@emplugins/emprivacy 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,283 @@
1
+ import { t as AnalyticsProvider } from "./config-CqOtRoQR.mjs";
2
+ import { z } from "zod";
3
+ import * as emdash from "emdash";
4
+ import { PageFragmentContribution, PageMetadataContribution } from "emdash";
5
+ import * as emdash_plugin0 from "emdash/plugin";
6
+ import { PluginContext } from "emdash/plugin";
7
+
8
+ //#region src/sandbox-entry.d.ts
9
+ declare const _default: {
10
+ hooks: {
11
+ "plugin:install": (_e: emdash_plugin0.LifecycleEvent, ctx: PluginContext<emdash.PluginStorageConfig>) => Promise<void>;
12
+ "page:metadata": {
13
+ handler: (_e: emdash.PageMetadataEvent, ctx: PluginContext<emdash.PluginStorageConfig>) => Promise<PageMetadataContribution[] | null>;
14
+ };
15
+ "page:fragments": {
16
+ handler: (_e: emdash.PageFragmentEvent, ctx: PluginContext<emdash.PluginStorageConfig>) => Promise<PageFragmentContribution[]>;
17
+ };
18
+ };
19
+ routes: {
20
+ admin: {
21
+ handler: (routeCtx: emdash_plugin0.SandboxedRouteContext, ctx: PluginContext<emdash.PluginStorageConfig>) => Promise<{
22
+ blocks: ({
23
+ type: "header";
24
+ text: string;
25
+ blockId?: undefined;
26
+ fields?: undefined;
27
+ submit?: undefined;
28
+ } | {
29
+ type: "context";
30
+ text: string;
31
+ blockId?: undefined;
32
+ fields?: undefined;
33
+ submit?: undefined;
34
+ } | {
35
+ type: "divider";
36
+ text?: undefined;
37
+ blockId?: undefined;
38
+ fields?: undefined;
39
+ submit?: undefined;
40
+ } | {
41
+ type: "form";
42
+ blockId: string;
43
+ fields: ({
44
+ type: "text_input";
45
+ action_id: string;
46
+ label: string;
47
+ initial_value: string;
48
+ multiline?: undefined;
49
+ placeholder?: undefined;
50
+ options?: undefined;
51
+ condition?: undefined;
52
+ } | {
53
+ type: "text_input";
54
+ action_id: string;
55
+ label: string;
56
+ multiline: boolean;
57
+ initial_value: string;
58
+ placeholder?: undefined;
59
+ options?: undefined;
60
+ condition?: undefined;
61
+ } | {
62
+ type: "text_input";
63
+ action_id: string;
64
+ label: string;
65
+ placeholder: string;
66
+ initial_value: string;
67
+ multiline?: undefined;
68
+ options?: undefined;
69
+ condition?: undefined;
70
+ } | {
71
+ type: "toggle";
72
+ action_id: string;
73
+ label: string;
74
+ initial_value: boolean;
75
+ multiline?: undefined;
76
+ placeholder?: undefined;
77
+ options?: undefined;
78
+ condition?: undefined;
79
+ } | {
80
+ type: "radio";
81
+ action_id: string;
82
+ label: string;
83
+ options: {
84
+ value: string;
85
+ label: string;
86
+ }[];
87
+ initial_value: AnalyticsProvider;
88
+ multiline?: undefined;
89
+ placeholder?: undefined;
90
+ condition?: undefined;
91
+ } | {
92
+ type: "text_input";
93
+ action_id: string;
94
+ label: string;
95
+ placeholder: string;
96
+ initial_value: string;
97
+ condition: {
98
+ field: string;
99
+ eq: string;
100
+ };
101
+ multiline?: undefined;
102
+ options?: undefined;
103
+ } | {
104
+ type: "text_input";
105
+ action_id: string;
106
+ label: string;
107
+ placeholder: string;
108
+ multiline: boolean;
109
+ initial_value: string;
110
+ condition: {
111
+ field: string;
112
+ eq: string;
113
+ };
114
+ options?: undefined;
115
+ } | {
116
+ type: "text_input";
117
+ action_id: string;
118
+ label: string;
119
+ placeholder: string;
120
+ multiline: boolean;
121
+ initial_value: string;
122
+ options?: undefined;
123
+ condition?: undefined;
124
+ })[];
125
+ submit: {
126
+ label: string;
127
+ action_id: string;
128
+ };
129
+ text?: undefined;
130
+ } | {
131
+ type: "fields";
132
+ fields: {
133
+ label: string;
134
+ value: string;
135
+ }[];
136
+ text?: undefined;
137
+ blockId?: undefined;
138
+ submit?: undefined;
139
+ })[];
140
+ } | {
141
+ toast: {
142
+ message: string;
143
+ type: string;
144
+ };
145
+ blocks: ({
146
+ type: "header";
147
+ text: string;
148
+ blockId?: undefined;
149
+ fields?: undefined;
150
+ submit?: undefined;
151
+ } | {
152
+ type: "context";
153
+ text: string;
154
+ blockId?: undefined;
155
+ fields?: undefined;
156
+ submit?: undefined;
157
+ } | {
158
+ type: "divider";
159
+ text?: undefined;
160
+ blockId?: undefined;
161
+ fields?: undefined;
162
+ submit?: undefined;
163
+ } | {
164
+ type: "form";
165
+ blockId: string;
166
+ fields: ({
167
+ type: "text_input";
168
+ action_id: string;
169
+ label: string;
170
+ initial_value: string;
171
+ multiline?: undefined;
172
+ placeholder?: undefined;
173
+ options?: undefined;
174
+ condition?: undefined;
175
+ } | {
176
+ type: "text_input";
177
+ action_id: string;
178
+ label: string;
179
+ multiline: boolean;
180
+ initial_value: string;
181
+ placeholder?: undefined;
182
+ options?: undefined;
183
+ condition?: undefined;
184
+ } | {
185
+ type: "text_input";
186
+ action_id: string;
187
+ label: string;
188
+ placeholder: string;
189
+ initial_value: string;
190
+ multiline?: undefined;
191
+ options?: undefined;
192
+ condition?: undefined;
193
+ } | {
194
+ type: "toggle";
195
+ action_id: string;
196
+ label: string;
197
+ initial_value: boolean;
198
+ multiline?: undefined;
199
+ placeholder?: undefined;
200
+ options?: undefined;
201
+ condition?: undefined;
202
+ } | {
203
+ type: "radio";
204
+ action_id: string;
205
+ label: string;
206
+ options: {
207
+ value: string;
208
+ label: string;
209
+ }[];
210
+ initial_value: AnalyticsProvider;
211
+ multiline?: undefined;
212
+ placeholder?: undefined;
213
+ condition?: undefined;
214
+ } | {
215
+ type: "text_input";
216
+ action_id: string;
217
+ label: string;
218
+ placeholder: string;
219
+ initial_value: string;
220
+ condition: {
221
+ field: string;
222
+ eq: string;
223
+ };
224
+ multiline?: undefined;
225
+ options?: undefined;
226
+ } | {
227
+ type: "text_input";
228
+ action_id: string;
229
+ label: string;
230
+ placeholder: string;
231
+ multiline: boolean;
232
+ initial_value: string;
233
+ condition: {
234
+ field: string;
235
+ eq: string;
236
+ };
237
+ options?: undefined;
238
+ } | {
239
+ type: "text_input";
240
+ action_id: string;
241
+ label: string;
242
+ placeholder: string;
243
+ multiline: boolean;
244
+ initial_value: string;
245
+ options?: undefined;
246
+ condition?: undefined;
247
+ })[];
248
+ submit: {
249
+ label: string;
250
+ action_id: string;
251
+ };
252
+ text?: undefined;
253
+ } | {
254
+ type: "fields";
255
+ fields: {
256
+ label: string;
257
+ value: string;
258
+ }[];
259
+ text?: undefined;
260
+ blockId?: undefined;
261
+ submit?: undefined;
262
+ })[];
263
+ }>;
264
+ };
265
+ record: {
266
+ public: true;
267
+ input: z.ZodObject<{
268
+ policyVersion: z.ZodString;
269
+ analytics: z.ZodBoolean;
270
+ marketing: z.ZodBoolean;
271
+ }, z.core.$strip>;
272
+ handler: (routeCtx: emdash_plugin0.SandboxedRouteContext, ctx: PluginContext<emdash.PluginStorageConfig>) => Promise<Response | {
273
+ ok: boolean;
274
+ reason?: undefined;
275
+ } | {
276
+ ok: boolean;
277
+ reason: string;
278
+ }>;
279
+ };
280
+ };
281
+ };
282
+ //#endregion
283
+ export { _default as default };