@paroicms/contact-form-plugin 0.7.0 → 0.7.1

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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.plugin = void 0;
4
+ const node_path_1 = require("node:path");
4
5
  const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
5
6
  const public_server_lib_1 = require("@paroicms/public-server-lib");
6
- const node_path_1 = require("node:path");
7
7
  const contact_form_mail_1 = require("./contact-form-mail");
8
8
  const data_format_1 = require("./data-format");
9
9
  const projectDir = (0, node_path_1.dirname)(__dirname);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/contact-form-plugin",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Contact form plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -30,16 +30,16 @@
30
30
  "@paroicms/public-server-lib": "0"
31
31
  },
32
32
  "devDependencies": {
33
- "@paroicms/public-anywhere-lib": "0.5.0",
34
- "@paroicms/public-server-lib": "0.12.0",
33
+ "@paroicms/public-anywhere-lib": "0.5.1",
34
+ "@paroicms/public-server-lib": "0.12.2",
35
35
  "@solid-primitives/i18n": "~2.1.1",
36
- "@types/node": "~20.12.8",
36
+ "@types/node": "~20.14.8",
37
37
  "rimraf": "~6.0.1",
38
38
  "sass": "~1.77.8",
39
39
  "solid-devtools": "~0.30.1",
40
- "solid-js": "~1.8.17",
40
+ "solid-js": "~1.8.20",
41
41
  "typescript": "~5.5.4",
42
- "vite": "~5.2.11",
42
+ "vite": "~5.4.0",
43
43
  "vite-plugin-solid": "~2.10.2"
44
44
  },
45
45
  "main": "backend/dist/plugin.js",
@@ -49,8 +49,7 @@ function ee(e, t, s) {
49
49
  return n.observers = null, n.observerSlots = null, n.comparator = s.equals || void 0, _(n), ye.bind(n);
50
50
  }
51
51
  function A(e) {
52
- if (a === null)
53
- return e();
52
+ if (a === null) return e();
54
53
  const t = a;
55
54
  a = null;
56
55
  try {
@@ -67,8 +66,7 @@ function He(e) {
67
66
  }
68
67
  function ye() {
69
68
  if (this.sources && this.state)
70
- if (this.state === E)
71
- _(this);
69
+ if (this.state === E) _(this);
72
70
  else {
73
71
  const e = d;
74
72
  d = null, T(() => q(this), !1), d = e;
@@ -91,11 +89,14 @@ function ve(e, t, s) {
91
89
  }, !1)), t;
92
90
  }
93
91
  function _(e) {
94
- if (!e.fn)
95
- return;
92
+ if (!e.fn) return;
96
93
  V(e);
97
94
  const t = k;
98
- Be(e, e.value, t);
95
+ Be(
96
+ e,
97
+ e.value,
98
+ t
99
+ );
99
100
  }
100
101
  function Be(e, t, s) {
101
102
  let n;
@@ -127,12 +128,9 @@ function ne(e, t, s, n = E, l) {
127
128
  return u === null || u !== we && (u.owned ? u.owned.push(r) : u.owned = [r]), r;
128
129
  }
129
130
  function I(e) {
130
- if (e.state === 0)
131
- return;
132
- if (e.state === B)
133
- return q(e);
134
- if (e.suspense && A(e.suspense.inFallback))
135
- return e.suspense.effects.push(e);
131
+ if (e.state === 0) return;
132
+ if (e.state === B) return q(e);
133
+ if (e.suspense && A(e.suspense.inFallback)) return e.suspense.effects.push(e);
136
134
  const t = [e];
137
135
  for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < k); )
138
136
  e.state && t.push(e);
@@ -145,8 +143,7 @@ function I(e) {
145
143
  }
146
144
  }
147
145
  function T(e, t) {
148
- if (d)
149
- return e();
146
+ if (d) return e();
150
147
  let s = !1;
151
148
  t || (d = []), v ? s = !0 : v = [], k++;
152
149
  try {
@@ -157,14 +154,12 @@ function T(e, t) {
157
154
  }
158
155
  }
159
156
  function Ie(e) {
160
- if (d && (Ce(d), d = null), e)
161
- return;
157
+ if (d && (Ce(d), d = null), e) return;
162
158
  const t = v;
163
159
  v = null, t.length && T(() => be(t), !1);
164
160
  }
165
161
  function Ce(e) {
166
- for (let t = 0; t < e.length; t++)
167
- I(e[t]);
162
+ for (let t = 0; t < e.length; t++) I(e[t]);
168
163
  }
169
164
  function qe(e) {
170
165
  let t, s = 0;
@@ -172,8 +167,7 @@ function qe(e) {
172
167
  const n = e[t];
173
168
  n.user ? e[s++] = n : I(n);
174
169
  }
175
- for (t = 0; t < s; t++)
176
- I(e[t]);
170
+ for (t = 0; t < s; t++) I(e[t]);
177
171
  }
178
172
  function q(e, t) {
179
173
  e.state = 0;
@@ -202,13 +196,11 @@ function V(e) {
202
196
  }
203
197
  }
204
198
  if (e.owned) {
205
- for (t = e.owned.length - 1; t >= 0; t--)
206
- V(e.owned[t]);
199
+ for (t = e.owned.length - 1; t >= 0; t--) V(e.owned[t]);
207
200
  e.owned = null;
208
201
  }
209
202
  if (e.cleanups) {
210
- for (t = e.cleanups.length - 1; t >= 0; t--)
211
- e.cleanups[t]();
203
+ for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
212
204
  e.cleanups = null;
213
205
  }
214
206
  e.state = 0;
@@ -230,18 +222,25 @@ function pe(e) {
230
222
  const t = e.keyed, s = ee(() => e.when, void 0, {
231
223
  equals: (n, l) => t ? n === l : !n == !l
232
224
  });
233
- return ee(() => {
234
- const n = s();
235
- if (n) {
236
- const l = e.children;
237
- return typeof l == "function" && l.length > 0 ? A(() => l(t ? n : () => {
238
- if (!A(s))
239
- throw Ve("Show");
240
- return e.when;
241
- })) : l;
242
- }
243
- return e.fallback;
244
- }, void 0, void 0);
225
+ return ee(
226
+ () => {
227
+ const n = s();
228
+ if (n) {
229
+ const l = e.children;
230
+ return typeof l == "function" && l.length > 0 ? A(
231
+ () => l(
232
+ t ? n : () => {
233
+ if (!A(s)) throw Ve("Show");
234
+ return e.when;
235
+ }
236
+ )
237
+ ) : l;
238
+ }
239
+ return e.fallback;
240
+ },
241
+ void 0,
242
+ void 0
243
+ );
245
244
  }
246
245
  function Ge(e, t, s) {
247
246
  let n = s.length, l = t.length, r = n, i = 0, o = 0, f = t[l - 1].nextSibling, p = null;
@@ -254,8 +253,7 @@ function Ge(e, t, s) {
254
253
  l--, r--;
255
254
  if (l === i) {
256
255
  const h = r < n ? o ? s[o - 1].nextSibling : s[r - o] : f;
257
- for (; o < r; )
258
- e.insertBefore(s[o++], h);
256
+ for (; o < r; ) e.insertBefore(s[o++], h);
259
257
  } else if (r === o)
260
258
  for (; i < l; )
261
259
  (!p || !p.has(t[i])) && t[i].remove(), i++;
@@ -266,8 +264,7 @@ function Ge(e, t, s) {
266
264
  if (!p) {
267
265
  p = /* @__PURE__ */ new Map();
268
266
  let w = o;
269
- for (; w < r; )
270
- p.set(s[w], w++);
267
+ for (; w < r; ) p.set(s[w], w++);
271
268
  }
272
269
  const h = p.get(t[i]);
273
270
  if (h != null)
@@ -277,14 +274,10 @@ function Ge(e, t, s) {
277
274
  j++;
278
275
  if (j > h - o) {
279
276
  const L = t[i];
280
- for (; o < h; )
281
- e.insertBefore(s[o++], L);
282
- } else
283
- e.replaceChild(s[o++], t[i++]);
284
- } else
285
- i++;
286
- else
287
- t[i++].remove();
277
+ for (; o < h; ) e.insertBefore(s[o++], L);
278
+ } else e.replaceChild(s[o++], t[i++]);
279
+ } else i++;
280
+ else t[i++].remove();
288
281
  }
289
282
  }
290
283
  }
@@ -308,15 +301,12 @@ function F(e, t, s) {
308
301
  s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
309
302
  }
310
303
  function g(e, t, s, n) {
311
- if (s !== void 0 && !n && (n = []), typeof t != "function")
312
- return D(e, t, n, s);
304
+ if (s !== void 0 && !n && (n = []), typeof t != "function") return D(e, t, n, s);
313
305
  S((l) => D(e, t(), l, s), n);
314
306
  }
315
307
  function D(e, t, s, n, l) {
316
- for (; typeof s == "function"; )
317
- s = s();
318
- if (t === s)
319
- return s;
308
+ for (; typeof s == "function"; ) s = s();
309
+ if (t === s) return s;
320
310
  const r = typeof t, i = n !== void 0;
321
311
  if (e = i && s[0] && s[0].parentNode || e, r === "string" || r === "number") {
322
312
  if (r === "number" && (t = t.toString(), t === s))
@@ -332,8 +322,7 @@ function D(e, t, s, n, l) {
332
322
  if (r === "function")
333
323
  return S(() => {
334
324
  let o = t();
335
- for (; typeof o == "function"; )
336
- o = o();
325
+ for (; typeof o == "function"; ) o = o();
337
326
  s = D(e, o, s, n);
338
327
  }), () => s;
339
328
  if (Array.isArray(t)) {
@@ -341,18 +330,14 @@ function D(e, t, s, n, l) {
341
330
  if (se(o, t, s, l))
342
331
  return S(() => s = D(e, o, s, n, !0)), () => s;
343
332
  if (o.length === 0) {
344
- if (s = $(e, s, n), i)
345
- return s;
346
- } else
347
- f ? s.length === 0 ? me(e, o, n) : Ge(e, s, o) : (s && $(e), me(e, o));
333
+ if (s = $(e, s, n), i) return s;
334
+ } else f ? s.length === 0 ? me(e, o, n) : Ge(e, s, o) : (s && $(e), me(e, o));
348
335
  s = o;
349
336
  } else if (t.nodeType) {
350
337
  if (Array.isArray(s)) {
351
- if (i)
352
- return s = $(e, s, n, t);
338
+ if (i) return s = $(e, s, n, t);
353
339
  $(e, s, null, t);
354
- } else
355
- s == null || s === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
340
+ } else s == null || s === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
356
341
  s = t;
357
342
  }
358
343
  }
@@ -362,32 +347,32 @@ function se(e, t, s, n) {
362
347
  let l = !1;
363
348
  for (let r = 0, i = t.length; r < i; r++) {
364
349
  let o = t[r], f = s && s[e.length], p;
365
- if (!(o == null || o === !0 || o === !1))
366
- if ((p = typeof o) == "object" && o.nodeType)
367
- e.push(o);
368
- else if (Array.isArray(o))
369
- l = se(e, o, f) || l;
370
- else if (p === "function")
371
- if (n) {
372
- for (; typeof o == "function"; )
373
- o = o();
374
- l = se(e, Array.isArray(o) ? o : [o], Array.isArray(f) ? f : [f]) || l;
375
- } else
376
- e.push(o), l = !0;
377
- else {
378
- const h = String(o);
379
- f && f.nodeType === 3 && f.data === h ? e.push(f) : e.push(document.createTextNode(h));
380
- }
350
+ if (!(o == null || o === !0 || o === !1)) if ((p = typeof o) == "object" && o.nodeType)
351
+ e.push(o);
352
+ else if (Array.isArray(o))
353
+ l = se(e, o, f) || l;
354
+ else if (p === "function")
355
+ if (n) {
356
+ for (; typeof o == "function"; ) o = o();
357
+ l = se(
358
+ e,
359
+ Array.isArray(o) ? o : [o],
360
+ Array.isArray(f) ? f : [f]
361
+ ) || l;
362
+ } else
363
+ e.push(o), l = !0;
364
+ else {
365
+ const h = String(o);
366
+ f && f.nodeType === 3 && f.data === h ? e.push(f) : e.push(document.createTextNode(h));
367
+ }
381
368
  }
382
369
  return l;
383
370
  }
384
371
  function me(e, t, s = null) {
385
- for (let n = 0, l = t.length; n < l; n++)
386
- e.insertBefore(t[n], s);
372
+ for (let n = 0, l = t.length; n < l; n++) e.insertBefore(t[n], s);
387
373
  }
388
374
  function $(e, t, s, n) {
389
- if (s === void 0)
390
- return e.textContent = "";
375
+ if (s === void 0) return e.textContent = "";
391
376
  const l = n || document.createTextNode("");
392
377
  if (t.length) {
393
378
  let r = !1;
@@ -396,11 +381,9 @@ function $(e, t, s, n) {
396
381
  if (l !== o) {
397
382
  const f = o.parentNode === e;
398
383
  !r && !i ? f ? e.replaceChild(l, o) : e.insertBefore(l, s) : f && o.remove();
399
- } else
400
- r = !0;
384
+ } else r = !0;
401
385
  }
402
- } else
403
- e.insertBefore(l, s);
386
+ } else e.insertBefore(l, s);
404
387
  return [l];
405
388
  }
406
389
  function Je(e) {
@@ -511,8 +494,7 @@ function _t({
511
494
  t: m
512
495
  } = Ft(t), Me = async (b) => {
513
496
  try {
514
- if (b.preventDefault(), !M() || !N)
515
- throw new Error("Erreur de recaptcha");
497
+ if (b.preventDefault(), !M() || !N) throw new Error("Erreur de recaptcha");
516
498
  const C = await $t({
517
499
  language: t,
518
500
  name: n(),
@@ -566,8 +548,7 @@ function _t({
566
548
  e && (window.onRecaptchaSubmitted = void 0, window.onRecaptchaExpired = void 0);
567
549
  }), N;
568
550
  function Pe(b) {
569
- if (!b)
570
- return;
551
+ if (!b) return;
571
552
  L(!0);
572
553
  const C = N?.elements.namedItem("g-recaptcha-response");
573
554
  j(C.value);
@@ -579,8 +560,7 @@ function _t({
579
560
  function Tt(e, {
580
561
  language: t
581
562
  }) {
582
- if (!t)
583
- throw new Error("Missing language");
563
+ if (!t) throw new Error("Missing language");
584
564
  const s = e.dataset.recaptchaKey, n = Qe(e.dataset.homeUrl), l = document.createElement("script");
585
565
  l.setAttribute("src", "https://www.google.com/recaptcha/api.js"), document.head.appendChild(l), Ye(() => te(_t, {
586
566
  recaptchaKey: s,