@maas/vue-equipment 0.19.1 → 0.20.1

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.
Files changed (62) hide show
  1. package/dist/composables/index.d.mts +2 -2
  2. package/dist/composables/index.d.ts +2 -2
  3. package/dist/composables/index.js.map +1 -1
  4. package/dist/composables/index.mjs.map +1 -1
  5. package/dist/nuxt/module.json +1 -1
  6. package/dist/nuxt/module.mjs +10 -10
  7. package/dist/plugins/MagicCookie/index.d.ts +8 -0
  8. package/dist/plugins/MagicCookie/index.mjs +9 -0
  9. package/dist/plugins/{MagicConsent → MagicCookie}/nuxt.mjs +7 -7
  10. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +118 -0
  11. package/dist/plugins/{MagicConsent/src/components/MagicConsent.vue.d.ts → MagicCookie/src/components/MagicCookie.vue.d.ts} +4 -4
  12. package/dist/plugins/{MagicConsent/src/composables/private/defineConsentApi.d.ts → MagicCookie/src/composables/private/defineCookieApi.d.ts} +2 -2
  13. package/dist/plugins/{MagicConsent/src/composables/private/defineConsentApi.mjs → MagicCookie/src/composables/private/defineCookieApi.mjs} +12 -10
  14. package/dist/plugins/MagicCookie/src/composables/useCookieApi.d.ts +15 -0
  15. package/dist/plugins/{MagicConsent/src/composables/useConsentApi.mjs → MagicCookie/src/composables/useCookieApi.mjs} +21 -27
  16. package/dist/plugins/MagicCookie/src/composables/useCookieEmitter.d.ts +15 -0
  17. package/dist/plugins/{MagicConsent/src/composables/useConsentEmitter.mjs → MagicCookie/src/composables/useCookieEmitter.mjs} +1 -1
  18. package/dist/plugins/MagicCookie/src/types/index.d.ts +20 -0
  19. package/dist/plugins/MagicDrawer/index.d.ts +1 -1
  20. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +1 -1
  21. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +1 -1
  22. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +1 -1
  23. package/dist/plugins/MagicModal/index.d.ts +1 -1
  24. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +1 -1
  25. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -1
  26. package/dist/plugins/MagicPlayer/index.d.ts +1 -1
  27. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +9 -3
  28. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +1 -1
  29. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +1 -1
  30. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -1
  31. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -1
  32. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
  33. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  34. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  35. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  36. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  37. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  38. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  39. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  40. package/dist/plugins/MagicScroll/index.d.ts +1 -1
  41. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +1 -1
  42. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +1 -1
  43. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +1 -1
  44. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +1 -1
  45. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +1 -1
  46. package/dist/plugins/MagicToast/demo/DemoToast.vue.d.ts +1 -1
  47. package/dist/plugins/MagicToast/index.d.ts +1 -1
  48. package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +1 -1
  49. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +1 -1
  50. package/dist/plugins/index.d.ts +1 -1
  51. package/dist/plugins/index.mjs +1 -1
  52. package/package.json +1 -1
  53. package/dist/plugins/MagicConsent/index.d.ts +0 -8
  54. package/dist/plugins/MagicConsent/index.mjs +0 -9
  55. package/dist/plugins/MagicConsent/src/components/MagicConsent.vue +0 -118
  56. package/dist/plugins/MagicConsent/src/composables/useConsentApi.d.ts +0 -15
  57. package/dist/plugins/MagicConsent/src/composables/useConsentEmitter.d.ts +0 -15
  58. package/dist/plugins/MagicConsent/src/types/index.d.ts +0 -20
  59. package/dist/plugins/MagicDrawer/src/index.d.ts +0 -0
  60. package/dist/plugins/MagicDrawer/src/index.mjs +0 -0
  61. /package/dist/plugins/{MagicConsent → MagicCookie}/nuxt.d.ts +0 -0
  62. /package/dist/plugins/{MagicConsent → MagicCookie}/src/types/index.mjs +0 -0
@@ -1,118 +0,0 @@
1
- <template>
2
- <client-only>
3
- <div class="magic-consent">
4
- <div class="magic-consent__container">
5
- <div class="magic-consent__body">
6
- <slot />
7
- <div v-show="preferencesVisible" class="magic-consent__preferences">
8
- <ul class="magic-consent__cookies">
9
- <li
10
- v-for="cookie in cookies"
11
- :key="cookie.key"
12
- class="magic-consent__cookie"
13
- >
14
- <div class="magic-consent-checkbox">
15
- <input
16
- :id="cookie.key"
17
- type="checkbox"
18
- :checked="
19
- cookie.optional === false
20
- ? true
21
- : selectedCookies[cookie.key]
22
- "
23
- @change="toggleSelection(cookie.key)"
24
- :disabled="cookie.optional === false"
25
- />
26
- </div>
27
- <div>
28
- <slot :name="cookie.key" :cookie="cookie">
29
- <div class="magic-consent__cookie__content">
30
- <div class="magic-consent__cookie__title">
31
- <span v-text="cookie.title" />
32
- </div>
33
- <div
34
- v-if="cookie.text"
35
- class="magic-consent__cookie__text"
36
- v-html="cookie.text"
37
- />
38
- </div>
39
- </slot>
40
- </div>
41
- </li>
42
- </ul>
43
- </div>
44
- </div>
45
- <div class="magic-consent__footer">
46
- <slot name="actions">
47
- <div class="magic-consent__actions">
48
- <template v-if="preferencesVisible">
49
- <button
50
- class="magic-consent-button -secondary"
51
- @click="preferencesVisible = !preferencesVisible"
52
- >
53
- Close
54
- </button>
55
- <button
56
- class="magic-consent-button -secondary"
57
- @click="acceptSelected"
58
- >
59
- Accept selected
60
- </button>
61
- </template>
62
- <template v-else>
63
- <button
64
- class="magic-consent-button -secondary"
65
- @click="preferencesVisible = true"
66
- >
67
- Preferences
68
- </button>
69
- <button class="magic-consent-button -secondary" @click="reject">
70
- Reject
71
- </button>
72
- </template>
73
- <button class="magic-consent-button -primary" @click="accept">
74
- Accept
75
- </button>
76
- </div>
77
- </slot>
78
- </div>
79
- </div>
80
- </div>
81
- </client-only>
82
- </template>
83
-
84
- <script lang="ts" setup>
85
- import { defineConsentApi } from '../composables/private/defineConsentApi'
86
- import { useConsentApi } from '../composables/useConsentApi'
87
- import type { ConsentCookieRecord } from '../types'
88
-
89
- // Define the props and their default values
90
- type Props = {
91
- cookies: ConsentCookieRecord[]
92
- maxAge?: number
93
- }
94
-
95
- const props = withDefaults(defineProps<Props>(), {
96
- maxAge: 60 * 60 * 24 * 30,
97
- })
98
-
99
- // Initialize the Consent API
100
- defineConsentApi({
101
- cookies: props.cookies,
102
- maxAge: props.maxAge,
103
- })
104
-
105
- // Use the Consent API
106
- const {
107
- preferencesVisible,
108
- selectedCookies,
109
- accept,
110
- acceptSelected,
111
- reject,
112
- toggleSelection,
113
- } = useConsentApi()
114
- </script>
115
-
116
- <style>
117
- :root{--magic-consent-max-width:480px;--magic-consent-max-height:calc(100vh - 2rem);--magic-consent-background-color:rgba(75,75,75,.5);--magic-consent-backdrop-filter:blur(32px);--magic-consent-color:#fff;--magic-consent-border-radius:0;--magic-consent-box-shadow:none;--magic-consent-preferences-mask:linear-gradient(0deg,hsla(0,0%,100%,0),#fff 1.5rem);--magic-consent-checkbox-size:0.875rem;--magic-consent-checkbox-border-width:1px;--magic-consent-checkbox-border-color:currentColor;--magic-consent-checkbox-border-radius:0;--magic-consent-button-width:auto;--magic-consent-button-height:2.5rem;--magic-consent-button-spacing:1rem;--magic-consent-button-border-width:1px;--magic-consent-button-border-radius:0.25rem;--magic-consent-button-backdrop-filter:none;--magic-consent-button-primary-color:#000;--magic-consent-button-primary-background-color:#fff;--magic-consent-button-primary-border-color:transparent;--magic-consent-button-secondary-color:#fff;--magic-consent-button-secondary-background-color:transparent;--magic-consent-button-secondary-border-color:transparent}.magic-consent{backdrop-filter:var(--magic-consent-backdrop-filter);-webkit-backdrop-filter:var(--magic-consent-backdrop-filter);background-color:var(--magic-consent-background-color);border-radius:var(--magic-consent-border-radius);box-shadow:var(--magic-consent-box-shadow);color:var(--magic-consent-color);max-width:var(--magic-consent-max-width);overflow:hidden}.magic-consent,.magic-consent__container{display:flex;flex-direction:column;width:100%}.magic-consent__container{max-height:var(--magic-consent-max-height)}.magic-consent__body{display:flex;flex-direction:column;gap:1rem;height:100%;mask:var(--magic-consent-preferences-mask);-webkit-mask:var(--magic-consent-preferences-mask);overflow-y:scroll;padding:1rem;width:100%;-webkit-overflow-scrolling:touch;scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none}.magic-consent__body::-webkit-scrollbar{display:none}.magic-consent__footer{padding:1rem;width:100%}.magic-consent__preferences{flex-direction:column;height:100%}.magic-consent__actions,.magic-consent__preferences{display:flex;gap:1rem;width:100%}ul.magic-consent__cookies{display:flex;flex-direction:column;gap:1rem;list-style:none;margin:0;padding:0}li.magic-consent__cookie{align-items:flex-start;display:flex;gap:1rem;margin:0;padding:0}.magic-consent__cookie__content{align-items:flex-start;display:flex;flex-direction:column;gap:.25rem}.magic-consent__cookie__title{display:inline-flex}.magic-consent__cookie__text{white-space:pre-line}.magic-consent-checkbox{align-items:center;display:flex;gap:.625rem}.magic-consent-checkbox input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:var(--magic-consent-checkbox-border-width) var(--magic-consent-checkbox-border-color) solid;border-radius:var(--magic-consent-checkbox-border-radius);cursor:pointer;flex-shrink:0;height:var(--magic-consent-checkbox-size);position:relative;vertical-align:middle;width:var(--magic-consent-checkbox-size)}.magic-consent-checkbox input[type=checkbox]:checked:after{background-color:var(--magic-consent-checkbox-border-color);border-radius:var(--magic-consent-checkbox-border-radius);content:"";display:block;height:calc(var(--magic-consent-checkbox-size)/2);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(var(--magic-consent-checkbox-size)/2)}.magic-consent-checkbox:disabled{cursor:not-allowed}.magic-consent-button{align-items:center;backdrop-filter:var(--magic-consent-button-backdrop-filter);-webkit-backdrop-filter:var(--magic-consent-button-backdrop-filter);border:var(--magic-consent-button-border-width) solid;border-radius:var(--magic-consent-button-border-radius);display:inline-flex;gap:var(--magic-consent-button-spacing);height:var(--magic-consent-button-height);justify-content:center;padding:0 var(--magic-consent-button-spacing);width:var(--magic-consent-button-width)}.magic-consent-button.-primary{background-color:var(--magic-consent-button-primary-background-color);border-color:var(--magic-consent-button-primary-border-color);color:var(--magic-consent-button-primary-color)}.magic-consent-button.-secondary{background-color:var(--magic-consent-button-secondary-background-color);border-color:var(--magic-consent-button-secondary-border-color);color:var(--magic-consent-button-secondary-color)}
118
- </style>
@@ -1,15 +0,0 @@
1
- import type { CookieConsentData } from '../types.js';
2
- export declare function useConsentApi(): {
3
- preferencesVisible: import("vue").Ref<boolean>;
4
- selectedCookies: import("vue").Ref<{
5
- [key: string]: boolean;
6
- }>;
7
- cookieConsentData: import("vue").WritableComputedRef<CookieConsentData>;
8
- toggleSelection: (key: string) => void;
9
- accept: () => void;
10
- acceptSelected: () => void;
11
- reject: () => void;
12
- onAccept: (handler: (args: CookieConsentData) => void) => void;
13
- onAcceptSelected: (handler: (args: CookieConsentData) => void) => void;
14
- onReject: (handler: (args: CookieConsentData) => void) => void;
15
- };
@@ -1,15 +0,0 @@
1
- import type { ConsentEvents } from '../types.js';
2
- export declare function useConsentEmitter(): {
3
- on: {
4
- <Key extends keyof ConsentEvents>(type: Key, handler: import("mitt").Handler<ConsentEvents[Key]>): void;
5
- (type: "*", handler: import("mitt").WildcardHandler<ConsentEvents>): void;
6
- };
7
- off: {
8
- <Key_1 extends keyof ConsentEvents>(type: Key_1, handler?: import("mitt").Handler<ConsentEvents[Key_1]> | undefined): void;
9
- (type: "*", handler: import("mitt").WildcardHandler<ConsentEvents>): void;
10
- };
11
- emit: {
12
- <Key_2 extends keyof ConsentEvents>(type: Key_2, event: ConsentEvents[Key_2]): void;
13
- <Key_3 extends keyof ConsentEvents>(type: undefined extends ConsentEvents[Key_3] ? Key_3 : never): void;
14
- };
15
- };
@@ -1,20 +0,0 @@
1
- export type ConsentApiDefinition = {
2
- cookies: ConsentCookieRecord[];
3
- maxAge?: number;
4
- };
5
- export type ConsentCookieRecord = {
6
- key: string;
7
- optional?: boolean;
8
- title?: string;
9
- text?: string;
10
- [key: string]: any;
11
- };
12
- export type CookieConsentData = {
13
- timestamp: number | undefined;
14
- cookies: Record<string, boolean>;
15
- };
16
- export type ConsentEvents = {
17
- accept: CookieConsentData;
18
- reject: CookieConsentData;
19
- acceptSelected: CookieConsentData;
20
- };
File without changes
File without changes