@rytass/bpm-core-react 0.7.7 → 0.9.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 (155) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +18 -2
  3. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs +3 -0
  4. package/dist/chunks/FormBuilderView-BPLwAJGv.cjs.map +1 -0
  5. package/dist/chunks/FormBuilderView-Do9-MIAe.js +1477 -0
  6. package/dist/chunks/FormBuilderView-Do9-MIAe.js.map +1 -0
  7. package/dist/chunks/FormRendererView-C5POZbWz.js +492 -0
  8. package/dist/chunks/FormRendererView-C5POZbWz.js.map +1 -0
  9. package/dist/chunks/FormRendererView-DNtNodNl.cjs +2 -0
  10. package/dist/chunks/FormRendererView-DNtNodNl.cjs.map +1 -0
  11. package/dist/chunks/{approval-instance-list-page-YZcGGDD8.js → approval-instance-list-page-BjX2kaoF.js} +56 -54
  12. package/dist/chunks/approval-instance-list-page-BjX2kaoF.js.map +1 -0
  13. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs +2 -0
  14. package/dist/chunks/approval-instance-list-page-C408vxE2.cjs.map +1 -0
  15. package/dist/chunks/{categories-DBPoSrsi.js → categories-DGlxuC6X.js} +5 -5
  16. package/dist/chunks/{categories-DBPoSrsi.js.map → categories-DGlxuC6X.js.map} +1 -1
  17. package/dist/chunks/{categories-B6QZKZRt.cjs → categories-DUfldZ_9.cjs} +2 -2
  18. package/dist/chunks/{categories-B6QZKZRt.cjs.map → categories-DUfldZ_9.cjs.map} +1 -1
  19. package/dist/chunks/compose-CULMDsLS.cjs +2 -0
  20. package/dist/chunks/compose-CULMDsLS.cjs.map +1 -0
  21. package/dist/chunks/{compose-B1quUa7y.js → compose-DJBlA5PD.js} +60 -58
  22. package/dist/chunks/compose-DJBlA5PD.js.map +1 -0
  23. package/dist/chunks/{delegations-DDEk-WI6.cjs → delegations-CGj-tZNO.cjs} +2 -2
  24. package/dist/chunks/{delegations-DDEk-WI6.cjs.map → delegations-CGj-tZNO.cjs.map} +1 -1
  25. package/dist/chunks/{delegations-iVnRi3QE.js → delegations-DLEEFBlH.js} +231 -231
  26. package/dist/chunks/{delegations-iVnRi3QE.js.map → delegations-DLEEFBlH.js.map} +1 -1
  27. package/dist/chunks/{delegations-ZNtodFaD.js → delegations-DqMpI_Nk.js} +168 -167
  28. package/dist/chunks/delegations-DqMpI_Nk.js.map +1 -0
  29. package/dist/chunks/delegations-kbMOSEif.cjs +2 -0
  30. package/dist/chunks/delegations-kbMOSEif.cjs.map +1 -0
  31. package/dist/chunks/designer-BszXJ5RO.js +3038 -0
  32. package/dist/chunks/designer-BszXJ5RO.js.map +1 -0
  33. package/dist/chunks/designer-CmqAU92b.cjs +65 -0
  34. package/dist/chunks/designer-CmqAU92b.cjs.map +1 -0
  35. package/dist/chunks/detail-CDexqBoU.cjs +2 -0
  36. package/dist/chunks/detail-CDexqBoU.cjs.map +1 -0
  37. package/dist/chunks/{detail-fg8MTwuH.js → detail-DAak2OXS.js} +737 -653
  38. package/dist/chunks/detail-DAak2OXS.js.map +1 -0
  39. package/dist/chunks/notifications--hwl-DR0.cjs +2 -0
  40. package/dist/chunks/{notifications-BKs4--96.cjs.map → notifications--hwl-DR0.cjs.map} +1 -1
  41. package/dist/chunks/{notifications-CSulztkU.js → notifications-DJ5wzCye.js} +7 -7
  42. package/dist/chunks/{notifications-CSulztkU.js.map → notifications-DJ5wzCye.js.map} +1 -1
  43. package/dist/chunks/{orgs-CrNxqlwp.js → orgs-DytLvZ_X.js} +243 -241
  44. package/dist/chunks/{orgs-CrNxqlwp.js.map → orgs-DytLvZ_X.js.map} +1 -1
  45. package/dist/chunks/orgs-Ni22buHs.cjs +2 -0
  46. package/dist/chunks/orgs-Ni22buHs.cjs.map +1 -0
  47. package/dist/chunks/providers-DEqcuXw9.js +506 -0
  48. package/dist/chunks/providers-DEqcuXw9.js.map +1 -0
  49. package/dist/chunks/providers-D_zTbkQH.cjs +2 -0
  50. package/dist/chunks/providers-D_zTbkQH.cjs.map +1 -0
  51. package/dist/chunks/{users-qghSMtLn.cjs → users-0HqlM_VQ.cjs} +2 -2
  52. package/dist/chunks/{users-qghSMtLn.cjs.map → users-0HqlM_VQ.cjs.map} +1 -1
  53. package/dist/chunks/{users-CUY139DF.js → users-FWrb3ehW.js} +5 -5
  54. package/dist/chunks/{users-CUY139DF.js.map → users-FWrb3ehW.js.map} +1 -1
  55. package/dist/components/notification-drawer.d.ts +4 -3
  56. package/dist/index.cjs +1 -1
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +21 -428
  59. package/dist/index.js.map +1 -1
  60. package/dist/next/index.cjs +1 -1
  61. package/dist/next/index.cjs.map +1 -1
  62. package/dist/next/index.js +16 -15
  63. package/dist/next/index.js.map +1 -1
  64. package/dist/pages/admin/delegations/index.cjs +1 -1
  65. package/dist/pages/admin/delegations/index.js +1 -1
  66. package/dist/pages/admin/orgs/index.cjs +1 -1
  67. package/dist/pages/admin/orgs/index.js +1 -1
  68. package/dist/pages/admin/users/index.cjs +1 -1
  69. package/dist/pages/admin/users/index.js +1 -1
  70. package/dist/pages/delegations/index.cjs +1 -1
  71. package/dist/pages/delegations/index.js +1 -1
  72. package/dist/pages/instances/detail/index.cjs +1 -1
  73. package/dist/pages/instances/detail/index.js +1 -1
  74. package/dist/pages/settings/notifications/index.cjs +1 -1
  75. package/dist/pages/settings/notifications/index.js +1 -1
  76. package/dist/pages/templates/categories/index.cjs +1 -1
  77. package/dist/pages/templates/categories/index.js +1 -1
  78. package/dist/pages/templates/compose/index.cjs +1 -1
  79. package/dist/pages/templates/compose/index.js +1 -1
  80. package/dist/pages/templates/designer/index.cjs +1 -1
  81. package/dist/pages/templates/designer/index.js +1 -1
  82. package/dist/views/admin/delegations/index.cjs +1 -1
  83. package/dist/views/admin/delegations/index.js +1 -1
  84. package/dist/views/admin/index.cjs +1 -1
  85. package/dist/views/admin/index.js +3 -3
  86. package/dist/views/admin/orgs/index.cjs +1 -1
  87. package/dist/views/admin/orgs/index.js +1 -1
  88. package/dist/views/admin/users/index.cjs +1 -1
  89. package/dist/views/admin/users/index.js +1 -1
  90. package/dist/views/cc/index.cjs +1 -1
  91. package/dist/views/cc/index.js +1 -1
  92. package/dist/views/delegations/index.cjs +1 -1
  93. package/dist/views/delegations/index.js +1 -1
  94. package/dist/views/forms/builder/index.cjs +1 -1
  95. package/dist/views/forms/builder/index.js +1 -1
  96. package/dist/views/forms/renderer/FormRendererView.d.ts +7 -2
  97. package/dist/views/forms/renderer/form-data-source-field.d.ts +34 -0
  98. package/dist/views/forms/renderer/index.cjs +1 -1
  99. package/dist/views/forms/renderer/index.d.ts +1 -0
  100. package/dist/views/forms/renderer/index.js +2 -2
  101. package/dist/views/instances/detail/index.cjs +1 -1
  102. package/dist/views/instances/detail/index.js +1 -1
  103. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +4 -1
  104. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +5 -1
  105. package/dist/views/instances/new/index.cjs +1 -1
  106. package/dist/views/instances/new/index.cjs.map +1 -1
  107. package/dist/views/instances/new/index.js +105 -86
  108. package/dist/views/instances/new/index.js.map +1 -1
  109. package/dist/views/search/index.cjs +1 -1
  110. package/dist/views/search/index.js +1 -1
  111. package/dist/views/sent/index.cjs +1 -1
  112. package/dist/views/sent/index.js +1 -1
  113. package/dist/views/settings/index.cjs +1 -1
  114. package/dist/views/settings/index.js +1 -1
  115. package/dist/views/settings/notifications/index.cjs +1 -1
  116. package/dist/views/settings/notifications/index.js +1 -1
  117. package/dist/views/templates/categories/index.cjs +1 -1
  118. package/dist/views/templates/categories/index.js +1 -1
  119. package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +3 -2
  120. package/dist/views/templates/compose/index.cjs +1 -1
  121. package/dist/views/templates/compose/index.js +1 -1
  122. package/dist/views/templates/designer/index.cjs +1 -1
  123. package/dist/views/templates/designer/index.js +1 -1
  124. package/dist/views/templates/index.cjs +1 -1
  125. package/dist/views/templates/index.cjs.map +1 -1
  126. package/dist/views/templates/index.js +153 -112
  127. package/dist/views/templates/index.js.map +1 -1
  128. package/package.json +41 -5
  129. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +0 -3
  130. package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +0 -1
  131. package/dist/chunks/FormBuilderView-D8DrQOXD.js +0 -1090
  132. package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +0 -1
  133. package/dist/chunks/FormRendererView-BwVsH2eX.cjs +0 -2
  134. package/dist/chunks/FormRendererView-BwVsH2eX.cjs.map +0 -1
  135. package/dist/chunks/FormRendererView-DrHsuSVo.js +0 -220
  136. package/dist/chunks/FormRendererView-DrHsuSVo.js.map +0 -1
  137. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs +0 -2
  138. package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs.map +0 -1
  139. package/dist/chunks/approval-instance-list-page-YZcGGDD8.js.map +0 -1
  140. package/dist/chunks/compose-B1quUa7y.js.map +0 -1
  141. package/dist/chunks/compose-B6nevcwq.cjs +0 -2
  142. package/dist/chunks/compose-B6nevcwq.cjs.map +0 -1
  143. package/dist/chunks/delegations-C2wLWsDQ.cjs +0 -2
  144. package/dist/chunks/delegations-C2wLWsDQ.cjs.map +0 -1
  145. package/dist/chunks/delegations-ZNtodFaD.js.map +0 -1
  146. package/dist/chunks/designer-BLfz5Dk9.js +0 -2594
  147. package/dist/chunks/designer-BLfz5Dk9.js.map +0 -1
  148. package/dist/chunks/designer-DP002lt7.cjs +0 -65
  149. package/dist/chunks/designer-DP002lt7.cjs.map +0 -1
  150. package/dist/chunks/detail-KEmfpCtt.cjs +0 -2
  151. package/dist/chunks/detail-KEmfpCtt.cjs.map +0 -1
  152. package/dist/chunks/detail-fg8MTwuH.js.map +0 -1
  153. package/dist/chunks/notifications-BKs4--96.cjs +0 -2
  154. package/dist/chunks/orgs-iNJ0QEcK.cjs +0 -2
  155. package/dist/chunks/orgs-iNJ0QEcK.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -2,458 +2,51 @@
2
2
  import { n as e, r as t, t as n } from "./chunks/router-adapter-DftlFTOd.js";
3
3
  import { n as r, t as i } from "./chunks/auth-provider-B5oPmvk2.js";
4
4
  import { t as a } from "./chunks/format-date-time-CB-LxzqT.js";
5
- import { n as o, r as s, t as c } from "./chunks/routes-config-RBYQtUd0.js";
6
- import { a as l, i as u, n as d, o as f, r as ee, t as p } from "./chunks/admin-pickers-DLlG_1du.js";
7
- import { t as m } from "./chunks/approval-instance-list-page-YZcGGDD8.js";
5
+ import { a as o, i as s, n as c, o as l, r as u, t as d } from "./chunks/providers-DEqcuXw9.js";
6
+ import { n as f, r as p, t as m } from "./chunks/routes-config-RBYQtUd0.js";
8
7
  import { t as h } from "./chunks/bpm-form-field-Cao0rMol.js";
9
- import { t as g } from "./chunks/dashboard-page-DJ9vOPga.js";
10
- import { Fragment as te, createContext as _, useCallback as v, useContext as y, useEffect as b, useMemo as x, useState as S } from "react";
11
- import { NavigationIconButton as C } from "@mezzanine-ui/react";
12
- import { Fragment as ne, jsx as w, jsxs as T } from "react/jsx-runtime";
13
- import { decideTask as E, listNotifications as re, markAllNotificationsRead as ie, markNotificationRead as D, readUnreadNotificationCount as O } from "@rytass/bpm-core-client/workflow";
14
- import { CalendarConfigProviderMoment as k, CalendarLocale as A } from "@mezzanine-ui/react/moment";
15
- import ae from "@mezzanine-ui/react/Drawer";
16
- import oe from "@mezzanine-ui/react/Modal";
17
- import se from "@mezzanine-ui/react/NotificationCenter";
18
- import ce from "@mezzanine-ui/react/Textarea";
19
- import { NotificationUnreadIcon as j } from "@mezzanine-ui/icons";
20
- import './index.css';//#region src/lib/notification-drawer-provider.tsx
21
- var M = _(null);
22
- function N({ children: e }) {
23
- let [t, n] = S(!1), r = v(() => {
24
- n(!0);
25
- }, []), i = v(() => {
26
- n(!1);
27
- }, []), a = v(() => {
28
- n((e) => !e);
29
- }, []), o = x(() => ({
30
- close: i,
31
- isOpen: t,
32
- open: r,
33
- toggle: a
34
- }), [
35
- i,
36
- t,
37
- r,
38
- a
39
- ]);
40
- return /* @__PURE__ */ w(M.Provider, {
41
- value: o,
42
- children: e
43
- });
44
- }
45
- function P() {
46
- return y(M) || {
47
- close: () => void 0,
48
- isOpen: !1,
49
- open: () => void 0,
50
- toggle: () => void 0
51
- };
52
- }
53
- //#endregion
54
- //#region src/lib/notification-unread-provider.tsx
55
- var F = _(null);
56
- function I({ children: e }) {
57
- let { member: t } = r(), n = t?.memberId ?? null, [i, a] = S(0), o = v(async () => {
58
- if (!n) return a(0), 0;
59
- let e = await O(n);
60
- return a(e), e;
61
- }, [n]);
62
- b(() => {
63
- let e = !0;
64
- return (async () => {
65
- try {
66
- let t = await o();
67
- e && a(t);
68
- } catch {
69
- e && a(0);
70
- }
71
- })(), () => {
72
- e = !1;
73
- };
74
- }, [o]);
75
- let s = x(() => ({
76
- refreshUnreadCount: o,
77
- unreadCount: i
78
- }), [o, i]);
79
- return /* @__PURE__ */ w(F.Provider, {
80
- value: s,
81
- children: e
82
- });
83
- }
84
- function L() {
85
- return y(F) || {
86
- refreshUnreadCount: async () => 0,
87
- unreadCount: 0
88
- };
89
- }
90
- //#endregion
91
- //#region src/components/notification-drawer.tsx
92
- var R = [
93
- "today",
94
- "yesterday",
95
- "past7Days",
96
- "earlier"
97
- ], le = {
98
- earlier: "更早",
99
- past7Days: "過去七天",
100
- today: "今天",
101
- yesterday: "昨天"
102
- }, ue = 50;
103
- function de(e) {
104
- return [
105
- ...e.actionable ? [{
106
- id: "approve",
107
- name: "同意"
108
- }, {
109
- id: "reject",
110
- name: "拒絕"
111
- }] : [],
112
- ...e.instanceId ? [{
113
- id: "view",
114
- name: "查看案件"
115
- }] : [],
116
- ...e.status === "READ" ? [] : [{
117
- id: "read",
118
- name: "標為已讀"
119
- }]
120
- ];
121
- }
122
- var z = {
123
- APPROVED: "簽核任務已同意",
124
- REJECTED: "簽核任務已拒絕",
125
- RETURNED: "簽核任務已退回",
126
- SUPERSEDED: "簽核任務已結束",
127
- TRANSFERRED: "簽核任務已轉派"
128
- };
129
- function fe(e) {
130
- return e.resolution ? z[e.resolution] : e.title;
131
- }
132
- function pe(e) {
133
- return e.resolution === "APPROVED" ? "success" : e.resolution === "REJECTED" ? "error" : e.resolution ? "info" : V(e.type);
134
- }
135
- function B() {
136
- let e = t(), n = s(), { member: i } = r(), { close: a, isOpen: o } = P(), { refreshUnreadCount: c } = L(), l = i?.memberId ?? null, [u, d] = S([]), [f, ee] = S(0), [p, m] = S(1), [h, g] = S(!1), [_, y] = S(!1), [C, O] = S(null), [k, A] = S(null), [j, M] = S("all"), [N, F] = S(null), [I, z] = S(""), [B, V] = S(!1), U = I.trim(), W = v(async (e, t) => {
137
- if (l) {
138
- g(!0), O(null);
139
- try {
140
- let n = await re({
141
- includeRead: !0,
142
- page: e,
143
- pageSize: ue,
144
- recipientMemberId: l
145
- });
146
- d((e) => t ? [...e, ...n.notifications] : n.notifications), ee(n.totalCount), m(e), await c();
147
- } catch (e) {
148
- O(H(e));
149
- } finally {
150
- g(!1);
151
- }
152
- }
153
- }, [l, c]);
154
- b(() => {
155
- !o || !l || (O(null), A(null), W(1, !1));
156
- }, [
157
- o,
158
- l,
159
- W
160
- ]);
161
- let G = v((e) => {
162
- let t = e.target.value;
163
- (t === "all" || t === "read" || t === "unread") && M(t);
164
- }, []), K = v(async () => {
165
- if (!(!l || _)) {
166
- y(!0), O(null);
167
- try {
168
- await ie({ recipientMemberId: l }), await W(1, !1);
169
- } catch (e) {
170
- O(H(e));
171
- } finally {
172
- y(!1);
173
- }
174
- }
175
- }, [
176
- _,
177
- l,
178
- W
179
- ]), q = v(() => {
180
- h || W(p + 1, !0);
181
- }, [
182
- h,
183
- W,
184
- p
185
- ]), J = v(async (e) => {
186
- if (l) try {
187
- await D({
188
- id: e,
189
- readerMemberId: l
190
- }), await W(1, !1);
191
- } catch (e) {
192
- O(H(e));
193
- }
194
- }, [l, W]), Y = v(async (t) => {
195
- if (!(!t.instanceId || !l)) try {
196
- t.status !== "READ" && (await D({
197
- id: t.id,
198
- readerMemberId: l
199
- }), await c()), a(), e.push(n.caseDetail(t.instanceId));
200
- } catch (e) {
201
- O(H(e));
202
- }
203
- }, [
204
- a,
205
- l,
206
- c,
207
- e,
208
- n
209
- ]), X = v(async (e) => {
210
- if (!(!e.taskId || !l || B)) {
211
- V(!0), O(null), A(null);
212
- try {
213
- await E({
214
- action: "APPROVED",
215
- comment: null,
216
- decidedByMemberId: l,
217
- taskId: e.taskId
218
- }), A(`已同意「${e.title}」。`), await W(1, !1);
219
- } catch (e) {
220
- O(H(e));
221
- } finally {
222
- V(!1);
223
- }
224
- }
225
- }, [
226
- l,
227
- B,
228
- W
229
- ]), Z = v((e) => {
230
- F(e), z("");
231
- }, []), Q = v(() => {
232
- F(null), z("");
233
- }, []), he = v(async () => {
234
- let e = N;
235
- if (!(!e?.taskId || !l || !U || B)) {
236
- V(!0), O(null), A(null);
237
- try {
238
- await E({
239
- action: "REJECTED",
240
- comment: U,
241
- decidedByMemberId: l,
242
- taskId: e.taskId
243
- }), F(null), z(""), A(`已拒絕「${e.title}」。`), await W(1, !1);
244
- } catch (e) {
245
- O(H(e));
246
- } finally {
247
- V(!1);
248
- }
249
- }
250
- }, [
251
- l,
252
- B,
253
- W,
254
- N,
255
- U
256
- ]), ge = v((e, t) => {
257
- let n = t.id;
258
- n === "approve" ? X(e) : n === "reject" ? Z(e) : n === "view" ? Y(e) : n === "read" && J(e.id);
259
- }, [
260
- X,
261
- J,
262
- Y,
263
- Z
264
- ]), _e = v((e, t) => {
265
- t instanceof Element && t.closest("button") || Y(e);
266
- }, [Y]), ve = v((e, t) => {
267
- t.key !== "Enter" && t.key !== " " || t.target instanceof Element && t.target.closest("button") || (t.preventDefault(), Y(e));
268
- }, [Y]), ye = x(() => u.filter((e) => j === "all" ? !0 : j === "read" ? e.status === "READ" : e.status !== "READ"), [j, u]), be = x(() => {
269
- let e = /* @__PURE__ */ new Date(), t = R.reduce((e, t) => (e[t] = [], e), {
270
- earlier: [],
271
- past7Days: [],
272
- today: [],
273
- yesterday: []
274
- });
275
- return ye.forEach((n) => {
276
- t[me(n.createdAt, e)].push(n);
277
- }), R.map((e) => [e, t[e]]).filter(([, e]) => e.length > 0);
278
- }, [ye]), $ = u.length < f;
279
- return l ? /* @__PURE__ */ T(ne, { children: [/* @__PURE__ */ w(ae, {
280
- bottomGhostActionDisabled: _ || h,
281
- bottomGhostActionLoading: _,
282
- bottomGhostActionText: "全部標為已讀",
283
- bottomOnGhostActionClick: () => {
284
- K();
285
- },
286
- bottomOnPrimaryActionClick: () => {
287
- q();
288
- },
289
- bottomPrimaryActionDisabled: !$ || h,
290
- bottomPrimaryActionLoading: h && $,
291
- bottomPrimaryActionText: $ ? "載入更多" : "已顯示全部",
292
- contentKey: `${j}:${u.length}`,
293
- filterAreaAllRadioLabel: "全部",
294
- filterAreaOnRadioChange: G,
295
- filterAreaReadRadioLabel: "已讀",
296
- filterAreaShow: !0,
297
- filterAreaUnreadRadioLabel: "未讀",
298
- filterAreaValue: j,
299
- headerTitle: "通知中心",
300
- isBottomDisplay: !0,
301
- isHeaderDisplay: !0,
302
- onClose: a,
303
- open: o,
304
- size: "medium",
305
- children: /* @__PURE__ */ T("div", {
306
- role: "list",
307
- children: [
308
- C ? /* @__PURE__ */ w("p", {
309
- role: "alert",
310
- style: {
311
- color: "var(--mzn-color-text-error, #d92d20)",
312
- padding: "12px 16px"
313
- },
314
- children: C
315
- }) : null,
316
- k ? /* @__PURE__ */ w("p", {
317
- role: "status",
318
- style: {
319
- color: "var(--mzn-color-text-success, #079455)",
320
- padding: "12px 16px"
321
- },
322
- children: k
323
- }) : null,
324
- be.length === 0 ? /* @__PURE__ */ w("p", {
325
- style: {
326
- color: "var(--mzn-color-text-secondary, #6b7280)",
327
- padding: "24px 16px",
328
- textAlign: "center"
329
- },
330
- children: h ? "載入中…" : "目前沒有通知"
331
- }) : null,
332
- be.map(([e, t]) => /* @__PURE__ */ w(te, { children: t.map((t, n) => {
333
- let r = t.instanceId !== null;
334
- return /* @__PURE__ */ w("div", {
335
- onClick: r ? (e) => {
336
- _e(t, e.target);
337
- } : void 0,
338
- onKeyDown: r ? (e) => {
339
- ve(t, e);
340
- } : void 0,
341
- role: r ? "button" : void 0,
342
- style: r ? { cursor: "pointer" } : void 0,
343
- tabIndex: r ? 0 : void 0,
344
- children: /* @__PURE__ */ w(se, {
345
- description: t.body,
346
- onBadgeSelect: (e) => {
347
- ge(t, e);
348
- },
349
- options: [...de(t)],
350
- prependTips: n === 0 ? le[e] : void 0,
351
- reference: t.id,
352
- severity: pe(t),
353
- showBadge: t.status !== "READ",
354
- timeStamp: t.createdAt,
355
- title: fe(t),
356
- type: "drawer"
357
- })
358
- }, t.id);
359
- }) }, e))
360
- ]
361
- })
362
- }), /* @__PURE__ */ w(oe, {
363
- cancelText: "取消",
364
- confirmButtonProps: {
365
- disabled: !U,
366
- variant: "destructive-primary"
367
- },
368
- confirmText: "送出拒絕",
369
- loading: B,
370
- modalStatusType: "error",
371
- modalType: "standard",
372
- onCancel: Q,
373
- onClose: Q,
374
- onConfirm: () => {
375
- he();
376
- },
377
- open: N !== null,
378
- showModalFooter: !0,
379
- showModalHeader: !0,
380
- size: "regular",
381
- supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
382
- title: "拒絕原因",
383
- children: /* @__PURE__ */ w(ce, {
384
- autoFocus: !0,
385
- onChange: (e) => {
386
- z(e.target.value);
387
- },
388
- placeholder: "請輸入拒絕原因",
389
- rows: 4,
390
- value: I
391
- })
392
- })] }) : null;
393
- }
394
- function V(e) {
395
- return e === "SLA_OVERDUE" ? "error" : e === "SLA_WARNING" ? "warning" : e === "INSTANCE_COMPLETED" ? "success" : "info";
396
- }
397
- function me(e, t) {
398
- let n = new Date(e);
399
- if (Number.isNaN(n.getTime())) return "earlier";
400
- let r = new Date(t.getFullYear(), t.getMonth(), t.getDate()), i = new Date(n.getFullYear(), n.getMonth(), n.getDate());
401
- if (i.getTime() === r.getTime()) return "today";
402
- let a = new Date(r);
403
- return a.setDate(a.getDate() - 1), i.getTime() === a.getTime() ? "yesterday" : (t.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24) <= 7 ? "past7Days" : "earlier";
404
- }
405
- function H(e) {
406
- return e instanceof Error ? e.message : "發生未知錯誤";
407
- }
408
- //#endregion
409
- //#region src/lib/providers.tsx
410
- function U({ children: e, locale: t = A.ZH_TW, publicPaths: n, loginPath: r }) {
411
- return /* @__PURE__ */ w(k, {
412
- locale: t,
413
- children: /* @__PURE__ */ w(i, {
414
- publicPaths: n,
415
- loginPath: r,
416
- children: /* @__PURE__ */ w(I, { children: /* @__PURE__ */ T(N, { children: [e, /* @__PURE__ */ w(B, {})] }) })
417
- })
418
- });
419
- }
420
- //#endregion
421
- //#region src/lib/use-bpm-logout.ts
422
- function W() {
8
+ import { a as g, i as _, n as v, o as y, r as b, t as x } from "./chunks/admin-pickers-DLlG_1du.js";
9
+ import { t as S } from "./chunks/approval-instance-list-page-BjX2kaoF.js";
10
+ import { t as C } from "./chunks/dashboard-page-DJ9vOPga.js";
11
+ import { NavigationIconButton as w } from "@mezzanine-ui/react";
12
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
13
+ import { NotificationUnreadIcon as D } from "@mezzanine-ui/icons";
14
+ import './index.css';//#region src/lib/use-bpm-logout.ts
15
+ function O() {
423
16
  let { logout: e } = r();
424
17
  return e;
425
18
  }
426
19
  //#endregion
427
20
  //#region src/lib/use-bpm-member.ts
428
- function G() {
21
+ function k() {
429
22
  let { member: e } = r();
430
23
  return e;
431
24
  }
432
- var K = {
25
+ var A = {
433
26
  root: "bpm_root_jl5S-",
434
27
  badge: "bpm_badge_SIKJk"
435
28
  };
436
29
  //#endregion
437
30
  //#region src/components/bpm-notification-bell-button.tsx
438
- function q({ label: e = "通知中心" } = {}) {
439
- let { open: t } = P(), { unreadCount: n } = L(), r = n > 0 ? `${e},${n} 則未讀` : e;
440
- return /* @__PURE__ */ T("span", {
441
- className: K.root,
442
- children: [/* @__PURE__ */ w(C, {
31
+ function j({ label: e = "通知中心" } = {}) {
32
+ let { open: t } = l(), { unreadCount: n } = s(), r = n > 0 ? `${e},${n} 則未讀` : e;
33
+ return /* @__PURE__ */ E("span", {
34
+ className: A.root,
35
+ children: [/* @__PURE__ */ T(w, {
443
36
  "aria-label": r,
444
- icon: j,
37
+ icon: D,
445
38
  onClick: () => {
446
39
  t();
447
40
  },
448
41
  title: e,
449
42
  type: "button"
450
- }), n > 0 ? /* @__PURE__ */ w("span", {
451
- className: K.badge,
43
+ }), n > 0 ? /* @__PURE__ */ T("span", {
44
+ className: A.badge,
452
45
  children: n > 99 ? "99+" : n
453
46
  }) : null]
454
47
  });
455
48
  }
456
49
  //#endregion
457
- export { m as ApprovalInstanceListPage, i as AuthProvider, h as BPMFormField, q as BPMNotificationBellButton, c as BPMRoutesProvider, g as DashboardPage, p as MemberPicker, B as NotificationDrawer, N as NotificationDrawerProvider, I as NotificationUnreadProvider, d as OrgUnitPicker, ee as PositionPicker, U as Providers, n as RouterAdapterProvider, o as createDefaultBPMRoutes, e as defaultBrowserSearchParams, a as formatDateTime, u as readMemberOption, l as readOrgUnitOption, f as readPositionOption, r as useAuth, W as useBPMLogout, G as useBPMMember, s as useBPMRoutes, P as useNotificationDrawer, L as useNotificationUnread, t as useRouterAdapter };
50
+ export { S as ApprovalInstanceListPage, i as AuthProvider, h as BPMFormField, j as BPMNotificationBellButton, m as BPMRoutesProvider, C as DashboardPage, x as MemberPicker, c as NotificationDrawer, o as NotificationDrawerProvider, u as NotificationUnreadProvider, v as OrgUnitPicker, b as PositionPicker, d as Providers, n as RouterAdapterProvider, f as createDefaultBPMRoutes, e as defaultBrowserSearchParams, a as formatDateTime, _ as readMemberOption, g as readOrgUnitOption, y as readPositionOption, r as useAuth, O as useBPMLogout, k as useBPMMember, p as useBPMRoutes, l as useNotificationDrawer, s as useNotificationUnread, t as useRouterAdapter };
458
51
 
459
52
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/lib/notification-drawer-provider.tsx","../src/lib/notification-unread-provider.tsx","../src/components/notification-drawer.tsx","../src/lib/providers.tsx","../src/lib/use-bpm-logout.ts","../src/lib/use-bpm-member.ts","../src/components/bpm-notification-bell-button.module.scss","../src/components/bpm-notification-bell-button.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\ninterface NotificationDrawerContextValue {\n readonly close: () => void;\n readonly isOpen: boolean;\n readonly open: () => void;\n readonly toggle: () => void;\n}\n\nconst NotificationDrawerContext =\n createContext<NotificationDrawerContextValue | null>(null);\n\ninterface NotificationDrawerProviderProps {\n readonly children: ReactNode;\n}\n\n/**\n * Controls the open/closed state of the BPM notification drawer. Wraps\n * children with a context that `<NotificationDrawer />` reads to mount /\n * hide itself, and that the host navigation reads (via\n * `<BPMNotificationBellButton />` or `useNotificationDrawer().open`) to\n * open the drawer when the bell icon is clicked.\n *\n * When used outside this provider, the returned hook is a safe no-op so\n * components don't crash in test or storybook environments.\n */\nexport function NotificationDrawerProvider({\n children,\n}: NotificationDrawerProviderProps): ReactElement {\n const [isOpen, setIsOpen] = useState(false);\n\n const open = useCallback((): void => {\n setIsOpen(true);\n }, []);\n const close = useCallback((): void => {\n setIsOpen(false);\n }, []);\n const toggle = useCallback((): void => {\n setIsOpen((current) => !current);\n }, []);\n\n const value = useMemo<NotificationDrawerContextValue>(\n () => ({ close, isOpen, open, toggle }),\n [close, isOpen, open, toggle],\n );\n\n return (\n <NotificationDrawerContext.Provider value={value}>\n {children}\n </NotificationDrawerContext.Provider>\n );\n}\n\n/**\n * Read the BPM notification drawer's open state and control helpers.\n * Returns a no-op stub when used outside `<NotificationDrawerProvider>`.\n */\nexport function useNotificationDrawer(): NotificationDrawerContextValue {\n const context = useContext(NotificationDrawerContext);\n if (!context) {\n return {\n close: (): void => undefined,\n isOpen: false,\n open: (): void => undefined,\n toggle: (): void => undefined,\n };\n }\n return context;\n}\n","'use client';\n\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { readUnreadNotificationCount } from '@rytass/bpm-core-client/workflow';\nimport { useAuth } from './auth-provider';\n\ninterface NotificationUnreadContextValue {\n readonly refreshUnreadCount: () => Promise<number>;\n readonly unreadCount: number;\n}\n\nconst NotificationUnreadContext =\n createContext<NotificationUnreadContextValue | null>(null);\n\ninterface NotificationUnreadProviderProps {\n readonly children: ReactNode;\n}\n\n/**\n * Polls BPM for the current member's unread notification count via\n * `readUnreadNotificationCount` and exposes it through context for the\n * host navigation (`<BPMNotificationBellButton />` badge or any custom\n * trigger using `useNotificationUnread().unreadCount`) and the BPM\n * `<NotificationDrawer />` (header count). Refresh is triggered on\n * mount and whenever the auth member id changes; consumers can call\n * `refreshUnreadCount()` after acknowledging a notification.\n */\nexport function NotificationUnreadProvider({\n children,\n}: NotificationUnreadProviderProps): ReactElement {\n const { member } = useAuth();\n const currentMemberId = member?.memberId ?? null;\n const [unreadCount, setUnreadCount] = useState(0);\n\n const refreshUnreadCount = useCallback(async (): Promise<number> => {\n if (!currentMemberId) {\n setUnreadCount(0);\n return 0;\n }\n const next = await readUnreadNotificationCount(currentMemberId);\n setUnreadCount(next);\n return next;\n }, [currentMemberId]);\n\n useEffect((): (() => void) => {\n let active = true;\n void (async () => {\n try {\n const next = await refreshUnreadCount();\n if (active) setUnreadCount(next);\n } catch {\n if (active) setUnreadCount(0);\n }\n })();\n return (): void => {\n active = false;\n };\n }, [refreshUnreadCount]);\n\n const value = useMemo<NotificationUnreadContextValue>(\n () => ({ refreshUnreadCount, unreadCount }),\n [refreshUnreadCount, unreadCount],\n );\n\n return (\n <NotificationUnreadContext.Provider value={value}>\n {children}\n </NotificationUnreadContext.Provider>\n );\n}\n\n/**\n * Read the current unread-notification count and a manual refresh helper.\n * Returns a zero/no-op stub when used outside\n * `<NotificationUnreadProvider>`.\n */\nexport function useNotificationUnread(): NotificationUnreadContextValue {\n const context = useContext(NotificationUnreadContext);\n if (!context) {\n return {\n refreshUnreadCount: async (): Promise<number> => 0,\n unreadCount: 0,\n };\n }\n return context;\n}\n","'use client';\n\nimport {\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ChangeEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n} from 'react';\nimport Drawer from '@mezzanine-ui/react/Drawer';\nimport Modal from '@mezzanine-ui/react/Modal';\nimport NotificationCenter from '@mezzanine-ui/react/NotificationCenter';\nimport Textarea from '@mezzanine-ui/react/Textarea';\nimport type { NotificationSeverity } from '@mezzanine-ui/core/notification-center';\nimport type { DropdownOption } from '@mezzanine-ui/core/dropdown/dropdown';\nimport {\n decideTask,\n listNotifications,\n markAllNotificationsRead,\n markNotificationRead,\n type NotificationRecord,\n type NotificationResolution,\n type NotificationType,\n} from '@rytass/bpm-core-client/workflow';\nimport { useAuth } from '../lib/auth-provider';\nimport { useNotificationDrawer } from '../lib/notification-drawer-provider';\nimport { useNotificationUnread } from '../lib/notification-unread-provider';\nimport { useRouterAdapter } from '../lib/router-adapter';\nimport { useBPMRoutes } from '../lib/routes-config';\n\ntype FilterValue = 'all' | 'read' | 'unread';\n\ntype TimeGroup = 'today' | 'yesterday' | 'past7Days' | 'earlier';\n\nconst TIME_GROUP_ORDER: readonly TimeGroup[] = [\n 'today',\n 'yesterday',\n 'past7Days',\n 'earlier',\n];\n\nconst TIME_GROUP_LABEL: Readonly<Record<TimeGroup, string>> = {\n earlier: '更早',\n past7Days: '過去七天',\n today: '今天',\n yesterday: '昨天',\n};\n\nconst PAGE_SIZE = 50;\n\n/** Identifiers for the per-notification `...` dropdown menu entries. */\ntype NotificationAction = 'approve' | 'reject' | 'view' | 'read';\n\n/**\n * Build the `...` dropdown options for one notification. Approve / reject are\n * offered only while the server still reports the notification as `actionable`\n * (an unresolved task assignment) — once the task is decided / cancelled the\n * backend flips `actionable` to false, so a stale \"同意\" can never appear.\n * \"查看案件\" needs an `instanceId`; \"標為已讀\" only shows while unread.\n */\nfunction buildNotificationOptions(\n record: NotificationRecord,\n): readonly DropdownOption[] {\n return [\n ...(record.actionable\n ? ([\n { id: 'approve', name: '同意' },\n { id: 'reject', name: '拒絕' },\n ] satisfies DropdownOption[])\n : []),\n ...(record.instanceId\n ? ([{ id: 'view', name: '查看案件' }] satisfies DropdownOption[])\n : []),\n ...(record.status !== 'READ'\n ? ([{ id: 'read', name: '標為已讀' }] satisfies DropdownOption[])\n : []),\n ];\n}\n\n/**\n * Title shown for a resolved task-assignment notification, replacing the\n * stored \"新的待簽任務\" wording so a decided card no longer reads as pending.\n * The stored `body` is kept as historical context (which case / node).\n */\nconst RESOLVED_TITLE: Readonly<Record<NotificationResolution, string>> = {\n APPROVED: '簽核任務已同意',\n REJECTED: '簽核任務已拒絕',\n RETURNED: '簽核任務已退回',\n SUPERSEDED: '簽核任務已結束',\n TRANSFERRED: '簽核任務已轉派',\n};\n\nfunction resolveDisplayTitle(record: NotificationRecord): string {\n return record.resolution ? RESOLVED_TITLE[record.resolution] : record.title;\n}\n\n/**\n * Severity (icon colour) for a notification. Once resolved, it reflects the\n * outcome — green for approved, red for rejected, neutral otherwise — instead\n * of the original by-type colour.\n */\nfunction resolveSeverity(record: NotificationRecord): NotificationSeverity {\n if (record.resolution === 'APPROVED') return 'success';\n if (record.resolution === 'REJECTED') return 'error';\n if (record.resolution) return 'info';\n return toSeverity(record.type);\n}\n\n/**\n * Right-side notification drawer mounted at the root by `<Providers>`.\n * Opens / closes via `useNotificationDrawer()`, polls\n * `listNotifications()` for the current member, supports filter\n * (`all` / `read` / `unread`), per-row mark-read, bulk mark-all-read, and\n * load-more pagination. Clicking a row with an `instanceId` navigates to\n * `/instances/<id>` via the host's router adapter.\n */\nexport function NotificationDrawer(): ReactElement | null {\n const router = useRouterAdapter();\n const routes = useBPMRoutes();\n const { member } = useAuth();\n const { close, isOpen } = useNotificationDrawer();\n const { refreshUnreadCount } = useNotificationUnread();\n const currentMemberId = member?.memberId ?? null;\n const [rows, setRows] = useState<readonly NotificationRecord[]>([]);\n const [totalCount, setTotalCount] = useState(0);\n const [page, setPage] = useState(1);\n const [loading, setLoading] = useState(false);\n const [bulkLoading, setBulkLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const [filter, setFilter] = useState<FilterValue>('all');\n const [rejectTarget, setRejectTarget] = useState<NotificationRecord | null>(\n null,\n );\n const [rejectReason, setRejectReason] = useState('');\n const [deciding, setDeciding] = useState(false);\n\n const trimmedRejectReason = rejectReason.trim();\n\n const loadPage = useCallback(\n async (nextPage: number, append: boolean): Promise<void> => {\n if (!currentMemberId) return;\n setLoading(true);\n setError(null);\n try {\n const result = await listNotifications({\n includeRead: true,\n page: nextPage,\n pageSize: PAGE_SIZE,\n recipientMemberId: currentMemberId,\n });\n setRows((current): readonly NotificationRecord[] =>\n append ? [...current, ...result.notifications] : result.notifications,\n );\n setTotalCount(result.totalCount);\n setPage(nextPage);\n await refreshUnreadCount();\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n } finally {\n setLoading(false);\n }\n },\n [currentMemberId, refreshUnreadCount],\n );\n\n useEffect((): void => {\n if (!isOpen || !currentMemberId) return;\n setError(null);\n setNotice(null);\n void loadPage(1, false);\n }, [isOpen, currentMemberId, loadPage]);\n\n const handleFilterChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>): void => {\n const next = event.target.value;\n if (next === 'all' || next === 'read' || next === 'unread') setFilter(next);\n },\n [],\n );\n\n const handleMarkAllRead = useCallback(async (): Promise<void> => {\n if (!currentMemberId || bulkLoading) return;\n setBulkLoading(true);\n setError(null);\n try {\n await markAllNotificationsRead({ recipientMemberId: currentMemberId });\n await loadPage(1, false);\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n } finally {\n setBulkLoading(false);\n }\n }, [bulkLoading, currentMemberId, loadPage]);\n\n const handleLoadMore = useCallback((): void => {\n if (loading) return;\n void loadPage(page + 1, true);\n }, [loading, loadPage, page]);\n\n const handleMarkRead = useCallback(\n async (id: string): Promise<void> => {\n if (!currentMemberId) return;\n try {\n await markNotificationRead({ id, readerMemberId: currentMemberId });\n await loadPage(1, false);\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n }\n },\n [currentMemberId, loadPage],\n );\n\n const handleOpenInstance = useCallback(\n async (record: NotificationRecord): Promise<void> => {\n if (!record.instanceId || !currentMemberId) return;\n try {\n if (record.status !== 'READ') {\n await markNotificationRead({\n id: record.id,\n readerMemberId: currentMemberId,\n });\n await refreshUnreadCount();\n }\n close();\n router.push(routes.caseDetail(record.instanceId));\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n }\n },\n [close, currentMemberId, refreshUnreadCount, router, routes],\n );\n\n const handleApprove = useCallback(\n async (record: NotificationRecord): Promise<void> => {\n if (!record.taskId || !currentMemberId || deciding) return;\n setDeciding(true);\n setError(null);\n setNotice(null);\n try {\n await decideTask({\n action: 'APPROVED',\n comment: null,\n decidedByMemberId: currentMemberId,\n taskId: record.taskId,\n });\n setNotice(`已同意「${record.title}」。`);\n await loadPage(1, false);\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n } finally {\n setDeciding(false);\n }\n },\n [currentMemberId, deciding, loadPage],\n );\n\n const openRejectModal = useCallback((record: NotificationRecord): void => {\n setRejectTarget(record);\n setRejectReason('');\n }, []);\n\n const closeRejectModal = useCallback((): void => {\n setRejectTarget(null);\n setRejectReason('');\n }, []);\n\n const handleRejectConfirm = useCallback(async (): Promise<void> => {\n const target = rejectTarget;\n if (!target?.taskId || !currentMemberId || !trimmedRejectReason || deciding)\n return;\n setDeciding(true);\n setError(null);\n setNotice(null);\n try {\n await decideTask({\n action: 'REJECTED',\n comment: trimmedRejectReason,\n decidedByMemberId: currentMemberId,\n taskId: target.taskId,\n });\n setRejectTarget(null);\n setRejectReason('');\n setNotice(`已拒絕「${target.title}」。`);\n await loadPage(1, false);\n } catch (e: unknown) {\n setError(readErrorMessage(e));\n } finally {\n setDeciding(false);\n }\n }, [currentMemberId, deciding, loadPage, rejectTarget, trimmedRejectReason]);\n\n const handleBadgeSelect = useCallback(\n (record: NotificationRecord, option: DropdownOption): void => {\n const action = option.id as NotificationAction;\n if (action === 'approve') void handleApprove(record);\n else if (action === 'reject') openRejectModal(record);\n else if (action === 'view') void handleOpenInstance(record);\n else if (action === 'read') void handleMarkRead(record.id);\n },\n [handleApprove, handleMarkRead, handleOpenInstance, openRejectModal],\n );\n\n const handleCardActivate = useCallback(\n (record: NotificationRecord, target: EventTarget | null): void => {\n // Let clicks on the `...` menu button (and its icon) open the dropdown\n // instead of navigating away. The icon renders as an <svg>, so guard on\n // `Element` (not `HTMLElement`) — SVG nodes are not HTMLElements.\n if (target instanceof Element && target.closest('button')) return;\n void handleOpenInstance(record);\n },\n [handleOpenInstance],\n );\n\n const handleCardKeyDown = useCallback(\n (\n record: NotificationRecord,\n event: ReactKeyboardEvent<HTMLDivElement>,\n ): void => {\n if (event.key !== 'Enter' && event.key !== ' ') return;\n if (event.target instanceof Element && event.target.closest('button'))\n return;\n event.preventDefault();\n void handleOpenInstance(record);\n },\n [handleOpenInstance],\n );\n\n const filteredRows = useMemo(\n (): readonly NotificationRecord[] =>\n rows.filter((row): boolean => {\n if (filter === 'all') return true;\n if (filter === 'read') return row.status === 'READ';\n return row.status !== 'READ';\n }),\n [filter, rows],\n );\n\n const groupedRows = useMemo(\n (): ReadonlyArray<readonly [TimeGroup, readonly NotificationRecord[]]> => {\n const now = new Date();\n const buckets = TIME_GROUP_ORDER.reduce<\n Record<TimeGroup, NotificationRecord[]>\n >(\n (accumulator, group) => {\n accumulator[group] = [];\n return accumulator;\n },\n { earlier: [], past7Days: [], today: [], yesterday: [] },\n );\n filteredRows.forEach((row): void => {\n buckets[resolveTimeGroup(row.createdAt, now)].push(row);\n });\n return TIME_GROUP_ORDER.map(\n (group) => [group, buckets[group]] as const,\n ).filter(([, items]) => items.length > 0);\n },\n [filteredRows],\n );\n\n const hasMore = rows.length < totalCount;\n\n if (!currentMemberId) return null;\n\n return (\n <>\n <Drawer\n bottomGhostActionDisabled={bulkLoading || loading}\n bottomGhostActionLoading={bulkLoading}\n bottomGhostActionText=\"全部標為已讀\"\n bottomOnGhostActionClick={(): void => {\n void handleMarkAllRead();\n }}\n bottomOnPrimaryActionClick={(): void => {\n handleLoadMore();\n }}\n bottomPrimaryActionDisabled={!hasMore || loading}\n bottomPrimaryActionLoading={loading && hasMore}\n bottomPrimaryActionText={hasMore ? '載入更多' : '已顯示全部'}\n contentKey={`${filter}:${rows.length}`}\n filterAreaAllRadioLabel=\"全部\"\n filterAreaOnRadioChange={handleFilterChange}\n filterAreaReadRadioLabel=\"已讀\"\n filterAreaShow\n filterAreaUnreadRadioLabel=\"未讀\"\n filterAreaValue={filter}\n headerTitle=\"通知中心\"\n isBottomDisplay\n isHeaderDisplay\n onClose={close}\n open={isOpen}\n size=\"medium\"\n >\n <div role=\"list\">\n {error ? (\n <p\n role=\"alert\"\n style={{\n color: 'var(--mzn-color-text-error, #d92d20)',\n padding: '12px 16px',\n }}\n >\n {error}\n </p>\n ) : null}\n {notice ? (\n <p\n role=\"status\"\n style={{\n color: 'var(--mzn-color-text-success, #079455)',\n padding: '12px 16px',\n }}\n >\n {notice}\n </p>\n ) : null}\n {groupedRows.length === 0 ? (\n <p\n style={{\n color: 'var(--mzn-color-text-secondary, #6b7280)',\n padding: '24px 16px',\n textAlign: 'center',\n }}\n >\n {loading ? '載入中…' : '目前沒有通知'}\n </p>\n ) : null}\n {groupedRows.map(([group, items]) => (\n <Fragment key={group}>\n {items.map((record, itemIndex) => {\n const openable = record.instanceId !== null;\n\n return (\n <div\n key={record.id}\n onClick={\n openable\n ? (event: ReactMouseEvent<HTMLDivElement>): void => {\n handleCardActivate(record, event.target);\n }\n : undefined\n }\n onKeyDown={\n openable\n ? (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n handleCardKeyDown(record, event);\n }\n : undefined\n }\n role={openable ? 'button' : undefined}\n style={openable ? { cursor: 'pointer' } : undefined}\n tabIndex={openable ? 0 : undefined}\n >\n <NotificationCenter\n description={record.body}\n onBadgeSelect={(option: DropdownOption): void => {\n handleBadgeSelect(record, option);\n }}\n options={[...buildNotificationOptions(record)]}\n prependTips={\n itemIndex === 0 ? TIME_GROUP_LABEL[group] : undefined\n }\n reference={record.id}\n severity={resolveSeverity(record)}\n showBadge={record.status !== 'READ'}\n timeStamp={record.createdAt}\n title={resolveDisplayTitle(record)}\n type=\"drawer\"\n />\n </div>\n );\n })}\n </Fragment>\n ))}\n </div>\n </Drawer>\n <Modal\n cancelText=\"取消\"\n confirmButtonProps={{\n disabled: !trimmedRejectReason,\n variant: 'destructive-primary',\n }}\n confirmText=\"送出拒絕\"\n loading={deciding}\n modalStatusType=\"error\"\n modalType=\"standard\"\n onCancel={closeRejectModal}\n onClose={closeRejectModal}\n onConfirm={(): void => {\n void handleRejectConfirm();\n }}\n open={rejectTarget !== null}\n showModalFooter\n showModalHeader\n size=\"regular\"\n supportingText=\"拒絕案件時必須留下原因,供發起人與後續追蹤查看。\"\n title=\"拒絕原因\"\n >\n <Textarea\n autoFocus\n onChange={(event: ChangeEvent<HTMLTextAreaElement>): void => {\n setRejectReason(event.target.value);\n }}\n placeholder=\"請輸入拒絕原因\"\n rows={4}\n value={rejectReason}\n />\n </Modal>\n </>\n );\n}\n\nfunction toSeverity(type: NotificationType): NotificationSeverity {\n if (type === 'SLA_OVERDUE') return 'error';\n if (type === 'SLA_WARNING') return 'warning';\n if (type === 'INSTANCE_COMPLETED') return 'success';\n return 'info';\n}\n\nfunction resolveTimeGroup(value: string, now: Date): TimeGroup {\n const notificationDate = new Date(value);\n if (Number.isNaN(notificationDate.getTime())) return 'earlier';\n const nowStartOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const notificationStartOfDay = new Date(\n notificationDate.getFullYear(),\n notificationDate.getMonth(),\n notificationDate.getDate(),\n );\n if (notificationStartOfDay.getTime() === nowStartOfDay.getTime()) return 'today';\n const yesterdayStartOfDay = new Date(nowStartOfDay);\n yesterdayStartOfDay.setDate(yesterdayStartOfDay.getDate() - 1);\n if (notificationStartOfDay.getTime() === yesterdayStartOfDay.getTime())\n return 'yesterday';\n const diffInDays =\n (now.getTime() - notificationDate.getTime()) / (1000 * 60 * 60 * 24);\n if (diffInDays <= 7) return 'past7Days';\n return 'earlier';\n}\n\nfunction readErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : '發生未知錯誤';\n}\n","'use client';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport {\n CalendarConfigProviderMoment,\n CalendarLocale,\n} from '@mezzanine-ui/react/moment';\nimport { AuthProvider } from './auth-provider';\nimport { NotificationDrawer } from '../components/notification-drawer';\nimport { NotificationDrawerProvider } from './notification-drawer-provider';\nimport { NotificationUnreadProvider } from './notification-unread-provider';\n\ninterface ProvidersProps {\n readonly children: ReactNode;\n /** Override Mezzanine calendar locale. Defaults to `CalendarLocale.ZH_TW`. */\n readonly locale?: CalendarLocale;\n /**\n * Public paths that should not trigger redirect to `/login` when there\n * is no session. Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n */\n readonly publicPaths?: readonly string[];\n /** Where to send unauthenticated users. Defaults to `'/login'`. */\n readonly loginPath?: string;\n}\n\n/**\n * One-stop BPM admin provider stack. Wires:\n *\n * - Mezzanine UI calendar locale (moment-based, `ZH_TW` by default)\n * - `<AuthProvider>` (BPM session via REST `/auth/*`)\n * - `<NotificationUnreadProvider>` (polls unread count)\n * - `<NotificationDrawerProvider>` (controls drawer open/close state)\n * - `<NotificationDrawer />` mounted at the root so the host navigation\n * bell (`<BPMNotificationBellButton />` or any custom trigger calling\n * `useNotificationDrawer().open`) can open it.\n *\n * Consumer hosts wrap this **inside** a `<RouterAdapterProvider>` (provided\n * by the `pages/*` subpath shims when consuming via Next.js, or wired by\n * hand for other frameworks).\n */\nexport function Providers({\n children,\n locale = CalendarLocale.ZH_TW,\n publicPaths,\n loginPath,\n}: ProvidersProps): ReactElement {\n return (\n <CalendarConfigProviderMoment locale={locale}>\n <AuthProvider publicPaths={publicPaths} loginPath={loginPath}>\n <NotificationUnreadProvider>\n <NotificationDrawerProvider>\n {children}\n <NotificationDrawer />\n </NotificationDrawerProvider>\n </NotificationUnreadProvider>\n </AuthProvider>\n </CalendarConfigProviderMoment>\n );\n}\n","'use client';\n\nimport { useAuth } from './auth-provider';\n\n/**\n * Drop-in logout handler for host navigation menus. Wraps the BPM auth\n * context's logout flow — calls `logoutApi()` against the BPM REST\n * session endpoint, clears the in-memory member, then redirects to the\n * configured `loginPath`.\n *\n * Hosts mount this on their own logout buttons / menu items so they do\n * not need to touch `useAuth()` directly. To customize the post-logout\n * destination, override the `loginPath` prop on `<BPMNextProviders>` or\n * `<AuthProvider>`.\n */\nexport function useBPMLogout(): () => Promise<void> {\n const { logout } = useAuth();\n return logout;\n}\n","'use client';\n\nimport type { ApiMember } from '@rytass/bpm-core-client';\nimport { useAuth } from './auth-provider';\n\n/**\n * Read the currently authenticated BPM member. Returns `null` when there\n * is no active session — typically only seen on the login page or during\n * the brief loading window before `<AuthProvider>` resolves the cookie.\n *\n * Convenience alias for `useAuth().member` aimed at host navigations\n * (avatar, display name, role-based menu visibility) that should not\n * depend on the broader `useAuth()` surface.\n */\nexport function useBPMMember(): ApiMember | null {\n const { member } = useAuth();\n return member;\n}\n",".root {\n display: inline-flex;\n position: relative;\n}\n\n.badge {\n align-items: center;\n background: #d92d20;\n border: 1px solid #fff;\n border-radius: 999px;\n color: #fff;\n display: inline-flex;\n font-size: 10px;\n font-weight: 600;\n height: 16px;\n justify-content: center;\n line-height: 1;\n min-width: 16px;\n padding: 0 4px;\n pointer-events: none;\n position: absolute;\n right: -4px;\n top: -4px;\n}\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { NavigationIconButton } from '@mezzanine-ui/react';\nimport { NotificationUnreadIcon } from '@mezzanine-ui/icons';\nimport { useNotificationDrawer } from '../lib/notification-drawer-provider';\nimport { useNotificationUnread } from '../lib/notification-unread-provider';\nimport styles from './bpm-notification-bell-button.module.scss';\n\nexport interface BPMNotificationBellButtonProps {\n /** Override the aria-label / tooltip. Defaults to `通知中心`. */\n readonly label?: string;\n}\n\n/**\n * Drop-in notification bell. Reads the unread count from\n * `<NotificationUnreadProvider>`, opens the BPM `<NotificationDrawer />`\n * mounted by `<Providers>` (or `<BPMNextProviders>`) on click, and\n * renders a small red badge with the unread count.\n *\n * Use this when the host navigation wants the BPM notification UX with\n * minimum wiring. Hosts that need a fully custom button can skip this\n * widget and consume `useNotificationDrawer()` + `useNotificationUnread()`\n * directly to wire their own trigger.\n *\n * Visual: uses Mezzanine `NavigationIconButton` so the bell aligns with\n * surrounding Mezzanine navigation chrome. The button is decoupled from\n * the `<Navigation>` container — it does not require a Mezzanine\n * navigation tree to render.\n */\nexport function BPMNotificationBellButton({\n label = '通知中心',\n}: BPMNotificationBellButtonProps = {}): ReactElement {\n const { open } = useNotificationDrawer();\n const { unreadCount } = useNotificationUnread();\n const ariaLabel = unreadCount > 0 ? `${label},${unreadCount} 則未讀` : label;\n return (\n <span className={styles.root}>\n <NavigationIconButton\n aria-label={ariaLabel}\n icon={NotificationUnreadIcon}\n onClick={(): void => {\n open();\n }}\n title={label}\n type=\"button\"\n />\n {unreadCount > 0 ? (\n <span className={styles.badge}>\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n ) : null}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,IACJ,EAAqD,IAAI;AAgB3D,SAAgB,EAA2B,EACzC,eACgD;CAChD,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAK,GAEpC,IAAO,QAAwB;EACnC,EAAU,EAAI;CAChB,GAAG,CAAC,CAAC,GACC,IAAQ,QAAwB;EACpC,EAA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E,YAAS,EAAsB,GACjC,EAAE,mBAAgB,EAAsB,GACxC,IAAY,IAAc,IAAI,GAAG,EAAM,GAAG,EAAY,QAAQ;CACpE,OACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,GAAD;GACE,cAAY;GACZ,MAAM;GACN,eAAqB;IACnB,EAAK;GACP;GACA,OAAO;GACP,MAAK;EACN,CAAA,GACA,IAAc,IACb,kBAAC,QAAD;GAAM,WAAW,EAAO;aACrB,IAAc,KAAK,QAAQ;EACxB,CAAA,IACJ,IACA;;AAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/lib/use-bpm-logout.ts","../src/lib/use-bpm-member.ts","../src/components/bpm-notification-bell-button.module.scss","../src/components/bpm-notification-bell-button.tsx"],"sourcesContent":["'use client';\n\nimport { useAuth } from './auth-provider';\n\n/**\n * Drop-in logout handler for host navigation menus. Wraps the BPM auth\n * context's logout flow — calls `logoutApi()` against the BPM REST\n * session endpoint, clears the in-memory member, then redirects to the\n * configured `loginPath`.\n *\n * Hosts mount this on their own logout buttons / menu items so they do\n * not need to touch `useAuth()` directly. To customize the post-logout\n * destination, override the `loginPath` prop on `<BPMNextProviders>` or\n * `<AuthProvider>`.\n */\nexport function useBPMLogout(): () => Promise<void> {\n const { logout } = useAuth();\n return logout;\n}\n","'use client';\n\nimport type { ApiMember } from '@rytass/bpm-core-client';\nimport { useAuth } from './auth-provider';\n\n/**\n * Read the currently authenticated BPM member. Returns `null` when there\n * is no active session — typically only seen on the login page or during\n * the brief loading window before `<AuthProvider>` resolves the cookie.\n *\n * Convenience alias for `useAuth().member` aimed at host navigations\n * (avatar, display name, role-based menu visibility) that should not\n * depend on the broader `useAuth()` surface.\n */\nexport function useBPMMember(): ApiMember | null {\n const { member } = useAuth();\n return member;\n}\n",".root {\n display: inline-flex;\n position: relative;\n}\n\n.badge {\n align-items: center;\n background: #d92d20;\n border: 1px solid #fff;\n border-radius: 999px;\n color: #fff;\n display: inline-flex;\n font-size: 10px;\n font-weight: 600;\n height: 16px;\n justify-content: center;\n line-height: 1;\n min-width: 16px;\n padding: 0 4px;\n pointer-events: none;\n position: absolute;\n right: -4px;\n top: -4px;\n}\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { NavigationIconButton } from '@mezzanine-ui/react';\nimport { NotificationUnreadIcon } from '@mezzanine-ui/icons';\nimport { useNotificationDrawer } from '../lib/notification-drawer-provider';\nimport { useNotificationUnread } from '../lib/notification-unread-provider';\nimport styles from './bpm-notification-bell-button.module.scss';\n\nexport interface BPMNotificationBellButtonProps {\n /** Override the aria-label / tooltip. Defaults to `通知中心`. */\n readonly label?: string;\n}\n\n/**\n * Drop-in notification bell. Reads the unread count from\n * `<NotificationUnreadProvider>`, opens the BPM `<NotificationDrawer />`\n * mounted by `<Providers>` (or `<BPMNextProviders>`) on click, and\n * renders a small red badge with the unread count.\n *\n * Use this when the host navigation wants the BPM notification UX with\n * minimum wiring. Hosts that need a fully custom button can skip this\n * widget and consume `useNotificationDrawer()` + `useNotificationUnread()`\n * directly to wire their own trigger.\n *\n * Visual: uses Mezzanine `NavigationIconButton` so the bell aligns with\n * surrounding Mezzanine navigation chrome. The button is decoupled from\n * the `<Navigation>` container — it does not require a Mezzanine\n * navigation tree to render.\n */\nexport function BPMNotificationBellButton({\n label = '通知中心',\n}: BPMNotificationBellButtonProps = {}): ReactElement {\n const { open } = useNotificationDrawer();\n const { unreadCount } = useNotificationUnread();\n const ariaLabel = unreadCount > 0 ? `${label},${unreadCount} 則未讀` : label;\n return (\n <span className={styles.root}>\n <NavigationIconButton\n aria-label={ariaLabel}\n icon={NotificationUnreadIcon}\n onClick={(): void => {\n open();\n }}\n title={label}\n type=\"button\"\n />\n {unreadCount > 0 ? (\n <span className={styles.badge}>\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n ) : null}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,IAAoC;CAClD,IAAM,EAAE,cAAW,EAAQ;CAC3B,OAAO;AACT;;;ACJA,SAAgB,IAAiC;CAC/C,IAAM,EAAE,cAAW,EAAQ;CAC3B,OAAO;AACT;;;;;;;AEaA,SAAgB,EAA0B,EACxC,WAAQ,WAC0B,CAAC,GAAiB;CACpD,IAAM,EAAE,YAAS,EAAsB,GACjC,EAAE,mBAAgB,EAAsB,GACxC,IAAY,IAAc,IAAI,GAAG,EAAM,GAAG,EAAY,QAAQ;CACpE,OACE,kBAAC,QAAD;EAAM,WAAW,EAAO;YAAxB,CACE,kBAAC,GAAD;GACE,cAAY;GACZ,MAAM;GACN,eAAqB;IACnB,EAAK;GACP;GACA,OAAO;GACP,MAAK;EACN,CAAA,GACA,IAAc,IACb,kBAAC,QAAD;GAAM,WAAW,EAAO;aACrB,IAAc,KAAK,QAAQ;EACxB,CAAA,IACJ,IACA;;AAEV"}
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunks/routes-config-fDVHmvXi.cjs");let t=require("react"),n=require("react/jsx-runtime"),r=require("next/navigation"),i=require("@rytass/bpm-core-react");function a({children:e,locale:a,publicPaths:o,loginPath:s}){let c=(0,r.useRouter)(),l=(0,r.usePathname)();return(0,n.jsx)(i.RouterAdapterProvider,{value:(0,t.useMemo)(()=>({pathname:l,push:e=>c.push(e),replace:e=>c.replace(e),back:()=>c.back(),searchParams:()=>(0,i.defaultBrowserSearchParams)()}),[c,l]),children:(0,n.jsx)(i.Providers,{locale:a,publicPaths:o,loginPath:s,children:e})})}exports.BPMNextProviders=a,exports.BPMRoutesProvider=e.t,exports.createDefaultBPMRoutes=e.n,exports.useBPMRoutes=e.r;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunks/router-adapter--gYs13E8.cjs"),t=require("../chunks/providers-D_zTbkQH.cjs"),n=require("../chunks/routes-config-fDVHmvXi.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("next/navigation");function o({children:n,locale:o,publicPaths:s,loginPath:c}){let l=(0,a.useRouter)(),u=(0,a.usePathname)();return(0,i.jsx)(e.t,{value:(0,r.useMemo)(()=>({pathname:u,push:e=>l.push(e),replace:e=>l.replace(e),back:()=>l.back(),searchParams:()=>e.n()}),[l,u]),children:(0,i.jsx)(t.t,{locale:o,publicPaths:s,loginPath:c,children:n})})}exports.BPMNextProviders=o,exports.BPMRoutesProvider=n.t,exports.createDefaultBPMRoutes=n.n,exports.useBPMRoutes=n.r;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport {\n Providers as BPMProviders,\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '@rytass/bpm-core-react';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":"+PA4EA,SAAgB,EAAiB,CAC/B,WACA,SACA,cACA,aACsC,CACtC,IAAM,GAAA,EAAA,EAAA,WAAuB,EACvB,GAAA,EAAA,EAAA,aAAuB,EAa7B,OACE,EAAA,EAAA,KAAC,EAAA,sBAAD,CAAuB,OAAA,EAAA,EAAA,cAXhB,CACL,WACA,KAAO,GAAuB,EAAW,KAAK,CAAI,EAClD,QAAU,GAAuB,EAAW,QAAQ,CAAI,EACxD,SAAkB,EAAW,KAAK,EAClC,kBAAA,EAAA,EAAA,4BAAgE,CAClE,GACA,CAAC,EAAY,CAAQ,CAIS,YAC5B,EAAA,EAAA,KAAC,EAAA,UAAD,CACU,SACK,cACF,YAEV,UACW,CAAA,CACO,CAAA,CAE3B"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\nimport { Providers as BPMProviders } from '../lib/providers';\nimport {\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '../lib/router-adapter';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":"4TA4EA,SAAgB,EAAiB,CAC/B,WACA,SACA,cACA,aACsC,CACtC,IAAM,GAAA,EAAA,EAAA,WAAuB,EACvB,GAAA,EAAA,EAAA,aAAuB,EAa7B,OACE,EAAA,EAAA,KAAC,EAAA,EAAD,CAAuB,OAAA,EAAA,EAAA,cAXhB,CACL,WACA,KAAO,GAAuB,EAAW,KAAK,CAAI,EAClD,QAAU,GAAuB,EAAW,QAAQ,CAAI,EACxD,SAAkB,EAAW,KAAK,EAClC,iBAAqC,EAAA,EAA2B,CAClE,GACA,CAAC,EAAY,CAAQ,CAIS,YAC5B,EAAA,EAAA,KAAC,EAAA,EAAD,CACU,SACK,cACF,YAEV,UACW,CAAA,CACO,CAAA,CAE3B"}