ablok-components 0.3.26 → 0.3.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,410 @@
1
+ var R = {};
2
+ (function _(M, T, B, I) {
3
+ var k = !!(M.Worker && M.Blob && M.Promise && M.OffscreenCanvas && M.OffscreenCanvasRenderingContext2D && M.HTMLCanvasElement && M.HTMLCanvasElement.prototype.transferControlToOffscreen && M.URL && M.URL.createObjectURL), A = typeof Path2D == "function" && typeof DOMMatrix == "function", V = (function() {
4
+ if (!M.OffscreenCanvas)
5
+ return !1;
6
+ try {
7
+ var e = new OffscreenCanvas(1, 1), r = e.getContext("2d");
8
+ r.fillRect(0, 0, 1, 1);
9
+ var a = e.transferToImageBitmap();
10
+ r.createPattern(a, "no-repeat");
11
+ } catch {
12
+ return !1;
13
+ }
14
+ return !0;
15
+ })();
16
+ function L() {
17
+ }
18
+ function P(e) {
19
+ var r = T.exports.Promise, a = r !== void 0 ? r : M.Promise;
20
+ return typeof a == "function" ? new a(e) : (e(L, L), null);
21
+ }
22
+ var x = /* @__PURE__ */ (function(e, r) {
23
+ return {
24
+ transform: function(a) {
25
+ if (e)
26
+ return a;
27
+ if (r.has(a))
28
+ return r.get(a);
29
+ var t = new OffscreenCanvas(a.width, a.height), o = t.getContext("2d");
30
+ return o.drawImage(a, 0, 0), r.set(a, t), t;
31
+ },
32
+ clear: function() {
33
+ r.clear();
34
+ }
35
+ };
36
+ })(V, /* @__PURE__ */ new Map()), F = (function() {
37
+ var e = Math.floor(16.666666666666668), r, a, t = {}, o = 0;
38
+ return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (r = function(i) {
39
+ var l = Math.random();
40
+ return t[l] = requestAnimationFrame(function n(s) {
41
+ o === s || o + e - 1 < s ? (o = s, delete t[l], i()) : t[l] = requestAnimationFrame(n);
42
+ }), l;
43
+ }, a = function(i) {
44
+ t[i] && cancelAnimationFrame(t[i]);
45
+ }) : (r = function(i) {
46
+ return setTimeout(i, e);
47
+ }, a = function(i) {
48
+ return clearTimeout(i);
49
+ }), { frame: r, cancel: a };
50
+ })(), Z = /* @__PURE__ */ (function() {
51
+ var e, r, a = {};
52
+ function t(o) {
53
+ function i(l, n) {
54
+ o.postMessage({ options: l || {}, callback: n });
55
+ }
56
+ o.init = function(n) {
57
+ var s = n.transferControlToOffscreen();
58
+ o.postMessage({ canvas: s }, [s]);
59
+ }, o.fire = function(n, s, h) {
60
+ if (r)
61
+ return i(n, null), r;
62
+ var d = Math.random().toString(36).slice(2);
63
+ return r = P(function(u) {
64
+ function f(m) {
65
+ m.data.callback === d && (delete a[d], o.removeEventListener("message", f), r = null, x.clear(), h(), u());
66
+ }
67
+ o.addEventListener("message", f), i(n, d), a[d] = f.bind(null, { data: { callback: d } });
68
+ }), r;
69
+ }, o.reset = function() {
70
+ o.postMessage({ reset: !0 });
71
+ for (var n in a)
72
+ a[n](), delete a[n];
73
+ };
74
+ }
75
+ return function() {
76
+ if (e)
77
+ return e;
78
+ if (!B && k) {
79
+ var o = [
80
+ "var CONFETTI, SIZE = {}, module = {};",
81
+ "(" + _.toString() + ")(this, module, true, SIZE);",
82
+ "onmessage = function(msg) {",
83
+ " if (msg.data.options) {",
84
+ " CONFETTI(msg.data.options).then(function () {",
85
+ " if (msg.data.callback) {",
86
+ " postMessage({ callback: msg.data.callback });",
87
+ " }",
88
+ " });",
89
+ " } else if (msg.data.reset) {",
90
+ " CONFETTI && CONFETTI.reset();",
91
+ " } else if (msg.data.resize) {",
92
+ " SIZE.width = msg.data.resize.width;",
93
+ " SIZE.height = msg.data.resize.height;",
94
+ " } else if (msg.data.canvas) {",
95
+ " SIZE.width = msg.data.canvas.width;",
96
+ " SIZE.height = msg.data.canvas.height;",
97
+ " CONFETTI = module.exports.create(msg.data.canvas);",
98
+ " }",
99
+ "}"
100
+ ].join(`
101
+ `);
102
+ try {
103
+ e = new Worker(URL.createObjectURL(new Blob([o])));
104
+ } catch (i) {
105
+ return typeof console < "u" && typeof console.warn == "function" && console.warn("🎊 Could not load worker", i), null;
106
+ }
107
+ t(e);
108
+ }
109
+ return e;
110
+ };
111
+ })(), q = {
112
+ particleCount: 50,
113
+ angle: 90,
114
+ spread: 45,
115
+ startVelocity: 45,
116
+ decay: 0.9,
117
+ gravity: 1,
118
+ drift: 0,
119
+ ticks: 200,
120
+ x: 0.5,
121
+ y: 0.5,
122
+ shapes: ["square", "circle"],
123
+ zIndex: 100,
124
+ colors: [
125
+ "#26ccff",
126
+ "#a25afd",
127
+ "#ff5e7e",
128
+ "#88ff5a",
129
+ "#fcff42",
130
+ "#ffa62d",
131
+ "#ff36ff"
132
+ ],
133
+ // probably should be true, but back-compat
134
+ disableForReducedMotion: !1,
135
+ scalar: 1
136
+ };
137
+ function H(e, r) {
138
+ return r ? r(e) : e;
139
+ }
140
+ function G(e) {
141
+ return e != null;
142
+ }
143
+ function v(e, r, a) {
144
+ return H(
145
+ e && G(e[r]) ? e[r] : q[r],
146
+ a
147
+ );
148
+ }
149
+ function J(e) {
150
+ return e < 0 ? 0 : Math.floor(e);
151
+ }
152
+ function K(e, r) {
153
+ return Math.floor(Math.random() * (r - e)) + e;
154
+ }
155
+ function E(e) {
156
+ return parseInt(e, 16);
157
+ }
158
+ function Q(e) {
159
+ return e.map($);
160
+ }
161
+ function $(e) {
162
+ var r = String(e).replace(/[^0-9a-f]/gi, "");
163
+ return r.length < 6 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]), {
164
+ r: E(r.substring(0, 2)),
165
+ g: E(r.substring(2, 4)),
166
+ b: E(r.substring(4, 6))
167
+ };
168
+ }
169
+ function X(e) {
170
+ var r = v(e, "origin", Object);
171
+ return r.x = v(r, "x", Number), r.y = v(r, "y", Number), r;
172
+ }
173
+ function Y(e) {
174
+ e.width = document.documentElement.clientWidth, e.height = document.documentElement.clientHeight;
175
+ }
176
+ function rr(e) {
177
+ var r = e.getBoundingClientRect();
178
+ e.width = r.width, e.height = r.height;
179
+ }
180
+ function er(e) {
181
+ var r = document.createElement("canvas");
182
+ return r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.pointerEvents = "none", r.style.zIndex = e, r;
183
+ }
184
+ function ar(e, r, a, t, o, i, l, n, s) {
185
+ e.save(), e.translate(r, a), e.rotate(i), e.scale(t, o), e.arc(0, 0, 1, l, n, s), e.restore();
186
+ }
187
+ function nr(e) {
188
+ var r = e.angle * (Math.PI / 180), a = e.spread * (Math.PI / 180);
189
+ return {
190
+ x: e.x,
191
+ y: e.y,
192
+ wobble: Math.random() * 10,
193
+ wobbleSpeed: Math.min(0.11, Math.random() * 0.1 + 0.05),
194
+ velocity: e.startVelocity * 0.5 + Math.random() * e.startVelocity,
195
+ angle2D: -r + (0.5 * a - Math.random() * a),
196
+ tiltAngle: (Math.random() * (0.75 - 0.25) + 0.25) * Math.PI,
197
+ color: e.color,
198
+ shape: e.shape,
199
+ tick: 0,
200
+ totalTicks: e.ticks,
201
+ decay: e.decay,
202
+ drift: e.drift,
203
+ random: Math.random() + 2,
204
+ tiltSin: 0,
205
+ tiltCos: 0,
206
+ wobbleX: 0,
207
+ wobbleY: 0,
208
+ gravity: e.gravity * 3,
209
+ ovalScalar: 0.6,
210
+ scalar: e.scalar,
211
+ flat: e.flat
212
+ };
213
+ }
214
+ function tr(e, r) {
215
+ r.x += Math.cos(r.angle2D) * r.velocity + r.drift, r.y += Math.sin(r.angle2D) * r.velocity + r.gravity, r.velocity *= r.decay, r.flat ? (r.wobble = 0, r.wobbleX = r.x + 10 * r.scalar, r.wobbleY = r.y + 10 * r.scalar, r.tiltSin = 0, r.tiltCos = 0, r.random = 1) : (r.wobble += r.wobbleSpeed, r.wobbleX = r.x + 10 * r.scalar * Math.cos(r.wobble), r.wobbleY = r.y + 10 * r.scalar * Math.sin(r.wobble), r.tiltAngle += 0.1, r.tiltSin = Math.sin(r.tiltAngle), r.tiltCos = Math.cos(r.tiltAngle), r.random = Math.random() + 2);
216
+ var a = r.tick++ / r.totalTicks, t = r.x + r.random * r.tiltCos, o = r.y + r.random * r.tiltSin, i = r.wobbleX + r.random * r.tiltCos, l = r.wobbleY + r.random * r.tiltSin;
217
+ if (e.fillStyle = "rgba(" + r.color.r + ", " + r.color.g + ", " + r.color.b + ", " + (1 - a) + ")", e.beginPath(), A && r.shape.type === "path" && typeof r.shape.path == "string" && Array.isArray(r.shape.matrix))
218
+ e.fill(ir(
219
+ r.shape.path,
220
+ r.shape.matrix,
221
+ r.x,
222
+ r.y,
223
+ Math.abs(i - t) * 0.1,
224
+ Math.abs(l - o) * 0.1,
225
+ Math.PI / 10 * r.wobble
226
+ ));
227
+ else if (r.shape.type === "bitmap") {
228
+ var n = Math.PI / 10 * r.wobble, s = Math.abs(i - t) * 0.1, h = Math.abs(l - o) * 0.1, d = r.shape.bitmap.width * r.scalar, u = r.shape.bitmap.height * r.scalar, f = new DOMMatrix([
229
+ Math.cos(n) * s,
230
+ Math.sin(n) * s,
231
+ -Math.sin(n) * h,
232
+ Math.cos(n) * h,
233
+ r.x,
234
+ r.y
235
+ ]);
236
+ f.multiplySelf(new DOMMatrix(r.shape.matrix));
237
+ var m = e.createPattern(x.transform(r.shape.bitmap), "no-repeat");
238
+ m.setTransform(f), e.globalAlpha = 1 - a, e.fillStyle = m, e.fillRect(
239
+ r.x - d / 2,
240
+ r.y - u / 2,
241
+ d,
242
+ u
243
+ ), e.globalAlpha = 1;
244
+ } else if (r.shape === "circle")
245
+ e.ellipse ? e.ellipse(r.x, r.y, Math.abs(i - t) * r.ovalScalar, Math.abs(l - o) * r.ovalScalar, Math.PI / 10 * r.wobble, 0, 2 * Math.PI) : ar(e, r.x, r.y, Math.abs(i - t) * r.ovalScalar, Math.abs(l - o) * r.ovalScalar, Math.PI / 10 * r.wobble, 0, 2 * Math.PI);
246
+ else if (r.shape === "star")
247
+ for (var c = Math.PI / 2 * 3, g = 4 * r.scalar, p = 8 * r.scalar, y = r.x, w = r.y, C = 5, b = Math.PI / C; C--; )
248
+ y = r.x + Math.cos(c) * p, w = r.y + Math.sin(c) * p, e.lineTo(y, w), c += b, y = r.x + Math.cos(c) * g, w = r.y + Math.sin(c) * g, e.lineTo(y, w), c += b;
249
+ else
250
+ e.moveTo(Math.floor(r.x), Math.floor(r.y)), e.lineTo(Math.floor(r.wobbleX), Math.floor(o)), e.lineTo(Math.floor(i), Math.floor(l)), e.lineTo(Math.floor(t), Math.floor(r.wobbleY));
251
+ return e.closePath(), e.fill(), r.tick < r.totalTicks;
252
+ }
253
+ function or(e, r, a, t, o) {
254
+ var i = r.slice(), l = e.getContext("2d"), n, s, h = P(function(d) {
255
+ function u() {
256
+ n = s = null, l.clearRect(0, 0, t.width, t.height), x.clear(), o(), d();
257
+ }
258
+ function f() {
259
+ B && !(t.width === I.width && t.height === I.height) && (t.width = e.width = I.width, t.height = e.height = I.height), !t.width && !t.height && (a(e), t.width = e.width, t.height = e.height), l.clearRect(0, 0, t.width, t.height), i = i.filter(function(m) {
260
+ return tr(l, m);
261
+ }), i.length ? n = F.frame(f) : u();
262
+ }
263
+ n = F.frame(f), s = u;
264
+ });
265
+ return {
266
+ addFettis: function(d) {
267
+ return i = i.concat(d), h;
268
+ },
269
+ canvas: e,
270
+ promise: h,
271
+ reset: function() {
272
+ n && F.cancel(n), s && s();
273
+ }
274
+ };
275
+ }
276
+ function N(e, r) {
277
+ var a = !e, t = !!v(r || {}, "resize"), o = !1, i = v(r, "disableForReducedMotion", Boolean), l = k && !!v(r || {}, "useWorker"), n = l ? Z() : null, s = a ? Y : rr, h = e && n ? !!e.__confetti_initialized : !1, d = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, u;
278
+ function f(c, g, p) {
279
+ for (var y = v(c, "particleCount", J), w = v(c, "angle", Number), C = v(c, "spread", Number), b = v(c, "startVelocity", Number), cr = v(c, "decay", Number), hr = v(c, "gravity", Number), ur = v(c, "drift", Number), j = v(c, "colors", Q), dr = v(c, "ticks", Number), D = v(c, "shapes"), fr = v(c, "scalar"), vr = !!v(c, "flat"), U = X(c), z = y, O = [], mr = e.width * U.x, gr = e.height * U.y; z--; )
280
+ O.push(
281
+ nr({
282
+ x: mr,
283
+ y: gr,
284
+ angle: w,
285
+ spread: C,
286
+ startVelocity: b,
287
+ color: j[z % j.length],
288
+ shape: D[K(0, D.length)],
289
+ ticks: dr,
290
+ decay: cr,
291
+ gravity: hr,
292
+ drift: ur,
293
+ scalar: fr,
294
+ flat: vr
295
+ })
296
+ );
297
+ return u ? u.addFettis(O) : (u = or(e, O, s, g, p), u.promise);
298
+ }
299
+ function m(c) {
300
+ var g = i || v(c, "disableForReducedMotion", Boolean), p = v(c, "zIndex", Number);
301
+ if (g && d)
302
+ return P(function(b) {
303
+ b();
304
+ });
305
+ a && u ? e = u.canvas : a && !e && (e = er(p), document.body.appendChild(e)), t && !h && s(e);
306
+ var y = {
307
+ width: e.width,
308
+ height: e.height
309
+ };
310
+ n && !h && n.init(e), h = !0, n && (e.__confetti_initialized = !0);
311
+ function w() {
312
+ if (n) {
313
+ var b = {
314
+ getBoundingClientRect: function() {
315
+ if (!a)
316
+ return e.getBoundingClientRect();
317
+ }
318
+ };
319
+ s(b), n.postMessage({
320
+ resize: {
321
+ width: b.width,
322
+ height: b.height
323
+ }
324
+ });
325
+ return;
326
+ }
327
+ y.width = y.height = null;
328
+ }
329
+ function C() {
330
+ u = null, t && (o = !1, M.removeEventListener("resize", w)), a && e && (document.body.contains(e) && document.body.removeChild(e), e = null, h = !1);
331
+ }
332
+ return t && !o && (o = !0, M.addEventListener("resize", w, !1)), n ? n.fire(c, y, C) : f(c, y, C);
333
+ }
334
+ return m.reset = function() {
335
+ n && n.reset(), u && u.reset();
336
+ }, m;
337
+ }
338
+ var S;
339
+ function W() {
340
+ return S || (S = N(null, { useWorker: !0, resize: !0 })), S;
341
+ }
342
+ function ir(e, r, a, t, o, i, l) {
343
+ var n = new Path2D(e), s = new Path2D();
344
+ s.addPath(n, new DOMMatrix(r));
345
+ var h = new Path2D();
346
+ return h.addPath(s, new DOMMatrix([
347
+ Math.cos(l) * o,
348
+ Math.sin(l) * o,
349
+ -Math.sin(l) * i,
350
+ Math.cos(l) * i,
351
+ a,
352
+ t
353
+ ])), h;
354
+ }
355
+ function lr(e) {
356
+ if (!A)
357
+ throw new Error("path confetti are not supported in this browser");
358
+ var r, a;
359
+ typeof e == "string" ? r = e : (r = e.path, a = e.matrix);
360
+ var t = new Path2D(r), o = document.createElement("canvas"), i = o.getContext("2d");
361
+ if (!a) {
362
+ for (var l = 1e3, n = l, s = l, h = 0, d = 0, u, f, m = 0; m < l; m += 2)
363
+ for (var c = 0; c < l; c += 2)
364
+ i.isPointInPath(t, m, c, "nonzero") && (n = Math.min(n, m), s = Math.min(s, c), h = Math.max(h, m), d = Math.max(d, c));
365
+ u = h - n, f = d - s;
366
+ var g = 10, p = Math.min(g / u, g / f);
367
+ a = [
368
+ p,
369
+ 0,
370
+ 0,
371
+ p,
372
+ -Math.round(u / 2 + n) * p,
373
+ -Math.round(f / 2 + s) * p
374
+ ];
375
+ }
376
+ return {
377
+ type: "path",
378
+ path: r,
379
+ matrix: a
380
+ };
381
+ }
382
+ function sr(e) {
383
+ var r, a = 1, t = "#000000", o = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
384
+ typeof e == "string" ? r = e : (r = e.text, a = "scalar" in e ? e.scalar : a, o = "fontFamily" in e ? e.fontFamily : o, t = "color" in e ? e.color : t);
385
+ var i = 10 * a, l = "" + i + "px " + o, n = new OffscreenCanvas(i, i), s = n.getContext("2d");
386
+ s.font = l;
387
+ var h = s.measureText(r), d = Math.ceil(h.actualBoundingBoxRight + h.actualBoundingBoxLeft), u = Math.ceil(h.actualBoundingBoxAscent + h.actualBoundingBoxDescent), f = 2, m = h.actualBoundingBoxLeft + f, c = h.actualBoundingBoxAscent + f;
388
+ d += f + f, u += f + f, n = new OffscreenCanvas(d, u), s = n.getContext("2d"), s.font = l, s.fillStyle = t, s.fillText(r, m, c);
389
+ var g = 1 / a;
390
+ return {
391
+ type: "bitmap",
392
+ // TODO these probably need to be transfered for workers
393
+ bitmap: n.transferToImageBitmap(),
394
+ matrix: [g, 0, 0, g, -d * g / 2, -u * g / 2]
395
+ };
396
+ }
397
+ T.exports = function() {
398
+ return W().apply(this, arguments);
399
+ }, T.exports.reset = function() {
400
+ W().reset();
401
+ }, T.exports.create = N, T.exports.shapeFromPath = lr, T.exports.shapeFromText = sr;
402
+ })(/* @__PURE__ */ (function() {
403
+ return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
404
+ })(), R, !1);
405
+ const Mr = R.exports;
406
+ var pr = R.exports.create;
407
+ export {
408
+ pr as create,
409
+ Mr as default
410
+ };
package/dist/i18n.d.ts CHANGED
@@ -132,6 +132,27 @@ declare const i18n: import('vue-i18n').I18n<{
132
132
  search: {
133
133
  noResults: string;
134
134
  };
135
+ locationFinder: {
136
+ searchLabel: string;
137
+ searchPlaceholder: string;
138
+ resultsLabel: string;
139
+ emptyText: string;
140
+ locateButtonLabel: string;
141
+ stopTrackingLabel: string;
142
+ mapHelperText: string;
143
+ directionsTitle: string;
144
+ directionsEmptyText: string;
145
+ distanceLabel: string;
146
+ durationLabel: string;
147
+ loadingRoute: string;
148
+ legendAriaLabel: string;
149
+ legendLocations: string;
150
+ legendSelected: string;
151
+ legendSearchResult: string;
152
+ userLocationLabel: string;
153
+ pinnedLocationTitle: string;
154
+ selectedLocationLabel: string;
155
+ };
135
156
  admin: {
136
157
  finder: {
137
158
  title: string;
package/dist/index.d.ts CHANGED
@@ -25,9 +25,12 @@ export { default as ColorPalette } from './components/molecules/color-palette/co
25
25
  export { default as InputDropdown } from './components/molecules/input-dropdown/input-dropdown.vue';
26
26
  export { default as AutoSuggest } from './components/molecules/auto-suggest/auto-suggest.vue';
27
27
  export { default as BaseCamera } from './components/molecules/base-camera/base-camera.vue';
28
+ export { default as BaseMap } from './components/molecules/base-map/base-map.vue';
29
+ export { default as LocationList } from './components/molecules/location-list/location-list.vue';
28
30
  export { default as FileUpload } from './components/molecules/file-upload/file-upload.vue';
29
31
  export { default as UploadGroup } from './components/molecules/upload-group/upload-group.vue';
30
32
  export { default as AssetUploader } from './components/organisms/asset-uploader/asset-uploader.vue';
33
+ export { default as LocationFinder } from './components/organisms/location-finder/location-finder.vue';
31
34
  export { default as BaseCarousel } from './components/templates/base-carousel/base-carousel.vue';
32
35
  export { default as MediaThumbnails } from './components/molecules/media-thumbnails/media-thumbnails.vue';
33
36
  export { default as ProgressSteps } from './components/molecules/progress-steps/progress-steps.vue';
@@ -48,5 +51,11 @@ export { default as ImageResize } from './components/molecules/image-resize/imag
48
51
  export { default as ImageCropResize } from './components/molecules/image-crop-resize/image-crop-resize.vue';
49
52
  export { default as ImageUpload } from './components/molecules/image-upload/image-upload.vue';
50
53
  export { useCameraFilter } from './composables/useCameraFilter';
54
+ export { useDirections } from './composables/useDirections';
55
+ export { useGeocoding } from './composables/useGeocoding';
56
+ export { useGeolocation } from './composables/useGeolocation';
51
57
  export type { CameraFilterProps } from './composables/useCameraFilter';
52
58
  export type { ApplyImageFilterOptions } from './composables/useCameraFilter';
59
+ export type { RoutePoint, RouteStep } from './composables/useDirections';
60
+ export type { GeocodingResult } from './composables/useGeocoding';
61
+ export type { GeolocationPositionValue } from './composables/useGeolocation';