@maas/vue-equipment 0.19.1 → 0.20.0

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 (61) 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.d.ts +1 -1
  28. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +1 -1
  29. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -1
  30. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -1
  31. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
  32. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  33. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  34. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  35. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  36. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  37. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  38. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  39. package/dist/plugins/MagicScroll/index.d.ts +1 -1
  40. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +1 -1
  41. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +1 -1
  42. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +1 -1
  43. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +1 -1
  44. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +1 -1
  45. package/dist/plugins/MagicToast/demo/DemoToast.vue.d.ts +1 -1
  46. package/dist/plugins/MagicToast/index.d.ts +1 -1
  47. package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +1 -1
  48. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +1 -1
  49. package/dist/plugins/index.d.ts +1 -1
  50. package/dist/plugins/index.mjs +1 -1
  51. package/package.json +1 -1
  52. package/dist/plugins/MagicConsent/index.d.ts +0 -8
  53. package/dist/plugins/MagicConsent/index.mjs +0 -9
  54. package/dist/plugins/MagicConsent/src/components/MagicConsent.vue +0 -118
  55. package/dist/plugins/MagicConsent/src/composables/useConsentApi.d.ts +0 -15
  56. package/dist/plugins/MagicConsent/src/composables/useConsentEmitter.d.ts +0 -15
  57. package/dist/plugins/MagicConsent/src/types/index.d.ts +0 -20
  58. package/dist/plugins/MagicDrawer/src/index.d.ts +0 -0
  59. package/dist/plugins/MagicDrawer/src/index.mjs +0 -0
  60. /package/dist/plugins/{MagicConsent → MagicCookie}/nuxt.d.ts +0 -0
  61. /package/dist/plugins/{MagicConsent → MagicCookie}/src/types/index.mjs +0 -0
@@ -1,13 +1,13 @@
1
1
  import { computed, ref } from "vue";
2
2
  import { useCookies } from "@vueuse/integrations/useCookies";
3
3
  import { toValue } from "@vueuse/core";
4
- import { globalApiState } from "./private/defineConsentApi.mjs";
5
- import { useConsentEmitter } from "./useConsentEmitter.mjs";
4
+ import { globalApiState } from "./private/defineCookieApi.mjs";
5
+ import { useCookieEmitter } from "./useCookieEmitter.mjs";
6
6
  const preferencesVisible = ref(false);
7
7
  const selectedCookies = ref({});
8
- export function useConsentApi() {
8
+ export function useCookieApi() {
9
9
  const universalCookies = useCookies(["cookie_consent"]);
10
- const cookieConsentData = computed({
10
+ const cookieConsent = computed({
11
11
  get: () => {
12
12
  return universalCookies.get("cookie_consent");
13
13
  },
@@ -17,8 +17,8 @@ export function useConsentApi() {
17
17
  });
18
18
  }
19
19
  });
20
- const emitter = useConsentEmitter();
21
- selectedCookies.value = cookieConsentData.value?.cookies || {};
20
+ const emitter = useCookieEmitter();
21
+ selectedCookies.value = cookieConsent.value?.cookies || {};
22
22
  function toggleSelection(key) {
23
23
  selectedCookies.value = {
24
24
  ...selectedCookies.value,
@@ -26,38 +26,32 @@ export function useConsentApi() {
26
26
  };
27
27
  }
28
28
  function accept() {
29
- const cookies = globalApiState.value?.cookies?.reduce(
30
- (result, cookie) => {
31
- result[cookie.key] = true;
32
- return result;
33
- },
34
- {}
35
- );
29
+ const cookies = globalApiState.value?.cookies?.reduce((result, cookie) => {
30
+ result[cookie.key] = true;
31
+ return result;
32
+ }, {});
36
33
  selectedCookies.value = cookies;
37
34
  const timestamp = (/* @__PURE__ */ new Date()).getTime();
38
- cookieConsentData.value = { timestamp, cookies };
39
- emitter.emit("accept", cookieConsentData.value);
35
+ cookieConsent.value = { timestamp, cookies };
36
+ emitter.emit("accept", cookieConsent.value);
40
37
  }
41
38
  function acceptSelected() {
42
39
  const timestamp = (/* @__PURE__ */ new Date()).getTime();
43
- cookieConsentData.value = {
40
+ cookieConsent.value = {
44
41
  timestamp,
45
42
  cookies: selectedCookies.value
46
43
  };
47
- emitter.emit("acceptSelected", cookieConsentData.value);
44
+ emitter.emit("acceptSelected", cookieConsent.value);
48
45
  }
49
46
  function reject() {
50
- const cookies = globalApiState.value?.cookies?.reduce(
51
- (result, cookie) => {
52
- result[cookie.key] = cookie.optional === false ? true : false;
53
- return result;
54
- },
55
- {}
56
- );
47
+ const cookies = globalApiState.value?.cookies?.reduce((result, cookie) => {
48
+ result[cookie.key] = cookie.optional === false ? true : false;
49
+ return result;
50
+ }, {});
57
51
  selectedCookies.value = cookies;
58
52
  const timestamp = (/* @__PURE__ */ new Date()).getTime();
59
- cookieConsentData.value = { timestamp, cookies };
60
- emitter.emit("reject", cookieConsentData.value);
53
+ cookieConsent.value = { timestamp, cookies };
54
+ emitter.emit("reject", cookieConsent.value);
61
55
  }
62
56
  function onAccept(handler) {
63
57
  emitter.on("accept", (args) => handler(toValue(args)));
@@ -74,7 +68,7 @@ export function useConsentApi() {
74
68
  return {
75
69
  preferencesVisible,
76
70
  selectedCookies,
77
- cookieConsentData,
71
+ cookieConsent,
78
72
  toggleSelection,
79
73
  accept,
80
74
  acceptSelected,
@@ -0,0 +1,15 @@
1
+ import type { CookieEvents } from '../types.js';
2
+ export declare function useCookieEmitter(): {
3
+ on: {
4
+ <Key extends keyof CookieEvents>(type: Key, handler: import("mitt").Handler<CookieEvents[Key]>): void;
5
+ (type: "*", handler: import("mitt").WildcardHandler<CookieEvents>): void;
6
+ };
7
+ off: {
8
+ <Key_1 extends keyof CookieEvents>(type: Key_1, handler?: import("mitt").Handler<CookieEvents[Key_1]> | undefined): void;
9
+ (type: "*", handler: import("mitt").WildcardHandler<CookieEvents>): void;
10
+ };
11
+ emit: {
12
+ <Key_2 extends keyof CookieEvents>(type: Key_2, event: CookieEvents[Key_2]): void;
13
+ <Key_3 extends keyof CookieEvents>(type: undefined extends CookieEvents[Key_3] ? Key_3 : never): void;
14
+ };
15
+ };
@@ -1,6 +1,6 @@
1
1
  import mitt from "mitt";
2
2
  const emitter = mitt();
3
- export function useConsentEmitter() {
3
+ export function useCookieEmitter() {
4
4
  return {
5
5
  on: emitter.on,
6
6
  off: emitter.off,
@@ -0,0 +1,20 @@
1
+ export type CookieApiDefinition = {
2
+ cookies: CookieRecord[];
3
+ maxAge?: number;
4
+ };
5
+ export type CookieRecord = {
6
+ key: string;
7
+ optional?: boolean;
8
+ title?: string;
9
+ text?: string;
10
+ [key: string]: any;
11
+ };
12
+ export type CookieConsent = {
13
+ timestamp: number | undefined;
14
+ cookies: Record<string, boolean>;
15
+ };
16
+ export type CookieEvents = {
17
+ accept: CookieConsent;
18
+ reject: CookieConsent;
19
+ acceptSelected: CookieConsent;
20
+ };
@@ -2,7 +2,7 @@ import MagicDrawer from './src/components/MagicDrawer.vue.js';
2
2
  import { useDrawerApi } from './src/composables/useDrawerApi.js';
3
3
  import { useDrawerEmitter } from './src/composables/useDrawerEmitter.js';
4
4
  import type { Plugin } from 'vue';
5
- import type { DrawerEvents } from './src/types.js';
5
+ import type { DrawerEvents } from './src/types/index.js';
6
6
  declare const MagicDrawerPlugin: Plugin;
7
7
  export { MagicDrawerPlugin, MagicDrawer, useDrawerApi, useDrawerEmitter };
8
8
  export type { DrawerEvents };
@@ -291,5 +291,5 @@ onBeforeUnmount(() => {
291
291
  </script>
292
292
 
293
293
  <style>
294
- :root{--magic-drawer-height:75svh;--magic-drawer-width:100%;--magic-drawer-z-index:999;--magic-drawer-justify-content:center;--magic-drawer-align-items:flex-end;--magic-drawer-backdrop-color:rgba(0,0,0,.5);--magic-drawer-backdrop-filter:unset;--magic-drawer-content-overflow-x:hidden;--magic-drawer-content-overflow-y:hidden;--magic-drawer-handle-wrapper-height:2rem;--magic-drawer-handle-width:3rem;--magic-drawer-handle-height:0.375rem;--magic-drawer-handle-color:#d4d4d8;--magic-drawer-handle-border-radius:0.25rem;--magic-drawer-enter-animation:slide-btt-in 300ms ease;--magic-drawer-leave-animation:slide-btt-out 300ms ease;--magic-drawer-drag-overshoot:4rem;--magic-drawer-drag-overshoot-x:0rem;--magic-drawer-drag-overshoot-y:0rem;--magic-drawer-padding:0rem}.magic-drawer{align-items:var(--magic-drawer-align-items);background:transparent;border:none;color:inherit;display:flex;height:100%;inset:0;justify-content:var(--magic-drawer-justify-content);padding:0;pointer-events:none;position:fixed;width:100%;z-index:var(--magic-drawer-z-index)}.magic-drawer.-bottom{--magic-drawer-drag-overshoot-y:var(--magic-drawer-drag-overshoot);--magic-drawer-padding:0 0 var(--magic-drawer-drag-overshoot-y) 0}.magic-drawer.-top{--magic-drawer-enter-animation:slide-ttb-in 300ms ease;--magic-drawer-leave-animation:slide-ttb-out 300ms ease;--magic-drawer-align-items:flex-start;--magic-drawer-drag-overshoot-y:calc(var(--magic-drawer-drag-overshoot)*-1);--magic-drawer-padding:var(--magic-drawer-drag-overshoot-y) 0 0 0}.magic-drawer.-right{--magic-drawer-enter-animation:slide-rtl-in 300ms ease;--magic-drawer-leave-animation:slide-rtl-out 300ms ease;--magic-drawer-align-items:center;--magic-drawer-justify-content:flex-end;--magic-drawer-drag-overshoot-x:var(--magic-drawer-drag-overshoot);--magic-drawer-padding:0 var(--magic-drawer-drag-overshoot-x) 0 0}.magic-drawer.-left{--magic-drawer-enter-animation:slide-ltr-in 300ms ease;--magic-drawer-leave-animation:slide-ltr-out 300ms ease;--magic-drawer-align-items:center;--magic-drawer-justify-content:flex-start;--magic-drawer-drag-overshoot-x:calc(var(--magic-drawer-drag-overshoot)*-1);--magic-drawer-padding:0 0 0 var(--magic-drawer-drag-overshoot-x)}.magic-drawer__wrapper{height:calc(var(--magic-drawer-height) + var(--magic-drawer-drag-overshoot-y));pointer-events:none;transform:translate(var(--magic-drawer-drag-overshoot-x),var(--magic-drawer-drag-overshoot-y));width:calc(var(--magic-drawer-width) + var(--magic-drawer-drag-overshoot-x))}.magic-drawer__content{height:100%;max-height:100%;position:relative;width:100%}.magic-drawer__drag{-webkit-overflow-scrolling:touch;align-items:var(--magic-drawer-align-items);cursor:grab;display:flex;height:100%;justify-content:var(--magic-drawer-justify-content);overflow-x:var(--magic-drawer-content-overflow-x);overflow-y:var(--magic-drawer-content-overflow-y);pointer-events:auto;position:relative;scroll-behavior:smooth;width:100%}.magic-drawer.-dragging .magic-drawer__drag{cursor:grabbing}.magic-drawer__drag>*{padding:var(--magic-drawer-padding)}.magic-drawer__overlay{inset:0;position:absolute;z-index:9999}.magic-drawer__backdrop{-webkit-backdrop-filter:var(--magic-drawer-backdrop-filter);backdrop-filter:var(--magic-drawer-backdrop-filter);background-color:var(--magic-drawer-backdrop-color);bottom:0;height:100%;left:0;pointer-events:auto;position:fixed;right:0;top:0;width:100%;z-index:-1}.magic-drawer--content-enter-active{animation:var(--magic-drawer-enter-animation)}.magic-drawer--content-leave-active{animation:var(--magic-drawer-leave-animation)}.magic-drawer--backdrop-enter-active{animation:fade-in .3s ease}.magic-drawer--backdrop-leave-active{animation:fade-out .3s ease}
294
+ :root{--magic-drawer-height:75svh;--magic-drawer-width:100%;--magic-drawer-z-index:999;--magic-drawer-justify-content:center;--magic-drawer-align-items:flex-end;--magic-drawer-backdrop-color:rgba(0,0,0,.5);--magic-drawer-backdrop-filter:unset;--magic-drawer-content-overflow-x:hidden;--magic-drawer-content-overflow-y:hidden;--magic-drawer-handle-wrapper-height:2rem;--magic-drawer-handle-width:3rem;--magic-drawer-handle-height:0.375rem;--magic-drawer-handle-color:#d4d4d8;--magic-drawer-handle-border-radius:0.25rem;--magic-drawer-enter-animation:slide-btt-in 300ms ease;--magic-drawer-leave-animation:slide-btt-out 300ms ease;--magic-drawer-drag-overshoot:4rem;--magic-drawer-drag-overshoot-x:0rem;--magic-drawer-drag-overshoot-y:0rem;--magic-drawer-padding:0rem}.magic-drawer{align-items:var(--magic-drawer-align-items);background:transparent;border:none;color:inherit;display:flex;height:100%;inset:0;justify-content:var(--magic-drawer-justify-content);padding:0;pointer-events:none;position:fixed;width:100%;z-index:var(--magic-drawer-z-index)}.magic-drawer.-bottom{--magic-drawer-drag-overshoot-y:var(--magic-drawer-drag-overshoot);--magic-drawer-padding:0 0 var(--magic-drawer-drag-overshoot-y) 0}.magic-drawer.-top{--magic-drawer-enter-animation:slide-ttb-in 300ms ease;--magic-drawer-leave-animation:slide-ttb-out 300ms ease;--magic-drawer-align-items:flex-start;--magic-drawer-drag-overshoot-y:calc(var(--magic-drawer-drag-overshoot)*-1);--magic-drawer-padding:var(--magic-drawer-drag-overshoot-y) 0 0 0}.magic-drawer.-right{--magic-drawer-enter-animation:slide-rtl-in 300ms ease;--magic-drawer-leave-animation:slide-rtl-out 300ms ease;--magic-drawer-align-items:center;--magic-drawer-justify-content:flex-end;--magic-drawer-drag-overshoot-x:var(--magic-drawer-drag-overshoot);--magic-drawer-padding:0 var(--magic-drawer-drag-overshoot-x) 0 0}.magic-drawer.-left{--magic-drawer-enter-animation:slide-ltr-in 300ms ease;--magic-drawer-leave-animation:slide-ltr-out 300ms ease;--magic-drawer-align-items:center;--magic-drawer-justify-content:flex-start;--magic-drawer-drag-overshoot-x:calc(var(--magic-drawer-drag-overshoot)*-1);--magic-drawer-padding:0 0 0 var(--magic-drawer-drag-overshoot-x)}.magic-drawer__wrapper{height:calc(var(--magic-drawer-height) + var(--magic-drawer-drag-overshoot-y));pointer-events:none;transform:translate(var(--magic-drawer-drag-overshoot-x),var(--magic-drawer-drag-overshoot-y));width:calc(var(--magic-drawer-width) + var(--magic-drawer-drag-overshoot-x))}.magic-drawer__content{height:100%;max-height:100%;position:relative;width:100%}.magic-drawer__drag{-webkit-overflow-scrolling:touch;align-items:var(--magic-drawer-align-items);cursor:grab;display:flex;height:100%;justify-content:var(--magic-drawer-justify-content);overflow-x:var(--magic-drawer-content-overflow-x);overflow-y:var(--magic-drawer-content-overflow-y);pointer-events:auto;position:relative;scroll-behavior:smooth;width:100%}.magic-drawer.-dragging .magic-drawer__drag{cursor:grabbing;-webkit-user-select:none;-moz-user-select:none;user-select:none}.magic-drawer__drag>*{padding:var(--magic-drawer-padding)}.magic-drawer__overlay{inset:0;position:absolute;z-index:9999}.magic-drawer__backdrop{-webkit-backdrop-filter:var(--magic-drawer-backdrop-filter);backdrop-filter:var(--magic-drawer-backdrop-filter);background-color:var(--magic-drawer-backdrop-color);bottom:0;height:100%;left:0;pointer-events:auto;position:fixed;right:0;top:0;width:100%;z-index:-1}.magic-drawer--content-enter-active{animation:var(--magic-drawer-enter-animation)}.magic-drawer--content-leave-active{animation:var(--magic-drawer-leave-animation)}.magic-drawer--backdrop-enter-active{animation:fade-in .3s ease}.magic-drawer--backdrop-leave-active{animation:fade-out .3s ease}
295
295
  </style>
@@ -19,7 +19,7 @@ interface MagicDrawerProps {
19
19
  }
20
20
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicDrawerProps>, {
21
21
  options: () => DrawerOptions;
22
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicDrawerProps>, {
22
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicDrawerProps>, {
23
23
  options: () => DrawerOptions;
24
24
  }>>>, {
25
25
  options: DrawerOptions;
@@ -9,7 +9,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
9
9
  playing: import("vue").Ref<boolean>;
10
10
  play: () => void;
11
11
  pause: () => void;
12
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
12
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
13
13
  direction: string;
14
14
  speed: number;
15
15
  }>>>, {
@@ -2,7 +2,7 @@ import MagicModal from './src/components/MagicModal.vue.js';
2
2
  import { useModalApi } from './src/composables/useModalApi.js';
3
3
  import { useModalEmitter } from './src/composables/useModalEmitter.js';
4
4
  import type { Plugin } from 'vue';
5
- import type { ModalEvents } from './src/types.js';
5
+ import type { ModalEvents } from './src/types/index.js';
6
6
  declare const MagicModalPlugin: Plugin;
7
7
  export { MagicModalPlugin, MagicModal, useModalEmitter, useModalApi };
8
8
  export type { ModalEvents };
@@ -11,7 +11,7 @@ interface MagicModalProps {
11
11
  }
12
12
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicModalProps>, {
13
13
  options: () => ModalOptions;
14
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicModalProps>, {
14
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicModalProps>, {
15
15
  options: () => ModalOptions;
16
16
  }>>>, {
17
17
  options: ModalOptions;
@@ -5,7 +5,7 @@ interface Props {
5
5
  }
6
6
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
7
7
  pause: boolean;
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
9
9
  pause: boolean;
10
10
  }>>>, {
11
11
  pause: boolean;
@@ -7,4 +7,4 @@ import MagicPlayerMuxPopover from './src/components/MagicPlayerMuxPopover.vue.js
7
7
  import { usePlayerApi } from './src/composables/usePlayerApi.js';
8
8
  declare const MagicPlayerPlugin: Plugin;
9
9
  export { MagicPlayerPlugin, MagicPlayer, MagicPlayerControls, MagicPlayerOverlay, MagicPlayerTimeline, MagicPlayerMuxPopover, usePlayerApi, };
10
- export type * from './src/types';
10
+ export type * from './src/types/index';
@@ -13,7 +13,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
13
13
  ratio: string;
14
14
  fill: boolean;
15
15
  autoplay: boolean;
16
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicPlayerProps>, {
16
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicPlayerProps>, {
17
17
  srcType: string;
18
18
  src: string;
19
19
  ratio: string;
@@ -1,7 +1,7 @@
1
1
  interface Props {
2
2
  id: string;
3
3
  }
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
5
5
  seekPopover?(_: {}): any;
6
6
  playIcon?(_: {}): any;
7
7
  pauseIcon?(_: {}): any;
@@ -2,7 +2,7 @@ type Props = {
2
2
  id: string;
3
3
  playbackId: string;
4
4
  };
5
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
5
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
6
6
  export default _default;
7
7
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
8
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,7 +1,7 @@
1
1
  interface Props {
2
2
  id: string;
3
3
  }
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
5
5
  waitingIcon?(_: {}): any;
6
6
  playIcon?(_: {}): any;
7
7
  pauseIcon?(_: {}): any;
@@ -1,7 +1,7 @@
1
1
  interface Props {
2
2
  id: string;
3
3
  }
4
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
5
5
  export default _default;
6
6
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
7
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
2
  export default _default;
@@ -11,4 +11,4 @@ import type { Plugin } from 'vue';
11
11
  declare const MagicScrollPlugin: Plugin;
12
12
  export { MagicScrollPlugin, MagicScrollProvider, MagicScrollScene, MagicScrollTransform, MagicScrollMotion, MagicScrollCollision, useCollisionEmitter, useScrollApi, useCollisionDetect, ScrollParentKey, ScrollPositionKey, ScrollProgressKey, };
13
13
  export * from './src/symbols.js';
14
- export type * from './src/types';
14
+ export type * from './src/types/index';
@@ -2,7 +2,7 @@ import type { CollisionEntry } from '../types';
2
2
  interface Props {
3
3
  collisionEntries: CollisionEntry[];
4
4
  }
5
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
5
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
6
6
  default?(_: {}): any;
7
7
  }>;
8
8
  export default _default;
@@ -8,7 +8,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
8
8
  keyframes: undefined;
9
9
  offset: undefined;
10
10
  easing: string;
11
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
11
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
12
12
  keyframes: undefined;
13
13
  offset: undefined;
14
14
  easing: string;
@@ -5,7 +5,7 @@ interface Props {
5
5
  }
6
6
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
7
7
  active: () => true;
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
9
9
  active: () => true;
10
10
  }>>>, {
11
11
  active: Boolean;
@@ -8,7 +8,7 @@ interface Props {
8
8
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
9
9
  from: string;
10
10
  to: string;
11
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
11
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
12
12
  from: string;
13
13
  to: string;
14
14
  }>>>, {
@@ -17,7 +17,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
17
17
  skewY: number;
18
18
  translateX: number;
19
19
  translateY: number;
20
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
20
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
21
21
  as: string;
22
22
  scale: number;
23
23
  scaleX: number;
@@ -3,7 +3,7 @@ interface Props {
3
3
  }
4
4
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  close: (...args: any[]) => void;
6
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
6
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
7
7
  onClose?: ((...args: any[]) => any) | undefined;
8
8
  }, {}, {}>;
9
9
  export default _default;
@@ -2,7 +2,7 @@ import MagicToast from './src/components/MagicToast.vue.js';
2
2
  import { useToastApi } from './src/composables/useToastApi.js';
3
3
  import { useToastEmitter } from './src/composables/useToastEmitter.js';
4
4
  import type { Plugin } from 'vue';
5
- import type { ToastEvents } from './src/types.js';
5
+ import type { ToastEvents } from './src/types/index.js';
6
6
  declare const MagicToastPlugin: Plugin;
7
7
  export { MagicToastPlugin, MagicToast, useToastApi, useToastEmitter };
8
8
  export type { ToastEvents };
@@ -10,7 +10,7 @@ interface MagicToastProps {
10
10
  class: MaybeRef<string>;
11
11
  options?: ToastOptions;
12
12
  }
13
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<MagicToastProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MagicToastProps>>>, {}, {}>;
13
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<MagicToastProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MagicToastProps>>>, {}, {}>;
14
14
  export default _default;
15
15
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
16
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -7,7 +7,7 @@ interface Props {
7
7
  }
8
8
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
9
  mouseenter: (event: Event) => void;
10
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
11
11
  onMouseenter?: ((event: Event) => any) | undefined;
12
12
  }, {}, {}>, {
13
13
  default?(_: {}): any;
@@ -1,4 +1,4 @@
1
- export * from './MagicConsent/index.js';
1
+ export * from './MagicCookie/index.js';
2
2
  export * from './MagicDrawer/index.js';
3
3
  export * from './MagicMarquee/index.js';
4
4
  export * from './MagicModal/index.js';
@@ -1,4 +1,4 @@
1
- export * from "./MagicConsent/index.mjs";
1
+ export * from "./MagicCookie/index.mjs";
2
2
  export * from "./MagicDrawer/index.mjs";
3
3
  export * from "./MagicMarquee/index.mjs";
4
4
  export * from "./MagicModal/index.mjs";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "A magic collection of Vue composables, plugins, components and directives",
4
- "version": "0.19.1",
4
+ "version": "0.20.0",
5
5
  "author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
6
6
  "devDependencies": {
7
7
  "@antfu/ni": "^0.21.12",
@@ -1,8 +0,0 @@
1
- import type { Plugin } from 'vue';
2
- import MagicConsent from './src/components/MagicConsent.vue.js';
3
- import { useConsentApi } from './src/composables/useConsentApi.js';
4
- import { useConsentEmitter } from './src/composables/useConsentEmitter.js';
5
- import type { ConsentEvents } from './src/types.js';
6
- declare const MagicConsentPlugin: Plugin;
7
- export { MagicConsentPlugin, MagicConsent, useConsentApi, useConsentEmitter };
8
- export type { ConsentEvents };
@@ -1,9 +0,0 @@
1
- import MagicConsent from "./src/components/MagicConsent.vue";
2
- import { useConsentApi } from "./src/composables/useConsentApi.mjs";
3
- import { useConsentEmitter } from "./src/composables/useConsentEmitter.mjs";
4
- const MagicConsentPlugin = {
5
- install: (app) => {
6
- app.component("MagicConsent", MagicConsent);
7
- }
8
- };
9
- export { MagicConsentPlugin, MagicConsent, useConsentApi, useConsentEmitter };
@@ -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>