@creaditor/web-starterkit 1.0.66 → 1.0.67

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.
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8758],{58758(e,t,n){n.d(t,{default:()=>x});function o(e){const t={};return e.dispatchEvent(new CustomEvent("cdtr-video-host",{bubbles:!0,composed:!0,detail:t})),"function"==typeof t.panel||"function"==typeof t.block?t:null}const l=e=>{{const{component:t,commands:n,helpers:l}=e,a=t.parent("col"),i=e=>"style"===e.text,s=(e,n)=>t.props[e]??t.props.style?.[e]??n;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"animations"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r,changeTab:c,tabs:d}=e;const A=t.element?o(t.element):null;return[{type:"heading",level:6,text:"video",active:()=>i(r)},{type:"input",title:"add_urlAddress_from_media_site",active:()=>i(r),value:s("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)}},...A?.panel?[{type:"custom",active:()=>i(r),node:()=>A.panel()}]:[],{type:"heading",level:6,text:"playback",active:()=>i(r)},{type:"checkbox",title:"autoplay",info:"autoplayMutedInfo",active:()=>i(r),checked:!!s("playing",!1),onChange:e=>{const t=e.target.checked;n.execCommand("playing",t),t&&!s("muted",!0)&&(n.execCommand("muted",!0),c("style"))}},{type:"checkbox",title:"playInLoop",active:()=>i(r),checked:!!s("loop",!1),onChange:e=>{n.execCommand("loop",e.target.checked)}},{type:"checkbox",title:"slientMode",active:()=>i(r),checked:!!s("muted",!0),onChange:e=>{n.execCommand("muted",e.target.checked)}},{type:"checkbox",title:"showControls",active:()=>i(r),checked:!1!==s("controls",!0),onChange:e=>{n.execCommand("controls",e.target.checked)}},{type:"checkbox",title:"showAsImage",active:()=>i(r),checked:!!s("light",!1),onChange:e=>{n.execCommand("light",e.target.checked)}},{type:"checkbox",title:"playInline",active:()=>i(r),checked:!!s("playsinline",!1),onChange:e=>{n.execCommand("playsinline",e.target.checked)}},{type:"slider",title:"volume",min:0,max:100,unit:"%",active:()=>i(r),value:Math.round(100*(s("volume",.8)??.8)),onInput:e=>{n.execCommand("volume",Number(e.target.value)/100)}},{type:"heading",level:6,text:"size",active:()=>i(r)},{type:"fontSize",title:"size",min:10,active:()=>i(r),max:a?.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:l.deepMerge(n,{style:{width:t+"px",height:9*t/16+"px"}})}}):n.execCommand("style",{width:t+"px"})}}]}}}};var a=n(52144);const i=["playing","loop","muted","controls","light","playsinline"],s=()=>({set:(e,t,n)=>{if(i.includes(t))return e[t]=Boolean(n),!0;switch(t){case"url":return e[t]=n,!0;case"volume":{const o=parseFloat(n);return!Number.isNaN(o)&&(e[t]=Math.min(1,Math.max(0,o)),!0)}case"style":if("object"==typeof n)return n.width&&(n.height=9*parseFloat(n.width)/16+"px"),e[t]=(0,a.A)(e[t],n),!0}}});var r=n(72591),c=n.n(r),d=n(88639),A=n.n(d),p=n(88128),h=n.n(p),m=n(30855),g=n.n(m),u=n(93051),C=n.n(u),y=n(51115),f={};f.setAttributes=g(),f.insert=h().bind(null,"head"),f.domAPI=A(),f.insertStyleElement=C();c()(y.A,f);const k=y.A&&y.A.locals?y.A.locals:void 0;n(15284);var v=n(86319);const b="video";const x=()=>({name:b,create:e=>{const{createElement:t,compose:n,helpers:a}=e,{arrayToString:i,mergeDiff:r}=a,c=document.createElement("div");c.classList.add(k.root);const d=document.createElement("div");d.classList.add(k.cover);const A=document.createElement("cdtr-media-player"),p=document.createElement("div");p.classList.add(k.empty),p.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M10 8.5l5 3.5-5 3.5z"/></svg>';const h=document.createElement("strong"),m=document.createElement("span");return p.append(h,m),c.append(A,p,d),c.addEventListener("click",()=>{A.playing=!1}),t({name:b,id:n.id,template:c,defaultProps:{url:"https://www.youtube.com/watch?v=04Or_U9OexU",playing:!1,loop:!1,muted:!0,controls:!0,light:!1,playsinline:!1,volume:.8,style:{width:"400px",height:"225px"}},draggable:{group:"element"},droppable:{group:"element"},render:e=>{const t=n.props,l=(e,n)=>t[e]??t.style?.[e]??n,a=l("url");A.url=a;const i=!String(a??"").trim();if(c.classList.toggle(k.blank,i),i){const e=o(c)?.block?.()??null;p.classList.toggle(k.hosted,!!e),e&&e.parentNode!==p&&p.append(e),e||p.querySelector(":scope > div")?.remove(),h.textContent=v.M.get("lang","video_paste_link")||"Paste a video link",m.textContent=v.M.get("lang","video_link_sources")||"YouTube, Vimeo or an MP4 file",Object.assign(p.style,{width:t.style.width,height:t.style.height})}r(A,{style:t.style}),A.width=t.style.width,A.height=t.style.height,A.playing=!!l("playing",!1),A.loop=!!l("loop",!1),A.controls=!1!==l("controls",!0),A.light=!!l("light",!1),A.playsinline=!!l("playsinline",!1);const s=l("volume",.8);A.volume="number"==typeof s?s:.8,A.muted=!0},atomElement:A,resizeable:()=>c,handleBar:!0,validator:s(),schema:n.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:n,remove:()=>{c.remove()},createEditor:l})}})},51115(e,t,n){n.d(t,{A:()=>s});var o=n(82001),l=n.n(o),a=n(40935),i=n.n(a)()(l());i.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\n/* no link yet: a quiet placeholder the size of the video */\n.meCvGtDIqeqhKAtynZ3d {\n display: none;\n box-sizing: border-box;\n max-width: 100%;\n min-height: 160px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border: 1px solid #dcdde3;\n border-radius: 8px;\n background: #eeeff2;\n color: #6b6880;\n font-size: 13px;\n text-align: center;\n}\n.meCvGtDIqeqhKAtynZ3d svg {\n width: 40px;\n height: 40px;\n margin-bottom: 4px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linejoin: round;\n}\n.meCvGtDIqeqhKAtynZ3d svg path {\n fill: currentColor;\n stroke: none;\n}\n.meCvGtDIqeqhKAtynZ3d strong {\n font-size: 15px;\n font-weight: 500;\n color: #1f1d2b;\n}\n/* The page's own content (the course builder's upload) stands in for the words, with its own edge. */\n.OjkoAFfgIQWkff_cKpRf > svg,\n.OjkoAFfgIQWkff_cKpRf > strong,\n.OjkoAFfgIQWkff_cKpRf > span {\n display: none;\n}\n.meCvGtDIqeqhKAtynZ3d.OjkoAFfgIQWkff_cKpRf {\n border: 0;\n background: #fff;\n}\n.cUFSqapO5YVXlS_kCjQ_ .meCvGtDIqeqhKAtynZ3d {\n display: flex;\n}\n.cUFSqapO5YVXlS_kCjQ_ cdtr-media-player {\n display: none !important;\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;;AAEA,2DAA2D;AAC3D;EACE,aAAa;EACb,sBAAsB;EACtB,eAAe;EACf,iBAAiB;EACjB,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,yBAAyB;EACzB,kBAAkB;EAClB,mBAAmB;EACnB,cAAc;EACd,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,UAAU;EACV,oBAAoB;EACpB,iBAAiB;EACjB,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,eAAe;EACf,gBAAgB;EAChB,cAAc;AAChB;AACA,qGAAqG;AACrG;;;EAGE,aAAa;AACf;AACA;EACE,SAAS;EACT,gBAAgB;AAClB;AACA;EACE,aAAa;AACf;AACA;EACE,wBAAwB;AAC1B",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\n/* no link yet: a quiet placeholder the size of the video */\n.empty {\n display: none;\n box-sizing: border-box;\n max-width: 100%;\n min-height: 160px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border: 1px solid #dcdde3;\n border-radius: 8px;\n background: #eeeff2;\n color: #6b6880;\n font-size: 13px;\n text-align: center;\n}\n.empty svg {\n width: 40px;\n height: 40px;\n margin-bottom: 4px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linejoin: round;\n}\n.empty svg path {\n fill: currentColor;\n stroke: none;\n}\n.empty strong {\n font-size: 15px;\n font-weight: 500;\n color: #1f1d2b;\n}\n/* The page's own content (the course builder's upload) stands in for the words, with its own edge. */\n.hosted > svg,\n.hosted > strong,\n.hosted > span {\n display: none;\n}\n.empty.hosted {\n border: 0;\n background: #fff;\n}\n.blank .empty {\n display: flex;\n}\n.blank cdtr-media-player {\n display: none !important;\n}\n"],sourceRoot:""}]),i.locals={root:"BaT92HY5C7Gxgg9C1_pc",cover:"aybkK2AXl8f2XctkkRjJ",empty:"meCvGtDIqeqhKAtynZ3d",hosted:"OjkoAFfgIQWkff_cKpRf",blank:"cUFSqapO5YVXlS_kCjQ_"};const s=i}}]);
Binary file