@aglyn/plugins-email 1.0.0-beta.143
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 +7 -0
- package/package.json +58 -0
- package/src/index.d.ts +35 -0
- package/src/index.js +35 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/campaign-design-create-widget.d.ts +21 -0
- package/src/lib/components/campaign-design-create-widget.js +61 -0
- package/src/lib/components/campaign-design-create-widget.js.map +1 -0
- package/src/lib/components/campaign-sender-editor-widget.d.ts +18 -0
- package/src/lib/components/campaign-sender-editor-widget.js +39 -0
- package/src/lib/components/campaign-sender-editor-widget.js.map +1 -0
- package/src/lib/components/campaign-topic-options-widget.d.ts +19 -0
- package/src/lib/components/campaign-topic-options-widget.js +48 -0
- package/src/lib/components/campaign-topic-options-widget.js.map +1 -0
- package/src/lib/components/campaign-topic-select.d.ts +32 -0
- package/src/lib/components/campaign-topic-select.js +87 -0
- package/src/lib/components/campaign-topic-select.js.map +1 -0
- package/src/lib/components/dynamic-list-rule-fields.d.ts +173 -0
- package/src/lib/components/dynamic-list-rule-fields.js +1473 -0
- package/src/lib/components/dynamic-list-rule-fields.js.map +1 -0
- package/src/lib/components/email-blocks.d.ts +111 -0
- package/src/lib/components/email-blocks.js +875 -0
- package/src/lib/components/email-blocks.js.map +1 -0
- package/src/lib/components/email-design-preview.d.ts +62 -0
- package/src/lib/components/email-design-preview.js +174 -0
- package/src/lib/components/email-design-preview.js.map +1 -0
- package/src/lib/components/email-screens-card.d.ts +42 -0
- package/src/lib/components/email-screens-card.js +277 -0
- package/src/lib/components/email-screens-card.js.map +1 -0
- package/src/lib/components/email-template-detail.d.ts +48 -0
- package/src/lib/components/email-template-detail.js +681 -0
- package/src/lib/components/email-template-detail.js.map +1 -0
- package/src/lib/components/email-topic-detail.d.ts +32 -0
- package/src/lib/components/email-topic-detail.js +293 -0
- package/src/lib/components/email-topic-detail.js.map +1 -0
- package/src/lib/components/email-topics-card.d.ts +46 -0
- package/src/lib/components/email-topics-card.js +327 -0
- package/src/lib/components/email-topics-card.js.map +1 -0
- package/src/lib/components/email-zones.d.ts +28 -0
- package/src/lib/components/email-zones.js +20 -0
- package/src/lib/components/email-zones.js.map +1 -0
- package/src/lib/components/emails-console-page.d.ts +32 -0
- package/src/lib/components/emails-console-page.js +229 -0
- package/src/lib/components/emails-console-page.js.map +1 -0
- package/src/lib/components/emails-console-sections.d.ts +36 -0
- package/src/lib/components/emails-console-sections.js +108 -0
- package/src/lib/components/emails-console-sections.js.map +1 -0
- package/src/lib/components/list-detail-card.d.ts +47 -0
- package/src/lib/components/list-detail-card.js +273 -0
- package/src/lib/components/list-detail-card.js.map +1 -0
- package/src/lib/components/list-edit-card.d.ts +11 -0
- package/src/lib/components/list-edit-card.js +287 -0
- package/src/lib/components/list-edit-card.js.map +1 -0
- package/src/lib/components/list-import-drawer.d.ts +22 -0
- package/src/lib/components/list-import-drawer.js +662 -0
- package/src/lib/components/list-import-drawer.js.map +1 -0
- package/src/lib/components/list-members-panel.d.ts +94 -0
- package/src/lib/components/list-members-panel.js +686 -0
- package/src/lib/components/list-members-panel.js.map +1 -0
- package/src/lib/components/lists-card.d.ts +28 -0
- package/src/lib/components/lists-card.js +377 -0
- package/src/lib/components/lists-card.js.map +1 -0
- package/src/lib/components/sending-domain-detail.d.ts +26 -0
- package/src/lib/components/sending-domain-detail.js +496 -0
- package/src/lib/components/sending-domain-detail.js.map +1 -0
- package/src/lib/components/sending-domains-card.d.ts +33 -0
- package/src/lib/components/sending-domains-card.js +962 -0
- package/src/lib/components/sending-domains-card.js.map +1 -0
- package/src/lib/components/sending-sender-drawer.d.ts +94 -0
- package/src/lib/components/sending-sender-drawer.js +543 -0
- package/src/lib/components/sending-sender-drawer.js.map +1 -0
- package/src/lib/components/suppressions-card.d.ts +49 -0
- package/src/lib/components/suppressions-card.js +639 -0
- package/src/lib/components/suppressions-card.js.map +1 -0
- package/src/lib/components/use-org-email-topics.d.ts +79 -0
- package/src/lib/components/use-org-email-topics.js +111 -0
- package/src/lib/components/use-org-email-topics.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +18 -0
- package/src/lib/constants/bundle-common.js +18 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/hooks/use-org-company-options.d.ts +20 -0
- package/src/lib/hooks/use-org-company-options.js +138 -0
- package/src/lib/hooks/use-org-company-options.js.map +1 -0
- package/src/lib/hooks/use-org-contact-fields.d.ts +40 -0
- package/src/lib/hooks/use-org-contact-fields.js +91 -0
- package/src/lib/hooks/use-org-contact-fields.js.map +1 -0
- package/src/lib/hooks/use-org-contact-segments.d.ts +16 -0
- package/src/lib/hooks/use-org-contact-segments.js +55 -0
- package/src/lib/hooks/use-org-contact-segments.js.map +1 -0
- package/src/lib/hooks/use-org-crm-views.d.ts +8 -0
- package/src/lib/hooks/use-org-crm-views.js +74 -0
- package/src/lib/hooks/use-org-crm-views.js.map +1 -0
- package/src/lib/hooks/use-org-lists.d.ts +8 -0
- package/src/lib/hooks/use-org-lists.js +47 -0
- package/src/lib/hooks/use-org-lists.js.map +1 -0
- package/src/lib/model/email-design-document.d.ts +52 -0
- package/src/lib/model/email-design-document.js +62 -0
- package/src/lib/model/email-design-document.js.map +1 -0
- package/src/lib/model/index.d.ts +64 -0
- package/src/lib/model/index.js +71 -0
- package/src/lib/model/index.js.map +1 -0
- package/src/lib/model/sending-domain-status.d.ts +99 -0
- package/src/lib/model/sending-domain-status.js +196 -0
- package/src/lib/model/sending-domain-status.js.map +1 -0
- package/src/lib/model/template-provenance.d.ts +113 -0
- package/src/lib/model/template-provenance.js +107 -0
- package/src/lib/model/template-provenance.js.map +1 -0
- package/src/lib/model/template-report.d.ts +158 -0
- package/src/lib/model/template-report.js +249 -0
- package/src/lib/model/template-report.js.map +1 -0
- package/src/lib/plugin.d.ts +27 -0
- package/src/lib/plugin.js +163 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server-console.d.ts +116 -0
- package/src/lib/server-console.js +422 -0
- package/src/lib/server-console.js.map +1 -0
- package/src/lib/server-email-drafts.d.ts +104 -0
- package/src/lib/server-email-drafts.js +381 -0
- package/src/lib/server-email-drafts.js.map +1 -0
- package/src/lib/server-list-gate.d.ts +183 -0
- package/src/lib/server-list-gate.js +365 -0
- package/src/lib/server-list-gate.js.map +1 -0
- package/src/lib/server-list-import.d.ts +199 -0
- package/src/lib/server-list-import.js +632 -0
- package/src/lib/server-list-import.js.map +1 -0
- package/src/lib/server-suppressions.d.ts +135 -0
- package/src/lib/server-suppressions.js +295 -0
- package/src/lib/server-suppressions.js.map +1 -0
- package/src/lib/server.d.ts +19 -0
- package/src/lib/server.js +834 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/site.d.ts +26 -0
- package/src/lib/site.js +81 -0
- package/src/lib/site.js.map +1 -0
- package/src/lib/unsubscribe-link.d.ts +311 -0
- package/src/lib/unsubscribe-link.js +398 -0
- package/src/lib/unsubscribe-link.js.map +1 -0
- package/src/lib/utils/create-email-screen.d.ts +59 -0
- package/src/lib/utils/create-email-screen.js +59 -0
- package/src/lib/utils/create-email-screen.js.map +1 -0
- package/src/lib/utils/generate-preset-id.d.ts +19 -0
- package/src/lib/utils/generate-preset-id.js +25 -0
- package/src/lib/utils/generate-preset-id.js.map +1 -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 reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and 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 choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or 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 [yyyy] [name of copyright owner]
|
|
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,7 @@
|
|
|
1
|
+
# @aglyn/plugins-ui-email
|
|
2
|
+
|
|
3
|
+
The Events Calendar feature plugin (AGL-313) — the reference
|
|
4
|
+
implementation of the console+UI feature-plugin pair (AGL-277). The
|
|
5
|
+
`event-list` component moved here from `plugins-ui-mui`; legacy screen
|
|
6
|
+
nodes persisted with pluginId `mui` keep rendering because resolution is
|
|
7
|
+
by componentId.
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aglyn/plugins-email",
|
|
3
|
+
"version": "1.0.0-beta.143",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"homepage": "https://aglyn.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/aglyn/aglyn.git",
|
|
9
|
+
"directory": "libs/plugins/email"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"provenance": true
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./src/index.d.ts",
|
|
19
|
+
"default": "./src/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./*": {
|
|
22
|
+
"types": "./src/lib/*.d.ts",
|
|
23
|
+
"default": "./src/lib/*.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.143",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.143",
|
|
30
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.143",
|
|
31
|
+
"@aglyn/shared-data-types": "1.0.0-beta.143",
|
|
32
|
+
"@aglyn/shared-ui-email-campaigns": "1.0.0-beta.143",
|
|
33
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.143",
|
|
34
|
+
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.143",
|
|
35
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.143",
|
|
36
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.143",
|
|
37
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.143",
|
|
38
|
+
"@aglyn/shared-util-email": "1.0.0-beta.143",
|
|
39
|
+
"@aglyn/shared-util-http": "1.0.0-beta.143",
|
|
40
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.143",
|
|
41
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.143",
|
|
42
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.143",
|
|
43
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.143",
|
|
44
|
+
"@swc/helpers": "0.5.23"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@mui/material": "^9.3.1",
|
|
48
|
+
"@mui/x-data-grid": "^9.12.0",
|
|
49
|
+
"firebase": "^12.18.0",
|
|
50
|
+
"firebase-admin": "^14.3.0",
|
|
51
|
+
"next": "16.3.3",
|
|
52
|
+
"react": "^19.2.8"
|
|
53
|
+
},
|
|
54
|
+
"sideEffects": false,
|
|
55
|
+
"types": "./src/index.d.ts",
|
|
56
|
+
"module": "./src/index.js",
|
|
57
|
+
"main": "./src/index.js"
|
|
58
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export * from './lib/constants/bundle-common';
|
|
18
|
+
export * from './lib/components/email-blocks';
|
|
19
|
+
export * from './lib/plugin';
|
|
20
|
+
export * from './lib/model';
|
|
21
|
+
/**
|
|
22
|
+
* ⛔ No console surface may be re-exported here (AGL-1151).
|
|
23
|
+
*
|
|
24
|
+
* The tenant's generated loader activates the site half of this plugin with
|
|
25
|
+
* `import('@aglyn/plugins-email')` — this file. Anything named statically here
|
|
26
|
+
* lands in the chunk a PUBLISHED site downloads and evaluates, so the three
|
|
27
|
+
* console cards that used to sit on these lines carried `firebase/firestore`
|
|
28
|
+
* and `@aglyn/tenant-feature-instance` onto every visitor's first paint, to
|
|
29
|
+
* render markup that queries nothing. Two of the three had no consumer outside
|
|
30
|
+
* this library at all.
|
|
31
|
+
*
|
|
32
|
+
* Console consumers deep-import the component they need
|
|
33
|
+
* (`@aglyn/plugins-email/components/...`), which reaches the same module
|
|
34
|
+
* without routing it through the site half's entry point.
|
|
35
|
+
*/
|
package/src/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export * from "./lib/constants/bundle-common.js";
|
|
17
|
+
export * from "./lib/components/email-blocks.js";
|
|
18
|
+
export * from "./lib/plugin.js";
|
|
19
|
+
export * from "./lib/model/index.js"; /**
|
|
20
|
+
* ⛔ No console surface may be re-exported here (AGL-1151).
|
|
21
|
+
*
|
|
22
|
+
* The tenant's generated loader activates the site half of this plugin with
|
|
23
|
+
* `import('@aglyn/plugins-email')` — this file. Anything named statically here
|
|
24
|
+
* lands in the chunk a PUBLISHED site downloads and evaluates, so the three
|
|
25
|
+
* console cards that used to sit on these lines carried `firebase/firestore`
|
|
26
|
+
* and `@aglyn/tenant-feature-instance` onto every visitor's first paint, to
|
|
27
|
+
* render markup that queries nothing. Two of the three had no consumer outside
|
|
28
|
+
* this library at all.
|
|
29
|
+
*
|
|
30
|
+
* Console consumers deep-import the component they need
|
|
31
|
+
* (`@aglyn/plugins-email/components/...`), which reaches the same module
|
|
32
|
+
* without routing it through the site half's entry point.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../libs/plugins/email/src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './lib/constants/bundle-common'\nexport * from './lib/components/email-blocks'\nexport * from './lib/plugin'\nexport * from './lib/model'\n/**\n * ⛔ No console surface may be re-exported here (AGL-1151).\n *\n * The tenant's generated loader activates the site half of this plugin with\n * `import('@aglyn/plugins-email')` — this file. Anything named statically here\n * lands in the chunk a PUBLISHED site downloads and evaluates, so the three\n * console cards that used to sit on these lines carried `firebase/firestore`\n * and `@aglyn/tenant-feature-instance` onto every visitor's first paint, to\n * render markup that queries nothing. Two of the three had no consumer outside\n * this library at all.\n *\n * Console consumers deep-import the component they need\n * (`@aglyn/plugins-email/components/...`), which reaches the same module\n * without routing it through the site half's entry point.\n */\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,mCAA+B;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,kBAAc;AAC5B,cAAc,uBAAa,CAC3B;;;;;;;;;;;;;;CAcC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** What the campaign owner's design-create zone hands a widget. */
|
|
2
|
+
export interface CampaignDesignCreateWidgetProps {
|
|
3
|
+
hostId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
onCreated: (design: {
|
|
6
|
+
screenId: string;
|
|
7
|
+
versionId: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
onError: (error: unknown) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A design for ONE email, without making the author think in templates.
|
|
13
|
+
*
|
|
14
|
+
* The data model has one shape for a design — a `kind: 'email'` screen, the
|
|
15
|
+
* document the template picker lists — so this mints one, named after the
|
|
16
|
+
* email it belongs to: the name is the only thing that tells one design from
|
|
17
|
+
* another in that picker. What happens next is the composer's: it records the
|
|
18
|
+
* choice on the campaign and opens the editor.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CampaignDesignCreateWidget(props: CampaignDesignCreateWidgetProps): import("react").JSX.Element;
|
|
21
|
+
export default CampaignDesignCreateWidget;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { useHostResourceApi, useHostVersionApi } from "@aglyn/tenant-feature-instance";
|
|
19
|
+
import { Button } from "@mui/material";
|
|
20
|
+
import { useCallback, useState } from "react";
|
|
21
|
+
import { createEmailScreen } from "../utils/create-email-screen.js";
|
|
22
|
+
/**
|
|
23
|
+
* A design for ONE email, without making the author think in templates.
|
|
24
|
+
*
|
|
25
|
+
* The data model has one shape for a design — a `kind: 'email'` screen, the
|
|
26
|
+
* document the template picker lists — so this mints one, named after the
|
|
27
|
+
* email it belongs to: the name is the only thing that tells one design from
|
|
28
|
+
* another in that picker. What happens next is the composer's: it records the
|
|
29
|
+
* choice on the campaign and opens the editor.
|
|
30
|
+
*/ export function CampaignDesignCreateWidget(props) {
|
|
31
|
+
const { hostId, name, onCreated, onError } = props;
|
|
32
|
+
const createHostResource = useHostResourceApi();
|
|
33
|
+
const createHostVersion = useHostVersionApi();
|
|
34
|
+
const [busy, setBusy] = useState(false);
|
|
35
|
+
const handleClick = useCallback(async ()=>{
|
|
36
|
+
setBusy(true);
|
|
37
|
+
try {
|
|
38
|
+
onCreated(await createEmailScreen(hostId, createHostResource, createHostVersion, name));
|
|
39
|
+
} catch (error) {
|
|
40
|
+
onError(error);
|
|
41
|
+
} finally{
|
|
42
|
+
setBusy(false);
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
hostId,
|
|
46
|
+
name,
|
|
47
|
+
createHostResource,
|
|
48
|
+
createHostVersion,
|
|
49
|
+
onCreated,
|
|
50
|
+
onError
|
|
51
|
+
]);
|
|
52
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
53
|
+
size: "small",
|
|
54
|
+
disabled: busy,
|
|
55
|
+
onClick: ()=>void handleClick(),
|
|
56
|
+
children: 'Design this email'
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export default CampaignDesignCreateWidget;
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=campaign-design-create-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/email/src/lib/components/campaign-design-create-widget.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n useHostResourceApi,\n useHostVersionApi,\n} from '@aglyn/tenant-feature-instance'\nimport { Button } from '@mui/material'\nimport { useCallback, useState } from 'react'\nimport { createEmailScreen } from '../utils/create-email-screen'\n\n/** What the campaign owner's design-create zone hands a widget. */\nexport interface CampaignDesignCreateWidgetProps {\n hostId: string\n name?: string\n onCreated: (design: { screenId: string; versionId: string }) => void\n onError: (error: unknown) => void\n}\n\n/**\n * A design for ONE email, without making the author think in templates.\n *\n * The data model has one shape for a design — a `kind: 'email'` screen, the\n * document the template picker lists — so this mints one, named after the\n * email it belongs to: the name is the only thing that tells one design from\n * another in that picker. What happens next is the composer's: it records the\n * choice on the campaign and opens the editor.\n */\nexport function CampaignDesignCreateWidget(\n props: CampaignDesignCreateWidgetProps,\n) {\n const { hostId, name, onCreated, onError } = props\n const createHostResource = useHostResourceApi()\n const createHostVersion = useHostVersionApi()\n const [busy, setBusy] = useState(false)\n const handleClick = useCallback(async () => {\n setBusy(true)\n try {\n onCreated(\n await createEmailScreen(\n hostId,\n createHostResource,\n createHostVersion,\n name,\n ),\n )\n } catch (error) {\n onError(error)\n } finally {\n setBusy(false)\n }\n }, [hostId, name, createHostResource, createHostVersion, onCreated, onError])\n return (\n <Button size=\"small\" disabled={busy} onClick={() => void handleClick()}>\n {'Design this email'}\n </Button>\n )\n}\n\nexport default CampaignDesignCreateWidget\n"],"names":["useHostResourceApi","useHostVersionApi","Button","useCallback","useState","createEmailScreen","CampaignDesignCreateWidget","props","hostId","name","onCreated","onError","createHostResource","createHostVersion","busy","setBusy","handleClick","error","size","disabled","onClick"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SACEA,kBAAkB,EAClBC,iBAAiB,QACZ,iCAAgC;AACvC,SAASC,MAAM,QAAQ,gBAAe;AACtC,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC7C,SAASC,iBAAiB,QAAQ,kCAA8B;AAUhE;;;;;;;;CAQC,GACD,OAAO,SAASC,2BACdC,KAAsC;IAEtC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAE,GAAGJ;IAC7C,MAAMK,qBAAqBZ;IAC3B,MAAMa,oBAAoBZ;IAC1B,MAAM,CAACa,MAAMC,QAAQ,GAAGX,SAAS;IACjC,MAAMY,cAAcb,YAAY;QAC9BY,QAAQ;QACR,IAAI;YACFL,UACE,MAAML,kBACJG,QACAI,oBACAC,mBACAJ;QAGN,EAAE,OAAOQ,OAAO;YACdN,QAAQM;QACV,SAAU;YACRF,QAAQ;QACV;IACF,GAAG;QAACP;QAAQC;QAAMG;QAAoBC;QAAmBH;QAAWC;KAAQ;IAC5E,qBACE,KAACT;QAAOgB,MAAK;QAAQC,UAAUL;QAAMM,SAAS,IAAM,KAAKJ;kBACtD;;AAGP;AAEA,eAAeV,2BAA0B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SendingIdentityView } from '@aglyn/tenant-feature-instance/hooks/use-sending-identity-api';
|
|
2
|
+
/** What the campaign owner's sender-editor zone hands a widget. */
|
|
3
|
+
export interface CampaignSenderEditorWidgetProps {
|
|
4
|
+
hostId: string;
|
|
5
|
+
view: SendingIdentityView | null;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onSaved: (senderId?: string) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The sender editor, opened from an email being written.
|
|
11
|
+
*
|
|
12
|
+
* `senderId={null}` is the ADD mode: the fields open empty, so the sender the
|
|
13
|
+
* site already has is left exactly where it is rather than renamed by somebody
|
|
14
|
+
* composing an email. The zone mounts this only once the author has asked for
|
|
15
|
+
* it, so the drawer is simply open.
|
|
16
|
+
*/
|
|
17
|
+
export declare function CampaignSenderEditorWidget(props: CampaignSenderEditorWidgetProps): import("react").JSX.Element;
|
|
18
|
+
export default CampaignSenderEditorWidget;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import SendingSenderDrawer from "./sending-sender-drawer.js";
|
|
19
|
+
/**
|
|
20
|
+
* The sender editor, opened from an email being written.
|
|
21
|
+
*
|
|
22
|
+
* `senderId={null}` is the ADD mode: the fields open empty, so the sender the
|
|
23
|
+
* site already has is left exactly where it is rather than renamed by somebody
|
|
24
|
+
* composing an email. The zone mounts this only once the author has asked for
|
|
25
|
+
* it, so the drawer is simply open.
|
|
26
|
+
*/ export function CampaignSenderEditorWidget(props) {
|
|
27
|
+
const { hostId, view, onClose, onSaved } = props;
|
|
28
|
+
return /*#__PURE__*/ _jsx(SendingSenderDrawer, {
|
|
29
|
+
open: true,
|
|
30
|
+
hostId: hostId,
|
|
31
|
+
view: view,
|
|
32
|
+
senderId: null,
|
|
33
|
+
onClose: onClose,
|
|
34
|
+
onSaved: onSaved
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export default CampaignSenderEditorWidget;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=campaign-sender-editor-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/email/src/lib/components/campaign-sender-editor-widget.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { SendingIdentityView } from '@aglyn/tenant-feature-instance/hooks/use-sending-identity-api'\nimport SendingSenderDrawer from './sending-sender-drawer'\n\n/** What the campaign owner's sender-editor zone hands a widget. */\nexport interface CampaignSenderEditorWidgetProps {\n hostId: string\n view: SendingIdentityView | null\n onClose: () => void\n onSaved: (senderId?: string) => void\n}\n\n/**\n * The sender editor, opened from an email being written.\n *\n * `senderId={null}` is the ADD mode: the fields open empty, so the sender the\n * site already has is left exactly where it is rather than renamed by somebody\n * composing an email. The zone mounts this only once the author has asked for\n * it, so the drawer is simply open.\n */\nexport function CampaignSenderEditorWidget(\n props: CampaignSenderEditorWidgetProps,\n) {\n const { hostId, view, onClose, onSaved } = props\n return (\n <SendingSenderDrawer\n open\n hostId={hostId}\n view={view}\n senderId={null}\n onClose={onClose}\n onSaved={onSaved}\n />\n )\n}\n\nexport default CampaignSenderEditorWidget\n"],"names":["SendingSenderDrawer","CampaignSenderEditorWidget","props","hostId","view","onClose","onSaved","open","senderId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,OAAOA,yBAAyB,6BAAyB;AAUzD;;;;;;;CAOC,GACD,OAAO,SAASC,2BACdC,KAAsC;IAEtC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGJ;IAC3C,qBACE,KAACF;QACCO,IAAI;QACJJ,QAAQA;QACRC,MAAMA;QACNI,UAAU;QACVH,SAASA;QACTC,SAASA;;AAGf;AAEA,eAAeL,2BAA0B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** What the campaign owner's topic-options zone hands a widget. */
|
|
2
|
+
export interface CampaignTopicOptionsWidgetProps {
|
|
3
|
+
hostId: string;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
onTopics: (topics: ReadonlyArray<{
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}>) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The streams a campaign can open on, reported to a drawer that lists them.
|
|
12
|
+
*
|
|
13
|
+
* Draws nothing. The catalog is read only while `enabled` — it is 200
|
|
14
|
+
* documents filling one select inside a drawer that is usually shut — and
|
|
15
|
+
* retired topics are left out, for the reason the composer's picker leaves
|
|
16
|
+
* them out: a campaign may not be aimed at a stream nobody can leave.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CampaignTopicOptionsWidget(props: CampaignTopicOptionsWidgetProps): any;
|
|
19
|
+
export default CampaignTopicOptionsWidget;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { activeEmailTopics } from "@aglyn/aglyn";
|
|
18
|
+
import { useEffect, useMemo } from "react";
|
|
19
|
+
import { useOrgEmailTopics } from "./use-org-email-topics.js";
|
|
20
|
+
/**
|
|
21
|
+
* The streams a campaign can open on, reported to a drawer that lists them.
|
|
22
|
+
*
|
|
23
|
+
* Draws nothing. The catalog is read only while `enabled` — it is 200
|
|
24
|
+
* documents filling one select inside a drawer that is usually shut — and
|
|
25
|
+
* retired topics are left out, for the reason the composer's picker leaves
|
|
26
|
+
* them out: a campaign may not be aimed at a stream nobody can leave.
|
|
27
|
+
*/ export function CampaignTopicOptionsWidget(props) {
|
|
28
|
+
const { hostId, enabled, onTopics } = props;
|
|
29
|
+
const { topics } = useOrgEmailTopics(hostId, {
|
|
30
|
+
enabled
|
|
31
|
+
});
|
|
32
|
+
const options = useMemo(()=>activeEmailTopics(topics).map(({ id, name })=>({
|
|
33
|
+
id,
|
|
34
|
+
name
|
|
35
|
+
})), [
|
|
36
|
+
topics
|
|
37
|
+
]);
|
|
38
|
+
useEffect(()=>{
|
|
39
|
+
onTopics(options);
|
|
40
|
+
}, [
|
|
41
|
+
options,
|
|
42
|
+
onTopics
|
|
43
|
+
]);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
export default CampaignTopicOptionsWidget;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=campaign-topic-options-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/email/src/lib/components/campaign-topic-options-widget.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { activeEmailTopics } from '@aglyn/aglyn'\nimport { useEffect, useMemo } from 'react'\nimport { useOrgEmailTopics } from './use-org-email-topics'\n\n/** What the campaign owner's topic-options zone hands a widget. */\nexport interface CampaignTopicOptionsWidgetProps {\n hostId: string\n enabled: boolean\n onTopics: (topics: ReadonlyArray<{ id: string; name: string }>) => void\n}\n\n/**\n * The streams a campaign can open on, reported to a drawer that lists them.\n *\n * Draws nothing. The catalog is read only while `enabled` — it is 200\n * documents filling one select inside a drawer that is usually shut — and\n * retired topics are left out, for the reason the composer's picker leaves\n * them out: a campaign may not be aimed at a stream nobody can leave.\n */\nexport function CampaignTopicOptionsWidget(\n props: CampaignTopicOptionsWidgetProps,\n) {\n const { hostId, enabled, onTopics } = props\n const { topics } = useOrgEmailTopics(hostId, { enabled })\n const options = useMemo(\n () => activeEmailTopics(topics).map(({ id, name }) => ({ id, name })),\n [topics],\n )\n useEffect(() => {\n onTopics(options)\n }, [options, onTopics])\n return null\n}\n\nexport default CampaignTopicOptionsWidget\n"],"names":["activeEmailTopics","useEffect","useMemo","useOrgEmailTopics","CampaignTopicOptionsWidget","props","hostId","enabled","onTopics","topics","options","map","id","name"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;AAEA,SAASA,iBAAiB,QAAQ,eAAc;AAChD,SAASC,SAAS,EAAEC,OAAO,QAAQ,QAAO;AAC1C,SAASC,iBAAiB,QAAQ,4BAAwB;AAS1D;;;;;;;CAOC,GACD,OAAO,SAASC,2BACdC,KAAsC;IAEtC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGH;IACtC,MAAM,EAAEI,MAAM,EAAE,GAAGN,kBAAkBG,QAAQ;QAAEC;IAAQ;IACvD,MAAMG,UAAUR,QACd,IAAMF,kBAAkBS,QAAQE,GAAG,CAAC,CAAC,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAM,CAAA;gBAAED;gBAAIC;YAAK,CAAA,IAClE;QAACJ;KAAO;IAEVR,UAAU;QACRO,SAASE;IACX,GAAG;QAACA;QAASF;KAAS;IACtB,OAAO;AACT;AAEA,eAAeJ,2BAA0B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface CampaignTopicSelectProps {
|
|
2
|
+
hostId: string;
|
|
3
|
+
/** The chosen topic id; empty until the effect below settles it. */
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (topicId: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* WHICH STREAM this campaign belongs to, chosen before it is sent.
|
|
10
|
+
*
|
|
11
|
+
* The topic decides three things at once: which recipients the send skips
|
|
12
|
+
* (anyone who has left this stream), what the preference page linked from the
|
|
13
|
+
* footer highlights as "this email", and which stream a resulting unsubscribe
|
|
14
|
+
* is recorded against. So it is a composer field rather than a setting — it is
|
|
15
|
+
* a property of the message, and the same site sends promotions and a
|
|
16
|
+
* newsletter in the same week.
|
|
17
|
+
*
|
|
18
|
+
* ## Why this is its own component
|
|
19
|
+
*
|
|
20
|
+
* The composer (`campaign-composer.tsx`) is a large component under concurrent
|
|
21
|
+
* edit. Keeping the picker separate means it can be dropped into the
|
|
22
|
+
* composer's field stack as one line and carries its own read of the org
|
|
23
|
+
* catalog, rather than threading a fifth collection listener through a
|
|
24
|
+
* component that already holds four.
|
|
25
|
+
*
|
|
26
|
+
* Retired topics are not offered. A campaign may not be composed under a
|
|
27
|
+
* stream nobody can unsubscribe from — but a campaign already SENT under one
|
|
28
|
+
* keeps resolving, which is why retiring is not deleting. See
|
|
29
|
+
* `email-topics-card.tsx`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function CampaignTopicSelect(props: CampaignTopicSelectProps): import("react").JSX.Element;
|
|
32
|
+
export default CampaignTopicSelect;
|