@devvit/ui-renderer 0.10.5-next-2023-09-25-4c7c9d091.0 → 0.10.5-next-2023-09-25-63e6c6310.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,10 +1,16 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
3
3
|
import { FaceplateDialog } from '@reddit/faceplate-ui/components/faceplate-dialog.js';
|
|
4
|
+
import { FaceplateEvent } from '@reddit/faceplate/event-types.js';
|
|
4
5
|
import { FaceplateForm } from '@reddit/faceplate/components/faceplate-form.js';
|
|
5
6
|
import { Form, UIEvent } from '@devvit/protos';
|
|
6
7
|
import '@reddit/faceplate-ui/components/faceplate-dialog';
|
|
7
8
|
import '@reddit/faceplate/components/faceplate-form.js';
|
|
9
|
+
export interface DevvitFormDialogEvent extends FaceplateEvent<'devvit-form-dialog-event'> {
|
|
10
|
+
detail: {
|
|
11
|
+
open?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
8
14
|
export declare class DevvitFormDialog extends LitElement {
|
|
9
15
|
#private;
|
|
10
16
|
form: Form | undefined;
|
|
@@ -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,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvD,OAAO,kEAAkE,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-form-dialog.d.ts","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvD,OAAO,kEAAkE,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAwB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,aAAa,EAAoB,MAAM,gDAAgD,CAAC;AAGjG,OAAO,EAAE,IAAI,EAA4C,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKzF,OAAO,kDAAkD,CAAC;AAC1D,OAAO,gDAAgD,CAAC;AAIxD,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,0BAA0B,CAAC;IACvF,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED,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;IAsFpD,MAAM;CAgDhB"}
|
|
@@ -18,7 +18,7 @@ var __classPrivateFieldSet = (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 _DevvitFormDialog_onEvent, _DevvitFormDialog_idMap, _DevvitFormDialog_makeIdMap, _DevvitFormDialog_collectValues, _DevvitFormDialog_submitClicked, _DevvitFormDialog_cancelClicked, _DevvitFormDialog_closeDialog, _DevvitFormDialog_renderTitle, _DevvitFormDialog_renderDescription, _DevvitFormDialog_renderButtons;
|
|
21
|
+
var _DevvitFormDialog_onEvent, _DevvitFormDialog_idMap, _DevvitFormDialog_makeIdMap, _DevvitFormDialog_collectValues, _DevvitFormDialog_submitClicked, _DevvitFormDialog_cancelClicked, _DevvitFormDialog_closeDialog, _DevvitFormDialog_dispatchFormStatusToHost, _DevvitFormDialog_renderTitle, _DevvitFormDialog_renderDescription, _DevvitFormDialog_renderButtons;
|
|
22
22
|
import { html, LitElement } from 'lit';
|
|
23
23
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
24
24
|
import { when } from 'lit/directives/when.js';
|
|
@@ -27,6 +27,7 @@ import { button, ButtonSize } from '@reddit/faceplate-ui/templates/button.js';
|
|
|
27
27
|
import { FaceplateDialog } from '@reddit/faceplate-ui/components/faceplate-dialog.js';
|
|
28
28
|
import { msg } from '@reddit/faceplate/lib/i18n/localize.js';
|
|
29
29
|
import { FaceplateForm } from '@reddit/faceplate/components/faceplate-form.js';
|
|
30
|
+
import { customEvent } from '@reddit/faceplate/lib/custom-event.js';
|
|
30
31
|
import { FormFieldType, FormFieldValue, UIEvent } from '@devvit/protos';
|
|
31
32
|
import { renderFormFields } from './fields/index.js';
|
|
32
33
|
import { styles } from '../../styles.js';
|
|
@@ -99,6 +100,10 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
99
100
|
this.$dialog?.close();
|
|
100
101
|
this.form = undefined;
|
|
101
102
|
__classPrivateFieldSet(this, _DevvitFormDialog_idMap, {}, "f");
|
|
103
|
+
__classPrivateFieldGet(this, _DevvitFormDialog_dispatchFormStatusToHost, "f").call(this, { open: false });
|
|
104
|
+
});
|
|
105
|
+
_DevvitFormDialog_dispatchFormStatusToHost.set(this, ({ open }) => {
|
|
106
|
+
this.dispatchEvent(customEvent('devvit-form-dialog-event', { open }));
|
|
102
107
|
});
|
|
103
108
|
_DevvitFormDialog_renderTitle.set(this, () => html `<span class="text-32 py-sm">${this.form?.title}</span>`);
|
|
104
109
|
_DevvitFormDialog_renderDescription.set(this, () => html `<span class="pb-md">${this.form?.shortDescription}</span>`);
|
|
@@ -134,6 +139,7 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
134
139
|
__classPrivateFieldSet(this, _DevvitFormDialog_idMap, __classPrivateFieldGet(this, _DevvitFormDialog_makeIdMap, "f").call(this, form.fields), "f");
|
|
135
140
|
__classPrivateFieldSet(this, _DevvitFormDialog_onEvent, onEvent, "f");
|
|
136
141
|
this.$dialog.showModal();
|
|
142
|
+
__classPrivateFieldGet(this, _DevvitFormDialog_dispatchFormStatusToHost, "f").call(this, { open: true });
|
|
137
143
|
}
|
|
138
144
|
}
|
|
139
145
|
render() {
|
|
@@ -155,7 +161,7 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
155
161
|
`;
|
|
156
162
|
}
|
|
157
163
|
};
|
|
158
|
-
_DevvitFormDialog_onEvent = new WeakMap(), _DevvitFormDialog_idMap = new WeakMap(), _DevvitFormDialog_makeIdMap = new WeakMap(), _DevvitFormDialog_collectValues = new WeakMap(), _DevvitFormDialog_submitClicked = new WeakMap(), _DevvitFormDialog_cancelClicked = new WeakMap(), _DevvitFormDialog_closeDialog = new WeakMap(), _DevvitFormDialog_renderTitle = new WeakMap(), _DevvitFormDialog_renderDescription = new WeakMap(), _DevvitFormDialog_renderButtons = new WeakMap();
|
|
164
|
+
_DevvitFormDialog_onEvent = new WeakMap(), _DevvitFormDialog_idMap = new WeakMap(), _DevvitFormDialog_makeIdMap = new WeakMap(), _DevvitFormDialog_collectValues = new WeakMap(), _DevvitFormDialog_submitClicked = new WeakMap(), _DevvitFormDialog_cancelClicked = new WeakMap(), _DevvitFormDialog_closeDialog = new WeakMap(), _DevvitFormDialog_dispatchFormStatusToHost = new WeakMap(), _DevvitFormDialog_renderTitle = new WeakMap(), _DevvitFormDialog_renderDescription = new WeakMap(), _DevvitFormDialog_renderButtons = new WeakMap();
|
|
159
165
|
__decorate([
|
|
160
166
|
property({ attribute: false }),
|
|
161
167
|
__metadata("design:type", Object)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/ui-renderer",
|
|
3
|
-
"version": "0.10.5-next-2023-09-25-
|
|
3
|
+
"version": "0.10.5-next-2023-09-25-63e6c6310.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"types": "./index.d.ts",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@devvit/protos": "0.10.5-next-2023-09-25-
|
|
52
|
-
"@devvit/runtime-lite": "0.10.5-next-2023-09-25-
|
|
53
|
-
"@devvit/runtimes": "0.10.5-next-2023-09-25-
|
|
51
|
+
"@devvit/protos": "0.10.5-next-2023-09-25-63e6c6310.0",
|
|
52
|
+
"@devvit/runtime-lite": "0.10.5-next-2023-09-25-63e6c6310.0",
|
|
53
|
+
"@devvit/runtimes": "0.10.5-next-2023-09-25-63e6c6310.0",
|
|
54
54
|
"@lottiefiles/lottie-player": "1.7.1",
|
|
55
55
|
"p-queue": "7.3.4",
|
|
56
56
|
"rxjs": "7.5.7"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@devvit/eslint-config": "0.10.4",
|
|
79
79
|
"@devvit/repo-tools": "0.10.4",
|
|
80
|
-
"@devvit/tsconfig": "0.10.5-next-2023-09-25-
|
|
80
|
+
"@devvit/tsconfig": "0.10.5-next-2023-09-25-63e6c6310.0",
|
|
81
81
|
"@lit/localize": "0.11.4",
|
|
82
82
|
"@open-wc/testing-helpers": "2.3.0",
|
|
83
83
|
"@reddit/baseplate": "0.14.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"directory": "dist"
|
|
103
103
|
},
|
|
104
104
|
"source": "./src/index.ts",
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "5dbf54b01a2a30d73abcd366f4fa080cf6bfd290"
|
|
106
106
|
}
|