@devvit/public-api 0.11.10-next-2025-03-11-adb564438.0 → 0.11.10-next-2025-03-11-19863e3ca.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/devvit/internals/blocks/handler/useWebView.d.ts.map +1 -1
- package/devvit/internals/blocks/handler/useWebView.js +14 -4
- package/meta.json +4 -4
- package/meta.min.json +5 -5
- package/package.json +6 -6
- package/public-api.d.ts +2 -0
- package/public-api.iife.js +16 -5
- package/public-api.min.js +6 -6
- package/public-api.min.js.map +3 -3
- package/types/hooks.d.ts +2 -0
- package/types/hooks.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebView.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useWebView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAEV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useWebView.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useWebView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAEV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AA+F9B;;KAEK;AACL,wBAAgB,UAAU,CAAC,IAAI,SAAS,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,SAAS,GAAG,SAAS,EAC7F,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,GACnC,gBAAgB,CAAC,EAAE,CAAC,CAUtB"}
|
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _WebViewHook_hookId, _WebViewHook_url, _WebViewHook_onMessage, _WebViewHook_onUnmount, _WebViewHook_renderContext;
|
|
12
|
+
var _WebViewHook_hookId, _WebViewHook_url, _WebViewHook_onMessage, _WebViewHook_onUnmount, _WebViewHook_renderContext, _WebViewHook_emitFullscreenEffect;
|
|
13
13
|
import { EffectType } from '@devvit/protos';
|
|
14
14
|
import { WebViewVisibility } from '@devvit/protos';
|
|
15
15
|
import { registerHook } from './BlocksHandler.js';
|
|
@@ -48,17 +48,26 @@ class WebViewHook {
|
|
|
48
48
|
if (!url) {
|
|
49
49
|
throw Error(`useWebView fullscreen request failed; web view asset could not be found`);
|
|
50
50
|
}
|
|
51
|
+
__classPrivateFieldGet(this, _WebViewHook_emitFullscreenEffect, "f").call(this, true, url);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Triggers the fullscreen effect to hide the open web view.
|
|
55
|
+
*/
|
|
56
|
+
this.unmount = () => {
|
|
57
|
+
__classPrivateFieldGet(this, _WebViewHook_emitFullscreenEffect, "f").call(this, false, '');
|
|
58
|
+
};
|
|
59
|
+
_WebViewHook_emitFullscreenEffect.set(this, (show, url) => {
|
|
51
60
|
__classPrivateFieldGet(this, _WebViewHook_renderContext, "f").emitEffect('fullscreen', {
|
|
52
61
|
type: EffectType.EFFECT_WEB_VIEW,
|
|
53
62
|
webView: {
|
|
54
63
|
fullscreen: {
|
|
55
64
|
id: __classPrivateFieldGet(this, _WebViewHook_hookId, "f"),
|
|
56
|
-
show
|
|
65
|
+
show,
|
|
57
66
|
url,
|
|
58
67
|
},
|
|
59
68
|
},
|
|
60
69
|
});
|
|
61
|
-
};
|
|
70
|
+
});
|
|
62
71
|
// Default to index.html if there is no URL provided.
|
|
63
72
|
__classPrivateFieldSet(this, _WebViewHook_url, options.url ?? 'index.html', "f");
|
|
64
73
|
__classPrivateFieldSet(this, _WebViewHook_hookId, params.hookId, "f");
|
|
@@ -82,7 +91,7 @@ class WebViewHook {
|
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
}
|
|
85
|
-
_WebViewHook_hookId = new WeakMap(), _WebViewHook_url = new WeakMap(), _WebViewHook_onMessage = new WeakMap(), _WebViewHook_onUnmount = new WeakMap(), _WebViewHook_renderContext = new WeakMap();
|
|
94
|
+
_WebViewHook_hookId = new WeakMap(), _WebViewHook_url = new WeakMap(), _WebViewHook_onMessage = new WeakMap(), _WebViewHook_onUnmount = new WeakMap(), _WebViewHook_renderContext = new WeakMap(), _WebViewHook_emitFullscreenEffect = new WeakMap();
|
|
86
95
|
/**
|
|
87
96
|
* Use this hook to handle a web view's visibility state and any messages sent to your app.
|
|
88
97
|
* */
|
|
@@ -94,5 +103,6 @@ export function useWebView(options) {
|
|
|
94
103
|
return {
|
|
95
104
|
postMessage: hook.postMessage,
|
|
96
105
|
mount: hook.mount,
|
|
106
|
+
unmount: hook.unmount,
|
|
97
107
|
};
|
|
98
108
|
}
|
package/meta.json
CHANGED
|
@@ -7223,7 +7223,7 @@
|
|
|
7223
7223
|
"format": "esm"
|
|
7224
7224
|
},
|
|
7225
7225
|
"src/types/hooks.ts": {
|
|
7226
|
-
"bytes":
|
|
7226
|
+
"bytes": 6097,
|
|
7227
7227
|
"imports": [],
|
|
7228
7228
|
"format": "esm"
|
|
7229
7229
|
},
|
|
@@ -9575,7 +9575,7 @@
|
|
|
9575
9575
|
"format": "esm"
|
|
9576
9576
|
},
|
|
9577
9577
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
9578
|
-
"bytes":
|
|
9578
|
+
"bytes": 3887,
|
|
9579
9579
|
"imports": [
|
|
9580
9580
|
{
|
|
9581
9581
|
"path": "../protos/dist/index.js",
|
|
@@ -10333,10 +10333,10 @@
|
|
|
10333
10333
|
"bytesInOutput": 370
|
|
10334
10334
|
},
|
|
10335
10335
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
10336
|
-
"bytesInOutput":
|
|
10336
|
+
"bytesInOutput": 3408
|
|
10337
10337
|
}
|
|
10338
10338
|
},
|
|
10339
|
-
"bytes":
|
|
10339
|
+
"bytes": 12455721
|
|
10340
10340
|
}
|
|
10341
10341
|
}
|
|
10342
10342
|
}
|
package/meta.min.json
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"format": "esm"
|
|
64
64
|
},
|
|
65
65
|
"src/types/hooks.ts": {
|
|
66
|
-
"bytes":
|
|
66
|
+
"bytes": 6097,
|
|
67
67
|
"imports": [],
|
|
68
68
|
"format": "esm"
|
|
69
69
|
},
|
|
@@ -2415,7 +2415,7 @@
|
|
|
2415
2415
|
"format": "esm"
|
|
2416
2416
|
},
|
|
2417
2417
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
2418
|
-
"bytes":
|
|
2418
|
+
"bytes": 3887,
|
|
2419
2419
|
"imports": [
|
|
2420
2420
|
{
|
|
2421
2421
|
"path": "@devvit/protos",
|
|
@@ -2517,7 +2517,7 @@
|
|
|
2517
2517
|
"imports": [],
|
|
2518
2518
|
"exports": [],
|
|
2519
2519
|
"inputs": {},
|
|
2520
|
-
"bytes":
|
|
2520
|
+
"bytes": 1058754
|
|
2521
2521
|
},
|
|
2522
2522
|
"dist/public-api.min.js": {
|
|
2523
2523
|
"imports": [
|
|
@@ -3067,10 +3067,10 @@
|
|
|
3067
3067
|
"bytesInOutput": 178
|
|
3068
3068
|
},
|
|
3069
3069
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
3070
|
-
"bytesInOutput":
|
|
3070
|
+
"bytesInOutput": 1396
|
|
3071
3071
|
}
|
|
3072
3072
|
},
|
|
3073
|
-
"bytes":
|
|
3073
|
+
"bytes": 218757
|
|
3074
3074
|
}
|
|
3075
3075
|
}
|
|
3076
3076
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/public-api",
|
|
3
|
-
"version": "0.11.10-next-2025-03-11-
|
|
3
|
+
"version": "0.11.10-next-2025-03-11-19863e3ca.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@devvit/protos": "0.11.10-next-2025-03-11-
|
|
34
|
-
"@devvit/shared-types": "0.11.10-next-2025-03-11-
|
|
33
|
+
"@devvit/protos": "0.11.10-next-2025-03-11-19863e3ca.0",
|
|
34
|
+
"@devvit/shared-types": "0.11.10-next-2025-03-11-19863e3ca.0",
|
|
35
35
|
"base64-js": "1.5.1",
|
|
36
36
|
"clone-deep": "4.0.1",
|
|
37
37
|
"moderndash": "4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@ampproject/filesize": "4.3.0",
|
|
41
|
-
"@devvit/repo-tools": "0.11.10-next-2025-03-11-
|
|
42
|
-
"@devvit/tsconfig": "0.11.10-next-2025-03-11-
|
|
41
|
+
"@devvit/repo-tools": "0.11.10-next-2025-03-11-19863e3ca.0",
|
|
42
|
+
"@devvit/tsconfig": "0.11.10-next-2025-03-11-19863e3ca.0",
|
|
43
43
|
"@microsoft/api-extractor": "7.41.0",
|
|
44
44
|
"@reddit/faceplate-ui": "18.0.1",
|
|
45
45
|
"@types/clone-deep": "4.0.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"source": "./src/index.ts",
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "f87e388b031ee356e0bbe9850e11a2dba0d9e4e2"
|
|
64
64
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -53377,6 +53377,8 @@ export declare type UseWebViewResult<To extends JSONValue = JSONValue> = {
|
|
|
53377
53377
|
postMessage(message: To): void;
|
|
53378
53378
|
/** Initiate a request for the web view to open */
|
|
53379
53379
|
mount(): void;
|
|
53380
|
+
/** Initiate a request for the web view to be closed */
|
|
53381
|
+
unmount(): void;
|
|
53380
53382
|
};
|
|
53381
53383
|
|
|
53382
53384
|
export declare type ValidatedBooleanField = Prettify<ValidatedFormField<BooleanField, boolean>>;
|