@m4l/layouts 0.0.39 → 0.0.42

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 (2) hide show
  1. package/dist/node_modules.js +198 -383
  2. package/package.json +71 -0
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from "@mui/material/styles";
2
2
  import { Box } from "@mui/material";
3
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
4
4
  import React, { Component, createContext, useContext, forwardRef } from "react";
5
5
  import "@mui/x-date-pickers/AdapterDateFns";
6
6
  import "@mui/x-date-pickers";
@@ -197,345 +197,232 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
197
197
  return true;
198
198
  };
199
199
  function a() {
200
- return a = Object.assign || function(t2) {
200
+ return a = Object.assign || function(t) {
201
201
  for (var e = 1; e < arguments.length; e++) {
202
202
  var r2 = arguments[e];
203
203
  for (var n in r2)
204
- Object.prototype.hasOwnProperty.call(r2, n) && (t2[n] = r2[n]);
204
+ Object.prototype.hasOwnProperty.call(r2, n) && (t[n] = r2[n]);
205
205
  }
206
- return t2;
206
+ return t;
207
207
  }, a.apply(this, arguments);
208
208
  }
209
- function s(t2, e) {
210
- t2.prototype = Object.create(e.prototype), t2.prototype.constructor = t2, c(t2, e);
209
+ function s(t, e) {
210
+ t.prototype = Object.create(e.prototype), t.prototype.constructor = t, c(t, e);
211
211
  }
212
- function c(t2, e) {
213
- return c = Object.setPrototypeOf || function(t3, e2) {
214
- return t3.__proto__ = e2, t3;
215
- }, c(t2, e);
212
+ function c(t, e) {
213
+ return c = Object.setPrototypeOf || function(t2, e2) {
214
+ return t2.__proto__ = e2, t2;
215
+ }, c(t, e);
216
216
  }
217
- function u(t2, e) {
218
- if (t2 == null)
217
+ function u(t, e) {
218
+ if (t == null)
219
219
  return {};
220
- var r2, n, i = {}, o = Object.keys(t2);
220
+ var r2, n, i = {}, o = Object.keys(t);
221
221
  for (n = 0; n < o.length; n++)
222
- e.indexOf(r2 = o[n]) >= 0 || (i[r2] = t2[r2]);
222
+ e.indexOf(r2 = o[n]) >= 0 || (i[r2] = t[r2]);
223
223
  return i;
224
224
  }
225
- var l = {
226
- BASE: "base",
227
- BODY: "body",
228
- HEAD: "head",
229
- HTML: "html",
230
- LINK: "link",
231
- META: "meta",
232
- NOSCRIPT: "noscript",
233
- SCRIPT: "script",
234
- STYLE: "style",
235
- TITLE: "title",
236
- FRAGMENT: "Symbol(react.fragment)"
237
- }, p = {
238
- rel: ["amphtml", "canonical", "alternate"]
239
- }, f = {
240
- type: ["application/ld+json"]
241
- }, d = {
242
- charset: "",
243
- name: ["robots", "description"],
244
- property: ["og:type", "og:title", "og:url", "og:image", "og:image:alt", "og:description", "twitter:url", "twitter:title", "twitter:description", "twitter:image", "twitter:image:alt", "twitter:card", "twitter:site"]
245
- }, h = Object.keys(l).map(function(t2) {
246
- return l[t2];
247
- }), m = {
248
- accesskey: "accessKey",
249
- charset: "charSet",
250
- class: "className",
251
- contenteditable: "contentEditable",
252
- contextmenu: "contextMenu",
253
- "http-equiv": "httpEquiv",
254
- itemprop: "itemProp",
255
- tabindex: "tabIndex"
256
- }, y = Object.keys(m).reduce(function(t2, e) {
257
- return t2[m[e]] = e, t2;
258
- }, {}), T = function(t2, e) {
259
- for (var r2 = t2.length - 1; r2 >= 0; r2 -= 1) {
260
- var n = t2[r2];
225
+ var l = { BASE: "base", BODY: "body", HEAD: "head", HTML: "html", LINK: "link", META: "meta", NOSCRIPT: "noscript", SCRIPT: "script", STYLE: "style", TITLE: "title", FRAGMENT: "Symbol(react.fragment)" }, p = { rel: ["amphtml", "canonical", "alternate"] }, f = { type: ["application/ld+json"] }, d = { charset: "", name: ["robots", "description"], property: ["og:type", "og:title", "og:url", "og:image", "og:image:alt", "og:description", "twitter:url", "twitter:title", "twitter:description", "twitter:image", "twitter:image:alt", "twitter:card", "twitter:site"] }, h = Object.keys(l).map(function(t) {
226
+ return l[t];
227
+ }), m = { accesskey: "accessKey", charset: "charSet", class: "className", contenteditable: "contentEditable", contextmenu: "contextMenu", "http-equiv": "httpEquiv", itemprop: "itemProp", tabindex: "tabIndex" }, y = Object.keys(m).reduce(function(t, e) {
228
+ return t[m[e]] = e, t;
229
+ }, {}), T = function(t, e) {
230
+ for (var r2 = t.length - 1; r2 >= 0; r2 -= 1) {
231
+ var n = t[r2];
261
232
  if (Object.prototype.hasOwnProperty.call(n, e))
262
233
  return n[e];
263
234
  }
264
235
  return null;
265
- }, g = function(t2) {
266
- var e = T(t2, l.TITLE), r2 = T(t2, "titleTemplate");
236
+ }, g = function(t) {
237
+ var e = T(t, l.TITLE), r2 = T(t, "titleTemplate");
267
238
  if (Array.isArray(e) && (e = e.join("")), r2 && e)
268
239
  return r2.replace(/%s/g, function() {
269
240
  return e;
270
241
  });
271
- var n = T(t2, "defaultTitle");
242
+ var n = T(t, "defaultTitle");
272
243
  return e || n || void 0;
273
- }, b = function(t2) {
274
- return T(t2, "onChangeClientState") || function() {
244
+ }, b = function(t) {
245
+ return T(t, "onChangeClientState") || function() {
275
246
  };
276
- }, v = function(t2, e) {
247
+ }, v = function(t, e) {
277
248
  return e.filter(function(e2) {
278
- return e2[t2] !== void 0;
249
+ return e2[t] !== void 0;
279
250
  }).map(function(e2) {
280
- return e2[t2];
281
- }).reduce(function(t3, e2) {
282
- return a({}, t3, e2);
251
+ return e2[t];
252
+ }).reduce(function(t2, e2) {
253
+ return a({}, t2, e2);
283
254
  }, {});
284
- }, A = function(t2, e) {
285
- return e.filter(function(t3) {
286
- return t3[l.BASE] !== void 0;
287
- }).map(function(t3) {
288
- return t3[l.BASE];
255
+ }, A = function(t, e) {
256
+ return e.filter(function(t2) {
257
+ return t2[l.BASE] !== void 0;
258
+ }).map(function(t2) {
259
+ return t2[l.BASE];
289
260
  }).reverse().reduce(function(e2, r2) {
290
261
  if (!e2.length)
291
262
  for (var n = Object.keys(r2), i = 0; i < n.length; i += 1) {
292
263
  var o = n[i].toLowerCase();
293
- if (t2.indexOf(o) !== -1 && r2[o])
264
+ if (t.indexOf(o) !== -1 && r2[o])
294
265
  return e2.concat(r2);
295
266
  }
296
267
  return e2;
297
268
  }, []);
298
- }, C = function(t2, e, r2) {
269
+ }, C = function(t, e, r2) {
299
270
  var n = {};
300
271
  return r2.filter(function(e2) {
301
- return !!Array.isArray(e2[t2]) || (e2[t2] !== void 0 && console && typeof console.warn == "function" && console.warn("Helmet: " + t2 + ' should be of type "Array". Instead found type "' + typeof e2[t2] + '"'), false);
272
+ return !!Array.isArray(e2[t]) || (e2[t] !== void 0 && console && typeof console.warn == "function" && console.warn("Helmet: " + t + ' should be of type "Array". Instead found type "' + typeof e2[t] + '"'), false);
302
273
  }).map(function(e2) {
303
- return e2[t2];
304
- }).reverse().reduce(function(t3, r3) {
274
+ return e2[t];
275
+ }).reverse().reduce(function(t2, r3) {
305
276
  var i = {};
306
- r3.filter(function(t4) {
307
- for (var r4, o2 = Object.keys(t4), a2 = 0; a2 < o2.length; a2 += 1) {
277
+ r3.filter(function(t3) {
278
+ for (var r4, o2 = Object.keys(t3), a2 = 0; a2 < o2.length; a2 += 1) {
308
279
  var s3 = o2[a2], c3 = s3.toLowerCase();
309
- e.indexOf(c3) === -1 || r4 === "rel" && t4[r4].toLowerCase() === "canonical" || c3 === "rel" && t4[c3].toLowerCase() === "stylesheet" || (r4 = c3), e.indexOf(s3) === -1 || s3 !== "innerHTML" && s3 !== "cssText" && s3 !== "itemprop" || (r4 = s3);
280
+ e.indexOf(c3) === -1 || r4 === "rel" && t3[r4].toLowerCase() === "canonical" || c3 === "rel" && t3[c3].toLowerCase() === "stylesheet" || (r4 = c3), e.indexOf(s3) === -1 || s3 !== "innerHTML" && s3 !== "cssText" && s3 !== "itemprop" || (r4 = s3);
310
281
  }
311
- if (!r4 || !t4[r4])
282
+ if (!r4 || !t3[r4])
312
283
  return false;
313
- var u3 = t4[r4].toLowerCase();
284
+ var u3 = t3[r4].toLowerCase();
314
285
  return n[r4] || (n[r4] = {}), i[r4] || (i[r4] = {}), !n[r4][u3] && (i[r4][u3] = true, true);
315
286
  }).reverse().forEach(function(e2) {
316
- return t3.push(e2);
287
+ return t2.push(e2);
317
288
  });
318
289
  for (var o = Object.keys(i), s2 = 0; s2 < o.length; s2 += 1) {
319
290
  var c2 = o[s2], u2 = a({}, n[c2], i[c2]);
320
291
  n[c2] = u2;
321
292
  }
322
- return t3;
293
+ return t2;
323
294
  }, []).reverse();
324
- }, O = function(t2, e) {
325
- if (Array.isArray(t2) && t2.length) {
326
- for (var r2 = 0; r2 < t2.length; r2 += 1)
327
- if (t2[r2][e])
295
+ }, O = function(t, e) {
296
+ if (Array.isArray(t) && t.length) {
297
+ for (var r2 = 0; r2 < t.length; r2 += 1)
298
+ if (t[r2][e])
328
299
  return true;
329
300
  }
330
301
  return false;
331
- }, S = function(t2) {
332
- return Array.isArray(t2) ? t2.join("") : t2;
333
- }, E = function(t2, e) {
334
- return Array.isArray(t2) ? t2.reduce(function(t3, r2) {
335
- return function(t4, e2) {
336
- for (var r3 = Object.keys(t4), n = 0; n < r3.length; n += 1)
337
- if (e2[r3[n]] && e2[r3[n]].includes(t4[r3[n]]))
302
+ }, S = function(t) {
303
+ return Array.isArray(t) ? t.join("") : t;
304
+ }, E = function(t, e) {
305
+ return Array.isArray(t) ? t.reduce(function(t2, r2) {
306
+ return function(t3, e2) {
307
+ for (var r3 = Object.keys(t3), n = 0; n < r3.length; n += 1)
308
+ if (e2[r3[n]] && e2[r3[n]].includes(t3[r3[n]]))
338
309
  return true;
339
310
  return false;
340
- }(r2, e) ? t3.priority.push(r2) : t3.default.push(r2), t3;
341
- }, {
342
- priority: [],
343
- default: []
344
- }) : {
345
- default: t2
346
- };
347
- }, I = function(t2, e) {
311
+ }(r2, e) ? t2.priority.push(r2) : t2.default.push(r2), t2;
312
+ }, { priority: [], default: [] }) : { default: t };
313
+ }, I = function(t, e) {
348
314
  var r2;
349
- return a({}, t2, ((r2 = {})[e] = void 0, r2));
350
- }, P = [l.NOSCRIPT, l.SCRIPT, l.STYLE], w = function(t2, e) {
351
- return e === void 0 && (e = true), e === false ? String(t2) : String(t2).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
352
- }, x = function(t2) {
353
- return Object.keys(t2).reduce(function(e, r2) {
354
- var n = t2[r2] !== void 0 ? r2 + '="' + t2[r2] + '"' : "" + r2;
315
+ return a({}, t, ((r2 = {})[e] = void 0, r2));
316
+ }, P = [l.NOSCRIPT, l.SCRIPT, l.STYLE], w = function(t, e) {
317
+ return e === void 0 && (e = true), e === false ? String(t) : String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
318
+ }, x = function(t) {
319
+ return Object.keys(t).reduce(function(e, r2) {
320
+ var n = t[r2] !== void 0 ? r2 + '="' + t[r2] + '"' : "" + r2;
355
321
  return e ? e + " " + n : n;
356
322
  }, "");
357
- }, L = function(t2, e) {
358
- return e === void 0 && (e = {}), Object.keys(t2).reduce(function(e2, r2) {
359
- return e2[m[r2] || r2] = t2[r2], e2;
323
+ }, L = function(t, e) {
324
+ return e === void 0 && (e = {}), Object.keys(t).reduce(function(e2, r2) {
325
+ return e2[m[r2] || r2] = t[r2], e2;
360
326
  }, e);
361
327
  }, j = function(e, r2) {
362
328
  return r2.map(function(r3, n) {
363
- var i, o = ((i = {
364
- key: n
365
- })["data-rh"] = true, i);
366
- return Object.keys(r3).forEach(function(t2) {
367
- var e2 = m[t2] || t2;
368
- e2 === "innerHTML" || e2 === "cssText" ? o.dangerouslySetInnerHTML = {
369
- __html: r3.innerHTML || r3.cssText
370
- } : o[e2] = r3[t2];
329
+ var i, o = ((i = { key: n })["data-rh"] = true, i);
330
+ return Object.keys(r3).forEach(function(t) {
331
+ var e2 = m[t] || t;
332
+ e2 === "innerHTML" || e2 === "cssText" ? o.dangerouslySetInnerHTML = { __html: r3.innerHTML || r3.cssText } : o[e2] = r3[t];
371
333
  }), React.createElement(e, o);
372
334
  });
373
335
  }, M = function(e, r2, n) {
374
336
  switch (e) {
375
337
  case l.TITLE:
376
- return {
377
- toComponent: function() {
378
- return n2 = r2.titleAttributes, (i = {
379
- key: e2 = r2.title
380
- })["data-rh"] = true, o = L(n2, i), [React.createElement(l.TITLE, o, e2)];
381
- var e2, n2, i, o;
382
- },
383
- toString: function() {
384
- return function(t2, e2, r3, n2) {
385
- var i = x(r3), o = S(e2);
386
- return i ? "<" + t2 + ' data-rh="true" ' + i + ">" + w(o, n2) + "</" + t2 + ">" : "<" + t2 + ' data-rh="true">' + w(o, n2) + "</" + t2 + ">";
387
- }(e, r2.title, r2.titleAttributes, n);
388
- }
389
- };
338
+ return { toComponent: function() {
339
+ return n2 = r2.titleAttributes, (i = { key: e2 = r2.title })["data-rh"] = true, o = L(n2, i), [React.createElement(l.TITLE, o, e2)];
340
+ var e2, n2, i, o;
341
+ }, toString: function() {
342
+ return function(t, e2, r3, n2) {
343
+ var i = x(r3), o = S(e2);
344
+ return i ? "<" + t + ' data-rh="true" ' + i + ">" + w(o, n2) + "</" + t + ">" : "<" + t + ' data-rh="true">' + w(o, n2) + "</" + t + ">";
345
+ }(e, r2.title, r2.titleAttributes, n);
346
+ } };
390
347
  case "bodyAttributes":
391
348
  case "htmlAttributes":
392
- return {
393
- toComponent: function() {
394
- return L(r2);
395
- },
396
- toString: function() {
397
- return x(r2);
398
- }
399
- };
349
+ return { toComponent: function() {
350
+ return L(r2);
351
+ }, toString: function() {
352
+ return x(r2);
353
+ } };
400
354
  default:
401
- return {
402
- toComponent: function() {
403
- return j(e, r2);
404
- },
405
- toString: function() {
406
- return function(t2, e2, r3) {
407
- return e2.reduce(function(e3, n2) {
408
- var i = Object.keys(n2).filter(function(t3) {
409
- return !(t3 === "innerHTML" || t3 === "cssText");
410
- }).reduce(function(t3, e4) {
411
- var i2 = n2[e4] === void 0 ? e4 : e4 + '="' + w(n2[e4], r3) + '"';
412
- return t3 ? t3 + " " + i2 : i2;
413
- }, ""), o = n2.innerHTML || n2.cssText || "", a2 = P.indexOf(t2) === -1;
414
- return e3 + "<" + t2 + ' data-rh="true" ' + i + (a2 ? "/>" : ">" + o + "</" + t2 + ">");
415
- }, "");
416
- }(e, r2, n);
417
- }
418
- };
355
+ return { toComponent: function() {
356
+ return j(e, r2);
357
+ }, toString: function() {
358
+ return function(t, e2, r3) {
359
+ return e2.reduce(function(e3, n2) {
360
+ var i = Object.keys(n2).filter(function(t2) {
361
+ return !(t2 === "innerHTML" || t2 === "cssText");
362
+ }).reduce(function(t2, e4) {
363
+ var i2 = n2[e4] === void 0 ? e4 : e4 + '="' + w(n2[e4], r3) + '"';
364
+ return t2 ? t2 + " " + i2 : i2;
365
+ }, ""), o = n2.innerHTML || n2.cssText || "", a2 = P.indexOf(t) === -1;
366
+ return e3 + "<" + t + ' data-rh="true" ' + i + (a2 ? "/>" : ">" + o + "</" + t + ">");
367
+ }, "");
368
+ }(e, r2, n);
369
+ } };
419
370
  }
420
- }, k = function(t2) {
421
- var e = t2.baseTag, r2 = t2.bodyAttributes, n = t2.encode, i = t2.htmlAttributes, o = t2.noscriptTags, a2 = t2.styleTags, s2 = t2.title, c2 = s2 === void 0 ? "" : s2, u2 = t2.titleAttributes, h2 = t2.linkTags, m2 = t2.metaTags, y2 = t2.scriptTags, T2 = {
422
- toComponent: function() {
423
- },
424
- toString: function() {
425
- return "";
426
- }
427
- };
428
- if (t2.prioritizeSeoTags) {
429
- var g2 = function(t3) {
430
- var e2 = t3.linkTags, r3 = t3.scriptTags, n2 = t3.encode, i2 = E(t3.metaTags, d), o2 = E(e2, p), a3 = E(r3, f);
431
- return {
432
- priorityMethods: {
433
- toComponent: function() {
434
- return [].concat(j(l.META, i2.priority), j(l.LINK, o2.priority), j(l.SCRIPT, a3.priority));
435
- },
436
- toString: function() {
437
- return M(l.META, i2.priority, n2) + " " + M(l.LINK, o2.priority, n2) + " " + M(l.SCRIPT, a3.priority, n2);
438
- }
439
- },
440
- metaTags: i2.default,
441
- linkTags: o2.default,
442
- scriptTags: a3.default
443
- };
444
- }(t2);
371
+ }, k = function(t) {
372
+ var e = t.baseTag, r2 = t.bodyAttributes, n = t.encode, i = t.htmlAttributes, o = t.noscriptTags, a2 = t.styleTags, s2 = t.title, c2 = s2 === void 0 ? "" : s2, u2 = t.titleAttributes, h2 = t.linkTags, m2 = t.metaTags, y2 = t.scriptTags, T2 = { toComponent: function() {
373
+ }, toString: function() {
374
+ return "";
375
+ } };
376
+ if (t.prioritizeSeoTags) {
377
+ var g2 = function(t2) {
378
+ var e2 = t2.linkTags, r3 = t2.scriptTags, n2 = t2.encode, i2 = E(t2.metaTags, d), o2 = E(e2, p), a3 = E(r3, f);
379
+ return { priorityMethods: { toComponent: function() {
380
+ return [].concat(j(l.META, i2.priority), j(l.LINK, o2.priority), j(l.SCRIPT, a3.priority));
381
+ }, toString: function() {
382
+ return M(l.META, i2.priority, n2) + " " + M(l.LINK, o2.priority, n2) + " " + M(l.SCRIPT, a3.priority, n2);
383
+ } }, metaTags: i2.default, linkTags: o2.default, scriptTags: a3.default };
384
+ }(t);
445
385
  T2 = g2.priorityMethods, h2 = g2.linkTags, m2 = g2.metaTags, y2 = g2.scriptTags;
446
386
  }
447
- return {
448
- priority: T2,
449
- base: M(l.BASE, e, n),
450
- bodyAttributes: M("bodyAttributes", r2, n),
451
- htmlAttributes: M("htmlAttributes", i, n),
452
- link: M(l.LINK, h2, n),
453
- meta: M(l.META, m2, n),
454
- noscript: M(l.NOSCRIPT, o, n),
455
- script: M(l.SCRIPT, y2, n),
456
- style: M(l.STYLE, a2, n),
457
- title: M(l.TITLE, {
458
- title: c2,
459
- titleAttributes: u2
460
- }, n)
461
- };
462
- }, H = [], N = function(t2, e) {
387
+ return { priority: T2, base: M(l.BASE, e, n), bodyAttributes: M("bodyAttributes", r2, n), htmlAttributes: M("htmlAttributes", i, n), link: M(l.LINK, h2, n), meta: M(l.META, m2, n), noscript: M(l.NOSCRIPT, o, n), script: M(l.SCRIPT, y2, n), style: M(l.STYLE, a2, n), title: M(l.TITLE, { title: c2, titleAttributes: u2 }, n) };
388
+ }, H = [], N = function(t, e) {
463
389
  var r2 = this;
464
- e === void 0 && (e = typeof document != "undefined"), this.instances = [], this.value = {
465
- setHelmet: function(t3) {
466
- r2.context.helmet = t3;
467
- },
468
- helmetInstances: {
469
- get: function() {
470
- return r2.canUseDOM ? H : r2.instances;
471
- },
472
- add: function(t3) {
473
- (r2.canUseDOM ? H : r2.instances).push(t3);
474
- },
475
- remove: function(t3) {
476
- var e2 = (r2.canUseDOM ? H : r2.instances).indexOf(t3);
477
- (r2.canUseDOM ? H : r2.instances).splice(e2, 1);
478
- }
479
- }
480
- }, this.context = t2, this.canUseDOM = e, e || (t2.helmet = k({
481
- baseTag: [],
482
- bodyAttributes: {},
483
- encodeSpecialCharacters: true,
484
- htmlAttributes: {},
485
- linkTags: [],
486
- metaTags: [],
487
- noscriptTags: [],
488
- scriptTags: [],
489
- styleTags: [],
490
- title: "",
491
- titleAttributes: {}
492
- }));
493
- }, R = React.createContext({}), D = r.shape({
494
- setHelmet: r.func,
495
- helmetInstances: r.shape({
496
- get: r.func,
497
- add: r.func,
498
- remove: r.func
499
- })
500
- }), U = typeof document != "undefined", q = /* @__PURE__ */ function(e) {
501
- function r2(t2) {
390
+ e === void 0 && (e = typeof document != "undefined"), this.instances = [], this.value = { setHelmet: function(t2) {
391
+ r2.context.helmet = t2;
392
+ }, helmetInstances: { get: function() {
393
+ return r2.canUseDOM ? H : r2.instances;
394
+ }, add: function(t2) {
395
+ (r2.canUseDOM ? H : r2.instances).push(t2);
396
+ }, remove: function(t2) {
397
+ var e2 = (r2.canUseDOM ? H : r2.instances).indexOf(t2);
398
+ (r2.canUseDOM ? H : r2.instances).splice(e2, 1);
399
+ } } }, this.context = t, this.canUseDOM = e, e || (t.helmet = k({ baseTag: [], bodyAttributes: {}, encodeSpecialCharacters: true, htmlAttributes: {}, linkTags: [], metaTags: [], noscriptTags: [], scriptTags: [], styleTags: [], title: "", titleAttributes: {} }));
400
+ }, R = React.createContext({}), D = r.shape({ setHelmet: r.func, helmetInstances: r.shape({ get: r.func, add: r.func, remove: r.func }) }), U = typeof document != "undefined", q = /* @__PURE__ */ function(e) {
401
+ function r2(t) {
502
402
  var n;
503
- return (n = e.call(this, t2) || this).helmetData = new N(n.props.context, r2.canUseDOM), n;
403
+ return (n = e.call(this, t) || this).helmetData = new N(n.props.context, r2.canUseDOM), n;
504
404
  }
505
405
  return s(r2, e), r2.prototype.render = function() {
506
- return /* @__PURE__ */ jsx(R.Provider, {
507
- value: this.helmetData.value,
508
- children: this.props.children
509
- });
406
+ return React.createElement(R.Provider, { value: this.helmetData.value }, this.props.children);
510
407
  }, r2;
511
408
  }(Component);
512
- q.canUseDOM = U, q.propTypes = {
513
- context: r.shape({
514
- helmet: r.shape()
515
- }),
516
- children: r.node.isRequired
517
- }, q.defaultProps = {
518
- context: {}
519
- }, q.displayName = "HelmetProvider";
520
- var Y = function(t2, e) {
521
- var r2, n = document.head || document.querySelector(l.HEAD), i = n.querySelectorAll(t2 + "[data-rh]"), o = [].slice.call(i), a2 = [];
409
+ q.canUseDOM = U, q.propTypes = { context: r.shape({ helmet: r.shape() }), children: r.node.isRequired }, q.defaultProps = { context: {} }, q.displayName = "HelmetProvider";
410
+ var Y = function(t, e) {
411
+ var r2, n = document.head || document.querySelector(l.HEAD), i = n.querySelectorAll(t + "[data-rh]"), o = [].slice.call(i), a2 = [];
522
412
  return e && e.length && e.forEach(function(e2) {
523
- var n2 = document.createElement(t2);
413
+ var n2 = document.createElement(t);
524
414
  for (var i2 in e2)
525
415
  Object.prototype.hasOwnProperty.call(e2, i2) && (i2 === "innerHTML" ? n2.innerHTML = e2.innerHTML : i2 === "cssText" ? n2.styleSheet ? n2.styleSheet.cssText = e2.cssText : n2.appendChild(document.createTextNode(e2.cssText)) : n2.setAttribute(i2, e2[i2] === void 0 ? "" : e2[i2]));
526
- n2.setAttribute("data-rh", "true"), o.some(function(t3, e3) {
527
- return r2 = e3, n2.isEqualNode(t3);
416
+ n2.setAttribute("data-rh", "true"), o.some(function(t2, e3) {
417
+ return r2 = e3, n2.isEqualNode(t2);
528
418
  }) ? o.splice(r2, 1) : a2.push(n2);
529
- }), o.forEach(function(t3) {
530
- return t3.parentNode.removeChild(t3);
531
- }), a2.forEach(function(t3) {
532
- return n.appendChild(t3);
533
- }), {
534
- oldTags: o,
535
- newTags: a2
536
- };
537
- }, B = function(t2, e) {
538
- var r2 = document.getElementsByTagName(t2)[0];
419
+ }), o.forEach(function(t2) {
420
+ return t2.parentNode.removeChild(t2);
421
+ }), a2.forEach(function(t2) {
422
+ return n.appendChild(t2);
423
+ }), { oldTags: o, newTags: a2 };
424
+ }, B = function(t, e) {
425
+ var r2 = document.getElementsByTagName(t)[0];
539
426
  if (r2) {
540
427
  for (var n = r2.getAttribute("data-rh"), i = n ? n.split(",") : [], o = [].concat(i), a2 = Object.keys(e), s2 = 0; s2 < a2.length; s2 += 1) {
541
428
  var c2 = a2[s2], u2 = e[c2] || "";
@@ -547,57 +434,35 @@ var Y = function(t2, e) {
547
434
  r2.removeAttribute(o[p2]);
548
435
  i.length === o.length ? r2.removeAttribute("data-rh") : r2.getAttribute("data-rh") !== a2.join(",") && r2.setAttribute("data-rh", a2.join(","));
549
436
  }
550
- }, K = function(t2, e) {
551
- var r2 = t2.baseTag, n = t2.htmlAttributes, i = t2.linkTags, o = t2.metaTags, a2 = t2.noscriptTags, s2 = t2.onChangeClientState, c2 = t2.scriptTags, u2 = t2.styleTags, p2 = t2.title, f2 = t2.titleAttributes;
552
- B(l.BODY, t2.bodyAttributes), B(l.HTML, n), function(t3, e2) {
553
- t3 !== void 0 && document.title !== t3 && (document.title = S(t3)), B(l.TITLE, e2);
437
+ }, K = function(t, e) {
438
+ var r2 = t.baseTag, n = t.htmlAttributes, i = t.linkTags, o = t.metaTags, a2 = t.noscriptTags, s2 = t.onChangeClientState, c2 = t.scriptTags, u2 = t.styleTags, p2 = t.title, f2 = t.titleAttributes;
439
+ B(l.BODY, t.bodyAttributes), B(l.HTML, n), function(t2, e2) {
440
+ t2 !== void 0 && document.title !== t2 && (document.title = S(t2)), B(l.TITLE, e2);
554
441
  }(p2, f2);
555
- var d2 = {
556
- baseTag: Y(l.BASE, r2),
557
- linkTags: Y(l.LINK, i),
558
- metaTags: Y(l.META, o),
559
- noscriptTags: Y(l.NOSCRIPT, a2),
560
- scriptTags: Y(l.SCRIPT, c2),
561
- styleTags: Y(l.STYLE, u2)
562
- }, h2 = {}, m2 = {};
563
- Object.keys(d2).forEach(function(t3) {
564
- var e2 = d2[t3], r3 = e2.newTags, n2 = e2.oldTags;
565
- r3.length && (h2[t3] = r3), n2.length && (m2[t3] = d2[t3].oldTags);
566
- }), e && e(), s2(t2, h2, m2);
567
- }, _ = null, z = /* @__PURE__ */ function(t2) {
442
+ var d2 = { baseTag: Y(l.BASE, r2), linkTags: Y(l.LINK, i), metaTags: Y(l.META, o), noscriptTags: Y(l.NOSCRIPT, a2), scriptTags: Y(l.SCRIPT, c2), styleTags: Y(l.STYLE, u2) }, h2 = {}, m2 = {};
443
+ Object.keys(d2).forEach(function(t2) {
444
+ var e2 = d2[t2], r3 = e2.newTags, n2 = e2.oldTags;
445
+ r3.length && (h2[t2] = r3), n2.length && (m2[t2] = d2[t2].oldTags);
446
+ }), e && e(), s2(t, h2, m2);
447
+ }, _ = null, z = /* @__PURE__ */ function(t) {
568
448
  function e() {
569
449
  for (var e2, r3 = arguments.length, n = new Array(r3), i = 0; i < r3; i++)
570
450
  n[i] = arguments[i];
571
- return (e2 = t2.call.apply(t2, [this].concat(n)) || this).rendered = false, e2;
451
+ return (e2 = t.call.apply(t, [this].concat(n)) || this).rendered = false, e2;
572
452
  }
573
- s(e, t2);
453
+ s(e, t);
574
454
  var r2 = e.prototype;
575
- return r2.shouldComponentUpdate = function(t3) {
576
- return !shallowequal(t3, this.props);
455
+ return r2.shouldComponentUpdate = function(t2) {
456
+ return !shallowequal(t2, this.props);
577
457
  }, r2.componentDidUpdate = function() {
578
458
  this.emitChange();
579
459
  }, r2.componentWillUnmount = function() {
580
460
  this.props.context.helmetInstances.remove(this), this.emitChange();
581
461
  }, r2.emitChange = function() {
582
- var t3, e2, r3 = this.props.context, n = r3.setHelmet, i = null, o = (t3 = r3.helmetInstances.get().map(function(t4) {
583
- var e3 = a({}, t4.props);
462
+ var t2, e2, r3 = this.props.context, n = r3.setHelmet, i = null, o = (t2 = r3.helmetInstances.get().map(function(t3) {
463
+ var e3 = a({}, t3.props);
584
464
  return delete e3.context, e3;
585
- }), {
586
- baseTag: A(["href"], t3),
587
- bodyAttributes: v("bodyAttributes", t3),
588
- defer: T(t3, "defer"),
589
- encode: T(t3, "encodeSpecialCharacters"),
590
- htmlAttributes: v("htmlAttributes", t3),
591
- linkTags: C(l.LINK, ["rel", "href"], t3),
592
- metaTags: C(l.META, ["name", "charset", "http-equiv", "property", "itemprop"], t3),
593
- noscriptTags: C(l.NOSCRIPT, ["innerHTML"], t3),
594
- onChangeClientState: b(t3),
595
- scriptTags: C(l.SCRIPT, ["src", "innerHTML"], t3),
596
- styleTags: C(l.STYLE, ["cssText"], t3),
597
- title: g(t3),
598
- titleAttributes: v("titleAttributes", t3),
599
- prioritizeSeoTags: O(t3, "prioritizeSeoTags")
600
- });
465
+ }), { baseTag: A(["href"], t2), bodyAttributes: v("bodyAttributes", t2), defer: T(t2, "defer"), encode: T(t2, "encodeSpecialCharacters"), htmlAttributes: v("htmlAttributes", t2), linkTags: C(l.LINK, ["rel", "href"], t2), metaTags: C(l.META, ["name", "charset", "http-equiv", "property", "itemprop"], t2), noscriptTags: C(l.NOSCRIPT, ["innerHTML"], t2), onChangeClientState: b(t2), scriptTags: C(l.SCRIPT, ["src", "innerHTML"], t2), styleTags: C(l.STYLE, ["cssText"], t2), title: g(t2), titleAttributes: v("titleAttributes", t2), prioritizeSeoTags: O(t2, "prioritizeSeoTags") });
601
466
  q.canUseDOM ? (e2 = o, _ && cancelAnimationFrame(_), e2.defer ? _ = requestAnimationFrame(function() {
602
467
  K(e2, function() {
603
468
  _ = null;
@@ -609,72 +474,62 @@ var Y = function(t2, e) {
609
474
  return this.init(), null;
610
475
  }, e;
611
476
  }(Component);
612
- z.propTypes = {
613
- context: D.isRequired
614
- }, z.displayName = "HelmetDispatcher";
477
+ z.propTypes = { context: D.isRequired }, z.displayName = "HelmetDispatcher";
615
478
  var F = ["children"], G = ["children"], W = /* @__PURE__ */ function(e) {
616
479
  function r2() {
617
480
  return e.apply(this, arguments) || this;
618
481
  }
619
482
  s(r2, e);
620
483
  var o = r2.prototype;
621
- return o.shouldComponentUpdate = function(t2) {
622
- return !reactFastCompare(I(this.props, "helmetData"), I(t2, "helmetData"));
623
- }, o.mapNestedChildrenToProps = function(t2, e2) {
484
+ return o.shouldComponentUpdate = function(t) {
485
+ return !reactFastCompare(I(this.props, "helmetData"), I(t, "helmetData"));
486
+ }, o.mapNestedChildrenToProps = function(t, e2) {
624
487
  if (!e2)
625
488
  return null;
626
- switch (t2.type) {
489
+ switch (t.type) {
627
490
  case l.SCRIPT:
628
491
  case l.NOSCRIPT:
629
- return {
630
- innerHTML: e2
631
- };
492
+ return { innerHTML: e2 };
632
493
  case l.STYLE:
633
- return {
634
- cssText: e2
635
- };
494
+ return { cssText: e2 };
636
495
  default:
637
- throw new Error("<" + t2.type + " /> elements are self-closing and can not contain children. Refer to our API for more information.");
496
+ throw new Error("<" + t.type + " /> elements are self-closing and can not contain children. Refer to our API for more information.");
638
497
  }
639
- }, o.flattenArrayTypeChildren = function(t2) {
640
- var e2, r3 = t2.child, n = t2.arrayTypeChildren;
641
- return a({}, n, ((e2 = {})[r3.type] = [].concat(n[r3.type] || [], [a({}, t2.newChildProps, this.mapNestedChildrenToProps(r3, t2.nestedChildren))]), e2));
642
- }, o.mapObjectTypeChildren = function(t2) {
643
- var e2, r3, n = t2.child, i = t2.newProps, o2 = t2.newChildProps, s2 = t2.nestedChildren;
498
+ }, o.flattenArrayTypeChildren = function(t) {
499
+ var e2, r3 = t.child, n = t.arrayTypeChildren;
500
+ return a({}, n, ((e2 = {})[r3.type] = [].concat(n[r3.type] || [], [a({}, t.newChildProps, this.mapNestedChildrenToProps(r3, t.nestedChildren))]), e2));
501
+ }, o.mapObjectTypeChildren = function(t) {
502
+ var e2, r3, n = t.child, i = t.newProps, o2 = t.newChildProps, s2 = t.nestedChildren;
644
503
  switch (n.type) {
645
504
  case l.TITLE:
646
505
  return a({}, i, ((e2 = {})[n.type] = s2, e2.titleAttributes = a({}, o2), e2));
647
506
  case l.BODY:
648
- return a({}, i, {
649
- bodyAttributes: a({}, o2)
650
- });
507
+ return a({}, i, { bodyAttributes: a({}, o2) });
651
508
  case l.HTML:
652
- return a({}, i, {
653
- htmlAttributes: a({}, o2)
654
- });
509
+ return a({}, i, { htmlAttributes: a({}, o2) });
655
510
  default:
656
511
  return a({}, i, ((r3 = {})[n.type] = a({}, o2), r3));
657
512
  }
658
- }, o.mapArrayTypeChildrenToProps = function(t2, e2) {
513
+ }, o.mapArrayTypeChildrenToProps = function(t, e2) {
659
514
  var r3 = a({}, e2);
660
- return Object.keys(t2).forEach(function(e3) {
515
+ return Object.keys(t).forEach(function(e3) {
661
516
  var n;
662
- r3 = a({}, r3, ((n = {})[e3] = t2[e3], n));
517
+ r3 = a({}, r3, ((n = {})[e3] = t[e3], n));
663
518
  }), r3;
664
- }, o.warnOnInvalidChildren = function(t2, e2) {
519
+ }, o.warnOnInvalidChildren = function(t, e2) {
665
520
  return browser(h.some(function(e3) {
666
- return t2.type === e3;
667
- }), typeof t2.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : "Only elements types " + h.join(", ") + " are allowed. Helmet does not support rendering <" + t2.type + "> elements. Refer to our API for more information."), browser(!e2 || typeof e2 == "string" || Array.isArray(e2) && !e2.some(function(t3) {
668
- return typeof t3 != "string";
669
- }), "Helmet expects a string as a child of <" + t2.type + ">. Did you forget to wrap your children in braces? ( <" + t2.type + ">{``}</" + t2.type + "> ) Refer to our API for more information."), true;
521
+ return t.type === e3;
522
+ }), typeof t.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : "Only elements types " + h.join(", ") + " are allowed. Helmet does not support rendering <" + t.type + "> elements. Refer to our API for more information."), browser(!e2 || typeof e2 == "string" || Array.isArray(e2) && !e2.some(function(t2) {
523
+ return typeof t2 != "string";
524
+ }), "Helmet expects a string as a child of <" + t.type + ">. Did you forget to wrap your children in braces? ( <" + t.type + ">{``}</" + t.type + "> ) Refer to our API for more information."), true;
670
525
  }, o.mapChildrenToProps = function(e2, r3) {
671
526
  var n = this, i = {};
672
- return React.Children.forEach(e2, function(t2) {
673
- if (t2 && t2.props) {
674
- var e3 = t2.props, o2 = e3.children, a2 = u(e3, F), s2 = Object.keys(a2).reduce(function(t3, e4) {
675
- return t3[y[e4] || e4] = a2[e4], t3;
676
- }, {}), c2 = t2.type;
677
- switch (typeof c2 == "symbol" ? c2 = c2.toString() : n.warnOnInvalidChildren(t2, o2), c2) {
527
+ return React.Children.forEach(e2, function(t) {
528
+ if (t && t.props) {
529
+ var e3 = t.props, o2 = e3.children, a2 = u(e3, F), s2 = Object.keys(a2).reduce(function(t2, e4) {
530
+ return t2[y[e4] || e4] = a2[e4], t2;
531
+ }, {}), c2 = t.type;
532
+ switch (typeof c2 == "symbol" ? c2 = c2.toString() : n.warnOnInvalidChildren(t, o2), c2) {
678
533
  case l.FRAGMENT:
679
534
  r3 = n.mapChildrenToProps(o2, r3);
680
535
  break;
@@ -683,61 +538,21 @@ var F = ["children"], G = ["children"], W = /* @__PURE__ */ function(e) {
683
538
  case l.NOSCRIPT:
684
539
  case l.SCRIPT:
685
540
  case l.STYLE:
686
- i = n.flattenArrayTypeChildren({
687
- child: t2,
688
- arrayTypeChildren: i,
689
- newChildProps: s2,
690
- nestedChildren: o2
691
- });
541
+ i = n.flattenArrayTypeChildren({ child: t, arrayTypeChildren: i, newChildProps: s2, nestedChildren: o2 });
692
542
  break;
693
543
  default:
694
- r3 = n.mapObjectTypeChildren({
695
- child: t2,
696
- newProps: r3,
697
- newChildProps: s2,
698
- nestedChildren: o2
699
- });
544
+ r3 = n.mapObjectTypeChildren({ child: t, newProps: r3, newChildProps: s2, nestedChildren: o2 });
700
545
  }
701
546
  }
702
547
  }), this.mapArrayTypeChildrenToProps(i, r3);
703
548
  }, o.render = function() {
704
549
  var e2 = this.props, r3 = e2.children, n = u(e2, G), i = a({}, n), o2 = n.helmetData;
705
- return r3 && (i = this.mapChildrenToProps(r3, i)), !o2 || o2 instanceof N || (o2 = new N(o2.context, o2.instances)), o2 ? /* @__PURE__ */ React.createElement(z, a({}, i, {
706
- context: o2.value,
707
- helmetData: void 0
708
- })) : /* @__PURE__ */ jsx(R.Consumer, {
709
- children: function(e3) {
710
- return React.createElement(z, a({}, i, {
711
- context: e3
712
- }));
713
- }
550
+ return r3 && (i = this.mapChildrenToProps(r3, i)), !o2 || o2 instanceof N || (o2 = new N(o2.context, o2.instances)), o2 ? /* @__PURE__ */ React.createElement(z, a({}, i, { context: o2.value, helmetData: void 0 })) : /* @__PURE__ */ React.createElement(R.Consumer, null, function(e3) {
551
+ return React.createElement(z, a({}, i, { context: e3 }));
714
552
  });
715
553
  }, r2;
716
554
  }(Component);
717
- W.propTypes = {
718
- base: r.object,
719
- bodyAttributes: r.object,
720
- children: r.oneOfType([r.arrayOf(r.node), r.node]),
721
- defaultTitle: r.string,
722
- defer: r.bool,
723
- encodeSpecialCharacters: r.bool,
724
- htmlAttributes: r.object,
725
- link: r.arrayOf(r.object),
726
- meta: r.arrayOf(r.object),
727
- noscript: r.arrayOf(r.object),
728
- onChangeClientState: r.func,
729
- script: r.arrayOf(r.object),
730
- style: r.arrayOf(r.object),
731
- title: r.string,
732
- titleAttributes: r.object,
733
- titleTemplate: r.string,
734
- prioritizeSeoTags: r.bool,
735
- helmetData: r.object
736
- }, W.defaultProps = {
737
- defer: true,
738
- encodeSpecialCharacters: true,
739
- prioritizeSeoTags: false
740
- }, W.displayName = "Helmet";
555
+ W.propTypes = { base: r.object, bodyAttributes: r.object, children: r.oneOfType([r.arrayOf(r.node), r.node]), defaultTitle: r.string, defer: r.bool, encodeSpecialCharacters: r.bool, htmlAttributes: r.object, link: r.arrayOf(r.object), meta: r.arrayOf(r.object), noscript: r.arrayOf(r.object), onChangeClientState: r.func, script: r.arrayOf(r.object), style: r.arrayOf(r.object), title: r.string, titleAttributes: r.object, titleTemplate: r.string, prioritizeSeoTags: r.bool, helmetData: r.object }, W.defaultProps = { defer: true, encodeSpecialCharacters: true, prioritizeSeoTags: false }, W.displayName = "Helmet";
741
556
  const LocalesContext = createContext(null);
742
557
  const useLocales = () => {
743
558
  const context = useContext(LocalesContext);
package/package.json CHANGED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@m4l/layouts",
3
+ "private": false,
4
+ "version": "0.0.42",
5
+ "license": "UNLICENSED",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview",
10
+ "lint": "npx eslint src",
11
+ "lint:fix": "npm run lint -- --fix",
12
+ "prettier": "npx prettier src --check",
13
+ "prettier:fix": "npm run prettier -- --write",
14
+ "format": "npm run prettier:fix && npm run lint:fix"
15
+ },
16
+ "dependencies": {
17
+ "@m4l/components": "^0.0.57",
18
+ "react": "^17.0.0 || 18.x",
19
+ "react-dom": "^18.0.0"
20
+ },
21
+ "peerDependencies": {
22
+ "react": "^17.0.0 || 18.x",
23
+ "react-dom": "^18.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@emotion/styled": "^11.9.3",
27
+ "@testing-library/react": "^13.3.0",
28
+ "@testing-library/user-event": "^14.2.1",
29
+ "@types/node": "^17.0.40",
30
+ "@types/react": "^18.0.0",
31
+ "@types/react-dom": "^18.0.0",
32
+ "@typescript-eslint/eslint-plugin": "^5.27.1",
33
+ "@typescript-eslint/parser": "^5.27.1",
34
+ "@vitejs/plugin-react": "^1.3.0",
35
+ "eslint": "^8.17.0",
36
+ "eslint-config-prettier": "^8.5.0",
37
+ "eslint-import-resolver-alias": "^1.1.2",
38
+ "eslint-plugin-import": "^2.26.0",
39
+ "eslint-plugin-jsx-a11y": "^6.5.1",
40
+ "eslint-plugin-prettier": "^4.0.0",
41
+ "eslint-plugin-react": "^7.30.0",
42
+ "eslint-plugin-react-hooks": "^4.5.0",
43
+ "eslint-plugin-unused-imports": "^2.0.0",
44
+ "prettier": "^2.6.2",
45
+ "rollup-plugin-terser": "^7.0.2",
46
+ "typescript": "^4.6.3",
47
+ "vite": "^2.9.9",
48
+ "vite-plugin-dts": "^1.2.0",
49
+ "vite-plugin-mkcert": "^1.6.4",
50
+ "vitest": "^0.17.1"
51
+ },
52
+ "files": [
53
+ "dist"
54
+ ],
55
+ "main": "./dist/index.js",
56
+ "module": "./dist/index.js",
57
+ "types": "./dist/index.d.ts",
58
+ "type": "module",
59
+ "exports": {
60
+ ".": {
61
+ "import": "./dist/index.js"
62
+ }
63
+ },
64
+ "sideEffects": false,
65
+ "publishConfig": {
66
+ "access": "public"
67
+ },
68
+ "engines": {
69
+ "node": ">=12.0.0"
70
+ }
71
+ }