@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
17 lines • 2.5 kB
JavaScript
import*as i18n from"../../../core/i18n/i18n.js";import*as Platform from"../../../core/platform/platform.js";import*as ComponentHelpers from"../../components/helpers/helpers.js";import*as LitHtml from"../../lit-html/lit-html.js";import*as IconButton from"../icon_button/icon_button.js";import panelFeedbackStyles from"./panelFeedback.css.js";const UIStrings={previewText:"Our team is actively working on this feature and we would love to know what you think.",previewTextFeedbackLink:"Send us your feedback.",previewFeature:"Preview feature",videoAndDocumentation:"Video and documentation"},str_=i18n.i18n.registerUIStrings("ui/components/panel_feedback/PanelFeedback.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_),previewFeatureUrl=new URL("../../../Images/experiment.svg",import.meta.url).toString(),videoThumbnailUrl=new URL("../../../Images/preview_feature_video_thumbnail.svg",import.meta.url).toString();export class PanelFeedback extends HTMLElement{static litTagName=LitHtml.literal`devtools-panel-feedback`;#e=this.attachShadow({mode:"open"});#t=this.#i.bind(this);#n={feedbackUrl:Platform.DevToolsPath.EmptyUrlString,quickStartUrl:Platform.DevToolsPath.EmptyUrlString,quickStartLinkText:""};connectedCallback(){this.#e.adoptedStyleSheets=[panelFeedbackStyles]}set data(e){this.#n=e,ComponentHelpers.ScheduledRender.scheduleRender(this,this.#t)}#i(){if(!ComponentHelpers.ScheduledRender.isScheduledRender(this))throw new Error("PanelFeedback render was not scheduled");LitHtml.render(LitHtml.html`
<div class="preview">
<h2 class="flex">
<${IconButton.Icon.Icon.litTagName} .data=${{iconPath:previewFeatureUrl,width:"20px",height:"20px",color:"var(--icon-primary)"}}></${IconButton.Icon.Icon.litTagName}> ${i18nString(UIStrings.previewFeature)}
</h2>
<p>${i18nString(UIStrings.previewText)} <x-link href=${this.#n.feedbackUrl}>${i18nString(UIStrings.previewTextFeedbackLink)}</x-link></p>
<div class="video">
<div class="thumbnail">
<img src=${videoThumbnailUrl} role="presentation" />
</div>
<div class="video-description">
<h3>${i18nString(UIStrings.videoAndDocumentation)}</h3>
<x-link class="quick-start-link" href=${this.#n.quickStartUrl}>${this.#n.quickStartLinkText}</x-link>
</div>
</div>
</div>
`,this.#e,{host:this})}}ComponentHelpers.CustomElements.defineComponent("devtools-panel-feedback",PanelFeedback);