@creaditor/web-starterkit 1.0.10 → 1.0.12
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/dist/1142.creaditor.bundle.js +1 -1
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1260.creaditor.bundle.js +86 -42
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -1
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js +2 -2
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +21 -20
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js +121 -1
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js +1 -1
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js +1 -1
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js +1 -1
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/3778.creaditor.bundle.js +1 -0
- package/dist/3778.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js +1 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js +1 -1
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js +10 -10
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +11 -111
- package/dist/453.creaditor.bundle.js.LICENSE.txt +5 -0
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +3 -3
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js +1 -1
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +1 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js +3 -3
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js +3 -3
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +1316 -0
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +34 -1
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +30 -29
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +91 -0
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +9 -5
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +1 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +49 -20
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +1 -1
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js +1 -1
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +98 -56
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +4 -4
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js +1 -1
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +20 -17
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js +1 -1
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +20 -24
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js +7 -7
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +13 -15
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js +1 -1
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js +1 -1
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/9994.creaditor.bundle.js +114 -0
- package/dist/9994.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +968 -583
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1142],{41142(e,t,n){n.d(t,{default:()=>b});const o=e=>{{const{component:t,commands:n,helpers:o}=e,s=t.parent("col");return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1142],{41142(e,t,n){n.d(t,{default:()=>b});const o=e=>{{const{component:t,commands:n,helpers:o}=e,s=t.parent("col");return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"style"},{text:"animations"},{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:r,changeTab:a,tabs:i}=e;const l=[{type:"input",title:"add_urlAddress_from_media_site",active:()=>"style"===r.text,value:t.props.url||"",onChange:e=>{let t=e.target.value;if(-1!==t.indexOf("youtube.com/shorts/")){const e=t.split("/");e.length>0&&(t=`https://youtu.be/${e[e.length-1]}`)}n.execCommand("url",t)}},{type:"divider",active:()=>"style"===r.text},{type:"fontSize",title:"size",min:10,active:()=>"style"===r.text,max:s?.element?.offsetWidth,value:parseInt(t.props.style.width),device:e=>{if("phone"===e.target.device){const n=t.props?.breakpoints?.sm?.style?.width||t.props.style.width;e.target.value=parseInt(n)}else e.target.value=parseInt(t.props.style.width)},onInput:e=>{const t=e.target.value;"phone"===e.target.device?n.execCommand("breakpoints",e=>{const n=e.props.breakpoints?.sm||{};return{sm:o.deepMerge(n,{style:{width:t+"px",height:e.props.isCircle?t+"px":"auto"}})}}):n.execCommand("style",e=>({width:t+"px",height:e.props.isCircle?t+"px":"auto"}))}},{type:"divider"},{type:"divider",active:()=>"style"===r.text}];return l}}}};var s=n(52144);const r=()=>({set:(e,t,n)=>{switch(t){case"url":return e[t]=n,!0;case"style":if("object"==typeof n)return n.width&&(n.height=parseFloat(n.width)/1.8+"px"),e[t]=(0,s.A)(e[t],n),!0}}});var a=n(72591),i=n.n(a),l=n(88639),c=n.n(l),p=n(88128),d=n.n(p),h=n(30855),u=n.n(h),A=n(93051),m=n.n(A),y=n(51115),g={};g.setAttributes=u(),g.insert=d().bind(null,"head"),g.domAPI=c(),g.insertStyleElement=m();i()(y.A,g);const v=y.A&&y.A.locals?y.A.locals:void 0;n(15284);const C="video";const b=()=>({name:C,create:e=>{const{createElement:t,compose:n,helpers:s}=e,{arrayToString:a,mergeDiff:i}=s,l=document.createElement("div");l.classList.add(v.root);const c=document.createElement("div");c.classList.add(v.cover);const p=document.createElement("cdtr-media-player");return l.append(p,c),l.addEventListener("click",()=>{p.playing=!1}),t({name:C,id:n.id,template:l,defaultProps:{style:{height:"auto",width:"400px",height:"300px",playing:!1,loop:!1,light:!1,controls:!0,autoPlay:!1,muted:!1,url:"https://www.youtube.com/watch?v=04Or_U9OexU"}},draggable:{group:"element"},droppable:{group:"element"},render:e=>{p.url=n.props.url,i(p,{style:n.props.style}),p.width=n.props.style.width,p.height=n.props.style.height},atomElement:p,resizeable:()=>l,handleBar:!0,validator:r(),schema:n.schema,onSelect:e=>{p.classList.add(e)},onDeselect:e=>{p.classList.remove(e)},elementProps:n,remove:()=>{l.remove()},createEditor:o})}})},51115(e,t,n){n.d(t,{A:()=>i});var o=n(82001),s=n.n(o),r=n(40935),a=n.n(r)()(s());a.push([e.id,".BaT92HY5C7Gxgg9C1_pc {\n position: relative;\n max-width: 100%;\n}\n.aybkK2AXl8f2XctkkRjJ {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.BaT92HY5C7Gxgg9C1_pc:hover .aybkK2AXl8f2XctkkRjJ {\n display: block;\n background-color: var(--primary);\n}\n","",{version:3,sources:["webpack://./../web-editors/video-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,eAAe;AACjB;AACA;EACE,WAAW;EACX,YAAY;EACZ,OAAO;EACP,MAAM;EACN,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,cAAc;EACd,gCAAgC;AAClC",sourcesContent:[".root {\n position: relative;\n max-width: 100%;\n}\n.cover {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.root:hover .cover {\n display: block;\n background-color: var(--primary);\n}\n"],sourceRoot:""}]),a.locals={root:"BaT92HY5C7Gxgg9C1_pc",cover:"aybkK2AXl8f2XctkkRjJ"};const i=a}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),n=o(36565),a=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var c=o(9334),l=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent();return e&&"section"===e.type?(e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t):[this.component]},this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this._sectionsExpanded=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=i.M.get("config","channel");this.tabs=[{text:"background"},{text:"design",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="design",this.maxWidth=0,this.background="",this.padding={topValue:0,bottomValue:0,leftValue:0,rightValue:0},this.margin={topValue:0,bottomValue:0},this.borderStyle="solid",this.borderWidth=0,this.borderColor="#000",this.theme=i.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{n.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,n.Ay.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;n.Ay.store().execCommand("style",{borderStyle:this.borderStyle,borderColor:this.borderColor,borderTopWidth:t.target.borderTopWidth||"0px",borderBottomWidth:t.target.borderBottomWidth||"0px",borderLeftWidth:t.target.borderLeftWidth||"0px",borderRightWidth:t.target.borderRightWidth||"0px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius||0)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},n.Ay.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.A)(e)){const t=p.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==d.findIndex(t=>t===e)}(e));else if(function(t){if(t&&t.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return!0;return!1}(e)){const t=p.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(n.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),n.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,o=[];Array.isArray(e)?e.forEach(t=>o.push(t.src)):o.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:o.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;n.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(n.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Ay.store().execCommand("style",{[(0,c.A)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,c.A)(`padding-${o.toLowerCase()}`);"all"===o?(n.Ay.store().execCommand("style",{padding:null,"padding-top":null,"padding-bottom":null,"padding-left":null,"padding-right":null,paddingTop:e+"px",paddingBottom:e+"px",paddingLeft:e+"px",paddingRight:e+"px","padding-right":null,"padding-left":null,"padding-top":null,"padding-bottom":null}),this.padding={topValue:e,bottomValue:e,leftValue:e,rightValue:e}):(n.Ay.store().execCommand("style",{[r]:e+"px",[`padding-${o.toLowerCase()}`]:null}),this.props.style={[r]:e+"px"},this[`padding${o.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;n.Ay.components.forEach(t=>{const o=t.find("text");if(o&&!o.closest("card")){let t=o.tiptap.getAttributes("textStyle").color;if(!t){const e=o.element.querySelector("p,h1,h2,h3,h4,h5,h6");e&&(t=window.getComputedStyle(e).color)}if(t){if("transparent"===t)return;if(!t.includes("var(--")&&!e.includes("var(--")&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgb(0, 0, 0)"!==e){const r=(0,l.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),n.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.M.get("config","channel")&&n.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:o,value:r}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[o])throw new Error(`${o} is not a valid property`);e.style[o]=r,n.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),n.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();n.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=n.Ay.components[n.Ay.components.length-1];if(this.component=t,t&&"block"===t.type){this.props=t.props;let{style:e}=this.props;e||(e={}),t.props||(t.props={}),t.props.style||(t.props.style={}),this.expand_image_for_outlook=!!t.props.expand_image_for_outlook,this.boxShadow=t.props.style.boxShadow,this.borderStyle=t.props.style.borderStyle,this.borderWidth=t.props.style.borderWidth,this.borderTopRightRadius=parseInt(t.props.style.borderTopRightRadius),this.borderTopLeftRadius=parseInt(t.props.style.borderTopLeftRadius),this.borderBottomRightRadius=parseInt(t.props.style.borderBottomRightRadius),this.borderBottomLeftRadius=parseInt(t.props.style.borderBottomLeftRadius),this.borderTopWidth=parseInt(t.props.style.borderTopWidth),this.borderBottomWidth=parseInt(t.props.style.borderBottomWidth),this.borderLeftWidth=parseInt(t.props.style.borderLeftWidth),this.borderRightWidth=parseInt(t.props.style.borderRightWidth),this.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.isBackgroundImage){const t=o.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,i=window.getComputedStyle(r);this.maxWidth=parseInt(i.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||i.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(i.paddingTop),bottomValue:parseInt(i.paddingBottom),leftValue:parseInt(i.paddingLeft),rightValue:parseInt(i.paddingRight)},this.margin={topValue:parseInt(i.marginTop),bottomValue:parseInt(i.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,n.Ay.store().execCommand("modalable",this.modalable)}_setModalName(t){this.modalName=t,n.Ay.store().execCommand("modalName",t)}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.shadowRoot.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded})}render(){const t=i.M.get("config","channel");return r.qy`
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),a=o(36565),n=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var l=o(9334),c=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;a.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent();return e&&"section"===e.type?(e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t):[this.component]},this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this._sectionsExpanded=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=i.M.get("config","channel");this.tabs=[{text:"background"},{text:"style",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="style",this.maxWidth=0,this.background="",this.padding={topValue:0,bottomValue:0,leftValue:0,rightValue:0},this.margin={topValue:0,bottomValue:0},this.borderStyle="solid",this.borderWidth=0,this.borderColor="#000",this.theme=i.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{a.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,a.Ay.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;a.Ay.store().execCommand("style",{borderStyle:this.borderStyle,borderColor:this.borderColor,borderTopWidth:t.target.borderTopWidth||"0px",borderBottomWidth:t.target.borderBottomWidth||"0px",borderLeftWidth:t.target.borderLeftWidth||"0px",borderRightWidth:t.target.borderRightWidth||"0px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius||0)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},a.Ay.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.A)(e)){const t=p.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==d.findIndex(t=>t===e)}(e));else if(function(t){if(t&&t.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return!0;return!1}(e)){const t=p.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(a.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),a.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,o=[];Array.isArray(e)?e.forEach(t=>o.push(t.src)):o.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:o.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;a.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(a.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):a.Ay.store().execCommand("style",{[(0,l.A)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,l.A)(`padding-${o.toLowerCase()}`);"all"===o?(a.Ay.store().execCommand("style",{padding:null,"padding-top":null,"padding-bottom":null,"padding-left":null,"padding-right":null,paddingTop:e+"px",paddingBottom:e+"px",paddingLeft:e+"px",paddingRight:e+"px","padding-right":null,"padding-left":null,"padding-top":null,"padding-bottom":null}),this.padding={topValue:e,bottomValue:e,leftValue:e,rightValue:e}):(a.Ay.store().execCommand("style",{[r]:e+"px",[`padding-${o.toLowerCase()}`]:null}),this.props.style={[r]:e+"px"},this[`padding${o.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;a.Ay.components.forEach(t=>{const o=t.find("text");if(o&&!o.closest("card")){let t=o.tiptap.getAttributes("textStyle").color;if(!t){const e=o.element.querySelector("p,h1,h2,h3,h4,h5,h6");e&&(t=window.getComputedStyle(e).color)}if(t){if("transparent"===t)return;if(!t.includes("var(--")&&!e.includes("var(--")&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgb(0, 0, 0)"!==e){const r=(0,c.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),a.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.M.get("config","channel")&&a.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:o,value:r}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[o])throw new Error(`${o} is not a valid property`);e.style[o]=r,a.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),a.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),a.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();a.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=a.Ay.components[a.Ay.components.length-1];if(this.component=t,t&&"block"===t.type){this.props=t.props;let{style:e}=this.props;e||(e={}),t.props||(t.props={}),t.props.style||(t.props.style={}),this.expand_image_for_outlook=!!t.props.expand_image_for_outlook,this.boxShadow=t.props.style.boxShadow,this.borderStyle=t.props.style.borderStyle,this.borderWidth=t.props.style.borderWidth,this.borderTopRightRadius=parseInt(t.props.style.borderTopRightRadius),this.borderTopLeftRadius=parseInt(t.props.style.borderTopLeftRadius),this.borderBottomRightRadius=parseInt(t.props.style.borderBottomRightRadius),this.borderBottomLeftRadius=parseInt(t.props.style.borderBottomLeftRadius),this.borderTopWidth=parseInt(t.props.style.borderTopWidth),this.borderBottomWidth=parseInt(t.props.style.borderBottomWidth),this.borderLeftWidth=parseInt(t.props.style.borderLeftWidth),this.borderRightWidth=parseInt(t.props.style.borderRightWidth),this.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.popupTrigger=t.props.popupTrigger||"button",this.popupDelay=null==t.props.popupDelay?3:t.props.popupDelay,this._rebuildTabs(),this.isBackgroundImage){const t=o.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,i=window.getComputedStyle(r);this.maxWidth=parseInt(i.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||i.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(i.paddingTop),bottomValue:parseInt(i.paddingBottom),leftValue:parseInt(i.paddingLeft),rightValue:parseInt(i.paddingRight)},this.margin={topValue:parseInt(i.marginTop),bottomValue:parseInt(i.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,a.Ay.store().execCommand("modalable",this.modalable),this.tabName=t?"popup":"style",this._rebuildTabs()}_rebuildTabs(){const t=i.M.get("config","channel"),e="web"===t&&this.modalable,o=[{text:"background"},{text:"style"},..."web"===t?[{text:"animations"}]:[],{text:"settings"},...e?[{text:"popup"}]:[]];let r=this.tabName;o.some(t=>t.text===r)||(r=e?"popup":"style"),o.forEach(t=>t.selected=t.text===r),this.tabName=r,this.tabs=o}_setModalName(t){this.modalName=t,a.Ay.store().execCommand("modalName",t)}_setPopupTrigger(t){this.popupTrigger=t,a.Ay.store().execCommand("popupTrigger",t)}_setPopupDelay(t){const e=Math.max(0,parseInt(t,10)||0);this.popupDelay=e,a.Ay.store().execCommand("popupDelay",e)}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.shadowRoot.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded})}render(){const t=i.M.get("config","channel");return r.qy`
|
|
2
2
|
<cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
|
|
3
3
|
<div slot="content">
|
|
4
4
|
<div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
></lang-text></paper-button>
|
|
34
34
|
<paper-button
|
|
35
35
|
class="backgrounds"
|
|
36
|
-
@click=${()=>
|
|
36
|
+
@click=${()=>n.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:a.Ay.components[0]})}
|
|
37
37
|
><lang-text
|
|
38
38
|
text="backgrounds"
|
|
39
39
|
></lang-text></paper-button>
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
></lang-text>
|
|
79
79
|
</h6>
|
|
80
80
|
</cdtr-editor-section>`:null}
|
|
81
|
-
${"
|
|
81
|
+
${"style"===this.tabName?r.qy`
|
|
82
82
|
<cdtr-editor-section label="backgroundColor" .open=${!0}>
|
|
83
83
|
<cdtr-color-swatch-group
|
|
84
84
|
.columns=${1}
|
|
@@ -165,23 +165,60 @@
|
|
|
165
165
|
></cdtr-checkbox>
|
|
166
166
|
</cdtr-col>
|
|
167
167
|
</cdtr-row>
|
|
168
|
-
${this.modalable?r.qy
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
168
|
+
${this.modalable?r.qy`<p
|
|
169
|
+
style="font-size:12px;color:#888;line-height:1.5;margin:6px 0 0;font-style:italic;"
|
|
170
|
+
>
|
|
171
|
+
<lang-text
|
|
172
|
+
whiteSpace="normal"
|
|
173
|
+
text="popup_settings_in_tab"
|
|
174
|
+
></lang-text>
|
|
175
|
+
</p>`:null}
|
|
176
|
+
`:null}
|
|
177
|
+
</cdtr-editor-section>
|
|
178
|
+
`:null}
|
|
179
|
+
|
|
180
|
+
${"popup"===this.tabName?r.qy`
|
|
181
|
+
<cdtr-editor-section label="modal_name" .open=${!0}>
|
|
182
|
+
<cdtr-input
|
|
183
|
+
style="width:100%"
|
|
184
|
+
.value=${this.modalName||""}
|
|
185
|
+
.placeholder=${i.M.get("lang","modal_name")||""}
|
|
186
|
+
@change=${t=>this._setModalName(t.target.value)}
|
|
187
|
+
></cdtr-input>
|
|
188
|
+
</cdtr-editor-section>
|
|
189
|
+
|
|
190
|
+
<cdtr-editor-section label="popup_trigger_label" .open=${!0}>
|
|
191
|
+
<select
|
|
192
|
+
style="width:100%;padding:8px;border:1px solid var(--color-border,#e0e0e0);border-radius:8px;font:inherit;background:#fff;cursor:pointer;"
|
|
193
|
+
@change=${t=>this._setPopupTrigger(t.target.value)}
|
|
194
|
+
>
|
|
195
|
+
${["button","load","delay","exit"].map(t=>r.qy`<option
|
|
196
|
+
value=${t}
|
|
197
|
+
?selected=${this.popupTrigger===t}
|
|
198
|
+
>
|
|
199
|
+
${i.M.get("lang","popup_trigger_"+t)||t}
|
|
200
|
+
</option>`)}
|
|
201
|
+
</select>
|
|
202
|
+
${"delay"===this.popupTrigger?r.qy`
|
|
203
|
+
<cdtr-title style="display:block;margin-top:8px">
|
|
204
|
+
<lang-text text="popup_delay_label"></lang-text>
|
|
205
|
+
</cdtr-title>
|
|
206
|
+
<input
|
|
207
|
+
type="number"
|
|
208
|
+
min="0"
|
|
209
|
+
style="width:100%;padding:8px;border:1px solid var(--color-border,#e0e0e0);border-radius:8px;font:inherit;box-sizing:border-box;"
|
|
210
|
+
.value=${String(this.popupDelay)}
|
|
211
|
+
@change=${t=>this._setPopupDelay(t.target.value)}
|
|
212
|
+
/>
|
|
184
213
|
`:null}
|
|
214
|
+
<p
|
|
215
|
+
style="font-size:12px;color:#888;line-height:1.5;margin:8px 0 0;font-style:italic;"
|
|
216
|
+
>
|
|
217
|
+
<lang-text
|
|
218
|
+
whiteSpace="normal"
|
|
219
|
+
text="modal_name_hint"
|
|
220
|
+
></lang-text>
|
|
221
|
+
</p>
|
|
185
222
|
</cdtr-editor-section>
|
|
186
223
|
`:null}
|
|
187
224
|
|
|
@@ -238,22 +275,29 @@
|
|
|
238
275
|
paper-button.gallery,
|
|
239
276
|
paper-button.backgrounds {
|
|
240
277
|
text-transform: none;
|
|
241
|
-
font-size:
|
|
278
|
+
font-size: var(--text-sm, 13px);
|
|
242
279
|
font-weight: 500;
|
|
243
280
|
letter-spacing: 0.01em;
|
|
244
|
-
border-radius: 6px;
|
|
245
|
-
padding:
|
|
281
|
+
border-radius: var(--radius-sm, 6px);
|
|
282
|
+
padding: var(--space-2, 8px) var(--space-4, 16px);
|
|
246
283
|
min-width: 0;
|
|
284
|
+
transition: background var(--duration-fast, 120ms) var(--ease-default, ease);
|
|
247
285
|
}
|
|
248
286
|
paper-button.gallery {
|
|
249
|
-
background: var(--primary);
|
|
250
|
-
color: var(--primary-text);
|
|
287
|
+
background: var(--color-primary, #6366f1);
|
|
288
|
+
color: var(--color-primary-text, #fff);
|
|
289
|
+
}
|
|
290
|
+
paper-button.gallery:hover {
|
|
291
|
+
background: var(--color-primary-hover, #4f46e5);
|
|
251
292
|
}
|
|
252
293
|
paper-button.backgrounds {
|
|
253
|
-
background: #
|
|
254
|
-
color: #
|
|
294
|
+
background: var(--color-bg-muted, #f4f4f6);
|
|
295
|
+
color: var(--color-text-secondary, #555);
|
|
296
|
+
}
|
|
297
|
+
paper-button.backgrounds:hover {
|
|
298
|
+
background: #eaeaed;
|
|
255
299
|
}
|
|
256
|
-
`,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>
|
|
300
|
+
`,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},popupTrigger:{type:String},popupDelay:{type:Number},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>n});var r=o(59929),i=o(57176);class a extends r.WF{constructor(){super(),this.items=[],this.columns=2}async openPicker(t){const e=this.shadowRoot.querySelector(`#picker-${t}`);if(!e)return;await e.updateComplete;const o=e.shadowRoot?.querySelector("color-playground");if(o)if(await o.updateComplete,"function"==typeof o.openColorpicker)o.openColorpicker();else{(o.shadowRoot?.querySelector('[role="button"]')||o.shadowRoot?.querySelector("div")||o).click()}}render(){const t=1===this.columns?"grid single-col":"grid";return r.qy`
|
|
257
301
|
<div class="${t}">
|
|
258
302
|
${(this.items||[]).map((t,e)=>r.qy`
|
|
259
303
|
<div class="swatch-item" @click=${()=>this.openPicker(e)}>
|
|
@@ -277,7 +321,7 @@
|
|
|
277
321
|
</div>
|
|
278
322
|
`)}
|
|
279
323
|
</div>
|
|
280
|
-
`}}
|
|
324
|
+
`}}a.styles=[i.L,r.AH`
|
|
281
325
|
:host {
|
|
282
326
|
display: block;
|
|
283
327
|
direction: var(--direction-locale, ltr);
|
|
@@ -325,12 +369,12 @@
|
|
|
325
369
|
clip: rect(0,0,0,0);
|
|
326
370
|
pointer-events: none;
|
|
327
371
|
}
|
|
328
|
-
`],
|
|
372
|
+
`],a.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",a);const n=t=>r.qy`
|
|
329
373
|
<cdtr-color-swatch-group
|
|
330
374
|
.items=${t.items}
|
|
331
375
|
.columns=${t.columns||2}
|
|
332
376
|
></cdtr-color-swatch-group>
|
|
333
|
-
`},12258(t,e,o){o.d(e,{A:()=>
|
|
377
|
+
`},12258(t,e,o){o.d(e,{A:()=>n});var r=o(59929),i=o(40648);class a extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,i.Q)(this.persistKey,this.open)}render(){return r.qy`
|
|
334
378
|
<div class="section">
|
|
335
379
|
<div class="header" @click=${this.toggle}>
|
|
336
380
|
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
@@ -344,44 +388,44 @@
|
|
|
344
388
|
</div>
|
|
345
389
|
</div>
|
|
346
390
|
</div>
|
|
347
|
-
`}}
|
|
391
|
+
`}}a.styles=r.AH`
|
|
348
392
|
:host {
|
|
349
393
|
display: block;
|
|
350
394
|
direction: var(--direction-locale, ltr);
|
|
351
395
|
--editor-container-inline-padding: 0;
|
|
352
396
|
}
|
|
353
397
|
.section {
|
|
354
|
-
border-bottom: 1px solid
|
|
398
|
+
border-bottom: 1px solid var(--color-border);
|
|
355
399
|
}
|
|
356
400
|
.header {
|
|
357
401
|
display: flex;
|
|
358
402
|
align-items: center;
|
|
359
403
|
justify-content: space-between;
|
|
360
|
-
padding:
|
|
404
|
+
padding: var(--space-3) var(--space-4);
|
|
361
405
|
cursor: pointer;
|
|
362
406
|
user-select: none;
|
|
363
407
|
}
|
|
364
408
|
.title {
|
|
365
|
-
font-size:
|
|
409
|
+
font-size: var(--text-md);
|
|
366
410
|
font-weight: 600;
|
|
367
|
-
color:
|
|
411
|
+
color: var(--color-text);
|
|
368
412
|
letter-spacing: 0.01em;
|
|
369
413
|
}
|
|
370
414
|
.chevron {
|
|
371
415
|
width: 16px;
|
|
372
416
|
height: 16px;
|
|
373
|
-
transition: transform
|
|
374
|
-
color:
|
|
417
|
+
transition: transform var(--duration-normal) var(--ease-default), color var(--duration-fast) var(--ease-default);
|
|
418
|
+
color: var(--color-text-faint);
|
|
375
419
|
}
|
|
376
420
|
.header:hover .chevron {
|
|
377
|
-
color:
|
|
421
|
+
color: var(--color-text-muted);
|
|
378
422
|
}
|
|
379
423
|
.chevron.open {
|
|
380
424
|
transform: rotate(180deg);
|
|
381
425
|
}
|
|
382
426
|
.content {
|
|
383
427
|
overflow: hidden;
|
|
384
|
-
transition: max-height
|
|
428
|
+
transition: max-height var(--duration-normal) var(--ease-default), opacity var(--duration-fast) var(--ease-default);
|
|
385
429
|
max-height: 0;
|
|
386
430
|
opacity: 0;
|
|
387
431
|
}
|
|
@@ -390,9 +434,9 @@
|
|
|
390
434
|
opacity: 1;
|
|
391
435
|
}
|
|
392
436
|
.content-inner {
|
|
393
|
-
padding:
|
|
437
|
+
padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
|
|
394
438
|
}
|
|
395
|
-
`,
|
|
439
|
+
`,a.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",a);const n=(t,e)=>r.qy`
|
|
396
440
|
<cdtr-editor-section
|
|
397
441
|
.label=${t.label}
|
|
398
442
|
.open=${!1!==t.open}
|
|
@@ -400,4 +444,4 @@
|
|
|
400
444
|
>
|
|
401
445
|
${e}
|
|
402
446
|
</cdtr-editor-section>
|
|
403
|
-
`},40648(t,e,o){o.d(e,{Q:()=>
|
|
447
|
+
`},40648(t,e,o){o.d(e,{Q:()=>n,i:()=>a});const r="cdtr:section-open";function i(){try{const t=localStorage.getItem(r);return t?JSON.parse(t):{}}catch(t){return{}}}function a(t){if(!t)return;const e=i();return Object.prototype.hasOwnProperty.call(e,t)?!!e[t]:void 0}function n(t,e){if(!t)return;const o=i();o[t]=!!e,function(t){try{localStorage.setItem(r,JSON.stringify(t))}catch(t){}}(o)}}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1271],{71271(e,t,n){n.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1271],{71271(e,t,n){n.d(t,{default:()=>y});var o=n(53577),i=n(74265),a=n(86319),l=n(20252);const s=[100,300,400,500,600,700,900].map(e=>({value:String(e),label:String(e)})),r=e=>{{const{component:t,commands:n,helpers:r}=e,c=t.tiptap,p=c.state.selection.$anchor.node().attrs,u=c.isActive("heading",{level:1})?"h1":c.isActive("heading",{level:2})?"h2":c.isActive("heading",{level:3})?"h3":c.isActive("heading",{level:4})?"h4":c.isActive("heading",{level:5})?"h5":c.isActive("heading",{level:6})?"h6":"paragraph";let d=e.languageJson;const g=e.language||"he";return d||(d="he"===g?o:i),{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=c.isActive("customBulletItem"),n=[{text:"style",selected:!t},...t?[{text:"icons",selected:!0}]:[],{text:"settings"}];return n.forEach(t=>t.selected=t.text===e),n},layout:e=>{let{tab:o,changeTab:i,tabs:r}=e;return[{type:"info",text:"text_micro_copy",active:()=>"style"===o.text},{type:"heading",level:6,text:"typography",active:()=>"style"===o.text},{type:"dropdown",active:()=>"style"===o.text,title:"type",value:u,items:[{value:"H1"},{value:"H2"},{value:"H3"},{value:"H4"},{value:"H5"},{value:"H6"},{value:"paragraph"}],onChange:e=>{const t=e.target.value;switch(t){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":c.chain().setHeading({level:parseInt(t.slice(1))}).run();break;case"paragraph":c.chain().setParagraph().run()}}},{type:"slider",title:"fontSize",min:8,step:2,max:74,value:parseInt(c.getAttributes("textStyle").fontSize||"16px"),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontSize(n).run():o.chain().setFontSize(n).run()}},{type:"dropdown",title:"fontWeight",active:()=>"style"===o.text&&"web"===a.M.get("config","channel"),value:String(c.getAttributes("textStyle").fontWeight||400),selected:String(c.getAttributes("textStyle").fontWeight||400),items:s,onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontWeight(n).run():o.chain().setFontWeight(n).run()}},{type:"checkbox",title:"smart_change",active:()=>"style"===o.text,checked:(0,l.z)(),onChange:e=>{(0,l.R)(!!e.target.checked)}},{type:"heading",level:6,text:"spacing",active:()=>"style"===o.text},{type:"slider",title:"lineHeight",min:1,max:3,step:.1,value:parseFloat(p.lineHeight||1),active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setLineHeight(n).run():o.chain().setLineHeight(n).run()}},{type:"slider",title:"letterSpacing",min:1,max:10,step:1,value:parseFloat(p.letterSpacing)||1,active:()=>"style"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;n<=1?i.from===i.to?o.chain().selectAll().setLetterSpacing("normal").run():o.chain().setLetterSpacing("normal").run():i.from===i.to?o.chain().selectAll().setLetterSpacing(n+"px").run():o.chain().setLetterSpacing(n+"px").run()}},{type:"heading",level:6,text:"colors",active:()=>"style"===o.text},{type:"colorSwatchGroup",active:()=>"style"===o.text,columns:2,items:[{title:"font_color",value:c.getAttributes("textStyle").color||"#000000",onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;if(i.from===i.to){const{state:e,view:t}=o,i=e.tr,{from:a,to:l}={from:0,to:e.doc.content.size};e.doc.nodesBetween(a,l,(t,o)=>{if(t.isText){t.marks.some(e=>"link"===e.type.name)||i.addMark(o,o+t.nodeSize,e.schema.marks.textStyle.create({color:n}))}}),t.dispatch(i)}else o.chain().setColor(n).focus().run()}},{title:"backgroundColor",allowGradient:!0,value:t.props.style.background||t.props.style.backgroundColor||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{background:t,backgroundColor:null})}}]},{type:"heading",level:6,text:"layout",active:()=>"style"===o.text},{type:"slider",active:()=>"style"===o.text,title:"maxWidth",value:parseFloat(t.props.style.width),min:20,max:1e3,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"divider"},{type:"colorpicker",active:()=>"icons"===o.text,title:d.iconColor||"Icon color",alpha:!1,value:c.getAttributes(" textStyle").color||"#0000",onChange:e=>{const t=e.target.value;c.chain().setCustomBulletStyles({fill:t}).run()}},{type:"divider",active:()=>"icons"===o.text},{type:"slider",active:()=>"icons"===o.text,title:d.iconSize||"Icon size",value:parseInt(c.getAttributes("customBulletItem").width)||24,min:10,max:40,onInput:e=>{const t=e.target.value;c.chain().setCustomBulletStyles({width:t+"px",height:t+"px"}).run()}},{type:"icons",active:()=>"icons"===o.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;t.tiptap.chain().focus().setCustomBulletIcon({svgIcon:n.urlPng}).run()}}]}}}};var c=n(52144);const p=e=>{let{helpers:t,tiptap:n,composeId:o,template:i}=e;return{set:(e,a,l)=>{switch(a){case"style":return"object"==typeof l&&(e[a]=(0,c.A)(e[a],l),t.mergeDiff(i,{style:e[a]})),!0;case"text":e[a]=l;const s=n.getJSON();return l&&"object"==typeof l&&JSON.stringify(s)!==JSON.stringify(l.childNodes)&&(l&&l.focusedElement&&l.focusedElement===o?(n.chain().focus().setContent(l.childNodes).run(),l.to&&l.from&&n.commands.setTextSelection({from:l.from,to:l.to})):n.chain().setContent(l.childNodes).run()),delete e?.text?.markdown,!0}}}};var u=n(84488),d=n.n(u);n(70567);const g=[];let h=!1,m=null;const y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="text";return{name:t,create:n=>{const{createElement:o,compose:i,helpers:l}=n,{mergeDiff:s}=l,c=document.createElement("div");s(c,{style:i.props.style});const u=a.M.get("config","editor","configure","editorProps","fonts");let y=a.M.get("config","target");"string"==typeof y&&(y=document.querySelector(y)),y||(y=document.body);const v=d()({element:c,container:y||document.body,editable:!0,offsetTop:40,onClickMagic:e=>{let{insertContent:t,getJSON:n,getHTML:o,getText:i,selectAll:l,insertContentHtml:s}=e;const r=a.M.get("injectEditor"),c=document.createElement("cdtr-text-prompt-editor");r(c),c.context=i(),c.addEventListener("text-generation-start",e=>{l()}),c.addEventListener("text-generation-chunk",e=>{t(e.detail.chunk)}),c.addEventListener("text-generation-complete",e=>{l(),s(e.detail.text)}),c.addEventListener("text-generation-error",e=>{console.error("Text generation error:",e.detail.error)})},content:"string"==typeof i.props.text.markdown?i.props.text.markdown:i.props.text.childNodes,defaultDirection:"rtl",onBlur:()=>{m===v&&(m=null),setTimeout(()=>{m!==v&&(h=!1)},150)},onFocus:()=>{if(!h||m===v||null===m){if(h=!0,m=v,g.length>0)for(g.forEach(e=>{e!==v&&e.hideEditor()});g.length>0;)g.pop();g.push(v),setTimeout(()=>{m===v&&h&&v.showEditor()},100)}},onUpdate:e=>{let{editor:t,transaction:n}=e;if(0===n.steps.length)return;const o=n.curSelection.from,a=n.curSelection.to,l={childNodes:t.getJSON(),from:o,to:a,focusedElement:i.id};f.commands.execCommand("text",l)},ignoresBlurByQuerySelectors:[".ignore-events"],builder:[{type:"fontFamily",fonts:u||[],useCloud:!0},{type:"fontSize",sizes:e.fontSize||[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74]},{type:"horizonRule"},{type:"clearFormat"},{type:"bold"},{type:"strike"},{type:"italic"},{type:"underline"},{type:"table"},{type:"emoji"},{type:"unLink"},{type:"link"},{type:"customList"},{type:"numbered"},{type:"bullet"},{type:"backcolor"},{type:"fontColor"},{type:"direction"},{type:"justify"},{type:"right"},{type:"center"},{type:"left"},{type:"image"},{type:"mergeTags"},{type:"magic"}]}),f=o({name:t,id:i.id,template:c,defaultProps:{text:{},style:{}},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:p({template:c,helpers:l,tiptap:v,composeId:i.id}),schema:i.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:i,remove:()=>{c.remove()},createEditor:r});return i.props.text.markdown&&v.chain().insertContent(" ").run(),f.addProp("tiptap",v),f}}}}}]);
|
|
Binary file
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
height: 100vh;
|
|
25
25
|
left: 0;
|
|
26
26
|
top: 0;
|
|
27
|
-
z-index:
|
|
27
|
+
z-index: var(--z-blocking, 2147483646);
|
|
28
28
|
background-color: #0000001f;
|
|
29
29
|
}
|
|
30
30
|
.container {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
background: #fff;
|
|
36
36
|
width: auto;
|
|
37
37
|
height: 500px;
|
|
38
|
-
z-index:
|
|
38
|
+
z-index: var(--z-toast, 1100);
|
|
39
39
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
|
|
40
40
|
padding: 3rem;
|
|
41
41
|
direction: var(--direction-locale);
|
|
Binary file
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[170],{60170(e,t,r){r.r(t),r.d(t,{BreadCrumbs:()=>a});var s=r(5441),
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[170],{60170(e,t,r){r.r(t),r.d(t,{BreadCrumbs:()=>a});var s=r(5441),o=r(59929),i=r(86319),n=r(58371),c=r(36565);class a extends o.WF{constructor(){super(),this.crumbs=[],this.cover=function(){const e=document.createElement("div");return e.style.position="fixed",e.style.background="var(--primary)",e.style.zIndex=2,e.style.border="1px dashed black",e.style.opacity=.2,e}(),this.currectCrumb={},this.onSubscribe=()=>{let e;this.crumbs=[];const t=c.Ay.components[c.Ay.components.length-1];if(!t)return;if(e=t.element,!e)return void console.error("selectElement not found","#1ppqmvss6");let r=t.type.getElementType(),s="";t.props.as&&(s=` (${i.M.get("lang",t.props.as)||t.props.as})`),this.currectCrumb={type:r,as:s,name:t.props.name,id:t.id};if(e){let t=e;for(;t&&t.parentElement;)if(t=t.parentElement.closest("[data-type]"),t){const e=i.M.get("components",t.dataset.id);let r=!0;e&&"row"!==e.type&&("col"===e.type&&"block"!==e.parent().type&&(r=!1),r&&this.crumbs.unshift({type:e.type,name:e.props.name,id:e.id,element:e.element,compose:e}))}this.dispatchEvent(new CustomEvent("change",[...this.crumbs]))}},this.onSubscribe=this.onSubscribe.bind(this)}updated(){this.toggleAttribute("hidden-crumbs",0===this.crumbs.length)}onHover(e){if(e){const t=e.getBoundingClientRect();this.cover.style.left=t.left+"px",this.cover.style.top=t.top+"px",this.cover.style.width=t.width+"px",this.cover.style.height=t.height+"px",document.body.appendChild(this.cover)}}render(){const e=i.M.get("langConfig","direction");return this.crumbs.length>0?o.qy`
|
|
2
2
|
<!-- <cdtr-tooltip content="breadcrumbs_info" .opened=${!0}></cdtr-tooltip> -->
|
|
3
3
|
<div>
|
|
4
|
-
${this.crumbs.map((t,r)=>
|
|
4
|
+
${this.crumbs.map((t,r)=>o.qy` <span
|
|
5
5
|
@mouseout=${()=>this.cover.remove()}
|
|
6
6
|
@mouseover=${()=>this.onHover(t.element)}
|
|
7
7
|
@mousedown=${()=>this.clickBread(t)}
|
|
8
8
|
class="breadcrumb"
|
|
9
|
-
>${t.name||
|
|
10
|
-
>${this.crumbs.length===r?null:(0,s.A)(
|
|
11
|
-
${this.mainText?
|
|
12
|
-
${this.currectCrumb.name||
|
|
9
|
+
>${t.name||o.qy`<lang-text text=${t.type}></lang-text>`}</span
|
|
10
|
+
>${this.crumbs.length===r?null:(0,s.A)(n.D9,{style:{transform:`rotate(${"ltr"===e?"180deg":"0"})`},class:"arrow"})}`)}
|
|
11
|
+
${this.mainText?o.qy` <div class="currect">
|
|
12
|
+
${this.currectCrumb.name||o.qy`<lang-text text=${this.currectCrumb.type}></lang-text
|
|
13
13
|
>${this.currectCrumb.as}`}
|
|
14
14
|
</div>`:null}
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
|
-
`:""}connectedCallback(){super.connectedCallback(),c.Ay.on("select",this.onSubscribe),c.Ay.on("update",this.onSubscribe)}disconnectedCallback(){super.disconnectedCallback(),this.cover.remove(),c.Ay.off("select",this.onSubscribe),c.Ay.off("update",this.onSubscribe)}clickBread(e){this.cover.remove(),c.Ay.clean().selectComponent(e.compose)}}a.styles=
|
|
17
|
+
`:""}connectedCallback(){super.connectedCallback(),c.Ay.on("select",this.onSubscribe),c.Ay.on("update",this.onSubscribe)}disconnectedCallback(){super.disconnectedCallback(),this.cover.remove(),c.Ay.off("select",this.onSubscribe),c.Ay.off("update",this.onSubscribe)}clickBread(e){this.cover.remove(),c.Ay.clean().selectComponent(e.compose)}}a.styles=o.AH`
|
|
18
18
|
:host {
|
|
19
19
|
direction: var(--direction);
|
|
20
20
|
display: block;
|
|
@@ -25,33 +25,34 @@
|
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
}
|
|
27
27
|
:host(:not([hidden-crumbs])) {
|
|
28
|
-
padding:
|
|
28
|
+
padding: var(--space-3) var(--space-4);
|
|
29
|
+
border-bottom: 1px solid var(--color-border);
|
|
29
30
|
}
|
|
30
31
|
.currect {
|
|
31
|
-
font-size:
|
|
32
|
+
font-size: var(--text-xs);
|
|
32
33
|
font-family: var(--font-family);
|
|
33
|
-
font-weight:
|
|
34
|
-
color: var(--primary);
|
|
35
|
-
margin-top:
|
|
36
|
-
margin-right:
|
|
37
|
-
margin-left:
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
color: var(--color-primary, var(--primary));
|
|
36
|
+
margin-top: var(--space-1);
|
|
37
|
+
margin-right: var(--space-1);
|
|
38
|
+
margin-left: var(--space-1);
|
|
38
39
|
display:inline-block;
|
|
39
40
|
}
|
|
40
41
|
.breadcrumb {
|
|
41
|
-
font-size:
|
|
42
|
+
font-size: var(--text-xs);
|
|
42
43
|
cursor: pointer;
|
|
43
44
|
font-family: var(--font-family);
|
|
44
|
-
margin-right:
|
|
45
|
-
margin-left:
|
|
46
|
-
color: var(--breadcrumbs);
|
|
45
|
+
margin-right: var(--space-1);
|
|
46
|
+
margin-left: var(--space-1);
|
|
47
|
+
color: var(--color-text-muted, var(--breadcrumbs));
|
|
47
48
|
}
|
|
48
49
|
.breadcrumb:hover {
|
|
49
|
-
color: var(--primary);
|
|
50
|
+
color: var(--color-primary, var(--primary));
|
|
50
51
|
}
|
|
51
52
|
.arrow {
|
|
52
53
|
height: 14px;
|
|
53
54
|
width: 14px;
|
|
54
|
-
fill:
|
|
55
|
+
fill: var(--color-text-faint);
|
|
55
56
|
vertical-align: middle;
|
|
56
57
|
}
|
|
57
58
|
`,a.properties={crumbs:{type:Array},mainText:{type:Boolean,reflect:!0}},customElements.define("cdtr-breadcrumbs",a)}}]);
|
|
Binary file
|
|
@@ -1 +1,121 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2234],{62234(
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2234],{62234(t,a,s){s.r(a),s.d(a,{ToastProvider:()=>i});var e=s(59929),o=s(49937);let r=0;class i extends e.WF{constructor(){super(),this._toasts=[],this._handleSnackbar=this._handleSnackbar.bind(this)}connectedCallback(){super.connectedCallback(),o.A.subscribe("snackbar",this._handleSnackbar),window.snackbar=t=>{"string"==typeof t&&(t={text:t}),this._handleSnackbar(t)}}disconnectedCallback(){super.disconnectedCallback()}_handleSnackbar(){let{text:t,type:a,action:s,timeout:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t)return;const o=++r,i={id:o,text:t,type:a||"neutral",action:s||null};this._toasts=[...this._toasts,i],this._toasts.length>3&&(this._toasts=this._toasts.slice(-3)),setTimeout(()=>this._dismiss(o),e||4e3)}_dismiss(t){const a=this.shadowRoot?.querySelector(`[data-toast-id="${t}"]`);a?(a.classList.add("removing"),setTimeout(()=>{this._toasts=this._toasts.filter(a=>a.id!==t)},120)):this._toasts=this._toasts.filter(a=>a.id!==t)}_onAction(t){t.action&&"function"==typeof t.action.onClick&&t.action.onClick(),this._dismiss(t.id)}render(){return e.qy`${this._toasts.map(t=>e.qy`
|
|
2
|
+
<div class="toast ${t.type}" data-toast-id="${t.id}">
|
|
3
|
+
<span class="toast-text">${t.text}</span>
|
|
4
|
+
${t.action?e.qy`<button class="toast-action" @click=${()=>this._onAction(t)}>${t.action.label}</button>`:null}
|
|
5
|
+
<button class="toast-close" @click=${()=>this._dismiss(t.id)}>
|
|
6
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
7
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
8
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
9
|
+
</svg>
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
`)}`}}i.properties={_toasts:{state:!0}},i.styles=e.AH`
|
|
13
|
+
:host {
|
|
14
|
+
position: fixed;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 50%;
|
|
17
|
+
transform: translateX(-50%);
|
|
18
|
+
z-index: var(--z-toast, 1100);
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column-reverse;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--space-2, 8px);
|
|
23
|
+
padding: var(--space-6, 24px);
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
direction: ltr;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.toast {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--space-3, 12px);
|
|
32
|
+
max-width: 420px;
|
|
33
|
+
min-width: 200px;
|
|
34
|
+
padding: var(--space-3, 12px) var(--space-4, 16px);
|
|
35
|
+
background: var(--color-text, #1a1a1f);
|
|
36
|
+
color: #fff;
|
|
37
|
+
border-radius: var(--radius-md, 10px);
|
|
38
|
+
box-shadow: var(--shadow-lg);
|
|
39
|
+
font-family: var(--font-sans, -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif);
|
|
40
|
+
font-size: var(--text-sm, 13px);
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: 1.4;
|
|
43
|
+
pointer-events: auto;
|
|
44
|
+
animation: cdtr-toast-in var(--duration-normal, 200ms) var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.toast.removing {
|
|
48
|
+
animation: cdtr-toast-out var(--duration-fast, 120ms) var(--ease-default, ease) forwards;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Accent stripe on the left for semantic variants */
|
|
52
|
+
.toast::before {
|
|
53
|
+
content: '';
|
|
54
|
+
flex: 0 0 auto;
|
|
55
|
+
width: 3px;
|
|
56
|
+
align-self: stretch;
|
|
57
|
+
border-radius: 2px;
|
|
58
|
+
background: transparent;
|
|
59
|
+
}
|
|
60
|
+
.toast.success::before { background: var(--color-success, #16a34a); }
|
|
61
|
+
.toast.error::before { background: var(--color-danger, #dc2626); }
|
|
62
|
+
.toast.warning::before { background: var(--color-warning, #d97706); }
|
|
63
|
+
|
|
64
|
+
.toast-text {
|
|
65
|
+
flex: 1 1 auto;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.toast-action {
|
|
70
|
+
flex: 0 0 auto;
|
|
71
|
+
background: transparent;
|
|
72
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
73
|
+
color: #fff;
|
|
74
|
+
padding: var(--space-1, 4px) var(--space-2, 8px);
|
|
75
|
+
border-radius: var(--radius-sm, 6px);
|
|
76
|
+
font: inherit;
|
|
77
|
+
font-size: var(--text-xs, 12px);
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
transition: background var(--duration-fast, 120ms) ease;
|
|
82
|
+
}
|
|
83
|
+
.toast-action:hover {
|
|
84
|
+
background: rgba(255, 255, 255, 0.15);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.toast-close {
|
|
88
|
+
flex: 0 0 auto;
|
|
89
|
+
background: transparent;
|
|
90
|
+
border: none;
|
|
91
|
+
color: rgba(255, 255, 255, 0.5);
|
|
92
|
+
padding: var(--space-1, 4px);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
border-radius: var(--radius-sm, 6px);
|
|
98
|
+
transition: color var(--duration-fast, 120ms) ease;
|
|
99
|
+
}
|
|
100
|
+
.toast-close:hover {
|
|
101
|
+
color: #fff;
|
|
102
|
+
}
|
|
103
|
+
.toast-close svg {
|
|
104
|
+
width: 14px;
|
|
105
|
+
height: 14px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@keyframes cdtr-toast-in {
|
|
109
|
+
from {
|
|
110
|
+
opacity: 0;
|
|
111
|
+
transform: translateY(16px);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@keyframes cdtr-toast-out {
|
|
116
|
+
to {
|
|
117
|
+
opacity: 0;
|
|
118
|
+
transform: translateY(8px);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,customElements.define("cdtr-toast-provider",i)}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2765],{12765(e,t,o){o.d(t,{default:()=>c});var n=o(61919);const r=e=>{{const{component:t,commands:o}=e;return{select:e=>{let{changeTab:t,tab:o}=e;o.text||t("icon")},tabs:e=>{const t=[{text:"icon",selected:!0},{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2765],{12765(e,t,o){o.d(t,{default:()=>c});var n=o(61919);const r=e=>{{const{component:t,commands:o}=e;return{select:e=>{let{changeTab:t,tab:o}=e;o.text||t("icon")},tabs:e=>{const t=[{text:"icon",selected:!0},{text:"style"},{text:"link"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r}=e;const s=t.props.src.includes("img.creaditor.ai");return[{type:"icons",active:()=>"icon"===r.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;if(n){const e=n.urlPng||n.src;e&&o.execCommand("src",e),t.props.alt&&"icon"!==t.props.alt||o.execCommand("alt",n.name),n.size?.width&&n.size?.height&&o.execCommand("style",{width:n.size.width+"px",height:n.size.height+"px"}),null!=n.category&&null!=n.name&&(o.execCommand("iconCategory",n.category),o.execCommand("iconName",n.name));const r=(n.color??t.props.iconColor??"000000").toString().replace(/^#/,"");o.execCommand("iconColor",r)}}},{type:"input",title:"altText",active:()=>"icon"===r.text,value:t.props.alt||"",onChange:e=>{const t=e.target.value;o.execCommand("alt",t)}},{type:"slider",title:"size",min:8,max:256,active:()=>"style"===r.text,value:parseInt(t.props.style?.width,10)||24,onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",height:t+"px"})}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"style"===r.text&&s,value:t.props.iconColor?t.props.iconColor.startsWith("#")?t.props.iconColor:"#"+t.props.iconColor:"#000000",onChange:e=>{let t=e.target.value;t=(0,n.A)(t).toHex(),t.startsWith("#")&&(t=t.slice(1)),o.execCommand("iconColor",t)}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===r.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}}]}}}},s=e=>{let{helpers:t}=e;return{set:(e,o,n)=>{switch(o){case"style":return e[o]=t.deepMerge(e[o],n),!0;case"src":case"alt":case"iconColor":case"iconCategory":case"iconName":return e[o]=n,!0;case"onClick":if(n&&n.link)return e[o]=n,!0}}}};const c=()=>{const e="icon";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:c}=t,{mergeDiff:i}=c,a=document.createElement("div"),l=document.createElement("img");a.appendChild(l);return o({name:e,id:n.id,template:a,defaultProps:{style:{height:"24px",width:"24px",display:"inline-block"},src:"",alt:"",iconColor:"000000"},draggable:{group:"element"},droppable:{group:"element"},render:()=>{i(l,{style:n.props.style});const e=function(e){const t=e.props.iconCategory,o=e.props.iconName;if(!t||!o)return null;let n=parseInt(e.props.style?.width,10)||24,r=parseInt(e.props.style?.height,10)||24;n=Math.min(512,Math.max(1,n)),r=Math.min(512,Math.max(1,r));const s=function(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length?"000000":t}(e.props.iconColor);return`https://img.creaditor.ai/icons/serve/${encodeURIComponent(t)}/${encodeURIComponent(o)}.png?${new URLSearchParams({width:String(n),height:String(r),color:s}).toString()}`}(n)||n.props.src;i(l,{src:e,alt:n.props.alt||""})},resizeable:null,handleBar:!0,validator:s({helpers:c}),schema:n.schema,onSelect:e=>{a.classList.add(e)},onDeselect:e=>{a.classList.remove(e)},elementProps:n,remove:()=>{a.remove()},createEditor:r})}}}}}]);
|