@devvit/ui-renderer 0.9.3 → 0.9.5
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/blocks/attributes.d.ts +1 -1
- package/blocks/attributes.d.ts.map +1 -1
- package/blocks/attributes.js +3 -3
- package/blocks/components/devvit-blocks-renderer.d.ts +15 -0
- package/blocks/components/devvit-blocks-renderer.d.ts.map +1 -0
- package/blocks/components/devvit-blocks-renderer.js +42 -0
- package/blocks/components/devvit-blocks-webview.d.ts.map +1 -1
- package/blocks/index.d.ts.map +1 -1
- package/blocks/templates/index.d.ts +1 -11
- package/blocks/templates/index.d.ts.map +1 -1
- package/blocks/templates/index.js +1 -38
- package/blocks/templates/renderAnimationBlock.d.ts +2 -1
- package/blocks/templates/renderAnimationBlock.d.ts.map +1 -1
- package/blocks/templates/renderAnimationBlock.js +2 -1
- package/blocks/templates/renderAvatarBlock.d.ts +1 -1
- package/blocks/templates/renderAvatarBlock.d.ts.map +1 -1
- package/blocks/templates/renderAvatarBlock.js +1 -1
- package/blocks/templates/renderBlock.d.ts +2 -1
- package/blocks/templates/renderBlock.d.ts.map +1 -1
- package/blocks/templates/renderBlock.js +22 -3
- package/blocks/templates/renderButtonBlock.d.ts +1 -1
- package/blocks/templates/renderButtonBlock.d.ts.map +1 -1
- package/blocks/templates/renderButtonBlock.js +5 -3
- package/blocks/templates/renderContext.d.ts +8 -0
- package/blocks/templates/renderContext.d.ts.map +1 -0
- package/blocks/templates/renderContext.js +1 -0
- package/blocks/templates/renderFullSnooBlock.d.ts +1 -1
- package/blocks/templates/renderFullSnooBlock.d.ts.map +1 -1
- package/blocks/templates/renderFullSnooBlock.js +1 -1
- package/blocks/templates/renderIconBlock.d.ts +1 -1
- package/blocks/templates/renderIconBlock.d.ts.map +1 -1
- package/blocks/templates/renderIconBlock.js +14 -5
- package/blocks/templates/renderImageBlock.d.ts +1 -1
- package/blocks/templates/renderImageBlock.d.ts.map +1 -1
- package/blocks/templates/renderImageBlock.js +1 -1
- package/blocks/templates/renderSpacerBlock.d.ts +1 -1
- package/blocks/templates/renderSpacerBlock.d.ts.map +1 -1
- package/blocks/templates/renderSpacerBlock.js +1 -1
- package/blocks/templates/renderStackBlock.d.ts +2 -2
- package/blocks/templates/renderStackBlock.d.ts.map +1 -1
- package/blocks/templates/renderStackBlock.js +2 -3
- package/blocks/templates/renderTextBlock.d.ts +1 -1
- package/blocks/templates/renderTextBlock.d.ts.map +1 -1
- package/blocks/templates/renderTextBlock.js +19 -21
- package/blocks/templates/renderWebViewBlock.d.ts +1 -1
- package/blocks/templates/renderWebViewBlock.d.ts.map +1 -1
- package/blocks/templates/renderWebViewBlock.js +1 -1
- package/blocks/templates/util.d.ts +7 -0
- package/blocks/templates/util.d.ts.map +1 -0
- package/blocks/templates/util.js +36 -0
- package/client/blocks.d.ts.map +1 -1
- package/client/devvit-animation-player.d.ts.map +1 -1
- package/client/devvit-custom-post.d.ts +7 -2
- package/client/devvit-custom-post.d.ts.map +1 -1
- package/client/devvit-custom-post.js +21 -32
- package/client/effects/devvit-effect-handler.d.ts.map +1 -1
- package/client/effects/form-effect-handler.d.ts.map +1 -1
- package/client/effects/toast-effect-handler.d.ts.map +1 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.d.ts +1 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.d.ts.map +1 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.js +13 -3
- package/client/formbuilder/components/devvit-form-selection-list.d.ts +1 -1
- package/client/formbuilder/components/devvit-form-selection-list.d.ts.map +1 -1
- package/client/formbuilder/components/devvit-form-selection-list.js +2 -2
- package/client/formbuilder/devvit-form-dialog.d.ts.map +1 -1
- package/client/formbuilder/fields/index.d.ts +0 -10
- package/client/formbuilder/fields/index.d.ts.map +1 -1
- package/client/formbuilder/fields/index.js +0 -9
- package/client/formbuilder/fields/renderBooleanField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderFieldLabel.d.ts.map +1 -1
- package/client/formbuilder/fields/renderFormFields.d.ts.map +1 -1
- package/client/formbuilder/fields/renderFormFields.js +7 -2
- package/client/formbuilder/fields/renderGroupField.d.ts +2 -1
- package/client/formbuilder/fields/renderGroupField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderGroupField.js +1 -2
- package/client/formbuilder/fields/renderHelpText.d.ts.map +1 -1
- package/client/formbuilder/fields/renderListField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderNumberField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderParagraphField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderSelectionField.d.ts.map +1 -1
- package/client/formbuilder/fields/renderSelectionField.js +1 -1
- package/client/formbuilder/fields/renderStringField.d.ts.map +1 -1
- package/client/formbuilder/index.d.ts.map +1 -1
- package/custom-styles.css +36 -0
- package/index.d.ts.map +1 -1
- package/package.json +43 -22
- package/server/blocks.d.ts.map +1 -1
- package/styles.d.ts.map +1 -1
- package/styles.js +1 -1
- package/types/events.d.ts.map +1 -1
- package/client/assets/snooBlocks.d.ts +0 -2
- package/client/assets/snooBlocks.d.ts.map +0 -1
- package/client/assets/snooBlocks.js +0 -2
- package/styles.css +0 -804
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nothing } from '@reddit/baseplate/html.js';
|
|
2
2
|
import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUIConfig.js';
|
|
3
3
|
import { defaultClasses, sizingClass, sizingStyle, stackChildClass } from '../attributes.js';
|
|
4
|
-
import { classMap } from './
|
|
4
|
+
import { classMap } from './util.js';
|
|
5
5
|
import '../components/devvit-blocks-webview.js';
|
|
6
6
|
export function renderWebViewBlock(block, ctx) {
|
|
7
7
|
const { html, styleMap } = getTemplateRenderingStrategy();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClassInfo, classMap as clientClassMap } from 'lit/directives/class-map.js';
|
|
2
|
+
import { TemplateResult } from 'lit';
|
|
3
|
+
import { UnsafeString } from '@reddit/baseplate/html.js';
|
|
4
|
+
export declare function classMap(classInfo: ClassInfo, forceString?: boolean): UnsafeString | ReturnType<typeof clientClassMap>;
|
|
5
|
+
export declare function unsafeHTML(input: string): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
|
|
6
|
+
export declare function resolveIcon(name: string): TemplateResult;
|
|
7
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,EAA0C,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIjG,wBAAgB,QAAQ,CACtB,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,OAAO,GACpB,YAAY,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAWlD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,4HAMvC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAYxD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { classMap as clientClassMap } from 'lit/directives/class-map.js';
|
|
2
|
+
import { unsafeHTML as clientUnsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
|
+
import { unsafeHTML as serverUnsafeHTML } from '@reddit/baseplate/html.js';
|
|
4
|
+
import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUIConfig.js';
|
|
5
|
+
import faceplateIcons from '@reddit/faceplate-ui/svgs/svg-manifest.js';
|
|
6
|
+
export function classMap(classInfo, forceString) {
|
|
7
|
+
const { getType } = getTemplateRenderingStrategy();
|
|
8
|
+
if (getType() === 'client' && forceString !== true) {
|
|
9
|
+
return clientClassMap(classInfo);
|
|
10
|
+
}
|
|
11
|
+
const result = Object.keys(classInfo)
|
|
12
|
+
.filter((className) => classInfo[className])
|
|
13
|
+
.join(' ');
|
|
14
|
+
return serverUnsafeHTML(result);
|
|
15
|
+
}
|
|
16
|
+
export function unsafeHTML(input) {
|
|
17
|
+
const { getType } = getTemplateRenderingStrategy();
|
|
18
|
+
if (getType() === 'client') {
|
|
19
|
+
return clientUnsafeHTML(input);
|
|
20
|
+
}
|
|
21
|
+
return serverUnsafeHTML(input);
|
|
22
|
+
}
|
|
23
|
+
export function resolveIcon(name) {
|
|
24
|
+
const { html } = getTemplateRenderingStrategy();
|
|
25
|
+
const fill = name.match(/-fill$/) !== null;
|
|
26
|
+
// clean up icon name
|
|
27
|
+
const iconName = name.replace(/^icon-/, '').replace(/-(fill|outline)$/, '');
|
|
28
|
+
// eslint-disable-next-line @reddit/i18n-shreddit/no-unwrapped-strings
|
|
29
|
+
const icon = faceplateIcons[iconName][fill ? 'fill' : 'outline'];
|
|
30
|
+
if (icon) {
|
|
31
|
+
return html `${unsafeHTML(icon)}`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return html ``;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/client/blocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/client/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAC1E,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../library/src/client/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAC1E,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-animation-player.d.ts","sourceRoot":"","sources":["../../src/client/devvit-animation-player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,4BAA4B,CAAC;AAEpC;;GAEG;AACH,qBACa,qBAAsB,SAAQ,UAAU;IACvB,GAAG,EAAE,MAAM,CAAM;IACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE7C,MAAM;CAQhB"}
|
|
1
|
+
{"version":3,"file":"devvit-animation-player.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-animation-player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,4BAA4B,CAAC;AAEpC;;GAEG;AACH,qBACa,qBAAsB,SAAQ,UAAU;IACvB,GAAG,EAAE,MAAM,CAAM;IACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE7C,MAAM;CAQhB"}
|
|
@@ -4,6 +4,7 @@ import type { Metadata } from '@devvit/protos';
|
|
|
4
4
|
import { Block, RenderPostResponse } from '@devvit/protos';
|
|
5
5
|
import type { ActorRef } from '@devvit/runtimes/common/runtime/ActorRef.js';
|
|
6
6
|
import './devvit-animation-player.js';
|
|
7
|
+
import '../blocks/components/devvit-blocks-renderer.js';
|
|
7
8
|
declare global {
|
|
8
9
|
interface HTMLElementTagNameMap {
|
|
9
10
|
'devvit-custom-post': DevvitCustomPost;
|
|
@@ -16,10 +17,14 @@ export declare class DevvitCustomPost extends LitElement {
|
|
|
16
17
|
postId?: string;
|
|
17
18
|
renderResponse?: RenderPostResponse;
|
|
18
19
|
rootBlock?: Block;
|
|
19
|
-
static get styles(): import("lit").CSSResult[];
|
|
20
20
|
connectedCallback(): void;
|
|
21
21
|
disconnectedCallback(): void;
|
|
22
22
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
23
|
-
render(): import("
|
|
23
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'devvit-custom-post': DevvitCustomPost;
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
//# sourceMappingURL=devvit-custom-post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-custom-post.d.ts","sourceRoot":"","sources":["../../src/client/devvit-custom-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"devvit-custom-post.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-custom-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvD,OAAO,kEAAkE,CAAC;AAG1E,OAAO,KAAK,EAMV,QAAQ,EAIT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,EAKL,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAI5E,OAAO,8BAA8B,CAAC;AACtC,OAAO,gDAAgD,CAAC;AAExD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF;AASD,qBACa,gBAAiB,SAAQ,UAAU;;IAE9C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAGpC,SAAS,CAAC,EAAE,KAAK,CAAC;IAiBT,iBAAiB;IAKjB,oBAAoB;cAQV,UAAU,CAAC,iBAAiB,EAAE,cAAc;IAatD,MAAM;CAkGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
var _DevvitCustomPost_instances, _DevvitCustomPost_postData, _DevvitCustomPost_appState, _DevvitCustomPost_lastRequest, _DevvitCustomPost_customPostActor, _DevvitCustomPost_uiEventHandlerActor, _DevvitCustomPost_rpcQueue, _DevvitCustomPost_rerenderTimeout, _DevvitCustomPost_state_get, _DevvitCustomPost_handleUIEvent, _DevvitCustomPost_handleUserAction, _DevvitCustomPost_renderRequest, _DevvitCustomPost_initialRender, _DevvitCustomPost_userActionRender, _DevvitCustomPost_effectEventRender, _DevvitCustomPost_renderPost, _DevvitCustomPost_handleEffects;
|
|
1
|
+
var _DevvitCustomPost_instances, _DevvitCustomPost_postData, _DevvitCustomPost_appState, _DevvitCustomPost_lastRequest, _DevvitCustomPost_customPostActor, _DevvitCustomPost_uiEventHandlerActor, _DevvitCustomPost_rpcQueue, _DevvitCustomPost_rerenderTimeout, _DevvitCustomPost_state_get, _DevvitCustomPost_makeRenderContext, _DevvitCustomPost_handleUIEvent, _DevvitCustomPost_handleUserAction, _DevvitCustomPost_renderRequest, _DevvitCustomPost_initialRender, _DevvitCustomPost_userActionRender, _DevvitCustomPost_effectEventRender, _DevvitCustomPost_renderPost, _DevvitCustomPost_handleEffects;
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate, __metadata } from "tslib";
|
|
3
3
|
import { html, LitElement } from 'lit';
|
|
4
4
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
|
-
import { localized, msg } from '@lit/localize';
|
|
6
5
|
import PQueue from 'p-queue';
|
|
7
6
|
import '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
8
|
-
import { emptyState } from '@reddit/faceplate-ui/templates/empty-state.js';
|
|
9
7
|
import { customEvent } from '@reddit/faceplate/lib/custom-event.js';
|
|
10
|
-
import { Block, BlockRenderEventType, BlockStackDirection,
|
|
11
|
-
import { renderBlocks } from '../blocks/index.js';
|
|
12
|
-
import { snooBlocks } from './assets/snooBlocks.js';
|
|
13
|
-
import { styles } from '../styles.js';
|
|
8
|
+
import { Block, BlockRenderEventType, BlockStackDirection, CustomPostDefinition, EffectType, RenderPostResponse, UIEventHandlerDefinition, } from '@devvit/protos';
|
|
14
9
|
import './devvit-animation-player.js';
|
|
10
|
+
import '../blocks/components/devvit-blocks-renderer.js';
|
|
15
11
|
let DevvitCustomPost = class DevvitCustomPost extends LitElement {
|
|
16
12
|
constructor() {
|
|
17
13
|
super(...arguments);
|
|
@@ -23,6 +19,14 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
|
|
|
23
19
|
_DevvitCustomPost_uiEventHandlerActor.set(this, void 0);
|
|
24
20
|
_DevvitCustomPost_rpcQueue.set(this, new PQueue({ concurrency: 1 }));
|
|
25
21
|
_DevvitCustomPost_rerenderTimeout.set(this, void 0);
|
|
22
|
+
_DevvitCustomPost_makeRenderContext.set(this, () => ({
|
|
23
|
+
request: __classPrivateFieldGet(this, _DevvitCustomPost_lastRequest, "f"),
|
|
24
|
+
state: __classPrivateFieldGet(this, _DevvitCustomPost_instances, "a", _DevvitCustomPost_state_get),
|
|
25
|
+
stackDirection: BlockStackDirection.UNRECOGNIZED,
|
|
26
|
+
onAction: (action) => {
|
|
27
|
+
__classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_userActionRender).call(this, action.id, action.data);
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
26
30
|
_DevvitCustomPost_handleUIEvent.set(this, (event) => {
|
|
27
31
|
void __classPrivateFieldGet(this, _DevvitCustomPost_rpcQueue, "f").add(async () => {
|
|
28
32
|
const req = {
|
|
@@ -45,9 +49,6 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
|
|
|
45
49
|
state: __classPrivateFieldGet(this, _DevvitCustomPost_instances, "a", _DevvitCustomPost_state_get),
|
|
46
50
|
}));
|
|
47
51
|
}
|
|
48
|
-
static get styles() {
|
|
49
|
-
return [styles];
|
|
50
|
-
}
|
|
51
52
|
connectedCallback() {
|
|
52
53
|
super.connectedCallback();
|
|
53
54
|
this.addEventListener('devvit-user-action', __classPrivateFieldGet(this, _DevvitCustomPost_handleUserAction, "f"));
|
|
@@ -60,39 +61,28 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
|
|
|
60
61
|
this.removeEventListener('devvit-user-action', __classPrivateFieldGet(this, _DevvitCustomPost_handleUserAction, "f"));
|
|
61
62
|
}
|
|
62
63
|
willUpdate(changedProperties) {
|
|
64
|
+
if (changedProperties.has('postId')) {
|
|
65
|
+
__classPrivateFieldSet(this, _DevvitCustomPost_postData, this.postId !== undefined ? { __postData: { thingId: this.postId } } : undefined, "f");
|
|
66
|
+
}
|
|
63
67
|
if (changedProperties.has('actorRef')) {
|
|
64
68
|
__classPrivateFieldSet(this, _DevvitCustomPost_customPostActor, this.actorRef?.As(CustomPostDefinition), "f");
|
|
65
69
|
__classPrivateFieldSet(this, _DevvitCustomPost_uiEventHandlerActor, this.actorRef?.As(UIEventHandlerDefinition), "f");
|
|
66
70
|
__classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_initialRender).call(this);
|
|
67
71
|
}
|
|
68
|
-
if (changedProperties.has('postId')) {
|
|
69
|
-
__classPrivateFieldSet(this, _DevvitCustomPost_postData, this.postId !== undefined ? { __postData: { thingId: this.postId } } : undefined, "f");
|
|
70
|
-
}
|
|
71
72
|
}
|
|
72
73
|
render() {
|
|
73
74
|
if (!this.renderResponse) {
|
|
74
75
|
return html `<slot></slot>`;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
__classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_userActionRender).call(this, action.id, action.data);
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return html `${emptyState({
|
|
87
|
-
creative: html `<div class="w-3xl h-3xl">${snooBlocks}</div>`,
|
|
88
|
-
title: msg('Whoops!', { desc: 'Header for message to display when rendering fails' }),
|
|
89
|
-
description: msg('Something went wrong while attempting to display this content.', {
|
|
90
|
-
desc: 'Message for users to display when rendering fails',
|
|
91
|
-
}),
|
|
92
|
-
})}`;
|
|
77
|
+
return html `<devvit-blocks-renderer
|
|
78
|
+
.block="${this.rootBlock}"
|
|
79
|
+
.renderContext="${__classPrivateFieldGet(this, _DevvitCustomPost_makeRenderContext, "f")}"
|
|
80
|
+
>
|
|
81
|
+
<slot slot="empty-state-image" name="empty-state-image"></slot>
|
|
82
|
+
</devvit-blocks-renderer>`;
|
|
93
83
|
}
|
|
94
84
|
};
|
|
95
|
-
_DevvitCustomPost_postData = new WeakMap(), _DevvitCustomPost_appState = new WeakMap(), _DevvitCustomPost_lastRequest = new WeakMap(), _DevvitCustomPost_customPostActor = new WeakMap(), _DevvitCustomPost_uiEventHandlerActor = new WeakMap(), _DevvitCustomPost_rpcQueue = new WeakMap(), _DevvitCustomPost_rerenderTimeout = new WeakMap(), _DevvitCustomPost_handleUIEvent = new WeakMap(), _DevvitCustomPost_handleUserAction = new WeakMap(), _DevvitCustomPost_renderRequest = new WeakMap(), _DevvitCustomPost_instances = new WeakSet(), _DevvitCustomPost_state_get = function _DevvitCustomPost_state_get() {
|
|
85
|
+
_DevvitCustomPost_postData = new WeakMap(), _DevvitCustomPost_appState = new WeakMap(), _DevvitCustomPost_lastRequest = new WeakMap(), _DevvitCustomPost_customPostActor = new WeakMap(), _DevvitCustomPost_uiEventHandlerActor = new WeakMap(), _DevvitCustomPost_rpcQueue = new WeakMap(), _DevvitCustomPost_rerenderTimeout = new WeakMap(), _DevvitCustomPost_makeRenderContext = new WeakMap(), _DevvitCustomPost_handleUIEvent = new WeakMap(), _DevvitCustomPost_handleUserAction = new WeakMap(), _DevvitCustomPost_renderRequest = new WeakMap(), _DevvitCustomPost_instances = new WeakSet(), _DevvitCustomPost_state_get = function _DevvitCustomPost_state_get() {
|
|
96
86
|
return Object.assign({}, __classPrivateFieldGet(this, _DevvitCustomPost_postData, "f"), __classPrivateFieldGet(this, _DevvitCustomPost_appState, "f"));
|
|
97
87
|
}, _DevvitCustomPost_initialRender = function _DevvitCustomPost_initialRender() {
|
|
98
88
|
__classPrivateFieldGet(this, _DevvitCustomPost_instances, "m", _DevvitCustomPost_renderPost).call(this, __classPrivateFieldGet(this, _DevvitCustomPost_renderRequest, "f").call(this, BlockRenderEventType.RENDER_INITIAL));
|
|
@@ -152,7 +142,6 @@ __decorate([
|
|
|
152
142
|
__metadata("design:type", Object)
|
|
153
143
|
], DevvitCustomPost.prototype, "rootBlock", void 0);
|
|
154
144
|
DevvitCustomPost = __decorate([
|
|
155
|
-
localized(),
|
|
156
145
|
customElement('devvit-custom-post')
|
|
157
146
|
], DevvitCustomPost);
|
|
158
147
|
export { DevvitCustomPost };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-effect-handler.d.ts","sourceRoot":"","sources":["../../../src/client/effects/devvit-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,2BAA2B,EAC3B,gBAAgB,EAChB,KAAK,EACL,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,8BAAsB,mBAAoB,YAAW,kBAAkB;;IACrE,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEpB,IAAI,EAAE,eAAe;IAKjC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEvE,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEpE,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEnF,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAE1E,SAAS,CAAC,uBAAuB,CAC/B,cAAc,EAAE,2BAA2B,EAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAGpC,aAAa;IAIb,gBAAgB;IAIhB,UAAU;IAEV,WAAW;IAOX,MAAM,WAAY,MAAM,mBAAmB,OAAO,KAAK,IAAI,UA8BzD;CACH"}
|
|
1
|
+
{"version":3,"file":"devvit-effect-handler.d.ts","sourceRoot":"","sources":["../../../library/src/client/effects/devvit-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,2BAA2B,EAC3B,gBAAgB,EAChB,KAAK,EACL,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,8BAAsB,mBAAoB,YAAW,kBAAkB;;IACrE,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEpB,IAAI,EAAE,eAAe;IAKjC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEvE,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEpE,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAEnF,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAE1E,SAAS,CAAC,uBAAuB,CAC/B,cAAc,EAAE,2BAA2B,EAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAGpC,aAAa;IAIb,gBAAgB;IAIhB,UAAU;IAEV,WAAW;IAOX,MAAM,WAAY,MAAM,mBAAmB,OAAO,KAAK,IAAI,UA8BzD;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-effect-handler.d.ts","sourceRoot":"","sources":["../../../src/client/effects/form-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,qBAAa,iBAAkB,SAAQ,mBAAmB;;gBAK5C,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAK7C,WAAW;cAKD,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;CAG5E"}
|
|
1
|
+
{"version":3,"file":"form-effect-handler.d.ts","sourceRoot":"","sources":["../../../library/src/client/effects/form-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,qBAAa,iBAAkB,SAAQ,mBAAmB;;gBAK5C,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAK7C,WAAW;cAKD,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;CAG5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-effect-handler.d.ts","sourceRoot":"","sources":["../../../src/client/effects/toast-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,qBAAa,kBAAmB,SAAQ,mBAAmB;IAChD,WAAW,CAAC,KAAK,EAAE,KAAK;CAQlC"}
|
|
1
|
+
{"version":3,"file":"toast-effect-handler.d.ts","sourceRoot":"","sources":["../../../library/src/client/effects/toast-effect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,qBAAa,kBAAmB,SAAQ,mBAAmB;IAChD,WAAW,CAAC,KAAK,EAAE,KAAK;CAQlC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
2
3
|
import { FormField } from '@devvit/protos';
|
|
3
4
|
import '@reddit/faceplate-ui/components/faceplate-dropdown-menu.js';
|
|
4
5
|
import '@reddit/faceplate-ui/components/faceplate-menu.js';
|
|
5
6
|
import '@reddit/faceplate-ui/components/faceplate-switch-input.js';
|
|
6
|
-
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
7
7
|
export declare class DevvitFormSelectionDropdown extends InputElement {
|
|
8
8
|
#private;
|
|
9
9
|
field: FormField | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-form-selection-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/components/devvit-form-selection-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"devvit-form-selection-dropdown.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/components/devvit-form-selection-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAS1D,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,OAAO,EAGL,SAAS,EAEV,MAAM,gBAAgB,CAAC;AAIxB,OAAO,4DAA4D,CAAC;AACpE,OAAO,mDAAmD,CAAC;AAC3D,OAAO,2DAA2D,CAAC;AAEnE,qBAAa,2BAA4B,SAAQ,YAAY;;IAE3D,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAG7B,YAAY,UAAS;IAGrB,YAAY,SAAM;IAKlB,WAAoB,MAAM,mCAWzB;IAED,IAAI,KAAK,WAER;IAED,UAAU,CAAC,iBAAiB,EAAE,cAAc;IAwDnC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAgDrC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
var _DevvitFormSelectionDropdown_selection, _DevvitFormSelectionDropdown_config, _DevvitFormSelectionDropdown_updateSelection, _DevvitFormSelectionDropdown_singleSelectListItem, _DevvitFormSelectionDropdown_multiSelectListItem;
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate, __metadata } from "tslib";
|
|
3
|
+
import { css } from 'lit';
|
|
3
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
6
|
import { html, ifDefined } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
5
7
|
import { listItem } from '@reddit/faceplate-ui/templates/list-item.js';
|
|
6
8
|
import { button } from '@reddit/faceplate-ui/templates/button.js';
|
|
7
9
|
import { msg } from '@reddit/faceplate/lib/i18n/localize.js';
|
|
10
|
+
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
8
11
|
import { FieldConfig_Selection, FormFieldValue_SelectionValue, } from '@devvit/protos';
|
|
9
12
|
import { styles } from '../../../styles.js';
|
|
10
13
|
import '@reddit/faceplate-ui/components/faceplate-dropdown-menu.js';
|
|
11
14
|
import '@reddit/faceplate-ui/components/faceplate-menu.js';
|
|
12
15
|
import '@reddit/faceplate-ui/components/faceplate-switch-input.js';
|
|
13
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
14
|
-
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
15
16
|
export class DevvitFormSelectionDropdown extends InputElement {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
@@ -62,7 +63,16 @@ export class DevvitFormSelectionDropdown extends InputElement {
|
|
|
62
63
|
}));
|
|
63
64
|
}
|
|
64
65
|
static get styles() {
|
|
65
|
-
return [
|
|
66
|
+
return [
|
|
67
|
+
super.styles,
|
|
68
|
+
styles,
|
|
69
|
+
// fixes a layering bug when dropdown menus are too close together
|
|
70
|
+
css `
|
|
71
|
+
.button .dropdown-icon {
|
|
72
|
+
transform: none;
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
];
|
|
66
76
|
}
|
|
67
77
|
get value() {
|
|
68
78
|
return __classPrivateFieldGet(this, _DevvitFormSelectionDropdown_selection, "f").values.join(',');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
2
3
|
import { FormField } from '@devvit/protos';
|
|
3
4
|
import '@reddit/faceplate-ui/components/faceplate-radio-input.js';
|
|
4
5
|
import '@reddit/faceplate-ui/components/faceplate-checkbox-input.js';
|
|
5
|
-
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
6
6
|
export declare class DevvitFormSelectionList extends InputElement {
|
|
7
7
|
#private;
|
|
8
8
|
field: FormField | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-form-selection-list.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/components/devvit-form-selection-list.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"devvit-form-selection-list.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/components/devvit-form-selection-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrD,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,OAAO,EAGL,SAAS,EAEV,MAAM,gBAAgB,CAAC;AAMxB,OAAO,0DAA0D,CAAC;AAClE,OAAO,6DAA6D,CAAC;AAErE,qBAAa,uBAAwB,SAAQ,YAAY;;IAEvD,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAK7B,WAAoB,MAAM,mCAEzB;IAED,IAAI,KAAK,WAER;IAED,UAAU,CAAC,iBAAiB,EAAE,cAAc;IAsBnC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CA6CrC"}
|
|
@@ -2,12 +2,12 @@ var _DevvitFormSelectionList_config, _DevvitFormSelectionList_selection, _Devvit
|
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate, __metadata } from "tslib";
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { html, repeat } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
5
|
+
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
5
6
|
import { FieldConfig_Selection, FormFieldValue_SelectionValue, } from '@devvit/protos';
|
|
6
|
-
import { renderFieldLabel } from '../fields/
|
|
7
|
+
import { renderFieldLabel } from '../fields/renderFieldLabel.js';
|
|
7
8
|
import { styles } from '../../../styles.js';
|
|
8
9
|
import '@reddit/faceplate-ui/components/faceplate-radio-input.js';
|
|
9
10
|
import '@reddit/faceplate-ui/components/faceplate-checkbox-input.js';
|
|
10
|
-
import { InputElement } from '@reddit/faceplate/base-classes/input-element.js';
|
|
11
11
|
export class DevvitFormSelectionList extends InputElement {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-form-dialog.d.ts","sourceRoot":"","sources":["../../../src/client/formbuilder/devvit-form-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,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,MAAM,KAAK,CAAC;AAIvC,OAAO,kEAAkE,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAGtF,OAAO,EAAE,aAAa,EAAoB,MAAM,gDAAgD,CAAC;AAEjG,OAAO,EAAE,IAAI,EAA4C,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKzF,OAAO,kDAAkD,CAAC;AAC1D,OAAO,gDAAgD,CAAC;AAKxD,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;IAgF7C,MAAM;CA+ChB"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export * from './renderBooleanField.js';
|
|
2
|
-
export * from './renderFieldLabel.js';
|
|
3
1
|
export * from './renderFormFields.js';
|
|
4
|
-
export * from './renderGroupField.js';
|
|
5
|
-
export * from './renderHelpText.js';
|
|
6
|
-
export * from './renderListField.js';
|
|
7
|
-
export * from './renderNumberField.js';
|
|
8
|
-
export * from './renderParagraphField.js';
|
|
9
|
-
export * from './renderSelectionField.js';
|
|
10
|
-
export * from './renderStringField.js';
|
|
11
|
-
export type OnInputDelegate = (event: InputEvent | CustomEvent) => void;
|
|
12
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export * from './renderBooleanField.js';
|
|
2
|
-
export * from './renderFieldLabel.js';
|
|
3
1
|
export * from './renderFormFields.js';
|
|
4
|
-
export * from './renderGroupField.js';
|
|
5
|
-
export * from './renderHelpText.js';
|
|
6
|
-
export * from './renderListField.js';
|
|
7
|
-
export * from './renderNumberField.js';
|
|
8
|
-
export * from './renderParagraphField.js';
|
|
9
|
-
export * from './renderSelectionField.js';
|
|
10
|
-
export * from './renderStringField.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBooleanField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,2DAA2D,CAAC;AAEnE,eAAO,MAAM,kBAAkB,UAAW,SAAS,yCAWlD,CAAC"}
|
|
1
|
+
{"version":3,"file":"renderBooleanField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderBooleanField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,2DAA2D,CAAC;AAEnE,eAAO,MAAM,kBAAkB,UAAW,SAAS,yCAWlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFieldLabel.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderFieldLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,eAAO,MAAM,gBAAgB,UAAW,SAAS,yCAC+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"renderFieldLabel.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderFieldLabel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,eAAO,MAAM,gBAAgB,UAAW,SAAS,yCAC+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFormFields.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderFormFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrC,OAAO,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderFormFields.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderFormFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrC,OAAO,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAqB1D,eAAO,MAAM,gBAAgB,WAAY,SAAS,EAAE,KAAG,cAEtD,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { choose } from 'lit/directives/choose.js';
|
|
2
2
|
import { html, repeat } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
3
3
|
import { FormFieldType } from '@devvit/protos';
|
|
4
|
-
import {
|
|
4
|
+
import { renderStringField } from './renderStringField.js';
|
|
5
|
+
import { renderBooleanField } from './renderBooleanField.js';
|
|
6
|
+
import { renderGroupField } from './renderGroupField.js';
|
|
7
|
+
import { renderSelectionField } from './renderSelectionField.js';
|
|
8
|
+
import { renderNumberField } from './renderNumberField.js';
|
|
9
|
+
import { renderParagraphField } from './renderParagraphField.js';
|
|
5
10
|
const renderFormField = (field) => html `
|
|
6
11
|
${choose(field.fieldType, [
|
|
7
12
|
[FormFieldType.STRING, () => renderStringField(field)],
|
|
@@ -10,7 +15,7 @@ const renderFormField = (field) => html `
|
|
|
10
15
|
[FormFieldType.BOOLEAN, () => renderBooleanField(field)],
|
|
11
16
|
// [FormFieldType.LIST, () => renderListField(field)],
|
|
12
17
|
[FormFieldType.SELECTION, () => renderSelectionField(field)],
|
|
13
|
-
[FormFieldType.GROUP, () => renderGroupField(field)],
|
|
18
|
+
[FormFieldType.GROUP, () => renderGroupField(field, renderFormFields)],
|
|
14
19
|
])}
|
|
15
20
|
`;
|
|
16
21
|
export const renderFormFields = (fields) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { FormField } from '@devvit/protos';
|
|
2
|
-
|
|
2
|
+
import { TemplateResult } from 'lit';
|
|
3
|
+
export declare const renderGroupField: (field: FormField, renderFormFields: (fields: FormField[]) => TemplateResult) => TemplateResult<1>;
|
|
3
4
|
//# sourceMappingURL=renderGroupField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderGroupField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderGroupField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderGroupField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderGroupField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,gBAAgB,UACpB,SAAS,6BACW,SAAS,EAAE,KAAK,cAAc,sBAU1D,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
2
|
-
import { renderFormFields } from './renderFormFields.js';
|
|
3
2
|
import { renderFieldLabel } from './renderFieldLabel.js';
|
|
4
|
-
export const renderGroupField = (field) => {
|
|
3
|
+
export const renderGroupField = (field, renderFormFields) => {
|
|
5
4
|
return html `
|
|
6
5
|
<div class="flex flex-col py-xs border-0 gap-y-xs">
|
|
7
6
|
${renderFieldLabel(field)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHelpText.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrC,OAAO,+DAA+D,CAAC;AAEvE,eAAO,MAAM,cAAc,cAAe,MAAM,GAAG,SAAS,KAAG,cACiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"renderHelpText.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrC,OAAO,+DAA+D,CAAC;AAEvE,eAAO,MAAM,cAAc,cAAe,MAAM,GAAG,SAAS,KAAG,cACiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderListField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderListField.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"renderListField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderListField.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderNumberField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderNumberField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderNumberField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderNumberField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,yDAAyD,CAAC;AAEjE,eAAO,MAAM,iBAAiB,UAAW,SAAS,yCAmBjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderParagraphField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderParagraphField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderParagraphField.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,6DAA6D,CAAC;AACrE,OAAO,+DAA+D,CAAC;AAGvE,eAAO,MAAM,oBAAoB,UAAW,SAAS,yCAoBpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderSelectionField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderSelectionField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderSelectionField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,iDAAiD,CAAC;AACzD,OAAO,6CAA6C,CAAC;AAErD,eAAO,MAAM,oBAAoB,UAAW,SAAS,yCAapD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderFieldLabel } from './index.js';
|
|
2
1
|
import { html } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
2
|
+
import { renderFieldLabel } from './renderFieldLabel.js';
|
|
3
3
|
import '../components/devvit-form-selection-dropdown.js';
|
|
4
4
|
import '../components/devvit-form-selection-list.js';
|
|
5
5
|
export const renderSelectionField = (field) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStringField.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderStringField.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/renderStringField.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,yDAAyD,CAAC;AAEjE,eAAO,MAAM,iBAAiB,UAAW,SAAS,yCAqBjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/formbuilder/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../library/src/client/formbuilder/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Text outline classes */
|
|
2
|
+
.text-outline-thin-bright {
|
|
3
|
+
text-shadow: #000 1px 0 0.5px, #000 -1px 0 0.5px, #000 0 1px 0.5px, #000 0 -1px 0.5px;
|
|
4
|
+
}
|
|
5
|
+
.text-outline-thick-bright {
|
|
6
|
+
text-shadow: #000 1px 0 2px, #000 -1px 0 2px, #000 0 1px 1px, #000 0 -1px 1px, #000 1px 0 2px,
|
|
7
|
+
#000 -1px 0 2px, #000 0 1px 1px, #000 0 -1px 1px;
|
|
8
|
+
}
|
|
9
|
+
.text-outline-thin-dark {
|
|
10
|
+
text-shadow: #fff 1px 0 0.5px, #fff -1px 0 0.5px, #fff 0 1px 0.5px, #fff 0 -1px 0.5px;
|
|
11
|
+
}
|
|
12
|
+
.text-outline-thick-dark {
|
|
13
|
+
text-shadow: #fff 1px 0 2px, #fff -1px 0 2px, #fff 0 1px 1px, #fff 0 -1px 1px, #fff 1px 0 2px,
|
|
14
|
+
#fff -1px 0 2px, #fff 0 1px 1px, #fff 0 -1px 1px;
|
|
15
|
+
}
|
|
16
|
+
/** Custom border sizes */
|
|
17
|
+
.border-dx-thick {
|
|
18
|
+
border-width: 2px;
|
|
19
|
+
}
|
|
20
|
+
.border-dx-thin {
|
|
21
|
+
border-width: 1px;
|
|
22
|
+
}
|
|
23
|
+
/** Custom border radius sizes */
|
|
24
|
+
.rounded-dx-lg {
|
|
25
|
+
border-radius: 1.5rem;
|
|
26
|
+
}
|
|
27
|
+
.rounded-dx-md {
|
|
28
|
+
border-radius: 1rem;
|
|
29
|
+
}
|
|
30
|
+
.rounded-dx-sm {
|
|
31
|
+
border-radius: 0.5rem;
|
|
32
|
+
}
|
|
33
|
+
/** Custom z-index for form dialogs */
|
|
34
|
+
.z-dialog {
|
|
35
|
+
z-index: 100;
|
|
36
|
+
}
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../library/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|