@aglyn/plugins-marketing 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.
Files changed (183) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +56 -0
  4. package/src/index.d.ts +19 -0
  5. package/src/index.js +20 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/announcement-bar-card.component.d.ts +20 -0
  8. package/src/lib/components/announcement-bar-card.component.js +292 -0
  9. package/src/lib/components/announcement-bar-card.component.js.map +1 -0
  10. package/src/lib/components/campaign-composer.d.ts +84 -0
  11. package/src/lib/components/campaign-composer.js +1643 -0
  12. package/src/lib/components/campaign-composer.js.map +1 -0
  13. package/src/lib/components/campaign-conversions-card.d.ts +22 -0
  14. package/src/lib/components/campaign-conversions-card.js +642 -0
  15. package/src/lib/components/campaign-conversions-card.js.map +1 -0
  16. package/src/lib/components/campaign-detail-card.d.ts +55 -0
  17. package/src/lib/components/campaign-detail-card.js +771 -0
  18. package/src/lib/components/campaign-detail-card.js.map +1 -0
  19. package/src/lib/components/campaign-edit-drawer.d.ts +60 -0
  20. package/src/lib/components/campaign-edit-drawer.js +252 -0
  21. package/src/lib/components/campaign-edit-drawer.js.map +1 -0
  22. package/src/lib/components/campaign-email-zones.d.ts +111 -0
  23. package/src/lib/components/campaign-email-zones.js +54 -0
  24. package/src/lib/components/campaign-email-zones.js.map +1 -0
  25. package/src/lib/components/campaign-glance-card.component.d.ts +18 -0
  26. package/src/lib/components/campaign-glance-card.component.js +151 -0
  27. package/src/lib/components/campaign-glance-card.component.js.map +1 -0
  28. package/src/lib/components/campaign-members-section.d.ts +87 -0
  29. package/src/lib/components/campaign-members-section.js +499 -0
  30. package/src/lib/components/campaign-members-section.js.map +1 -0
  31. package/src/lib/components/campaign-reach-sections.d.ts +137 -0
  32. package/src/lib/components/campaign-reach-sections.js +694 -0
  33. package/src/lib/components/campaign-reach-sections.js.map +1 -0
  34. package/src/lib/components/campaign-report-card.d.ts +91 -0
  35. package/src/lib/components/campaign-report-card.js +667 -0
  36. package/src/lib/components/campaign-report-card.js.map +1 -0
  37. package/src/lib/components/campaign-test-send-drawer.d.ts +45 -0
  38. package/src/lib/components/campaign-test-send-drawer.js +238 -0
  39. package/src/lib/components/campaign-test-send-drawer.js.map +1 -0
  40. package/src/lib/components/campaigns-card.d.ts +31 -0
  41. package/src/lib/components/campaigns-card.js +667 -0
  42. package/src/lib/components/campaigns-card.js.map +1 -0
  43. package/src/lib/components/conversion-attribution.component.d.ts +62 -0
  44. package/src/lib/components/conversion-attribution.component.js +127 -0
  45. package/src/lib/components/conversion-attribution.component.js.map +1 -0
  46. package/src/lib/components/email-compose-card.d.ts +12 -0
  47. package/src/lib/components/email-compose-card.js +157 -0
  48. package/src/lib/components/email-compose-card.js.map +1 -0
  49. package/src/lib/components/email-detail.d.ts +40 -0
  50. package/src/lib/components/email-detail.js +1180 -0
  51. package/src/lib/components/email-detail.js.map +1 -0
  52. package/src/lib/components/email-edit-drawer.d.ts +54 -0
  53. package/src/lib/components/email-edit-drawer.js +172 -0
  54. package/src/lib/components/email-edit-drawer.js.map +1 -0
  55. package/src/lib/components/email-messages-widget.d.ts +22 -0
  56. package/src/lib/components/email-messages-widget.js +49 -0
  57. package/src/lib/components/email-messages-widget.js.map +1 -0
  58. package/src/lib/components/email-recipients-card.d.ts +50 -0
  59. package/src/lib/components/email-recipients-card.js +338 -0
  60. package/src/lib/components/email-recipients-card.js.map +1 -0
  61. package/src/lib/components/emails-list-card.d.ts +36 -0
  62. package/src/lib/components/emails-list-card.js +544 -0
  63. package/src/lib/components/emails-list-card.js.map +1 -0
  64. package/src/lib/components/experiment-zones.d.ts +78 -0
  65. package/src/lib/components/experiment-zones.js +65 -0
  66. package/src/lib/components/experiment-zones.js.map +1 -0
  67. package/src/lib/components/host-experiments-card.component.d.ts +17 -0
  68. package/src/lib/components/host-experiments-card.component.js +887 -0
  69. package/src/lib/components/host-experiments-card.component.js.map +1 -0
  70. package/src/lib/components/host-marketing-summary-card.component.d.ts +15 -0
  71. package/src/lib/components/host-marketing-summary-card.component.js +161 -0
  72. package/src/lib/components/host-marketing-summary-card.component.js.map +1 -0
  73. package/src/lib/components/host-overlays-card.component.d.ts +19 -0
  74. package/src/lib/components/host-overlays-card.component.js +783 -0
  75. package/src/lib/components/host-overlays-card.component.js.map +1 -0
  76. package/src/lib/components/marketing-console-page.d.ts +28 -0
  77. package/src/lib/components/marketing-console-page.js +166 -0
  78. package/src/lib/components/marketing-console-page.js.map +1 -0
  79. package/src/lib/components/marketing-console-sections.d.ts +34 -0
  80. package/src/lib/components/marketing-console-sections.js +77 -0
  81. package/src/lib/components/marketing-console-sections.js.map +1 -0
  82. package/src/lib/components/overlay-stats-row.component.d.ts +15 -0
  83. package/src/lib/components/overlay-stats-row.component.js +78 -0
  84. package/src/lib/components/overlay-stats-row.component.js.map +1 -0
  85. package/src/lib/components/popup-card.component.d.ts +18 -0
  86. package/src/lib/components/popup-card.component.js +462 -0
  87. package/src/lib/components/popup-card.component.js.map +1 -0
  88. package/src/lib/components/record-attribution-widget.d.ts +35 -0
  89. package/src/lib/components/record-attribution-widget.js +33 -0
  90. package/src/lib/components/record-attribution-widget.js.map +1 -0
  91. package/src/lib/components/site-runtime.d.ts +9 -0
  92. package/src/lib/components/site-runtime.js +1081 -0
  93. package/src/lib/components/site-runtime.js.map +1 -0
  94. package/src/lib/components/use-campaign-send-api.d.ts +35 -0
  95. package/src/lib/components/use-campaign-send-api.js +99 -0
  96. package/src/lib/components/use-campaign-send-api.js.map +1 -0
  97. package/src/lib/components/use-campaign-topic-options.d.ts +20 -0
  98. package/src/lib/components/use-campaign-topic-options.js +44 -0
  99. package/src/lib/components/use-campaign-topic-options.js.map +1 -0
  100. package/src/lib/components/use-emails-hub-path.d.ts +39 -0
  101. package/src/lib/components/use-emails-hub-path.js +70 -0
  102. package/src/lib/components/use-emails-hub-path.js.map +1 -0
  103. package/src/lib/components/use-marketing-hub-path.d.ts +21 -0
  104. package/src/lib/components/use-marketing-hub-path.js +50 -0
  105. package/src/lib/components/use-marketing-hub-path.js.map +1 -0
  106. package/src/lib/components/use-overlay-copy-editor.d.ts +79 -0
  107. package/src/lib/components/use-overlay-copy-editor.js +110 -0
  108. package/src/lib/components/use-overlay-copy-editor.js.map +1 -0
  109. package/src/lib/constants/bundle-common.d.ts +8 -0
  110. package/src/lib/constants/bundle-common.js +9 -0
  111. package/src/lib/constants/bundle-common.js.map +1 -0
  112. package/src/lib/model/campaign-membership-figures.d.ts +109 -0
  113. package/src/lib/model/campaign-membership-figures.js +113 -0
  114. package/src/lib/model/campaign-membership-figures.js.map +1 -0
  115. package/src/lib/model/compile-client-automations.d.ts +65 -0
  116. package/src/lib/model/compile-client-automations.js +95 -0
  117. package/src/lib/model/compile-client-automations.js.map +1 -0
  118. package/src/lib/model/experiments.d.ts +130 -0
  119. package/src/lib/model/experiments.js +186 -0
  120. package/src/lib/model/experiments.js.map +1 -0
  121. package/src/lib/model/index.d.ts +26 -0
  122. package/src/lib/model/index.js +26 -0
  123. package/src/lib/model/index.js.map +1 -0
  124. package/src/lib/model/marketing-record-routes.d.ts +6 -0
  125. package/src/lib/model/marketing-record-routes.js +46 -0
  126. package/src/lib/model/marketing-record-routes.js.map +1 -0
  127. package/src/lib/model/overlay-copy.d.ts +62 -0
  128. package/src/lib/model/overlay-copy.js +78 -0
  129. package/src/lib/model/overlay-copy.js.map +1 -0
  130. package/src/lib/model/overlays.d.ts +113 -0
  131. package/src/lib/model/overlays.js +93 -0
  132. package/src/lib/model/overlays.js.map +1 -0
  133. package/src/lib/model/site-contract.d.ts +100 -0
  134. package/src/lib/model/site-contract.js +23 -0
  135. package/src/lib/model/site-contract.js.map +1 -0
  136. package/src/lib/plugin.d.ts +27 -0
  137. package/src/lib/plugin.js +168 -0
  138. package/src/lib/plugin.js.map +1 -0
  139. package/src/lib/preview-props.d.ts +31 -0
  140. package/src/lib/preview-props.js +54 -0
  141. package/src/lib/preview-props.js.map +1 -0
  142. package/src/lib/server/campaign-manage.d.ts +62 -0
  143. package/src/lib/server/campaign-manage.js +829 -0
  144. package/src/lib/server/campaign-manage.js.map +1 -0
  145. package/src/lib/server/campaign-process-scheduled.d.ts +26 -0
  146. package/src/lib/server/campaign-process-scheduled.js +198 -0
  147. package/src/lib/server/campaign-process-scheduled.js.map +1 -0
  148. package/src/lib/server/campaign-recipients.d.ts +55 -0
  149. package/src/lib/server/campaign-recipients.js +219 -0
  150. package/src/lib/server/campaign-recipients.js.map +1 -0
  151. package/src/lib/server/campaign-send.d.ts +487 -0
  152. package/src/lib/server/campaign-send.js +3157 -0
  153. package/src/lib/server/campaign-send.js.map +1 -0
  154. package/src/lib/server/email-campaign-reach.d.ts +174 -0
  155. package/src/lib/server/email-campaign-reach.js +254 -0
  156. package/src/lib/server/email-campaign-reach.js.map +1 -0
  157. package/src/lib/server/email-events.d.ts +27 -0
  158. package/src/lib/server/email-events.js +714 -0
  159. package/src/lib/server/email-events.js.map +1 -0
  160. package/src/lib/server/get-client-automations.d.ts +60 -0
  161. package/src/lib/server/get-client-automations.js +87 -0
  162. package/src/lib/server/get-client-automations.js.map +1 -0
  163. package/src/lib/server/get-overlays.d.ts +28 -0
  164. package/src/lib/server/get-overlays.js +65 -0
  165. package/src/lib/server/get-overlays.js.map +1 -0
  166. package/src/lib/server/get-screen-experiments.d.ts +42 -0
  167. package/src/lib/server/get-screen-experiments.js +82 -0
  168. package/src/lib/server/get-screen-experiments.js.map +1 -0
  169. package/src/lib/server/lists-materialize.d.ts +18 -0
  170. package/src/lib/server/lists-materialize.js +130 -0
  171. package/src/lib/server/lists-materialize.js.map +1 -0
  172. package/src/lib/server/marketing-figures.d.ts +37 -0
  173. package/src/lib/server/marketing-figures.js +248 -0
  174. package/src/lib/server/marketing-figures.js.map +1 -0
  175. package/src/lib/server/site-page-enricher.d.ts +26 -0
  176. package/src/lib/server/site-page-enricher.js +210 -0
  177. package/src/lib/server/site-page-enricher.js.map +1 -0
  178. package/src/lib/server.d.ts +20 -0
  179. package/src/lib/server.js +152 -0
  180. package/src/lib/server.js.map +1 -0
  181. package/src/lib/site.d.ts +22 -0
  182. package/src/lib/site.js +48 -0
  183. package/src/lib/site.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-data
2
+
3
+ The Data 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,56 @@
1
+ {
2
+ "name": "@aglyn/plugins-marketing",
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/marketing"
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-ui-email-campaigns": "1.0.0-beta.143",
32
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.143",
33
+ "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.143",
34
+ "@aglyn/shared-ui-next": "1.0.0-beta.143",
35
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.143",
36
+ "@aglyn/shared-util-email": "1.0.0-beta.143",
37
+ "@aglyn/shared-util-http": "1.0.0-beta.143",
38
+ "@aglyn/shared-util-timestamp": "1.0.0-beta.143",
39
+ "@aglyn/tenant-data-admin": "1.0.0-beta.143",
40
+ "@aglyn/tenant-feature-instance": "1.0.0-beta.143",
41
+ "@aglyn/tenant-runtime": "1.0.0-beta.143",
42
+ "@swc/helpers": "0.5.23"
43
+ },
44
+ "peerDependencies": {
45
+ "@mui/material": "^9.3.1",
46
+ "@mui/x-data-grid": "^9.12.0",
47
+ "firebase": "^12.18.0",
48
+ "firebase-admin": "^14.3.0",
49
+ "next": "16.3.3",
50
+ "react": "^19.2.8"
51
+ },
52
+ "sideEffects": false,
53
+ "types": "./src/index.d.ts",
54
+ "module": "./src/index.js",
55
+ "main": "./src/index.js"
56
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,19 @@
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/plugin';
19
+ export * from './lib/model';
package/src/index.js ADDED
@@ -0,0 +1,20 @@
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/plugin.js";
18
+ export * from "./lib/model/index.js";
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../libs/plugins/marketing/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/plugin'\nexport * from './lib/model'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,mCAA+B;AAC7C,cAAc,kBAAc;AAC5B,cAAc,uBAAa"}
@@ -0,0 +1,20 @@
1
+ import { type AglynOrgBilling } from '@aglyn/aglyn';
2
+ export interface AnnouncementBarCardProps {
3
+ hostId: string;
4
+ /** Resolved entitlement source (AGL-395). */
5
+ org?: Partial<AglynOrgBilling>;
6
+ }
7
+ /**
8
+ * Announcement bar editor (AGL-195): site-wide banner config persisted on
9
+ * the host doc; the tenant render gates on the marketingOverlays
10
+ * entitlement and resolves the text through `resolveOverlayCopy`. A typed
11
+ * `{{name}}` is stored as its variable's id token, the only variable form
12
+ * that resolves, and a token that would still show as typed is flagged
13
+ * under the field (AGL-2885). Starter+ (locked-state upsell below),
14
+ * dark-launched for plan-less workspaces like the other AGL-99 gates.
15
+ */
16
+ export declare function AnnouncementBarCard(props: AnnouncementBarCardProps): import("react").JSX.Element;
17
+ export declare namespace AnnouncementBarCard {
18
+ var displayName: string;
19
+ }
20
+ export default AnnouncementBarCard;
@@ -0,0 +1,292 @@
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 { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { checkEntitlement, pluginDocsHelp } from "@aglyn/aglyn";
20
+ import { CardDisplay, useLoading } from "@aglyn/shared-ui-jsx";
21
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
22
+ import { Alert, Box, Button, Stack, Switch, TextField, Typography } from "@mui/material";
23
+ import { doc, updateDoc } from "firebase/firestore";
24
+ import { useEffect, useState } from "react";
25
+ import { useFirestore, useFirestoreDoc, useHostActivityLogger, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
26
+ import OverlayStatsRow from "./overlay-stats-row.component.js";
27
+ import { OVERLAY_COPY_HELPER_TEXT, shownAsTypedHelperText, useOverlayCopyEditor } from "./use-overlay-copy-editor.js";
28
+ /**
29
+ * Announcement bar editor (AGL-195): site-wide banner config persisted on
30
+ * the host doc; the tenant render gates on the marketingOverlays
31
+ * entitlement and resolves the text through `resolveOverlayCopy`. A typed
32
+ * `{{name}}` is stored as its variable's id token, the only variable form
33
+ * that resolves, and a token that would still show as typed is flagged
34
+ * under the field (AGL-2885). Starter+ (locked-state upsell below),
35
+ * dark-launched for plan-less workspaces like the other AGL-99 gates.
36
+ */ export function AnnouncementBarCard(props) {
37
+ var _ref, _shownAsTypedHelperText, _draft_href, _draft_backgroundColor, _draft_textColor;
38
+ var _draft_text;
39
+ const { hostId } = props;
40
+ const firestore = useFirestore();
41
+ const { org } = props;
42
+ const { enqueueSnackbar } = useSnackbar();
43
+ const { queueLoading } = useLoading();
44
+ const logActivity = useHostActivityLogger(hostId);
45
+ const { data: host, status: hostStatus, /**
46
+ * The host doc this form is seeded from is unconfirmed by the server
47
+ * (AGL-1358). The save writes the whole `announcementBar` map — a nested
48
+ * map value REPLACES atomically, so `updateDoc` protects only the host
49
+ * doc's other fields, never the bar's own — and every field of it comes
50
+ * off this seed. Against a cached read, editing the text reinstates the
51
+ * colours, link and `enabled` flag from that snapshot on a banner shown
52
+ * on every page of a published site.
53
+ */ fromCache: hostFromCache } = useFirestoreDoc(()=>doc(firestore, 'hosts', hostId), [
54
+ firestore,
55
+ hostId
56
+ ], {
57
+ idField: '$id'
58
+ });
59
+ const entitled = checkEntitlement(org, 'marketingOverlays');
60
+ const saved = (_ref = host == null ? void 0 : host.announcementBar) != null ? _ref : {};
61
+ const [draft, setDraft] = useState(saved);
62
+ // Re-seed the form when another session edits the host doc.
63
+ const savedKey = JSON.stringify(saved);
64
+ useEffect(()=>{
65
+ setDraft(JSON.parse(savedKey));
66
+ // eslint-disable-next-line react-hooks/exhaustive-deps
67
+ }, [
68
+ savedKey
69
+ ]);
70
+ // `draft.text` is held in its stored form; the field shows it as typed.
71
+ const copy = useOverlayCopyEditor({
72
+ hostId,
73
+ host,
74
+ usesTokens: entitled && [
75
+ saved.text,
76
+ draft.text
77
+ ].some((text)=>text == null ? void 0 : text.includes('{{'))
78
+ });
79
+ // Compared as it would be stored, so a name typed before the variables
80
+ // arrived still counts as the change it becomes on save.
81
+ const dirty = JSON.stringify(_extends({}, draft, {
82
+ text: copy.stored(draft.text)
83
+ })) !== savedKey;
84
+ const patch = (partial)=>setDraft((previous)=>_extends({}, previous, partial));
85
+ const textShownAsTyped = copy.shownAsTyped(draft.text);
86
+ const handleSave = async ()=>{
87
+ const dequeue = queueLoading();
88
+ try {
89
+ /**
90
+ * Refuse a save whose seed the server never confirmed (AGL-1358).
91
+ *
92
+ * There is no create path to exempt, and that is the point: unlike a
93
+ * new row at a fresh uid, this writes a FIXED document path, so the
94
+ * blank `draft` that `host?.announcementBar ?? {}` yields when the
95
+ * cache has never seen a bar is not harmless — it replaces whatever
96
+ * bar the server really holds with an empty, disabled one.
97
+ *
98
+ * The activity log rides inside the guard: a logged "Updated
99
+ * announcement bar" whose write never happened leaves the history
100
+ * disagreeing with the bar it claims to explain.
101
+ *
102
+ * The guard WRAPS the write — an early return is a shape you can keep
103
+ * while losing the protection.
104
+ */ const verdict = await writeGuardedBySeed({
105
+ subject: 'announcement bar',
106
+ unreadable: hostStatus === 'error',
107
+ fromCache: hostFromCache
108
+ }, async ()=>{
109
+ var _draft_href, _draft_backgroundColor, _draft_textColor;
110
+ await updateDoc(doc(firestore, 'hosts', hostId), {
111
+ announcementBar: {
112
+ enabled: Boolean(draft.enabled),
113
+ text: copy.storedWithin(draft.text, 300),
114
+ href: ((_draft_href = draft.href) != null ? _draft_href : '').trim(),
115
+ backgroundColor: ((_draft_backgroundColor = draft.backgroundColor) != null ? _draft_backgroundColor : '').trim(),
116
+ textColor: ((_draft_textColor = draft.textColor) != null ? _draft_textColor : '').trim(),
117
+ dismissible: draft.dismissible !== false
118
+ }
119
+ });
120
+ logActivity('Updated announcement bar', {
121
+ type: 'host',
122
+ id: hostId
123
+ });
124
+ });
125
+ // A refusal leaves every typed value on screen. A save that silently
126
+ // does nothing sends the user back to retype a form that will be
127
+ // refused again just as quietly.
128
+ if (!verdict.ok) {
129
+ return void enqueueSnackbar(verdict.message, {
130
+ variant: 'warning',
131
+ persist: false
132
+ });
133
+ }
134
+ enqueueSnackbar('Announcement bar saved', {
135
+ variant: 'success',
136
+ persist: false
137
+ });
138
+ } catch (error) {
139
+ console.error(error);
140
+ enqueueSnackbar('An error has occurred', {
141
+ variant: 'error',
142
+ allowDuplicate: true
143
+ });
144
+ } finally{
145
+ dequeue();
146
+ }
147
+ };
148
+ return /*#__PURE__*/ _jsx(CardDisplay, {
149
+ header: "Announcement bar",
150
+ help: pluginDocsHelp('marketingOverlays', {
151
+ anchor: '#announcement-bar'
152
+ }),
153
+ contentGutterX: true,
154
+ contentGutterY: true,
155
+ children: !entitled ? /*#__PURE__*/ _jsx(Alert, {
156
+ severity: "info",
157
+ children: 'Announcement bars and popups are included from the Starter ' + 'plan — see Billing to upgrade.'
158
+ }) : /*#__PURE__*/ _jsxs(Stack, {
159
+ spacing: 2,
160
+ children: [
161
+ /*#__PURE__*/ _jsxs(Stack, {
162
+ direction: "row",
163
+ spacing: 1,
164
+ sx: {
165
+ alignItems: 'center'
166
+ },
167
+ children: [
168
+ /*#__PURE__*/ _jsx(Switch, {
169
+ checked: Boolean(draft.enabled),
170
+ onChange: (event)=>patch({
171
+ enabled: event.target.checked
172
+ })
173
+ }),
174
+ /*#__PURE__*/ _jsx(Typography, {
175
+ variant: "body2",
176
+ children: draft.enabled ? 'Shown on every page of your published site' : 'Hidden'
177
+ })
178
+ ]
179
+ }),
180
+ /*#__PURE__*/ _jsx(TextField, {
181
+ label: "Text",
182
+ size: "small",
183
+ value: copy.editable(draft.text),
184
+ onChange: (event)=>patch({
185
+ text: copy.stored(event.target.value)
186
+ }),
187
+ error: textShownAsTyped.length > 0,
188
+ helperText: (_shownAsTypedHelperText = shownAsTypedHelperText(textShownAsTyped)) != null ? _shownAsTypedHelperText : OVERLAY_COPY_HELPER_TEXT,
189
+ multiline: true,
190
+ fullWidth: true
191
+ }),
192
+ /*#__PURE__*/ _jsxs(Stack, {
193
+ direction: "row",
194
+ spacing: 1,
195
+ sx: {
196
+ flexWrap: 'wrap',
197
+ rowGap: 1
198
+ },
199
+ children: [
200
+ /*#__PURE__*/ _jsx(TextField, {
201
+ label: "Link (optional)",
202
+ size: "small",
203
+ placeholder: "/sale or https://…",
204
+ value: (_draft_href = draft.href) != null ? _draft_href : '',
205
+ onChange: (event)=>patch({
206
+ href: event.target.value
207
+ }),
208
+ sx: {
209
+ flex: 1,
210
+ minWidth: 200
211
+ }
212
+ }),
213
+ /*#__PURE__*/ _jsx(TextField, {
214
+ label: "Background",
215
+ size: "small",
216
+ placeholder: "#111827",
217
+ value: (_draft_backgroundColor = draft.backgroundColor) != null ? _draft_backgroundColor : '',
218
+ onChange: (event)=>patch({
219
+ backgroundColor: event.target.value
220
+ }),
221
+ sx: {
222
+ width: 120
223
+ }
224
+ }),
225
+ /*#__PURE__*/ _jsx(TextField, {
226
+ label: "Text color",
227
+ size: "small",
228
+ placeholder: "#ffffff",
229
+ value: (_draft_textColor = draft.textColor) != null ? _draft_textColor : '',
230
+ onChange: (event)=>patch({
231
+ textColor: event.target.value
232
+ }),
233
+ sx: {
234
+ width: 120
235
+ }
236
+ })
237
+ ]
238
+ }),
239
+ /*#__PURE__*/ _jsxs(Stack, {
240
+ direction: "row",
241
+ spacing: 1,
242
+ sx: {
243
+ alignItems: 'center'
244
+ },
245
+ children: [
246
+ /*#__PURE__*/ _jsx(Switch, {
247
+ checked: draft.dismissible !== false,
248
+ onChange: (event)=>patch({
249
+ dismissible: event.target.checked
250
+ })
251
+ }),
252
+ /*#__PURE__*/ _jsx(Typography, {
253
+ variant: "body2",
254
+ children: 'Visitors can dismiss it (re-shown when the text changes)'
255
+ })
256
+ ]
257
+ }),
258
+ draft.text ? /*#__PURE__*/ _jsx(Box, {
259
+ sx: {
260
+ px: 2,
261
+ py: 1,
262
+ borderRadius: 1,
263
+ textAlign: 'center',
264
+ fontSize: 14,
265
+ color: draft.textColor || '#fff',
266
+ backgroundColor: draft.backgroundColor || '#111827'
267
+ },
268
+ children: copy.preview(draft.text)
269
+ }) : null,
270
+ /*#__PURE__*/ _jsx(Button, {
271
+ variant: "contained",
272
+ color: "primary",
273
+ disabled: !dirty || Boolean(draft.enabled) && !((_draft_text = draft.text) == null ? void 0 : _draft_text.trim()) || copy.pending(draft.text),
274
+ onClick: handleSave,
275
+ sx: {
276
+ alignSelf: 'flex-start'
277
+ },
278
+ children: 'Save'
279
+ }),
280
+ /*#__PURE__*/ _jsx(OverlayStatsRow, {
281
+ hostId: hostId,
282
+ actionKey: "barClick",
283
+ actionLabel: "clicks"
284
+ })
285
+ ]
286
+ })
287
+ });
288
+ }
289
+ AnnouncementBarCard.displayName = 'AnnouncementBarCard';
290
+ export default AnnouncementBarCard;
291
+
292
+ //# sourceMappingURL=announcement-bar-card.component.js.map