@cling-se/widget 0.14.3 → 0.14.4

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 (134) hide show
  1. package/.eslintrc.cjs +4 -4
  2. package/README.md +40 -40
  3. package/package.json +1 -1
  4. package/tsconfig.json +26 -26
  5. package/tsconfig.node.json +10 -10
  6. package/tsconfig.paths.json +17 -17
  7. package/vite.config.ts +61 -61
  8. package/dist/AddClientCallout-DKH-LP5B.js +0 -46
  9. package/dist/AnswerModal-BCbq8wc4.js +0 -3869
  10. package/dist/AttachmentItem-60CSZnkF.js +0 -78
  11. package/dist/BaseDatePicker-Cl8SnC1k.js +0 -3183
  12. package/dist/BaseUpload-D4FCjlhL.js +0 -1977
  13. package/dist/BlockMedia-CqkwdGnE.js +0 -76
  14. package/dist/CCallout-BTBgU8f-.js +0 -59
  15. package/dist/CCurrencyDropdown-CL32Mo-Y.js +0 -246
  16. package/dist/CDropdownItem-DlWtQwO6.js +0 -538
  17. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  18. package/dist/CFormField-BxJv-nUO.js +0 -241
  19. package/dist/CPhoneFormat-CJ9kndtJ.js +0 -62
  20. package/dist/CPriceInput-BpXI5X2j.js +0 -112
  21. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  22. package/dist/ClientAutocomplete-D9Dj9iBW.js +0 -78
  23. package/dist/ClientModal-JOt8NGcR.js +0 -625
  24. package/dist/ColorPicker-uPKD-Gvm.js +0 -2879
  25. package/dist/CompanyModal-7bG0iIRd.js +0 -141
  26. package/dist/ContentWrapper-B2nyZHL4.js +0 -183
  27. package/dist/CoverBlockSettings-C1O_FAde.js +0 -275
  28. package/dist/DocAnswer-B9G-y4Px.js +0 -36
  29. package/dist/DocDetails-DYHxKChO.js +0 -246
  30. package/dist/DocForm-BktEXjML.js +0 -7273
  31. package/dist/DocFormSend-DM6QgUOj.js +0 -143
  32. package/dist/DocLinks-BIGwfB3H.js +0 -38
  33. package/dist/DocModalBase-D5GdwTI7.js +0 -28
  34. package/dist/DocPrint-HqbaIGms.js +0 -240
  35. package/dist/DocReceipt-WXo6vWyW.js +0 -210
  36. package/dist/DocSendReminder-C8dNEpLg.js +0 -137
  37. package/dist/DocTextEditor-BfOZFDTP.js +0 -17177
  38. package/dist/DocTimeline-CitwS9px.js +0 -481
  39. package/dist/DocumentClient-CQ_z8ajY.js +0 -136
  40. package/dist/DocumentLayout-BA7mFfZh.js +0 -4909
  41. package/dist/DocumentLogotype-woc_hfll.js +0 -87
  42. package/dist/DocumentVoided-DC4FzpxG.js +0 -25
  43. package/dist/EmbedInput-CheqYcNr.js +0 -113
  44. package/dist/EmbedSettings-YcwM8hJw.js +0 -72
  45. package/dist/ErrorCallout-6pCYcx00.js +0 -28
  46. package/dist/FilePreviewModal-T8AiphqO.js +0 -81
  47. package/dist/Flag-Ddm6a4Il.js +0 -114
  48. package/dist/HeaderSettings-DHdZweJH.js +0 -392
  49. package/dist/ImageSelectModal-CAoBhnI8.js +0 -84
  50. package/dist/ImageUploadWrapper-CNv59Lhh.js +0 -1604
  51. package/dist/Index-B6S9U4Z-.js +0 -26
  52. package/dist/Index-BHX0D5fW.js +0 -559
  53. package/dist/Index-BL_7m5Ca.js +0 -70
  54. package/dist/Index-BXMXEUfo.js +0 -223
  55. package/dist/Index-BhVBvMu6.js +0 -32
  56. package/dist/Index-Bl_SNW80.js +0 -25
  57. package/dist/Index-BsguntKl.js +0 -21
  58. package/dist/Index-CGYjPfsf.js +0 -2402
  59. package/dist/Index-CKrGb3of.js +0 -61
  60. package/dist/Index-CMNrQo5a.js +0 -140
  61. package/dist/Index-CU50Al5c.js +0 -642
  62. package/dist/Index-CdqrrZxd.js +0 -77
  63. package/dist/Index-CfnL9dAw.js +0 -58
  64. package/dist/Index-CuW0MYrT.js +0 -171
  65. package/dist/Index-D-z8JSn6.js +0 -154
  66. package/dist/Index-D8giJ_bs.js +0 -84
  67. package/dist/Index-DDvfqy_h.js +0 -24
  68. package/dist/Index-DQDalqZ-.js +0 -107
  69. package/dist/Index-DTIPKKkV.js +0 -150
  70. package/dist/Index-DWxzUBff.js +0 -754
  71. package/dist/Index-DaNGeDQw.js +0 -144
  72. package/dist/Index-DfLU_AyN.js +0 -49
  73. package/dist/Index-DkVav_I7.js +0 -25
  74. package/dist/Index-Dxp8QAtB.js +0 -57
  75. package/dist/Index-DzjxFkcv.js +0 -52
  76. package/dist/Index-EwUJJWaB.js +0 -69
  77. package/dist/Index-I60qAqLl.js +0 -31
  78. package/dist/Index-LfF-7lQK.js +0 -292
  79. package/dist/Index-P0_dyc2V.js +0 -45
  80. package/dist/Index-RQMPSeHw.js +0 -98
  81. package/dist/Index-oipNLl3Y.js +0 -46
  82. package/dist/Index-sJq2Iyvt.js +0 -62
  83. package/dist/Index-uubi3NHX.js +0 -33
  84. package/dist/Index-vNj2kYZT.js +0 -55
  85. package/dist/InputToggleRow-B2pWvVyx.js +0 -57
  86. package/dist/ManualPopover-BI_Sf1zG.js +0 -54
  87. package/dist/MediaWrapper-eFpWxv3n.js +0 -23
  88. package/dist/NotBindingText-DA5NpePz.js +0 -32
  89. package/dist/PackageGroup-DOSijBdN.js +0 -699
  90. package/dist/PdfTerms-Q5YuVtrJ.js +0 -36
  91. package/dist/PdfViewer-zcWl8XZT.js +0 -374
  92. package/dist/PlainHtml-BmA83UAm.js +0 -20
  93. package/dist/PriceHeader-C14L5zgG.js +0 -339
  94. package/dist/SearchApi-CGT7-jVf.js +0 -161
  95. package/dist/Setup-RJQvZlDO.js +0 -50
  96. package/dist/SmartList-YosKRPVn.js +0 -83
  97. package/dist/TermsSettings-C5JTv7rT.js +0 -102
  98. package/dist/ThemeColorRow-D-C_tm2f.js +0 -63
  99. package/dist/ToggleBinding-KEVHHvKf.js +0 -38
  100. package/dist/UploadModal-DOYoWELI.js +0 -95
  101. package/dist/VideoPlayerInput-Dxb6CNk-.js +0 -93
  102. package/dist/VideoPlayerSettings-DsVN4Ix-.js +0 -61
  103. package/dist/VideoSelectModal-BpfzNx61.js +0 -100
  104. package/dist/anime.es-BrPTThYb.js +0 -858
  105. package/dist/answerDocumentMixin-BJMGrfUs.js +0 -51
  106. package/dist/color-TdtKxwVa.js +0 -19
  107. package/dist/debounce-BN83gOVd.js +0 -84
  108. package/dist/dom-CJxkno7i.js +0 -91
  109. package/dist/favicon.ico +0 -0
  110. package/dist/focusDrawerMixin-CawyQaGq.js +0 -22
  111. package/dist/formComponentsInstall-jcnyQ1zw.js +0 -2494
  112. package/dist/formDrawerState-BdNohvZH.js +0 -20
  113. package/dist/formValidationMixin-DOwgebZk.js +0 -49
  114. package/dist/i18nMessages-Chz_lxGG.js +0 -17
  115. package/dist/index-BBJIOkm_.js +0 -347
  116. package/dist/index-BNq9YCWc.js +0 -166
  117. package/dist/index-BdhbkLLU.js +0 -81
  118. package/dist/index-COf8F6CL.js +0 -3916
  119. package/dist/index-D0WvZHX_.js +0 -102
  120. package/dist/index-DTzZP4yq.js +0 -492
  121. package/dist/index.es.js +0 -35
  122. package/dist/index.umd.js +0 -3148
  123. package/dist/main-DE5THsiR.js +0 -56739
  124. package/dist/mapFormMixin-y2txvLw9.js +0 -72
  125. package/dist/omit-BrsWQAtU.js +0 -31
  126. package/dist/publicSenderState-BYsq95Vt.js +0 -21
  127. package/dist/splitpanes-BHUVsCZF.js +0 -382
  128. package/dist/style.css +0 -4
  129. package/dist/throttle-C2srA2wa.js +0 -18
  130. package/dist/tinycolor-SjV_ROuP.js +0 -633
  131. package/dist/tippy.esm-Dj7DQppr.js +0 -1799
  132. package/dist/utils-16HMuRfY.js +0 -108
  133. package/dist/vuedraggable.umd-Cd1g2Hr7.js +0 -3161
  134. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,392 +0,0 @@
1
- import { m as x } from "./mapFormMixin-y2txvLw9.js";
2
- import { T as w } from "./ThemeColorRow-D-C_tm2f.js";
3
- import C from "./VideoPlayerInput-Dxb6CNk-.js";
4
- import _ from "./ImageUploadWrapper-CNv59Lhh.js";
5
- import { B as k, a as b } from "./index-BNq9YCWc.js";
6
- import { c as v, n as y, o as d, H as S } from "./main-DE5THsiR.js";
7
- import { t as A } from "./tinycolor-SjV_ROuP.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-CNv59Lhh.js";
2
- import { B as l, a as i } from "./index-BNq9YCWc.js";
3
- import { c, n as m, o as n, H as d } from "./main-DE5THsiR.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
- };