@getmicdrop/venue-calendar 4.3.113 → 4.3.115

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 (30) hide show
  1. package/dist/{CollectionView-DlkRy1E6.js → CollectionView-CKuFr-dz.js} +41 -34
  2. package/dist/api/types.d.ts +1 -0
  3. package/dist/venue-calendar.es.js +1189 -1200
  4. package/dist/venue-calendar.iife.js +29 -29
  5. package/dist/venue-calendar.umd.js +57 -57
  6. package/package.json +2 -2
  7. /package/dist/locales/{4.3.113 → 4.3.115}/flow/de.js +0 -0
  8. /package/dist/locales/{4.3.113 → 4.3.115}/flow/es.js +0 -0
  9. /package/dist/locales/{4.3.113 → 4.3.115}/flow/fr.js +0 -0
  10. /package/dist/locales/{4.3.113 → 4.3.115}/flow/id.js +0 -0
  11. /package/dist/locales/{4.3.113 → 4.3.115}/flow/it.js +0 -0
  12. /package/dist/locales/{4.3.113 → 4.3.115}/flow/ja.js +0 -0
  13. /package/dist/locales/{4.3.113 → 4.3.115}/flow/ko.js +0 -0
  14. /package/dist/locales/{4.3.113 → 4.3.115}/flow/nl.js +0 -0
  15. /package/dist/locales/{4.3.113 → 4.3.115}/flow/pl.js +0 -0
  16. /package/dist/locales/{4.3.113 → 4.3.115}/flow/pt-br.js +0 -0
  17. /package/dist/locales/{4.3.113 → 4.3.115}/flow/tr.js +0 -0
  18. /package/dist/locales/{4.3.113 → 4.3.115}/flow/zh.js +0 -0
  19. /package/dist/locales/{4.3.113 → 4.3.115}/main/de.js +0 -0
  20. /package/dist/locales/{4.3.113 → 4.3.115}/main/es.js +0 -0
  21. /package/dist/locales/{4.3.113 → 4.3.115}/main/fr.js +0 -0
  22. /package/dist/locales/{4.3.113 → 4.3.115}/main/id.js +0 -0
  23. /package/dist/locales/{4.3.113 → 4.3.115}/main/it.js +0 -0
  24. /package/dist/locales/{4.3.113 → 4.3.115}/main/ja.js +0 -0
  25. /package/dist/locales/{4.3.113 → 4.3.115}/main/ko.js +0 -0
  26. /package/dist/locales/{4.3.113 → 4.3.115}/main/nl.js +0 -0
  27. /package/dist/locales/{4.3.113 → 4.3.115}/main/pl.js +0 -0
  28. /package/dist/locales/{4.3.113 → 4.3.115}/main/pt-br.js +0 -0
  29. /package/dist/locales/{4.3.113 → 4.3.115}/main/tr.js +0 -0
  30. /package/dist/locales/{4.3.113 → 4.3.115}/main/zh.js +0 -0
@@ -17,67 +17,74 @@ function v(v, y) {
17
17
  f.push(y, !0), t("CollectionView"), f.prop(y, "organizationId", 3, "");
18
18
  let b = f.prop(y, "onNavigateToEvent", 3, void 0), x = f.prop(y, "password", 3, void 0);
19
19
  f.prop(y, "displayMode", 3, "gallery"), f.prop(y, "showViewSwitcher", 3, !0);
20
- let S = f.prop(y, "labels", 3, r), C = f.prop(y, "locale", 3, void 0), w = f.state(null), T = f.state(!0), E = f.state(null), D = f.state(!1), O = f.state(!1), k = f.state(""), A = f.state(!1), j = f.derived(() => f.get(w) ? n(f.get(w)) : null), M = 0;
21
- async function N(e, t = !1) {
22
- if (!f.get(D)) return;
23
- let n = ++M;
20
+ let S = f.prop(y, "labels", 3, r), C = f.prop(y, "locale", 3, void 0), w = f.prop(y, "initialCollection", 3, null), T = f.state(null), E = f.state(!0), D = f.state(null), O = f.state(!1), k = f.state(!1), A = f.state(""), j = f.state(!1), M = f.derived(() => f.get(T) ? n(f.get(T)) : null), N = 0;
21
+ async function P(e, t = !1) {
22
+ if (!f.get(O)) return;
23
+ let n = ++N;
24
24
  if (!y.collectionId) {
25
- f.set(E, S().noCollectionIdProvided || "No collection ID provided", !0), f.set(T, !1);
25
+ f.set(D, S().noCollectionIdProvided || "No collection ID provided", !0), f.set(E, !1);
26
26
  return;
27
27
  }
28
- f.set(T, !0), f.set(E, null), f.set(A, !1);
28
+ f.set(E, !0), f.set(D, null), f.set(j, !1);
29
29
  try {
30
30
  let r = await a(y.collectionId, e);
31
- if (!f.get(D) || n !== M) return;
31
+ if (!f.get(O) || n !== N) return;
32
32
  if (r) {
33
33
  if (r.passwordRequired || r.error?.code === "PASSWORD_REQUIRED") {
34
- f.set(O, !0), t && d("collection", y.collectionId), f.set(T, !1);
34
+ f.set(k, !0), t && d("collection", y.collectionId), f.set(E, !1);
35
35
  return;
36
36
  }
37
- f.set(w, r, !0), f.set(O, !1), l("collection", y.collectionId, e);
37
+ f.set(T, r, !0), f.set(k, !1), l("collection", y.collectionId, e);
38
38
  } else {
39
39
  if (e) {
40
- f.set(O, !0), t ? d("collection", y.collectionId) : f.set(A, !0), f.set(T, !1);
40
+ f.set(k, !0), t ? d("collection", y.collectionId) : f.set(j, !0), f.set(E, !1);
41
41
  return;
42
42
  }
43
- f.set(E, S().failedToLoadCollection || "Failed to load collection", !0);
43
+ f.set(D, S().failedToLoadCollection || "Failed to load collection", !0);
44
44
  }
45
45
  } catch (e) {
46
- if (f.get(D) && n === M) {
46
+ if (f.get(O) && n === N) {
47
47
  let n = e.message || "";
48
- n.includes("401") || n.includes("403") || n.includes("password") ? (f.set(O, !0), t && d("collection", y.collectionId)) : f.set(E, n || S().failedToLoadCollection || "Failed to load collection", !0);
48
+ n.includes("401") || n.includes("403") || n.includes("password") ? (f.set(k, !0), t && d("collection", y.collectionId)) : f.set(D, n || S().failedToLoadCollection || "Failed to load collection", !0);
49
49
  }
50
50
  } finally {
51
- f.get(D) && n === M && f.set(T, !1);
51
+ f.get(O) && n === N && f.set(E, !1);
52
52
  }
53
53
  }
54
- function P(e) {
55
- e.preventDefault(), f.get(k).trim() && N(f.get(k));
56
- }
57
54
  function F(e) {
55
+ return !!(e && String(e.id) === String(y.collectionId) && e.visibility === "public" && Array.isArray(e.events) && !e.passwordRequired && !e.error);
56
+ }
57
+ function I(e) {
58
+ e.preventDefault(), f.get(A).trim() && P(f.get(A));
59
+ }
60
+ function L(e) {
58
61
  b() && e.id ? b()(Number(e.id), e.slug) : s(c("/[id]/[slug]", {
59
62
  id: String(e.id),
60
63
  slug: String(e.slug)
61
64
  }));
62
65
  }
63
66
  m(() => {
64
- f.set(D, !0);
67
+ f.set(O, !0);
65
68
  let e = x() ? void 0 : u("collection", y.collectionId);
66
- N(x() ?? e, !!e);
69
+ if (!x() && !e && F(w())) {
70
+ f.set(T, w()), f.set(E, !1);
71
+ return;
72
+ }
73
+ P(x() ?? e, !!e);
67
74
  }), p(() => {
68
- f.set(D, !1);
75
+ f.set(O, !1);
69
76
  });
70
- var I = f.comment(), L = f.first_child(I), R = (e) => {
77
+ var R = f.comment(), z = f.first_child(R), B = (e) => {
71
78
  var t = h(), n = f.child(t), r = f.child(n, !0);
72
79
  f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, S().loadingCollection || "Loading collection...")), f.append(e, t);
73
- }, z = (e) => {
80
+ }, V = (e) => {
74
81
  var t = g(), n = f.child(t), r = f.child(n), a = f.child(r, !0);
75
82
  f.reset(r);
76
83
  var s = f.sibling(r, 2), c = f.child(s, !0);
77
84
  f.reset(s);
78
85
  var l = f.sibling(s, 2), u = f.child(l);
79
86
  {
80
- let e = f.derived(() => S().enterPassword || "Enter password"), t = f.derived(() => f.get(A) ? S().incorrectPassword || "Incorrect password. Please try again" : "");
87
+ let e = f.derived(() => S().enterPassword || "Enter password"), t = f.derived(() => f.get(j) ? S().incorrectPassword || "Incorrect password. Please try again" : "");
81
88
  o(u, {
82
89
  get placeholder() {
83
90
  return f.get(e);
@@ -86,10 +93,10 @@ function v(v, y) {
86
93
  return f.get(t);
87
94
  },
88
95
  get value() {
89
- return f.get(k);
96
+ return f.get(A);
90
97
  },
91
98
  set value(e) {
92
- f.set(k, e, !0);
99
+ f.set(A, e, !0);
93
100
  }
94
101
  });
95
102
  }
@@ -105,16 +112,16 @@ function v(v, y) {
105
112
  $$slots: { default: !0 }
106
113
  }), f.reset(l), f.reset(n), f.reset(t), f.template_effect(() => {
107
114
  f.set_text(a, S().collectionPrivateTitle || "This collection is private"), f.set_text(c, S().collectionPrivateDescription || "Please enter the password to view this collection");
108
- }), f.event("submit", l, P), f.append(e, t);
109
- }, B = (e) => {
115
+ }), f.event("submit", l, I), f.append(e, t);
116
+ }, H = (e) => {
110
117
  var t = _(), n = f.child(t), r = f.child(n);
111
- f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, `${(S().errorPrefix || "Error:") ?? ""} ${f.get(E) ?? ""}`)), f.append(e, t);
112
- }, V = (t) => {
118
+ f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, `${(S().errorPrefix || "Error:") ?? ""} ${f.get(D) ?? ""}`)), f.append(e, t);
119
+ }, U = (t) => {
113
120
  e(t, {
114
121
  get event() {
115
- return f.get(j);
122
+ return f.get(M);
116
123
  },
117
- onCollectionEventClick: F,
124
+ onCollectionEventClick: L,
118
125
  get labels() {
119
126
  return S();
120
127
  },
@@ -123,9 +130,9 @@ function v(v, y) {
123
130
  }
124
131
  });
125
132
  };
126
- f.if(L, (e) => {
127
- f.get(T) ? e(R) : f.get(O) ? e(z, 1) : f.get(E) ? e(B, 2) : f.get(j) && e(V, 3);
128
- }), f.append(v, I), f.pop();
133
+ f.if(z, (e) => {
134
+ f.get(E) ? e(B) : f.get(k) ? e(V, 1) : f.get(D) ? e(H, 2) : f.get(M) && e(U, 3);
135
+ }), f.append(v, R), f.pop();
129
136
  }
130
137
  //#endregion
131
138
  export { v as default };
@@ -435,6 +435,7 @@ export interface PublicCollectionData {
435
435
  error?: {
436
436
  code?: string;
437
437
  };
438
+ visibility?: string;
438
439
  }
439
440
  export interface ApiConfig {
440
441
  baseUrl?: string;