@voyant-travel/notifications-react 0.111.7
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.
- package/LICENSE +201 -0
- package/README.md +30 -0
- package/dist/admin/index.d.ts +70 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +104 -0
- package/dist/admin/notification-deliveries-host.d.ts +7 -0
- package/dist/admin/notification-deliveries-host.d.ts.map +1 -0
- package/dist/admin/notification-deliveries-host.js +92 -0
- package/dist/admin/notification-delivery-detail-dialog.d.ts +8 -0
- package/dist/admin/notification-delivery-detail-dialog.d.ts.map +1 -0
- package/dist/admin/notification-delivery-detail-dialog.js +30 -0
- package/dist/admin/notification-reminder-rule-detail-host.d.ts +12 -0
- package/dist/admin/notification-reminder-rule-detail-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rule-detail-host.js +23 -0
- package/dist/admin/notification-reminder-rule-dialog.d.ts +10 -0
- package/dist/admin/notification-reminder-rule-dialog.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rule-dialog.js +122 -0
- package/dist/admin/notification-reminder-rules-host.d.ts +8 -0
- package/dist/admin/notification-reminder-rules-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rules-host.js +57 -0
- package/dist/admin/notification-reminder-runs-host.d.ts +7 -0
- package/dist/admin/notification-reminder-runs-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-runs-host.js +28 -0
- package/dist/admin/notification-settings-host.d.ts +7 -0
- package/dist/admin/notification-settings-host.d.ts.map +1 -0
- package/dist/admin/notification-settings-host.js +11 -0
- package/dist/admin/notification-template-attachments-field.d.ts +10 -0
- package/dist/admin/notification-template-attachments-field.d.ts.map +1 -0
- package/dist/admin/notification-template-attachments-field.js +6 -0
- package/dist/admin/notification-template-authoring-help.d.ts +25 -0
- package/dist/admin/notification-template-authoring-help.d.ts.map +1 -0
- package/dist/admin/notification-template-authoring-help.js +8 -0
- package/dist/admin/notification-template-detail-host.d.ts +11 -0
- package/dist/admin/notification-template-detail-host.d.ts.map +1 -0
- package/dist/admin/notification-template-detail-host.js +159 -0
- package/dist/admin/notification-template-dialog-utils.d.ts +53 -0
- package/dist/admin/notification-template-dialog-utils.d.ts.map +1 -0
- package/dist/admin/notification-template-dialog-utils.js +112 -0
- package/dist/admin/notification-template-dialog.d.ts +10 -0
- package/dist/admin/notification-template-dialog.d.ts.map +1 -0
- package/dist/admin/notification-template-dialog.js +253 -0
- package/dist/admin/notification-template-rendered-preview.d.ts +14 -0
- package/dist/admin/notification-template-rendered-preview.d.ts.map +1 -0
- package/dist/admin/notification-template-rendered-preview.js +6 -0
- package/dist/admin/notification-templates-host.d.ts +9 -0
- package/dist/admin/notification-templates-host.d.ts.map +1 -0
- package/dist/admin/notification-templates-host.js +52 -0
- package/dist/admin/notifications-admin-shared.d.ts +14 -0
- package/dist/admin/notifications-admin-shared.d.ts.map +1 -0
- package/dist/admin/notifications-admin-shared.js +17 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.d.ts +8 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.js +10 -0
- package/dist/admin/pages/notification-template-detail-page.d.ts +7 -0
- package/dist/admin/pages/notification-template-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/notification-template-detail-page.js +9 -0
- package/dist/admin/reminders-preview-host.d.ts +7 -0
- package/dist/admin/reminders-preview-host.d.ts.map +1 -0
- package/dist/admin/reminders-preview-host.js +13 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +71 -0
- package/dist/components/notification-settings-form.d.ts +2 -0
- package/dist/components/notification-settings-form.d.ts.map +1 -0
- package/dist/components/notification-settings-form.js +66 -0
- package/dist/components/reminders-preview-list.d.ts +6 -0
- package/dist/components/reminders-preview-list.d.ts.map +1 -0
- package/dist/components/reminders-preview-list.js +19 -0
- package/dist/components/stage-channel-editor-dialog.d.ts +11 -0
- package/dist/components/stage-channel-editor-dialog.d.ts.map +1 -0
- package/dist/components/stage-channel-editor-dialog.js +77 -0
- package/dist/components/stage-channel-list.d.ts +6 -0
- package/dist/components/stage-channel-list.d.ts.map +1 -0
- package/dist/components/stage-channel-list.js +20 -0
- package/dist/components/stage-editor-dialog.d.ts +10 -0
- package/dist/components/stage-editor-dialog.d.ts.map +1 -0
- package/dist/components/stage-editor-dialog.js +104 -0
- package/dist/components/stage-list.d.ts +5 -0
- package/dist/components/stage-list.d.ts.map +1 -0
- package/dist/components/stage-list.js +34 -0
- package/dist/components/template-picker.d.ts +19 -0
- package/dist/components/template-picker.d.ts.map +1 -0
- package/dist/components/template-picker.js +26 -0
- package/dist/components/timezone-combobox.d.ts +9 -0
- package/dist/components/timezone-combobox.d.ts.map +1 -0
- package/dist/components/timezone-combobox.js +67 -0
- package/dist/hooks/index.d.ts +19 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/use-notification-deliveries.d.ts +39 -0
- package/dist/hooks/use-notification-deliveries.d.ts.map +1 -0
- package/dist/hooks/use-notification-deliveries.js +12 -0
- package/dist/hooks/use-notification-delivery-mutation.d.ts +32 -0
- package/dist/hooks/use-notification-delivery-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-delivery-mutation.js +24 -0
- package/dist/hooks/use-notification-delivery.d.ts +32 -0
- package/dist/hooks/use-notification-delivery.d.ts.map +1 -0
- package/dist/hooks/use-notification-delivery.js +12 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.d.ts +53 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.js +31 -0
- package/dist/hooks/use-notification-reminder-rule.d.ts +19 -0
- package/dist/hooks/use-notification-reminder-rule.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rule.js +12 -0
- package/dist/hooks/use-notification-reminder-rules.d.ts +25 -0
- package/dist/hooks/use-notification-reminder-rules.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rules.js +12 -0
- package/dist/hooks/use-notification-reminder-runs.d.ts +56 -0
- package/dist/hooks/use-notification-reminder-runs.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-runs.js +12 -0
- package/dist/hooks/use-notification-settings.d.ts +50 -0
- package/dist/hooks/use-notification-settings.d.ts.map +1 -0
- package/dist/hooks/use-notification-settings.js +26 -0
- package/dist/hooks/use-notification-template-authoring.d.ts +5 -0
- package/dist/hooks/use-notification-template-authoring.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-authoring.js +8 -0
- package/dist/hooks/use-notification-template-mutation.d.ts +54 -0
- package/dist/hooks/use-notification-template-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-mutation.js +31 -0
- package/dist/hooks/use-notification-template-tools.d.ts +80 -0
- package/dist/hooks/use-notification-template-tools.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-tools.js +21 -0
- package/dist/hooks/use-notification-template.d.ts +20 -0
- package/dist/hooks/use-notification-template.d.ts.map +1 -0
- package/dist/hooks/use-notification-template.js +12 -0
- package/dist/hooks/use-notification-templates.d.ts +26 -0
- package/dist/hooks/use-notification-templates.d.ts.map +1 -0
- package/dist/hooks/use-notification-templates.js +12 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.d.ts +93 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.d.ts.map +1 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.js +53 -0
- package/dist/hooks/use-reminder-rule-stages.d.ts +25 -0
- package/dist/hooks/use-reminder-rule-stages.d.ts.map +1 -0
- package/dist/hooks/use-reminder-rule-stages.js +12 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.d.ts +48 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.d.ts.map +1 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.js +42 -0
- package/dist/hooks/use-reminder-stage-channels.d.ts +18 -0
- package/dist/hooks/use-reminder-stage-channels.d.ts.map +1 -0
- package/dist/hooks/use-reminder-stage-channels.js +12 -0
- package/dist/hooks/use-reminders-preview.d.ts +21 -0
- package/dist/hooks/use-reminders-preview.d.ts.map +1 -0
- package/dist/hooks/use-reminders-preview.js +12 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +385 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +386 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +26 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +3 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +385 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +72 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +19 -0
- package/dist/query-options.d.ts +1252 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +120 -0
- package/dist/schemas.d.ts +796 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +173 -0
- package/dist/ui.d.ts +9 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +8 -0
- package/package.json +138 -0
- package/src/styles.css +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept and charge a
|
|
167
|
+
fee for, the acceptance of support, warranty, indemnity, or
|
|
168
|
+
other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 PixelMakers Studio SRL
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @voyant-travel/notifications-react
|
|
2
|
+
|
|
3
|
+
The notifications client tier: headless data hooks/clients plus the styled UI
|
|
4
|
+
components and admin pages (formerly `@voyant-travel/notifications-ui`).
|
|
5
|
+
|
|
6
|
+
Headless consumers import from the root, `./hooks`, or `./client` — these pull
|
|
7
|
+
no styling peers. Styled surfaces live under `./ui`, `./components/*`,
|
|
8
|
+
`./admin`, `./i18n`, and `./styles.css`, whose heavier peers (`@voyant-travel/ui`,
|
|
9
|
+
`@voyant-travel/admin`, `lucide-react`, `react-hook-form`) are optional and only
|
|
10
|
+
needed when you import those subpaths.
|
|
11
|
+
|
|
12
|
+
React components for Voyant notifications: reminder sequence editor (stages + channels), notification settings, and preview.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @voyant-travel/notifications-react @voyant-travel/ui @tanstack/react-query react react-dom
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import "@voyant-travel/notifications-react/styles.css"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Components
|
|
25
|
+
|
|
26
|
+
- `<StageList />` — reminder rule's ordered stages with reorder + delete.
|
|
27
|
+
- `<StageEditorDialog />` — create / edit a stage (anchor, window, cadence).
|
|
28
|
+
- `<StageChannelEditorDialog />` — create / edit a channel under a stage.
|
|
29
|
+
- `<NotificationSettingsForm />` — quiet hours, blackout dates, weekend skip, recipient rate limit, suppression window.
|
|
30
|
+
- `<RemindersPreviewList />` — what would fire on a given date with reasoning.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type AdminExtension } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* Semantic destinations the notifications admin surfaces navigate to
|
|
4
|
+
* (packaged-admin RFC §4.7): the templates list/detail pair (list rows and
|
|
5
|
+
* the detail page's back link) and the reminder rules list/detail pair
|
|
6
|
+
* (the per-rule "Manage stages" link and the stage editor's back link).
|
|
7
|
+
* All shapes are closed, so they are declared here directly.
|
|
8
|
+
*/
|
|
9
|
+
declare module "@voyant-travel/admin" {
|
|
10
|
+
interface AdminDestinations {
|
|
11
|
+
/** The notification templates list page. */
|
|
12
|
+
"notificationTemplate.list": Record<string, never>;
|
|
13
|
+
/** A notification template's detail page. */
|
|
14
|
+
"notificationTemplate.detail": {
|
|
15
|
+
templateId: string;
|
|
16
|
+
};
|
|
17
|
+
/** The reminder rules list page. */
|
|
18
|
+
"notificationReminderRule.list": Record<string, never>;
|
|
19
|
+
/** A reminder rule's detail page (stage sequence editor). */
|
|
20
|
+
"notificationReminderRule.detail": {
|
|
21
|
+
ruleId: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export type { NotificationReminderRuleDetailHostProps } from "./notification-reminder-rule-detail-host.js";
|
|
26
|
+
export type { NotificationTemplateDetailHostProps } from "./notification-template-detail-host.js";
|
|
27
|
+
export interface CreateNotificationsAdminExtensionOptions {
|
|
28
|
+
/** Mount path of the notifications pages inside the admin workspace. Default `/notifications`. */
|
|
29
|
+
basePath?: string;
|
|
30
|
+
/** Localized page titles. Defaults are the English operator nav labels. */
|
|
31
|
+
labels?: {
|
|
32
|
+
templates?: string;
|
|
33
|
+
reminderRules?: string;
|
|
34
|
+
deliveries?: string;
|
|
35
|
+
reminderRuns?: string;
|
|
36
|
+
preview?: string;
|
|
37
|
+
settings?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The notifications admin contribution (packaged-admin RFC Phase 3,
|
|
42
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
43
|
+
*
|
|
44
|
+
* NAVIGATION: deliberately none. The Notifications nav group (templates,
|
|
45
|
+
* reminder rules, deliveries, reminder runs, preview, settings) is part of
|
|
46
|
+
* the BASE operator navigation — see `createOperatorAdminNavigation` in
|
|
47
|
+
* `@voyant-travel/admin` — so contributing nav entries here would duplicate
|
|
48
|
+
* them. If the base nav ever drops the notifications group, this extension
|
|
49
|
+
* is where the entries move.
|
|
50
|
+
*
|
|
51
|
+
* ROUTES: full implementations (packaged-admin RFC §4.8 endgame) — each
|
|
52
|
+
* contribution carries a lazy `page` module loader, so hosts bind them
|
|
53
|
+
* through their code-assembled admin route tree with no per-route files.
|
|
54
|
+
* The notifications pages keep their filter state component-local and fetch
|
|
55
|
+
* client-side, so contributions carry no loader, no search contract and no
|
|
56
|
+
* SSR override. {@link NotificationTemplatesHost},
|
|
57
|
+
* {@link NotificationReminderRulesHost}, {@link NotificationDeliveriesHost},
|
|
58
|
+
* {@link NotificationReminderRunsHost}, {@link RemindersPreviewHost} and
|
|
59
|
+
* {@link NotificationSettingsHost} are zero-prop; the detail contributions
|
|
60
|
+
* resolve wrapper pages (`./pages/*`) that bind the matched `$id` param onto
|
|
61
|
+
* {@link NotificationTemplateDetailHost} and
|
|
62
|
+
* {@link NotificationReminderRuleDetailHost}. Pages stay code-split because
|
|
63
|
+
* every `page` is a dynamic import of the specific host module, never a
|
|
64
|
+
* static reference from this factory.
|
|
65
|
+
*
|
|
66
|
+
* WIDGETS: none today. No cross-domain notifications card is slot-mounted —
|
|
67
|
+
* deliveries shown on other domains' detail pages are those hosts' concern.
|
|
68
|
+
*/
|
|
69
|
+
export declare function createNotificationsAdminExtension(options?: CreateNotificationsAdminExtensionOptions): AdminExtension;
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,sBAAsB,CAAA;AAE7B;;;;;;GAMG;AACH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,iBAAiB;QACzB,4CAA4C;QAC5C,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QAClD,6CAA6C;QAC7C,6BAA6B,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAA;QACrD,oCAAoC;QACpC,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACtD,6DAA6D;QAC7D,iCAAiC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KACtD;CACF;AAWD,YAAY,EAAE,uCAAuC,EAAE,MAAM,6CAA6C,CAAA;AAC1G,YAAY,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAA;AAEjG,MAAM,WAAW,wCAAwC;IACvD,kGAAkG;IAClG,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,cAAc,CAmGhB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { adminRoutePageModule, defineAdminExtension, } from "@voyant-travel/admin";
|
|
2
|
+
/**
|
|
3
|
+
* The notifications admin contribution (packaged-admin RFC Phase 3,
|
|
4
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
5
|
+
*
|
|
6
|
+
* NAVIGATION: deliberately none. The Notifications nav group (templates,
|
|
7
|
+
* reminder rules, deliveries, reminder runs, preview, settings) is part of
|
|
8
|
+
* the BASE operator navigation — see `createOperatorAdminNavigation` in
|
|
9
|
+
* `@voyant-travel/admin` — so contributing nav entries here would duplicate
|
|
10
|
+
* them. If the base nav ever drops the notifications group, this extension
|
|
11
|
+
* is where the entries move.
|
|
12
|
+
*
|
|
13
|
+
* ROUTES: full implementations (packaged-admin RFC §4.8 endgame) — each
|
|
14
|
+
* contribution carries a lazy `page` module loader, so hosts bind them
|
|
15
|
+
* through their code-assembled admin route tree with no per-route files.
|
|
16
|
+
* The notifications pages keep their filter state component-local and fetch
|
|
17
|
+
* client-side, so contributions carry no loader, no search contract and no
|
|
18
|
+
* SSR override. {@link NotificationTemplatesHost},
|
|
19
|
+
* {@link NotificationReminderRulesHost}, {@link NotificationDeliveriesHost},
|
|
20
|
+
* {@link NotificationReminderRunsHost}, {@link RemindersPreviewHost} and
|
|
21
|
+
* {@link NotificationSettingsHost} are zero-prop; the detail contributions
|
|
22
|
+
* resolve wrapper pages (`./pages/*`) that bind the matched `$id` param onto
|
|
23
|
+
* {@link NotificationTemplateDetailHost} and
|
|
24
|
+
* {@link NotificationReminderRuleDetailHost}. Pages stay code-split because
|
|
25
|
+
* every `page` is a dynamic import of the specific host module, never a
|
|
26
|
+
* static reference from this factory.
|
|
27
|
+
*
|
|
28
|
+
* WIDGETS: none today. No cross-domain notifications card is slot-mounted —
|
|
29
|
+
* deliveries shown on other domains' detail pages are those hosts' concern.
|
|
30
|
+
*/
|
|
31
|
+
export function createNotificationsAdminExtension(options = {}) {
|
|
32
|
+
const { basePath = "/notifications", labels = {} } = options;
|
|
33
|
+
const { templates = "Templates", reminderRules = "Reminder Rules", deliveries = "Deliveries", reminderRuns = "Reminder Runs", preview = "Preview", settings = "Settings", } = labels;
|
|
34
|
+
return defineAdminExtension({
|
|
35
|
+
id: "notifications",
|
|
36
|
+
routes: [
|
|
37
|
+
{
|
|
38
|
+
// Index redirect (formerly the host's `notifications/index.tsx`
|
|
39
|
+
// file route): `/notifications` lands on the templates page.
|
|
40
|
+
id: "notifications-index",
|
|
41
|
+
path: basePath,
|
|
42
|
+
title: templates,
|
|
43
|
+
redirectTo: `${basePath}/templates`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "notifications-templates-index",
|
|
47
|
+
path: `${basePath}/templates`,
|
|
48
|
+
title: templates,
|
|
49
|
+
// Route-backed destination (RFC §4.7 endgame): the key resolves by
|
|
50
|
+
// pure path interpolation of this route, so the host's resolver is
|
|
51
|
+
// generated (`voyant admin generate --destinations`).
|
|
52
|
+
destination: "notificationTemplate.list",
|
|
53
|
+
page: () => import("./notification-templates-host.js").then((module) => adminRoutePageModule(module.NotificationTemplatesHost)),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "notifications-templates-detail",
|
|
57
|
+
path: `${basePath}/templates/$id`,
|
|
58
|
+
title: templates,
|
|
59
|
+
destination: "notificationTemplate.detail",
|
|
60
|
+
destinationParams: { id: "templateId" },
|
|
61
|
+
page: () => import("./pages/notification-template-detail-page.js"),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "notifications-reminder-rules-index",
|
|
65
|
+
path: `${basePath}/reminder-rules`,
|
|
66
|
+
title: reminderRules,
|
|
67
|
+
destination: "notificationReminderRule.list",
|
|
68
|
+
page: () => import("./notification-reminder-rules-host.js").then((module) => adminRoutePageModule(module.NotificationReminderRulesHost)),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "notifications-reminder-rules-detail",
|
|
72
|
+
path: `${basePath}/reminder-rules/$id`,
|
|
73
|
+
title: reminderRules,
|
|
74
|
+
destination: "notificationReminderRule.detail",
|
|
75
|
+
destinationParams: { id: "ruleId" },
|
|
76
|
+
page: () => import("./pages/notification-reminder-rule-detail-page.js"),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "notifications-deliveries",
|
|
80
|
+
path: `${basePath}/deliveries`,
|
|
81
|
+
title: deliveries,
|
|
82
|
+
page: () => import("./notification-deliveries-host.js").then((module) => adminRoutePageModule(module.NotificationDeliveriesHost)),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "notifications-reminder-runs",
|
|
86
|
+
path: `${basePath}/reminder-runs`,
|
|
87
|
+
title: reminderRuns,
|
|
88
|
+
page: () => import("./notification-reminder-runs-host.js").then((module) => adminRoutePageModule(module.NotificationReminderRunsHost)),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "notifications-preview",
|
|
92
|
+
path: `${basePath}/preview`,
|
|
93
|
+
title: preview,
|
|
94
|
+
page: () => import("./reminders-preview-host.js").then((module) => adminRoutePageModule(module.RemindersPreviewHost)),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "notifications-settings",
|
|
98
|
+
path: `${basePath}/settings`,
|
|
99
|
+
title: settings,
|
|
100
|
+
page: () => import("./notification-settings-host.js").then((module) => adminRoutePageModule(module.NotificationSettingsHost)),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Packaged admin host for the notification deliveries page (packaged-admin
|
|
3
|
+
* RFC Phase 3). Zero-prop: filter state stays component-local and the
|
|
4
|
+
* details dialog is in-page — no cross-route navigation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function NotificationDeliveriesHost(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=notification-deliveries-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-deliveries-host.d.ts","sourceRoot":"","sources":["../../src/admin/notification-deliveries-host.tsx"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,wBAAgB,0BAA0B,4CA+KzC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge, Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogHeader, DialogTitle, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyant-travel/ui/components";
|
|
4
|
+
import { Loader2, RotateCcw, Search } from "lucide-react";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useNotificationsUiMessagesOrDefault } from "../i18n/index.js";
|
|
7
|
+
import { useNotificationDeliveries, useNotificationDeliveryMutation, } from "../index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Packaged admin host for the notification deliveries page (packaged-admin
|
|
10
|
+
* RFC Phase 3). Zero-prop: filter state stays component-local and the
|
|
11
|
+
* details dialog is in-page — no cross-route navigation.
|
|
12
|
+
*/
|
|
13
|
+
export function NotificationDeliveriesHost() {
|
|
14
|
+
const messages = useNotificationsUiMessagesOrDefault();
|
|
15
|
+
const t = messages.admin.deliveriesPage;
|
|
16
|
+
const common = messages.admin.common;
|
|
17
|
+
const [channel, setChannel] = useState("all");
|
|
18
|
+
const [status, setStatus] = useState("all");
|
|
19
|
+
const [selectedDelivery, setSelectedDelivery] = useState(null);
|
|
20
|
+
const deliveryMutation = useNotificationDeliveryMutation();
|
|
21
|
+
const selectedDeliveryId = selectedDelivery?.id;
|
|
22
|
+
const { data, isPending } = useNotificationDeliveries({
|
|
23
|
+
channel: channel === "all" ? undefined : channel,
|
|
24
|
+
status: status === "all" ? undefined : status,
|
|
25
|
+
limit: 50,
|
|
26
|
+
offset: 0,
|
|
27
|
+
});
|
|
28
|
+
return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight", children: t.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: t.description })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs(Select, { value: channel, onValueChange: (value) => setChannel(value ?? "all"), children: [_jsx(SelectTrigger, { className: "w-[140px]", children: _jsx(SelectValue, { placeholder: common.channelFilterPlaceholder }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: common.allChannels }), _jsx(SelectItem, { value: "email", children: common.channelEmail }), _jsx(SelectItem, { value: "sms", children: common.channelSms })] })] }), _jsxs(Select, { value: status, onValueChange: (value) => setStatus(value ?? "all"), children: [_jsx(SelectTrigger, { className: "w-[140px]", children: _jsx(SelectValue, { placeholder: common.statusFilterPlaceholder }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: common.allStatuses }), _jsx(SelectItem, { value: "pending", children: common.statusPending }), _jsx(SelectItem, { value: "sent", children: common.statusSent }), _jsx(SelectItem, { value: "failed", children: common.statusFailed }), _jsx(SelectItem, { value: "cancelled", children: common.statusCancelled })] })] })] }), isPending ? (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) })) : null, !isPending && (!data?.data || data.data.length === 0) ? (_jsx("div", { className: "rounded-md border border-dashed p-8 text-center", children: _jsx("p", { className: "text-sm text-muted-foreground", children: t.empty }) })) : null, !isPending && data?.data && data.data.length > 0 ? (_jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/40 text-left text-xs uppercase tracking-wide text-muted-foreground", children: _jsxs("tr", { children: [_jsx("th", { className: "px-4 py-3", children: "To" }), _jsx("th", { className: "px-4 py-3", children: "Template" }), _jsx("th", { className: "px-4 py-3", children: "Channel" }), _jsx("th", { className: "px-4 py-3", children: "Provider" }), _jsx("th", { className: "px-4 py-3", children: "Status" }), _jsx("th", { className: "px-4 py-3", children: "Created" }), _jsx("th", { className: "px-4 py-3 text-right", children: "Logs" })] }) }), _jsx("tbody", { children: data.data.map((delivery) => (_jsxs("tr", { className: "border-t", children: [_jsxs("td", { className: "px-4 py-3", children: [_jsx("div", { children: delivery.toAddress }), delivery.subject ? (_jsx("div", { className: "text-xs text-muted-foreground", children: delivery.subject })) : null] }), _jsx("td", { className: "px-4 py-3 font-mono text-xs", children: delivery.templateSlug ?? common.directTemplate }), _jsx("td", { className: "px-4 py-3", children: _jsx(Badge, { variant: "outline", children: delivery.channel }) }), _jsx("td", { className: "px-4 py-3", children: delivery.provider }), _jsxs("td", { className: "px-4 py-3", children: [_jsx(Badge, { variant: delivery.status === "sent"
|
|
29
|
+
? "default"
|
|
30
|
+
: delivery.status === "failed"
|
|
31
|
+
? "destructive"
|
|
32
|
+
: "secondary", children: delivery.status }), delivery.status === "failed" && delivery.errorMessage ? (_jsx("div", { className: "mt-1 max-w-[280px] truncate text-destructive text-xs", children: delivery.errorMessage })) : null] }), _jsx("td", { className: "px-4 py-3", children: new Date(delivery.createdAt).toLocaleString() }), _jsx("td", { className: "px-4 py-3 text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [delivery.status === "failed" ? (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: deliveryMutation.resend.isPending, onClick: () => {
|
|
33
|
+
deliveryMutation.resend.mutate(delivery.id, {
|
|
34
|
+
onError(error) {
|
|
35
|
+
window.alert(error instanceof Error ? error.message : t.resendFailed);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}, children: [deliveryMutation.resend.isPending ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(RotateCcw, { className: "mr-2 h-4 w-4" })), t.resend] })) : null, _jsxs(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => setSelectedDelivery(delivery), children: [_jsx(Search, { className: "mr-2 h-4 w-4" }), t.detailsButton] })] }) })] }, delivery.id))) })] }) })) : null, _jsx(DeliveryDetailsDialog, { messages: messages, delivery: selectedDelivery, open: Boolean(selectedDelivery), onOpenChange: (open) => {
|
|
39
|
+
if (!open)
|
|
40
|
+
setSelectedDelivery(null);
|
|
41
|
+
}, onResend: selectedDelivery?.status === "failed" && selectedDeliveryId
|
|
42
|
+
? () => {
|
|
43
|
+
deliveryMutation.resend.mutate(selectedDeliveryId, {
|
|
44
|
+
onError(error) {
|
|
45
|
+
window.alert(error instanceof Error ? error.message : t.resendFailed);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
: undefined, isResending: deliveryMutation.resend.isPending })] }));
|
|
50
|
+
}
|
|
51
|
+
function DeliveryDetailsDialog({ messages, delivery, open, onOpenChange, onResend, isResending = false, }) {
|
|
52
|
+
if (!delivery)
|
|
53
|
+
return null;
|
|
54
|
+
const t = messages.admin.deliveriesPage;
|
|
55
|
+
const failureLog = readRecord(delivery.metadata?.failureLog);
|
|
56
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { size: "xl", children: [_jsx(DialogHeader, { children: _jsxs("div", { className: "flex items-start justify-between gap-4 pr-8", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(DialogTitle, { children: t.dialogTitle }), _jsx(DialogDescription, { children: t.dialogDescription })] }), onResend ? (_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: isResending, onClick: onResend, children: [isResending ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(RotateCcw, { className: "mr-2 h-4 w-4" })), t.resend] })) : null] }) }), _jsxs(DialogBody, { className: "space-y-5", children: [_jsxs("section", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(Detail, { label: t.labels.deliveryId, value: delivery.id, mono: true }), _jsx(Detail, { label: t.labels.status, value: delivery.status }), _jsx(Detail, { label: t.labels.provider, value: delivery.provider }), _jsx(Detail, { label: t.labels.providerMessageId, value: delivery.providerMessageId ?? "—", mono: true }), _jsx(Detail, { label: t.labels.template, value: delivery.templateSlug ?? messages.admin.common.directTemplate, mono: true }), _jsx(Detail, { label: t.labels.channel, value: delivery.channel }), _jsx(Detail, { label: t.labels.created, value: formatDateTime(delivery.createdAt) }), _jsx(Detail, { label: t.labels.failed, value: formatDateTime(delivery.failedAt) }), _jsx(Detail, { label: t.labels.sent, value: formatDateTime(delivery.sentAt) }), _jsx(Detail, { label: t.labels.scheduled, value: formatDateTime(delivery.scheduledFor) })] }), delivery.errorMessage ? (_jsx(LogSection, { title: t.errorMessageTitle, tone: "destructive", children: delivery.errorMessage })) : null, failureLog ? (_jsx(JsonSection, { title: t.failureLogTitle, value: failureLog })) : delivery.status === "failed" ? (_jsx(LogSection, { title: t.failureLogTitle, children: t.noFailureLog })) : null, _jsxs("section", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(Detail, { label: t.labels.to, value: delivery.toAddress }), _jsx(Detail, { label: t.labels.from, value: delivery.fromAddress ?? "—" }), _jsx(Detail, { label: t.labels.subject, value: delivery.subject ?? "—" }), _jsx(Detail, { label: t.labels.target, value: formatTarget(delivery), mono: true })] }), _jsx(JsonSection, { title: t.payloadDataTitle, value: delivery.payloadData }), _jsx(JsonSection, { title: t.metadataTitle, value: delivery.metadata }), _jsx(BodySection, { title: t.textBodyTitle, value: delivery.textBody }), _jsx(BodySection, { title: t.htmlBodyTitle, value: delivery.htmlBody })] })] }) }));
|
|
57
|
+
}
|
|
58
|
+
function Detail({ label, value, mono = false }) {
|
|
59
|
+
return (_jsxs("div", { className: "rounded-md border bg-muted/20 p-3", children: [_jsx("div", { className: "text-muted-foreground text-xs uppercase tracking-wide", children: label }), _jsx("div", { className: `mt-1 break-words text-sm ${mono ? "font-mono" : ""}`, children: value || "—" })] }));
|
|
60
|
+
}
|
|
61
|
+
function LogSection({ title, children, tone, }) {
|
|
62
|
+
return (_jsxs("section", { className: "space-y-2", children: [_jsx("h2", { className: "font-medium text-sm", children: title }), _jsx("pre", { className: `max-h-56 overflow-auto rounded-md border p-3 text-xs ${
|
|
63
|
+
// i18n-literal-ok tailwind utilities keyed off a tone enum, not user-facing copy.
|
|
64
|
+
tone === "destructive" ? "border-destructive/30 bg-destructive/10" : "bg-muted/30"}`, children: children })] }));
|
|
65
|
+
}
|
|
66
|
+
function JsonSection({ title, value }) {
|
|
67
|
+
if (!value)
|
|
68
|
+
return null;
|
|
69
|
+
return _jsx(LogSection, { title: title, children: JSON.stringify(value, null, 2) });
|
|
70
|
+
}
|
|
71
|
+
function BodySection({ title, value }) {
|
|
72
|
+
if (!value)
|
|
73
|
+
return null;
|
|
74
|
+
return _jsx(LogSection, { title: title, children: value });
|
|
75
|
+
}
|
|
76
|
+
function readRecord(value) {
|
|
77
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
78
|
+
? value
|
|
79
|
+
: null;
|
|
80
|
+
}
|
|
81
|
+
function formatDateTime(value) {
|
|
82
|
+
return value ? new Date(value).toLocaleString() : "—";
|
|
83
|
+
}
|
|
84
|
+
function formatTarget(delivery) {
|
|
85
|
+
const targetId = delivery.bookingId ??
|
|
86
|
+
delivery.invoiceId ??
|
|
87
|
+
delivery.paymentSessionId ??
|
|
88
|
+
delivery.personId ??
|
|
89
|
+
delivery.organizationId ??
|
|
90
|
+
delivery.targetId;
|
|
91
|
+
return targetId ? `${delivery.targetType}:${targetId}` : delivery.targetType;
|
|
92
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type NotificationDeliveryDetailDialogProps = {
|
|
2
|
+
deliveryId: string | null;
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function NotificationDeliveryDetailDialog({ deliveryId, open, onOpenChange, }: NotificationDeliveryDetailDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=notification-delivery-detail-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-delivery-detail-dialog.d.ts","sourceRoot":"","sources":["../../src/admin/notification-delivery-detail-dialog.tsx"],"names":[],"mappings":"AAeA,KAAK,qCAAqC,GAAG;IAC3C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CACtC,CAAA;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,UAAU,EACV,IAAI,EACJ,YAAY,GACb,EAAE,qCAAqC,2CA+HvC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Badge, Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from "@voyant-travel/ui/components";
|
|
4
|
+
import { Loader2 } from "lucide-react";
|
|
5
|
+
import { useNotificationsUiMessagesOrDefault } from "../i18n/index.js";
|
|
6
|
+
import { useNotificationDelivery } from "../index.js";
|
|
7
|
+
export function NotificationDeliveryDetailDialog({ deliveryId, open, onOpenChange, }) {
|
|
8
|
+
const messages = useNotificationsUiMessagesOrDefault();
|
|
9
|
+
const t = messages.admin.deliveryDetail;
|
|
10
|
+
const { data, isPending, error } = useNotificationDelivery(deliveryId ?? "", {
|
|
11
|
+
enabled: open && Boolean(deliveryId),
|
|
12
|
+
});
|
|
13
|
+
const delivery = data ?? null;
|
|
14
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-4xl", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t.title }) }), _jsxs("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto py-4 pr-1", children: [isPending ? (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) })) : null, !isPending && error ? (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive", children: error instanceof Error ? error.message : t.loadFailed })) : null, !isPending && delivery ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4", children: [_jsx(InfoCard, { label: t.labels.to, value: delivery.toAddress }), _jsx(InfoCard, { label: t.labels.template, value: delivery.templateSlug ?? messages.admin.common.directTemplate, mono: true }), _jsx(InfoCard, { label: t.labels.provider, value: delivery.provider }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: t.labels.status }), _jsx("div", { className: "mt-2", children: _jsx(Badge, { variant: delivery.status === "sent"
|
|
15
|
+
? "default"
|
|
16
|
+
: delivery.status === "failed"
|
|
17
|
+
? "destructive"
|
|
18
|
+
: "secondary", children: delivery.status }) })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsxs(Section, { title: t.metadataTitle, children: [_jsx(KeyValue, { label: t.labels.channel, value: delivery.channel }), _jsx(KeyValue, { label: t.labels.from, value: delivery.fromAddress ?? "—" }), _jsx(KeyValue, { label: t.labels.targetType, value: delivery.targetType }), _jsx(KeyValue, { label: t.labels.targetId, value: delivery.targetId ?? "—", mono: true }), _jsx(KeyValue, { label: t.labels.providerMessageId, value: delivery.providerMessageId ?? "—", mono: true }), _jsx(KeyValue, { label: t.labels.created, value: new Date(delivery.createdAt).toLocaleString() }), _jsx(KeyValue, { label: t.labels.sent, value: delivery.sentAt ? new Date(delivery.sentAt).toLocaleString() : "—" }), _jsx(KeyValue, { label: t.labels.failed, value: delivery.failedAt ? new Date(delivery.failedAt).toLocaleString() : "—" })] }), _jsxs(Section, { title: t.renderedPayloadTitle, children: [_jsx(KeyValue, { label: t.labels.subject, value: delivery.subject ?? "—" }), _jsx(KeyValue, { label: t.labels.error, value: delivery.errorMessage ?? "—" }), _jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: t.labels.text }), _jsx("pre", { className: "whitespace-pre-wrap rounded-md border bg-muted/20 px-3 py-3 text-xs", children: delivery.textBody ?? "—" })] })] })] }), _jsx(Section, { title: t.htmlBodyTitle, children: delivery.htmlBody ? (_jsx("div", { className: "prose prose-sm max-w-none rounded-md border bg-background px-4 py-4 dark:prose-invert",
|
|
19
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: Notification HTML body is stored template output rendered for preview. -- owner: notifications-react; existing suppression is intentional pending typed cleanup.
|
|
20
|
+
dangerouslySetInnerHTML: { __html: delivery.htmlBody } })) : (_jsx("div", { className: "rounded-md border bg-muted/20 px-4 py-3 text-sm text-muted-foreground", children: t.noHtmlStored })) }), _jsx(Section, { title: t.payloadDataTitle, children: _jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap rounded-md border bg-muted/20 px-3 py-3 text-xs", children: JSON.stringify(delivery.payloadData ?? {}, null, 2) }) })] })) : null] }), _jsx(DialogFooter, { children: _jsx(Button, { type: "button", variant: "ghost", onClick: () => onOpenChange(false), children: t.close }) })] }) }));
|
|
21
|
+
}
|
|
22
|
+
function Section({ title, children }) {
|
|
23
|
+
return (_jsxs("section", { className: "space-y-3 rounded-md border p-4", children: [_jsx("h3", { className: "text-sm font-medium", children: title }), children] }));
|
|
24
|
+
}
|
|
25
|
+
function InfoCard({ label, value, mono = false, }) {
|
|
26
|
+
return (_jsxs("div", { className: "rounded-md border p-3", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: label }), _jsx("div", { className: `mt-2 break-words text-sm ${mono ? "font-mono text-xs" : ""}`, children: value })] }));
|
|
27
|
+
}
|
|
28
|
+
function KeyValue({ label, value, mono = false, }) {
|
|
29
|
+
return (_jsxs("div", { className: "grid gap-1", children: [_jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: label }), _jsx("div", { className: `break-words text-sm ${mono ? "font-mono text-xs" : ""}`, children: value })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface NotificationReminderRuleDetailHostProps {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Packaged admin host for the reminder rule detail page — rule summary plus
|
|
6
|
+
* the stage sequence editor (packaged-admin RFC Phase 3). Takes the rule id
|
|
7
|
+
* as a prop — the host route file binds `Route.useParams()` onto it. The
|
|
8
|
+
* back link resolves through the `notificationReminderRule.list` semantic
|
|
9
|
+
* destination.
|
|
10
|
+
*/
|
|
11
|
+
export declare function NotificationReminderRuleDetailHost({ id, }: NotificationReminderRuleDetailHostProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=notification-reminder-rule-detail-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-reminder-rule-detail-host.d.ts","sourceRoot":"","sources":["../../src/admin/notification-reminder-rule-detail-host.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,uCAAuC;IACtD,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,EAAE,GACH,EAAE,uCAAuC,2CAuDzC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useAdminHref, useAdminNavigate } from "@voyant-travel/admin";
|
|
4
|
+
import { Badge, Button, Card, CardContent, CardHeader, CardTitle, } from "@voyant-travel/ui/components";
|
|
5
|
+
import { ArrowLeft } from "lucide-react";
|
|
6
|
+
import { StageList } from "../components/stage-list.js";
|
|
7
|
+
import { useNotificationsUiMessagesOrDefault } from "../i18n/index.js";
|
|
8
|
+
import { useNotificationReminderRule } from "../index.js";
|
|
9
|
+
import { DestinationLink } from "./notifications-admin-shared.js";
|
|
10
|
+
/**
|
|
11
|
+
* Packaged admin host for the reminder rule detail page — rule summary plus
|
|
12
|
+
* the stage sequence editor (packaged-admin RFC Phase 3). Takes the rule id
|
|
13
|
+
* as a prop — the host route file binds `Route.useParams()` onto it. The
|
|
14
|
+
* back link resolves through the `notificationReminderRule.list` semantic
|
|
15
|
+
* destination.
|
|
16
|
+
*/
|
|
17
|
+
export function NotificationReminderRuleDetailHost({ id, }) {
|
|
18
|
+
const messages = useNotificationsUiMessagesOrDefault();
|
|
19
|
+
const resolveHref = useAdminHref();
|
|
20
|
+
const navigateTo = useAdminNavigate();
|
|
21
|
+
const { data: rule, isLoading } = useNotificationReminderRule(id);
|
|
22
|
+
return (_jsxs("div", { className: "container mx-auto space-y-6 p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(DestinationLink, { href: resolveHref("notificationReminderRule.list", {}), onNavigate: () => navigateTo("notificationReminderRule.list", {}), children: _jsx(Button, { variant: "ghost", size: "icon", children: _jsx(ArrowLeft, { className: "size-4" }) }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: rule?.name ?? messages.admin.reminderRuleDetail.fallbackTitle }), _jsx("p", { className: "text-sm text-muted-foreground", children: isLoading ? messages.common.loading : rule?.slug })] })] }), rule && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: "outline", children: rule.targetType }), _jsx(Badge, { variant: "outline", children: rule.channel }), _jsx(Badge, { children: rule.status })] }))] }), rule && (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { className: "text-base", children: "Rule" }) }), _jsxs(CardContent, { className: "text-sm grid grid-cols-2 gap-x-8 gap-y-2 text-muted-foreground", children: [_jsxs("div", { children: ["Template slug: ", _jsx("span", { className: "font-mono", children: rule.templateSlug ?? "—" })] }), _jsxs("div", { children: ["Template id: ", _jsx("span", { className: "font-mono", children: rule.templateId ?? "—" })] })] })] })), _jsx(StageList, { reminderRuleId: id })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type NotificationReminderRuleRecord } from "../index.js";
|
|
2
|
+
type NotificationReminderRuleDialogProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
rule?: NotificationReminderRuleRecord;
|
|
6
|
+
onSuccess: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function NotificationReminderRuleDialog({ open, onOpenChange, rule, onSuccess, }: NotificationReminderRuleDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=notification-reminder-rule-dialog.d.ts.map
|