@creaditor/newsletter-starterkit 1.0.41 → 1.0.43

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.
Files changed (116) hide show
  1. package/dist/1260.creaditor.bundle.js +234 -0
  2. package/dist/1260.creaditor.bundle.js.gz +0 -0
  3. package/dist/1317.creaditor.bundle.js +3 -3
  4. package/dist/1317.creaditor.bundle.js.gz +0 -0
  5. package/dist/1529.creaditor.bundle.js +16 -0
  6. package/dist/1529.creaditor.bundle.js.gz +0 -0
  7. package/dist/1565.creaditor.bundle.js +1016 -0
  8. package/dist/1565.creaditor.bundle.js.gz +0 -0
  9. package/dist/168.creaditor.bundle.js +5 -421
  10. package/dist/168.creaditor.bundle.js.gz +0 -0
  11. package/dist/170.creaditor.bundle.js +1 -1
  12. package/dist/170.creaditor.bundle.js.gz +0 -0
  13. package/dist/2234.creaditor.bundle.js +1 -1
  14. package/dist/2234.creaditor.bundle.js.gz +0 -0
  15. package/dist/2384.creaditor.bundle.js +1 -1
  16. package/dist/2384.creaditor.bundle.js.gz +0 -0
  17. package/dist/2438.creaditor.bundle.js +67 -0
  18. package/dist/2438.creaditor.bundle.js.gz +0 -0
  19. package/dist/2547.creaditor.bundle.js +6 -0
  20. package/dist/2547.creaditor.bundle.js.gz +0 -0
  21. package/dist/2706.creaditor.bundle.js +2 -2
  22. package/dist/2706.creaditor.bundle.js.gz +0 -0
  23. package/dist/271.creaditor.bundle.js +99 -0
  24. package/dist/271.creaditor.bundle.js.gz +0 -0
  25. package/dist/2834.creaditor.bundle.js +14 -0
  26. package/dist/2834.creaditor.bundle.js.LICENSE.txt +5 -0
  27. package/dist/2834.creaditor.bundle.js.gz +0 -0
  28. package/dist/3095.creaditor.bundle.js +161 -0
  29. package/dist/3095.creaditor.bundle.js.gz +0 -0
  30. package/dist/3521.creaditor.bundle.js +2 -2
  31. package/dist/3521.creaditor.bundle.js.gz +0 -0
  32. package/dist/3553.creaditor.bundle.js +1 -1
  33. package/dist/3553.creaditor.bundle.js.gz +0 -0
  34. package/dist/3606.creaditor.bundle.js +113 -0
  35. package/dist/3606.creaditor.bundle.js.gz +0 -0
  36. package/dist/3932.creaditor.bundle.js +30 -0
  37. package/dist/3932.creaditor.bundle.js.gz +0 -0
  38. package/dist/4186.creaditor.bundle.js +453 -0
  39. package/dist/4186.creaditor.bundle.js.LICENSE.txt +10 -0
  40. package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  41. package/dist/4186.creaditor.bundle.js.gz +0 -0
  42. package/dist/4288.creaditor.bundle.js +98 -0
  43. package/dist/4288.creaditor.bundle.js.gz +0 -0
  44. package/dist/453.creaditor.bundle.js +111 -11
  45. package/dist/453.creaditor.bundle.js.gz +0 -0
  46. package/dist/4569.creaditor.bundle.js +1043 -19
  47. package/dist/4569.creaditor.bundle.js.gz +0 -0
  48. package/dist/4819.creaditor.bundle.js +1 -1
  49. package/dist/4819.creaditor.bundle.js.gz +0 -0
  50. package/dist/5133.creaditor.bundle.js +60 -0
  51. package/dist/5133.creaditor.bundle.js.gz +0 -0
  52. package/dist/5501.creaditor.bundle.js +112 -0
  53. package/dist/5501.creaditor.bundle.js.gz +0 -0
  54. package/dist/5713.creaditor.bundle.js +2 -152
  55. package/dist/5713.creaditor.bundle.js.LICENSE.txt +0 -11
  56. package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  57. package/dist/5713.creaditor.bundle.js.gz +0 -0
  58. package/dist/574.creaditor.bundle.js +4 -68
  59. package/dist/574.creaditor.bundle.js.gz +0 -0
  60. package/dist/5849.creaditor.bundle.js +1 -1
  61. package/dist/5849.creaditor.bundle.js.gz +0 -0
  62. package/dist/5926.creaditor.bundle.js +1 -1
  63. package/dist/5926.creaditor.bundle.js.gz +0 -0
  64. package/dist/6036.creaditor.bundle.js +34 -0
  65. package/dist/6036.creaditor.bundle.js.gz +0 -0
  66. package/dist/6151.creaditor.bundle.js +1 -0
  67. package/dist/6151.creaditor.bundle.js.gz +0 -0
  68. package/dist/638.creaditor.bundle.js +23 -0
  69. package/dist/638.creaditor.bundle.js.gz +0 -0
  70. package/dist/6442.creaditor.bundle.js +236 -0
  71. package/dist/6442.creaditor.bundle.js.gz +0 -0
  72. package/dist/7307.creaditor.bundle.js +186 -0
  73. package/dist/7307.creaditor.bundle.js.gz +0 -0
  74. package/dist/741.creaditor.bundle.js +234 -0
  75. package/dist/741.creaditor.bundle.js.gz +0 -0
  76. package/dist/7466.creaditor.bundle.js +1 -1
  77. package/dist/7466.creaditor.bundle.js.gz +0 -0
  78. package/dist/752.creaditor.bundle.js +40 -0
  79. package/dist/752.creaditor.bundle.js.gz +0 -0
  80. package/dist/767.creaditor.bundle.js +1 -1
  81. package/dist/767.creaditor.bundle.js.gz +0 -0
  82. package/dist/8042.creaditor.bundle.js +71 -0
  83. package/dist/8042.creaditor.bundle.js.gz +0 -0
  84. package/dist/8141.creaditor.bundle.js +1 -1
  85. package/dist/8141.creaditor.bundle.js.gz +0 -0
  86. package/dist/8173.creaditor.bundle.js +3 -3
  87. package/dist/8173.creaditor.bundle.js.gz +0 -0
  88. package/dist/8443.creaditor.bundle.js +72 -0
  89. package/dist/8443.creaditor.bundle.js.gz +0 -0
  90. package/dist/8516.creaditor.bundle.js +1 -1
  91. package/dist/8516.creaditor.bundle.js.gz +0 -0
  92. package/dist/8570.creaditor.bundle.js +102 -0
  93. package/dist/8570.creaditor.bundle.js.gz +0 -0
  94. package/dist/8646.creaditor.bundle.js +122 -0
  95. package/dist/8646.creaditor.bundle.js.gz +0 -0
  96. package/dist/8654.creaditor.bundle.js +109 -0
  97. package/dist/8654.creaditor.bundle.js.gz +0 -0
  98. package/dist/8854.creaditor.bundle.js +1 -1
  99. package/dist/8854.creaditor.bundle.js.gz +0 -0
  100. package/dist/8916.creaditor.bundle.js +18 -0
  101. package/dist/8916.creaditor.bundle.js.gz +0 -0
  102. package/dist/898.creaditor.bundle.js +5 -357
  103. package/dist/898.creaditor.bundle.js.gz +0 -0
  104. package/dist/9041.creaditor.bundle.js +171 -0
  105. package/dist/9041.creaditor.bundle.js.gz +0 -0
  106. package/dist/9193.creaditor.bundle.js +1 -1
  107. package/dist/9193.creaditor.bundle.js.gz +0 -0
  108. package/dist/9990.creaditor.bundle.js +16 -0
  109. package/dist/9990.creaditor.bundle.js.gz +0 -0
  110. package/dist/creaditor.bundle.js +1241 -1657
  111. package/dist/creaditor.bundle.js.LICENSE.txt +8 -0
  112. package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
  113. package/dist/creaditor.bundle.js.gz +0 -0
  114. package/dist/service-worker.js +1 -1
  115. package/dist/service-worker.js.gz +0 -0
  116. package/package.json +1 -1
@@ -0,0 +1,234 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[741],{60741(t,e,r){r.r(e),r.d(e,{BlockEditor:()=>h});var o=r(24586),i=r(59929),d=r(86319),n=r(9507),a=r(49937),s=r(83235);const c=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 p=r(9334),l=r(96374);const g=[{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"}}}}];r.e(4217).then(r.bind(r,94217));class h extends i.WF{constructor(t){super(),(0,o.A)(this,"onChangeBakgroundExpanding",t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)}),(0,o.A)(this,"getInnerBlocks",()=>{const t=[],e=this.component.parent("section");return e&&e.children.forEach(e=>{const r=d.M.get("components",e);r&&"block"===r.type&&t.push(r)}),t}),this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this),this.tabs=[{text:"background"},{text:"design",selected:!0},{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=d.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 r;if((0,s.A)(e)){const t=g.find(t=>"images"===t.type);t.preset.properties.src=e,r=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==c.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=g.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,r=t.preset}r&&(n.Ay.store().execCommand("background",JSON.parse(JSON.stringify(r))),n.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,r=[];Array.isArray(e)?e.forEach(t=>r.push(t.src)):r.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:r.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,r=t.target.direction;"all"===r?(n.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Ay.store().execCommand("style",{[(0,p.A)(`margin-${r.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,r=t.target.direction,o=(0,p.A)(`padding-${r.toLowerCase()}`);"all"===r?(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",{[o]:e+"px",[`padding-${r.toLowerCase()}`]:null}),this.props.style={[o]:e+"px"},this[`padding${r.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;n.Ay.components.forEach(t=>{const r=t.find("text");if(r&&!r.closest("card")){let t=r.tiptap.getAttributes("textStyle").color;if(!t){const e=r.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 o=(0,l.w)(t,e);r.tiptap.chain().selectAll().setColor(o).run()}}}}),n.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==d.M.get("config","channel")&&n.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:r,value:o}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[r])throw new Error(`${r} is not a valid property`);e.style[r]=o,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 r=this.getInnerBlocks();n.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...r]}),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 r=t.props.background;if(this.isBackgroundImage="images"===r?.type,this.noResponsive=!!t.props.noResponsive,this.isBackgroundImage){const t=r.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=r,this.backgroundVideo=r?.properties?.src||r?.properties?.url||"";const o=t.element,i=window.getComputedStyle(o);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}render(){const t=d.M.get("config","channel");return i.qy`
2
+ <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
+ <div slot="content">
4
+ ${"background"===this.tabName?i.qy` <cdtr-editor-container>
5
+ <cdtr-row justify="space-between">
6
+ <cdtr-col sm="5"
7
+ ><paper-button
8
+ class="gallery"
9
+ raised
10
+ @click=${()=>this.galleryOpened=!0}
11
+ ><lang-text
12
+ text="openGalleryImage"
13
+ ></lang-text></paper-button
14
+ ></cdtr-col>
15
+ <cdtr-col sm="5">
16
+ <paper-button
17
+ class="backgrounds"
18
+ raised
19
+ @click=${()=>a.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:n.Ay.components[0]})}
20
+ ><lang-text
21
+ text="backgrounds"
22
+ ></lang-text></paper-button
23
+ ></cdtr-col>
24
+ </cdtr-row>
25
+ </cdtr-editor-container>
26
+ ${this.isBackgroundImage&&"web"===t?i.qy`<cdtr-editor-container>
27
+ <background-editor-plugin
28
+ backgroundAttachment=${this.backgroundAttachment}
29
+ backgroundPosition=${this.backgroundPosition}
30
+ backgroundRepeat=${this.backgroundRepeat}
31
+ backgroundSize=${this.backgroundSize}
32
+ @change=${this.onChangeImageBackgroundProp}
33
+ ></background-editor-plugin
34
+ ></cdtr-editor-container>`:null}
35
+ <cdtr-editor-container>
36
+ <cdtr-row>
37
+ <cdtr-title
38
+ ><lang-text
39
+ text="add_urlAddress_from_media_site"
40
+ ></lang-text
41
+ ></cdtr-title>
42
+ </cdtr-row>
43
+ <cdtr-row>
44
+ <cdtr-input
45
+ .value="${this.backgroundVideo}"
46
+ @input=${this.cmds.onChangeBackgroundVideo}
47
+ style="width:100%;direction:ltr;text-align:left;"
48
+ placeholder="https://"
49
+ ></cdtr-input>
50
+ ${"object"==typeof this.backgroundInstance&&this.backgroundInstance?.component?i.qy`<paper-button
51
+ style=" font-size: 13px;
52
+ padding: 0;
53
+ text-align: var(--text-align-locale);
54
+ direction: var(--direction-locale);
55
+ justify-content: flex-start;
56
+ color:red;
57
+ margin: 0;"
58
+ @click=${this.cmds.onRemoveBackgroundVideo}
59
+ ><lang-text text="remove_background_movie"></lang-text
60
+ ></paper-button>`:null}
61
+ </cdtr-row>
62
+ </cdtr-editor-container>
63
+ <cdtr-divider></cdtr-divider>
64
+ <cdtr-editor-container>
65
+ <cdtr-colorpicker-editor
66
+ .hasAlpha=${"web"===t}
67
+ @change=${this.cmds.onChangebackground}
68
+ .value=${this.background}
69
+ text="backgroundColor"
70
+ ></cdtr-colorpicker-editor>
71
+ </cdtr-editor-container>
72
+ <cdtr-divider></cdtr-divider>
73
+ <cdtr-editor-container>
74
+ <cdtr-checkbox
75
+ @change=${t=>this.onChangeBakgroundExpanding(t)}
76
+ .checked=${this.expand_image_for_outlook}
77
+ >
78
+ <cdtr-title
79
+ ><lang-text text="expand_image_for_outlook"></lang-text
80
+ ></cdtr-title>
81
+ </cdtr-checkbox>
82
+ <h6>
83
+ <lang-text
84
+ whiteSpace="break-spaces"
85
+ text="expand_image_for_outlook_description"
86
+ ></lang-text>
87
+ </h6>
88
+ </cdtr-editor-container>
89
+ <cdtr-divider></cdtr-divider>`:null}
90
+ ${"design"===this.tabName?i.qy`
91
+ <cdtr-editor-container>
92
+ <cdtr-colorpicker-editor
93
+ .hasAlpha=${!1}
94
+ @change=${this.cmds.onChangebackground}
95
+ .value=${this.background}
96
+ text="backgroundColor"
97
+ ></cdtr-colorpicker-editor>
98
+ </cdtr-editor-container>
99
+ <cdtr-editor-container>
100
+ <cdtr-width-editor
101
+ text="width"
102
+ unit="px"
103
+ max="1000"
104
+ min="500"
105
+ .value="${this.width}"
106
+ @input=${this.onChangeWidth}
107
+ .sizes=${[{name:d.M.get("lang","recommended")||"recommended",value:600,default:!0},{name:d.M.get("lang","large")||"large",value:1e3}]}
108
+ ></cdtr-width-editor>
109
+ <p style="font-size:12px">
110
+ <lang-text whiteSpace="" text="email_600"></lang-text>
111
+ </p>
112
+ </cdtr-editor-container>
113
+ <cdtr-divider></cdtr-divider>
114
+ <cdtr-editor-container>
115
+ <cdtr-row justify="center">
116
+ <cdtr-col sm="12"
117
+ ><cdtr-title style="display:block" class="align-lang"
118
+ ><lang-text text="padding"></lang-text></cdtr-title
119
+ ></cdtr-col>
120
+ <cdtr-col sm="6"
121
+ ><cdtr-spacing
122
+ .topValue="${this.padding.topValue}"
123
+ .bottomValue="${this.padding.bottomValue}"
124
+ .leftValue="${this.padding.leftValue}"
125
+ .rightValue="${this.padding.rightValue}"
126
+ isLock=${!1}
127
+ max="500"
128
+ @input=${this.cmds.onChangePadding}
129
+ ></cdtr-spacing
130
+ ></cdtr-col>
131
+ </cdtr-row>
132
+ </cdtr-editor-container>
133
+
134
+ <cdtr-divider></cdtr-divider>
135
+ <cdtr-editor-container>
136
+ <cdtr-row alignItems="center" justify="space-between">
137
+ <cdtr-col>
138
+ <cdtr-title>
139
+ <lang-text text="no_responsive"></lang-text>
140
+ </cdtr-title>
141
+ </cdtr-col>
142
+ <cdtr-col sm="1">
143
+ <cdtr-checkbox
144
+ @change=${this.cmds.toggleResponsive}
145
+ .checked="${this.noResponsive}"
146
+ ></cdtr-checkbox>
147
+ </cdtr-col>
148
+ </cdtr-row>
149
+ </cdtr-editor-container>
150
+ <!-- <cdtr-divider></cdtr-divider>
151
+ <cdtr-editor-container>
152
+ <cdtr-radius-editor
153
+ @input=${this.cmds.onchangeRadius}
154
+ ></cdtr-radius-editor>
155
+ </cdtr-editor-container> -->
156
+ <cdtr-divider></cdtr-divider>
157
+
158
+ <cdtr-editor-container>
159
+ <cdtr-border-editor
160
+ .borderStyle=${this.borderStyle}
161
+ .borderWidth=${this.borderWidth}
162
+ .borderColor=${this.borderColor}
163
+ .borderTopWidth=${this.borderTopWidth}
164
+ .borderBottomWidth=${this.borderBottomWidth}
165
+ .borderLeftWidth=${this.borderLeftWidth}
166
+ .borderRightWidth=${this.borderRightWidth}
167
+ .borderTopRightRadius=${this.borderTopRightRadius}
168
+ .borderTopLeftRadius=${this.borderTopLeftRadius}
169
+ .borderBottomRightRadius=${this.borderBottomRightRadius}
170
+ .borderBottomLeftRadius=${this.borderBottomLeftRadius}
171
+ @change=${this.cmds.onChangeBorderStyle}
172
+ ></cdtr-border-editor>
173
+ </cdtr-editor-container>
174
+ `:null}
175
+
176
+ <!-- ${"typography"===this.tabName?i.qy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
177
+ <!-- ${"spacing"===this.tabName?i.qy`
178
+ <cdtr-editor-container>
179
+ <cdtr-row justify="center">
180
+ <cdtr-col sm="12"
181
+ ><cdtr-title style="display:block" class="align-lang"
182
+ ><lang-text text="padding"></lang-text></cdtr-title
183
+ ></cdtr-col>
184
+ <cdtr-col sm="6"
185
+ ><cdtr-spacing
186
+ .topValue="${this.padding.topValue}"
187
+ .bottomValue="${this.padding.bottomValue}"
188
+ .leftValue="${this.padding.leftValue}"
189
+ .rightValue="${this.padding.rightValue}"
190
+ isLock=${!1}
191
+ max="500"
192
+ @input=${this.cmds.onChangePadding}
193
+ ></cdtr-spacing
194
+ ></cdtr-col>
195
+ </cdtr-row>
196
+ </cdtr-editor-container>
197
+ <cdtr-editor-container>
198
+ <cdtr-row justify="center">
199
+ <cdtr-col sm="12"
200
+ ><cdtr-title style="display:block" class="align-lang"
201
+ ><lang-text text="margin"></lang-text></cdtr-title
202
+ ></cdtr-col>
203
+ <cdtr-col sm="6"
204
+ ><cdtr-spacing
205
+ .topValue=${this.margin.topValue}
206
+ .bottomValue=${this.margin.bottomValue}
207
+ isLock=${!1}
208
+ max="500"
209
+ .hasLeft=${!1}
210
+ .hasRight=${!1}
211
+ @input=${this.cmds.onChangeMargin}
212
+ ></cdtr-spacing
213
+ ></cdtr-col>
214
+ </cdtr-row>
215
+ </cdtr-editor-container>
216
+ `:null} -->
217
+ </div>
218
+ </cdtr-editor-tabs>
219
+ <cdtr-gallery
220
+ .multi=${!0}
221
+ @close=${()=>{this.galleryOpened=!1}}
222
+ .opened=${this.galleryOpened}
223
+ @file=${this.cmds.onChangeImage}
224
+ ></cdtr-gallery>
225
+ `}}(0,o.A)(h,"styles",i.AH`
226
+ paper-button.gallery {
227
+ background: var(--primary);
228
+ color: var(--primary-text);
229
+ }
230
+ paper-button.backgrounds {
231
+ background: BLACK;
232
+ color: #fff;
233
+ }
234
+ `),(0,o.A)(h,"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},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}}),customElements.define("block-editor",h)}}]);
Binary file
@@ -1 +1 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7466],{47466(e,t,o){o.d(t,{default:()=>c});const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"time"},{text:"design"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:a,changeTab:n,tabs:r}=e;t.parent("col");return[{type:"datetime",value:t.props.date,active:"time"===a.text,onChange:e=>{const t=e.target.value;o.execCommand("date",t.toString())}},{type:"slider",title:"size",max:500,min:200,value:parseFloat(t.props.containerWidth),active:"design"===a.text,onInput:e=>{const t=e.target.value;o.execCommand("containerWidth",t+"px")}},{type:"divider",active:"design"===a.text},{type:"heading",level:5,text:"numbers"},{type:"colorpicker",title:"color",alpha:!1,value:t.props.numberColor,onChange:e=>{const t=e.target.value;o.execCommand("numberColor",t)}},{type:"divider"},{type:"heading",level:5,text:"labels"},{type:"checkbox",title:"counterTitle",checked:t.props.hasLabels,onChange:e=>{const t=e.target.checked;o.execCommand("hasLabels",t)}},{type:"colorpicker",title:"color",alpha:!1,alpha:!1,value:t.props.labelColor,onChange:e=>{const t=e.target.value;o.execCommand("labelColor",t)}},{type:"divider"}]}}}};var n=o(61919);const r=()=>({set:(e,t,o)=>{switch(t){case"containerWidth":case"numberFontFamily":case"labelSize":case"numberSize":case"colBorderSize":case"hasLabels":case"colBorderSize":case"labelFontFamily":case"numberFontFamily":case"date":return e[t]=o,!0;case"labelColor":case"colBg":case"containerBg":case"numberColor":case"colBorderColor":return o="#"+(0,n.A)(o).toHex(),e[t]=o,!0}}});o(91597);var l=o(86319);function s(e){return(e=(0,n.A)(e).toRgb()).r+","+e.g+","+e.b+","+e.a}const c=()=>{const e="countdown";return{name:e,create:t=>{let{createElement:o,compose:c,helpers:i}=t;const d=c.props,p=document.createElement("div");p.style.position="relative";const m=document.createElement("img");m.style.maxWidth="100%";const u=document.createElement("cdtr-block-loader");function g(){let{key:e,value:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u.parentElement||"containerWidth"===e||p.append(u);const o=h.closest("col");let a;if(o&&(a=o.props?.style?.background),!a){const e=h.closest("block");e&&(a=a=e.props?.style?.background)}if(!a){const e=h.closest("section");e&&(a=a=e.props?.style?.background)}if(!a){const e=h.closest("root");e&&(a=a=e.props?.style?.background)}"transparent"===a&&(a="#fff"),a||(a="#fff");const r=(0,n.A)(a);c.props.containerBg="#"+r.toHex();const i=function(e){const t=new Date(e);return`${String(t.getMonth()+1).padStart(2,"0")}/${String(t.getDate()).padStart(2,"0")}/${t.getFullYear()}+${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`}(c.props.date),[g,b]=i.split("+"),f=l.M.get("config","language");let C,y,v,x;C="he"===f?"ימים":"Days",y="he"===f?"שעות":"Hours",v="he"===f?"דקות":"Minutes",x="he"===f?"שניות":"Seconds";const S=function(e){let{time:t,date:o,showTitles:a,ht:n="",mt:r="",st:l="",dt:c="",bgColor:i,timerC:d,titleC:p,language:m}=e;"transparent"===i&&(i="#fff"),-1!==i.indexOf("#")&&(i=s(i)),-1!==d.indexOf("#")&&(d=s(d)),-1!==p.indexOf("#")&&(p=s(p));const u={time:t,date:o,showTitles:a,ht:n,mt:r,st:l,dt:c,bgColor:i,timerC:d,titleC:p,language:m};let g=0;const h=["https://app.creaditor.com/assets/countdown/timerHandler.ashx?"];for(var b in u.time=u.date+"+"+u.time,delete u.date,u.showTitles&&"false"!==u.showTitles||(delete u.ht,delete u.mt,delete u.st,delete u.dt),u.ht||delete u.ht,u.mt||delete u.mt,u.st||delete u.st,u.dt||delete u.dt,u)g>0&&h.push("&"),h.push(b+"="+u[b]),g++;return h.join("")}({date:g,showTitles:!!d.hasLabels,time:b,bgColor:d.containerBg,timerC:d.numberColor,titleC:d.labelColor,language:d.language,dt:C,ht:y,mt:v,st:x});m.src=S,m.addEventListener("load",()=>{setTimeout(()=>{u.remove()},0)},{once:!0}),d.containerWidth&&(m.style.width=d.containerWidth)}u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.color="var(--primary-color)",c.editor.on("update",g),p.append(m);const h=o({name:e,id:c.id,template:p,defaultProps:{hasColons:!0,hasLabels:!0,date:"",language:"he",style:{},classList:[],containerWidth:"800px",containerBg:"#fff",containerRadius:"0",colBg:"transparent",colBorderStyle:"none",colBorderSize:"0",colBorderColor:"none",colBorderPadding:"0",colBorderRadius:"100px",numberSize:"30px",numberColor:"black",numberFontFamily:"Arial",labelSize:"14px",labelColor:"black",labelfontFamily:"Arial"},render:e=>{g(e)},validator:r(),draggable:{group:"element"},droppable:{group:"element"},handleBar:!0,schema:c.schema,onSelect:e=>{m.classList.add(e)},onDeselect:e=>{m.classList.remove(e)},elementProps:c,remove:()=>{p.remove()},createEditor:a});return g(),h}}}}}]);
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7466],{47466(e,t,o){o.d(t,{default:()=>c});const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"time"},{text:"design"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:a,changeTab:n,tabs:r}=e;t.parent("col");return[{type:"datetime",value:t.props.date,active:"time"===a.text,onChange:e=>{const t=e.target.value;o.execCommand("date",t.toString())}},{type:"slider",title:"size",max:500,min:200,value:parseFloat(t.props.containerWidth),active:"design"===a.text,onInput:e=>{const t=e.target.value;o.execCommand("containerWidth",t+"px")}},{type:"divider",active:"design"===a.text},{type:"heading",level:5,text:"numbers"},{type:"colorpicker",title:"color",alpha:!1,value:t.props.numberColor,onChange:e=>{const t=e.target.value;o.execCommand("numberColor",t)}},{type:"divider"},{type:"heading",level:5,text:"labels"},{type:"checkbox",title:"counterTitle",checked:t.props.hasLabels,onChange:e=>{const t=e.target.checked;o.execCommand("hasLabels",t)}},{type:"colorpicker",title:"color",alpha:!1,alpha:!1,value:t.props.labelColor,onChange:e=>{const t=e.target.value;o.execCommand("labelColor",t)}},{type:"divider"}]}}}};var n=o(61919);const r=()=>({set:(e,t,o)=>{switch(t){case"containerWidth":case"numberFontFamily":case"labelSize":case"numberSize":case"colBorderSize":case"hasLabels":case"colBorderSize":case"labelFontFamily":case"numberFontFamily":case"date":return e[t]=o,!0;case"labelColor":case"colBg":case"containerBg":case"numberColor":case"colBorderColor":return o="#"+(0,n.A)(o).toHex(),e[t]=o,!0}}});var l=o(86319);function s(e){return(e=(0,n.A)(e).toRgb()).r+","+e.g+","+e.b+","+e.a}const c=()=>{const e="countdown";return{name:e,create:t=>{let{createElement:o,compose:c,helpers:i}=t;const d=c.props,p=document.createElement("div");p.style.position="relative";const m=document.createElement("img");m.style.maxWidth="100%";const u=document.createElement("cdtr-block-loader");function g(){let{key:e,value:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u.parentElement||"containerWidth"===e||p.append(u);const o=h.closest("col");let a;if(o&&(a=o.props?.style?.background),!a){const e=h.closest("block");e&&(a=a=e.props?.style?.background)}if(!a){const e=h.closest("section");e&&(a=a=e.props?.style?.background)}if(!a){const e=h.closest("root");e&&(a=a=e.props?.style?.background)}"transparent"===a&&(a="#fff"),a||(a="#fff");const r=(0,n.A)(a);c.props.containerBg="#"+r.toHex();const i=function(e){const t=new Date(e);return`${String(t.getMonth()+1).padStart(2,"0")}/${String(t.getDate()).padStart(2,"0")}/${t.getFullYear()}+${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`}(c.props.date),[g,b]=i.split("+"),f=l.M.get("config","language");let C,y,v,x;C="he"===f?"ימים":"Days",y="he"===f?"שעות":"Hours",v="he"===f?"דקות":"Minutes",x="he"===f?"שניות":"Seconds";const S=function(e){let{time:t,date:o,showTitles:a,ht:n="",mt:r="",st:l="",dt:c="",bgColor:i,timerC:d,titleC:p,language:m}=e;"transparent"===i&&(i="#fff"),-1!==i.indexOf("#")&&(i=s(i)),-1!==d.indexOf("#")&&(d=s(d)),-1!==p.indexOf("#")&&(p=s(p));const u={time:t,date:o,showTitles:a,ht:n,mt:r,st:l,dt:c,bgColor:i,timerC:d,titleC:p,language:m};let g=0;const h=["https://app.creaditor.com/assets/countdown/timerHandler.ashx?"];for(var b in u.time=u.date+"+"+u.time,delete u.date,u.showTitles&&"false"!==u.showTitles||(delete u.ht,delete u.mt,delete u.st,delete u.dt),u.ht||delete u.ht,u.mt||delete u.mt,u.st||delete u.st,u.dt||delete u.dt,u)g>0&&h.push("&"),h.push(b+"="+u[b]),g++;return h.join("")}({date:g,showTitles:!!d.hasLabels,time:b,bgColor:d.containerBg,timerC:d.numberColor,titleC:d.labelColor,language:d.language,dt:C,ht:y,mt:v,st:x});m.src=S,m.addEventListener("load",()=>{setTimeout(()=>{u.remove()},0)},{once:!0}),d.containerWidth&&(m.style.width=d.containerWidth)}u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.color="var(--primary-color)",c.editor.on("update",g),p.append(m);const h=o({name:e,id:c.id,template:p,defaultProps:{hasColons:!0,hasLabels:!0,date:"",language:"he",style:{},classList:[],containerWidth:"800px",containerBg:"#fff",containerRadius:"0",colBg:"transparent",colBorderStyle:"none",colBorderSize:"0",colBorderColor:"none",colBorderPadding:"0",colBorderRadius:"100px",numberSize:"30px",numberColor:"black",numberFontFamily:"Arial",labelSize:"14px",labelColor:"black",labelfontFamily:"Arial"},render:e=>{g(e)},validator:r(),draggable:{group:"element"},droppable:{group:"element"},handleBar:!0,schema:c.schema,onSelect:e=>{m.classList.add(e)},onDeselect:e=>{m.classList.remove(e)},elementProps:c,remove:()=>{p.remove()},createEditor:a});return g(),h}}}}}]);
Binary file
@@ -0,0 +1,40 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[752],{40752(t,e,i){i.r(e),i.d(e,{EditorContainer:()=>o});var n=i(24586),a=i(59929);class o extends a.WF{constructor(){super(),this.pt="10px",this.isAnimate=!0}render(){return a.qy`<div
2
+ style="padding-top:${this.pt}"
3
+ class="container ${this.isAnimate?"animate":""}"
4
+ >
5
+ <slot></slot>
6
+ </div> `}}(0,n.A)(o,"styles",a.AH`
7
+ //create fade in animation
8
+ :host{
9
+ direction: var(--direction-locale);
10
+ }
11
+ :host *{
12
+ direction: var(--direction-locale);
13
+ }
14
+ .container:hover {
15
+ background: #9c9c9c0b;
16
+ }
17
+ .container {
18
+ padding-left: 15px;
19
+ padding-right: 15px;
20
+ display: block;
21
+ width: 100%;
22
+ min-height: 20px;
23
+ padding-bottom: 10px;
24
+ box-sizing: border-box;
25
+ }
26
+ .animate {
27
+ animation: slide-in 0.2s ease-in-out;
28
+ }
29
+ @keyframes slide-in {
30
+ from {
31
+ opacity: 0;
32
+ transform: translateX(10%);
33
+ }
34
+
35
+ to {
36
+ opacity: 1;
37
+ transform: translateX(0%);
38
+ }
39
+ }
40
+ `),(0,n.A)(o,"properties",{pt:{type:String},isAnimate:{type:Boolean}}),customElements.define("cdtr-editor-container",o)}}]);
Binary file
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[767],{70767(e,t,r){r.r(t),r.d(t,{PexelsGallery:()=>n});var o=r(24586),a=r(59929),s=(r(86319),r(49549)),l=(r(91597),r(21421),r(93967)),i=r(86959);function c(e){e||(e={query:"nature",per_page:1});const t=`${i.XW.agent_url}pexels/search/?query=${e.query||"marketing"}&per_page=${e.per_page||1}`;return fetch(t).then(e=>e.json()).then(e=>{if("success"===e.status&&e.data)return e.data.photos;throw new Error("Invalid response from backend")}).catch(e=>{throw console.error("Error fetching images:",e),e})}class n extends a.WF{constructor(){super(),this.images=[],this.loading=!1,this.searchQuery="",this.page=1,this.hasMore=!0,this.perPage=20,this.multi=!0,this.selectedColor="",this.defaultSearchTerms=["nature","landscape","city","people","technology","food","architecture","travel","business","art"],this.colorOptions=[{name:"Red",value:"red",hex:"#ff0000"},{name:"Orange",value:"orange",hex:"#ff8000"},{name:"Yellow",value:"yellow",hex:"#ffff00"},{name:"Green",value:"green",hex:"#00ff00"},{name:"Blue",value:"blue",hex:"#0000ff"},{name:"Purple",value:"purple",hex:"#8000ff"},{name:"Pink",value:"pink",hex:"#ff0080"},{name:"Brown",value:"brown",hex:"#8b4513"},{name:"Black",value:"black",hex:"#000000"},{name:"White",value:"white",hex:"#ffffff"},{name:"Gray",value:"gray",hex:"#808080"},{name:"Teal",value:"teal",hex:"#008080"},{name:"Navy",value:"navy",hex:"#000080"},{name:"Maroon",value:"maroon",hex:"#800000"},{name:"Olive",value:"olive",hex:"#808000"},{name:"Lime",value:"lime",hex:"#00ff00"},{name:"Aqua",value:"aqua",hex:"#00ffff"},{name:"Silver",value:"silver",hex:"#c0c0c0"},{name:"Fuchsia",value:"fuchsia",hex:"#ff00ff"},{name:"Coral",value:"coral",hex:"#ff7f50"},{name:"Gold",value:"gold",hex:"#ffd700"},{name:"Indigo",value:"indigo",hex:"#4b0082"},{name:"Violet",value:"violet",hex:"#ee82ee"},{name:"Cyan",value:"cyan",hex:"#00ffff"},{name:"Magenta",value:"magenta",hex:"#ff00ff"}],this.cacheKey="pexels-gallery-cache",this.cacheExpiry=864e5,this.isTyping=!1,this.lastSearchQuery="",this.searchTimeout=null}connectedCallback(){super.connectedCallback(),this.loadFromCache()}getCacheData(){try{const e=localStorage.getItem(this.cacheKey);if(!e)return null;const t=JSON.parse(e),r=Date.now();return t.timestamp&&r-t.timestamp>this.cacheExpiry?(localStorage.removeItem(this.cacheKey),null):t}catch(e){return console.error("Error reading cache:",e),null}}saveToCache(){if(!this.isTyping)try{const e={images:this.images,searchQuery:this.searchQuery,selectedColor:this.selectedColor,page:this.page,hasMore:this.hasMore,timestamp:Date.now()};localStorage.setItem(this.cacheKey,JSON.stringify(e))}catch(e){console.error("Error saving to cache:",e)}}loadFromCache(){const e=this.getCacheData();e?(this.images=e.images||[],this.searchQuery=e.searchQuery||"",this.selectedColor=e.selectedColor||"",this.page=e.page||1,this.hasMore=void 0===e.hasMore||e.hasMore,console.log("Gallery state restored from cache"),this.requestUpdate(),this.updateComplete.then(()=>{this.updateSearchInput()})):this.loadRandomImages()}updateSearchInput(){const e=this.shadowRoot?.querySelector('cdtr-input[type="search"]');e&&(e.value=this.searchQuery)}async loadRandomImages(){this.loading=!0;try{const e=this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)],t=await c({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.searchQuery="",this.selectedColor="",this.page=1,this.saveToCache()):(console.error("Failed to load images from Pexels"),this.images=[])}catch(e){console.error("Error loading images:",e),this.images=[]}finally{this.loading=!1}}async searchImages(e){if(!e.trim())return this.loadRandomImages();this.loading=!0,this.searchQuery=e,this.page=1;try{const t=await c({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.saveToCache()):(console.error("Failed to search images from Pexels"),this.images=[])}catch(e){console.error("Error searching images:",e),this.images=[]}finally{this.loading=!1}}async loadMoreImages(){if(!this.loading&&this.hasMore){this.loading=!0,this.page++;try{let e;if(this.selectedColor&&"all"!==this.selectedColor){let t=this.removeColorFilters(this.searchQuery);e=t.trim()?`${t} ${this.selectedColor}`:this.selectedColor}else{e=this.removeColorFilters(this.searchQuery)||this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)]}const t=await c({query:e,per_page:this.perPage});if(t.ok){const e=(await t.json()).photos||[];this.images=[...this.images,...e],this.hasMore=e.length===this.perPage,this.saveToCache()}}catch(e){console.error("Error loading more images:",e)}finally{this.loading=!1}}}onSearch(e){const t=e.target.value;this.isTyping=!0,t!==this.lastSearchQuery&&(this.lastSearchQuery=t,this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.isTyping=!1,this.searchWithColor(t,this.selectedColor)},500))}onSelectImage(e){const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`,o={detail:{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",o))}sendSelectedImages(){const e={detail:this.images.filter(e=>e.selected).map(e=>{const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`;return{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r}}),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onScroll(e){const t=e.target;t.scrollTop+t.offsetHeight>=t.scrollHeight-50&&this.loadMoreImages()}clearCache(){localStorage.removeItem(this.cacheKey),console.log("Gallery cache cleared")}onColorChange(e){console.log("Color change event:",e);const t=e.target.value;console.log("Selected color:",t),this.selectedColor="all"===t?"":t;const r=this.searchQuery||"";this.searchWithColor(r,this.selectedColor)}searchWithColor(e,t){if(t&&"all"!==t){let r=this.removeColorFilters(e),o=r.trim()?`${r} ${t}`:t;this.searchImages(o)}else{let t=this.removeColorFilters(e);this.searchImages(t)}}removeColorFilters(e){if(!e)return"";const t=this.colorOptions.map(e=>e.value);return e.split(" ").filter(e=>{const r=e.toLowerCase().trim();return!t.includes(r)}).join(" ").trim()}getSelectedColorName(){if(!this.selectedColor)return"Filter by color";const e=this.colorOptions.find(e=>e.value===this.selectedColor);return e?e.name:"Filter by color"}getSelectedColorHex(){if(!this.selectedColor)return"#666";const e=this.colorOptions.find(e=>e.value===this.selectedColor);return e?e.hex:"#666"}render(){return a.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[767],{70767(e,t,r){r.r(t),r.d(t,{PexelsGallery:()=>n});var o=r(24586),a=r(59929),s=r(49549),l=r(93967),i=r(86959);function c(e){e||(e={query:"nature",per_page:1});const t=`${i.XW.agent_url}pexels/search/?query=${e.query||"marketing"}&per_page=${e.per_page||1}`;return fetch(t).then(e=>e.json()).then(e=>{if("success"===e.status&&e.data)return e.data.photos;throw new Error("Invalid response from backend")}).catch(e=>{throw console.error("Error fetching images:",e),e})}class n extends a.WF{constructor(){super(),this.images=[],this.loading=!1,this.searchQuery="",this.page=1,this.hasMore=!0,this.perPage=20,this.multi=!0,this.selectedColor="",this.defaultSearchTerms=["nature","landscape","city","people","technology","food","architecture","travel","business","art"],this.colorOptions=[{name:"Red",value:"red",hex:"#ff0000"},{name:"Orange",value:"orange",hex:"#ff8000"},{name:"Yellow",value:"yellow",hex:"#ffff00"},{name:"Green",value:"green",hex:"#00ff00"},{name:"Blue",value:"blue",hex:"#0000ff"},{name:"Purple",value:"purple",hex:"#8000ff"},{name:"Pink",value:"pink",hex:"#ff0080"},{name:"Brown",value:"brown",hex:"#8b4513"},{name:"Black",value:"black",hex:"#000000"},{name:"White",value:"white",hex:"#ffffff"},{name:"Gray",value:"gray",hex:"#808080"},{name:"Teal",value:"teal",hex:"#008080"},{name:"Navy",value:"navy",hex:"#000080"},{name:"Maroon",value:"maroon",hex:"#800000"},{name:"Olive",value:"olive",hex:"#808000"},{name:"Lime",value:"lime",hex:"#00ff00"},{name:"Aqua",value:"aqua",hex:"#00ffff"},{name:"Silver",value:"silver",hex:"#c0c0c0"},{name:"Fuchsia",value:"fuchsia",hex:"#ff00ff"},{name:"Coral",value:"coral",hex:"#ff7f50"},{name:"Gold",value:"gold",hex:"#ffd700"},{name:"Indigo",value:"indigo",hex:"#4b0082"},{name:"Violet",value:"violet",hex:"#ee82ee"},{name:"Cyan",value:"cyan",hex:"#00ffff"},{name:"Magenta",value:"magenta",hex:"#ff00ff"}],this.cacheKey="pexels-gallery-cache",this.cacheExpiry=864e5,this.isTyping=!1,this.lastSearchQuery="",this.searchTimeout=null}connectedCallback(){super.connectedCallback(),this.loadFromCache()}getCacheData(){try{const e=localStorage.getItem(this.cacheKey);if(!e)return null;const t=JSON.parse(e),r=Date.now();return t.timestamp&&r-t.timestamp>this.cacheExpiry?(localStorage.removeItem(this.cacheKey),null):t}catch(e){return console.error("Error reading cache:",e),null}}saveToCache(){if(!this.isTyping)try{const e={images:this.images,searchQuery:this.searchQuery,selectedColor:this.selectedColor,page:this.page,hasMore:this.hasMore,timestamp:Date.now()};localStorage.setItem(this.cacheKey,JSON.stringify(e))}catch(e){console.error("Error saving to cache:",e)}}loadFromCache(){const e=this.getCacheData();e?(this.images=e.images||[],this.searchQuery=e.searchQuery||"",this.selectedColor=e.selectedColor||"",this.page=e.page||1,this.hasMore=void 0===e.hasMore||e.hasMore,console.log("Gallery state restored from cache"),this.requestUpdate(),this.updateComplete.then(()=>{this.updateSearchInput()})):this.loadRandomImages()}updateSearchInput(){const e=this.shadowRoot?.querySelector('cdtr-input[type="search"]');e&&(e.value=this.searchQuery)}async loadRandomImages(){this.loading=!0;try{const e=this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)],t=await c({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.searchQuery="",this.selectedColor="",this.page=1,this.saveToCache()):(console.error("Failed to load images from Pexels"),this.images=[])}catch(e){console.error("Error loading images:",e),this.images=[]}finally{this.loading=!1}}async searchImages(e){if(!e.trim())return this.loadRandomImages();this.loading=!0,this.searchQuery=e,this.page=1;try{const t=await c({query:e,per_page:this.perPage});t?(this.images=t||[],this.hasMore=t&&t.length===this.perPage,this.saveToCache()):(console.error("Failed to search images from Pexels"),this.images=[])}catch(e){console.error("Error searching images:",e),this.images=[]}finally{this.loading=!1}}async loadMoreImages(){if(!this.loading&&this.hasMore){this.loading=!0,this.page++;try{let e;if(this.selectedColor&&"all"!==this.selectedColor){let t=this.removeColorFilters(this.searchQuery);e=t.trim()?`${t} ${this.selectedColor}`:this.selectedColor}else{e=this.removeColorFilters(this.searchQuery)||this.defaultSearchTerms[Math.floor(Math.random()*this.defaultSearchTerms.length)]}const t=await c({query:e,per_page:this.perPage});if(t.ok){const e=(await t.json()).photos||[];this.images=[...this.images,...e],this.hasMore=e.length===this.perPage,this.saveToCache()}}catch(e){console.error("Error loading more images:",e)}finally{this.loading=!1}}}onSearch(e){const t=e.target.value;this.isTyping=!0,t!==this.lastSearchQuery&&(this.lastSearchQuery=t,this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.isTyping=!1,this.searchWithColor(t,this.selectedColor)},500))}onSelectImage(e){const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`,o={detail:{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r},bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",o))}sendSelectedImages(){const e={detail:this.images.filter(e=>e.selected).map(e=>{const t=`Photo by ${e.photographer} on Pexels`,r=`Photo by <a href="${e.photographer_url}" target="_blank" rel="noopener noreferrer">${e.photographer}</a> on <a href="${e.url}" target="_blank" rel="noopener noreferrer">Pexels</a>`;return{id:e.id,src:e.src.medium||e.src.large||e.src.original,name:`Pexels Image ${e.id}`,size:`${e.width}x${e.height}`,photographer:e.photographer,photographerUrl:e.photographer_url,pexelsUrl:e.url,alt:e.alt||`Photo by ${e.photographer} on Pexels`,attributionText:t,attributionHtml:r}}),bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",e))}onScroll(e){const t=e.target;t.scrollTop+t.offsetHeight>=t.scrollHeight-50&&this.loadMoreImages()}clearCache(){localStorage.removeItem(this.cacheKey),console.log("Gallery cache cleared")}onColorChange(e){console.log("Color change event:",e);const t=e.target.value;console.log("Selected color:",t),this.selectedColor="all"===t?"":t;const r=this.searchQuery||"";this.searchWithColor(r,this.selectedColor)}searchWithColor(e,t){if(t&&"all"!==t){let r=this.removeColorFilters(e),o=r.trim()?`${r} ${t}`:t;this.searchImages(o)}else{let t=this.removeColorFilters(e);this.searchImages(t)}}removeColorFilters(e){if(!e)return"";const t=this.colorOptions.map(e=>e.value);return e.split(" ").filter(e=>{const r=e.toLowerCase().trim();return!t.includes(r)}).join(" ").trim()}getSelectedColorName(){if(!this.selectedColor)return"Filter by color";const e=this.colorOptions.find(e=>e.value===this.selectedColor);return e?e.name:"Filter by color"}getSelectedColorHex(){if(!this.selectedColor)return"#666";const e=this.colorOptions.find(e=>e.value===this.selectedColor);return e?e.hex:"#666"}render(){return a.qy`
2
2
  <div class="gallery-container">
3
3
  <cdtr-row alignItems="center">
4
4
  <cdtr-input
Binary file
@@ -0,0 +1,71 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8042],{38042(e,t,i){i.r(t),i.d(t,{Resizeable:()=>f});var s,n,o,r,h,l,a,d,u=i(59088),p=i(24586),c=i(36936),g=i(59929),b=i(49410),m=i(21421);let f=(s=(0,b.MZ)({type:Number,reflect:!0}),n=(0,b.MZ)({type:Number,reflect:!0}),o=(0,b.MZ)({type:Boolean,reflect:!0}),d=class extends g.WF{constructor(){super(),(0,u.A)(this,"height",h,this),(0,u.A)(this,"delta",l,this),(0,u.A)(this,"isDragging",a,this),(0,p.A)(this,"m_pos",0),(0,p.A)(this,"onResizeEvent",void 0),(0,p.A)(this,"finishedEvent",void 0),(0,p.A)(this,"handleRef",(0,m._)()),this.isDragging=!1,this.height=200,this.resize=this.resize.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onResizeEvent=new UIEvent("resize",{view:window,bubbles:!0,cancelable:!0}),this.finishedEvent=new UIEvent("finished",{view:window,bubbles:!0,cancelable:!0})}resize(e){this.removeRange();const t=this.m_pos-e.y;this.m_pos=e.y;let i=this.getBoundingClientRect().height-t;i<=0&&(i=0),this.height=i+"px",this.dispatchEvent(this.onResizeEvent)}removeRange(){const e=window.getSelection();if(e&&e.rangeCount>1)for(let t=1;t<e.rangeCount;t++)e.removeRange(e.getRangeAt(t))}onMouseUp(){this.isDragging=!1,document.removeEventListener("mousemove",this.resize,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.dispatchEvent(this.finishedEvent)}onMouseDown(e){const t=this.handleRef.value;if(!t)return;const i=t.getBoundingClientRect();e.y>i.top&&e.y<i.bottom&&(this.isDragging=!0,this.m_pos=e.y,document.addEventListener("mousemove",this.resize,!1),document.addEventListener("mouseup",this.onMouseUp,!1))}disconnectedCallback(){document.removeEventListener("mousedown",this.onMouseDown)}connectedCallback(){super.connectedCallback(),setTimeout(()=>{const e=this.parentElement;if(!e)return;const t=e.getBoundingClientRect(),i=this.getBoundingClientRect(),s=t.bottom;s-(i.top+i.height)>0&&(this.height=parseInt(String(s-i.top))+"px",this.style.height=String(this.height)),document.addEventListener("mousedown",this.onMouseDown)},200)}render(){return g.qy`<slot></slot>
2
+ <div ${(0,m.K)(this.handleRef)} class="bottom-resize"></div>
3
+ ${this.isDragging?g.qy`<div class="wrapper">
4
+ <div style="height:${this.height}" class="center-line"></div>
5
+ </div>
6
+ <div class="inspect">${this.height}</div>`:null} `}},(0,p.A)(d,"styles",g.AH`
7
+ :host {
8
+ min-height: 3px;
9
+ display: inline-block;
10
+ width: 100%;
11
+ -webkit-touch-callout: none;
12
+ -webkit-user-select: none;
13
+ -moz-user-select: none;
14
+ -ms-user-select: none;
15
+ user-select: none;
16
+ }
17
+ .bottom-resize {
18
+ position: absolute;
19
+ top: 100%;
20
+ width: 100%;
21
+ height: 4px;
22
+ transform: translateY(-50%);
23
+ cursor: ns-resize;
24
+ z-index: 5;
25
+ }
26
+ :host:hover .bottom-resize {
27
+ display: block !important;
28
+ }
29
+ .inspect {
30
+ position: absolute;
31
+ top: 98%;
32
+ left: 55%;
33
+ transform: translateY(-100%);
34
+ color: #fff;
35
+ background: #000000cf;
36
+ padding: 7px;
37
+ border-radius: 0.3rem;
38
+ font-family: Arial;
39
+ font-size: 12px;
40
+ }
41
+ .wrapper {
42
+ width: 100%;
43
+ height: 100%;
44
+ position: relative;
45
+ }
46
+ .center-line {
47
+ position: absolute;
48
+ left: 50%;
49
+ border-left: 1px dashed;
50
+ }
51
+ .wrapper:before {
52
+ content: "";
53
+ position: absolute;
54
+ left: 50%;
55
+ top: -1%;
56
+ transform: translateX(-50%);
57
+ width: 100%;
58
+ height: 2px;
59
+ border-bottom: 1px dashed;
60
+ }
61
+ .wrapper:after {
62
+ content: "";
63
+ position: absolute;
64
+ left: 50%;
65
+ top: 100%;
66
+ transform: translateX(-50%);
67
+ width: 100%;
68
+ height: 2px;
69
+ border-bottom: 1px dashed;
70
+ }
71
+ `),r=d,h=(0,c.A)(r.prototype,"height",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),l=(0,c.A)(r.prototype,"delta",[n],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=(0,c.A)(r.prototype,"isDragging",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),r);customElements.define("cdtr-resizeable",f)}}]);
Binary file
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 8141.creaditor.bundle.js.LICENSE.txt */
2
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8141],{68141(e,t,s){var i=s(24586),r=s(59929),n=(s(49549),s(64749)),o=s(70980);class c extends r.WF{constructor(){super(),this.index=0}render(){"string"!=typeof this.src&&(this.src="");const e=this.src.split(",");e.length>1&&setTimeout(()=>{const t=this.shadowRoot.querySelector(".background");t.classList.remove("fade-in"),this.index<e.length-1?this.index++:this.index=0,t&&setTimeout(()=>{t.classList.add("fade-in"),setTimeout(()=>{t.classList.remove("fade-in")},1e3)},0)},4500);const t=(0,n.t)(this.getAttribute("style"));return t.backgroundImage=`url(${e[this.index]})`,r.qy`<div style="${(0,o.W)(t)}" class="background"></div>`}}(0,i.A)(c,"properties",{src:{type:String},index:{type:Number},style:{type:String}}),(0,i.A)(c,"styles",r.AH`
2
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8141],{68141(e,t,s){var i=s(24586),r=s(59929),n=s(64749),o=s(70980);class c extends r.WF{constructor(){super(),this.index=0}render(){"string"!=typeof this.src&&(this.src="");const e=this.src.split(",");e.length>1&&setTimeout(()=>{const t=this.shadowRoot.querySelector(".background");t.classList.remove("fade-in"),this.index<e.length-1?this.index++:this.index=0,t&&setTimeout(()=>{t.classList.add("fade-in"),setTimeout(()=>{t.classList.remove("fade-in")},1e3)},0)},4500);const t=(0,n.t)(this.getAttribute("style"));return t.backgroundImage=`url(${e[this.index]})`,r.qy`<div style="${(0,o.W)(t)}" class="background"></div>`}}(0,i.A)(c,"properties",{src:{type:String},index:{type:Number},style:{type:String}}),(0,i.A)(c,"styles",r.AH`
3
3
  .background {
4
4
  background-position: center center;
5
5
  background-size: cover;
Binary file
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 8173.creaditor.bundle.js.LICENSE.txt */
2
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8173],{87335(e,t,r){r.d(t,{K:()=>i});r(69130);const i={properties:{value:{type:Number,value:0,notify:!0,reflectToAttribute:!0},min:{type:Number,value:0,notify:!0},max:{type:Number,value:100,notify:!0},step:{type:Number,value:1,notify:!0},ratio:{type:Number,value:0,readOnly:!0,notify:!0}},observers:["_update(value, min, max, step)"],_calcRatio:function(e){return(this._clampValue(e)-this.min)/(this.max-this.min)},_clampValue:function(e){return Math.min(this.max,Math.max(this.min,this._calcStep(e)))},_calcStep:function(e){if(e=parseFloat(e),!this.step)return e;var t=Math.round((e-this.min)/this.step);return this.step<1?t/(1/this.step)+this.min:t*this.step+this.min},_validateValue:function(){var e=this._clampValue(this.value);return this.value=this.oldValue=isNaN(e)?this.oldValue:e,this.value!==e},_update:function(){this._validateValue(),this._setRatio(100*this._calcRatio(this.value))}}},56379(e,t,r){r.d(t,{O:()=>o,o:()=>n});r(69130);var i=r(71920),a=r(90703),s=r(82239);const n={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=s.v._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},o=[i.a,a.x,s.v,n]},82239(e,t,r){r.d(t,{v:()=>s});r(69130),r(82491);var i=r(71920),a=r(53874);const s={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(e){i.A._downHandler.call(this,e),this.pressed&&this.ensureRipple(e)},ensureRipple:function(e){if(!this.hasRipple()){this._ripple=this._createRipple(),this._ripple.noink=this.noink;var t=this._rippleContainer||this.root;if(t&&(0,a.tT)(t).appendChild(this._ripple),e){var r=(0,a.tT)(this._rippleContainer||this),i=(0,a.tT)(e).rootTarget;r.deepContains(i)&&this._ripple.uiDownAction(e)}}},getRipple:function(){return this.ensureRipple(),this._ripple},hasRipple:function(){return Boolean(this._ripple)},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(e){this.hasRipple()&&(this._ripple.noink=e)}}},89281(e,t,r){r(69130),r(12479),r(88453);var i=r(87335),a=r(95586),s=r(47351);(0,a.b)({_template:s.q`
2
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8173],{87335(e,r,t){t.d(r,{K:()=>i});t(69130);const i={properties:{value:{type:Number,value:0,notify:!0,reflectToAttribute:!0},min:{type:Number,value:0,notify:!0},max:{type:Number,value:100,notify:!0},step:{type:Number,value:1,notify:!0},ratio:{type:Number,value:0,readOnly:!0,notify:!0}},observers:["_update(value, min, max, step)"],_calcRatio:function(e){return(this._clampValue(e)-this.min)/(this.max-this.min)},_clampValue:function(e){return Math.min(this.max,Math.max(this.min,this._calcStep(e)))},_calcStep:function(e){if(e=parseFloat(e),!this.step)return e;var r=Math.round((e-this.min)/this.step);return this.step<1?r/(1/this.step)+this.min:r*this.step+this.min},_validateValue:function(){var e=this._clampValue(this.value);return this.value=this.oldValue=isNaN(e)?this.oldValue:e,this.value!==e},_update:function(){this._validateValue(),this._setRatio(100*this._calcRatio(this.value))}}},56379(e,r,t){t.d(r,{O:()=>o,o:()=>n});t(69130);var i=t(71920),a=t(90703),s=t(82239);const n={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=s.v._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},o=[i.a,a.x,s.v,n]},89281(e,r,t){t(69130),t(12479),t(88453);var i=t(87335),a=t(95586),s=t(47351);(0,a.b)({_template:s.q`
3
3
  <style>
4
4
  :host {
5
5
  display: block;
@@ -163,7 +163,7 @@
163
163
  <div id="secondaryProgress" hidden\$="[[_hideSecondaryProgress(secondaryRatio)]]"></div>
164
164
  <div id="primaryProgress"></div>
165
165
  </div>
166
- `,is:"paper-progress",behaviors:[i.K],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Number,value:0,readOnly:!0},indeterminate:{type:Boolean,value:!1,observer:"_toggleIndeterminate"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, value, min, max, indeterminate)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function(e){this.toggleClass("indeterminate",e,this.$.primaryProgress)},_transformProgress:function(e,t){var r="scaleX("+t/100+")";e.style.transform=e.style.webkitTransform=r},_mainRatioChanged:function(e){this._transformProgress(this.$.primaryProgress,e)},_progressChanged:function(e,t,r,i,a){e=this._clampValue(e),t=this._clampValue(t);var s=100*this._calcRatio(e),n=100*this._calcRatio(t);this._setSecondaryRatio(s),this._transformProgress(this.$.secondaryProgress,s),this._transformProgress(this.$.primaryProgress,n),this.secondaryProgress=e,a?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",t),this.setAttribute("aria-valuemin",r),this.setAttribute("aria-valuemax",i)},_disabledChanged:function(e){this.setAttribute("aria-disabled",e?"true":"false")},_hideSecondaryProgress:function(e){return 0===e}})},28173(e,t,r){r.r(t);r(12479),r(95813),r(89281),r(88453);var i=r(35915),a=r(19911),s=r(87335),n=r(56379),o=r(95586),l=r(15055);const p=r(69130).qy`
166
+ `,is:"paper-progress",behaviors:[i.K],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Number,value:0,readOnly:!0},indeterminate:{type:Boolean,value:!1,observer:"_toggleIndeterminate"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, value, min, max, indeterminate)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function(e){this.toggleClass("indeterminate",e,this.$.primaryProgress)},_transformProgress:function(e,r){var t="scaleX("+r/100+")";e.style.transform=e.style.webkitTransform=t},_mainRatioChanged:function(e){this._transformProgress(this.$.primaryProgress,e)},_progressChanged:function(e,r,t,i,a){e=this._clampValue(e),r=this._clampValue(r);var s=100*this._calcRatio(e),n=100*this._calcRatio(r);this._setSecondaryRatio(s),this._transformProgress(this.$.secondaryProgress,s),this._transformProgress(this.$.primaryProgress,n),this.secondaryProgress=e,a?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",r),this.setAttribute("aria-valuemin",t),this.setAttribute("aria-valuemax",i)},_disabledChanged:function(e){this.setAttribute("aria-disabled",e?"true":"false")},_hideSecondaryProgress:function(e){return 0===e}})},28173(e,r,t){t.r(r);t(12479),t(95813),t(89281),t(88453);var i=t(35915),a=t(19911),s=t(87335),n=t(56379),o=t(95586),l=t(15055);const d=t(69130).qy`
167
167
  <style>
168
168
  :host {
169
169
  @apply --layout;
@@ -452,4 +452,4 @@
452
452
  <paper-input id="input" type="number" step="[[step]]" min="[[min]]" max="[[max]]" class="slider-input" disabled\$="[[disabled]]" value="[[immediateValue]]" on-change="_changeValue" on-keydown="_inputKeyDown" no-label-float>
453
453
  </paper-input>
454
454
  </template>
455
- `;p.setAttribute("strip-whitespace",""),(0,o.b)({_template:p,is:"paper-slider",behaviors:[i.D,a.x,n.O,s.K],properties:{value:{type:Number,value:0},snaps:{type:Boolean,value:!1,notify:!0},pin:{type:Boolean,value:!1,notify:!0},secondaryProgress:{type:Number,value:0,notify:!0,observer:"_secondaryProgressChanged"},editable:{type:Boolean,value:!1},immediateValue:{type:Number,value:0,readOnly:!0,notify:!0},maxMarkers:{type:Number,value:0,notify:!0},expand:{type:Boolean,value:!1,readOnly:!0},ignoreBarTouch:{type:Boolean,value:!1},dragging:{type:Boolean,value:!1,readOnly:!0,notify:!0},transiting:{type:Boolean,value:!1,readOnly:!0},markers:{type:Array,readOnly:!0,value:function(){return[]}}},observers:["_updateKnob(value, min, max, snaps, step)","_valueChanged(value)","_immediateValueChanged(immediateValue)","_updateMarkers(maxMarkers, min, max, snaps)"],hostAttributes:{role:"slider",tabindex:0},keyBindings:{left:"_leftKey",right:"_rightKey","down pagedown home":"_decrementKey","up pageup end":"_incrementKey"},ready:function(){this.ignoreBarTouch&&(0,l.wB)(this.$.sliderBar,"auto")},increment:function(){this.value=this._clampValue(this.value+this.step)},decrement:function(){this.value=this._clampValue(this.value-this.step)},_updateKnob:function(e,t,r,i,a){this.setAttribute("aria-valuemin",t),this.setAttribute("aria-valuemax",r),this.setAttribute("aria-valuenow",e),this._positionKnob(100*this._calcRatio(e))},_valueChanged:function(){this.fire("value-change",{composed:!0})},_immediateValueChanged:function(){this.dragging?this.fire("immediate-value-change",{composed:!0}):this.value=this.immediateValue},_secondaryProgressChanged:function(){this.secondaryProgress=this._clampValue(this.secondaryProgress)},_expandKnob:function(){this._setExpand(!0)},_resetKnob:function(){this.cancelDebouncer("expandKnob"),this._setExpand(!1)},_positionKnob:function(e){this._setImmediateValue(this._calcStep(this._calcKnobPosition(e))),this._setRatio(100*this._calcRatio(this.immediateValue)),this.$.sliderKnob.style.left=this.ratio+"%",this.dragging&&(this._knobstartx=this.ratio*this._w/100,this.translate3d(0,0,0,this.$.sliderKnob))},_calcKnobPosition:function(e){return(this.max-this.min)*e/100+this.min},_onTrack:function(e){switch(e.stopPropagation(),e.detail.state){case"start":this._trackStart(e);break;case"track":this._trackX(e);break;case"end":this._trackEnd()}},_trackStart:function(e){this._setTransiting(!1),this._w=this.$.sliderBar.offsetWidth,this._x=this.ratio*this._w/100,this._startx=this._x,this._knobstartx=this._startx,this._minx=-this._startx,this._maxx=this._w-this._startx,this.$.sliderKnob.classList.add("dragging"),this._setDragging(!0)},_trackX:function(e){this.dragging||this._trackStart(e);var t=this._isRTL?-1:1,r=Math.min(this._maxx,Math.max(this._minx,e.detail.dx*t));this._x=this._startx+r;var i=this._calcStep(this._calcKnobPosition(this._x/this._w*100));this._setImmediateValue(i);var a=this._calcRatio(this.immediateValue)*this._w-this._knobstartx;this.translate3d(a+"px",0,0,this.$.sliderKnob)},_trackEnd:function(){var e=this.$.sliderKnob.style;this.$.sliderKnob.classList.remove("dragging"),this._setDragging(!1),this._resetKnob(),this.value=this.immediateValue,e.transform=e.webkitTransform="",this.fire("change",{composed:!0})},_knobdown:function(e){this._expandKnob(),e.preventDefault(),this.focus()},_bartrack:function(e){this._allowBarEvent(e)&&this._onTrack(e)},_barclick:function(e){this._w=this.$.sliderBar.offsetWidth;var t=this.$.sliderBar.getBoundingClientRect(),r=(e.detail.x-t.left)/this._w*100;this._isRTL&&(r=100-r);var i=this.ratio;this._setTransiting(!0),this._positionKnob(r),i===this.ratio&&this._setTransiting(!1),this.async(function(){this.fire("change",{composed:!0})}),e.preventDefault(),this.focus()},_bardown:function(e){this._allowBarEvent(e)&&(this.debounce("expandKnob",this._expandKnob,60),this._barclick(e))},_knobTransitionEnd:function(e){e.target===this.$.sliderKnob&&this._setTransiting(!1)},_updateMarkers:function(e,t,r,i){i||this._setMarkers([]);var a=Math.round((r-t)/this.step);a>e&&(a=e),(a<0||!isFinite(a))&&(a=0),this._setMarkers(new Array(a))},_mergeClasses:function(e){return Object.keys(e).filter(function(t){return e[t]}).join(" ")},_getClassNames:function(){return this._mergeClasses({disabled:this.disabled,pin:this.pin,snaps:this.snaps,ring:this.immediateValue<=this.min,expand:this.expand,dragging:this.dragging,transiting:this.transiting,editable:this.editable})},_allowBarEvent:function(e){return!this.ignoreBarTouch||e.detail.sourceEvent instanceof MouseEvent},get _isRTL(){return void 0===this.__isRTL&&(this.__isRTL="rtl"===window.getComputedStyle(this).direction),this.__isRTL},_leftKey:function(e){this._isRTL?this._incrementKey(e):this._decrementKey(e)},_rightKey:function(e){this._isRTL?this._decrementKey(e):this._incrementKey(e)},_incrementKey:function(e){this.disabled||("end"===e.detail.key?this.value=this.max:this.increment(),this.fire("change"),e.preventDefault())},_decrementKey:function(e){this.disabled||("home"===e.detail.key?this.value=this.min:this.decrement(),this.fire("change"),e.preventDefault())},_changeValue:function(e){this.value=e.target.value,this.fire("change",{composed:!0})},_inputKeyDown:function(e){e.stopPropagation()},_createRipple:function(){return this._rippleContainer=this.$.sliderKnob,n.o._createRipple.call(this)},_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.style.display=e?"":"none",this._ripple.holdDown=e)}})}}]);
455
+ `;d.setAttribute("strip-whitespace",""),(0,o.b)({_template:d,is:"paper-slider",behaviors:[i.D,a.x,n.O,s.K],properties:{value:{type:Number,value:0},snaps:{type:Boolean,value:!1,notify:!0},pin:{type:Boolean,value:!1,notify:!0},secondaryProgress:{type:Number,value:0,notify:!0,observer:"_secondaryProgressChanged"},editable:{type:Boolean,value:!1},immediateValue:{type:Number,value:0,readOnly:!0,notify:!0},maxMarkers:{type:Number,value:0,notify:!0},expand:{type:Boolean,value:!1,readOnly:!0},ignoreBarTouch:{type:Boolean,value:!1},dragging:{type:Boolean,value:!1,readOnly:!0,notify:!0},transiting:{type:Boolean,value:!1,readOnly:!0},markers:{type:Array,readOnly:!0,value:function(){return[]}}},observers:["_updateKnob(value, min, max, snaps, step)","_valueChanged(value)","_immediateValueChanged(immediateValue)","_updateMarkers(maxMarkers, min, max, snaps)"],hostAttributes:{role:"slider",tabindex:0},keyBindings:{left:"_leftKey",right:"_rightKey","down pagedown home":"_decrementKey","up pageup end":"_incrementKey"},ready:function(){this.ignoreBarTouch&&(0,l.wB)(this.$.sliderBar,"auto")},increment:function(){this.value=this._clampValue(this.value+this.step)},decrement:function(){this.value=this._clampValue(this.value-this.step)},_updateKnob:function(e,r,t,i,a){this.setAttribute("aria-valuemin",r),this.setAttribute("aria-valuemax",t),this.setAttribute("aria-valuenow",e),this._positionKnob(100*this._calcRatio(e))},_valueChanged:function(){this.fire("value-change",{composed:!0})},_immediateValueChanged:function(){this.dragging?this.fire("immediate-value-change",{composed:!0}):this.value=this.immediateValue},_secondaryProgressChanged:function(){this.secondaryProgress=this._clampValue(this.secondaryProgress)},_expandKnob:function(){this._setExpand(!0)},_resetKnob:function(){this.cancelDebouncer("expandKnob"),this._setExpand(!1)},_positionKnob:function(e){this._setImmediateValue(this._calcStep(this._calcKnobPosition(e))),this._setRatio(100*this._calcRatio(this.immediateValue)),this.$.sliderKnob.style.left=this.ratio+"%",this.dragging&&(this._knobstartx=this.ratio*this._w/100,this.translate3d(0,0,0,this.$.sliderKnob))},_calcKnobPosition:function(e){return(this.max-this.min)*e/100+this.min},_onTrack:function(e){switch(e.stopPropagation(),e.detail.state){case"start":this._trackStart(e);break;case"track":this._trackX(e);break;case"end":this._trackEnd()}},_trackStart:function(e){this._setTransiting(!1),this._w=this.$.sliderBar.offsetWidth,this._x=this.ratio*this._w/100,this._startx=this._x,this._knobstartx=this._startx,this._minx=-this._startx,this._maxx=this._w-this._startx,this.$.sliderKnob.classList.add("dragging"),this._setDragging(!0)},_trackX:function(e){this.dragging||this._trackStart(e);var r=this._isRTL?-1:1,t=Math.min(this._maxx,Math.max(this._minx,e.detail.dx*r));this._x=this._startx+t;var i=this._calcStep(this._calcKnobPosition(this._x/this._w*100));this._setImmediateValue(i);var a=this._calcRatio(this.immediateValue)*this._w-this._knobstartx;this.translate3d(a+"px",0,0,this.$.sliderKnob)},_trackEnd:function(){var e=this.$.sliderKnob.style;this.$.sliderKnob.classList.remove("dragging"),this._setDragging(!1),this._resetKnob(),this.value=this.immediateValue,e.transform=e.webkitTransform="",this.fire("change",{composed:!0})},_knobdown:function(e){this._expandKnob(),e.preventDefault(),this.focus()},_bartrack:function(e){this._allowBarEvent(e)&&this._onTrack(e)},_barclick:function(e){this._w=this.$.sliderBar.offsetWidth;var r=this.$.sliderBar.getBoundingClientRect(),t=(e.detail.x-r.left)/this._w*100;this._isRTL&&(t=100-t);var i=this.ratio;this._setTransiting(!0),this._positionKnob(t),i===this.ratio&&this._setTransiting(!1),this.async(function(){this.fire("change",{composed:!0})}),e.preventDefault(),this.focus()},_bardown:function(e){this._allowBarEvent(e)&&(this.debounce("expandKnob",this._expandKnob,60),this._barclick(e))},_knobTransitionEnd:function(e){e.target===this.$.sliderKnob&&this._setTransiting(!1)},_updateMarkers:function(e,r,t,i){i||this._setMarkers([]);var a=Math.round((t-r)/this.step);a>e&&(a=e),(a<0||!isFinite(a))&&(a=0),this._setMarkers(new Array(a))},_mergeClasses:function(e){return Object.keys(e).filter(function(r){return e[r]}).join(" ")},_getClassNames:function(){return this._mergeClasses({disabled:this.disabled,pin:this.pin,snaps:this.snaps,ring:this.immediateValue<=this.min,expand:this.expand,dragging:this.dragging,transiting:this.transiting,editable:this.editable})},_allowBarEvent:function(e){return!this.ignoreBarTouch||e.detail.sourceEvent instanceof MouseEvent},get _isRTL(){return void 0===this.__isRTL&&(this.__isRTL="rtl"===window.getComputedStyle(this).direction),this.__isRTL},_leftKey:function(e){this._isRTL?this._incrementKey(e):this._decrementKey(e)},_rightKey:function(e){this._isRTL?this._decrementKey(e):this._incrementKey(e)},_incrementKey:function(e){this.disabled||("end"===e.detail.key?this.value=this.max:this.increment(),this.fire("change"),e.preventDefault())},_decrementKey:function(e){this.disabled||("home"===e.detail.key?this.value=this.min:this.decrement(),this.fire("change"),e.preventDefault())},_changeValue:function(e){this.value=e.target.value,this.fire("change",{composed:!0})},_inputKeyDown:function(e){e.stopPropagation()},_createRipple:function(){return this._rippleContainer=this.$.sliderKnob,n.o._createRipple.call(this)},_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.style.display=e?"":"none",this._ripple.holdDown=e)}})}}]);
Binary file
@@ -0,0 +1,72 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8443],{48443(t,e,i){i.r(e),i.d(e,{JustifyGroup:()=>h});var r,c,o,l,n,s,a=i(59088),d=i(24586),u=i(36936),p=i(59929),f=i(49410);let h=(r=(0,f.MZ)({type:Number}),c=(0,f.MZ)({type:String}),s=class extends p.WF{constructor(){super(),(0,a.A)(this,"value",l,this),(0,a.A)(this,"justify",n,this),this.onClick=this.onClick.bind(this),this.justify="flex-start"}onClick(t){const e=t.target.closest("[data-justify]");if(e){const t=e.getAttribute("data-justify");this.value=t;const i={detail:t,bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("change",i))}}render(){return p.qy` <cdtr-row justify="center">
2
+ <paper-button
3
+ class="${"flex-start"===this.value?"selected":null}"
4
+ @click=${this.onClick}
5
+ data-justify="flex-start"
6
+ >
7
+ <cdtr-tooltip delay="100" content="left">
8
+ <cdtr-icon color="var(--primary)" icon="justifyLeft"></cdtr-icon>
9
+ </cdtr-tooltip>
10
+ </paper-button>
11
+ <paper-button
12
+ class="${"center"===this.value?"selected":null}"
13
+ @click=${this.onClick}
14
+ data-justify="center"
15
+ >
16
+ <cdtr-tooltip delay="100" content="center">
17
+ <cdtr-icon color="var(--primary)" icon="justifyCenter"></cdtr-icon>
18
+ </cdtr-tooltip>
19
+ </paper-button>
20
+ <paper-button
21
+ class="${"flex-end"===this.value?"selected":null}"
22
+ @click=${this.onClick}
23
+ data-justify="flex-end"
24
+ >
25
+ <cdtr-tooltip delay="100" content="right">
26
+ <cdtr-icon color="var(--primary)" icon="justifyRight"></cdtr-icon>
27
+
28
+ </cdtr-tooltip>
29
+ </paper-button>
30
+ <!-- //============ -->
31
+ <!-- <cdtr-divider></cdtr-divider>
32
+ <paper-button
33
+ class="${"flex-start"===this.value?"selected":null}"
34
+ @click=${this.onClick}
35
+ data-justify="flex-start"
36
+ >
37
+ <cdtr-tooltip delay="100" content="left">
38
+ <cdtr-icon height="33" color="var(--primary)" icon="alignTop"></cdtr-icon>
39
+ </cdtr-tooltip>
40
+ </paper-button>
41
+ <paper-button
42
+ class="${"center"===this.value?"selected":null}"
43
+ @click=${this.onClick}
44
+ data-justify="center"
45
+ >
46
+ <cdtr-tooltip delay="100" content="center">
47
+ <cdtr-icon height="33" color="var(--primary)" icon="justifyCenter"></cdtr-icon>
48
+ </cdtr-tooltip>
49
+ </paper-button>
50
+ <paper-button
51
+ class="${"flex-end"===this.value?"selected":null}"
52
+ @click=${this.onClick}
53
+ data-justify="flex-end"
54
+ >
55
+ <cdtr-tooltip delay="100" content="right">
56
+ <cdtr-icon height="33" color="var(--primary)" icon="alignBottom"></cdtr-icon>
57
+ </cdtr-tooltip>
58
+ </paper-button> -->
59
+ </cdtr-row>`}},(0,d.A)(s,"styles",p.AH`
60
+ :host {
61
+ direction: ltr;
62
+ }
63
+ paper-button {
64
+ min-width: auto;
65
+ }
66
+ .keyboard-focus {
67
+ outline: 1px solid var(--primary);
68
+ }
69
+ .selected {
70
+ background: #f1f3f5;
71
+ }
72
+ `),o=s,l=(0,u.A)(o.prototype,"value",[r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),n=(0,u.A)(o.prototype,"justify",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),o);customElements.define("cdtr-justify-group",h)}}]);
Binary file
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8516],{8516(t,e,n){n.r(e),n.d(e,{RadiusEditorPlugin:()=>i});var r=n(24586),s=n(59929),d=n(9507);n(86319);class i extends s.WF{constructor(){super(),this.onConnect=this.onConnect.bind(this)}onConnect(){const t=d.Ay.getSelectedComponent();if(t.length>0){const e=t[0],n=e.props?.style?.borderRadius;this.radius=parseInt(n)||0}}onChangeRadius(t){const e=t.target.value;d.Ay.execCommand("style",{borderRadius:e+"px"})}connectedCallback(){super.connectedCallback(),d.Ay.on("update",this.onConnect),this.onConnect()}disconnectedCallback(){super.disconnectedCallback(),d.Ay.off("update",this.onConnect)}render(){return s.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8516],{8516(t,e,n){n.r(e),n.d(e,{RadiusEditorPlugin:()=>i});var r=n(24586),s=n(59929),d=n(9507);class i extends s.WF{constructor(){super(),this.onConnect=this.onConnect.bind(this)}onConnect(){const t=d.Ay.getSelectedComponent();if(t.length>0){const e=t[0],n=e.props?.style?.borderRadius;this.radius=parseInt(n)||0}}onChangeRadius(t){const e=t.target.value;d.Ay.execCommand("style",{borderRadius:e+"px"})}connectedCallback(){super.connectedCallback(),d.Ay.on("update",this.onConnect),this.onConnect()}disconnectedCallback(){super.disconnectedCallback(),d.Ay.off("update",this.onConnect)}render(){return s.qy`
2
2
  <cdtr-row mt="1">
3
3
  <cdtr-title><lang-text text="radius"></lang-text></cdtr-title>
4
4
  </cdtr-row>
Binary file