@rocketspark/domain-checker
Version:
Embeddable Domain Checker for Rocketspark
13 lines • 6.37 kB
JavaScript
/*!
*
* @rocketspark/domain-checker v1.0.12
* git+https://github.com/rocketspark/domain-checker.git
*
* Copyright (c) Lee Reichardt and project contributors.
*
* This source code is licensed under the no license license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";(self.webpackChunkDomainChecker=self.webpackChunkDomainChecker||[]).push([[871],{8871:function(t,e,r){r.r(e),r.d(e,{rs_select:function(){return i},rs_template_card:function(){return s}});var o=r(6919);const i=class{constructor(t){(0,o.r)(this,t),this.selectChange=(0,o.c)(this,"selectChange",7),this.items=[],this.handleChange=t=>{const e=t.target.value;this.selectChange.emit(""===e?null:e)}}watchItems(){this.buildItems()}render(){return(0,o.h)("div",{key:"a03d0f27e3dd098d1c1fc82dd948d299071993c6"},(0,o.h)("select",{key:"99a3e302a150cb0e26c6e4fb260910f940fe5d56",onChange:this.handleChange},(0,o.h)("option",{key:"563372f129db4fb8aa34037748264c044c6b83c8",value:"",selected:!0},"Show all"),this.itemsToDisplay.map((({value:t,label:e})=>(0,o.h)("option",{value:t},e)))))}componentWillLoad(){this.buildItems()}buildItems(){if("string"==typeof this.items)try{this.itemsToDisplay=JSON.parse(this.items)}catch(t){this.itemsToDisplay=[]}else this.itemsToDisplay=this.items}static get watchers(){return{items:["watchItems"]}}};i.style='div{position:relative}div::after{content:" ";position:absolute;top:50%;right:10px;width:0;height:0;border:5px solid transparent;border-top-color:var(--rs-color-secondary);transform:translateY(-25%)}select{width:100%;padding:11px;appearance:none;border-radius:2.5px;border:1px solid var(--rs-color-select-border);background:var(--rs-color-select-background);font-family:Soleil, sans-serif;color:var(--rs-color-secondary)}select:active,select:focus,select:focus-visible{border:1px solid var(--rs-color-grey-300);outline:none}';const s=class{constructor(t){(0,o.r)(this,t),this.useTemplate=(0,o.c)(this,"useTemplate",7),this.previewTemplate=(0,o.c)(this,"previewTemplate",7),this.isFlintOptimised=!1,this.empty=!1,this.doTouchEvent=!1,this.useTemplateHandler=()=>{this.useTemplate.emit(this.templateId)},this.previewTemplateHandler=()=>{this.previewTemplate.emit(this.templateId)},this.touchStartHandler=()=>{this.doTouchEvent=!0},this.touchMoveHandler=()=>{this.doTouchEvent=!1}}render(){return this.empty?this.renderEmptyTemplate():this.renderStandardTemplate()}renderStandardTemplate(){return(0,o.h)(o.H,{onTouchStart:this.touchStartHandler,onTouchMove:this.touchMoveHandler,onTouchEnd:this.touchEndHandler(this.previewTemplateHandler)},!0===this.isFlintOptimised&&(0,o.h)("div",{class:"rs-template-card-container"},(0,o.h)("div",{class:"rs-template-card-icon-container"},(0,o.h)("rs-icon",{name:"lightning",size:28,color:"positive"}))),(0,o.h)("img",{class:"thumbnail",src:this.thumbnail,alt:this.name}),(0,o.h)("div",{class:"overlay"},!0===this.isFlintOptimised&&(0,o.h)("div",{class:"rs-template-card-container"},(0,o.h)("div",{class:"rs-template-card-tooltip"},(0,o.h)("p",null,"Works great with Flint auto-writing")),(0,o.h)("div",{class:"rs-template-card-icon-container"},(0,o.h)("rs-icon",{name:"lightning",size:28,color:"positive"}))),(0,o.h)("button",{class:"button--use",onClick:this.useTemplateHandler},"Start with this design"),(0,o.h)("button",{class:"button--hollow button--preview",onClick:this.previewTemplateHandler},"Preview design")))}renderEmptyTemplate(){return(0,o.h)(o.H,{onTouchStart:this.touchStartHandler,onTouchMove:this.touchMoveHandler,onTouchEnd:this.touchEndHandler(this.useTemplateHandler)},(0,o.h)("rs-icon",{name:"brush",size:40,color:"primary-700",style:{transform:"rotate(1deg)"}}),(0,o.h)("rs-subtitle",{subtitle:"1",color:"grey"},"Start from scratch"),(0,o.h)("div",{class:"overlay"},(0,o.h)("button",{class:"button--use",onClick:this.useTemplateHandler},"Start from scratch")))}touchEndHandler(t){return()=>{this.doTouchEvent&&t()}}};s.style=":host{overflow:hidden;border:1px solid var(--rs-color-select-border);border-radius:8px;position:relative;background:var(--rs-color-white);display:flex;justify-content:center;align-items:center;flex-direction:column;row-gap:30px;aspect-ratio:428.59 / 596}.thumbnail{display:block;width:100%;height:auto}rs-subtitle{text-align:center;font-size:20px;font-weight:600;line-height:130%}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;display:flex;justify-content:center;align-items:center;flex-direction:column;row-gap:24px;background:rgb(250 247 242 / 0.97);opacity:0;visibility:hidden;transition:opacity 0.3s ease-out, visibility 0.3s ease-out}:host(:hover) .overlay{visibility:visible;opacity:1}button{width:80%;border-radius:4px;padding:12px 25px;font-family:Soleil, sans-serif;font-size:16px;font-weight:600;cursor:pointer;text-decoration:none;user-select:none;outline:none;white-space:nowrap;background:var(--rs-color-primary-700);border:none;color:var(--rs-color-white);transition:background 0.25s ease-out 0s}button:hover{background:var(--rs-color-primary);border:none}.button--hollow{background:none;box-shadow:inset 0 0 0 1px var(--rs-color-primary-700);color:var(--rs-color-primary-700);transition:border 0.25s ease-out 0s}.button--hollow:hover{box-shadow:inset 0 0 0 1px var(--rs-color-primary);background:none}.rs-template-card-container{position:absolute;top:5%;right:6%;width:auto;display:flex;gap:10px;align-items:center;flex-direction:row;padding-left:25px;height:50px}.rs-template-card-icon-container{border-radius:50%;background-color:var(--rs-color-white);width:50px;height:50px;display:flex;align-items:center;justify-content:center;flex:none;box-shadow:var(--rs-shadow-tooltip)}.rs-template-card-tooltip{background-color:var(--rs-color-secondary);color:var(--rs-color-white);padding:14px 16px;border-radius:4px;font-family:Soleil, sans-serif;font-size:14px;font-style:normal;font-weight:400;position:relative}.rs-template-card-tooltip::before{content:'';position:absolute;display:block;width:0;right:0;top:50%;border:8px solid transparent;border-right:0;border-left:8px solid var(--rs-color-secondary);transform:translate(calc(100%), -50%)}.rs-template-card-tooltip p{margin:0;line-height:normal}@media only screen and (max-width: 667px){.overlay{display:none}button{width:90%}rs-icon{font-size:16px}rs-subtitle{font-size:16px}}"}}]);
//# sourceMappingURL=871.index.js.map