@devvit/ui-renderer 0.10.23-next-2024-06-24-e4d107a11.0 → 0.10.23-next-2024-06-24-057510192.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/client/devvit-surface.d.ts.map +1 -1
- package/client/devvit-surface.js +4 -15
- package/client/formbuilder/devvit-form-dialog.d.ts.map +1 -1
- package/client/formbuilder/devvit-form-dialog.js +1 -6
- package/client/webDispatcher.d.ts +1 -2
- package/client/webDispatcher.d.ts.map +1 -1
- package/client/webDispatcher.js +12 -19
- package/devvit-surface-meta.min.json +9 -14
- package/devvit-surface.min.js +77 -77
- package/devvit-surface.min.js.map +3 -3
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-surface.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-surface.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAE1E,OAAO,KAAK,EAEV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,EAEP,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAyC,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAGxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-surface.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-surface.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAE1E,OAAO,KAAK,EAEV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,EAEP,UAAU,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ivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
18
18
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
19
19
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
20
20
|
};
|
|
21
|
-
var
|
|
21
|
+
var _DevvitSurface_rootHeight, _DevvitSurface_resizeObserver, _DevvitSurface_intersectionObserver, _DevvitSurface_dispatcher, _DevvitSurface_newRenderContext, _DevvitSurface_onRender;
|
|
22
22
|
import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
23
23
|
import { BlockConfig_Root, BlockStackDirection, UIDimensions } from '@devvit/protos';
|
|
24
24
|
import { throttle } from '@devvit/shared-types/throttle.js';
|
|
@@ -28,7 +28,6 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
28
28
|
import { DEFAULT_ROOT_HEIGHT } from '../blocks/templates/renderBlock.js';
|
|
29
29
|
import { styles } from '../styles.js';
|
|
30
30
|
import { WebDispatcher } from './webDispatcher.js';
|
|
31
|
-
import { customEvent } from '@reddit/faceplate/lib/custom-event.js';
|
|
32
31
|
import '../blocks/components/devvit-blocks-renderer.js';
|
|
33
32
|
import '../blocks/components/devvit-blocks-webview.js';
|
|
34
33
|
import './devvit-animation-player.js';
|
|
@@ -48,7 +47,6 @@ let DevvitSurface = class DevvitSurface extends LitElement {
|
|
|
48
47
|
}
|
|
49
48
|
constructor() {
|
|
50
49
|
super();
|
|
51
|
-
_DevvitSurface_instances.add(this);
|
|
52
50
|
/** Enables debug logging for the local runtime */
|
|
53
51
|
this.runtimeDebugLogging = false;
|
|
54
52
|
/** Enable the use of experimental blocks that are not production ready */
|
|
@@ -62,6 +60,9 @@ let DevvitSurface = class DevvitSurface extends LitElement {
|
|
|
62
60
|
_DevvitSurface_intersectionObserver.set(this, void 0);
|
|
63
61
|
/** The orchestrates events for blocks */
|
|
64
62
|
_DevvitSurface_dispatcher.set(this, void 0);
|
|
63
|
+
// #bubble<T>(type: string, detail: T): void {
|
|
64
|
+
// this.dispatchEvent(customEvent(type, detail));
|
|
65
|
+
// }
|
|
65
66
|
_DevvitSurface_newRenderContext.set(this, () => ({
|
|
66
67
|
experimental: this.useExperimentalBlocks,
|
|
67
68
|
webViewEnabled: this.allowWebView,
|
|
@@ -97,12 +98,6 @@ let DevvitSurface = class DevvitSurface extends LitElement {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
|
-
_DevvitSurface_onUserActionEffect.set(this, (fx) => {
|
|
101
|
-
__classPrivateFieldGet(this, _DevvitSurface_instances, "m", _DevvitSurface_bubble).call(this, 'devvit-ui-effect', {
|
|
102
|
-
effect: fx,
|
|
103
|
-
onEvent: (ev) => __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f")?.submit([ev]),
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
101
|
if (devvit?.debug.surface)
|
|
107
102
|
console.debug(`[surface] Using devvit-surface and KMP!`);
|
|
108
103
|
}
|
|
@@ -118,7 +113,6 @@ let DevvitSurface = class DevvitSurface extends LitElement {
|
|
|
118
113
|
}, {
|
|
119
114
|
useSpeculativeExecution: this.useSpeculativeExecution,
|
|
120
115
|
}), "f");
|
|
121
|
-
__classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").onUserAction = __classPrivateFieldGet(this, _DevvitSurface_onUserActionEffect, "f");
|
|
122
116
|
__classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").subscribe((params) => {
|
|
123
117
|
__classPrivateFieldGet(this, _DevvitSurface_onRender, "f").call(this, {
|
|
124
118
|
request: params.request,
|
|
@@ -231,11 +225,6 @@ _DevvitSurface_intersectionObserver = new WeakMap();
|
|
|
231
225
|
_DevvitSurface_dispatcher = new WeakMap();
|
|
232
226
|
_DevvitSurface_newRenderContext = new WeakMap();
|
|
233
227
|
_DevvitSurface_onRender = new WeakMap();
|
|
234
|
-
_DevvitSurface_onUserActionEffect = new WeakMap();
|
|
235
|
-
_DevvitSurface_instances = new WeakSet();
|
|
236
|
-
_DevvitSurface_bubble = function _DevvitSurface_bubble(type, detail) {
|
|
237
|
-
this.dispatchEvent(customEvent(type, detail));
|
|
238
|
-
};
|
|
239
228
|
__decorate([
|
|
240
229
|
property({ attribute: false }),
|
|
241
230
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-form-dialog.d.ts","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,kEAAkE,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,kCAAkC,CAAC;AAI7F,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAiC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKxE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-form-dialog.d.ts","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,kEAAkE,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,kCAAkC,CAAC;AAI7F,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAiC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKxE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,gDAAgD,CAAC;AAIxD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,0BAA0B,CAAC,GAAG;IAC/E,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,qBACa,gBAAiB,SAAQ,UAAU;;IAE9C,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IAGvB,OAAO,CAAC,EAAE,eAAe,CAAC;IAG1B,KAAK,CAAC,EAAE,aAAa,CAAC;IAKtB,WAAoB,MAAM,8BAEzB;IAED,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IA2GpD,MAAM;CAuDhB"}
|
|
@@ -33,7 +33,6 @@ import { styles } from '../../styles.js';
|
|
|
33
33
|
import { renderFormFields } from './fields/index.js';
|
|
34
34
|
import '@reddit/faceplate-ui/components/faceplate-dialog';
|
|
35
35
|
import '@reddit/faceplate/components/faceplate-form.js';
|
|
36
|
-
import { formKeyToHookId } from '@devvit/shared-types/useForm.js';
|
|
37
36
|
/**
|
|
38
37
|
* Devvit form dialog.
|
|
39
38
|
*
|
|
@@ -98,13 +97,9 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
98
97
|
if (!invalidFields || invalidFields.length > 0) {
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
|
-
if (!this.form?.id) {
|
|
102
|
-
throw new Error(`Cannot submit form due to missing form id. If you are using 'useForm' please make sure that it is not called conditionally inside of your component.`);
|
|
103
|
-
}
|
|
104
100
|
__classPrivateFieldGet(this, _DevvitFormDialog_onEvent, "f").call(this, UIEvent.fromPartial({
|
|
105
|
-
hook: formKeyToHookId(this.form.id),
|
|
106
101
|
formSubmitted: {
|
|
107
|
-
formId: this.form
|
|
102
|
+
formId: this.form?.id,
|
|
108
103
|
results: __classPrivateFieldGet(this, _DevvitFormDialog_collectValues, "f").call(this),
|
|
109
104
|
},
|
|
110
105
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dispatcher, SubscribeCallbackParams } from '@devvit/multiplatform/ui-shared-shared.js';
|
|
2
2
|
import { JsDispatcherImpl } from '@devvit/multiplatform/ui-shared-shared.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { UIRequest } from '@devvit/protos';
|
|
4
4
|
import { type Metadata, type UIEnvironment, type UIEvent } from '@devvit/protos';
|
|
5
5
|
import type { ReplayUIResponse, UIProps, UIState } from './runtimes.js';
|
|
6
6
|
import { LocalRuntime, RemoteRuntime } from './runtimes.js';
|
|
@@ -15,7 +15,6 @@ export declare class WebDispatcher {
|
|
|
15
15
|
* render events.
|
|
16
16
|
*/
|
|
17
17
|
hasRendered: boolean;
|
|
18
|
-
onUserAction?: ((fx: Effect) => void) | undefined;
|
|
19
18
|
get state(): KMPDispatcher['state'];
|
|
20
19
|
constructor(initialState: Record<string, unknown>, env: UIEnvironment, config: {
|
|
21
20
|
useSpeculativeExecution: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webDispatcher.d.ts","sourceRoot":"","sources":["../../library/src/client/webDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAGV,uBAAuB,EAExB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,2CAA2C,CAAC;AAC9F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"webDispatcher.d.ts","sourceRoot":"","sources":["../../library/src/client/webDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAGV,uBAAuB,EAExB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,E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AG,IAAI;IAI9B,UAAU,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI;IAItD,SAAS,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzE,eAAe,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI;CAGxE"}
|
package/client/webDispatcher.js
CHANGED
|
@@ -18,16 +18,16 @@ import { Timers } from './timers.js';
|
|
|
18
18
|
class Logger {
|
|
19
19
|
debug(messages) {
|
|
20
20
|
if (devvit?.debug.runtime)
|
|
21
|
-
console.debug(
|
|
21
|
+
console.debug(...messages);
|
|
22
22
|
}
|
|
23
23
|
error(messages) {
|
|
24
|
-
console.error(
|
|
24
|
+
console.error(...messages);
|
|
25
25
|
}
|
|
26
26
|
info(messages) {
|
|
27
|
-
console.info(
|
|
27
|
+
console.info(...messages);
|
|
28
28
|
}
|
|
29
29
|
warn(messages) {
|
|
30
|
-
console.warn(
|
|
30
|
+
console.warn(...messages);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -58,8 +58,6 @@ const makeMillisecondsFromDuration = ({ nanos, seconds, }) => {
|
|
|
58
58
|
const nanosInMillis = nanos / 1000000;
|
|
59
59
|
return Math.floor(secondsInMillis + nanosInMillis);
|
|
60
60
|
};
|
|
61
|
-
// Effects that can only be fired as the result of a user action
|
|
62
|
-
const userActionEffects = ['showToast', 'showForm', 'navigateToUrl'];
|
|
63
61
|
export class WebDispatcher {
|
|
64
62
|
get state() {
|
|
65
63
|
return __classPrivateFieldGet(this, _WebDispatcher_dispatcher, "f").state;
|
|
@@ -120,21 +118,16 @@ export class WebDispatcher {
|
|
|
120
118
|
console.debug(`[runtime] dispatcher got a new event from subscribe`, args[0]);
|
|
121
119
|
const [{ response }] = args;
|
|
122
120
|
response.effects.forEach((effect) => {
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
// We only need to handle interval effects!
|
|
122
|
+
if (!effect.interval)
|
|
125
123
|
return;
|
|
124
|
+
const entries = Object.entries(effect.interval.intervals);
|
|
125
|
+
if (entries.length === 0) {
|
|
126
|
+
__classPrivateFieldGet(this, _WebDispatcher_timers, "f").clear();
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
__classPrivateFieldGet(this, _WebDispatcher_timers, "f").clear();
|
|
131
|
-
}
|
|
132
|
-
__classPrivateFieldGet(this, _WebDispatcher_timers, "f").apply(entries.map(([id, meta]) =>
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
|
-
new TimerDefinition(id, makeMillisecondsFromDuration(meta.duration))));
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(effect, null, 2)}`);
|
|
128
|
+
__classPrivateFieldGet(this, _WebDispatcher_timers, "f").apply(entries.map(([id, meta]) =>
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
|
+
new TimerDefinition(id, makeMillisecondsFromDuration(meta.duration))));
|
|
138
131
|
});
|
|
139
132
|
cb(...args);
|
|
140
133
|
}), "f");
|
|
@@ -10194,7 +10194,7 @@
|
|
|
10194
10194
|
"format": "esm"
|
|
10195
10195
|
},
|
|
10196
10196
|
"library/src/client/webDispatcher.ts": {
|
|
10197
|
-
"bytes":
|
|
10197
|
+
"bytes": 7256,
|
|
10198
10198
|
"imports": [
|
|
10199
10199
|
{
|
|
10200
10200
|
"path": "../../node_modules/@devvit/multiplatform/kotlin/ui-shared-shared.js",
|
|
@@ -10835,7 +10835,7 @@
|
|
|
10835
10835
|
"format": "esm"
|
|
10836
10836
|
},
|
|
10837
10837
|
"library/src/client/devvit-surface.ts": {
|
|
10838
|
-
"bytes":
|
|
10838
|
+
"bytes": 11011,
|
|
10839
10839
|
"imports": [
|
|
10840
10840
|
{
|
|
10841
10841
|
"path": "../../node_modules/@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js",
|
|
@@ -10887,11 +10887,6 @@
|
|
|
10887
10887
|
"kind": "import-statement",
|
|
10888
10888
|
"original": "./webDispatcher.js"
|
|
10889
10889
|
},
|
|
10890
|
-
{
|
|
10891
|
-
"path": "../../node_modules/@reddit/faceplate/lib/custom-event.js",
|
|
10892
|
-
"kind": "import-statement",
|
|
10893
|
-
"original": "@reddit/faceplate/lib/custom-event.js"
|
|
10894
|
-
},
|
|
10895
10890
|
{
|
|
10896
10891
|
"path": "library/src/blocks/components/devvit-blocks-renderer.ts",
|
|
10897
10892
|
"kind": "import-statement",
|
|
@@ -10921,7 +10916,7 @@
|
|
|
10921
10916
|
"imports": [],
|
|
10922
10917
|
"exports": [],
|
|
10923
10918
|
"inputs": {},
|
|
10924
|
-
"bytes":
|
|
10919
|
+
"bytes": 12135432
|
|
10925
10920
|
},
|
|
10926
10921
|
"dist/devvit-surface.min.js": {
|
|
10927
10922
|
"imports": [
|
|
@@ -11569,7 +11564,7 @@
|
|
|
11569
11564
|
"bytesInOutput": 38
|
|
11570
11565
|
},
|
|
11571
11566
|
"../shared-types/dist/tid.js": {
|
|
11572
|
-
"bytesInOutput":
|
|
11567
|
+
"bytesInOutput": 282
|
|
11573
11568
|
},
|
|
11574
11569
|
"../../node_modules/@lit/reactive-element/decorators/custom-element.js": {
|
|
11575
11570
|
"bytesInOutput": 186
|
|
@@ -11578,7 +11573,7 @@
|
|
|
11578
11573
|
"bytesInOutput": 0
|
|
11579
11574
|
},
|
|
11580
11575
|
"../../node_modules/@lit/reactive-element/decorators/property.js": {
|
|
11581
|
-
"bytesInOutput":
|
|
11576
|
+
"bytesInOutput": 423
|
|
11582
11577
|
},
|
|
11583
11578
|
"../../node_modules/@lit/reactive-element/decorators/state.js": {
|
|
11584
11579
|
"bytesInOutput": 42
|
|
@@ -11605,7 +11600,7 @@
|
|
|
11605
11600
|
"bytesInOutput": 0
|
|
11606
11601
|
},
|
|
11607
11602
|
"../../node_modules/@reddit/faceplate-ui/templates/_buttonBaseInternalsDoNotUse.js": {
|
|
11608
|
-
"bytesInOutput":
|
|
11603
|
+
"bytesInOutput": 2668
|
|
11609
11604
|
},
|
|
11610
11605
|
"../../node_modules/@reddit/faceplate-ui/templates/button.js": {
|
|
11611
11606
|
"bytesInOutput": 108
|
|
@@ -11737,7 +11732,7 @@
|
|
|
11737
11732
|
"bytesInOutput": 1178
|
|
11738
11733
|
},
|
|
11739
11734
|
"library/src/client/webDispatcher.ts": {
|
|
11740
|
-
"bytesInOutput":
|
|
11735
|
+
"bytesInOutput": 2190
|
|
11741
11736
|
},
|
|
11742
11737
|
"../../node_modules/@lit/localize/internal/str-tag.js": {
|
|
11743
11738
|
"bytesInOutput": 131
|
|
@@ -11797,10 +11792,10 @@
|
|
|
11797
11792
|
"bytesInOutput": 1710
|
|
11798
11793
|
},
|
|
11799
11794
|
"library/src/client/devvit-surface.ts": {
|
|
11800
|
-
"bytesInOutput":
|
|
11795
|
+
"bytesInOutput": 4129
|
|
11801
11796
|
}
|
|
11802
11797
|
},
|
|
11803
|
-
"bytes":
|
|
11798
|
+
"bytes": 4387888
|
|
11804
11799
|
}
|
|
11805
11800
|
}
|
|
11806
11801
|
}
|