@devvit/client 0.15.3-next-2026-11-09-20-13-16-e04d606076.0 → 0.15.3
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/effects/share.d.ts.map +1 -1
- package/effects/share.js +2 -3
- package/package.json +8 -8
- package/client-meta.min.json +0 -789
- package/client.min.js +0 -2
- package/client.min.js.map +0 -7
package/effects/share.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/effects/share.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAMzC,MAAM,MAAM,cAAc,GAAG;IAC3B,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iFAAiF;IACjF,IAAI,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;CACvB,CAAC;AAGF,4EAA4E;AAC5E,wBAAsB,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/effects/share.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAMzC,MAAM,MAAM,cAAc,GAAG;IAC3B,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iFAAiF;IACjF,IAAI,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;CACvB,CAAC;AAGF,4EAA4E;AAC5E,wBAAsB,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BlF;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAEjD"}
|
package/effects/share.js
CHANGED
|
@@ -8,9 +8,6 @@ import { redditUrlFromPostId } from '@devvit/shared-types/web-view-scripts-const
|
|
|
8
8
|
export async function showShareSheet(opts) {
|
|
9
9
|
if (opts.data && opts.data.length > maxShareParamUserDataChars)
|
|
10
10
|
throw Error(`data must be <= ${maxShareParamUserDataChars} characters but was ${opts.data.length} characters`);
|
|
11
|
-
const postId = opts.post ?? devvit.context.postId;
|
|
12
|
-
if (!postId)
|
|
13
|
-
throw Error('A post must be specified when sharing outside a post');
|
|
14
11
|
const iconURL = `${new URL(ICON_FILE_PATH, location.origin)}`;
|
|
15
12
|
let iconRsp;
|
|
16
13
|
try {
|
|
@@ -19,6 +16,8 @@ export async function showShareSheet(opts) {
|
|
|
19
16
|
catch {
|
|
20
17
|
//
|
|
21
18
|
}
|
|
19
|
+
// Create the share URL using the post from the props, or the current post if not provided.
|
|
20
|
+
const postId = opts.post ?? devvit.context.postId;
|
|
22
21
|
const url = redditUrlFromPostId(postId);
|
|
23
22
|
emitEffect({
|
|
24
23
|
type: EffectType.EFFECT_WEB_VIEW,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/client",
|
|
3
|
-
"version": "0.15.3
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"test:unit-with-coverage": "vitest run --coverage"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@devvit/protos": "0.15.3
|
|
36
|
-
"@devvit/shared": "0.15.3
|
|
37
|
-
"@devvit/shared-types": "0.15.3
|
|
38
|
-
"@devvit/web-view-scripts": "0.15.3
|
|
35
|
+
"@devvit/protos": "0.15.3",
|
|
36
|
+
"@devvit/shared": "0.15.3",
|
|
37
|
+
"@devvit/shared-types": "0.15.3",
|
|
38
|
+
"@devvit/web-view-scripts": "0.15.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@ampproject/filesize": "4.3.0",
|
|
42
|
-
"@devvit/repo-tools": "0.15.3
|
|
43
|
-
"@devvit/tsconfig": "0.15.3
|
|
42
|
+
"@devvit/repo-tools": "0.15.3",
|
|
43
|
+
"@devvit/tsconfig": "0.15.3",
|
|
44
44
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
45
45
|
"esbuild": "0.25.9",
|
|
46
46
|
"eslint": "9.11.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"none": "15 KB"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "0ffe1ef5dbecc63d5dfbe376b6a7a9328c52c4b5"
|
|
57
57
|
}
|
package/client-meta.min.json
DELETED
|
@@ -1,789 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"inputs": {
|
|
3
|
-
"../protos/dist/json/devvit/ui/effects/v1alpha/effect.js": {
|
|
4
|
-
"bytes": 3338,
|
|
5
|
-
"imports": [],
|
|
6
|
-
"format": "esm"
|
|
7
|
-
},
|
|
8
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/user_progress.js": {
|
|
9
|
-
"bytes": 967,
|
|
10
|
-
"imports": [],
|
|
11
|
-
"format": "esm"
|
|
12
|
-
},
|
|
13
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/post_message.js": {
|
|
14
|
-
"bytes": 563,
|
|
15
|
-
"imports": [],
|
|
16
|
-
"format": "esm"
|
|
17
|
-
},
|
|
18
|
-
"../shared-types/dist/client/emit-effect.js": {
|
|
19
|
-
"bytes": 3001,
|
|
20
|
-
"imports": [
|
|
21
|
-
{
|
|
22
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
23
|
-
"kind": "import-statement",
|
|
24
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../protos/dist/json/devvit/ui/effects/web_view/v1alpha/post_message.js",
|
|
28
|
-
"kind": "import-statement",
|
|
29
|
-
"original": "@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"format": "esm"
|
|
33
|
-
},
|
|
34
|
-
"../shared-types/dist/user-progress.js": {
|
|
35
|
-
"bytes": 159,
|
|
36
|
-
"imports": [],
|
|
37
|
-
"format": "esm"
|
|
38
|
-
},
|
|
39
|
-
"src/effects/user-progress.ts": {
|
|
40
|
-
"bytes": 1937,
|
|
41
|
-
"imports": [
|
|
42
|
-
{
|
|
43
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
44
|
-
"kind": "import-statement",
|
|
45
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "../protos/dist/json/devvit/ui/effects/web_view/v1alpha/user_progress.js",
|
|
49
|
-
"kind": "import-statement",
|
|
50
|
-
"original": "@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/user_progress.js"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
54
|
-
"kind": "import-statement",
|
|
55
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"path": "../shared-types/dist/user-progress.js",
|
|
59
|
-
"kind": "import-statement",
|
|
60
|
-
"original": "@devvit/shared-types/user-progress.js"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"format": "esm"
|
|
64
|
-
},
|
|
65
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js": {
|
|
66
|
-
"bytes": 922,
|
|
67
|
-
"imports": [],
|
|
68
|
-
"format": "esm"
|
|
69
|
-
},
|
|
70
|
-
"../shared-types/dist/client/telemetry.js": {
|
|
71
|
-
"bytes": 2611,
|
|
72
|
-
"imports": [
|
|
73
|
-
{
|
|
74
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
75
|
-
"kind": "import-statement",
|
|
76
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
80
|
-
"kind": "import-statement",
|
|
81
|
-
"original": "./emit-effect.js"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"format": "esm"
|
|
85
|
-
},
|
|
86
|
-
"../shared-types/dist/constants.js": {
|
|
87
|
-
"bytes": 1576,
|
|
88
|
-
"imports": [],
|
|
89
|
-
"format": "esm"
|
|
90
|
-
},
|
|
91
|
-
"../shared-types/dist/webbit.js": {
|
|
92
|
-
"bytes": 159,
|
|
93
|
-
"imports": [],
|
|
94
|
-
"format": "esm"
|
|
95
|
-
},
|
|
96
|
-
"src/effects/web-view-mode.ts": {
|
|
97
|
-
"bytes": 5828,
|
|
98
|
-
"imports": [
|
|
99
|
-
{
|
|
100
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
101
|
-
"kind": "import-statement",
|
|
102
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"path": "../protos/dist/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js",
|
|
106
|
-
"kind": "import-statement",
|
|
107
|
-
"original": "@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
111
|
-
"kind": "import-statement",
|
|
112
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"path": "../shared-types/dist/client/telemetry.js",
|
|
116
|
-
"kind": "import-statement",
|
|
117
|
-
"original": "@devvit/shared-types/client/telemetry.js"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"path": "../shared-types/dist/constants.js",
|
|
121
|
-
"kind": "import-statement",
|
|
122
|
-
"original": "@devvit/shared-types/constants.js"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"path": "../shared-types/dist/webbit.js",
|
|
126
|
-
"kind": "import-statement",
|
|
127
|
-
"original": "@devvit/shared-types/webbit.js"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"format": "esm"
|
|
131
|
-
},
|
|
132
|
-
"src/clientContext.ts": {
|
|
133
|
-
"bytes": 189,
|
|
134
|
-
"imports": [],
|
|
135
|
-
"format": "esm"
|
|
136
|
-
},
|
|
137
|
-
"src/effects/ad-payload.ts": {
|
|
138
|
-
"bytes": 269,
|
|
139
|
-
"imports": [],
|
|
140
|
-
"format": "esm"
|
|
141
|
-
},
|
|
142
|
-
"src/effects/experiments.ts": {
|
|
143
|
-
"bytes": 1082,
|
|
144
|
-
"imports": [
|
|
145
|
-
{
|
|
146
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
147
|
-
"kind": "import-statement",
|
|
148
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
"format": "esm"
|
|
152
|
-
},
|
|
153
|
-
"src/effects/helpers/form-types.ts": {
|
|
154
|
-
"bytes": 2373,
|
|
155
|
-
"imports": [],
|
|
156
|
-
"format": "esm"
|
|
157
|
-
},
|
|
158
|
-
"src/effects/login-prompt.ts": {
|
|
159
|
-
"bytes": 340,
|
|
160
|
-
"imports": [
|
|
161
|
-
{
|
|
162
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
163
|
-
"kind": "import-statement",
|
|
164
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
168
|
-
"kind": "import-statement",
|
|
169
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
"format": "esm"
|
|
173
|
-
},
|
|
174
|
-
"../shared-types/dist/thing-navigation.js": {
|
|
175
|
-
"bytes": 1484,
|
|
176
|
-
"imports": [],
|
|
177
|
-
"format": "esm"
|
|
178
|
-
},
|
|
179
|
-
"../shared-types/dist/web-view-scripts-constants.js": {
|
|
180
|
-
"bytes": 1179,
|
|
181
|
-
"imports": [],
|
|
182
|
-
"format": "esm"
|
|
183
|
-
},
|
|
184
|
-
"src/effects/navigate-to.ts": {
|
|
185
|
-
"bytes": 2165,
|
|
186
|
-
"imports": [
|
|
187
|
-
{
|
|
188
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
189
|
-
"kind": "import-statement",
|
|
190
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"path": "../shared-types/dist/thing-navigation.js",
|
|
194
|
-
"kind": "import-statement",
|
|
195
|
-
"original": "@devvit/shared-types/thing-navigation.js"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
"path": "../shared-types/dist/web-view-scripts-constants.js",
|
|
199
|
-
"kind": "import-statement",
|
|
200
|
-
"original": "@devvit/shared-types/web-view-scripts-constants.js"
|
|
201
|
-
}
|
|
202
|
-
],
|
|
203
|
-
"format": "esm"
|
|
204
|
-
},
|
|
205
|
-
"../protos/dist/json/reddit/devvit/app_permission/v1/app_permission.js": {
|
|
206
|
-
"bytes": 1681,
|
|
207
|
-
"imports": [],
|
|
208
|
-
"format": "esm"
|
|
209
|
-
},
|
|
210
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/context.js": {
|
|
211
|
-
"bytes": 1322,
|
|
212
|
-
"imports": [],
|
|
213
|
-
"format": "esm"
|
|
214
|
-
},
|
|
215
|
-
"../shared-types/dist/assert.js": {
|
|
216
|
-
"bytes": 89,
|
|
217
|
-
"imports": [],
|
|
218
|
-
"format": "esm"
|
|
219
|
-
},
|
|
220
|
-
"../shared-types/dist/tid.js": {
|
|
221
|
-
"bytes": 2489,
|
|
222
|
-
"imports": [
|
|
223
|
-
{
|
|
224
|
-
"path": "../shared-types/dist/assert.js",
|
|
225
|
-
"kind": "import-statement",
|
|
226
|
-
"original": "./assert.js"
|
|
227
|
-
}
|
|
228
|
-
],
|
|
229
|
-
"format": "esm"
|
|
230
|
-
},
|
|
231
|
-
"../web-view-scripts/dist/client.js": {
|
|
232
|
-
"bytes": 680,
|
|
233
|
-
"imports": [
|
|
234
|
-
{
|
|
235
|
-
"path": "../shared-types/dist/web-view-scripts-constants.js",
|
|
236
|
-
"kind": "import-statement",
|
|
237
|
-
"original": "@devvit/shared-types/web-view-scripts-constants.js"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
"format": "esm"
|
|
241
|
-
},
|
|
242
|
-
"../../node_modules/jwt-decode/build/esm/index.js": {
|
|
243
|
-
"bytes": 1697,
|
|
244
|
-
"imports": [],
|
|
245
|
-
"format": "esm"
|
|
246
|
-
},
|
|
247
|
-
"../web-view-scripts/dist/token.js": {
|
|
248
|
-
"bytes": 1255,
|
|
249
|
-
"imports": [
|
|
250
|
-
{
|
|
251
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
252
|
-
"kind": "import-statement",
|
|
253
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
257
|
-
"kind": "import-statement",
|
|
258
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"path": "../../node_modules/jwt-decode/build/esm/index.js",
|
|
262
|
-
"kind": "import-statement",
|
|
263
|
-
"original": "jwt-decode"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"path": "../web-view-scripts/dist/devvit-global.js",
|
|
267
|
-
"kind": "import-statement",
|
|
268
|
-
"original": "./devvit-global.js"
|
|
269
|
-
}
|
|
270
|
-
],
|
|
271
|
-
"format": "esm"
|
|
272
|
-
},
|
|
273
|
-
"../web-view-scripts/dist/devvit-global.js": {
|
|
274
|
-
"bytes": 4936,
|
|
275
|
-
"imports": [
|
|
276
|
-
{
|
|
277
|
-
"path": "../protos/dist/json/devvit/ui/effects/web_view/v1alpha/context.js",
|
|
278
|
-
"kind": "import-statement",
|
|
279
|
-
"original": "@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"path": "../shared-types/dist/tid.js",
|
|
283
|
-
"kind": "import-statement",
|
|
284
|
-
"original": "@devvit/shared-types/tid.js"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"path": "../shared-types/dist/webbit.js",
|
|
288
|
-
"kind": "import-statement",
|
|
289
|
-
"original": "@devvit/shared-types/webbit.js"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"path": "../web-view-scripts/dist/client.js",
|
|
293
|
-
"kind": "import-statement",
|
|
294
|
-
"original": "./client.js"
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"path": "../web-view-scripts/dist/token.js",
|
|
298
|
-
"kind": "import-statement",
|
|
299
|
-
"original": "./token.js"
|
|
300
|
-
}
|
|
301
|
-
],
|
|
302
|
-
"format": "esm"
|
|
303
|
-
},
|
|
304
|
-
"src/effects/run-as-user.ts": {
|
|
305
|
-
"bytes": 2530,
|
|
306
|
-
"imports": [
|
|
307
|
-
{
|
|
308
|
-
"path": "../protos/dist/json/reddit/devvit/app_permission/v1/app_permission.js",
|
|
309
|
-
"kind": "import-statement",
|
|
310
|
-
"original": "@devvit/protos/json/reddit/devvit/app_permission/v1/app_permission.js"
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
314
|
-
"kind": "import-statement",
|
|
315
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"path": "../web-view-scripts/dist/devvit-global.js",
|
|
319
|
-
"kind": "import-statement",
|
|
320
|
-
"original": "@devvit/web-view-scripts/devvit-global.js"
|
|
321
|
-
}
|
|
322
|
-
],
|
|
323
|
-
"format": "esm"
|
|
324
|
-
},
|
|
325
|
-
"../shared-types/dist/client/share.js": {
|
|
326
|
-
"bytes": 90,
|
|
327
|
-
"imports": [],
|
|
328
|
-
"format": "esm"
|
|
329
|
-
},
|
|
330
|
-
"src/effects/share.ts": {
|
|
331
|
-
"bytes": 1856,
|
|
332
|
-
"imports": [
|
|
333
|
-
{
|
|
334
|
-
"path": "../protos/dist/json/devvit/ui/effects/v1alpha/effect.js",
|
|
335
|
-
"kind": "import-statement",
|
|
336
|
-
"original": "@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js"
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
340
|
-
"kind": "import-statement",
|
|
341
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
"path": "../shared-types/dist/client/share.js",
|
|
345
|
-
"kind": "import-statement",
|
|
346
|
-
"original": "@devvit/shared-types/client/share.js"
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"path": "../shared-types/dist/constants.js",
|
|
350
|
-
"kind": "import-statement",
|
|
351
|
-
"original": "@devvit/shared-types/constants.js"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"path": "../shared-types/dist/web-view-scripts-constants.js",
|
|
355
|
-
"kind": "import-statement",
|
|
356
|
-
"original": "@devvit/shared-types/web-view-scripts-constants.js"
|
|
357
|
-
}
|
|
358
|
-
],
|
|
359
|
-
"format": "esm"
|
|
360
|
-
},
|
|
361
|
-
"src/effects/helpers/assert-valid-form-fields.ts": {
|
|
362
|
-
"bytes": 1270,
|
|
363
|
-
"imports": [],
|
|
364
|
-
"format": "esm"
|
|
365
|
-
},
|
|
366
|
-
"../protos/dist/json/devvit/ui/form_builder/v1alpha/type.js": {
|
|
367
|
-
"bytes": 1198,
|
|
368
|
-
"imports": [],
|
|
369
|
-
"format": "esm"
|
|
370
|
-
},
|
|
371
|
-
"../shared/dist/types/menu-item.js": {
|
|
372
|
-
"bytes": 11,
|
|
373
|
-
"imports": [],
|
|
374
|
-
"format": "esm"
|
|
375
|
-
},
|
|
376
|
-
"../shared/dist/types/settings.js": {
|
|
377
|
-
"bytes": 11,
|
|
378
|
-
"imports": [],
|
|
379
|
-
"format": "esm"
|
|
380
|
-
},
|
|
381
|
-
"../protos/dist/json/devvit/events/v1alpha/events.js": {
|
|
382
|
-
"bytes": 1117,
|
|
383
|
-
"imports": [],
|
|
384
|
-
"format": "esm"
|
|
385
|
-
},
|
|
386
|
-
"../protos/dist/json/devvit/reddit/v2alpha/postv2.js": {
|
|
387
|
-
"bytes": 1135,
|
|
388
|
-
"imports": [],
|
|
389
|
-
"format": "esm"
|
|
390
|
-
},
|
|
391
|
-
"../protos/dist/json/devvit/reddit/v2alpha/subredditv2.js": {
|
|
392
|
-
"bytes": 4090,
|
|
393
|
-
"imports": [],
|
|
394
|
-
"format": "esm"
|
|
395
|
-
},
|
|
396
|
-
"../shared/dist/types/triggers.js": {
|
|
397
|
-
"bytes": 708,
|
|
398
|
-
"imports": [
|
|
399
|
-
{
|
|
400
|
-
"path": "../protos/dist/json/devvit/events/v1alpha/events.js",
|
|
401
|
-
"kind": "import-statement",
|
|
402
|
-
"original": "@devvit/protos/json/devvit/events/v1alpha/events.js"
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"path": "../protos/dist/json/devvit/events/v1alpha/events.js",
|
|
406
|
-
"kind": "import-statement",
|
|
407
|
-
"original": "@devvit/protos/json/devvit/events/v1alpha/events.js"
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
"path": "../protos/dist/json/devvit/reddit/v2alpha/postv2.js",
|
|
411
|
-
"kind": "import-statement",
|
|
412
|
-
"original": "@devvit/protos/json/devvit/reddit/v2alpha/postv2.js"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
"path": "../protos/dist/json/devvit/reddit/v2alpha/subredditv2.js",
|
|
416
|
-
"kind": "import-statement",
|
|
417
|
-
"original": "@devvit/protos/json/devvit/reddit/v2alpha/subredditv2.js"
|
|
418
|
-
}
|
|
419
|
-
],
|
|
420
|
-
"format": "esm"
|
|
421
|
-
},
|
|
422
|
-
"../shared/dist/types/ui-response.js": {
|
|
423
|
-
"bytes": 11,
|
|
424
|
-
"imports": [],
|
|
425
|
-
"format": "esm"
|
|
426
|
-
},
|
|
427
|
-
"../shared-types/dist/json.js": {
|
|
428
|
-
"bytes": 11,
|
|
429
|
-
"imports": [],
|
|
430
|
-
"format": "esm"
|
|
431
|
-
},
|
|
432
|
-
"../shared-types/dist/shared/baseContext.js": {
|
|
433
|
-
"bytes": 11,
|
|
434
|
-
"imports": [],
|
|
435
|
-
"format": "esm"
|
|
436
|
-
},
|
|
437
|
-
"../shared-types/dist/shared/form.js": {
|
|
438
|
-
"bytes": 177,
|
|
439
|
-
"imports": [],
|
|
440
|
-
"format": "esm"
|
|
441
|
-
},
|
|
442
|
-
"../shared/dist/index.js": {
|
|
443
|
-
"bytes": 356,
|
|
444
|
-
"imports": [
|
|
445
|
-
{
|
|
446
|
-
"path": "../shared/dist/types/menu-item.js",
|
|
447
|
-
"kind": "import-statement",
|
|
448
|
-
"original": "./types/menu-item.js"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
"path": "../shared/dist/types/settings.js",
|
|
452
|
-
"kind": "import-statement",
|
|
453
|
-
"original": "./types/settings.js"
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
"path": "../shared/dist/types/triggers.js",
|
|
457
|
-
"kind": "import-statement",
|
|
458
|
-
"original": "./types/triggers.js"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
"path": "../shared/dist/types/ui-response.js",
|
|
462
|
-
"kind": "import-statement",
|
|
463
|
-
"original": "./types/ui-response.js"
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
"path": "../shared-types/dist/json.js",
|
|
467
|
-
"kind": "import-statement",
|
|
468
|
-
"original": "@devvit/shared-types/json.js"
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"path": "../shared-types/dist/shared/baseContext.js",
|
|
472
|
-
"kind": "import-statement",
|
|
473
|
-
"original": "@devvit/shared-types/shared/baseContext.js"
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"path": "../shared-types/dist/shared/form.js",
|
|
477
|
-
"kind": "import-statement",
|
|
478
|
-
"original": "@devvit/shared-types/shared/form.js"
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
"path": "../shared-types/dist/tid.js",
|
|
482
|
-
"kind": "import-statement",
|
|
483
|
-
"original": "@devvit/shared-types/tid.js"
|
|
484
|
-
}
|
|
485
|
-
],
|
|
486
|
-
"format": "esm"
|
|
487
|
-
},
|
|
488
|
-
"src/effects/helpers/get-form-values.ts": {
|
|
489
|
-
"bytes": 1449,
|
|
490
|
-
"imports": [
|
|
491
|
-
{
|
|
492
|
-
"path": "../protos/dist/json/devvit/ui/form_builder/v1alpha/type.js",
|
|
493
|
-
"kind": "import-statement",
|
|
494
|
-
"original": "@devvit/protos/json/devvit/ui/form_builder/v1alpha/type.js"
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
"path": "../shared/dist/index.js",
|
|
498
|
-
"kind": "import-statement",
|
|
499
|
-
"original": "@devvit/shared"
|
|
500
|
-
}
|
|
501
|
-
],
|
|
502
|
-
"format": "esm"
|
|
503
|
-
},
|
|
504
|
-
"src/effects/helpers/transform-form.ts": {
|
|
505
|
-
"bytes": 4205,
|
|
506
|
-
"imports": [
|
|
507
|
-
{
|
|
508
|
-
"path": "../protos/dist/json/devvit/ui/form_builder/v1alpha/type.js",
|
|
509
|
-
"kind": "import-statement",
|
|
510
|
-
"original": "@devvit/protos/json/devvit/ui/form_builder/v1alpha/type.js"
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
"path": "../shared/dist/index.js",
|
|
514
|
-
"kind": "import-statement",
|
|
515
|
-
"original": "@devvit/shared"
|
|
516
|
-
}
|
|
517
|
-
],
|
|
518
|
-
"format": "esm"
|
|
519
|
-
},
|
|
520
|
-
"src/effects/show-form.ts": {
|
|
521
|
-
"bytes": 2154,
|
|
522
|
-
"imports": [
|
|
523
|
-
{
|
|
524
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
525
|
-
"kind": "import-statement",
|
|
526
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"path": "src/effects/helpers/assert-valid-form-fields.ts",
|
|
530
|
-
"kind": "import-statement",
|
|
531
|
-
"original": "./helpers/assert-valid-form-fields.js"
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
"path": "src/effects/helpers/get-form-values.ts",
|
|
535
|
-
"kind": "import-statement",
|
|
536
|
-
"original": "./helpers/get-form-values.js"
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
"path": "src/effects/helpers/transform-form.ts",
|
|
540
|
-
"kind": "import-statement",
|
|
541
|
-
"original": "./helpers/transform-form.js"
|
|
542
|
-
}
|
|
543
|
-
],
|
|
544
|
-
"format": "esm"
|
|
545
|
-
},
|
|
546
|
-
"src/effects/show-toast.ts": {
|
|
547
|
-
"bytes": 1034,
|
|
548
|
-
"imports": [
|
|
549
|
-
{
|
|
550
|
-
"path": "../shared-types/dist/client/emit-effect.js",
|
|
551
|
-
"kind": "import-statement",
|
|
552
|
-
"original": "@devvit/shared-types/client/emit-effect.js"
|
|
553
|
-
}
|
|
554
|
-
],
|
|
555
|
-
"format": "esm"
|
|
556
|
-
},
|
|
557
|
-
"../shared-types/dist/PostData.js": {
|
|
558
|
-
"bytes": 11,
|
|
559
|
-
"imports": [],
|
|
560
|
-
"format": "esm"
|
|
561
|
-
},
|
|
562
|
-
"src/index.ts": {
|
|
563
|
-
"bytes": 819,
|
|
564
|
-
"imports": [
|
|
565
|
-
{
|
|
566
|
-
"path": "src/effects/user-progress.ts",
|
|
567
|
-
"kind": "import-statement",
|
|
568
|
-
"original": "./effects/user-progress.js"
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
"path": "src/effects/web-view-mode.ts",
|
|
572
|
-
"kind": "import-statement",
|
|
573
|
-
"original": "./effects/web-view-mode.js"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
"path": "src/clientContext.ts",
|
|
577
|
-
"kind": "import-statement",
|
|
578
|
-
"original": "./clientContext.js"
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
"path": "src/effects/ad-payload.ts",
|
|
582
|
-
"kind": "import-statement",
|
|
583
|
-
"original": "./effects/ad-payload.js"
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
"path": "src/effects/experiments.ts",
|
|
587
|
-
"kind": "import-statement",
|
|
588
|
-
"original": "./effects/experiments.js"
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
"path": "src/effects/helpers/form-types.ts",
|
|
592
|
-
"kind": "import-statement",
|
|
593
|
-
"original": "./effects/helpers/form-types.js"
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
"path": "src/effects/login-prompt.ts",
|
|
597
|
-
"kind": "import-statement",
|
|
598
|
-
"original": "./effects/login-prompt.js"
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
"path": "src/effects/navigate-to.ts",
|
|
602
|
-
"kind": "import-statement",
|
|
603
|
-
"original": "./effects/navigate-to.js"
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
"path": "src/effects/run-as-user.ts",
|
|
607
|
-
"kind": "import-statement",
|
|
608
|
-
"original": "./effects/run-as-user.js"
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
"path": "src/effects/share.ts",
|
|
612
|
-
"kind": "import-statement",
|
|
613
|
-
"original": "./effects/share.js"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"path": "src/effects/show-form.ts",
|
|
617
|
-
"kind": "import-statement",
|
|
618
|
-
"original": "./effects/show-form.js"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
"path": "src/effects/show-toast.ts",
|
|
622
|
-
"kind": "import-statement",
|
|
623
|
-
"original": "./effects/show-toast.js"
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
"path": "src/effects/web-view-mode.ts",
|
|
627
|
-
"kind": "import-statement",
|
|
628
|
-
"original": "./effects/web-view-mode.js"
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
"path": "../shared-types/dist/PostData.js",
|
|
632
|
-
"kind": "import-statement",
|
|
633
|
-
"original": "@devvit/shared-types/PostData.js"
|
|
634
|
-
}
|
|
635
|
-
],
|
|
636
|
-
"format": "esm"
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
"outputs": {
|
|
640
|
-
"dist/client.min.js.map": {
|
|
641
|
-
"imports": [],
|
|
642
|
-
"exports": [],
|
|
643
|
-
"inputs": {},
|
|
644
|
-
"bytes": 85651
|
|
645
|
-
},
|
|
646
|
-
"dist/client.min.js": {
|
|
647
|
-
"imports": [],
|
|
648
|
-
"exports": [
|
|
649
|
-
"addWebViewModeListener",
|
|
650
|
-
"canRunAsUser",
|
|
651
|
-
"context",
|
|
652
|
-
"exitExpandedMode",
|
|
653
|
-
"experimentVariant",
|
|
654
|
-
"exposeExperiment",
|
|
655
|
-
"getAdPayload",
|
|
656
|
-
"getShareData",
|
|
657
|
-
"getWebViewMode",
|
|
658
|
-
"initWebViewMode",
|
|
659
|
-
"navigateTo",
|
|
660
|
-
"navigateToPost",
|
|
661
|
-
"onWebViewMessage",
|
|
662
|
-
"removeWebViewModeListener",
|
|
663
|
-
"requestExpandedMode",
|
|
664
|
-
"showForm",
|
|
665
|
-
"showLoginPrompt",
|
|
666
|
-
"showShareSheet",
|
|
667
|
-
"showToast"
|
|
668
|
-
],
|
|
669
|
-
"entryPoint": "src/index.ts",
|
|
670
|
-
"inputs": {
|
|
671
|
-
"../protos/dist/json/devvit/ui/effects/v1alpha/effect.js": {
|
|
672
|
-
"bytesInOutput": 901
|
|
673
|
-
},
|
|
674
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/user_progress.js": {
|
|
675
|
-
"bytesInOutput": 155
|
|
676
|
-
},
|
|
677
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/post_message.js": {
|
|
678
|
-
"bytesInOutput": 91
|
|
679
|
-
},
|
|
680
|
-
"../shared-types/dist/client/emit-effect.js": {
|
|
681
|
-
"bytesInOutput": 523
|
|
682
|
-
},
|
|
683
|
-
"../shared-types/dist/user-progress.js": {
|
|
684
|
-
"bytesInOutput": 31
|
|
685
|
-
},
|
|
686
|
-
"src/effects/user-progress.ts": {
|
|
687
|
-
"bytesInOutput": 549
|
|
688
|
-
},
|
|
689
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js": {
|
|
690
|
-
"bytesInOutput": 173
|
|
691
|
-
},
|
|
692
|
-
"../shared-types/dist/client/telemetry.js": {
|
|
693
|
-
"bytesInOutput": 937
|
|
694
|
-
},
|
|
695
|
-
"../shared-types/dist/constants.js": {
|
|
696
|
-
"bytesInOutput": 39
|
|
697
|
-
},
|
|
698
|
-
"../shared-types/dist/webbit.js": {
|
|
699
|
-
"bytesInOutput": 14
|
|
700
|
-
},
|
|
701
|
-
"src/effects/web-view-mode.ts": {
|
|
702
|
-
"bytesInOutput": 1174
|
|
703
|
-
},
|
|
704
|
-
"src/clientContext.ts": {
|
|
705
|
-
"bytesInOutput": 34
|
|
706
|
-
},
|
|
707
|
-
"src/index.ts": {
|
|
708
|
-
"bytesInOutput": 8
|
|
709
|
-
},
|
|
710
|
-
"src/effects/ad-payload.ts": {
|
|
711
|
-
"bytesInOutput": 38
|
|
712
|
-
},
|
|
713
|
-
"src/effects/experiments.ts": {
|
|
714
|
-
"bytesInOutput": 249
|
|
715
|
-
},
|
|
716
|
-
"src/effects/login-prompt.ts": {
|
|
717
|
-
"bytesInOutput": 61
|
|
718
|
-
},
|
|
719
|
-
"../shared-types/dist/thing-navigation.js": {
|
|
720
|
-
"bytesInOutput": 247
|
|
721
|
-
},
|
|
722
|
-
"../shared-types/dist/web-view-scripts-constants.js": {
|
|
723
|
-
"bytesInOutput": 138
|
|
724
|
-
},
|
|
725
|
-
"src/effects/navigate-to.ts": {
|
|
726
|
-
"bytesInOutput": 397
|
|
727
|
-
},
|
|
728
|
-
"../protos/dist/json/reddit/devvit/app_permission/v1/app_permission.js": {
|
|
729
|
-
"bytesInOutput": 405
|
|
730
|
-
},
|
|
731
|
-
"../protos/dist/json/devvit/ui/effects/web_view/v1alpha/context.js": {
|
|
732
|
-
"bytesInOutput": 497
|
|
733
|
-
},
|
|
734
|
-
"../shared-types/dist/tid.js": {
|
|
735
|
-
"bytesInOutput": 125
|
|
736
|
-
},
|
|
737
|
-
"../../node_modules/jwt-decode/build/esm/index.js": {
|
|
738
|
-
"bytesInOutput": 65
|
|
739
|
-
},
|
|
740
|
-
"../web-view-scripts/dist/devvit-global.js": {
|
|
741
|
-
"bytesInOutput": 107
|
|
742
|
-
},
|
|
743
|
-
"src/effects/run-as-user.ts": {
|
|
744
|
-
"bytesInOutput": 691
|
|
745
|
-
},
|
|
746
|
-
"src/effects/share.ts": {
|
|
747
|
-
"bytesInOutput": 496
|
|
748
|
-
},
|
|
749
|
-
"src/effects/helpers/assert-valid-form-fields.ts": {
|
|
750
|
-
"bytesInOutput": 359
|
|
751
|
-
},
|
|
752
|
-
"../protos/dist/json/devvit/ui/form_builder/v1alpha/type.js": {
|
|
753
|
-
"bytesInOutput": 258
|
|
754
|
-
},
|
|
755
|
-
"../shared/dist/index.js": {
|
|
756
|
-
"bytesInOutput": 0
|
|
757
|
-
},
|
|
758
|
-
"../protos/dist/json/devvit/events/v1alpha/events.js": {
|
|
759
|
-
"bytesInOutput": 450
|
|
760
|
-
},
|
|
761
|
-
"../shared/dist/types/triggers.js": {
|
|
762
|
-
"bytesInOutput": 0
|
|
763
|
-
},
|
|
764
|
-
"../protos/dist/json/devvit/reddit/v2alpha/postv2.js": {
|
|
765
|
-
"bytesInOutput": 366
|
|
766
|
-
},
|
|
767
|
-
"../protos/dist/json/devvit/reddit/v2alpha/subredditv2.js": {
|
|
768
|
-
"bytesInOutput": 1651
|
|
769
|
-
},
|
|
770
|
-
"../shared-types/dist/shared/form.js": {
|
|
771
|
-
"bytesInOutput": 74
|
|
772
|
-
},
|
|
773
|
-
"src/effects/helpers/get-form-values.ts": {
|
|
774
|
-
"bytesInOutput": 381
|
|
775
|
-
},
|
|
776
|
-
"src/effects/helpers/transform-form.ts": {
|
|
777
|
-
"bytesInOutput": 1774
|
|
778
|
-
},
|
|
779
|
-
"src/effects/show-form.ts": {
|
|
780
|
-
"bytesInOutput": 347
|
|
781
|
-
},
|
|
782
|
-
"src/effects/show-toast.ts": {
|
|
783
|
-
"bytesInOutput": 140
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
"bytes": 14398
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
package/client.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var E;(function(e){e[e.EFFECT_REALTIME_SUB=0]="EFFECT_REALTIME_SUB",e[e.EFFECT_RERENDER_UI=1]="EFFECT_RERENDER_UI",e[e.EFFECT_RELOAD_PART=2]="EFFECT_RELOAD_PART",e[e.EFFECT_SHOW_FORM=3]="EFFECT_SHOW_FORM",e[e.EFFECT_SHOW_TOAST=4]="EFFECT_SHOW_TOAST",e[e.EFFECT_NAVIGATE_TO_URL=5]="EFFECT_NAVIGATE_TO_URL",e[e.EFFECT_SET_INTERVALS=7]="EFFECT_SET_INTERVALS",e[e.EFFECT_CREATE_ORDER=8]="EFFECT_CREATE_ORDER",e[e.EFFECT_WEB_VIEW=9]="EFFECT_WEB_VIEW",e[e.EFFECT_CAN_RUN_AS_USER=11]="EFFECT_CAN_RUN_AS_USER",e[e.EFFECT_TELEMETRY=12]="EFFECT_TELEMETRY",e[e.EFFECT_UPDATE_REQUEST_CONTEXT=13]="EFFECT_UPDATE_REQUEST_CONTEXT",e[e.EFFECT_SCREENSHOT_RESPONSE=14]="EFFECT_SCREENSHOT_RESPONSE",e[e.EFFECT_LOGIN_PROMPT=15]="EFFECT_LOGIN_PROMPT",e[e.EFFECT_PROMOTED_TELEMETRY=16]="EFFECT_PROMOTED_TELEMETRY",e[e.EFFECT_EXPOSE_EXPERIMENT=17]="EFFECT_EXPOSE_EXPERIMENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(E||(E={}));var d;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.STARTED=1]="STARTED",e[e.COMPLETED=2]="COMPLETED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(d||(d={}));var u;(function(e){e[e.CLIENT=0]="CLIENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(u||(u={}));var F="devvit-internal",a=(e,t)=>{let r={...e,realtimeEffect:e.realtime,id:t,scope:u.CLIENT,type:F};(e.showToast||e.navigateToUrl)&&(r.effect=e),parent.postMessage(r,"*")},m=e=>new Promise(t=>{let r={...e,realtimeEffect:e.realtime,scope:u.CLIENT,type:F};(e.showForm||e.type===E.EFFECT_CAN_RUN_AS_USER)&&(r.effect=e);let o=crypto.randomUUID();r.id=o;let s=i=>{i.data?.type==="devvit-message"&&i.data?.data?.id===o&&(t(i.data.data),removeEventListener("message",s))};addEventListener("message",s),parent.postMessage(r,"*")});var A="x-devvit-user-progress";var h=Symbol.for("@devvit/client/user-progress");function P(){let e=globalThis.fetch;if(e[h])return;let t=async(r,o)=>{let s=await e(r,o),i=new URL(r instanceof Request?r.url:r,location.href);if(i.origin===location.origin&&i.pathname.startsWith("/api/")&&!s.redirected)try{q(s)}catch(f){console.error("Failed to deliver user progress notification",f)}return s};t[h]=!0,globalThis.fetch=t}function q(e){let t=e.headers.get(A),r=t==="STARTED"?d.STARTED:t==="COMPLETED"?d.COMPLETED:void 0;r!==void 0&&a({type:E.EFFECT_WEB_VIEW,userProgress:{state:r}})}var p;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.INLINE_MODE=1]="INLINE_MODE",e[e.IMMERSIVE_MODE=2]="IMMERSIVE_MODE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(p||(p={}));function T(e){let t=J(e.target,e.isTrusted);a({type:E.EFFECT_TELEMETRY,telemetry:{event:t.event,click:t},analytics:t})}function J(e,t){let{definition:r,elemTrackId:o}=Q(e,t);return{event:"click",definition:r,elemTrackId:o}}function Q(e,t){let r=z(e);if(!r)return{definition:"default",elemTrackId:void 0};let o="default";t&&globalThis.window.getComputedStyle(r)?.getPropertyValue("cursor")==="pointer"&&(o="strict");let s,i=r;for(;i;){if(s===void 0){let f=i.getAttribute("data-track-id");f?s=f:i.id&&(s=i.id)}if(t&&o==="default"&&ee(i)&&(o="strict"),s!==void 0&&(!t||o==="strict"))break;i=i.parentElement}return{definition:o,elemTrackId:s}}function z(e){if(!e||typeof e!="object"||!("nodeType"in e))return;let t=e;return t.nodeType===1?t:t.parentElement??void 0}function ee(e){return["A","BUTTON","CANVAS","INPUT","SELECT","TEXTAREA","LABEL"].includes(e.tagName)||["true","plaintext-only"].includes(e.getAttribute("contenteditable")??"")}var L="/api/";var g="$devvit_icon.png";var M="token";var I=new Set;function te(){return oe(devvit.webViewMode)}function be(e,t,r){T(e),w(p.IMMERSIVE_MODE,e,t,r?.title)}function We(e){if(devvit.webViewMode===p.INLINE_MODE)throw Error("web view is already inlined");T(e),w(p.INLINE_MODE,e,void 0)}function Ve(e){I.add(e)}function je(e){I.delete(e)}function w(e,t,r,o=void 0){if(!t.isTrusted||t.type!=="click")throw console.error("Expanded mode effect ignored due to untrusted event"),new Error("Untrusted event");if(r!=null&&!devvit.entrypoints[r])throw Error(`no entrypoint named "${r}"; all entrypoints must appear in \`devvit.json\` \`post.entrypoints\``);let s;if(r){let i=new URL(devvit.entrypoints[r]);i.pathname.startsWith(L)&&i.searchParams.set(M,devvit.token),s=`${i}`}a({type:E.EFFECT_WEB_VIEW,immersiveMode:{entryUrl:s,immersiveMode:e,title:o}})}function G(){addEventListener("message",re)}function re(e){if(e.data?.type!=="devvit-message"||!e.data?.data?.immersiveModeEvent)return;let t=te();for(let r of I)r(t)}function oe(e){switch(e){case p.IMMERSIVE_MODE:return"expanded";case p.INLINE_MODE:case p.UNRECOGNIZED:case p.UNSPECIFIED:case void 0:return"inline";default:throw Error(`${e} not a WebViewImmersiveMode`)}}var Ye=globalThis.devvit?.context;function $e(){return devvit.adPayload}function Xe(e){if(!Object.hasOwn(devvit.experiments,e)){console.error(`exposeExperiment effect ignored because experiment "${e}" is missing from devvit.json`);return}a({exposeExperiment:{name:e},type:17})}function qe(e){return devvit.experiments[e]}function et(){a({type:E.EFFECT_LOGIN_PROMPT,loginPrompt:{}})}function B(e){if(typeof e=="string")return e;let{url:t,permalink:r}=e;if(r===void 0)return t;try{if(new URL(t).pathname!==r)return new URL(r,"https://www.reddit.com").toString()}catch{return new URL(r,"https://www.reddit.com").toString()}return t}var ne="devvit.v1.min.js";var ot=`https://webview.devvit.net/scripts/${ne}`,l=e=>`https://reddit.com/r/_/comments/${e.replace("t3_","")}`;function Et(e){let t=B(e),r;try{r=new URL(t).toString()}catch{throw new TypeError(`Invalid URL: ${t}`)}y(r)}function pt(e,t){let r=new URL(l(e)),o={};t?.title!==void 0&&(o.title=t.title),t?.presentation==="expanded"&&(o.presentation=1),(o.title!==void 0||o.presentation!==void 0)&&r.searchParams.set("devvitshare",JSON.stringify(o)),y(r.toString())}function y(e){a({navigateToUrl:{url:e},type:5})}var c;(function(e){e[e.CONSENT_STATUS_UNKNOWN=0]="CONSENT_STATUS_UNKNOWN",e[e.REVOKED=1]="REVOKED",e[e.GRANTED=2]="GRANTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(c||(c={}));var b;(function(e){e[e.SCOPE_UNKNOWN=0]="SCOPE_UNKNOWN",e[e.SUBMIT_POST=1]="SUBMIT_POST",e[e.SUBMIT_COMMENT=2]="SUBMIT_COMMENT",e[e.SUBSCRIBE_TO_SUBREDDIT=3]="SUBSCRIBE_TO_SUBREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(b||(b={}));var N;(function(e){e[e.CLIENT_UNSPECIFIED=0]="CLIENT_UNSPECIFIED",e[e.ANDROID=1]="ANDROID",e[e.IOS=2]="IOS",e[e.SHREDDIT=3]="SHREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N||(N={}));var W;(function(e){e[e.HEIGHT_UNSPECIFIED=0]="HEIGHT_UNSPECIFIED",e[e.REGULAR=1]="REGULAR",e[e.TALL=2]="TALL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(W||(W={}));var V;(function(e){e[e.PRESENTATION_UNSPECIFIED=0]="PRESENTATION_UNSPECIFIED",e[e.EXPANDED=1]="EXPANDED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(V||(V={}));var j;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(j||(j={}));var _=class extends Error{};_.prototype.name="InvalidTokenError";function k(e){globalThis.devvit.appPermissionState&&(globalThis.devvit.appPermissionState.consentStatus=e)}var kt=async e=>{if(!e.isTrusted)throw console.error("CanRunAsUser effect ignored due to untrusted event"),new Error("Untrusted event");let t=devvit.appPermissionState;if(!t)return!0;if(t.requestedScopes.length===0)return!1;switch(t.consentStatus){case c.REVOKED:return!1;case c.GRANTED:if(t.requestedScopes.every(o=>t.grantedScopes.includes(o)))return!0;break;case c.CONSENT_STATUS_UNKNOWN:case c.UNRECOGNIZED:break;default:{t.consentStatus;break}}let r=await m({canRunAsUser:{postId:devvit.context.postId,appSlug:devvit.context.appName,subredditId:devvit.context.subredditId},type:11});return r?.consentStatus&&k(r.consentStatus.consentStatus),r?.consentStatus?.consentStatus===c.GRANTED};async function Jt(e){if(e.data&&e.data.length>1024)throw Error(`data must be <= ${1024} characters but was ${e.data.length} characters`);let t=e.post??devvit.context.postId;if(!t)throw Error("A post must be specified when sharing outside a post");let r=`${new URL(g,location.origin)}`,o;try{o=await fetch(r,{method:"HEAD"})}catch{}let s=l(t);a({type:E.EFFECT_WEB_VIEW,share:{appIconUri:o?.ok?r:void 0,userData:e.data,text:e.text,title:e.title,url:s}})}function Qt(){return devvit.share?.userData}function R(e,t=new Set){for(let r of e){if(r.type==="group"){R(r.fields,t);continue}let o=r.name;if(t.has(o))throw new Error(`Duplicate field name: ${o}`);t.add(o)}ie(e)}function ie(e){for(let t of e)if(t.type==="string"&&t.isSecret&&t.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${t.name}"`}var n;(function(e){e[e.STRING=0]="STRING",e[e.PARAGRAPH=1]="PARAGRAPH",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.LIST=4]="LIST",e[e.SELECTION=5]="SELECTION",e[e.GROUP=6]="GROUP",e[e.IMAGE=7]="IMAGE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(n||(n={}));var D;(function(e){e[e.UNKNOWN_EVENT_SOURCE=0]="UNKNOWN_EVENT_SOURCE",e[e.USER=1]="USER",e[e.ADMIN=2]="ADMIN",e[e.MODERATOR=3]="MODERATOR",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(D||(D={}));var v;(function(e){e[e.UNSPECIFIED_DELETION_REASON=0]="UNSPECIFIED_DELETION_REASON",e[e.SPAM=1]="SPAM",e[e.LEGAL=2]="LEGAL",e[e.OTHER=3]="OTHER",e[e.UNKNOWN=4]="UNKNOWN",e[e.EXPLICIT_CONTENT=5]="EXPLICIT_CONTENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(v||(v={}));var O;(function(e){e[e.OFF=0]="OFF",e[e.LENIENT=1]="LENIENT",e[e.MEDIUM=2]="MEDIUM",e[e.STRICT=3]="STRICT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(O||(O={}));var U;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.ADMIN=1]="ADMIN",e[e.GOLD=2]="GOLD",e[e.GOLD_AUTO=3]="GOLD_AUTO",e[e.YES=4]="YES",e[e.SPECIAL=5]="SPECIAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(U||(U={}));var x;(function(e){e[e.ARCHIVED=0]="ARCHIVED",e[e.EMPLOYEES_ONLY=1]="EMPLOYEES_ONLY",e[e.GOLD_ONLY=2]="GOLD_ONLY",e[e.GOLD_RESTRICTED=3]="GOLD_RESTRICTED",e[e.PRIVATE=4]="PRIVATE",e[e.PUBLIC=5]="PUBLIC",e[e.RESTRICTED=6]="RESTRICTED",e[e.USER=7]="USER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(x||(x={}));var S;(function(e){e[e.UNKNOWN_SUBREDDIT_RATING=0]="UNKNOWN_SUBREDDIT_RATING",e[e.E=1]="E",e[e.M1=2]="M1",e[e.M2=3]="M2",e[e.D=4]="D",e[e.V=5]="V",e[e.X=6]="X",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(S||(S={}));var Z;(function(e){e[e.SUBREDDIT_TYPE_UNSPECIFIED=0]="SUBREDDIT_TYPE_UNSPECIFIED",e[e.SUBREDDIT_TYPE_UNKNOWN=1]="SUBREDDIT_TYPE_UNKNOWN",e[e.SUBREDDIT_TYPE_ARCHIVED=2]="SUBREDDIT_TYPE_ARCHIVED",e[e.SUBREDDIT_TYPE_EMPLOYEES_ONLY=3]="SUBREDDIT_TYPE_EMPLOYEES_ONLY",e[e.SUBREDDIT_TYPE_GOLD_ONLY=4]="SUBREDDIT_TYPE_GOLD_ONLY",e[e.SUBREDDIT_TYPE_GOLD_RESTRICTED=5]="SUBREDDIT_TYPE_GOLD_RESTRICTED",e[e.SUBREDDIT_TYPE_PRIVATE=6]="SUBREDDIT_TYPE_PRIVATE",e[e.SUBREDDIT_TYPE_PUBLIC=7]="SUBREDDIT_TYPE_PUBLIC",e[e.SUBREDDIT_TYPE_RESTRICTED=8]="SUBREDDIT_TYPE_RESTRICTED",e[e.SUBREDDIT_TYPE_USER=9]="SUBREDDIT_TYPE_USER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Z||(Z={}));var $;(function(e){e[e.SUBREDDIT_RATING_UNSPECIFIED=0]="SUBREDDIT_RATING_UNSPECIFIED",e[e.SUBREDDIT_RATING_UNKNOWN=1]="SUBREDDIT_RATING_UNKNOWN",e[e.SUBREDDIT_RATING_E=2]="SUBREDDIT_RATING_E",e[e.SUBREDDIT_RATING_M1=3]="SUBREDDIT_RATING_M1",e[e.SUBREDDIT_RATING_M2=4]="SUBREDDIT_RATING_M2",e[e.SUBREDDIT_RATING_D=5]="SUBREDDIT_RATING_D",e[e.SUBREDDIT_RATING_V=6]="SUBREDDIT_RATING_V",e[e.SUBREDDIT_RATING_X=7]="SUBREDDIT_RATING_X",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($||($={}));var H;(function(e){e.Installation="installation",e.App="app"})(H||(H={}));function se(e){switch(e.fieldType){case n.STRING:return e.stringValue;case n.IMAGE:return e.stringValue;case n.PARAGRAPH:return e.stringValue;case n.NUMBER:return e.numberValue;case n.BOOLEAN:return e.boolValue;case n.SELECTION:return e.selectionValue?.values??[];default:return}}function K(e){return Object.keys(e).reduce((t,r)=>{let o=se(e[r]);return o!==void 0&&(t[r]=o),t},{})}function C(e){return e.map(t=>{switch(t.type){case"string":return ae(t);case"image":return Ee(t);case"paragraph":return pe(t);case"number":return ce(t);case"select":return fe(t);case"boolean":return de(t);case"group":return ue(t);default:throw new Error("Unknown field type.")}})}function ae(e){return{defaultValue:{fieldType:n.STRING,stringValue:e.defaultValue},disabled:e.disabled,fieldConfig:{stringConfig:{placeholder:e.placeholder}},fieldId:e.name,fieldType:n.STRING,helpText:e.helpText,label:e.label,required:e.required,isSecret:e.isSecret}}function Ee(e){return{disabled:e.disabled,fieldId:e.name,fieldType:n.IMAGE,helpText:e.helpText,label:e.label,required:e.required}}function pe(e){return{defaultValue:{fieldType:n.PARAGRAPH,stringValue:e.defaultValue},disabled:e.disabled,fieldConfig:{paragraphConfig:{lineHeight:e.lineHeight,placeholder:e.placeholder}},fieldId:e.name,fieldType:n.PARAGRAPH,helpText:e.helpText,label:e.label,required:e.required}}function ce(e){return{defaultValue:{fieldType:n.NUMBER,numberValue:e.defaultValue},disabled:e.disabled,fieldConfig:{numberConfig:{}},fieldId:e.name,fieldType:n.NUMBER,helpText:e.helpText,label:e.label,required:e.required}}function fe(e){return{defaultValue:{fieldType:n.SELECTION,selectionValue:{values:e.defaultValue??[]}},disabled:e.disabled,fieldConfig:{selectionConfig:{choices:e.options,multiSelect:e.multiSelect}},fieldId:e.name,fieldType:n.SELECTION,helpText:e.helpText,label:e.label,required:e.required}}function de(e){return{defaultValue:{fieldType:n.BOOLEAN,boolValue:e.defaultValue},disabled:e.disabled,fieldId:e.name,fieldType:n.BOOLEAN,helpText:e.helpText,label:e.label}}function ue(e){return{fieldId:"",fieldType:n.GROUP,fieldConfig:{groupConfig:{fields:C(e.fields)}},label:e.label,helpText:e.helpText}}var X=1,me=()=>(X++,`form.${X}`),hr=async e=>{let t={fields:[],id:me(),title:e.title,acceptLabel:e.acceptLabel,cancelLabel:e.cancelLabel,shortDescription:e.description};R(e.fields),t.fields=C(e.fields);let r=await m({showForm:{form:t},type:3});return!r||!r.formSubmitted?{action:"CANCELED"}:{action:"SUBMITTED",values:K(r.formSubmitted.results)}};function gr(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?1:0}:t={text:e},a({showToast:{toast:t},type:4})}G();P();export{Ve as addWebViewModeListener,kt as canRunAsUser,Ye as context,We as exitExpandedMode,qe as experimentVariant,Xe as exposeExperiment,$e as getAdPayload,Qt as getShareData,te as getWebViewMode,G as initWebViewMode,Et as navigateTo,pt as navigateToPost,re as onWebViewMessage,je as removeWebViewModeListener,be as requestExpandedMode,hr as showForm,et as showLoginPrompt,Jt as showShareSheet,gr as showToast};
|
|
2
|
-
//# sourceMappingURL=client.min.js.map
|
package/client.min.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../protos/dist/json/devvit/ui/effects/v1alpha/effect.js", "../../protos/dist/json/devvit/ui/effects/web_view/v1alpha/user_progress.js", "../../protos/dist/json/devvit/ui/effects/web_view/v1alpha/post_message.js", "../../shared-types/dist/client/emit-effect.js", "../../shared-types/dist/user-progress.js", "../src/effects/user-progress.ts", "../../protos/dist/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js", "../../shared-types/dist/client/telemetry.js", "../../shared-types/dist/constants.js", "../../shared-types/dist/webbit.js", "../src/effects/web-view-mode.ts", "../src/clientContext.ts", "../src/effects/ad-payload.ts", "../src/effects/experiments.ts", "../src/effects/login-prompt.ts", "../../shared-types/dist/thing-navigation.js", "../../shared-types/dist/web-view-scripts-constants.js", "../src/effects/navigate-to.ts", "../../protos/dist/json/reddit/devvit/app_permission/v1/app_permission.js", "../../protos/dist/json/devvit/ui/effects/web_view/v1alpha/context.js", "../../shared-types/dist/tid.js", "../../../node_modules/jwt-decode/build/esm/index.js", "../../web-view-scripts/dist/devvit-global.js", "../src/effects/run-as-user.ts", "../src/effects/share.ts", "../src/effects/helpers/assert-valid-form-fields.ts", "../../protos/dist/json/devvit/ui/form_builder/v1alpha/type.js", "../../protos/dist/json/devvit/events/v1alpha/events.js", "../../protos/dist/json/devvit/reddit/v2alpha/postv2.js", "../../protos/dist/json/devvit/reddit/v2alpha/subredditv2.js", "../../shared-types/dist/shared/form.js", "../src/effects/helpers/get-form-values.ts", "../src/effects/helpers/transform-form.ts", "../src/effects/show-form.ts", "../src/effects/show-toast.ts", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * #effect.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var EffectType;\n(function (EffectType) {\n /**\n * EFFECT_REALTIME_SUB - Notify client to synchronize its realtime subscriptions\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_REALTIME_SUB\"] = 0] = \"EFFECT_REALTIME_SUB\";\n /**\n * EFFECT_RERENDER_UI - Trigger a re-render for apps that have visible UI\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_RERENDER_UI\"] = 1] = \"EFFECT_RERENDER_UI\";\n /**\n * EFFECT_RELOAD_PART - Notify the client that parts of a subreddit, post, or comment should be reloaded\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_RELOAD_PART\"] = 2] = \"EFFECT_RELOAD_PART\";\n /** EFFECT_SHOW_FORM - Display a user input form */\n EffectType[EffectType[\"EFFECT_SHOW_FORM\"] = 3] = \"EFFECT_SHOW_FORM\";\n /** EFFECT_SHOW_TOAST - Display a transient toast message */\n EffectType[EffectType[\"EFFECT_SHOW_TOAST\"] = 4] = \"EFFECT_SHOW_TOAST\";\n /** EFFECT_NAVIGATE_TO_URL - Notify the client to navigate to a URL */\n EffectType[EffectType[\"EFFECT_NAVIGATE_TO_URL\"] = 5] = \"EFFECT_NAVIGATE_TO_URL\";\n /**\n * EFFECT_SET_INTERVALS - This updates the list of active timers.\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_SET_INTERVALS\"] = 7] = \"EFFECT_SET_INTERVALS\";\n /**\n * EFFECT_CREATE_ORDER - This starts a purchase flow\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_CREATE_ORDER\"] = 8] = \"EFFECT_CREATE_ORDER\";\n /**\n * EFFECT_WEB_VIEW - Control and communicate with WebViews\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_WEB_VIEW\"] = 9] = \"EFFECT_WEB_VIEW\";\n /**\n * EFFECT_CAN_RUN_AS_USER - Check if the app can execute some actions as the user\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_CAN_RUN_AS_USER\"] = 11] = \"EFFECT_CAN_RUN_AS_USER\";\n /**\n * EFFECT_TELEMETRY - Statistical data event for analytics.\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_TELEMETRY\"] = 12] = \"EFFECT_TELEMETRY\";\n /**\n * EFFECT_UPDATE_REQUEST_CONTEXT - Request an updated signed request context\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_UPDATE_REQUEST_CONTEXT\"] = 13] = \"EFFECT_UPDATE_REQUEST_CONTEXT\";\n /**\n * EFFECT_SCREENSHOT_RESPONSE - Send the screenshot response from web view to the client\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_SCREENSHOT_RESPONSE\"] = 14] = \"EFFECT_SCREENSHOT_RESPONSE\";\n /**\n * EFFECT_LOGIN_PROMPT - Request a login/signup prompt\n *\n * @deprecated\n */\n EffectType[EffectType[\"EFFECT_LOGIN_PROMPT\"] = 15] = \"EFFECT_LOGIN_PROMPT\";\n /**\n * EFFECT_PROMOTED_TELEMETRY - Emit an app-defined promoted telemetry event from a web view, such as\n * custom_event_1 for a promoted app interaction.\n */\n EffectType[EffectType[\"EFFECT_PROMOTED_TELEMETRY\"] = 16] = \"EFFECT_PROMOTED_TELEMETRY\";\n /** EFFECT_EXPOSE_EXPERIMENT - Manually expose an experiment to the user. */\n EffectType[EffectType[\"EFFECT_EXPOSE_EXPERIMENT\"] = 17] = \"EFFECT_EXPOSE_EXPERIMENT\";\n EffectType[EffectType[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(EffectType || (EffectType = {}));\n", "/**\n * #user_progress.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var WebViewUserProgressEffect_State;\n(function (WebViewUserProgressEffect_State) {\n /** UNSPECIFIED - No progress state was provided. Receivers ignore this value. */\n WebViewUserProgressEffect_State[WebViewUserProgressEffect_State[\"UNSPECIFIED\"] = 0] = \"UNSPECIFIED\";\n /** STARTED - Any accepted progress call, including progress({ progress: 0 }). */\n WebViewUserProgressEffect_State[WebViewUserProgressEffect_State[\"STARTED\"] = 1] = \"STARTED\";\n /** COMPLETED - Accepted endJourney({ complete: true }), even without prior progress. */\n WebViewUserProgressEffect_State[WebViewUserProgressEffect_State[\"COMPLETED\"] = 2] = \"COMPLETED\";\n WebViewUserProgressEffect_State[WebViewUserProgressEffect_State[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(WebViewUserProgressEffect_State || (WebViewUserProgressEffect_State = {}));\n", "/**\n * #post_message.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\n/**\n * Blocks only.\n *\n * @deprecated\n */\nexport var WebViewInternalMessageScope;\n(function (WebViewInternalMessageScope) {\n /** CLIENT - Message is intended for the client only */\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"CLIENT\"] = 0] = \"CLIENT\";\n WebViewInternalMessageScope[WebViewInternalMessageScope[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(WebViewInternalMessageScope || (WebViewInternalMessageScope = {}));\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { WebViewInternalMessageScope, } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js';\n/** `WebViewInternalMessage.type`. */\nexport const webViewInternalMessageType = 'devvit-internal';\n/**\n * Emits an effect to the parent window returns immediately.\n *\n * @param effect - The effect to be emitted to the parent window\n * @param requestId - Optional request id used to correlate request/response messages\n * @description\n * This function handles effects that don't require a response, and can also\n * set a request id when replying to client-originated requests.\n */\nexport const emitEffect = (effect, requestId) => {\n const message = {\n ...effect,\n realtimeEffect: effect.realtime, // to-do: remove deprecated field.\n id: requestId,\n scope: WebViewInternalMessageScope.CLIENT,\n type: webViewInternalMessageType,\n };\n // For temporary backward compatibility, we set both `message.effect_type` above, and `effect` below\n // Once mobile clients are updated to consume the strongly typed properties above, we can remove this block\n // *Do not* add new effects here, use the strongly typed properties above\n if (effect.showToast || effect.navigateToUrl) {\n message.effect = effect;\n }\n parent.postMessage(message, '*');\n};\n/**\n * Emits an effect to the parent window and returns a promise that resolves with the response message.\n *\n * @param effect - The effect to be emitted to the parent window\n * @returns A promise that resolves with the response message\n *\n * @description\n * This function handles effects that require a response.\n */\nexport const emitEffectWithResponse = (effect) => {\n return new Promise((resolve) => {\n const message = {\n ...effect,\n realtimeEffect: effect.realtime, // to-do: remove deprecated field.\n scope: WebViewInternalMessageScope.CLIENT,\n type: webViewInternalMessageType,\n };\n // For temporary backward compatibility, we set both `message.effect_type` above, and `effect` below\n // Once mobile clients are updated to consume the strongly typed properties above, we can remove this block\n // *Do not* add new effects here, use the strongly typed properties above\n if (effect.showForm || effect.type === EffectType.EFFECT_CAN_RUN_AS_USER) {\n message.effect = effect;\n }\n const id = crypto.randomUUID();\n message.id = id;\n const handleEffect = (event) => {\n if (event.data?.type === 'devvit-message' && event.data?.data?.id === id) {\n resolve(event.data.data);\n removeEventListener('message', handleEffect);\n }\n };\n addEventListener('message', handleEffect);\n // Post message to the parent window, handled by client web view component\n parent.postMessage(message, '*');\n });\n};\n", "/** Carries accepted progress in HTTP headers and identifies its request-context callback. */\nexport const userProgressStateHeader = 'x-devvit-user-progress';\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { WebViewUserProgressEffect_State } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/user_progress.js';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\nimport { userProgressStateHeader } from '@devvit/shared-types/user-progress.js';\n\n// Multiple bundled copies of the client SDK must not emit the same notification twice.\nconst userProgressFetch = Symbol.for('@devvit/client/user-progress');\ntype ProgressFetch = typeof globalThis.fetch & { [userProgressFetch]?: true };\n\n/** Receives server SDK progress when the browser client SDK is imported. @internal */\nexport function initUserProgress(): void {\n const fetch = globalThis.fetch as ProgressFetch;\n if (fetch[userProgressFetch]) return;\n\n const wrappedFetch: ProgressFetch = async (input, init) => {\n const response = await fetch(input, init);\n const url = new URL(input instanceof Request ? input.url : input, location.href);\n if (\n url.origin === location.origin &&\n url.pathname.startsWith('/api/') &&\n !response.redirected\n ) {\n // Notification delivery must not turn a successful app request into a failure.\n try {\n notifyUserProgress(response);\n } catch (error) {\n console.error('Failed to deliver user progress notification', error);\n }\n }\n return response;\n };\n wrappedFetch[userProgressFetch] = true;\n globalThis.fetch = wrappedFetch;\n}\n\nfunction notifyUserProgress(response: Response): void {\n const progress = response.headers.get(userProgressStateHeader);\n const state =\n progress === 'STARTED'\n ? WebViewUserProgressEffect_State.STARTED\n : progress === 'COMPLETED'\n ? WebViewUserProgressEffect_State.COMPLETED\n : undefined;\n if (state !== undefined) {\n emitEffect({ type: EffectType.EFFECT_WEB_VIEW, userProgress: { state } });\n }\n}\n", "/**\n * #immersive_mode.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\n/** How a Devvit app is presented. */\nexport var WebViewImmersiveMode;\n(function (WebViewImmersiveMode) {\n WebViewImmersiveMode[WebViewImmersiveMode[\"UNSPECIFIED\"] = 0] = \"UNSPECIFIED\";\n /**\n * INLINE_MODE - Conventional post presentation. May appear adjacent other posts in a feed\n * or with comments.\n */\n WebViewImmersiveMode[WebViewImmersiveMode[\"INLINE_MODE\"] = 1] = \"INLINE_MODE\";\n /**\n * IMMERSIVE_MODE - Large modal expanded presentation. Appears popped out from the rest of the\n * Reddit experience which is disabled.\n */\n WebViewImmersiveMode[WebViewImmersiveMode[\"IMMERSIVE_MODE\"] = 2] = \"IMMERSIVE_MODE\";\n WebViewImmersiveMode[WebViewImmersiveMode[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(WebViewImmersiveMode || (WebViewImmersiveMode = {}));\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { emitEffect } from './emit-effect.js';\nexport function emitTelemetryClickEffect(event) {\n const click = TelemetryClickPayload(event.target, event.isTrusted);\n void emitEffect({\n type: EffectType.EFFECT_TELEMETRY,\n telemetry: { event: click.event, click },\n // to-do: remove once all clients support `telemetry`. Deprecated on\n // 2025-11-24.\n analytics: click,\n });\n}\n/**\n * This function is expensive. It does heavy DOM work.\n * @internal\n */\nexport function TelemetryClickPayload(eventTarget, isTrusted) {\n const { definition, elemTrackId } = analyzeClickTarget(eventTarget, isTrusted);\n return { event: 'click', definition, elemTrackId };\n}\nfunction analyzeClickTarget(eventTarget, isTrusted) {\n const targetElement = getTargetElement(eventTarget);\n if (!targetElement) {\n return { definition: 'default', elemTrackId: undefined };\n }\n let definition = 'default';\n if (isTrusted) {\n const computedStyles = globalThis.window.getComputedStyle(targetElement);\n if (computedStyles?.getPropertyValue('cursor') === 'pointer') {\n definition = 'strict';\n }\n }\n let elemTrackId;\n let currentElement = targetElement;\n while (currentElement) {\n if (elemTrackId === undefined) {\n const dataTrackId = currentElement.getAttribute('data-track-id');\n if (dataTrackId) {\n elemTrackId = dataTrackId;\n }\n else if (currentElement.id) {\n elemTrackId = currentElement.id;\n }\n }\n if (isTrusted && definition === 'default' && elementIsStrictClickTarget(currentElement)) {\n definition = 'strict';\n }\n if (elemTrackId !== undefined && (!isTrusted || definition === 'strict')) {\n break;\n }\n currentElement = currentElement.parentElement;\n }\n return { definition, elemTrackId };\n}\nfunction getTargetElement(eventTarget) {\n if (!eventTarget || typeof eventTarget !== 'object' || !('nodeType' in eventTarget)) {\n return undefined;\n }\n const node = eventTarget;\n return node.nodeType === 1 ? node : (node.parentElement ?? undefined);\n}\nfunction elementIsStrictClickTarget(element) {\n const STRICT_CLICK_TAGNAMES = ['A', 'BUTTON', 'CANVAS', 'INPUT', 'SELECT', 'TEXTAREA', 'LABEL'];\n return (STRICT_CLICK_TAGNAMES.includes(element.tagName) ||\n ['true', 'plaintext-only'].includes(element.getAttribute('contenteditable') ?? ''));\n}\n", "// to-do: move to service + CLI package.\n// Do not use in @devvit/public-api. Protos not in externalized @devvit/protos\n// barrel.\nexport const ACTOR_SRC_DIR = 'src';\nexport const ACTOR_SRC_PRIMARY_NAME = 'main';\n/** payments stuff. */\nexport const PRODUCTS_JSON_FILE = 'products.json';\n/**\n * The hashing algorithm used - pass this to `createHash`\n */\nexport const ASSET_HASHING_ALGO = 'sha256';\n/**\n * The max number of subscribers allowed in a test subreddit (ie where a user can install an uploaded, private app\n * Determines if a PRIVATE (unpublished) version of an app can be installed or playtested\n *\n * TODO: turn this off before we go live - see DX-1336\n * */\nexport const MAX_ALLOWED_SUBSCRIBER_COUNT = 200;\n/**\n * How many assets to upload at once. Sending too many at once can cause the\n * server to become overwhelmed and start erroring clients out.\n * @type {number}\n */\nexport const ASSET_UPLOAD_BATCH_SIZE = 10;\nexport const REDDIT_OAUTH_COPY_PASTE_CLIENT_ID = 'TWTsqXa53CexlrYGBWaesQ';\n/** All server endpoints must start with this prefix. */\nexport const apiPathPrefix = '/api/';\n/** All unexposed APIs must start with this prefix. */\nexport const internalPathPrefix = '/internal/';\n/** When an app's icon is present in the media assets list, it'll be with this special name. */\nexport const ICON_FILE_PATH = '$devvit_icon.png'; // Uses special characters intentionally to avoid conflicts with real asset paths\nexport const REDDIT_DISCORD_INVITE_URL = 'https://discord.gg/Cd43ExtEFS';\nexport const REDDIT_SUBREDDIT_URL = 'https://www.reddit.com/r/devvit';\n", "export const noWebbitToken = `0.0.0`;\n/**\n * `RequestContext` token query parameter name on `DevvitPost.entrypointUrl`.\n */\nexport const tokenParam = 'token';\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { WebViewImmersiveMode } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/immersive_mode.js';\nimport type { WebViewMessageEvent_MessageData } from '@devvit/protos/json/devvit/ui/events/v1alpha/web_view.js';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\nimport { emitTelemetryClickEffect } from '@devvit/shared-types/client/telemetry.js';\nimport { apiPathPrefix } from '@devvit/shared-types/constants.js';\nimport { tokenParam } from '@devvit/shared-types/webbit.js';\n\nimport type { WebViewOptions } from './web-view-options.js';\n\n/**\n * The presentation mode of the web view.\n * 'inline' The web view is displayed inline within a feed or post detail page\n * 'expanded' The web view is displayed in a larger modal presentation\n * @experimental\n */\nexport type WebViewMode = 'inline' | 'expanded';\n\n/**\n * A listener that is called when the web view mode changes.\n * @param mode The new mode, either 'inline' or 'expanded'.\n * @experimental\n */\nexport type WebViewModeListener = (mode: WebViewMode) => void;\n\nconst modeListeners: Set<WebViewModeListener> = new Set();\n\n/**\n * Represents the current web view mode state for the application.\n *\n * @experimental\n */\nexport function getWebViewMode(): WebViewMode {\n return webViewMode(devvit.webViewMode);\n}\n\n/**\n * Requests expanded mode for the web view.\n * This will display the web view in a larger modal presentation.\n *\n * @param event The gesture that triggered the request, must be a trusted event.\n * @param entry The destination URI name. Eg, `'splash'` or `'default'`. Entry\n * names are the `devvit.json` `post.entrypoints` keys. Passing the\n * same entrypoint as currently loaded may cause a reload.\n * @param options Optional settings for the expanded web view. Set `title`\n * @returns A promise that resolves request has been received.\n *\n * @experimental\n * @example\n * ```ts\n * button.addEventListener('click', async (event) => {\n * await requestExpandedMode(event);\n * });\n * ```\n */\nexport function requestExpandedMode(\n event: MouseEvent,\n entry: string,\n options?: WebViewOptions\n): void {\n // Count a click in case web view is destroyed when entry changes.\n emitTelemetryClickEffect(event);\n emitModeEffect(WebViewImmersiveMode.IMMERSIVE_MODE, event, entry, options?.title);\n}\n\n/**\n * Exits expanded mode for the web view.\n * This will display the web view in an inline presentation.\n *\n * @param event The event that triggered the request, must be a trusted event.\n * @returns A promise that resolves request has been received.\n * @throws When already inlined.\n *\n * @experimental\n * @example\n * ```ts\n * button.addEventListener('click', async (event) => {\n * await exitExpandedMode(event);\n * });\n * ```\n */\nexport function exitExpandedMode(event: MouseEvent): void {\n if (devvit.webViewMode === WebViewImmersiveMode.INLINE_MODE)\n throw Error('web view is already inlined');\n // Count a click in case web view is destroyed when entry changes.\n emitTelemetryClickEffect(event);\n emitModeEffect(WebViewImmersiveMode.INLINE_MODE, event, undefined);\n}\n\n/**\n * @deprecated This API is deprecated and will be removed in a future release.\n * use window.addEventListener(\"focus\", () => { }) to receive notifications\n * when the web view mode changes back to inline.\n * Adds a listener that is called when the web view mode changes. Initial mode\n * is not reported. Web views in the process of destruction may not receive a\n * mode change event.\n *\n * @param callback The callback to be called when the mode changes.\n * @experimental\n */\nexport function addWebViewModeListener(callback: WebViewModeListener): void {\n modeListeners.add(callback);\n}\n\n/**\n * @deprecated This API is deprecated and will be removed in a future release.\n * Removes a listener that was previously added with `addWebViewModeListener`.\n *\n * @param callback The callback to be removed.\n * @experimental\n */\nexport function removeWebViewModeListener(callback: WebViewModeListener): void {\n modeListeners.delete(callback);\n}\n\nfunction emitModeEffect(\n mode: WebViewImmersiveMode,\n event: Event,\n entry: string | undefined,\n title: string | undefined = undefined\n): void {\n if (!event.isTrusted || event.type !== 'click') {\n console.error('Expanded mode effect ignored due to untrusted event');\n throw new Error('Untrusted event');\n }\n\n if (entry != null && !devvit.entrypoints[entry])\n throw Error(\n `no entrypoint named \"${entry}\"; all entrypoints must appear in \\`devvit.json\\` \\`post.entrypoints\\``\n );\n\n let entryUrl;\n if (entry) {\n const url = new URL(devvit.entrypoints[entry]);\n if (url.pathname.startsWith(apiPathPrefix)) url.searchParams.set(tokenParam, devvit.token);\n entryUrl = `${url}`;\n }\n\n emitEffect({\n type: EffectType.EFFECT_WEB_VIEW,\n immersiveMode: { entryUrl, immersiveMode: mode, title },\n });\n}\n\n/** @internal */\nexport function initWebViewMode(): void {\n addEventListener('message', onWebViewMessage);\n}\n\n/** @internal */\nexport function onWebViewMessage(ev: MessageEvent<WebViewMessageEvent_MessageData>): void {\n if (ev.data?.type !== 'devvit-message') return;\n if (!ev.data?.data?.immersiveModeEvent) return;\n\n const mode = getWebViewMode();\n for (const listener of modeListeners) listener(mode);\n}\n\nfunction webViewMode(mode: WebViewImmersiveMode | undefined): WebViewMode {\n switch (mode) {\n case WebViewImmersiveMode.IMMERSIVE_MODE:\n return 'expanded';\n case WebViewImmersiveMode.INLINE_MODE:\n case WebViewImmersiveMode.UNRECOGNIZED:\n case WebViewImmersiveMode.UNSPECIFIED:\n case undefined:\n return 'inline';\n default:\n mode satisfies never;\n throw Error(`${mode} not a WebViewImmersiveMode`);\n }\n}\n", "import type { Context } from '@devvit/shared-types/client/client-context.js';\n\n// Use nullish coalescing for local development.\nexport const context: Context = globalThis.devvit?.context!;\n", "import type { AdPayload } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';\n\n/** Render-time ad data for promoted posts. Returns undefined for non-ad posts. */\nexport function getAdPayload(): AdPayload | undefined {\n return devvit.adPayload;\n}\n", "import type { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\n\n/**\n * Explicitly records exposure to an experiment present in `devvit.experiments`.\n * Logs an error and skips exposure if the experiment is absent.\n * @param experimentName The name of the experiment to expose.\n * @internal\n */\nexport function exposeExperiment(experimentName: string): void {\n if (!Object.hasOwn(devvit.experiments, experimentName)) {\n console.error(\n `exposeExperiment effect ignored because experiment \"${experimentName}\" is missing from devvit.json`\n );\n return;\n }\n\n void emitEffect({\n exposeExperiment: {\n name: experimentName,\n },\n type: 17 satisfies EffectType.EFFECT_EXPOSE_EXPERIMENT,\n });\n}\n\n/**\n * Returns the variant assigned to the experiment, or undefined if no variant is assigned.\n * @param experimentName\n * @internal\n */\nexport function experimentVariant(experimentName: string): string | undefined {\n return devvit.experiments[experimentName];\n}\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\n\n/**\n * Opens a Reddit login/signup prompt.\n */\nexport function showLoginPrompt(): void {\n void emitEffect({\n type: EffectType.EFFECT_LOGIN_PROMPT,\n loginPrompt: {},\n });\n}\n", "/**\n * Resolves a `navigateTo` argument (a raw URL string or a Reddit Thing-like\n * object) to the URL string the platform should navigate to.\n *\n * - Strings pass through unchanged.\n * - Things with only `url` (no `permalink`) pass through `url` unchanged. This\n * keeps backward compatibility with callers that produce `{ url: '...' }`\n * shapes (e.g. `UiResponse.navigateTo`).\n * - Things with both `url` and `permalink` get a heuristic:\n * - If `url`'s pathname equals `permalink`, navigate to `url`. This is the\n * case for Subreddit/Comment/User and self/text Posts, and using `url`\n * preserves the source origin (e.g. Snoodev mocks return snoodev-rooted\n * URLs and we want to keep the user on Snoodev).\n * - Otherwise, `url` is an asset URL such as `https://i.redd.it/foo.jpg`\n * (typical for link/image/video Posts). Fall back to `permalink` resolved\n * against `https://www.reddit.com` so we land on the comments page rather\n * than the asset.\n */\nexport function resolveNavigationInput(thingOrUrl) {\n if (typeof thingOrUrl === 'string') {\n return thingOrUrl;\n }\n const { url, permalink } = thingOrUrl;\n if (permalink === undefined) {\n return url;\n }\n try {\n if (new URL(url).pathname !== permalink) {\n return new URL(permalink, 'https://www.reddit.com').toString();\n }\n }\n catch {\n return new URL(permalink, 'https://www.reddit.com').toString();\n }\n return url;\n}\n", "/**\n * The `@devvit/client` version attribute name on the web view's document\n * script tag:\n *\n * <script src=\"https://webview.devvit.net/scripts/devvit.v1.min.js\" data-client-version=\"1.2.3\"></script>\n *\n * The value is the version of `@devvit/client` bundled with the app.\n * `@devvit/client` may have runtime dependencies on\n * `@devvit/web-view-scripts` (`devvit.v1.min.js`) which is not bundled. The\n * client version can be used to specialize behavior to match the static\n * expectations of the `@devvit/client` version.\n */\nexport const clientVersionDataAttribute = 'data-client-version';\n/** Bootstrap WebView script file name. */\nexport const devvitScriptFileName = 'devvit.v1.min.js';\n/** Screenshot capture WebView script file name. */\nexport const screenshotScriptFileName = 'screenshot.v1.min.js';\n/** CDN URL for the WebView bootstrap script. */\nexport const devvitScriptUrl = `https://webview.devvit.net/scripts/${devvitScriptFileName}`;\n/** Constructs a Reddit URL from a post ID. */\nexport const redditUrlFromPostId = (postId) => {\n const postWithoutPrefix = postId.replace('t3_', '');\n return `https://reddit.com/r/_/comments/${postWithoutPrefix}`;\n};\n", "import type { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport type {\n ShareParam,\n ShareParam_Presentation,\n} from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';\nimport type { T3 } from '@devvit/shared';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\nimport { resolveNavigationInput } from '@devvit/shared-types/thing-navigation.js';\nimport { redditUrlFromPostId } from '@devvit/shared-types/web-view-scripts-constants.js';\n\nimport type { WebViewOptions } from './web-view-options.js';\n\n/** Options for navigating to a URL or Reddit object. */\nexport type NavigateToOptions = WebViewOptions & {\n presentation?: 'expanded';\n};\n\n/**\n * Navigates to a URL, subreddit, post, comment, or user.\n *\n * @param url - The URL, subreddit, post, comment, or user to navigate to\n */\nexport function navigateTo(\n url: string | { readonly url: string; readonly permalink?: string }\n): void {\n const inputUrl = resolveNavigationInput(url);\n let normalizedUrl: string;\n try {\n normalizedUrl = new URL(inputUrl).toString();\n } catch {\n throw new TypeError(`Invalid URL: ${inputUrl}`);\n }\n emitNavigationEffect(normalizedUrl);\n}\n\n/**\n * Navigates to a post.\n *\n * @param postId - The ID of the post to navigate to.\n * @param options - Optional settings for the presentation of the custom post.\n */\nexport function navigateToPost(postId: T3, options?: NavigateToOptions): void {\n const normalizedUrl = new URL(redditUrlFromPostId(postId));\n\n const devvitShare: Partial<ShareParam> = {};\n\n if (options?.title !== undefined) {\n devvitShare.title = options.title;\n }\n\n if (options?.presentation === 'expanded') {\n devvitShare.presentation = 1 satisfies ShareParam_Presentation.EXPANDED;\n }\n\n if (devvitShare.title !== undefined || devvitShare.presentation !== undefined) {\n normalizedUrl.searchParams.set('devvitshare', JSON.stringify(devvitShare));\n }\n\n emitNavigationEffect(normalizedUrl.toString());\n}\n\nfunction emitNavigationEffect(url: string): void {\n void emitEffect({\n navigateToUrl: { url },\n type: 5 satisfies EffectType.EFFECT_NAVIGATE_TO_URL,\n });\n}\n", "/**\n * #app_permission.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\n/** This enum is used to represent the consent status of an app permission. */\nexport var ConsentStatus;\n(function (ConsentStatus) {\n /** CONSENT_STATUS_UNKNOWN - The consent status is unknown, which means it has not been set or is not applicable. */\n ConsentStatus[ConsentStatus[\"CONSENT_STATUS_UNKNOWN\"] = 0] = \"CONSENT_STATUS_UNKNOWN\";\n /** REVOKED - The user has explicitly denied consent for the app permissions. */\n ConsentStatus[ConsentStatus[\"REVOKED\"] = 1] = \"REVOKED\";\n /** GRANTED - The user has granted consent for the app permissions. */\n ConsentStatus[ConsentStatus[\"GRANTED\"] = 2] = \"GRANTED\";\n ConsentStatus[ConsentStatus[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(ConsentStatus || (ConsentStatus = {}));\n/** This enum is used to represent the scopes of permissions that can be granted to an app. */\nexport var Scope;\n(function (Scope) {\n /** SCOPE_UNKNOWN - The scope is unknown, which means it has not been set or is not applicable. */\n Scope[Scope[\"SCOPE_UNKNOWN\"] = 0] = \"SCOPE_UNKNOWN\";\n /** SUBMIT_POST - Allows the app to submit posts on behalf of the user. */\n Scope[Scope[\"SUBMIT_POST\"] = 1] = \"SUBMIT_POST\";\n /** SUBMIT_COMMENT - Allows the app to submit comments on behalf of the user. */\n Scope[Scope[\"SUBMIT_COMMENT\"] = 2] = \"SUBMIT_COMMENT\";\n /** SUBSCRIBE_TO_SUBREDDIT - Allows the app to subscribe the user to a subreddit. */\n Scope[Scope[\"SUBSCRIBE_TO_SUBREDDIT\"] = 3] = \"SUBSCRIBE_TO_SUBREDDIT\";\n Scope[Scope[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(Scope || (Scope = {}));\n", "/**\n * #context.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\n/** The user client hosting the web view. */\nexport var Client;\n(function (Client) {\n Client[Client[\"CLIENT_UNSPECIFIED\"] = 0] = \"CLIENT_UNSPECIFIED\";\n Client[Client[\"ANDROID\"] = 1] = \"ANDROID\";\n Client[Client[\"IOS\"] = 2] = \"IOS\";\n Client[Client[\"SHREDDIT\"] = 3] = \"SHREDDIT\";\n Client[Client[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(Client || (Client = {}));\n/**\n * Inline height of post.\n *\n * @deprecated\n */\nexport var Height;\n(function (Height) {\n Height[Height[\"HEIGHT_UNSPECIFIED\"] = 0] = \"HEIGHT_UNSPECIFIED\";\n Height[Height[\"REGULAR\"] = 1] = \"REGULAR\";\n Height[Height[\"TALL\"] = 2] = \"TALL\";\n Height[Height[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(Height || (Height = {}));\n/** Presentation mode requested when opening the app deep link. */\nexport var ShareParam_Presentation;\n(function (ShareParam_Presentation) {\n ShareParam_Presentation[ShareParam_Presentation[\"PRESENTATION_UNSPECIFIED\"] = 0] = \"PRESENTATION_UNSPECIFIED\";\n ShareParam_Presentation[ShareParam_Presentation[\"EXPANDED\"] = 1] = \"EXPANDED\";\n ShareParam_Presentation[ShareParam_Presentation[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(ShareParam_Presentation || (ShareParam_Presentation = {}));\n", "import { assert } from './assert.js';\n/**\n * - **C**omment (T1).\n * - **A**ccount (T2).\n * - **L**ink (T3).\n * - **M**essage (T4).\n * - **S**ubreddit (T5).\n * - **T**rophies (T6).\n */\nexport var T_PREFIX;\n(function (T_PREFIX) {\n T_PREFIX[\"COMMENT\"] = \"t1_\";\n T_PREFIX[\"ACCOUNT\"] = \"t2_\";\n T_PREFIX[\"LINK\"] = \"t3_\";\n T_PREFIX[\"MESSAGE\"] = \"t4_\";\n T_PREFIX[\"SUBREDDIT\"] = \"t5_\";\n T_PREFIX[\"AWARD\"] = \"t6_\";\n})(T_PREFIX || (T_PREFIX = {}));\n// type guards\nexport function isT1(id) {\n return !!id?.startsWith(T_PREFIX.COMMENT);\n}\nexport function isT2(id) {\n return !!id?.startsWith(T_PREFIX.ACCOUNT);\n}\nexport function isT3(id) {\n return !!id?.startsWith(T_PREFIX.LINK);\n}\nexport function isT4(id) {\n return !!id?.startsWith(T_PREFIX.MESSAGE);\n}\nexport function isT5(id) {\n return !!id?.startsWith(T_PREFIX.SUBREDDIT);\n}\nexport function isT6(id) {\n return !!id?.startsWith(T_PREFIX.AWARD);\n}\n// assertion functions\nexport function assertT1(id) {\n assert(isT1(id), `Expected comment id to start with ${T_PREFIX.COMMENT}, got ${id}`);\n}\nexport function assertT2(id) {\n assert(isT2(id), `Expected account id to start with ${T_PREFIX.ACCOUNT}, got ${id}`);\n}\nexport function assertT3(id) {\n assert(isT3(id), `Expected link id to start with ${T_PREFIX.LINK}, got ${id}`);\n}\nexport function assertT4(id) {\n assert(isT4(id), `Expected message id to start with ${T_PREFIX.MESSAGE}, got ${id}`);\n}\nexport function assertT5(id) {\n assert(isT5(id), `Expected subreddit id to start with ${T_PREFIX.SUBREDDIT}, got ${id}`);\n}\nexport function assertT6(id) {\n assert(isT6(id), `Expected award id to start with ${T_PREFIX.AWARD}, got ${id}`);\n}\n// factory functions\nexport function T1(id) {\n assertT1(id);\n return id;\n}\nexport function T2(id) {\n assertT2(id);\n return id;\n}\nexport function T3(id) {\n assertT3(id);\n return id;\n}\nexport function T4(id) {\n assertT4(id);\n return id;\n}\nexport function T5(id) {\n assertT5(id);\n return id;\n}\nexport function T6(id) {\n assertT6(id);\n return id;\n}\nexport function asTid(id) {\n if (isT1(id)) {\n return T1(id);\n }\n if (isT2(id)) {\n return T2(id);\n }\n if (isT3(id)) {\n return T3(id);\n }\n if (isT4(id)) {\n return T4(id);\n }\n if (isT5(id)) {\n return T5(id);\n }\n if (isT6(id)) {\n return T6(id);\n }\n throw new Error(`Expected thing id to start with ${Object.values(T_PREFIX).join(', ')} got ${id}}`);\n}\n", "export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n", "import { Client as ClientName, } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/context.js';\nimport { T2, T3, T5 } from '@devvit/shared-types/tid.js';\nimport {} from '@devvit/shared-types/webbit.js';\nimport { queryClientVersion } from './client.js';\nimport { decodeToken, requestTokenRefresh } from './token.js';\n/** @internal */\nexport const initDevvitGlobal = (document, location, window) => {\n const bridge = getBridgeContext(window.name, location.hash);\n const client = getClient(bridge);\n let appPermissionState = bridge?.appPermissionState;\n /**\n * Android versions older than this do not support runAsUser correctly, so we\n * suppress the permission state to allow the app to run as if the feature\n * wasn't present (failing open).\n *\n * Supported after 2026.05.x\n */\n if (client?.name === 'ANDROID') {\n if (client.version.yyyy < 2026 ||\n (client.version.yyyy === 2026 && client.version.release <= 5)) {\n appPermissionState = undefined;\n }\n }\n const reqCtx = decodeToken(bridge.signedRequestContext);\n let context;\n if (reqCtx)\n context = contextFromRequestContext(reqCtx, client, bridge.postData);\n else if (bridge.webViewContext)\n context = contextFromWebViewContext(bridge.webViewContext, client, bridge.postData);\n if (!context)\n throw Error('no context');\n // to-do: expose `devvitDebug`, `shredditVersion`.\n const clientData = bridge.webViewClientData;\n globalThis.devvit = {\n context,\n dependencies: {\n client: queryClientVersion(document),\n webViewScripts: globalThis.webViewScriptsVersion,\n },\n entrypoints: clientData?.appConfig?.entrypoints ?? {},\n experiments: clientData?.featureConfig?.experiments ?? {},\n share: bridge?.shareParam ? { userData: bridge?.shareParam.userData } : undefined,\n adPayload: bridge?.adPayload,\n appPermissionState,\n token: (bridge.signedRequestContext || bridge.webbitToken),\n webViewMode: bridge?.viewMode,\n startTime: bridge?.startTime ?? undefined,\n refreshToken: requestTokenRefresh,\n };\n};\nexport function updateConsentStatus(consentStatus) {\n if (!globalThis.devvit.appPermissionState)\n return;\n globalThis.devvit.appPermissionState.consentStatus = consentStatus;\n}\nexport function updateMode(mode) {\n devvit.webViewMode = mode;\n}\nexport function updateToken(token) {\n globalThis.devvit.token = token;\n}\n/** @internal */\nexport function contextFromRequestContext(reqCtx, client, postData) {\n if (!reqCtx.app)\n throw Error('no RequestContext.app');\n if (!reqCtx.post && !reqCtx.installation?.id)\n throw Error('no RequestContext.post or RequestContext.installation.id');\n if (!reqCtx.subreddit && reqCtx.post)\n throw Error('no RequestContext.subreddit');\n return {\n appName: reqCtx.app.name,\n appSlug: reqCtx.app.slug,\n appVersion: reqCtx.app.version,\n client,\n commentId: undefined,\n loid: reqCtx.user?.devvitLoid ?? reqCtx.user?.devvit_loid,\n postAuthorId: reqCtx.post ? T2(reqCtx.post.author) : undefined,\n postData: postData?.developerData,\n postId: reqCtx.post ? T3(reqCtx.post.id) : undefined,\n snoovatar: reqCtx.user?.snoovatar,\n subredditId: reqCtx.subreddit ? T5(reqCtx.subreddit.id) : undefined,\n subredditName: reqCtx.subreddit?.name,\n userId: reqCtx.user?.id ? T2(reqCtx.user.id) : undefined,\n username: reqCtx.user?.name,\n clientData: postData?.clientData,\n };\n}\n/** @internal */\nexport function contextFromWebViewContext(webViewCtx, client, postData) {\n return {\n appName: webViewCtx.appName,\n appSlug: webViewCtx.appName,\n appVersion: webViewCtx.appVersion,\n client,\n commentId: undefined,\n loid: undefined,\n postData: postData?.developerData,\n postAuthorId: undefined,\n postId: T3(webViewCtx.postId),\n snoovatar: undefined,\n subredditId: T5(webViewCtx.subredditId),\n subredditName: webViewCtx.subredditName,\n userId: webViewCtx.userId ? T2(webViewCtx.userId) : undefined,\n username: undefined,\n };\n}\n/**\n * Extracts the BridgeContext from the hash.\n * @internal\n */\nexport function getBridgeContext(name, hash) {\n if (name)\n return JSON.parse(name);\n const json = hash?.slice(1); // Strip the leading '#' from the hash\n if (!json)\n throw Error('no bridge context');\n return JSON.parse(decodeURIComponent(json));\n}\n/** @internal */\nexport function getClient(bridge) {\n if ((bridge.client !== ClientName.ANDROID && bridge.client !== ClientName.IOS) ||\n !bridge.nativeVersion)\n return;\n return {\n name: bridge.client === ClientName.ANDROID ? 'ANDROID' : 'IOS',\n version: bridge.nativeVersion,\n };\n}\n", "import type { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport { ConsentStatus } from '@devvit/protos/json/reddit/devvit/app_permission/v1/app_permission.js';\nimport { emitEffectWithResponse } from '@devvit/shared-types/client/emit-effect.js';\nimport { updateConsentStatus } from '@devvit/web-view-scripts/devvit-global.js';\n\n/**\n * This method is used to check if the app has been granted all the requested scopes.\n *\n * @experimental\n * @param event The event that triggered the request, must be a trusted event.\n * @returns true if the app has been granted all the requested scopes, false otherwise.\n */\nexport const canRunAsUser = async (event: Event): Promise<boolean> => {\n if (!event.isTrusted) {\n console.error('CanRunAsUser effect ignored due to untrusted event');\n throw new Error('Untrusted event');\n }\n\n const appPermissionState = devvit.appPermissionState;\n\n if (!appPermissionState) {\n // Note: The app permission state will be missing when the app runs on clients that haven't implemented this feature yet.\n // \"true\" is the correct value for the time being, until we have all clients supporting this feature.\n return true;\n }\n\n if (appPermissionState.requestedScopes.length === 0) {\n // the app does not have permission to do anything as the user\n return false;\n }\n\n switch (appPermissionState.consentStatus) {\n case ConsentStatus.REVOKED:\n return false;\n case ConsentStatus.GRANTED:\n // If the app has been granted all the requested scopes, return true\n if (\n appPermissionState.requestedScopes.every((scope) =>\n appPermissionState.grantedScopes.includes(scope)\n )\n ) {\n return true;\n }\n // Otherwise, the sets of scopes do not overlap we emit the effect to request the scopes; continue\n break;\n case ConsentStatus.CONSENT_STATUS_UNKNOWN:\n case ConsentStatus.UNRECOGNIZED:\n // We don't know the status, so we'll have to ask.\n break;\n default: {\n appPermissionState.consentStatus satisfies never;\n break;\n }\n }\n\n const response = await emitEffectWithResponse({\n canRunAsUser: {\n postId: devvit.context.postId,\n appSlug: devvit.context.appName,\n subredditId: devvit.context.subredditId,\n },\n type: 11 satisfies EffectType.EFFECT_CAN_RUN_AS_USER,\n });\n\n if (response?.consentStatus) updateConsentStatus(response.consentStatus.consentStatus);\n\n return response?.consentStatus?.consentStatus === ConsentStatus.GRANTED;\n};\n", "import { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport type { T3 } from '@devvit/shared';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\nimport { maxShareParamUserDataChars } from '@devvit/shared-types/client/share.js';\nimport { ICON_FILE_PATH } from '@devvit/shared-types/constants.js';\nimport { redditUrlFromPostId } from '@devvit/shared-types/web-view-scripts-constants.js';\n\nexport type ShareSheetOpts = {\n /** Data to share. Must be 1024 characters or less. */\n data?: string | undefined;\n /** Title of share sheet. */\n title?: string | undefined;\n /** Body text of share sheet. */\n text?: string | undefined;\n /** Post to share. If not provided, a link to the current post will be shared. */\n post?: T3 | undefined;\n};\n\n// to-do: move to web view scripts.\n/** Show the native share sheet or copy to clipboard depending on device. */\nexport async function showShareSheet(opts: Readonly<ShareSheetOpts>): Promise<void> {\n if (opts.data && opts.data.length > maxShareParamUserDataChars)\n throw Error(\n `data must be <= ${maxShareParamUserDataChars} characters but was ${opts.data.length} characters`\n );\n\n const postId = opts.post ?? devvit.context.postId;\n if (!postId) throw Error('A post must be specified when sharing outside a post');\n\n const iconURL = `${new URL(ICON_FILE_PATH, location.origin)}`;\n let iconRsp;\n try {\n iconRsp = await fetch(iconURL, { method: 'HEAD' });\n } catch {\n //\n }\n\n const url = redditUrlFromPostId(postId);\n\n emitEffect({\n type: EffectType.EFFECT_WEB_VIEW,\n share: {\n appIconUri: iconRsp?.ok ? iconURL : undefined,\n userData: opts.data,\n text: opts.text,\n title: opts.title,\n url: url,\n },\n });\n}\n\nexport function getShareData(): string | undefined {\n return devvit.share?.userData;\n}\n", "import type { FormField, SettingScope } from '@devvit/shared';\n\n/**\n * Make sure that the form fields have unique names.\n *\n * This is a carbon copy of the assertValidFormFields function in the public-api package\n * We copy it here so that @devvit/client does not need to depend on public-api\n * Any changes to this function should be reflected in the public-api version\n */\nexport function assertValidFormFields(\n fields: readonly FormField[],\n seenNames: Set<string> = new Set()\n): void {\n for (const field of fields) {\n if (field.type === 'group') {\n assertValidFormFields(field.fields, seenNames);\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fieldName = (field as any).name as string;\n\n if (seenNames.has(fieldName)) {\n throw new Error(`Duplicate field name: ${fieldName}`);\n }\n\n seenNames.add(fieldName);\n }\n assertAppSecretsOnly(fields);\n}\n\nexport function assertAppSecretsOnly(fields: readonly FormField[]): void {\n for (const field of fields) {\n if (field.type === 'string' && field.isSecret && field.scope !== ('app' as SettingScope.App)) {\n throw `Invalid setting: only app settings can be secrets. Add \"scope: SettingScope.App\" to field \"${field.name}\"`;\n }\n }\n}\n", "/**\n * #type.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var FormFieldType;\n(function (FormFieldType) {\n /** STRING - Single-line string */\n FormFieldType[FormFieldType[\"STRING\"] = 0] = \"STRING\";\n /** PARAGRAPH - Multi-line string */\n FormFieldType[FormFieldType[\"PARAGRAPH\"] = 1] = \"PARAGRAPH\";\n /** NUMBER - Number input */\n FormFieldType[FormFieldType[\"NUMBER\"] = 2] = \"NUMBER\";\n /** BOOLEAN - Checkbox, switch */\n FormFieldType[FormFieldType[\"BOOLEAN\"] = 3] = \"BOOLEAN\";\n /** LIST - Collect multiple entries of a single type */\n FormFieldType[FormFieldType[\"LIST\"] = 4] = \"LIST\";\n /** SELECTION - Provide a list of options for the user to choose from */\n FormFieldType[FormFieldType[\"SELECTION\"] = 5] = \"SELECTION\";\n /** GROUP - Create a labeled subsection of the form with nested fields */\n FormFieldType[FormFieldType[\"GROUP\"] = 6] = \"GROUP\";\n /** IMAGE - Image upload - value is a URL for the uploaded image */\n FormFieldType[FormFieldType[\"IMAGE\"] = 7] = \"IMAGE\";\n FormFieldType[FormFieldType[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(FormFieldType || (FormFieldType = {}));\n", "/**\n * #events.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var EventSource;\n(function (EventSource) {\n EventSource[EventSource[\"UNKNOWN_EVENT_SOURCE\"] = 0] = \"UNKNOWN_EVENT_SOURCE\";\n EventSource[EventSource[\"USER\"] = 1] = \"USER\";\n EventSource[EventSource[\"ADMIN\"] = 2] = \"ADMIN\";\n EventSource[EventSource[\"MODERATOR\"] = 3] = \"MODERATOR\";\n EventSource[EventSource[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(EventSource || (EventSource = {}));\nexport var DeletionReason;\n(function (DeletionReason) {\n DeletionReason[DeletionReason[\"UNSPECIFIED_DELETION_REASON\"] = 0] = \"UNSPECIFIED_DELETION_REASON\";\n DeletionReason[DeletionReason[\"SPAM\"] = 1] = \"SPAM\";\n DeletionReason[DeletionReason[\"LEGAL\"] = 2] = \"LEGAL\";\n DeletionReason[DeletionReason[\"OTHER\"] = 3] = \"OTHER\";\n DeletionReason[DeletionReason[\"UNKNOWN\"] = 4] = \"UNKNOWN\";\n DeletionReason[DeletionReason[\"EXPLICIT_CONTENT\"] = 5] = \"EXPLICIT_CONTENT\";\n DeletionReason[DeletionReason[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(DeletionReason || (DeletionReason = {}));\n", "/**\n * #postv2.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var CrowdControlLevel;\n(function (CrowdControlLevel) {\n CrowdControlLevel[CrowdControlLevel[\"OFF\"] = 0] = \"OFF\";\n CrowdControlLevel[CrowdControlLevel[\"LENIENT\"] = 1] = \"LENIENT\";\n CrowdControlLevel[CrowdControlLevel[\"MEDIUM\"] = 2] = \"MEDIUM\";\n CrowdControlLevel[CrowdControlLevel[\"STRICT\"] = 3] = \"STRICT\";\n CrowdControlLevel[CrowdControlLevel[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(CrowdControlLevel || (CrowdControlLevel = {}));\nexport var DistinguishType;\n(function (DistinguishType) {\n DistinguishType[DistinguishType[\"NULL_VALUE\"] = 0] = \"NULL_VALUE\";\n DistinguishType[DistinguishType[\"ADMIN\"] = 1] = \"ADMIN\";\n DistinguishType[DistinguishType[\"GOLD\"] = 2] = \"GOLD\";\n DistinguishType[DistinguishType[\"GOLD_AUTO\"] = 3] = \"GOLD_AUTO\";\n DistinguishType[DistinguishType[\"YES\"] = 4] = \"YES\";\n DistinguishType[DistinguishType[\"SPECIAL\"] = 5] = \"SPECIAL\";\n DistinguishType[DistinguishType[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(DistinguishType || (DistinguishType = {}));\n", "/**\n * #subredditv2.ts\n *\n * Code generated by ts-proto. DO NOT EDIT.\n * @packageDocumentation\n */\n/* eslint-disable */\nexport var SubredditType;\n(function (SubredditType) {\n SubredditType[SubredditType[\"ARCHIVED\"] = 0] = \"ARCHIVED\";\n SubredditType[SubredditType[\"EMPLOYEES_ONLY\"] = 1] = \"EMPLOYEES_ONLY\";\n SubredditType[SubredditType[\"GOLD_ONLY\"] = 2] = \"GOLD_ONLY\";\n SubredditType[SubredditType[\"GOLD_RESTRICTED\"] = 3] = \"GOLD_RESTRICTED\";\n SubredditType[SubredditType[\"PRIVATE\"] = 4] = \"PRIVATE\";\n SubredditType[SubredditType[\"PUBLIC\"] = 5] = \"PUBLIC\";\n SubredditType[SubredditType[\"RESTRICTED\"] = 6] = \"RESTRICTED\";\n SubredditType[SubredditType[\"USER\"] = 7] = \"USER\";\n SubredditType[SubredditType[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SubredditType || (SubredditType = {}));\n/** used with data-api */\nexport var SubredditRating;\n(function (SubredditRating) {\n SubredditRating[SubredditRating[\"UNKNOWN_SUBREDDIT_RATING\"] = 0] = \"UNKNOWN_SUBREDDIT_RATING\";\n /** E - everyone */\n SubredditRating[SubredditRating[\"E\"] = 1] = \"E\";\n /** M1 - mature 1 */\n SubredditRating[SubredditRating[\"M1\"] = 2] = \"M1\";\n /** M2 - mature 2 */\n SubredditRating[SubredditRating[\"M2\"] = 3] = \"M2\";\n /** D - high-risk drug use */\n SubredditRating[SubredditRating[\"D\"] = 4] = \"D\";\n /** V - violence & gore */\n SubredditRating[SubredditRating[\"V\"] = 5] = \"V\";\n /** X - sexually explicit */\n SubredditRating[SubredditRating[\"X\"] = 6] = \"X\";\n SubredditRating[SubredditRating[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SubredditRating || (SubredditRating = {}));\n/** creating new enums so that we can have unspecified and unset values */\nexport var SubredditTypeV2;\n(function (SubredditTypeV2) {\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_UNSPECIFIED\"] = 0] = \"SUBREDDIT_TYPE_UNSPECIFIED\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_UNKNOWN\"] = 1] = \"SUBREDDIT_TYPE_UNKNOWN\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_ARCHIVED\"] = 2] = \"SUBREDDIT_TYPE_ARCHIVED\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_EMPLOYEES_ONLY\"] = 3] = \"SUBREDDIT_TYPE_EMPLOYEES_ONLY\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_GOLD_ONLY\"] = 4] = \"SUBREDDIT_TYPE_GOLD_ONLY\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_GOLD_RESTRICTED\"] = 5] = \"SUBREDDIT_TYPE_GOLD_RESTRICTED\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_PRIVATE\"] = 6] = \"SUBREDDIT_TYPE_PRIVATE\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_PUBLIC\"] = 7] = \"SUBREDDIT_TYPE_PUBLIC\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_RESTRICTED\"] = 8] = \"SUBREDDIT_TYPE_RESTRICTED\";\n SubredditTypeV2[SubredditTypeV2[\"SUBREDDIT_TYPE_USER\"] = 9] = \"SUBREDDIT_TYPE_USER\";\n SubredditTypeV2[SubredditTypeV2[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SubredditTypeV2 || (SubredditTypeV2 = {}));\nexport var SubredditRatingV2;\n(function (SubredditRatingV2) {\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_UNSPECIFIED\"] = 0] = \"SUBREDDIT_RATING_UNSPECIFIED\";\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_UNKNOWN\"] = 1] = \"SUBREDDIT_RATING_UNKNOWN\";\n /** SUBREDDIT_RATING_E - everyone */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_E\"] = 2] = \"SUBREDDIT_RATING_E\";\n /** SUBREDDIT_RATING_M1 - mature 1 */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_M1\"] = 3] = \"SUBREDDIT_RATING_M1\";\n /** SUBREDDIT_RATING_M2 - mature 2 */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_M2\"] = 4] = \"SUBREDDIT_RATING_M2\";\n /** SUBREDDIT_RATING_D - high-risk drug use */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_D\"] = 5] = \"SUBREDDIT_RATING_D\";\n /** SUBREDDIT_RATING_V - violence & gore */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_V\"] = 6] = \"SUBREDDIT_RATING_V\";\n /** SUBREDDIT_RATING_X - sexually explicit */\n SubredditRatingV2[SubredditRatingV2[\"SUBREDDIT_RATING_X\"] = 7] = \"SUBREDDIT_RATING_X\";\n SubredditRatingV2[SubredditRatingV2[\"UNRECOGNIZED\"] = -1] = \"UNRECOGNIZED\";\n})(SubredditRatingV2 || (SubredditRatingV2 = {}));\n", "export var SettingScope;\n(function (SettingScope) {\n SettingScope[\"Installation\"] = \"installation\";\n SettingScope[\"App\"] = \"app\";\n})(SettingScope || (SettingScope = {}));\n", "import { FormFieldType } from '@devvit/protos/json/devvit/ui/form_builder/v1alpha/type.js';\nimport type { FormFieldValue } from '@devvit/protos/json/devvit/ui/form_builder/v1alpha/value.js';\nimport { type FormValues, type JsonObject } from '@devvit/shared';\n\nfunction flattenFormFieldValue(\n value: FormFieldValue\n): undefined | string | string[] | number | boolean {\n switch (value.fieldType) {\n case FormFieldType.STRING:\n return value.stringValue;\n case FormFieldType.IMAGE:\n // the string value is the URL\n return value.stringValue;\n case FormFieldType.PARAGRAPH:\n return value.stringValue;\n case FormFieldType.NUMBER:\n return value.numberValue;\n case FormFieldType.BOOLEAN:\n return value.boolValue;\n case FormFieldType.SELECTION:\n return value.selectionValue?.values ?? [];\n default:\n return undefined;\n }\n}\n\n// This is a carbon copy of the transformFormFields function in the public-api package\n// We copy it here so that @devvit/client does not need to depend on public-api\n// Any changes to this function should be reflected in the public-api version\nexport function getFormValues<T extends JsonObject>(results: {\n [key: string]: FormFieldValue;\n}): FormValues<T> {\n return Object.keys(results).reduce((acc, key) => {\n const val = flattenFormFieldValue(results[key]);\n if (val !== undefined) (acc as JsonObject)[key] = val;\n return acc;\n }, {} as FormValues<T>);\n}\n", "import type { FormField as FormFieldProto } from '@devvit/protos/json/devvit/ui/form_builder/v1alpha/field.js';\nimport { FormFieldType } from '@devvit/protos/json/devvit/ui/form_builder/v1alpha/type.js';\nimport {\n type BooleanField,\n type FormField,\n type FormFieldGroup,\n type ImageField,\n type NumberField,\n type ParagraphField,\n type SelectField,\n type StringField,\n} from '@devvit/shared';\n\n// This is a carbon copy of the transformFormFields function in the public-api package\n// We copy it here so that @devvit/client does not need to depend on public-api\n// Any changes to this function should be reflected in the public-api version\nexport function transformFormFields(fields: readonly FormField[]): FormFieldProto[] {\n return fields.map((field) => {\n switch (field.type) {\n case 'string':\n return transformStringField(field);\n case 'image':\n return transformImageField(field);\n case 'paragraph':\n return transformParagraphField(field);\n case 'number':\n return transformNumberField(field);\n case 'select':\n return transformSelectField(field);\n case 'boolean':\n return transformBooleanField(field);\n case 'group':\n return transformGroupField(field);\n default:\n throw new Error('Unknown field type.');\n }\n });\n}\n\nfunction transformStringField(field: StringField): FormFieldProto {\n return {\n defaultValue: {\n fieldType: FormFieldType.STRING,\n stringValue: field.defaultValue,\n },\n disabled: field.disabled,\n fieldConfig: {\n stringConfig: {\n placeholder: field.placeholder,\n },\n },\n fieldId: field.name,\n fieldType: FormFieldType.STRING,\n helpText: field.helpText,\n label: field.label,\n required: field.required,\n isSecret: field.isSecret,\n };\n}\n\nfunction transformImageField(field: ImageField): FormFieldProto {\n return {\n disabled: field.disabled,\n fieldId: field.name,\n fieldType: FormFieldType.IMAGE,\n helpText: field.helpText,\n label: field.label,\n required: field.required,\n };\n}\n\nfunction transformParagraphField(field: ParagraphField): FormFieldProto {\n return {\n defaultValue: {\n fieldType: FormFieldType.PARAGRAPH,\n stringValue: field.defaultValue,\n },\n disabled: field.disabled,\n fieldConfig: {\n paragraphConfig: {\n lineHeight: field.lineHeight,\n placeholder: field.placeholder,\n },\n },\n fieldId: field.name,\n fieldType: FormFieldType.PARAGRAPH,\n helpText: field.helpText,\n label: field.label,\n required: field.required,\n };\n}\n\nfunction transformNumberField(field: NumberField): FormFieldProto {\n return {\n defaultValue: {\n fieldType: FormFieldType.NUMBER,\n numberValue: field.defaultValue,\n },\n disabled: field.disabled,\n fieldConfig: {\n numberConfig: {},\n },\n fieldId: field.name,\n fieldType: FormFieldType.NUMBER,\n helpText: field.helpText,\n label: field.label,\n required: field.required,\n };\n}\n\nfunction transformSelectField(field: SelectField): FormFieldProto {\n return {\n defaultValue: {\n fieldType: FormFieldType.SELECTION,\n selectionValue: {\n values: field.defaultValue ?? [],\n },\n },\n disabled: field.disabled,\n fieldConfig: {\n selectionConfig: {\n choices: field.options,\n multiSelect: field.multiSelect,\n },\n },\n fieldId: field.name,\n fieldType: FormFieldType.SELECTION,\n helpText: field.helpText,\n label: field.label,\n required: field.required,\n };\n}\n\nfunction transformBooleanField(field: BooleanField): FormFieldProto {\n return {\n defaultValue: {\n fieldType: FormFieldType.BOOLEAN,\n boolValue: field.defaultValue,\n },\n disabled: field.disabled,\n fieldId: field.name,\n fieldType: FormFieldType.BOOLEAN,\n helpText: field.helpText,\n label: field.label,\n };\n}\n\nfunction transformGroupField(field: FormFieldGroup): FormFieldProto {\n return {\n fieldId: '',\n fieldType: FormFieldType.GROUP,\n fieldConfig: {\n groupConfig: {\n fields: transformFormFields(field.fields),\n },\n },\n label: field.label,\n helpText: field.helpText,\n };\n}\n", "import type { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport type { Form as FormProto } from '@devvit/protos/json/devvit/ui/form_builder/v1alpha/form.js';\nimport type { Form } from '@devvit/shared';\nimport { emitEffectWithResponse } from '@devvit/shared-types/client/emit-effect.js';\nimport type { FormKey } from '@devvit/shared-types/useForm.js';\n\nimport { assertValidFormFields } from './helpers/assert-valid-form-fields.js';\nimport type { FormEffectResponse, FormToFormValues } from './helpers/form-types.js';\nimport { getFormValues } from './helpers/get-form-values.js';\nimport { transformFormFields } from './helpers/transform-form.js';\n\nlet _formKey = 1;\n\nconst getNextFormKey = (): FormKey => {\n _formKey++;\n return `form.${_formKey}`;\n};\n\n/**\n * Opens a form in a modal.\n * Returns a promise that resolves with the form submission results.\n * The form can be submitted or canceled by the user.\n *\n * @param formDefinition - The form configuration\n * @returns A promise that resolves to either:\n * - An object with `action: FormAction.SUBMITTED` and the submitted form values\n * - An object with `action: FormAction.CANCELED` if the user canceled the form\n * @throws Will throw if the form fields are invalid\n */\nexport const showForm = async <const T extends Form>(\n formDefinition: T\n): Promise<FormEffectResponse<FormToFormValues<T>>> => {\n const form: FormProto = {\n fields: [],\n id: getNextFormKey(),\n title: formDefinition.title,\n acceptLabel: formDefinition.acceptLabel,\n cancelLabel: formDefinition.cancelLabel,\n shortDescription: formDefinition.description,\n };\n\n assertValidFormFields(formDefinition.fields);\n form.fields = transformFormFields(formDefinition.fields);\n\n const response = await emitEffectWithResponse({\n showForm: {\n form,\n },\n type: 3 satisfies EffectType.EFFECT_SHOW_FORM,\n });\n\n if (!response || !response.formSubmitted) {\n return {\n action: 'CANCELED',\n };\n }\n\n const formResults = getFormValues(response.formSubmitted.results);\n\n return {\n action: 'SUBMITTED',\n values: formResults as FormToFormValues<T>,\n };\n};\n", "import type { EffectType } from '@devvit/protos/json/devvit/ui/effects/v1alpha/effect.js';\nimport type {\n Toast as ToastProto,\n ToastAppearance,\n} from '@devvit/protos/json/devvit/ui/toast/toast.js';\nimport type { Toast } from '@devvit/shared';\nimport { emitEffect } from '@devvit/shared-types/client/emit-effect.js';\n\n/**\n * Shows a toast message.\n *\n * @param textOrToast - The text or toast object to display\n */\nexport function showToast(text: string): void;\nexport function showToast(toast: Toast): void;\nexport function showToast(textOrToast: string | Toast): void {\n let toast: ToastProto;\n\n if (textOrToast instanceof Object) {\n toast = {\n text: textOrToast.text,\n appearance:\n textOrToast.appearance === 'success'\n ? (1 satisfies ToastAppearance.SUCCESS)\n : (0 satisfies ToastAppearance.NEUTRAL),\n };\n } else {\n toast = {\n text: textOrToast,\n };\n }\n\n void emitEffect({\n showToast: {\n toast,\n },\n type: 4 satisfies EffectType.EFFECT_SHOW_TOAST,\n });\n}\n", "import { initUserProgress } from './effects/user-progress.js';\nimport { initWebViewMode } from './effects/web-view-mode.js';\n\nexport * from './clientContext.js';\nexport * from './effects/ad-payload.js';\nexport * from './effects/experiments.js';\nexport * from './effects/helpers/form-types.js';\nexport * from './effects/login-prompt.js';\nexport * from './effects/navigate-to.js';\nexport * from './effects/run-as-user.js';\nexport * from './effects/share.js';\nexport * from './effects/show-form.js';\nexport * from './effects/show-toast.js';\nexport * from './effects/web-view-mode.js';\nexport type { WebViewOptions } from './effects/web-view-options.js';\nexport type { Context } from '@devvit/shared-types/client/client-context.js';\nexport * from '@devvit/shared-types/PostData.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,QAClB,CACF,CCpJA,IAAIS,EAAW,EAETC,GAAiB,KACrBD,IACO,QAAQA,CAAQ,IAcZE,GAAW,MACtBC,GACqD,CACrD,IAAMC,EAAkB,CACtB,OAAQ,CAAC,EACT,GAAIH,GAAe,EACnB,MAAOE,EAAe,MACtB,YAAaA,EAAe,YAC5B,YAAaA,EAAe,YAC5B,iBAAkBA,EAAe,WACnC,EAEAE,EAAsBF,EAAe,MAAM,EAC3CC,EAAK,OAASE,EAAoBH,EAAe,MAAM,EAEvD,IAAMI,EAAW,MAAMC,EAAuB,CAC5C,SAAU,CACR,KAAAJ,CACF,EACA,KAAM,CACR,CAAC,EAED,MAAI,CAACG,GAAY,CAACA,EAAS,cAClB,CACL,OAAQ,UACV,EAKK,CACL,OAAQ,YACR,OAJkBE,EAAcF,EAAS,cAAc,OAAO,CAKhE,CACF,EChDO,SAASG,GAAUC,EAAmC,CAC3D,IAAIC,EAEAD,aAAuB,OACzBC,EAAQ,CACN,KAAMD,EAAY,KAClB,WACEA,EAAY,aAAe,UACtB,EACA,CACT,EAEAC,EAAQ,CACN,KAAMD,CACR,EAGGE,EAAW,CACd,UAAW,CACT,MAAAD,CACF,EACA,KAAM,CACR,CAAC,CACH,CCpBAE,EAAgB,EAChBC,EAAiB",
|
|
6
|
-
"names": ["EffectType", "WebViewUserProgressEffect_State", "WebViewInternalMessageScope", "webViewInternalMessageType", "emitEffect", "effect", "requestId", "message", "WebViewInternalMessageScope", "emitEffectWithResponse", "resolve", "EffectType", "id", "handleEffect", "event", "userProgressStateHeader", "userProgressFetch", "initUserProgress", "fetch", "wrappedFetch", "input", "init", "response", "url", "notifyUserProgress", "error", "progress", "userProgressStateHeader", "state", "WebViewUserProgressEffect_State", "emitEffect", "EffectType", "WebViewImmersiveMode", "emitTelemetryClickEffect", "event", "click", "TelemetryClickPayload", "emitEffect", "EffectType", "eventTarget", "isTrusted", "definition", "elemTrackId", "analyzeClickTarget", "targetElement", "getTargetElement", "currentElement", "dataTrackId", "elementIsStrictClickTarget", "node", "element", "apiPathPrefix", "ICON_FILE_PATH", "tokenParam", "modeListeners", "getWebViewMode", "webViewMode", "requestExpandedMode", "event", "entry", "options", "emitTelemetryClickEffect", "emitModeEffect", "WebViewImmersiveMode", "exitExpandedMode", "addWebViewModeListener", "callback", "removeWebViewModeListener", "mode", "title", "entryUrl", "url", "apiPathPrefix", "tokenParam", "emitEffect", "EffectType", "initWebViewMode", "onWebViewMessage", "ev", "listener", "context", "getAdPayload", "exposeExperiment", "experimentName", "emitEffect", "experimentVariant", "showLoginPrompt", "emitEffect", "EffectType", "resolveNavigationInput", "thingOrUrl", "url", "permalink", "devvitScriptFileName", "devvitScriptUrl", "devvitScriptFileName", "redditUrlFromPostId", "postId", "navigateTo", "url", "inputUrl", "resolveNavigationInput", "normalizedUrl", "emitNavigationEffect", "navigateToPost", "postId", "options", "redditUrlFromPostId", "devvitShare", "emitEffect", "ConsentStatus", "Scope", "Client", "Height", "ShareParam_Presentation", "T_PREFIX", "InvalidTokenError", "updateConsentStatus", "consentStatus", "canRunAsUser", "event", "appPermissionState", "ConsentStatus", "scope", "response", "emitEffectWithResponse", "updateConsentStatus", "showShareSheet", "opts", "postId", "iconURL", "ICON_FILE_PATH", "iconRsp", "url", "redditUrlFromPostId", "emitEffect", "EffectType", "getShareData", "assertValidFormFields", "fields", "seenNames", "field", "fieldName", "assertAppSecretsOnly", "FormFieldType", "EventSource", "DeletionReason", "CrowdControlLevel", "DistinguishType", "SubredditType", "SubredditRating", "SubredditTypeV2", "SubredditRatingV2", "SettingScope", "flattenFormFieldValue", "value", "FormFieldType", "getFormValues", "results", "acc", "key", "val", "transformFormFields", "fields", "field", "transformStringField", "transformImageField", "transformParagraphField", "transformNumberField", "transformSelectField", "transformBooleanField", "transformGroupField", "FormFieldType", "_formKey", "getNextFormKey", "showForm", "formDefinition", "form", "assertValidFormFields", "transformFormFields", "response", "emitEffectWithResponse", "getFormValues", "showToast", "textOrToast", "toast", "emitEffect", "initWebViewMode", "initUserProgress"]
|
|
7
|
-
}
|