@devvit/ui-renderer 0.11.8-next-2025-03-03-853279042.0 → 0.11.8-next-2025-03-03-9bd38a220.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.
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
2
|
+
import '@reddit/rpl-web/components/modal-card/rpl-modal-card';
|
|
3
|
+
import type { RPLDialog } from '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
4
|
+
import type { TemplateResult } from 'lit';
|
|
2
5
|
import { LitElement } from 'lit';
|
|
3
6
|
export declare class DevvitNavigateOffsiteDialog extends LitElement {
|
|
4
7
|
#private;
|
|
5
8
|
url: string;
|
|
6
|
-
$dialog?:
|
|
9
|
+
$dialog?: RPLDialog;
|
|
7
10
|
static get styles(): import("lit").CSSResult[];
|
|
8
11
|
show(url: string): void;
|
|
9
|
-
render():
|
|
12
|
+
render(): TemplateResult<1>;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=devvit-navigate-offsite-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-navigate-offsite-dialog.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-navigate-offsite-dialog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devvit-navigate-offsite-dialog.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-navigate-offsite-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC,qBACa,2BAA4B,SAAQ,UAAU;;IAEzD,GAAG,EAAE,MAAM,CAAM;IAGjB,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,WAAoB,MAAM,8BAEzB;IAED,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAcd,MAAM;CA4DhB"}
|
|
@@ -13,9 +13,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
14
|
};
|
|
15
15
|
var _DevvitNavigateOffsiteDialog_cancelNavigation, _DevvitNavigateOffsiteDialog_completeNavigation;
|
|
16
|
+
import '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
17
|
+
import '@reddit/rpl-web/components/modal-card/rpl-modal-card';
|
|
16
18
|
import { msg } from '@lit/localize';
|
|
17
|
-
import {
|
|
19
|
+
import { IconSize } from '@reddit/faceplate-ui/lib/IconSize.js';
|
|
18
20
|
import { button, ButtonSize } from '@reddit/faceplate-ui/templates/client/button.js';
|
|
21
|
+
import IconCloseOutline from '@reddit/faceplate-ui/templates/client/icons/icon-close-outline.js';
|
|
19
22
|
import { html, LitElement } from 'lit';
|
|
20
23
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
21
24
|
import { styles } from '../styles.js';
|
|
@@ -24,11 +27,11 @@ let DevvitNavigateOffsiteDialog = class DevvitNavigateOffsiteDialog extends LitE
|
|
|
24
27
|
super(...arguments);
|
|
25
28
|
this.url = '';
|
|
26
29
|
_DevvitNavigateOffsiteDialog_cancelNavigation.set(this, () => {
|
|
27
|
-
this.$dialog?.
|
|
30
|
+
this.$dialog?.hide();
|
|
28
31
|
});
|
|
29
32
|
_DevvitNavigateOffsiteDialog_completeNavigation.set(this, () => {
|
|
30
33
|
window.open(this.url, '_blank');
|
|
31
|
-
this.$dialog?.
|
|
34
|
+
this.$dialog?.hide();
|
|
32
35
|
});
|
|
33
36
|
}
|
|
34
37
|
static get styles() {
|
|
@@ -39,22 +42,33 @@ let DevvitNavigateOffsiteDialog = class DevvitNavigateOffsiteDialog extends LitE
|
|
|
39
42
|
this.$dialog?.showModal();
|
|
40
43
|
}
|
|
41
44
|
render() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
const renderModalContent = html `<rpl-modal-card
|
|
46
|
+
class="max-h-[596px] sm:min-w-[480px] max-w-full"
|
|
47
|
+
>
|
|
48
|
+
<div slot="title">
|
|
49
|
+
${msg('Continue to external link?', {
|
|
47
50
|
desc: 'Title for dialog asking for permission to navigate off of Reddit',
|
|
48
51
|
})}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
</div>
|
|
53
|
+
<div slot="close-button">
|
|
54
|
+
${button({
|
|
55
|
+
appearance: 'secondary',
|
|
56
|
+
leadingIcon: IconCloseOutline({ size: IconSize.Small }),
|
|
57
|
+
size: ButtonSize.Small,
|
|
58
|
+
attributes: {
|
|
59
|
+
onclick: __classPrivateFieldGet(this, _DevvitNavigateOffsiteDialog_cancelNavigation, "f"),
|
|
60
|
+
},
|
|
61
|
+
})}
|
|
62
|
+
</div>
|
|
63
|
+
<div class="flex flex-col gap-sm w-[32rem] max-w-full">
|
|
64
|
+
<span>${this.url}</span>
|
|
65
|
+
<p>
|
|
66
|
+
${msg('This link leads to an external site. We cannot guarantee the security on the external site, nor verify its contents.', {
|
|
53
67
|
desc: 'Dialog message informing the user they are about to leave Reddit and that we cannot vouch for the contents of the destination',
|
|
54
68
|
})}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
</p>
|
|
70
|
+
<div class="flex flex-row justify-end gap-sm">
|
|
71
|
+
${button({
|
|
58
72
|
appearance: 'secondary',
|
|
59
73
|
size: ButtonSize.Medium,
|
|
60
74
|
children: msg('Cancel', { desc: 'Cancel navigation' }),
|
|
@@ -62,7 +76,7 @@ let DevvitNavigateOffsiteDialog = class DevvitNavigateOffsiteDialog extends LitE
|
|
|
62
76
|
onclick: __classPrivateFieldGet(this, _DevvitNavigateOffsiteDialog_cancelNavigation, "f"),
|
|
63
77
|
},
|
|
64
78
|
})}
|
|
65
|
-
|
|
79
|
+
${button({
|
|
66
80
|
appearance: 'primary',
|
|
67
81
|
size: ButtonSize.Medium,
|
|
68
82
|
children: msg('Continue', { desc: 'Continue navigating to the external site' }),
|
|
@@ -70,9 +84,17 @@ let DevvitNavigateOffsiteDialog = class DevvitNavigateOffsiteDialog extends LitE
|
|
|
70
84
|
onclick: __classPrivateFieldGet(this, _DevvitNavigateOffsiteDialog_completeNavigation, "f"),
|
|
71
85
|
},
|
|
72
86
|
})}
|
|
73
|
-
</div>
|
|
74
87
|
</div>
|
|
75
|
-
</
|
|
88
|
+
</div>
|
|
89
|
+
</rpl-modal-card>`;
|
|
90
|
+
return html `
|
|
91
|
+
<rpl-dialog
|
|
92
|
+
id="devvit-navigate-to-dialog"
|
|
93
|
+
dialog-id="devvit-navigate-to-dialog"
|
|
94
|
+
class="z-dialog w-[32rem] max-w-[480px] max-h-[720px] overflow-auto"
|
|
95
|
+
.litTemplateChildren="${renderModalContent}"
|
|
96
|
+
>
|
|
97
|
+
</rpl-dialog>
|
|
76
98
|
`;
|
|
77
99
|
}
|
|
78
100
|
};
|
|
@@ -83,8 +105,8 @@ __decorate([
|
|
|
83
105
|
__metadata("design:type", String)
|
|
84
106
|
], DevvitNavigateOffsiteDialog.prototype, "url", void 0);
|
|
85
107
|
__decorate([
|
|
86
|
-
query('
|
|
87
|
-
__metadata("design:type",
|
|
108
|
+
query('rpl-dialog', true),
|
|
109
|
+
__metadata("design:type", Function)
|
|
88
110
|
], DevvitNavigateOffsiteDialog.prototype, "$dialog", void 0);
|
|
89
111
|
DevvitNavigateOffsiteDialog = __decorate([
|
|
90
112
|
customElement('devvit-navigate-offsite-dialog')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-navigate-offsite-dialog.js","sourceRoot":"","sources":["../../library/src/client/devvit-navigate-offsite-dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"devvit-navigate-offsite-dialog.js","sourceRoot":"","sources":["../../library/src/client/devvit-navigate-offsite-dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;AAE9D,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,gBAAgB,MAAM,mEAAmE,CAAC;AAGjG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG/B,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAU;IAApD;;QAEL,QAAG,GAAW,EAAE,CAAC;QAcjB,wDAAoB,GAAS,EAAE;YAC7B,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACvB,CAAC,EAAC;QAEF,0DAAsB,GAAS,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACvB,CAAC,EAAC;IA8DJ,CAAC;IA9EC,MAAM,KAAc,MAAM;QACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,GAAW;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;IAC5B,CAAC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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/ui-renderer",
|
|
3
|
-
"version": "0.11.8-next-2025-03-03-
|
|
3
|
+
"version": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"types": "./index.d.ts",
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@devvit/multiplatform": "0.0.1-20250218-2f1c7a2a",
|
|
63
|
-
"@devvit/protos": "0.11.8-next-2025-03-03-
|
|
64
|
-
"@devvit/runtime-lite": "0.11.8-next-2025-03-03-
|
|
65
|
-
"@devvit/shared-types": "0.11.8-next-2025-03-03-
|
|
63
|
+
"@devvit/protos": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
64
|
+
"@devvit/runtime-lite": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
65
|
+
"@devvit/shared-types": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
66
66
|
"compare-versions": "6.1.1",
|
|
67
67
|
"nice-grpc-web": "3.3.3",
|
|
68
68
|
"p-queue": "7.3.4",
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@ampproject/filesize": "4.3.0",
|
|
96
|
-
"@devvit/public-api": "0.11.8-next-2025-03-03-
|
|
97
|
-
"@devvit/repo-tools": "0.11.8-next-2025-03-03-
|
|
98
|
-
"@devvit/tsconfig": "0.11.8-next-2025-03-03-
|
|
96
|
+
"@devvit/public-api": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
97
|
+
"@devvit/repo-tools": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
98
|
+
"@devvit/tsconfig": "0.11.8-next-2025-03-03-9bd38a220.0",
|
|
99
99
|
"@lit-labs/ssr": "^2.2.3",
|
|
100
100
|
"@lit/localize": "0.11.4",
|
|
101
101
|
"@open-wc/testing-helpers": "2.3.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"source": "./src/index.ts",
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "f3b529c839ac2babb22579e06870b834dd552b90"
|
|
146
146
|
}
|