@vuetify/v0 1.0.0-beta.0 → 1.0.0-beta.2

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 (154) hide show
  1. package/README.md +2 -1
  2. package/dist/{adapter-DZeI0ZbW.d.mts → adapter-CQoi3rdC.d.mts} +1 -1
  3. package/dist/adapter-CVoWg0sw.mjs +99 -0
  4. package/dist/{adapter-oM18AdUc.mjs → adapter-Cj7vxEdB.mjs} +6 -1
  5. package/dist/adapter-Cy7wXVFe.mjs +4 -0
  6. package/dist/{adapter-we-0GbFH.d.mts → adapter-D2ABPTpo.d.mts} +2 -2
  7. package/dist/{adapter-BO75n0Cn.d.mts → adapter-_srNCBEi.d.mts} +3 -3
  8. package/dist/browser/index.js +23639 -23267
  9. package/dist/components/index.d.mts +1 -1
  10. package/dist/components/index.mjs +1 -1
  11. package/dist/{components-_uxZ_Zo3.mjs → components-DcOwIGXt.mjs} +304 -214
  12. package/dist/composables/index.d.mts +20 -20
  13. package/dist/composables/index.mjs +34 -28
  14. package/dist/composables-DxKmYiTj.mjs +4077 -0
  15. package/dist/{consola-CUNHyu8J.d.mts → consola-BPGkJp_q.d.mts} +1 -1
  16. package/dist/constants/index.d.mts +1 -1
  17. package/dist/constants/index.mjs +1 -1
  18. package/dist/{createDataTable-DlFQyBTN.mjs → createDataTable-CBfnCUKU.mjs} +14 -11
  19. package/dist/{createGroup-DsKJMuRd.mjs → createGroup-BTG6xcyp.mjs} +26 -14
  20. package/dist/{adapter-BCVxBtDp.mjs → createPagination-B5dfqY-a.mjs} +3 -98
  21. package/dist/{createRegistry-tJ1PPNIr.mjs → createRegistry-Cb6ftNMU.mjs} +57 -41
  22. package/dist/{createSelection-DEqhvdoj.mjs → createSelection-BMvXj84C.mjs} +7 -4
  23. package/dist/{createSingle-ClzWqRCe.mjs → createSingle-BCUJuV4D.mjs} +3 -3
  24. package/dist/{createTokens-mNxs8DQ3.mjs → createTokens-BSSQAfNX.mjs} +12 -6
  25. package/dist/data-table/adapters/client/index.d.mts +1 -1
  26. package/dist/data-table/adapters/client/index.mjs +1 -1
  27. package/dist/data-table/adapters/index.d.mts +4 -4
  28. package/dist/data-table/adapters/index.mjs +4 -5
  29. package/dist/data-table/adapters/server/index.d.mts +1 -1
  30. package/dist/data-table/adapters/server/index.mjs +1 -1
  31. package/dist/data-table/adapters/virtual/index.d.mts +1 -1
  32. package/dist/data-table/adapters/virtual/index.mjs +1 -1
  33. package/dist/data-table/index.d.mts +5 -5
  34. package/dist/data-table/index.mjs +5 -5
  35. package/dist/date/index.d.mts +1 -1
  36. package/dist/date/index.mjs +36 -33
  37. package/dist/features/adapters/flagsmith/index.d.mts +1 -1
  38. package/dist/features/adapters/flagsmith/index.mjs +47 -1
  39. package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
  40. package/dist/features/adapters/launchdarkly/index.mjs +37 -1
  41. package/dist/features/adapters/posthog/index.d.mts +1 -1
  42. package/dist/features/adapters/posthog/index.mjs +46 -1
  43. package/dist/features/index.d.mts +2 -2
  44. package/dist/features/index.mjs +2 -2
  45. package/dist/{flagsmith-Cn_KVy6v.d.mts → flagsmith-CXzNBqm3.d.mts} +1 -1
  46. package/dist/{globals-DB-krEA-.mjs → globals-C1X-9O7K.mjs} +1 -1
  47. package/dist/{index-DWAgQOBa.d.mts → index-Bmz8PZMY.d.mts} +3 -4
  48. package/dist/{index-BN06veYe.d.mts → index-CKyDkh8J.d.mts} +169 -88
  49. package/dist/{index-B3PDLk_Y.d.mts → index-DLBPM47A.d.mts} +509 -439
  50. package/dist/{index-ZD3hw2Zo.d.mts → index-DRrHHgE7.d.mts} +4 -4
  51. package/dist/{index-ATZqco03.d.mts → index-LMiCHwZl.d.mts} +7 -2
  52. package/dist/{index-BIyQ3OxC.d.mts → index-rJ_lhMYJ.d.mts} +5 -5
  53. package/dist/index.d.mts +24 -24
  54. package/dist/index.mjs +37 -31
  55. package/dist/json/attributes.json +2 -2
  56. package/dist/json/web-types.json +3 -3
  57. package/dist/{launchdarkly-C3Knz7-v.d.mts → launchdarkly-DvhloBts.d.mts} +1 -1
  58. package/dist/locale/adapters/index.d.mts +2 -2
  59. package/dist/locale/adapters/index.mjs +2 -3
  60. package/dist/locale/adapters/v0/index.d.mts +1 -1
  61. package/dist/locale/adapters/v0/index.mjs +1 -1
  62. package/dist/locale/adapters/vue-i18n/index.d.mts +1 -1
  63. package/dist/locale/adapters/vue-i18n/index.mjs +1 -1
  64. package/dist/locale/index.d.mts +3 -3
  65. package/dist/locale/index.mjs +3 -3
  66. package/dist/logger/adapters/consola/index.d.mts +1 -1
  67. package/dist/logger/adapters/index.d.mts +4 -4
  68. package/dist/logger/adapters/index.mjs +1 -2
  69. package/dist/logger/adapters/pino/index.d.mts +1 -1
  70. package/dist/logger/adapters/v0/index.d.mts +1 -1
  71. package/dist/logger/adapters/v0/index.mjs +1 -1
  72. package/dist/logger/index.d.mts +5 -5
  73. package/dist/logger/index.mjs +2 -2
  74. package/dist/notifications/index.d.mts +6 -6
  75. package/dist/notifications/index.mjs +29 -29
  76. package/dist/palettes/ant/index.d.mts +1 -1
  77. package/dist/palettes/index.d.mts +3 -3
  78. package/dist/palettes/material/index.d.mts +1 -1
  79. package/dist/palettes/md1/index.d.mts +1 -1
  80. package/dist/palettes/md2/index.d.mts +1 -1
  81. package/dist/palettes/radix/index.d.mts +1 -1
  82. package/dist/palettes/tailwind/index.d.mts +1 -1
  83. package/dist/permissions/adapters/index.d.mts +1 -1
  84. package/dist/permissions/adapters/index.mjs +1 -2
  85. package/dist/permissions/adapters/v0/index.d.mts +1 -1
  86. package/dist/permissions/adapters/v0/index.mjs +1 -1
  87. package/dist/permissions/index.d.mts +1 -1
  88. package/dist/permissions/index.mjs +2 -2
  89. package/dist/{pino-BaYY_KIN.d.mts → pino-B6BI1AOK.d.mts} +1 -1
  90. package/dist/{posthog-CR8R2ywM.d.mts → posthog-BOT5W7Ds.d.mts} +1 -1
  91. package/dist/rules/index.d.mts +1 -1
  92. package/dist/rules/index.mjs +1 -1
  93. package/dist/{server-CZ83nTn_.mjs → server-D5BJBjB0.mjs} +2 -1
  94. package/dist/{server-7vjHxjNc.d.mts → server-DbtTGb67.d.mts} +1 -1
  95. package/dist/storage/adapters/index.d.mts +2 -2
  96. package/dist/storage/adapters/index.mjs +1 -1
  97. package/dist/storage/adapters/memory/index.d.mts +1 -1
  98. package/dist/storage/adapters/memory/index.mjs +1 -1
  99. package/dist/storage/index.d.mts +3 -3
  100. package/dist/storage/index.mjs +2 -2
  101. package/dist/theme/adapters/index.d.mts +1 -1
  102. package/dist/theme/adapters/index.mjs +3 -4
  103. package/dist/theme/adapters/unhead/index.d.mts +1 -1
  104. package/dist/theme/adapters/unhead/index.mjs +1 -1
  105. package/dist/theme/adapters/v0/index.d.mts +1 -1
  106. package/dist/theme/adapters/v0/index.mjs +1 -1
  107. package/dist/theme/index.d.mts +1 -1
  108. package/dist/theme/index.mjs +5 -4
  109. package/dist/types/index.d.mts +1 -1
  110. package/dist/{unhead-CG672gKh.mjs → unhead-i8ji788n.mjs} +12 -8
  111. package/dist/useEventListener-BK_uaXZv.mjs +103 -0
  112. package/dist/{useFeatures-B-A-eOo-.mjs → useFeatures-BKAK56af.mjs} +4 -8
  113. package/dist/{useLocale-CbpoxbVU.mjs → useLocale-CTwn8uZk.mjs} +4 -5
  114. package/dist/{useLogger-CTgAedNH.mjs → useLogger-D7_hm4e8.mjs} +2 -3
  115. package/dist/{useNotifications-BkKGUl_1.mjs → useNotifications-B2YeotHN.mjs} +15 -8
  116. package/dist/{usePermissions-BYOrKcnk.mjs → usePermissions-CWYXR7ji.mjs} +18 -11
  117. package/dist/{useClickOutside-DoOgNtrj.mjs → useRovingFocus-BdnSUVrD.mjs} +4014 -8138
  118. package/dist/{useRules-mD_DY9dy.mjs → useRules-CB2_tvd0.mjs} +2 -2
  119. package/dist/useStorage-BORz1d1g.mjs +162 -0
  120. package/dist/{useTheme-B1lUya5B.mjs → useTheme-ClUmdmvT.mjs} +12 -9
  121. package/dist/utilities/index.d.mts +2 -2
  122. package/dist/utilities/index.mjs +7 -3
  123. package/dist/{v0-COaQncfZ.mjs → v0-A4GLojAr.mjs} +2 -1
  124. package/dist/{v0-Bx5Mi7qE.mjs → v0-BU39ZO4s.mjs} +21 -10
  125. package/dist/{v0-WzS4GAIp.d.mts → v0-D7NA38Vu.d.mts} +1 -1
  126. package/dist/{v0-CG9o3on7.mjs → v0-DL9JtgCO.mjs} +1 -1
  127. package/dist/{v0-QIjffi4E.d.mts → v0-DotXXGXU.d.mts} +1 -1
  128. package/dist/{v0-CHK79mZX.mjs → v0-SwedwC_b.mjs} +3 -4
  129. package/dist/{v0-DWZ_N2GG.d.mts → v0-rSxMW8FJ.d.mts} +1 -1
  130. package/dist/{virtual-CrgGA-o6.d.mts → virtual-C-NsLue0.d.mts} +1 -1
  131. package/dist/{virtual-UumJ2BQ9.mjs → virtual-DFvOoeG6.mjs} +2 -1
  132. package/package.json +10 -7
  133. package/dist/adapters-BHD1lc-K.mjs +0 -4
  134. package/dist/adapters-BYLWDmYl.mjs +0 -5
  135. package/dist/adapters-BxrTL8E3.mjs +0 -4
  136. package/dist/adapters-CBgBd7VE.mjs +0 -2
  137. package/dist/adapters-D64TORDu.mjs +0 -2
  138. package/dist/flagsmith-Cu93hUIF.mjs +0 -48
  139. package/dist/launchdarkly-CLGtJCsI.mjs +0 -38
  140. package/dist/posthog-B5s_KGhy.mjs +0 -47
  141. /package/dist/{adapter-BEJXp-ie.d.mts → adapter-BYzU4Ey5.d.mts} +0 -0
  142. /package/dist/{adapter-B6IrPwib.d.mts → adapter-C5F2huij.d.mts} +0 -0
  143. /package/dist/{adapter-BSKx9WQ7.mjs → adapter-CTsckKAR.mjs} +0 -0
  144. /package/dist/{adapter-D8zizQVP.mjs → adapter-bwZo7b5p.mjs} +0 -0
  145. /package/dist/{index-DHmuwBdv.d.mts → index-B9YmdGZ3.d.mts} +0 -0
  146. /package/dist/{index-PvkxPev3.d.mts → index-BgCkepP_.d.mts} +0 -0
  147. /package/dist/{index-BOn0AAue.d.mts → index-CROz1VSV.d.mts} +0 -0
  148. /package/dist/{index-H_hl6-4b.d.mts → index-DXMlYoiQ.d.mts} +0 -0
  149. /package/dist/{index-C6NnIuDv.d.mts → index-DidZKN6S.d.mts} +0 -0
  150. /package/dist/{index-CKKoxA9V.d.mts → index-FtE8MXJ_.d.mts} +0 -0
  151. /package/dist/{memory-BMpJcQjQ.mjs → memory-BJjkQzxs.mjs} +0 -0
  152. /package/dist/{memory-D-JbdKXg.d.mts → memory-DbyZeNjg.d.mts} +0 -0
  153. /package/dist/{toArray-CD2-OxAz.mjs → toArray-C89ZaEuF.mjs} +0 -0
  154. /package/dist/{v0-Dvu8fMl3.mjs → v0-UNyykD27.mjs} +0 -0
@@ -1,7 +1,7 @@
1
- import { t as IN_BROWSER } from "./globals-DB-krEA-.mjs";
1
+ import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
2
2
  import { isNull, isString } from "./utilities/index.mjs";
3
- import { t as ThemeAdapter } from "./adapter-oM18AdUc.mjs";
4
- import { onScopeDispose, watch } from "vue";
3
+ import { t as ThemeAdapter } from "./adapter-Cj7vxEdB.mjs";
4
+ import { watch } from "vue";
5
5
  //#region src/composables/useTheme/adapters/unhead.ts
6
6
  /**
7
7
  * @module useTheme/adapters/unhead
@@ -35,26 +35,30 @@ var V0UnheadThemeAdapter = class extends ThemeAdapter {
35
35
  let targetEl = null;
36
36
  if (!/* @__PURE__ */ isNull(target)) targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
37
37
  if (targetEl && context.selectedId.value) targetEl.dataset.theme = String(context.selectedId.value);
38
- onScopeDispose(watch([
38
+ const stopWatch = watch([
39
39
  context.colors,
40
40
  context.isDark,
41
41
  context.selectedId
42
42
  ], ([colors, isDark, id]) => {
43
43
  const themeStr = id ? String(id) : "";
44
44
  if (targetEl && themeStr && targetEl.dataset.theme !== themeStr) targetEl.dataset.theme = themeStr;
45
- this.entry?.patch({
45
+ this.entry?.patch?.({
46
46
  htmlAttrs: { "data-theme": themeStr },
47
47
  style: [{
48
48
  innerHTML: this.generate(colors, isDark),
49
49
  id: this.stylesheetId
50
50
  }]
51
51
  });
52
- }), true);
53
- }
52
+ });
53
+ this.dispose = () => {
54
+ stopWatch();
55
+ this.entry?.dispose?.();
56
+ };
57
+ } else this.dispose = () => this.entry?.dispose?.();
54
58
  }
55
59
  update(colors, isDark) {
56
60
  if (!this.entry) return;
57
- this.entry.patch({ style: [{
61
+ this.entry.patch?.({ style: [{
58
62
  innerHTML: this.generate(colors, isDark),
59
63
  id: this.stylesheetId
60
64
  }] });
@@ -0,0 +1,103 @@
1
+ import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
2
+ import { t as toArray } from "./toArray-C89ZaEuF.mjs";
3
+ import { onScopeDispose, toValue, unref, watch } from "vue";
4
+ //#region src/composables/useEventListener/index.ts
5
+ /**
6
+ * @module useEventListener
7
+ *
8
+ * @see https://0.vuetifyjs.com/composables/system/use-event-listener
9
+ *
10
+ * @remarks
11
+ * Event listener composable with automatic cleanup on scope disposal.
12
+ *
13
+ * Key features:
14
+ * - Supports Window, Document, and HTMLElement targets
15
+ * - Reactive targets, events, and listeners
16
+ * - Event options support (capture, passive, once)
17
+ * - Automatic removeEventListener on unmount
18
+ * - Multiple overloads for type safety
19
+ *
20
+ * Perfect for safely managing event listeners in Vue components.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { useEventListener } from '@vuetify/v0'
25
+ *
26
+ * useEventListener(window, 'resize', () => {
27
+ * console.log('window resized')
28
+ * })
29
+ * ```
30
+ */
31
+ /**
32
+ * Attaches an event listener to a target.
33
+ *
34
+ * @param target The target to attach the event listener to.
35
+ * @param event The event to listen for.
36
+ * @param listener The event listener.
37
+ * @param options The event listener options.
38
+ * @returns A function to remove the event listener.
39
+ *
40
+ * @see https://0.vuetifyjs.com/composables/system/use-event-listener
41
+ */
42
+ function useEventListener(target, event, listener, options) {
43
+ const cleanups = [];
44
+ function cleanup() {
45
+ for (const fn of cleanups) fn();
46
+ cleanups.length = 0;
47
+ }
48
+ function register(el, event, listener, options) {
49
+ el.addEventListener(event, listener, options);
50
+ return () => el.removeEventListener(event, listener, options);
51
+ }
52
+ const stopWatcher = watch(() => [
53
+ toValue(target),
54
+ toValue(event),
55
+ unref(listener),
56
+ toValue(options)
57
+ ], ([el, events, listeners, opts]) => {
58
+ cleanup();
59
+ if (!el) return;
60
+ const eventList = /* @__PURE__ */ toArray(events);
61
+ const listenerList = /* @__PURE__ */ toArray(listeners);
62
+ for (const event of eventList) for (const listenerFn of listenerList) cleanups.push(register(el, event, listenerFn, opts));
63
+ }, {
64
+ immediate: true,
65
+ flush: "post"
66
+ });
67
+ function stop() {
68
+ stopWatcher();
69
+ cleanup();
70
+ }
71
+ onScopeDispose(stop, true);
72
+ return stop;
73
+ }
74
+ /**
75
+ * Attaches an event listener to the window.
76
+ *
77
+ * @param event The event to listen for.
78
+ * @param listener The event listener.
79
+ * @param options The event listener options.
80
+ * @template E The event type.
81
+ * @returns A function to remove the event listener.
82
+ *
83
+ * @see https://0.vuetifyjs.com/composables/system/use-event-listener
84
+ */
85
+ function useWindowEventListener(event, listener, options) {
86
+ return IN_BROWSER ? useEventListener(window, event, listener, options) : () => {};
87
+ }
88
+ /**
89
+ * Attaches an event listener to the document.
90
+ *
91
+ * @param event The event to listen for.
92
+ * @param listener The event listener.
93
+ * @param options The event listener options.
94
+ * @template E The event type.
95
+ * @returns A function to remove the event listener.
96
+ *
97
+ * @see https://0.vuetifyjs.com/composables/system/use-event-listener
98
+ */
99
+ function useDocumentEventListener(event, listener, options) {
100
+ return IN_BROWSER ? useEventListener(document, event, listener, options) : () => {};
101
+ }
102
+ //#endregion
103
+ export { useEventListener as n, useWindowEventListener as r, useDocumentEventListener as t };
@@ -1,10 +1,7 @@
1
1
  import { isArray, isBoolean, isFunction, isObject } from "./utilities/index.mjs";
2
- import { o as createPluginContext } from "./useLogger-CTgAedNH.mjs";
3
- import { t as createTokens } from "./createTokens-mNxs8DQ3.mjs";
4
- import { t as createGroup } from "./createGroup-DsKJMuRd.mjs";
5
- import "./flagsmith-Cu93hUIF.mjs";
6
- import "./launchdarkly-CLGtJCsI.mjs";
7
- import "./posthog-B5s_KGhy.mjs";
2
+ import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
3
+ import { t as createTokens } from "./createTokens-BSSQAfNX.mjs";
4
+ import { t as createGroup } from "./createGroup-BTG6xcyp.mjs";
8
5
  //#region src/composables/useFeatures/index.ts
9
6
  /**
10
7
  * @module useFeatures
@@ -46,8 +43,7 @@ import "./posthog-B5s_KGhy.mjs";
46
43
  * ```ts
47
44
  * import { createFeatures } from '@vuetify/v0'
48
45
  *
49
- * const [useFeatures, provideFeaturesContext, context] = createFeatures({
50
- * namespace: 'v0:features',
46
+ * const features = createFeatures({
51
47
  * features: {
52
48
  * 'dark-mode': true,
53
49
  * 'theme-color': { $variation: 'blue' },
@@ -1,8 +1,7 @@
1
- import { o as createPluginContext } from "./useLogger-CTgAedNH.mjs";
2
- import { t as createSingle } from "./createSingle-ClzWqRCe.mjs";
3
- import { r as flatten, t as createTokens } from "./createTokens-mNxs8DQ3.mjs";
4
- import { t as V0LocaleAdapter } from "./v0-CHK79mZX.mjs";
5
- import "./adapters-CBgBd7VE.mjs";
1
+ import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
2
+ import { t as createSingle } from "./createSingle-BCUJuV4D.mjs";
3
+ import { r as flatten, t as createTokens } from "./createTokens-BSSQAfNX.mjs";
4
+ import { t as V0LocaleAdapter } from "./v0-SwedwC_b.mjs";
6
5
  //#region src/composables/useLocale/index.ts
7
6
  /**
8
7
  * @module useLocale
@@ -1,8 +1,7 @@
1
- import { s as __LOGGER_ENABLED__, t as IN_BROWSER } from "./globals-DB-krEA-.mjs";
1
+ import { s as __LOGGER_ENABLED__, t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
2
2
  import { isNullOrUndefined, isUndefined } from "./utilities/index.mjs";
3
3
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
4
- import { t as V0LoggerAdapter } from "./v0-CG9o3on7.mjs";
5
- import "./adapters-BxrTL8E3.mjs";
4
+ import { t as V0LoggerAdapter } from "./v0-DL9JtgCO.mjs";
6
5
  import { hasInjectionContext, inject, watch } from "vue";
7
6
  //#region src/composables/createPlugin/index.ts
8
7
  /**
@@ -1,8 +1,8 @@
1
- import { t as IN_BROWSER } from "./globals-DB-krEA-.mjs";
1
+ import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
2
2
  import { isFunction, isNull, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
3
3
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
4
- import { o as createPluginContext } from "./useLogger-CTgAedNH.mjs";
5
- import { t as createRegistry } from "./createRegistry-tJ1PPNIr.mjs";
4
+ import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
5
+ import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
6
6
  import { onScopeDispose, shallowRef, toValue } from "vue";
7
7
  //#region src/composables/useTimer/index.ts
8
8
  /**
@@ -188,9 +188,9 @@ function useTimer(handler, options = {}) {
188
188
  *
189
189
  * @example
190
190
  * ```ts
191
- * import { useQueue } from '@vuetify/v0'
191
+ * import { createQueue } from '@vuetify/v0'
192
192
  *
193
- * const queue = useQueue()
193
+ * const queue = createQueue()
194
194
  *
195
195
  * // Register an ticket with default timeout (3000ms)
196
196
  * const ticket1 = queue.register({ value: 'Ticket 1' })
@@ -376,10 +376,10 @@ function useQueue(namespace = "v0:queue") {
376
376
  * notifications.send({ subject: 'Saved', severity: 'success' })
377
377
  * ```
378
378
  */
379
- function createNotifications(options = {}) {
380
- const { timeout = 3e3, ...registryOptions } = options;
379
+ function createNotifications(_options = {}) {
380
+ const { timeout = 3e3, ...options } = _options;
381
381
  const registry = createRegistry({
382
- ...registryOptions,
382
+ ...options,
383
383
  events: true,
384
384
  reactive: true
385
385
  });
@@ -548,6 +548,7 @@ function createNotifications(options = {}) {
548
548
  * ```
549
549
  */
550
550
  function read(id) {
551
+ if (!registry.has(id)) return;
551
552
  registry.upsert(id, { readAt: /* @__PURE__ */ new Date() }, "notification:read");
552
553
  }
553
554
  /**
@@ -568,6 +569,7 @@ function createNotifications(options = {}) {
568
569
  * ```
569
570
  */
570
571
  function unread(id) {
572
+ if (!registry.has(id)) return;
571
573
  registry.upsert(id, { readAt: null }, "notification:unread");
572
574
  }
573
575
  /**
@@ -591,6 +593,7 @@ function createNotifications(options = {}) {
591
593
  * ```
592
594
  */
593
595
  function seen(id) {
596
+ if (!registry.has(id)) return;
594
597
  registry.upsert(id, { seenAt: /* @__PURE__ */ new Date() }, "notification:seen");
595
598
  }
596
599
  /**
@@ -611,6 +614,7 @@ function createNotifications(options = {}) {
611
614
  * ```
612
615
  */
613
616
  function archive(id) {
617
+ if (!registry.has(id)) return;
614
618
  registry.upsert(id, { archivedAt: /* @__PURE__ */ new Date() }, "notification:archived");
615
619
  }
616
620
  /**
@@ -631,6 +635,7 @@ function createNotifications(options = {}) {
631
635
  * ```
632
636
  */
633
637
  function unarchive(id) {
638
+ if (!registry.has(id)) return;
634
639
  registry.upsert(id, { archivedAt: null }, "notification:unarchived");
635
640
  }
636
641
  /**
@@ -655,6 +660,7 @@ function createNotifications(options = {}) {
655
660
  * ```
656
661
  */
657
662
  function snooze(id, until) {
663
+ if (!registry.has(id)) return;
658
664
  registry.upsert(id, { snoozedUntil: until }, "notification:snoozed");
659
665
  }
660
666
  /**
@@ -675,6 +681,7 @@ function createNotifications(options = {}) {
675
681
  * ```
676
682
  */
677
683
  function wake(id) {
684
+ if (!registry.has(id)) return;
678
685
  registry.upsert(id, { snoozedUntil: null }, "notification:unsnoozed");
679
686
  }
680
687
  /**
@@ -1,8 +1,8 @@
1
- import { o as createPluginContext } from "./useLogger-CTgAedNH.mjs";
2
- import { t as createTokens } from "./createTokens-mNxs8DQ3.mjs";
3
- import { t as toArray } from "./toArray-CD2-OxAz.mjs";
4
- import { t as V0PermissionsAdapter } from "./v0-Dvu8fMl3.mjs";
5
- import "./adapters-D64TORDu.mjs";
1
+ import { UNSAFE_KEYS } from "./utilities/index.mjs";
2
+ import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
3
+ import { t as createTokens } from "./createTokens-BSSQAfNX.mjs";
4
+ import { t as toArray } from "./toArray-C89ZaEuF.mjs";
5
+ import { t as V0PermissionsAdapter } from "./v0-UNyykD27.mjs";
6
6
  //#region src/composables/usePermissions/index.ts
7
7
  /**
8
8
  * @module usePermissions
@@ -43,8 +43,7 @@ import "./adapters-D64TORDu.mjs";
43
43
  * ```ts
44
44
  * import { createPermissions } from '@vuetify/v0'
45
45
  *
46
- * const [usePermissions, providePermissions] = createPermissions({
47
- * namespace: 'v0:permissions',
46
+ * const permissions = createPermissions({
48
47
  * permissions: {
49
48
  * admin: [['read', 'users']],
50
49
  * editor: [['edit', 'posts']],
@@ -56,10 +55,15 @@ function createPermissions(_options = {}) {
56
55
  const { adapter = new V0PermissionsAdapter(), permissions = {}, ...options } = _options;
57
56
  const record = {};
58
57
  for (const role in permissions) {
58
+ if (UNSAFE_KEYS.has(role)) continue;
59
59
  if (!record[role]) record[role] = {};
60
- for (const [actions, subjects, condition = true] of permissions[role]) for (const action of /* @__PURE__ */ toArray(actions)) for (const subject of /* @__PURE__ */ toArray(subjects)) {
61
- if (!record[role][action]) record[role][action] = {};
62
- record[role][action][subject] = condition;
60
+ for (const [actions, subjects, condition = true] of permissions[role]) for (const action of /* @__PURE__ */ toArray(actions)) {
61
+ if (UNSAFE_KEYS.has(action)) continue;
62
+ for (const subject of /* @__PURE__ */ toArray(subjects)) {
63
+ if (UNSAFE_KEYS.has(subject)) continue;
64
+ if (!record[role][action]) record[role][action] = {};
65
+ record[role][action][subject] = condition;
66
+ }
63
67
  }
64
68
  }
65
69
  const tokens = createTokens(record, options);
@@ -68,7 +72,10 @@ function createPermissions(_options = {}) {
68
72
  }
69
73
  return {
70
74
  ...tokens,
71
- can
75
+ can,
76
+ get size() {
77
+ return tokens.size;
78
+ }
72
79
  };
73
80
  }
74
81
  /**