@devvit/ui-renderer 0.9.4 → 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.map +1 -1
- 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.map +1 -1
- package/blocks/templates/renderAnimationBlock.d.ts +1 -0
- package/blocks/templates/renderAnimationBlock.d.ts.map +1 -1
- package/blocks/templates/renderAnimationBlock.js +1 -0
- package/blocks/templates/renderAvatarBlock.d.ts.map +1 -1
- package/blocks/templates/renderBlock.d.ts.map +1 -1
- package/blocks/templates/renderButtonBlock.d.ts.map +1 -1
- package/blocks/templates/renderButtonBlock.js +5 -3
- package/blocks/templates/renderContext.d.ts.map +1 -1
- package/blocks/templates/renderFullSnooBlock.d.ts.map +1 -1
- package/blocks/templates/renderIconBlock.d.ts.map +1 -1
- package/blocks/templates/renderIconBlock.js +14 -5
- package/blocks/templates/renderImageBlock.d.ts.map +1 -1
- package/blocks/templates/renderSpacerBlock.d.ts.map +1 -1
- package/blocks/templates/renderStackBlock.d.ts.map +1 -1
- package/blocks/templates/renderTextBlock.d.ts.map +1 -1
- package/blocks/templates/renderWebViewBlock.d.ts.map +1 -1
- package/blocks/templates/util.d.ts +3 -0
- package/blocks/templates/util.d.ts.map +1 -1
- package/blocks/templates/util.js +27 -8
- 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 +18 -29
- 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.map +1 -1
- package/client/formbuilder/components/devvit-form-selection-dropdown.js +11 -1
- package/client/formbuilder/components/devvit-form-selection-list.d.ts.map +1 -1
- package/client/formbuilder/devvit-form-dialog.d.ts.map +1 -1
- package/client/formbuilder/fields/index.d.ts.map +1 -1
- 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/renderGroupField.d.ts.map +1 -1
- 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/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 +41 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/blocks/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EACL,KAAK,EAEL,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,WAAW,EAEX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gB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CASxF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Block } from '@devvit/protos';
|
|
3
|
+
import type { RenderContext } from '../templates/renderContext.js';
|
|
4
|
+
export declare class DevvitBlocksRenderer extends LitElement {
|
|
5
|
+
block: Block | undefined;
|
|
6
|
+
renderContext: () => RenderContext;
|
|
7
|
+
static get styles(): import("lit").CSSResult[];
|
|
8
|
+
render(): import("@reddit/baseplate/html.js").TemplateLike;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'devvit-blocks-renderer': DevvitBlocksRenderer;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=devvit-blocks-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devvit-blocks-renderer.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/components/devvit-blocks-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAMvC,OAAO,EAAE,KAAK,EAAkC,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,qBAEa,oBAAqB,SAAQ,UAAU;IAElD,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IAGzB,aAAa,EAAE,MAAM,aAAa,CAAgE;IAElG,WAAoB,MAAM,8BAEzB;IAEQ,MAAM;CAahB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,oBAAoB,CAAC;KAChD;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { localized, msg } from '@lit/localize';
|
|
5
|
+
import { emptyState } from '@reddit/faceplate-ui/templates/empty-state.js';
|
|
6
|
+
import { BlockStackDirection, BlockType } from '@devvit/protos';
|
|
7
|
+
import { renderBlocks } from '../templates/index.js';
|
|
8
|
+
import { styles } from '../../styles.js';
|
|
9
|
+
let DevvitBlocksRenderer = class DevvitBlocksRenderer extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.renderContext = () => ({ stackDirection: BlockStackDirection.UNRECOGNIZED });
|
|
13
|
+
}
|
|
14
|
+
static get styles() {
|
|
15
|
+
return [styles];
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
if (this.block && this.block.type === BlockType.BLOCK_ROOT) {
|
|
19
|
+
return renderBlocks(this.block, this.renderContext());
|
|
20
|
+
}
|
|
21
|
+
return html `${emptyState({
|
|
22
|
+
creative: html `<slot name="empty-state-image"></slot>`,
|
|
23
|
+
title: msg('Whoops!', { desc: 'Header for message to display when rendering fails' }),
|
|
24
|
+
description: msg('Something went wrong while attempting to display this content.', {
|
|
25
|
+
desc: 'Message for users to display when rendering fails',
|
|
26
|
+
}),
|
|
27
|
+
})}`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ attribute: false }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], DevvitBlocksRenderer.prototype, "block", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
property({ attribute: false }),
|
|
36
|
+
__metadata("design:type", Function)
|
|
37
|
+
], DevvitBlocksRenderer.prototype, "renderContext", void 0);
|
|
38
|
+
DevvitBlocksRenderer = __decorate([
|
|
39
|
+
localized(),
|
|
40
|
+
customElement('devvit-blocks-renderer')
|
|
41
|
+
], DevvitBlocksRenderer);
|
|
42
|
+
export { DevvitBlocksRenderer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devvit-blocks-webview.d.ts","sourceRoot":"","sources":["../../../src/blocks/components/devvit-blocks-webview.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"devvit-blocks-webview.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/components/devvit-blocks-webview.ts"],"names":[],"mappings":""}
|
package/blocks/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":";AAEA,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../library/src/blocks/index.ts"],"names":[],"mappings":";AAEA,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Block } from '@devvit/protos';
|
|
2
2
|
import { TemplateLike } from '@reddit/baseplate/html.js';
|
|
3
|
+
import '../../client/devvit-animation-player.js';
|
|
3
4
|
import { RenderContext } from './renderContext.js';
|
|
4
5
|
export declare function renderAnimationBlock(block: Block, ctx: RenderContext): TemplateLike;
|
|
5
6
|
//# sourceMappingURL=renderAnimationBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderAnimationBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderAnimationBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"renderAnimationBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderAnimationBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,yCAAyC,CAAC;AASjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA6BnF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nothing } from '@reddit/baseplate/html.js';
|
|
2
2
|
import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUIConfig.js';
|
|
3
|
+
import '../../client/devvit-animation-player.js';
|
|
3
4
|
import { defaultClasses, onClickAction, sizingClass, sizingStyle, stackChildClass, } from '../attributes.js';
|
|
4
5
|
import { classMap } from './util.js';
|
|
5
6
|
export function renderAnimationBlock(block, ctx) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderAvatarBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderAvatarBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAYlE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA6BhF"}
|
|
1
|
+
{"version":3,"file":"renderAvatarBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderAvatarBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAYlE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA6BhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAkC,MAAM,gBAAgB,CAAC;AAYvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,YAAY,CAsB7F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA+C1E"}
|
|
1
|
+
{"version":3,"file":"renderBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAkC,MAAM,gBAAgB,CAAC;AAYvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,YAAY,CAsB7F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA+C1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderButtonBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderButtonBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,2BAA2B,CAAC;AAKvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderButtonBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderButtonBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,2BAA2B,CAAC;AAKvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAWvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAqChF"}
|
|
@@ -2,10 +2,10 @@ import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUICo
|
|
|
2
2
|
import { button } from '@reddit/faceplate-ui/templates/button.js';
|
|
3
3
|
import { styleMap } from '@reddit/faceplate-ui/templateUtils/styleMap.js';
|
|
4
4
|
import { buttonAppearance, buttonSize, colorStyle, defaultClasses, onClickAction, sizingClass, stackChildClass, } from '../attributes.js';
|
|
5
|
-
import { classMap } from './util.js';
|
|
5
|
+
import { classMap, resolveIcon } from './util.js';
|
|
6
6
|
export function renderButtonBlock(block, ctx) {
|
|
7
7
|
const { html, ifDefined } = getTemplateRenderingStrategy();
|
|
8
|
-
|
|
8
|
+
const buttonIcon = block.config?.buttonConfig?.icon;
|
|
9
9
|
const disabled = block.config?.buttonConfig?.disabled === true;
|
|
10
10
|
const classes = {
|
|
11
11
|
...defaultClasses(block.type),
|
|
@@ -18,10 +18,12 @@ export function renderButtonBlock(block, ctx) {
|
|
|
18
18
|
// ...backgroundStyle(block.config?.buttonConfig?.backgroundColor),
|
|
19
19
|
};
|
|
20
20
|
const onClick = onClickAction(block, ctx);
|
|
21
|
+
const iconSvg = buttonIcon ? resolveIcon(buttonIcon) : undefined;
|
|
22
|
+
const icon = iconSvg ? { leadingIcon: iconSvg } : {};
|
|
21
23
|
return html `${button({
|
|
22
24
|
size: buttonSize(block.config?.buttonConfig?.buttonSize),
|
|
23
25
|
appearance: buttonAppearance(block.config?.buttonConfig?.buttonAppearance),
|
|
24
|
-
|
|
26
|
+
...icon,
|
|
25
27
|
children: ifDefined(block.config?.buttonConfig?.text),
|
|
26
28
|
attributes: {
|
|
27
29
|
disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderContext.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,cAAc,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACxD"}
|
|
1
|
+
{"version":3,"file":"renderContext.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,cAAc,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderFullSnooBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderFullSnooBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAWvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA6BlF"}
|
|
1
|
+
{"version":3,"file":"renderFullSnooBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderFullSnooBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAWvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA6BlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIconBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderIconBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderIconBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderIconBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA+B9E"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { nothing } from '@reddit/baseplate/html.js';
|
|
2
2
|
import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUIConfig.js';
|
|
3
|
-
import { defaultClasses, iconSizeClass, onClickAction, sizingClass, stackChildClass, } from '../attributes.js';
|
|
4
|
-
import { classMap } from './util.js';
|
|
3
|
+
import { colorStyle, defaultClasses, iconSizeClass, onClickAction, sizingClass, stackChildClass, } from '../attributes.js';
|
|
4
|
+
import { classMap, resolveIcon } from './util.js';
|
|
5
5
|
export function renderIconBlock(block, ctx) {
|
|
6
|
-
const { html } = getTemplateRenderingStrategy();
|
|
6
|
+
const { html, styleMap, ifDefined } = getTemplateRenderingStrategy();
|
|
7
7
|
if (!block.config?.iconConfig) {
|
|
8
8
|
console.error('Invalid block: Icon missing IconConfig');
|
|
9
9
|
return nothing;
|
|
10
10
|
}
|
|
11
11
|
const { icon, size, color } = block.config.iconConfig;
|
|
12
|
-
|
|
12
|
+
const styles = {
|
|
13
|
+
...colorStyle(color),
|
|
14
|
+
};
|
|
13
15
|
const classes = {
|
|
14
16
|
...defaultClasses(block.type),
|
|
15
17
|
...stackChildClass(ctx.stackDirection),
|
|
@@ -17,5 +19,12 @@ export function renderIconBlock(block, ctx) {
|
|
|
17
19
|
...iconSizeClass(size),
|
|
18
20
|
};
|
|
19
21
|
const onClick = onClickAction(block, ctx);
|
|
20
|
-
return html `<div
|
|
22
|
+
return html `<div
|
|
23
|
+
class="${classMap(classes)}"
|
|
24
|
+
style="${styleMap(styles)}"
|
|
25
|
+
@click="${ifDefined(onClick)}"
|
|
26
|
+
data-debug-block-type="icon"
|
|
27
|
+
>
|
|
28
|
+
${resolveIcon(icon)}
|
|
29
|
+
</div>`;
|
|
21
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderImageBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderImageBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAkC/E"}
|
|
1
|
+
{"version":3,"file":"renderImageBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderImageBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAkC/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderSpacerBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderSpacerBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AASvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAmBhF"}
|
|
1
|
+
{"version":3,"file":"renderSpacerBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderSpacerBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AASvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAmBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStackBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderStackBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAuB,MAAM,gBAAgB,CAAC;AAiB5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,GAAG,2BAAsE,EACzE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,KAAK,YAAY,GAC9D,YAAY,CAoEd"}
|
|
1
|
+
{"version":3,"file":"renderStackBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderStackBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAuB,MAAM,gBAAgB,CAAC;AAiB5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,GAAG,2BAAsE,EACzE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,KAAK,YAAY,GAC9D,YAAY,CAoEd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderTextBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderTextBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAkD,MAAM,gBAAgB,CAAC;AAavF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA8D9E"}
|
|
1
|
+
{"version":3,"file":"renderTextBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderTextBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAkD,MAAM,gBAAgB,CAAC;AAavF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA8D9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderWebViewBlock.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/renderWebViewBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,wCAAwC,CAAC;AAEhD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA2BjF"}
|
|
1
|
+
{"version":3,"file":"renderWebViewBlock.d.ts","sourceRoot":"","sources":["../../../library/src/blocks/templates/renderWebViewBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,wCAAwC,CAAC;AAEhD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CA2BjF"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ClassInfo, classMap as clientClassMap } from 'lit/directives/class-map.js';
|
|
2
|
+
import { TemplateResult } from 'lit';
|
|
2
3
|
import { UnsafeString } from '@reddit/baseplate/html.js';
|
|
3
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;
|
|
4
7
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/blocks/templates/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
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"}
|
package/blocks/templates/util.js
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import { classMap as clientClassMap } from 'lit/directives/class-map.js';
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeHTML as clientUnsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
|
+
import { unsafeHTML as serverUnsafeHTML } from '@reddit/baseplate/html.js';
|
|
3
4
|
import { getTemplateRenderingStrategy } from '@reddit/faceplate-ui/faceplateUIConfig.js';
|
|
5
|
+
import faceplateIcons from '@reddit/faceplate-ui/svgs/svg-manifest.js';
|
|
4
6
|
export function classMap(classInfo, forceString) {
|
|
5
7
|
const { getType } = getTemplateRenderingStrategy();
|
|
6
8
|
if (getType() === 'client' && forceString !== true) {
|
|
7
9
|
return clientClassMap(classInfo);
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 ``;
|
|
14
35
|
}
|
|
15
|
-
// eslint-disable-next-line @reddit/no-unsafe/no-unsafe-function-usage
|
|
16
|
-
return unsafe(result);
|
|
17
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"));
|
|
@@ -73,26 +74,15 @@ let DevvitCustomPost = class DevvitCustomPost extends LitElement {
|
|
|
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 +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,5 +1,6 @@
|
|
|
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';
|
|
4
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
6
|
import { html, ifDefined } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
|
|
@@ -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 +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,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"}
|
|
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"}
|
|
@@ -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;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
|
+
{"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/formbuilder/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../library/src/client/formbuilder/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -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;AAqB1D,eAAO,MAAM,gBAAgB,WAAY,SAAS,EAAE,KAAG,cAEtD,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 +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;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,eAAO,MAAM,gBAAgB,UACpB,SAAS,6BACW,SAAS,EAAE,KAAK,cAAc,sBAU1D,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 +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;AAE/D,OAAO,yDAAyD,CAAC;AAEjE,eAAO,MAAM,iBAAiB,UAAW,SAAS,yCAmBjD,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;AAElE,OAAO,6DAA6D,CAAC;AACrE,OAAO,+DAA+D,CAAC;AAGvE,eAAO,MAAM,oBAAoB,UAAW,SAAS,yCAoBpD,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":"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
|
+
{"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 +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;AAE/D,OAAO,yDAAyD,CAAC;AAEjE,eAAO,MAAM,iBAAiB,UAAW,SAAS,yCAqBjD,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":""}
|