@devvit/ui-renderer 0.11.8-next-2025-03-03-b6dc5fcf8.0 → 0.11.8-next-2025-03-03-a1521adcc.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/formbuilder/devvit-form-dialog.d.ts +1 -0
- package/client/formbuilder/devvit-form-dialog.d.ts.map +1 -1
- package/client/formbuilder/devvit-form-dialog.js +27 -7
- package/client/formbuilder/devvit-form-dialog.js.map +1 -1
- package/client/formbuilder/fields/renderBooleanField.d.ts +1 -0
- package/client/formbuilder/fields/renderBooleanField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderBooleanField.js +15 -10
- package/client/formbuilder/fields/renderBooleanField.js.map +1 -1
- package/client/formbuilder/fields/renderFieldLabel.js +1 -1
- package/client/formbuilder/fields/renderFieldLabel.js.map +1 -1
- package/client/formbuilder/fields/renderHelpText.d.ts.map +1 -1
- package/client/formbuilder/fields/renderHelpText.js +4 -1
- package/client/formbuilder/fields/renderHelpText.js.map +1 -1
- package/client/formbuilder/fields/renderImageField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderImageField.js +2 -7
- package/client/formbuilder/fields/renderImageField.js.map +1 -1
- package/client/formbuilder/fields/renderNumberField.js +1 -1
- package/client/formbuilder/fields/renderNumberField.js.map +1 -1
- package/client/formbuilder/fields/renderParagraphField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderParagraphField.js +2 -3
- package/client/formbuilder/fields/renderParagraphField.js.map +1 -1
- package/client/formbuilder/fields/renderSelectionField.d.ts +1 -2
- package/client/formbuilder/fields/renderSelectionField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderSelectionField.js +21 -15
- package/client/formbuilder/fields/renderSelectionField.js.map +1 -1
- package/client/formbuilder/fields/renderStringField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderStringField.js +0 -1
- package/client/formbuilder/fields/renderStringField.js.map +1 -1
- package/package.json +8 -8
- package/styles.js +1 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.d.ts +0 -18
- package/client/formbuilder/components/devvit-form-selection-dropdown.d.ts.map +0 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.js +0 -187
- package/client/formbuilder/components/devvit-form-selection-dropdown.js.map +0 -1
- package/client/formbuilder/components/devvit-form-selection-list.d.ts +0 -14
- package/client/formbuilder/components/devvit-form-selection-list.d.ts.map +0 -1
- package/client/formbuilder/components/devvit-form-selection-list.js +0 -112
- package/client/formbuilder/components/devvit-form-selection-list.js.map +0 -1
|
@@ -2,6 +2,7 @@ import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
|
2
2
|
import '@reddit/faceplate/components/faceplate-form.js';
|
|
3
3
|
import '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
4
4
|
import '@reddit/rpl-web/components/modal-card/rpl-modal-card';
|
|
5
|
+
import '@reddit/rpl-web/components/scrollbox/rpl-scrollbox';
|
|
5
6
|
import { UIEvent } from '@devvit/protos/types/devvit/ui/events/v1alpha/event.js';
|
|
6
7
|
import type { Form } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/form.js';
|
|
7
8
|
import { FaceplateForm } from '@reddit/faceplate/components/faceplate-form.js';
|
|
@@ -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,kEAAkE,CAAC;AAC1E,OAAO,gDAAgD,CAAC;AACxD,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-form-dialog.d.ts","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAC1E,OAAO,gDAAgD,CAAC;AACxD,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,oDAAoD,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAEjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6DAA6D,CAAC;AAKxF,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAO/E,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAUvC;;;;;;GAMG;AACH,qBACa,gBAAiB,SAAQ,UAAU;;IAE9C,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IAGvB,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAK7B,WAAoB,MAAM,8BAEzB;IAEK,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA8GnE,MAAM;CAyEhB"}
|
|
@@ -23,16 +23,19 @@ import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
|
23
23
|
import '@reddit/faceplate/components/faceplate-form.js';
|
|
24
24
|
import '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
25
25
|
import '@reddit/rpl-web/components/modal-card/rpl-modal-card';
|
|
26
|
+
import '@reddit/rpl-web/components/scrollbox/rpl-scrollbox';
|
|
26
27
|
import { UIEvent } from '@devvit/protos/types/devvit/ui/events/v1alpha/event.js';
|
|
27
28
|
import { FormFieldType } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/type.js';
|
|
28
29
|
import { FormFieldValue } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/value.js';
|
|
29
30
|
import { formKeyToHookId } from '@devvit/shared-types/useForm.js';
|
|
30
31
|
import { FaceplateForm } from '@reddit/faceplate/components/faceplate-form.js';
|
|
31
32
|
import { msg } from '@reddit/faceplate/lib/i18n/localize.js';
|
|
33
|
+
import { IconSize } from '@reddit/faceplate-ui/lib/IconSize.js';
|
|
32
34
|
import { button, ButtonSize } from '@reddit/faceplate-ui/templates/client/button.js';
|
|
35
|
+
import IconCloseOutline from '@reddit/faceplate-ui/templates/client/icons/icon-close-outline.js';
|
|
33
36
|
import { RPLDialog } from '@reddit/rpl-web/components/dialog/rpl-dialog';
|
|
34
37
|
import { html, LitElement } from 'lit';
|
|
35
|
-
import { customElement, property, query
|
|
38
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
36
39
|
import { when } from 'lit/directives/when.js';
|
|
37
40
|
import { styles } from '../../styles.js';
|
|
38
41
|
import { renderFormFields } from './fields/index.js';
|
|
@@ -88,12 +91,14 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
88
91
|
case FormFieldType.BOOLEAN:
|
|
89
92
|
fieldValue.boolValue = value === 'true' || value === 'on';
|
|
90
93
|
break;
|
|
91
|
-
case FormFieldType.SELECTION:
|
|
92
|
-
|
|
94
|
+
case FormFieldType.SELECTION: {
|
|
95
|
+
const selectedValues = f.selectedOptions.map((option) => option.value);
|
|
96
|
+
if (selectedValues.length === 0) {
|
|
93
97
|
continue;
|
|
94
98
|
}
|
|
95
|
-
fieldValue.selectionValue = { values:
|
|
99
|
+
fieldValue.selectionValue = { values: selectedValues };
|
|
96
100
|
break;
|
|
101
|
+
}
|
|
97
102
|
}
|
|
98
103
|
values[name] = fieldValue;
|
|
99
104
|
}
|
|
@@ -131,8 +136,12 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
131
136
|
this.form = undefined;
|
|
132
137
|
__classPrivateFieldSet(this, _DevvitFormDialog_idMap, {}, "f");
|
|
133
138
|
});
|
|
134
|
-
_DevvitFormDialog_renderTitle.set(this, () => html `<
|
|
135
|
-
|
|
139
|
+
_DevvitFormDialog_renderTitle.set(this, () => html `<div slot="title">
|
|
140
|
+
${msg(this.form?.title, {
|
|
141
|
+
desc: 'Title of the form',
|
|
142
|
+
})}
|
|
143
|
+
</div>`);
|
|
144
|
+
_DevvitFormDialog_renderDescription.set(this, () => html `<span>${this.form?.shortDescription}</span>`);
|
|
136
145
|
_DevvitFormDialog_renderButtons.set(this, () => html `
|
|
137
146
|
<div class="flex justify-end">
|
|
138
147
|
${button({
|
|
@@ -173,8 +182,18 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
173
182
|
const renderModalContent = html `<rpl-modal-card
|
|
174
183
|
class="max-h-[596px] min-w-[320px] w-full max-w-[480px]"
|
|
175
184
|
>
|
|
185
|
+
${when(this.form?.title, __classPrivateFieldGet(this, _DevvitFormDialog_renderTitle, "f"))}
|
|
186
|
+
<div slot="close-button">
|
|
187
|
+
${button({
|
|
188
|
+
appearance: 'secondary',
|
|
189
|
+
leadingIcon: IconCloseOutline({ size: IconSize.Small }),
|
|
190
|
+
size: ButtonSize.Small,
|
|
191
|
+
attributes: {
|
|
192
|
+
onclick: __classPrivateFieldGet(this, _DevvitFormDialog_closeForm, "f"),
|
|
193
|
+
},
|
|
194
|
+
})}
|
|
195
|
+
</div>
|
|
176
196
|
<div class="flex flex-col gap-y-sm" @keyup="${__classPrivateFieldGet(this, _DevvitFormDialog_onKeyUp, "f")}">
|
|
177
|
-
${when(this.form?.title, __classPrivateFieldGet(this, _DevvitFormDialog_renderTitle, "f"))}
|
|
178
197
|
${when(this.form?.shortDescription, __classPrivateFieldGet(this, _DevvitFormDialog_renderDescription, "f"))}
|
|
179
198
|
<faceplate-form
|
|
180
199
|
@faceplate-submit="${(ev) => ev.preventDefault()}"
|
|
@@ -191,6 +210,7 @@ let DevvitFormDialog = class DevvitFormDialog extends LitElement {
|
|
|
191
210
|
class="z-dialog w-[32rem] max-w-[480px] max-h-[720px] overflow-auto"
|
|
192
211
|
@rpl-dialog:after-hide="${__classPrivateFieldGet(this, _DevvitFormDialog_onDialogClosed, "f")}"
|
|
193
212
|
.litTemplateChildren="${renderModalContent}"
|
|
213
|
+
auto-close
|
|
194
214
|
>
|
|
195
215
|
</rpl-dialog>
|
|
196
216
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-form-dialog.js","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,kEAAkE,CAAC;AAC1E,OAAO,gDAAgD,CAAC;AACxD,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-form-dialog.js","sourceRoot":"","sources":["../../../library/src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,kEAAkE,CAAC;AAC1E,OAAO,gDAAgD,CAAC;AACxD,OAAO,8CAA8C,CAAC;AACtD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,oDAAoD,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAE/E,OAAO,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,gBAAgB,MAAM,mEAAmE,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAA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|
2
3
|
import type { FormField } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/field.js';
|
|
3
4
|
import type { TemplateResult } from 'lit';
|
|
4
5
|
export declare const renderBooleanField: (field: FormField) => TemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBooleanField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"renderBooleanField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;AACnE,OAAO,+DAA+D,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1C,eAAO,MAAM,kBAAkB,UAAW,SAAS,KAAG,cAcrD,CAAC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import '@reddit/faceplate-ui/components/faceplate-switch-input.js';
|
|
2
|
+
import '@reddit/faceplate-ui/components/faceplate-form-helper-text.js';
|
|
2
3
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
4
|
+
import { renderHelpText } from './renderHelpText.js';
|
|
3
5
|
export const renderBooleanField = (field) => html `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
<div class="py-xs border-0">
|
|
7
|
+
<faceplate-switch-input
|
|
8
|
+
id="${field.fieldId}"
|
|
9
|
+
name="${field.fieldId}"
|
|
10
|
+
class="border-0"
|
|
11
|
+
?required="${field.required}"
|
|
12
|
+
?checked="${field.defaultValue?.boolValue}"
|
|
13
|
+
?disabled="${field.disabled}"
|
|
14
|
+
>
|
|
15
|
+
${field.label}
|
|
16
|
+
</faceplate-switch-input>
|
|
17
|
+
${renderHelpText(field.helpText)}
|
|
18
|
+
</div>
|
|
14
19
|
`;
|
|
15
20
|
//# sourceMappingURL=renderBooleanField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBooleanField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"renderBooleanField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;AACnE,OAAO,+DAA+D,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAgB,EAAkB,EAAE,CAAC,IAAI,CAAA;;;YAGhE,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;mBAER,KAAK,CAAC,QAAQ;kBACf,KAAK,CAAC,YAAY,EAAE,SAAS;mBAC5B,KAAK,CAAC,QAAQ;;QAEzB,KAAK,CAAC,KAAK;;MAEb,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC;;CAEnC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
2
2
|
const isRequired = (field) => field.required === true ? html `<span class="text-danger-content">*</span>` : html ``;
|
|
3
|
-
export const renderFieldLabel = (field, classnames) => html `<label for="${field.fieldId}" class="${classnames || ''}"
|
|
3
|
+
export const renderFieldLabel = (field, classnames) => html `<label for="${field.fieldId}" class="normal-case ${classnames || ''}"
|
|
4
4
|
>${field.label}${isRequired(field)}</label
|
|
5
5
|
>`;
|
|
6
6
|
//# sourceMappingURL=renderFieldLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFieldLabel.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderFieldLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAkB,EAAE,CACtD,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,4CAA4C,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC;AAEtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAE,UAAmB,EAAkB,EAAE,CACxF,IAAI,CAAA,eAAe,KAAK,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"renderFieldLabel.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderFieldLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAkB,EAAE,CACtD,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,4CAA4C,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC;AAEtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAE,UAAmB,EAAkB,EAAE,CACxF,IAAI,CAAA,eAAe,KAAK,CAAC,OAAO,wBAAwB,UAAU,IAAI,EAAE;OACnE,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHelpText.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AAGvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,cAAc,cAAe,MAAM,GAAG,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"renderHelpText.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AAGvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,cAAc,cAAe,MAAM,GAAG,SAAS,KAAG,cAMnD,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import '@reddit/faceplate-ui/components/faceplate-form-helper-text.js';
|
|
2
2
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
3
3
|
export const renderHelpText = (helpText) => helpText
|
|
4
|
-
? html `<faceplate-form-helper-text
|
|
4
|
+
? html `<faceplate-form-helper-text
|
|
5
|
+
class="px-md"
|
|
6
|
+
placeholder="${helpText}"
|
|
7
|
+
></faceplate-form-helper-text>`
|
|
5
8
|
: html ``;
|
|
6
9
|
//# sourceMappingURL=renderHelpText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHelpText.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA6B,EAAkB,EAAE,CAC9E,QAAQ;IACN,CAAC,CAAC,IAAI,CAAA,
|
|
1
|
+
{"version":3,"file":"renderHelpText.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA6B,EAAkB,EAAE,CAC9E,QAAQ;IACN,CAAC,CAAC,IAAI,CAAA;;uBAEa,QAAQ;qCACM;IACjC,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderImageField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderImageField.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAG9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"renderImageField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderImageField.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAG9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1C,eAAO,MAAM,gBAAgB,UAAW,SAAS,KAAG,cAgBnD,CAAC"}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import '../components/image-field/devvit-image-field.js';
|
|
2
2
|
import { msg } from '@lit/localize';
|
|
3
3
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
4
|
-
import { renderFieldLabel } from './renderFieldLabel.js';
|
|
5
4
|
import { renderHelpText } from './renderHelpText.js';
|
|
6
5
|
export const renderImageField = (field) => {
|
|
7
6
|
return html ` <div>
|
|
8
|
-
${renderFieldLabel(field, 'font-semibold text-14 text-neutral-content-strong')}
|
|
9
|
-
${renderHelpText(field.helpText)}
|
|
10
7
|
<devvit-form-image-field
|
|
11
8
|
class="flex mt-xs"
|
|
12
9
|
name="${field.fieldId}"
|
|
13
10
|
.field="${field}"
|
|
14
11
|
></devvit-form-image-field>
|
|
15
|
-
<div class="
|
|
12
|
+
<div class="text-12 text-neutral-content-weak mt-xs px-md">
|
|
16
13
|
<span
|
|
17
14
|
>${msg('Formats: JPG, PNG, GIF, WEBP', {
|
|
18
15
|
desc: 'Supported formats for image upload',
|
|
19
16
|
})}</span
|
|
20
17
|
>
|
|
21
|
-
<span
|
|
22
|
-
>${msg('Max size: 20 MB', { desc: 'Max file size for image upload is 20 megabytes' })}</span
|
|
23
|
-
>
|
|
24
18
|
</div>
|
|
19
|
+
${renderHelpText(field.helpText)}
|
|
25
20
|
</div>`;
|
|
26
21
|
};
|
|
27
22
|
//# sourceMappingURL=renderImageField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderImageField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderImageField.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"renderImageField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderImageField.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,kEAAkE,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACnE,OAAO,IAAI,CAAA;;;cAGC,KAAK,CAAC,OAAO;gBACX,KAAK;;;;WAIV,GAAG,CAAC,8BAA8B,EAAE;QACrC,IAAI,EAAE,oCAAoC;KAC3C,CAAC;;;MAGJ,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC;SAC3B,CAAC;AACV,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const renderNumberField = (field) => {
|
|
|
14
14
|
step="${ifDefined(step)}"
|
|
15
15
|
?required="${field.required}"
|
|
16
16
|
?disabled="${field.disabled}"
|
|
17
|
-
|
|
17
|
+
helper-text-placeholder="${ifDefined(field.helpText)}"
|
|
18
18
|
>
|
|
19
19
|
<span slot="label">${field.label}</span>
|
|
20
20
|
</faceplate-text-input>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderNumberField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderNumberField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAGjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACpE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,YAAY,IAAI,EAAE,CAAC;IACjE,OAAO,IAAI,CAAA;;YAED,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;;eAGZ,KAAK,CAAC,YAAY,EAAE,WAAW,IAAI,CAAC;aACtC,SAAS,CAAC,GAAG,CAAC;aACd,SAAS,CAAC,GAAG,CAAC;cACb,SAAS,CAAC,IAAI,CAAC;mBACV,KAAK,CAAC,QAAQ;mBACd,KAAK,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"renderNumberField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderNumberField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAGjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACpE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,YAAY,IAAI,EAAE,CAAC;IACjE,OAAO,IAAI,CAAA;;YAED,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;;eAGZ,KAAK,CAAC,YAAY,EAAE,WAAW,IAAI,CAAC;aACtC,SAAS,CAAC,GAAG,CAAC;aACd,SAAS,CAAC,GAAG,CAAC;cACb,SAAS,CAAC,IAAI,CAAC;mBACV,KAAK,CAAC,QAAQ;mBACd,KAAK,CAAC,QAAQ;iCACA,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;2BAE/B,KAAK,CAAC,KAAK;;GAEnC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderParagraphField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,6DAA6D,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"renderParagraphField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,6DAA6D,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,oBAAoB,UAAW,SAAS,KAAG,cAmBvD,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '@reddit/faceplate-ui/components/faceplate-form-helper-text.js';
|
|
2
2
|
import '@reddit/faceplate-ui/components/faceplate-textarea-input.js';
|
|
3
3
|
import { html, ifDefined } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
4
|
-
import { renderHelpText } from './renderHelpText.js';
|
|
5
4
|
export const renderParagraphField = (field) => {
|
|
6
5
|
const { lineHeight, maxCharacters, placeholder } = field.fieldConfig?.paragraphConfig ?? {};
|
|
7
6
|
return html `
|
|
@@ -12,14 +11,14 @@ export const renderParagraphField = (field) => {
|
|
|
12
11
|
value="${ifDefined(field.defaultValue?.stringValue)}"
|
|
13
12
|
placeholder="${ifDefined(placeholder)}"
|
|
14
13
|
rows="${ifDefined(lineHeight)}"
|
|
14
|
+
size="expanded"
|
|
15
15
|
maxlength="${ifDefined(maxCharacters)}"
|
|
16
16
|
?disabled="${field.disabled}"
|
|
17
17
|
?required="${field.required}"
|
|
18
|
-
|
|
18
|
+
helper-text-placeholder="${ifDefined(field.helpText)}"
|
|
19
19
|
>
|
|
20
20
|
<span slot="label">${field.label}</span>
|
|
21
21
|
</faceplate-textarea-input>
|
|
22
|
-
${renderHelpText(field.helpText)}
|
|
23
22
|
`;
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=renderParagraphField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderParagraphField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,6DAA6D,CAAC;AAGrE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,
|
|
1
|
+
{"version":3,"file":"renderParagraphField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAAA,OAAO,+DAA+D,CAAC;AACvE,OAAO,6DAA6D,CAAC;AAGrE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACvE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,eAAe,IAAI,EAAE,CAAC;IAC5F,OAAO,IAAI,CAAA;;YAED,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;eAEZ,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC;qBACpC,SAAS,CAAC,WAAW,CAAC;cAC7B,SAAS,CAAC,UAAU,CAAC;;mBAEhB,SAAS,CAAC,aAAa,CAAC;mBACxB,KAAK,CAAC,QAAQ;mBACd,KAAK,CAAC,QAAQ;iCACA,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;2BAE/B,KAAK,CAAC,KAAK;;GAEnC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../components/devvit-form-selection-list.js';
|
|
1
|
+
import '@reddit/faceplate-ui/components/faceplate-select-text-input.js';
|
|
3
2
|
import type { FormField } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/field.js';
|
|
4
3
|
import type { TemplateResult } from 'lit';
|
|
5
4
|
export declare const renderSelectionField: (field: FormField) => TemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderSelectionField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"renderSelectionField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"AAAA,OAAO,gEAAgE,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAG9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,oBAAoB,UAAW,SAAS,KAAG,cAuBvD,CAAC"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
4
|
-
import { renderFieldLabel } from './renderFieldLabel.js';
|
|
1
|
+
import '@reddit/faceplate-ui/components/faceplate-select-text-input.js';
|
|
2
|
+
import { FaceplateTextField } from '@reddit/faceplate-ui/components/faceplate-text-input.js';
|
|
3
|
+
import { html, ifDefined } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
5
4
|
export const renderSelectionField = (field) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const items = field.fieldConfig?.selectionConfig?.choices.map((reason) => html `<faceplate-option
|
|
6
|
+
value="${reason.value}"
|
|
7
|
+
display-text="${reason.label}"
|
|
8
|
+
></faceplate-option>`);
|
|
9
|
+
return html `<faceplate-select-text-input
|
|
10
|
+
readonly
|
|
11
|
+
id="${field.fieldId}"
|
|
12
|
+
name="${field.fieldId}"
|
|
13
|
+
class="py-xs border-0"
|
|
14
|
+
label="${field.fieldId}"
|
|
15
|
+
value="${ifDefined(field.defaultValue?.stringValue)}"
|
|
16
|
+
?required="${field.required}"
|
|
17
|
+
?multiple="${field.fieldConfig?.selectionConfig?.multiSelect}"
|
|
18
|
+
helper-text-placeholder="${ifDefined(field.helpText)}"
|
|
19
|
+
>
|
|
20
|
+
<span slot="clearButton">${FaceplateTextField.clearButton()}</span>
|
|
21
|
+
${items}</faceplate-select-text-input
|
|
22
|
+
>`;
|
|
17
23
|
};
|
|
18
24
|
//# sourceMappingURL=renderSelectionField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderSelectionField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"renderSelectionField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"AAAA,OAAO,gEAAgE,CAAC;AAGxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACvE,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,eAAe,EAAE,OAAO,CAAC,GAAG,CAC3D,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,CAAA;iBACO,MAAM,CAAC,KAAK;wBACL,MAAM,CAAC,KAAK;2BACT,CACxB,CAAC;IAEF,OAAO,IAAI,CAAA;;UAEH,KAAK,CAAC,OAAO;YACX,KAAK,CAAC,OAAO;;aAEZ,KAAK,CAAC,OAAO;aACb,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC;iBACtC,KAAK,CAAC,QAAQ;iBACd,KAAK,CAAC,WAAW,EAAE,eAAe,EAAE,WAAW;+BACjC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;+BAEzB,kBAAkB,CAAC,WAAW,EAAE;MACzD,KAAK;IACP,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStringField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,iBAAiB,UAAW,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"renderStringField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,eAAO,MAAM,iBAAiB,UAAW,SAAS,KAAG,cAmBpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStringField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAGjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACpE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,YAAY,IAAI,EAAE,CAAC;IACpF,OAAO,IAAI,CAAA;;YAED,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;;eAGZ,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC;qBACpC,SAAS,CAAC,WAAW,CAAC;iCACV,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;mBACvC,SAAS,CAAC,SAAS,CAAC;mBACpB,SAAS,CAAC,SAAS,CAAC;mBACpB,KAAK,CAAC,QAAQ;mBACd,KAAK,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"renderStringField.js","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAAA,OAAO,yDAAyD,CAAC;AAGjE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kEAAkE,CAAC;AAGnG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAkB,EAAE;IACpE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,YAAY,IAAI,EAAE,CAAC;IACpF,OAAO,IAAI,CAAA;;YAED,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,OAAO;;;eAGZ,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC;qBACpC,SAAS,CAAC,WAAW,CAAC;iCACV,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;mBACvC,SAAS,CAAC,SAAS,CAAC;mBACpB,SAAS,CAAC,SAAS,CAAC;mBACpB,KAAK,CAAC,QAAQ;mBACd,KAAK,CAAC,QAAQ;;2BAEN,KAAK,CAAC,KAAK;;GAEnC,CAAC;AACJ,CAAC,CAAC"}
|
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-a1521adcc.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-a1521adcc.0",
|
|
64
|
+
"@devvit/runtime-lite": "0.11.8-next-2025-03-03-a1521adcc.0",
|
|
65
|
+
"@devvit/shared-types": "0.11.8-next-2025-03-03-a1521adcc.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-a1521adcc.0",
|
|
97
|
+
"@devvit/repo-tools": "0.11.8-next-2025-03-03-a1521adcc.0",
|
|
98
|
+
"@devvit/tsconfig": "0.11.8-next-2025-03-03-a1521adcc.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": "7e6debb89b88f3cedb810d435c7d2c489d5072e7"
|
|
146
146
|
}
|