@pisell/pisellos 2.0.67 → 2.1.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 (96) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -4
  3. package/dist/effects/index.js +6 -15
  4. package/dist/modules/AccountList/index.d.ts +1 -7
  5. package/dist/modules/AccountList/index.js +14 -81
  6. package/dist/modules/AccountList/types.d.ts +0 -28
  7. package/dist/modules/AccountList/types.js +0 -8
  8. package/dist/modules/Cart/utils/changePrice.d.ts +2 -2
  9. package/dist/modules/Cart/utils/changePrice.js +1 -1
  10. package/dist/modules/ProductList/index.d.ts +3 -14
  11. package/dist/modules/ProductList/index.js +33 -67
  12. package/dist/modules/ProductList/types.d.ts +0 -1
  13. package/dist/modules/Rules/index.js +14 -27
  14. package/dist/modules/Rules/types.d.ts +0 -1
  15. package/dist/modules/index.d.ts +0 -1
  16. package/dist/modules/index.js +0 -1
  17. package/dist/plugins/window.d.ts +0 -1
  18. package/dist/solution/BookingByStep/index.js +50 -34
  19. package/dist/solution/BookingByStep/types.d.ts +3 -2
  20. package/dist/solution/BookingByStep/utils/resources.js +12 -4
  21. package/dist/solution/BuyTickets/index.d.ts +2 -2
  22. package/dist/solution/BuyTickets/index.js +1 -1
  23. package/dist/solution/ShopDiscount/index.js +2 -4
  24. package/dist/solution/index.d.ts +0 -1
  25. package/dist/solution/index.js +0 -1
  26. package/dist/types/index.d.ts +1 -3
  27. package/lib/core/index.js +1 -1
  28. package/lib/effects/index.d.ts +3 -4
  29. package/lib/effects/index.js +1 -4
  30. package/lib/modules/AccountList/index.d.ts +1 -7
  31. package/lib/modules/AccountList/index.js +0 -27
  32. package/lib/modules/AccountList/types.d.ts +0 -28
  33. package/lib/modules/Cart/utils/changePrice.d.ts +2 -2
  34. package/lib/modules/Cart/utils/changePrice.js +1 -1
  35. package/lib/modules/ProductList/index.d.ts +3 -14
  36. package/lib/modules/ProductList/index.js +14 -54
  37. package/lib/modules/ProductList/types.d.ts +0 -1
  38. package/lib/modules/Rules/index.js +12 -20
  39. package/lib/modules/Rules/types.d.ts +0 -1
  40. package/lib/modules/index.d.ts +0 -1
  41. package/lib/modules/index.js +0 -2
  42. package/lib/plugins/window.d.ts +0 -1
  43. package/lib/solution/BookingByStep/index.js +39 -27
  44. package/lib/solution/BookingByStep/types.d.ts +3 -2
  45. package/lib/solution/BookingByStep/utils/resources.js +12 -4
  46. package/lib/solution/BuyTickets/index.d.ts +2 -2
  47. package/lib/solution/BuyTickets/index.js +1 -1
  48. package/lib/solution/ShopDiscount/index.js +1 -2
  49. package/lib/solution/index.d.ts +0 -1
  50. package/lib/solution/index.js +0 -2
  51. package/lib/types/index.d.ts +1 -3
  52. package/package.json +1 -1
  53. package/dist/modules/Customer/constants.d.ts +0 -7
  54. package/dist/modules/Customer/constants.js +0 -12
  55. package/dist/modules/Customer/index.d.ts +0 -122
  56. package/dist/modules/Customer/index.js +0 -697
  57. package/dist/modules/Customer/types.d.ts +0 -146
  58. package/dist/modules/Customer/types.js +0 -41
  59. package/dist/solution/BookingTicket/index.d.ts +0 -172
  60. package/dist/solution/BookingTicket/index.js +0 -665
  61. package/dist/solution/BookingTicket/types.d.ts +0 -68
  62. package/dist/solution/BookingTicket/types.js +0 -43
  63. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  64. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  65. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  66. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
  67. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  68. package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
  69. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  70. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  71. package/dist/utils/task.d.ts +0 -40
  72. package/dist/utils/task.js +0 -171
  73. package/dist/utils/watch.d.ts +0 -102
  74. package/dist/utils/watch.js +0 -294
  75. package/lib/modules/Customer/constants.d.ts +0 -7
  76. package/lib/modules/Customer/constants.js +0 -39
  77. package/lib/modules/Customer/index.d.ts +0 -122
  78. package/lib/modules/Customer/index.js +0 -440
  79. package/lib/modules/Customer/types.d.ts +0 -146
  80. package/lib/modules/Customer/types.js +0 -37
  81. package/lib/solution/BookingTicket/index.d.ts +0 -172
  82. package/lib/solution/BookingTicket/index.js +0 -399
  83. package/lib/solution/BookingTicket/types.d.ts +0 -68
  84. package/lib/solution/BookingTicket/types.js +0 -72
  85. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  86. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  87. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  88. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
  89. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  90. package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
  91. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  92. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  93. package/lib/utils/task.d.ts +0 -40
  94. package/lib/utils/task.js +0 -109
  95. package/lib/utils/watch.d.ts +0 -102
  96. package/lib/utils/watch.js +0 -217
@@ -1,217 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/utils/watch.ts
20
- var watch_exports = {};
21
- __export(watch_exports, {
22
- default: () => watch_default
23
- });
24
- module.exports = __toCommonJS(watch_exports);
25
- var Watch = class {
26
- constructor() {
27
- // 监听列表
28
- this.events = /* @__PURE__ */ new Map();
29
- // 启用列表 - 使用数组保持顺序
30
- this.enableListMap = /* @__PURE__ */ new Map();
31
- }
32
- /**
33
- * 订阅事件
34
- * @param event 事件名称
35
- * @param callback 回调函数
36
- * @returns 订阅对象,可用于取消订阅
37
- */
38
- subscribe(watchKey, event) {
39
- if (!this.events.has(watchKey)) {
40
- this.events.set(watchKey, /* @__PURE__ */ new Map());
41
- }
42
- const callbacks = this.events.get(watchKey);
43
- callbacks.set(event.key, event.callback);
44
- this.enableEvent(watchKey, event.key);
45
- return {
46
- // 取消订阅
47
- unsubscribe: () => {
48
- this.unsubscribe(watchKey, event);
49
- }
50
- };
51
- }
52
- /**
53
- * 启用事件
54
- * @param watchKey 监听的key
55
- * @param event 事件名称
56
- */
57
- enableEvent(watchKey, eventKey) {
58
- const enableList = this.enableListMap.get(watchKey);
59
- if (enableList) {
60
- if (enableList.includes(eventKey)) {
61
- return;
62
- }
63
- enableList.push(eventKey);
64
- } else {
65
- this.enableListMap.set(watchKey, [eventKey]);
66
- }
67
- }
68
- /**
69
- * 禁用某个事件
70
- * @param watchKey 监听的key
71
- * @param eventKey 事件名称
72
- */
73
- disableEvent(watchKey, eventKey) {
74
- const enableList = this.enableListMap.get(watchKey);
75
- if (enableList) {
76
- const index = enableList.indexOf(eventKey);
77
- if (index !== -1) {
78
- enableList.splice(index);
79
- }
80
- }
81
- }
82
- /**
83
- * 冻结某个监听下的所有事件
84
- * @param watchKey 监听的key
85
- */
86
- disabledAllEventByWatchKey(watchKey) {
87
- this.enableListMap.set(watchKey, []);
88
- }
89
- /**
90
- * 启用某个监听下的所有事件
91
- * @param watchKey 监听的key
92
- */
93
- enableAllEventByWatchKey(watchKey) {
94
- var _a;
95
- this.enableListMap.set(
96
- watchKey,
97
- Array.from(((_a = this.events.get(watchKey)) == null ? void 0 : _a.keys()) || [])
98
- );
99
- }
100
- /**
101
- * 取消订阅事件
102
- * @param event 事件名称
103
- * @param callback 回调函数
104
- * @returns 是否成功取消订阅
105
- */
106
- unsubscribe(watchKey, event) {
107
- const callbacks = this.events.get(watchKey);
108
- if (!callbacks) {
109
- return;
110
- }
111
- this.disableEvent(watchKey, event.key);
112
- callbacks.delete(event.key);
113
- return;
114
- }
115
- /**
116
- * 发布事件
117
- * @param event 事件名称
118
- * @param args 事件参数
119
- */
120
- publish(watchKey, ...args) {
121
- var _a;
122
- const callbacks = this.events.get(watchKey);
123
- if (!callbacks) {
124
- return;
125
- }
126
- const enableList = this.enableListMap.get(watchKey);
127
- if (!enableList || enableList.length === 0) {
128
- return;
129
- }
130
- const lastCallbackKey = enableList.at(-1);
131
- if (lastCallbackKey) {
132
- try {
133
- (_a = callbacks.get(lastCallbackKey)) == null ? void 0 : _a(...args);
134
- } catch (error) {
135
- console.error(`执行事件"${watchKey}"的回调时出错:`, error);
136
- }
137
- }
138
- }
139
- /**
140
- * 根据事件名称发布事件
141
- * @param watchKey 监听的key
142
- * @param eventKey 事件名称
143
- * @param args 事件参数
144
- */
145
- publishByEventKey(watchKey, eventKey, ...args) {
146
- var _a;
147
- const callbacks = this.events.get(watchKey);
148
- if (!callbacks) {
149
- return;
150
- }
151
- (_a = callbacks.get(eventKey)) == null ? void 0 : _a(...args);
152
- }
153
- /**
154
- * 获取最后一个启用的事件
155
- * @param watchKey 监听的key
156
- * @returns 最后一个启用的事件
157
- */
158
- getLastEnableEventKey(watchKey) {
159
- const enableList = this.enableListMap.get(watchKey);
160
- console.log("enableList", enableList);
161
- if (!enableList) {
162
- return void 0;
163
- }
164
- return enableList.at(-1) || void 0;
165
- }
166
- /**
167
- * 移除某个事件的所有订阅
168
- * @param event 事件名称
169
- * @returns 是否成功移除
170
- */
171
- clearEvent(watchKey) {
172
- this.disabledAllEventByWatchKey(watchKey);
173
- this.events.delete(watchKey);
174
- }
175
- /**
176
- * 移除所有事件订阅
177
- */
178
- clearAllEvents() {
179
- this.events.clear();
180
- this.enableListMap.clear();
181
- }
182
- /**
183
- * 获取事件的订阅数量
184
- * @param event 事件名称
185
- * @returns 订阅数量
186
- */
187
- getSubscriberCount(event) {
188
- const callbacks = this.events.get(event);
189
- return callbacks ? callbacks.size : 0;
190
- }
191
- /**
192
- * 检查事件是否有订阅者
193
- * @param event 事件名称
194
- * @returns 是否有订阅者
195
- */
196
- hasSubscribers(event) {
197
- return this.getSubscriberCount(event) > 0;
198
- }
199
- /**
200
- * 一次性订阅事件,事件触发后自动取消订阅
201
- * @param event 事件名称
202
- * @param callback 回调函数
203
- * @returns 订阅对象,可用于取消订阅
204
- */
205
- once(watchKey, event) {
206
- const wrappedCallback = (...args) => {
207
- this.unsubscribe(watchKey, { key: event.key, callback: wrappedCallback });
208
- event.callback(...args);
209
- };
210
- return this.subscribe(watchKey, {
211
- key: event.key,
212
- callback: wrappedCallback
213
- });
214
- }
215
- };
216
- var watch = new Watch();
217
- var watch_default = watch;