@cling-se/widget 1.0.0-beta.1 → 1.0.0-beta.2

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 (241) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.internal.md +82 -0
  3. package/README.md +14 -40
  4. package/README.public.md +14 -0
  5. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  6. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  7. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  8. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  9. package/dist/BlockMedia-CW5wgipC.js +103 -0
  10. package/dist/CCallout-Cy2eeIYd.js +104 -0
  11. package/dist/{CCurrencyDropdown-qH-3m2eP.js → CCurrencyDropdown-DE_3CTjm.js} +91 -49
  12. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  13. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  14. package/dist/{CPhoneFormat-CfQayFxw.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  15. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  16. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  17. package/dist/CSelect-DgnT07Hk.js +98 -0
  18. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  19. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  20. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  21. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  22. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  23. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  24. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  25. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  26. package/dist/DocDetails-CStEwWnU.js +448 -0
  27. package/dist/DocForm-BOoILf5E.js +6748 -0
  28. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  29. package/dist/DocLinks-BRX5QzNe.js +36 -0
  30. package/dist/DocModalBase-D72yWj-x.js +29 -0
  31. package/dist/DocPrint-BI1LXUPE.js +399 -0
  32. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  33. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  34. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  35. package/dist/DocTimeline-DCwofzuk.js +537 -0
  36. package/dist/DocumentClient-vJdxCB53.js +90 -0
  37. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  38. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  39. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  40. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  41. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  42. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  43. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  44. package/dist/Flag-BwTgCNHO.js +41 -0
  45. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  46. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  47. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  48. package/dist/Index-0_3ULrWX.js +126 -0
  49. package/dist/Index-4NPe0sfX.js +629 -0
  50. package/dist/Index-B1uA0FF6.js +4 -0
  51. package/dist/Index-BBkCYm2q.js +201 -0
  52. package/dist/{Index-DIOiMm9f.js → Index-BBwvo7S9.js} +10 -18
  53. package/dist/Index-BEMlsYwJ.js +68 -0
  54. package/dist/Index-BRBhJ6kz.js +21 -0
  55. package/dist/{Index--qPMWUMT.js → Index-BTFmHjUt.js} +48 -61
  56. package/dist/Index-BcUNnxLC.js +1098 -0
  57. package/dist/Index-Bo6ExBUL.js +93 -0
  58. package/dist/Index-BvMPCgdH.js +102 -0
  59. package/dist/Index-Bx5TOI9k.js +74 -0
  60. package/dist/Index-C7GZS8EI.js +16 -0
  61. package/dist/Index-CNWhm07R.js +25 -0
  62. package/dist/{Index-DcQbh-z2.js → Index-CQpznMKV.js} +9 -17
  63. package/dist/Index-CRzsnIij.js +159 -0
  64. package/dist/Index-CeSG1C41.js +140 -0
  65. package/dist/Index-CjfjdZj5.js +52 -0
  66. package/dist/Index-CskKmZpd.js +363 -0
  67. package/dist/Index-D5qwbCo1.js +28 -0
  68. package/dist/Index-D8Ae1Txt.js +228 -0
  69. package/dist/Index-DE8aenDB.js +3452 -0
  70. package/dist/Index-DI5EB5Rt.js +39 -0
  71. package/dist/Index-DaV57YPP.js +163 -0
  72. package/dist/Index-DbwkmoyM.js +38 -0
  73. package/dist/Index-Df9skok6.js +70 -0
  74. package/dist/{Index-Bu0MGrj6.js → Index-DfLLA0ij.js} +313 -206
  75. package/dist/Index-Dw1CO5F9.js +76 -0
  76. package/dist/Index-PZXyOoVb.js +87 -0
  77. package/dist/{Index-D4XgxmbD.js → Index-ZUnH-BHj.js} +10 -18
  78. package/dist/Index-cjKGSiDi.js +136 -0
  79. package/dist/Index-m-goRuKD.js +49 -0
  80. package/dist/Index-rGeWbLcB.js +47 -0
  81. package/dist/Index-vrljNp6G.js +28 -0
  82. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  83. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  84. package/dist/ManualPopover-BONBJIUA.js +57 -0
  85. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  86. package/dist/{NotBindingText-CNV2Wmdx.js → NotBindingText-BqESO13N.js} +13 -17
  87. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  88. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  89. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  90. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  91. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  92. package/dist/SearchApi-B7lXgUY6.js +137 -0
  93. package/dist/SendForm-BcD0xSvB.js +7031 -0
  94. package/dist/Setup-C2qaYDei.js +47 -0
  95. package/dist/{SmartList-Qgu0rMrI.js → SmartList-DqG7Q5t7.js} +16 -24
  96. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  97. package/dist/{TermsSettings-CE3h_xkm.js → TermsSettings-BOCONyM4.js} +169 -49
  98. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  99. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  100. package/dist/UploadModal-C_X2NjVY.js +134 -0
  101. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  102. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  103. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  104. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  105. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  106. package/dist/{debounce-C1AuSpOZ.js → debounce-DNl99Gyo.js} +7 -7
  107. package/dist/dom-CkTGWrfu.js +69 -0
  108. package/dist/{focusDrawerMixin-Be6BAK8-.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  109. package/dist/{formDrawerState-DRbg5rVI.js → formDrawerState-DaurePnd.js} +2 -2
  110. package/dist/helpers-CPW--XIz.js +44 -0
  111. package/dist/index-BjiGCJPI.js +149 -0
  112. package/dist/index-CFNv6OvX.js +188 -0
  113. package/dist/index-Cx71On5Z.js +508 -0
  114. package/dist/index-DKMxIBz_.js +270 -0
  115. package/dist/index-DKf5SGLD.js +125 -0
  116. package/dist/index-E32WgUp9.js +3525 -0
  117. package/dist/index-kp-GC5I0.js +513 -0
  118. package/dist/index.es.js +2 -5
  119. package/dist/index.umd.js +306 -1505
  120. package/dist/{main-WKzC-Dnu.js → main-Cb-nyil1.js} +33252 -33755
  121. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  122. package/dist/omit--YYr41Xp.js +31 -0
  123. package/dist/{publicSenderState-BujjYsZZ.js → publicSenderState-CdRW_Wwp.js} +4 -4
  124. package/dist/regions-BdZt9Srn.js +1250 -0
  125. package/dist/splitpanes-D-ThFkeR.js +342 -0
  126. package/dist/style.css +1 -4
  127. package/dist/template-BvaNnq-g.js +1493 -0
  128. package/dist/{throttle-CWPJmFid.js → throttle-D-bUGaVh.js} +2 -2
  129. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  130. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  131. package/dist/{utils-CA_Zy6u1.js → utils-CBPcYdLv.js} +8 -11
  132. package/dist/validation-DOcUOoMe.js +40 -0
  133. package/package.json +25 -31
  134. package/.eslintrc.cjs +0 -4
  135. package/dist/AddClientCallout-BWnvyBcK.js +0 -46
  136. package/dist/AnswerModal-CLGRdSnK.js +0 -3874
  137. package/dist/AttachmentItem-BPS0-wyc.js +0 -78
  138. package/dist/BaseDatePicker-BbmV_GdD.js +0 -3183
  139. package/dist/BaseUpload-9gPgI7r6.js +0 -1977
  140. package/dist/BlockMedia-DkPFWiYL.js +0 -76
  141. package/dist/CCallout-T26jwUby.js +0 -59
  142. package/dist/CDropdownItem-BE8BAMD1.js +0 -636
  143. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  144. package/dist/CFormField-DECEfoVq.js +0 -241
  145. package/dist/CPriceInput-C4SOB-P5.js +0 -112
  146. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  147. package/dist/ClientAutocomplete-DSebA1Mx.js +0 -78
  148. package/dist/ClientModal-BXFYvYCF.js +0 -625
  149. package/dist/ColorPicker-CZ_bJabP.js +0 -2879
  150. package/dist/CompanyModal-CDr3t28n.js +0 -141
  151. package/dist/ContentWrapper-BwmMoe4W.js +0 -183
  152. package/dist/CoverBlockSettings-_F11-DGc.js +0 -275
  153. package/dist/DocAnswer-BR59xzkT.js +0 -36
  154. package/dist/DocDetails-D1qbCbps.js +0 -259
  155. package/dist/DocForm-DBc2a7z5.js +0 -7272
  156. package/dist/DocFormSend-Casix-yG.js +0 -144
  157. package/dist/DocLinks-DGTaewyX.js +0 -38
  158. package/dist/DocModalBase-BbS_qvSv.js +0 -28
  159. package/dist/DocPrint-0PqX3mbJ.js +0 -240
  160. package/dist/DocReceipt-CU3VD5pt.js +0 -210
  161. package/dist/DocSendReminder-CuycBspr.js +0 -137
  162. package/dist/DocTextEditor-CntS2Bd-.js +0 -17180
  163. package/dist/DocTimeline-DJuv3yBe.js +0 -481
  164. package/dist/DocumentClient-C25XXzz6.js +0 -136
  165. package/dist/DocumentLayout-B7afHRMr.js +0 -4909
  166. package/dist/DocumentLogotype-sqI51wvM.js +0 -87
  167. package/dist/DocumentVoided-TahdTSMn.js +0 -25
  168. package/dist/EmbedInput-BY-wHSfc.js +0 -113
  169. package/dist/EmbedSettings-8pfjk4NP.js +0 -72
  170. package/dist/ErrorCallout-Dsr8PNsU.js +0 -28
  171. package/dist/FilePreviewModal-CcEinEFg.js +0 -81
  172. package/dist/Flag-PJKrghi9.js +0 -114
  173. package/dist/HeaderSettings-BqczIOsG.js +0 -392
  174. package/dist/ImageSelectModal-Cd-HhKnH.js +0 -84
  175. package/dist/ImageUploadWrapper-Dv43rGdb.js +0 -1604
  176. package/dist/Index-6b5VBKE-.js +0 -107
  177. package/dist/Index-B4pRJnbw.js +0 -84
  178. package/dist/Index-B69f8qgZ.js +0 -62
  179. package/dist/Index-B79YN9RO.js +0 -25
  180. package/dist/Index-BBrlPoe8.js +0 -58
  181. package/dist/Index-BXfWJCuq.js +0 -52
  182. package/dist/Index-Bd76vb37.js +0 -55
  183. package/dist/Index-BmbtQO5F.js +0 -150
  184. package/dist/Index-ByV_kJaH.js +0 -77
  185. package/dist/Index-CDV5rhWS.js +0 -49
  186. package/dist/Index-CIx4OOK-.js +0 -144
  187. package/dist/Index-CL1OWLt6.js +0 -223
  188. package/dist/Index-Caow0eZu.js +0 -31
  189. package/dist/Index-Cd3-3PEK.js +0 -2402
  190. package/dist/Index-CdpZBEKU.js +0 -98
  191. package/dist/Index-CmU3Sys-.js +0 -754
  192. package/dist/Index-CtRtgnpm.js +0 -32
  193. package/dist/Index-Cukkr33D.js +0 -140
  194. package/dist/Index-Cuqw0ios.js +0 -57
  195. package/dist/Index-Czm_WdqC.js +0 -25
  196. package/dist/Index-DNdYXHgr.js +0 -33
  197. package/dist/Index-DcuBxutp.js +0 -642
  198. package/dist/Index-DpWNWiyY.js +0 -291
  199. package/dist/Index-DzS1rZdF.js +0 -24
  200. package/dist/Index-N6s5pZxv.js +0 -26
  201. package/dist/Index-g_DNu4mt.js +0 -69
  202. package/dist/Index-mJ8F41GY.js +0 -154
  203. package/dist/Index-q7W9KA8m.js +0 -21
  204. package/dist/Index-rtzblZp4.js +0 -70
  205. package/dist/InputToggleRow-CZjxsDOQ.js +0 -57
  206. package/dist/ManualPopover-CZrWiT-P.js +0 -58
  207. package/dist/MediaWrapper-D37qK4KR.js +0 -23
  208. package/dist/PackageGroup-Heo_s8ct.js +0 -699
  209. package/dist/PdfTerms-AB9tXAtU.js +0 -36
  210. package/dist/PdfViewer-CIVkvOBr.js +0 -373
  211. package/dist/PlainHtml-CPmIebjY.js +0 -20
  212. package/dist/PriceHeader-DhDAruwX.js +0 -339
  213. package/dist/SearchApi-BMgdaI4s.js +0 -161
  214. package/dist/Setup-VIaIV9uT.js +0 -50
  215. package/dist/ThemeColorRow-DYJNgk6S.js +0 -67
  216. package/dist/ToggleBinding-CuwCeYpO.js +0 -38
  217. package/dist/UploadModal-BITcxG-J.js +0 -95
  218. package/dist/VideoPlayerInput-8szEX_8L.js +0 -93
  219. package/dist/VideoPlayerSettings-BIPytm6w.js +0 -61
  220. package/dist/VideoSelectModal-B-Pe34nb.js +0 -100
  221. package/dist/answerDocumentMixin-W7vE1Gp4.js +0 -51
  222. package/dist/formComponentsInstall-Bm3VMOh6.js +0 -2507
  223. package/dist/formValidationMixin-COkY8COk.js +0 -49
  224. package/dist/index-BFvjENMH.js +0 -81
  225. package/dist/index-BV2nGWay.js +0 -492
  226. package/dist/index-BgJ05dYc.js +0 -165
  227. package/dist/index-CMPAXxzs.js +0 -347
  228. package/dist/index-DNDjI5uI.js +0 -3916
  229. package/dist/index-aoff9oUi.js +0 -102
  230. package/dist/mapFormMixin-QbevCwJK.js +0 -72
  231. package/dist/omit-CTp9CXoU.js +0 -31
  232. package/dist/splitpanes-BHUVsCZF.js +0 -382
  233. package/dist/tinycolor-kTl0yxzz.js +0 -633
  234. package/dist/tippy.esm-sS5koDSU.js +0 -1799
  235. package/dist/vuedraggable.umd-BA3ZDRAp.js +0 -3161
  236. package/dist/vuex.esm-DKGl8mcw.js +0 -467
  237. package/public/favicon.ico +0 -0
  238. package/tsconfig.json +0 -26
  239. package/tsconfig.node.json +0 -10
  240. package/tsconfig.paths.json +0 -17
  241. package/vite.config.ts +0 -60
@@ -1,392 +0,0 @@
1
- import { m as x } from "./mapFormMixin-QbevCwJK.js";
2
- import { T as w } from "./ThemeColorRow-DYJNgk6S.js";
3
- import C from "./VideoPlayerInput-8szEX_8L.js";
4
- import _ from "./ImageUploadWrapper-Dv43rGdb.js";
5
- import { B as k, a as b } from "./index-BgJ05dYc.js";
6
- import { c as v, n as y, o as d, H as S } from "./main-WKzC-Dnu.js";
7
- import { t as A } from "./tinycolor-kTl0yxzz.js";
8
- const g = v.unsplash.id, L = v.pexels.id, z = {
9
- name: "MediaSelectModal",
10
- i18nOptions: {
11
- namespaces: "mediaSelectModal",
12
- messages: {
13
- en: {
14
- title: "Choose background",
15
- creditVideos: "Videos from {{thing}}",
16
- tabLink: "Use link",
17
- minWidth: "Recommended minimum image width is 1200 pixels or greater."
18
- },
19
- sv: {
20
- title: "Välj bakgrundsbild",
21
- creditVideos: "Videor från {{thing}}",
22
- tabLink: "Egen länk",
23
- minWidth: "Rekommenderad minimum bredd på bilden är 1200 pixlar eller större."
24
- }
25
- }
26
- },
27
- components: {
28
- BackgroundModal: k,
29
- BackgroundList: b,
30
- VideoPlayerInput: C,
31
- ImageUploadWrapper: _
32
- },
33
- props: {
34
- currentType: {
35
- type: String,
36
- default: ""
37
- }
38
- },
39
- data() {
40
- return {
41
- tabs: [
42
- {
43
- value: "unsplash",
44
- label: "Unsplash",
45
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"/></svg>'
46
- },
47
- {
48
- value: "customImage",
49
- label: this.$t("_common:upload"),
50
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M20.4 14.5L16 10 4 20"/></svg>'
51
- },
52
- {
53
- value: "pexels",
54
- label: "Pexels",
55
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 32 32"><path d="M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z" fill="#05A081"></path><path d="M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z" fill="#fff"></path></svg>'
56
- },
57
- {
58
- value: "customVideo",
59
- label: this.$t("tabLink"),
60
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="28" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" xml:space="preserve" viewBox="0 0 71.412 50"><g transform="scale(.58824)"><path d="M118.9 13.3c-1.4-5.2-5.5-9.3-10.7-10.7C98.7 0 60.7 0 60.7 0s-38 0-47.5 2.5C8.1 3.9 3.9 8.1 2.5 13.3 0 22.8 0 42.5 0 42.5s0 19.8 2.5 29.2C3.9 76.9 8 81 13.2 82.4 22.8 85 60.7 85 60.7 85s38 0 47.5-2.5c5.2-1.4 9.3-5.5 10.7-10.7 2.5-9.5 2.5-29.2 2.5-29.2s.1-19.8-2.5-29.3z" fill="red" fill-opacity="1"/><path fill="#fff" d="M80.2 42.5L48.6 24.3v36.4z"/></g></svg>'
61
- }
62
- ],
63
- activeTab: "unsplash",
64
- selectedImage: null,
65
- preferredColor: null,
66
- customImage: null,
67
- selectedVideo: null,
68
- customVideo: null
69
- };
70
- },
71
- computed: {
72
- isImage() {
73
- return ["unsplash", "customImage"].includes(this.activeTab);
74
- }
75
- },
76
- created() {
77
- this.currentType === "video" && (this.activeTab = "pexels");
78
- },
79
- methods: {
80
- async fetchImage({ query: i, page: t }) {
81
- const { data: e } = await d.get(
82
- "https://api.unsplash.com/search/photos",
83
- {
84
- params: {
85
- page: t,
86
- per_page: 12,
87
- client_id: g,
88
- query: i
89
- }
90
- }
91
- );
92
- return {
93
- items: (e.results || []).map((o) => ({
94
- ...o,
95
- image: o.urls.regular,
96
- minImage: o.urls.thumb
97
- })),
98
- total: e.total
99
- };
100
- },
101
- async fetchVideo({ query: i, page: t }) {
102
- const { data: e } = await d.get("https://api.pexels.com/videos/search", {
103
- headers: {
104
- Authorization: L
105
- },
106
- params: {
107
- page: t,
108
- per_page: 12,
109
- query: i
110
- }
111
- }), o = (s, a) => s.height < a.height || s.width < a.width ? -1 : 1, r = (s) => (s.find(({ height: a }) => a > 1e3 && a < 1200) || {}).link;
112
- return {
113
- items: (e.videos || []).map(
114
- ({ id: s, image: a, video_files: u = [], user: m }) => {
115
- const { sd: h, hd: p } = (u || []).sort(o).reduce(
116
- (n, l) => (n[l.quality] && l.link && n[l.quality].push(l.link), n),
117
- { sd: [], hd: [] }
118
- ), [f] = h;
119
- let c = r(u);
120
- return c || ([c] = p.length ? p : h.slice(-1)), {
121
- id: `${s}`,
122
- image: a,
123
- minImage: a,
124
- video: c,
125
- minVideo: f,
126
- userName: m.name,
127
- userLink: m.link
128
- };
129
- }
130
- ),
131
- total: e.total_results
132
- };
133
- },
134
- selectImage({ image: i, links: t, color: e }) {
135
- this.selectedImage = S(i, { w: 1800 }), e && (this.preferredColor = e);
136
- const o = new Image();
137
- o.src = this.selectedImage, d.get(t.download_location, {
138
- params: {
139
- client_id: g
140
- }
141
- });
142
- },
143
- setCustomBackground({ response: i }) {
144
- this.customImage = i.url;
145
- },
146
- selectVideo({ id: i, image: t, video: e }) {
147
- this.selectedVideo = {
148
- id: i,
149
- url: e,
150
- thumbnail: t,
151
- provider: "pexels"
152
- };
153
- },
154
- onSave() {
155
- let i;
156
- this.isImage ? i = {
157
- type: "image",
158
- value: this.activeTab === "unsplash" ? this.selectedImage : this.customImage
159
- } : i = {
160
- type: "video",
161
- value: this.activeTab === "pexels" ? this.selectedVideo : this.customVideo
162
- }, this.preferredColor && (i.preferredColor = this.preferredColor), this.$emit("input", i), this.$parent && this.$parent.$emit("input", i), this.$emit("close");
163
- }
164
- }
165
- };
166
- var I = function() {
167
- var t = this, e = t._self._c;
168
- return e("BackgroundModal", t._g({}, t.$listeners), [e("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "calc(0.25 * var(--rem)) calc(1 * var(--rem))", "border-bottom": "1px solid hsl(0, 0%, 88%)" }, attrs: { slot: "header" }, slot: "header" }, t._l(t.tabs, function(o, r) {
169
- return e("CButton", { key: r, staticStyle: { "font-size": "15px", "font-weight": "700", opacity: "0.5", "box-shadow": "none" }, style: t.activeTab === o.value && { opacity: 1 }, on: { click: function(s) {
170
- t.activeTab = o.value;
171
- } } }, [e("span", { staticClass: "inline-flex items-center justify-center" }, [e("div", { domProps: { innerHTML: t._s(o.icon) } }), e("span", { staticClass: "max-md:!hidden" }, [t._v(t._s(o.label))])])]);
172
- }), 1), ["unsplash", "pexels"].includes(t.activeTab) ? e("BackgroundList", { key: t.activeTab, attrs: { fetch: t.isImage ? t.fetchImage : t.fetchVideo, "credit-text": t.$t("creditVideos", { thing: t.activeTab.capitalize() }), "default-query": "nature" }, on: { select: function(o) {
173
- t.isImage ? t.selectImage(o) : t.selectVideo(o);
174
- } } }, [e("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { slot: "footer", disabled: t.isImage ? !t.selectedImage : !t.selectedVideo, type: "secondary" }, on: { click: t.onSave }, slot: "footer" }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1) : t.activeTab === "customVideo" ? e("div", { staticClass: "flex w-full flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("div", { staticStyle: { position: "relative", width: "100%", "padding-top": "56.25%", "background-color": "hsl(var(--gray-color-100) / 1)", "border-radius": "0.5em", "margin-bottom": "calc(1.5 * var(--rem))" } }, [t.customVideo ? e("iframe", { staticClass: "custom-video-preview", attrs: { src: t.customVideo.url } }) : t._e()]), e("VideoPlayerInput", { attrs: { filled: !0, "video-options": { background: !0 } }, model: { value: t.customVideo, callback: function(o) {
175
- t.customVideo = o;
176
- }, expression: "customVideo" } }, [e("CButton", { attrs: { disabled: !t.customVideo, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)]) : e("div", { staticClass: "flex flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": t.setCustomBackground }, scopedSlots: t._u([{ key: "default", fn: function({ progress: o }) {
177
- return [e("div", { staticClass: "relative mb-6 w-full" }, [t.customImage ? e("img", { staticClass: "h-full w-full object-cover object-scale-down object-top", staticStyle: { "max-height": "500px" }, attrs: { src: t.customImage, alt: t.customImage } }) : e("div", { staticClass: "flex aspect-video flex-col items-center justify-center rounded-md bg-gray-100" }, [e("CButton", { style: t.customImage && { opacity: 0.5 }, attrs: { loading: !!o && o < 100, "icon-left": "upload", type: "none" } }, [t._v(" " + t._s(t.$t("_common:upload")) + " ")]), e("div", { staticClass: "text-center text-gray-600", staticStyle: { "padding-top": "calc(1 * var(--rem))", "font-size": "14px", "max-width": "40ch" } }, [t._v(" " + t._s(t.$t("minWidth")) + " ")])], 1)])];
178
- } }]) }), e("div", { staticClass: "flex items-center justify-center" }, [e("CButton", { attrs: { disabled: !t.customImage, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)])], 1);
179
- }, V = [], M = /* @__PURE__ */ y(
180
- z,
181
- I,
182
- V,
183
- !1,
184
- null,
185
- "459dc015"
186
- );
187
- const T = M.exports, $ = {
188
- name: "HeaderSettings",
189
- components: {
190
- ThemeColorRow: w
191
- },
192
- mixins: [
193
- x(
194
- [
195
- "layout",
196
- "items",
197
- "media",
198
- "showPriceSummary",
199
- "backgroundColor",
200
- "textAlign",
201
- "textColor"
202
- ],
203
- { useEmit: !1 }
204
- )
205
- ],
206
- data() {
207
- return {
208
- type: "image",
209
- layoutOptions2: [
210
- {
211
- value: "left",
212
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
213
- },
214
- {
215
- value: "right",
216
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
217
- },
218
- {
219
- value: "top",
220
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>'
221
- },
222
- {
223
- value: "bottom",
224
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>'
225
- },
226
- {
227
- value: "center",
228
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>'
229
- },
230
- {
231
- value: "price",
232
- icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>'
233
- }
234
- ],
235
- alignOptions: [
236
- {
237
- value: "left",
238
- icon: '<path d="M 6 9 A 2.0002 2.0002 0 1 0 6 13 L 34 13 A 2.0002 2.0002 0 1 0 34 9 L 6 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 7 35 A 2.0002 2.0002 0 1 0 7 39 L 27 39 A 2.0002 2.0002 0 1 0 27 35 L 7 35 z" />'
239
- },
240
- {
241
- value: "center",
242
- icon: '<path d="M 10 9 A 2.0002 2.0002 0 1 0 10 13 L 38 13 A 2.0002 2.0002 0 1 0 38 9 L 10 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 14 35 A 2.0002 2.0002 0 1 0 14 39 L 34 39 A 2.0002 2.0002 0 1 0 34 35 L 14 35 z" />'
243
- },
244
- {
245
- value: "right",
246
- icon: '<path d="M 14 9 A 2.0002 2.0002 0 1 0 14 13 L 42 13 A 2.0002 2.0002 0 1 0 42 9 L 14 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 22 35 A 2.0002 2.0002 0 1 0 22 39 L 42 39 A 2.0002 2.0002 0 1 0 42 35 L 22 35 z" />'
247
- }
248
- ]
249
- };
250
- },
251
- computed: {
252
- layoutOptions() {
253
- var t;
254
- const { type: i } = ((t = this.items) == null ? void 0 : t[0]) || {};
255
- return [
256
- {
257
- // left
258
- isActive: this.layout === "vertical" && i === "media",
259
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
260
- onClick: () => this.setLayout({ layout: "vertical", type: "media" })
261
- },
262
- {
263
- // right
264
- isActive: this.layout === "vertical" && i === "content",
265
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
266
- onClick: () => this.setLayout({ layout: "vertical", type: "content" })
267
- },
268
- {
269
- // top
270
- isActive: this.layout === "horizontal" && i === "media",
271
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>',
272
- onClick: () => this.setLayout({ layout: "horizontal", type: "media" })
273
- },
274
- {
275
- // bottom
276
- isActive: this.layout === "horizontal" && i === "content",
277
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>',
278
- onClick: () => this.setLayout({ layout: "horizontal", type: "content" })
279
- },
280
- {
281
- // center
282
- isActive: this.layout === "center",
283
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>',
284
- onClick: () => this.setLayout({ layout: "center", type: "media" })
285
- },
286
- {
287
- // price
288
- isActive: this.layout === "price",
289
- icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>',
290
- onClick: () => this.setLayout({ layout: "price" })
291
- }
292
- ];
293
- },
294
- overlayColor: {
295
- get() {
296
- var i;
297
- return ((i = this.media) == null ? void 0 : i.overlayColor) || "";
298
- },
299
- set(i) {
300
- this.media = { ...this.media, overlay: !0, overlayColor: i };
301
- }
302
- },
303
- background() {
304
- let i = "";
305
- const { type: t, resourceUrl: e, video: o = {} } = this.media || {};
306
- return t === "image" && e ? i = e : t === "video" && o.thumbnail && (i = o.thumbnail), i;
307
- },
308
- theme() {
309
- var i;
310
- return ((i = this._document) == null ? void 0 : i.theme) || {};
311
- },
312
- showPriceToggle: {
313
- get() {
314
- return !!(typeof this.showPriceSummary == "boolean" ? this.showPriceSummary : this.theme.showPriceSummary);
315
- },
316
- set(i) {
317
- this.showPriceSummary = i;
318
- }
319
- }
320
- },
321
- watch: {
322
- layout(i) {
323
- this._document.isDirty(this._value.textAlign) || (this.textAlign = i === "center" ? i : "left");
324
- },
325
- backgroundColor(i) {
326
- this._document.isDirty(this._value.textColor) || (this.textColor = A.readability(i, "#fff") < 1.8 ? "#111111" : "#FFFFFF");
327
- }
328
- },
329
- methods: {
330
- // Used for setting the correct array item order for specific layouts
331
- // will place the given item type first in items
332
- setLayout({ layout: i, type: t = "" }) {
333
- const e = (o) => (r) => r.type === o ? -1 : 1;
334
- t && (this.items = [...this.items].sort(e(t))), this.layout = i;
335
- },
336
- openBgModal() {
337
- const { type: i = "image" } = this.media || {};
338
- this.$modal.show(
339
- T,
340
- {
341
- currentType: i
342
- },
343
- {},
344
- {
345
- input: ({ type: t, value: e, preferredColor: o }) => {
346
- const r = t === "image" ? "resourceUrl" : "video";
347
- this.media = {
348
- ...this.media,
349
- type: t,
350
- [r]: e
351
- }, o && !this._document.isDirty(this._value.backgroundColor) && (this.backgroundColor = o);
352
- }
353
- }
354
- );
355
- }
356
- }
357
- };
358
- var B = function() {
359
- var t = this, e = t._self._c;
360
- return e("div", { staticClass: "d-root" }, [e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" Layouts ")]), e("div", { staticClass: "grid grid-cols-3 gap-2 p-1" }, t._l(t.layoutOptions, function({ isActive: o, onClick: r, icon: s }, a) {
361
- return e("CButton", { key: a, staticStyle: { padding: "6px 10px", "border-radius": "3px", height: "initial" }, attrs: { type: o ? "secondary" : "none", pattern: o ? "primary" : "secondary", size: "normal" }, on: { click: r } }, [e("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(s) } })]);
362
- }), 1)]), e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:background").capitalize()) + " ")]), e("div", { staticClass: "d-option-button-image", style: {
363
- backgroundImage: `url(${t.background || t.theme.background})`
364
- }, on: { click: t.openBgModal } })]), e("div", { staticClass: "d-option", staticStyle: { "padding-bottom": "0.5em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.overlayColor || t.theme.backgroundFilter || "", placement: "auto" }, on: { change: function(o) {
365
- t.overlayColor = o;
366
- } } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.backgroundFilter")) + " ")])], 1), t.layout === "price" ? e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title" }, [e("div", { staticStyle: { flex: "1 1 auto" } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.priceSummaryBackground")) + " ")]), e("CSwitch", { staticStyle: { "margin-right": "0" }, attrs: { size: "small", type: "secondary" }, model: { value: t.showPriceToggle, callback: function(o) {
367
- t.showPriceToggle = o;
368
- }, expression: "showPriceToggle" } })], 1), t.showPriceToggle ? e("div", { staticClass: "d-option-row", staticStyle: { "padding-top": "1em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
369
- t.backgroundColor = o;
370
- } } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e()]) : [t.layout !== "center" ? e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
371
- t.backgroundColor = o, t._document.setDirty(t._value.backgroundColor);
372
- } } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e(), e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" }, attrs: { value: t.textColor || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(o) {
373
- t.textColor = o, t._document.setDirty(t._value.textColor);
374
- } } }, [t._v(" " + t._s(t.$t("_common:textColor").capitalize()) + " ")])], 1), e("div", { staticClass: "d-option flex w-full" }, [e("div", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:textAlign").capitalize()) + " ")]), e("CField", { staticStyle: { "margin-left": "auto" } }, t._l(t.alignOptions, function({ value: o, icon: r }, s) {
375
- return e("CRadioButton", { key: s, class: !t.textAlign && "text-gray-400", attrs: { "native-value": o, type: t.textAlign ? "secondary" : "none", size: "small" }, on: { input: function(a) {
376
- return t._document.setDirty(t._value.textAlign);
377
- } }, model: { value: t.textAlign, callback: function(a) {
378
- t.textAlign = a;
379
- }, expression: "textAlign" } }, [e("svg", { staticStyle: { margin: "0" }, attrs: { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 48 48", fill: "currentColor", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(r) } })]);
380
- }), 1)], 1)]], 2);
381
- }, P = [], F = /* @__PURE__ */ y(
382
- $,
383
- B,
384
- P,
385
- !1,
386
- null,
387
- "adcf8352"
388
- );
389
- const q = F.exports;
390
- export {
391
- q as default
392
- };
@@ -1,84 +0,0 @@
1
- import r from "./ImageUploadWrapper-Dv43rGdb.js";
2
- import { B as l, a as i } from "./index-BgJ05dYc.js";
3
- import { c, n as m, o as n, H as d } from "./main-WKzC-Dnu.js";
4
- const o = c.unsplash.id, p = {
5
- name: "ImageSelectModal",
6
- i18nOptions: {
7
- namespaces: "imageSelectModal",
8
- messages: {
9
- en: {
10
- creditImages: "Images from {{thing}}"
11
- },
12
- sv: {
13
- creditImages: "Bilder från {{thing}}"
14
- }
15
- }
16
- },
17
- components: {
18
- BackgroundModal: l,
19
- BackgroundList: i,
20
- ImageUploadWrapper: r
21
- },
22
- data() {
23
- return {
24
- selectedUrl: null
25
- };
26
- },
27
- methods: {
28
- async fetch({ query: a, page: e }) {
29
- const { data: t } = await n.get(
30
- "https://api.unsplash.com/search/photos",
31
- {
32
- params: {
33
- page: e,
34
- per_page: 12,
35
- client_id: o,
36
- query: a
37
- }
38
- }
39
- );
40
- return {
41
- items: (t.results || []).map((s) => ({
42
- ...s,
43
- image: s.urls.regular,
44
- minImage: s.urls.thumb
45
- })),
46
- total: t.total
47
- };
48
- },
49
- selectImage(a) {
50
- this.selectedUrl = d(a.image, { w: 1800 });
51
- const e = new Image();
52
- e.src = this.selectedUrl, n.get(a.links.download_location, {
53
- params: {
54
- client_id: o
55
- }
56
- });
57
- },
58
- setCustomBackground({ response: a }) {
59
- this.selectedUrl = a.url, this.onSave();
60
- },
61
- onSave() {
62
- this.$emit("change"), this.$emit("input", this.selectedUrl), this.$parent && (this.$parent.$emit("change"), this.$parent.$emit("input", this.selectedUrl)), this.$emit("close");
63
- }
64
- }
65
- };
66
- var u = function() {
67
- var e = this, t = e._self._c;
68
- return t("BackgroundModal", e._g({}, e.$listeners), [t("BackgroundList", { attrs: { fetch: e.fetch, "credit-text": e.$t("creditImages", { thing: "Unsplash" }), "default-query": "architecture" }, on: { select: e.selectImage } }, [t("template", { slot: "footer" }, [t("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": e.setCustomBackground }, on: { upload: function(s) {
69
- e.isUploadingImage = !0;
70
- } }, scopedSlots: e._u([{ key: "default", fn: function({ progress: s }) {
71
- return [t("CButton", { attrs: { loading: !!s, "icon-left": "upload", type: "none" } }, [e._v(" " + e._s(e.$t("_common:upload")) + " ")])];
72
- } }]) }), t("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "secondary" }, on: { click: e.onSave } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2)], 1);
73
- }, g = [], h = /* @__PURE__ */ m(
74
- p,
75
- u,
76
- g,
77
- !1,
78
- null,
79
- "d3705339"
80
- );
81
- const v = h.exports;
82
- export {
83
- v as default
84
- };