@pubinfo/core 2.1.0 → 2.1.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 (67) hide show
  1. package/dist/{AppSetting-Dzj6YBgW.js → AppSetting-CmT5_15W.js} +15 -15
  2. package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-OWv01eXk.js → HCheckList.vue_vue_type_script_setup_true_lang-CHzkJth7.js} +1 -1
  3. package/dist/{HToggle-BnESuuPG.js → HToggle-DpDYLh8y.js} +1 -1
  4. package/dist/HeaderThinMenu-D6jF8yl1.js +4 -0
  5. package/dist/{PreferencesContent-DBKQJ8Ob.js → PreferencesContent-AXqWatOF.js} +4 -4
  6. package/dist/{SettingBreadcrumb-DmP1nJLZ.js → SettingBreadcrumb-CBWdS_nO.js} +3 -3
  7. package/dist/{SettingCopyright-C8_F7BB2.js → SettingCopyright-D5Jhdu1J.js} +2 -2
  8. package/dist/{SettingEnableTransition-BeJMq6ny.js → SettingEnableTransition-DQJozSZH.js} +2 -2
  9. package/dist/{SettingHome-yGmbxzJm.js → SettingHome-DAwn9Ypx.js} +2 -2
  10. package/dist/{SettingMenu-yWnqZqmz.js → SettingMenu-DEQRAtWl.js} +3 -3
  11. package/dist/{SettingMode-B8fgUhvi.js → SettingMode-bh3I8UBZ.js} +1 -1
  12. package/dist/{SettingNavSearch--yQEXqEL.js → SettingNavSearch-iYc-eRzY.js} +2 -2
  13. package/dist/{SettingOther-CSs1_D9L.js → SettingOther-C2TS6okv.js} +2 -2
  14. package/dist/{SettingPage-Pm7KblGG.js → SettingPage-B2_SNyn5.js} +2 -2
  15. package/dist/{SettingTabbar-DM5hdlQf.js → SettingTabbar-BETdKJxz.js} +3 -3
  16. package/dist/{SettingThemes-DqygGgDK.js → SettingThemes-ComNCP3P.js} +12 -11
  17. package/dist/{SettingToolbar-BP-yWiKo.js → SettingToolbar-D0DTBbbb.js} +2 -2
  18. package/dist/{SettingTopbar-Dd_SXy2e.js → SettingTopbar-BcO5Hcxm.js} +3 -3
  19. package/dist/{SettingWidthMode-DOtJg5uB.js → SettingWidthMode-wzTMq96A.js} +1 -1
  20. package/dist/built-in/pinia-plugin/plugins/persist.d.ts +2 -2
  21. package/dist/built-in/pinia-plugin/plugins/persistedstate/index.d.ts +3 -0
  22. package/dist/built-in/pinia-plugin/plugins/persistedstate/persistedstate.d.ts +15 -0
  23. package/dist/built-in/pinia-plugin/plugins/persistedstate/types.d.ts +150 -0
  24. package/dist/built-in/pinia-plugin/plugins/persistedstate/utils.d.ts +17 -0
  25. package/dist/core/ctx.d.ts +1 -0
  26. package/dist/core/interface.d.ts +26 -1
  27. package/dist/core/utils/index.d.ts +2 -0
  28. package/dist/features/composables/index.d.ts +1 -0
  29. package/dist/features/composables/partyLogin.d.ts +7 -1
  30. package/dist/{index-npW0xuOi.js → index-6W8u4oWQ.js} +1 -1
  31. package/dist/{index-igxVB1m3.js → index-B9i7R1pn.js} +2 -2
  32. package/dist/{index-C88VclMA.js → index-BXLF9xfN.js} +16300 -15834
  33. package/dist/{index-CnbD4YWA.js → index-C5X0cH7a.js} +3 -3
  34. package/dist/{index--xVOZLmn.js → index-CMSPnrUx.js} +1 -1
  35. package/dist/index-DSKHePRb.js +4 -0
  36. package/dist/{index-D8kKHmiD.js → index-FATjHAwl.js} +1 -1
  37. package/dist/{index-BSTB6EhQ.js → index-_VKoUSGo.js} +1 -1
  38. package/dist/index.d.ts +2 -1
  39. package/dist/index.js +13 -12
  40. package/dist/{pick-l2RrF3SE.js → pick-BvMRfqim.js} +1 -1
  41. package/dist/utils/index.d.ts +0 -1
  42. package/package.json +9 -8
  43. package/src/built-in/pinia-plugin/index.ts +2 -2
  44. package/src/built-in/pinia-plugin/plugins/persist.ts +15 -4
  45. package/src/built-in/pinia-plugin/plugins/persistedstate/README.md +551 -0
  46. package/src/built-in/pinia-plugin/plugins/persistedstate/index.ts +3 -0
  47. package/src/built-in/pinia-plugin/plugins/persistedstate/persistedstate.ts +575 -0
  48. package/src/built-in/pinia-plugin/plugins/persistedstate/types.ts +162 -0
  49. package/src/built-in/pinia-plugin/plugins/persistedstate/utils.ts +46 -0
  50. package/src/core/ctx.ts +24 -1
  51. package/src/core/interface.ts +31 -1
  52. package/src/core/resolver/icon.ts +1 -1
  53. package/src/core/utils/index.ts +2 -0
  54. package/src/features/composables/index.ts +1 -0
  55. package/src/features/composables/partyLogin.ts +180 -38
  56. package/src/features/context/index.ts +1 -1
  57. package/src/index.ts +7 -5
  58. package/src/utils/index.ts +0 -1
  59. package/src/utils/proxy.ts +1 -1
  60. package/types/index.d.ts +1 -0
  61. package/types/pinia.d.ts +94 -0
  62. package/dist/HeaderThinMenu-Co2S6vIB.js +0 -4
  63. package/dist/index-GSKGoyv_.js +0 -4
  64. /package/dist/{utils → core/utils}/global.d.ts +0 -0
  65. /package/dist/core/{utils.d.ts → utils/utils.d.ts} +0 -0
  66. /package/src/{utils → core/utils}/global.ts +0 -0
  67. /package/src/core/{utils.ts → utils/utils.ts} +0 -0
@@ -0,0 +1,94 @@
1
+ import type { StateTree } from 'pinia';
2
+
3
+ /**
4
+ * 持久化选项类型
5
+ */
6
+ export type PersistenceOptions<State extends StateTree = StateTree> = Partial<{
7
+ /** 自定义存储键名 */
8
+ key: string
9
+ /** 存储实例 */
10
+ storage: {
11
+ getItem: (key: string) => string | null
12
+ setItem: (key: string, value: string) => void
13
+ }
14
+ /** 序列化器 */
15
+ serializer: {
16
+ serialize: (data: StateTree) => string
17
+ deserialize: (data: string) => StateTree
18
+ }
19
+ /** 是否开启调试模式 */
20
+ debug: boolean
21
+ /** 恢复数据前的钩子 */
22
+ beforeHydrate: (context: any) => void
23
+ /** 恢复数据后的钩子 */
24
+ afterHydrate: (context: any) => void
25
+ /** 要持久化的状态字段(白名单) */
26
+ pick: string[]
27
+ /** 不需要持久化的状态字段(黑名单) */
28
+ omit: string[]
29
+ /** 存储区域类型 */
30
+ storageArea: 'local' | 'session'
31
+ }>;
32
+
33
+ /**
34
+ * 扩展 Pinia 的 Store 类型定义
35
+ */
36
+ declare module 'pinia' {
37
+ /**
38
+ * 扩展 Store 实例,添加持久化相关方法
39
+ */
40
+ export interface Store<Id extends string = string, S extends StateTree = StateTree, G = Record<string, unknown>, A = Record<string, unknown>> {
41
+ /**
42
+ * 手动持久化当前状态到存储
43
+ */
44
+ $persist?: () => void
45
+
46
+ /**
47
+ * 手动从存储恢复状态
48
+ * @param options - 恢复选项
49
+ */
50
+ $hydrate?: (options?: { runHooks?: boolean }) => void
51
+ }
52
+
53
+ /**
54
+ * 扩展 DefineStoreOptionsInPlugin,添加 persist 选项支持
55
+ * 适用于 Options API 风格和插件系统
56
+ */
57
+ export interface DefineStoreOptionsInPlugin<Id extends string, S extends StateTree, G, A> {
58
+ /**
59
+ * 持久化配置
60
+ * - `true`: 启用默认持久化
61
+ * - `object`: 单个持久化配置
62
+ * - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
63
+ */
64
+ persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
65
+ }
66
+
67
+ /**
68
+ * 扩展 DefineSetupStoreOptions,添加 persist 选项支持
69
+ * 适用于 Setup 函数风格(defineStore 的第三个参数)
70
+ */
71
+ export interface DefineSetupStoreOptions<Id extends string, S extends StateTree, G, A> {
72
+ /**
73
+ * 持久化配置
74
+ * - `true`: 启用默认持久化
75
+ * - `object`: 单个持久化配置
76
+ * - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
77
+ */
78
+ persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
79
+ }
80
+
81
+ /**
82
+ * 扩展 DefineStoreOptions,添加 persist 选项支持
83
+ * 适用于 Options API 风格(defineStore 的第二个参数)
84
+ */
85
+ export interface DefineStoreOptions<Id extends string, S extends StateTree, G, A> {
86
+ /**
87
+ * 持久化配置
88
+ * - `true`: 启用默认持久化
89
+ * - `object`: 单个持久化配置
90
+ * - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
91
+ */
92
+ persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
93
+ }
94
+ }
@@ -1,4 +0,0 @@
1
- import { cE as f } from "./index-C88VclMA.js";
2
- export {
3
- f as default
4
- };
@@ -1,4 +0,0 @@
1
- import { cD as f } from "./index-C88VclMA.js";
2
- export {
3
- f as default
4
- };
File without changes
File without changes
File without changes
File without changes