@20minutes/tyr 2.1.0 → 2.1.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.
package/dist/index.es.js CHANGED
@@ -60540,8 +60540,9 @@ const Q$ = 180, X$ = () => {
60540
60540
  selectorsLabel: u,
60541
60541
  editionSelector: l,
60542
60542
  monthSelector: f,
60543
- variant: d = "archivesByYear"
60544
- }) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(ir, { my: { xs: "xl", md: "xxl-2" }, color: "ultramarine" }), /* @__PURE__ */ t.createElement(jt, { size: "xs", mb: "xxl" }, a), /* @__PURE__ */ t.createElement(
60543
+ variant: d = "archivesByYear",
60544
+ enabled: v = !0
60545
+ }) => v ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(ir, { my: { xs: "xl", md: "xxl-2" }, color: "ultramarine" }), /* @__PURE__ */ t.createElement(jt, { size: "xs", mb: "xxl" }, a), /* @__PURE__ */ t.createElement(
60545
60546
  Ee,
60546
60547
  {
60547
60548
  alignItems: { xs: "start", md: "center" },
@@ -60569,7 +60570,7 @@ const Q$ = 180, X$ = () => {
60569
60570
  px: "s"
60570
60571
  }
60571
60572
  )
60572
- ), i && i.length > 0 && /* @__PURE__ */ t.createElement(Ee, { direction: "column", gap: "l", mt: "l" }, i.slice(0, 20).map((v) => /* @__PURE__ */ t.createElement(Ee, { key: v.name, alignItems: "baseline" }, /* @__PURE__ */ t.createElement(br, { name: "diode", color: "ultramarine", size: 11, mr: "xxs" }), /* @__PURE__ */ t.createElement(Le, { color: "ultramarine", href: v.href }, v.name))), i.length > 20 && /* @__PURE__ */ t.createElement(G, { as: "span" }, "Vous ne trouvez pas le journal numérique recherché ? Sélectionnez une édition et un mois pour une recherche plus précise."))), SW = ({ months: r, ...a }) => r.length > 0 ? /* @__PURE__ */ t.createElement(ee, { ...a }, r.map((i, u) => /* @__PURE__ */ t.createElement(
60573
+ ), i && i.length > 0 && /* @__PURE__ */ t.createElement(Ee, { direction: "column", gap: "l", mt: "l" }, i.slice(0, 20).map((h) => /* @__PURE__ */ t.createElement(Ee, { key: h.name, alignItems: "baseline" }, /* @__PURE__ */ t.createElement(br, { name: "diode", color: "ultramarine", size: 11, mr: "xxs" }), /* @__PURE__ */ t.createElement(Le, { color: "ultramarine", href: h.href }, h.name))), i.length > 20 && /* @__PURE__ */ t.createElement(G, { as: "span" }, "Vous ne trouvez pas le journal numérique recherché ? Sélectionnez une édition et un mois pour une recherche plus précise."))) : null, SW = ({ months: r, ...a }) => r.length > 0 ? /* @__PURE__ */ t.createElement(ee, { ...a }, r.map((i, u) => /* @__PURE__ */ t.createElement(
60573
60574
  tc,
60574
60575
  {
60575
60576
  key: i.items[0].name,
@@ -62307,40 +62308,41 @@ const Q$ = 180, X$ = () => {
62307
62308
  selectorsLabel: l,
62308
62309
  editionSelector: f,
62309
62310
  monthSelector: d,
62310
- editions: v
62311
+ editions: v,
62312
+ enabled: h
62311
62313
  }) => {
62312
- const [h, m] = t.useState(v), _ = t.useCallback(async () => {
62313
- var A;
62314
- const { apiHost: x } = document.body.dataset, w = new Headers();
62315
- (A = window.envVariables) != null && A.apiAuthKey && w.append("auth-key", window.envVariables.apiAuthKey);
62316
- const C = document.getElementById(
62314
+ const [m, _] = t.useState(v), x = t.useCallback(async () => {
62315
+ var O;
62316
+ const { apiHost: w } = document.body.dataset, C = new Headers();
62317
+ (O = window.envVariables) != null && O.apiAuthKey && C.append("auth-key", window.envVariables.apiAuthKey);
62318
+ const S = document.getElementById(
62317
62319
  GO.editionSelectorId
62318
- ), S = document.getElementById(
62320
+ ), k = document.getElementById(
62319
62321
  GO.monthSelectorId
62320
- ), k = [
62322
+ ), A = [
62321
62323
  {
62322
- url: `${x}/?id=getPdfsByEditionSlug&variables=${encodeURIComponent(
62324
+ url: `${w}/?id=getPdfsByEditionSlug&variables=${encodeURIComponent(
62323
62325
  JSON.stringify({
62324
62326
  brandId: a == null ? void 0 : a.brandId,
62325
- slug: C == null ? void 0 : C.value,
62327
+ slug: S == null ? void 0 : S.value,
62326
62328
  first: 100,
62327
62329
  sort: "ASC",
62328
62330
  year: a == null ? void 0 : a.year,
62329
- month: S == null ? void 0 : S.value
62331
+ month: k == null ? void 0 : k.value
62330
62332
  })
62331
62333
  )}`,
62332
- options: { headers: w }
62334
+ options: { headers: C }
62333
62335
  }
62334
62336
  ];
62335
62337
  try {
62336
- const O = await sl(...k), I = uZ({
62337
- data: O
62338
+ const I = await sl(...A), M = uZ({
62339
+ data: I
62338
62340
  });
62339
- m(I);
62340
- } catch (O) {
62341
- console.error("20mn> Error while searching:", O);
62341
+ _(M);
62342
+ } catch (I) {
62343
+ console.error("20mn> Error while searching:", I);
62342
62344
  }
62343
- }, [m]);
62345
+ }, [_]);
62344
62346
  return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
62345
62347
  wW,
62346
62348
  {
@@ -62348,14 +62350,15 @@ const Q$ = 180, X$ = () => {
62348
62350
  selectorsLabel: l,
62349
62351
  editionSelector: {
62350
62352
  ...f,
62351
- onChange: _
62353
+ onChange: x
62352
62354
  },
62353
62355
  monthSelector: d && {
62354
62356
  ...d,
62355
- onChange: _
62357
+ onChange: x
62356
62358
  },
62357
- editions: h,
62358
- layout: i
62359
+ editions: m,
62360
+ layout: i,
62361
+ enabled: h
62359
62362
  }
62360
62363
  ), r && /* @__PURE__ */ t.createElement(
62361
62364
  "script",
@@ -62370,7 +62373,8 @@ const Q$ = 180, X$ = () => {
62370
62373
  editionSelector: f,
62371
62374
  monthSelector: d,
62372
62375
  editions: v,
62373
- variablesForQuery: a
62376
+ variablesForQuery: a,
62377
+ enabled: h
62374
62378
  }
62375
62379
  }
62376
62380
  )} };`
@@ -67787,7 +67791,8 @@ const hJ = ({
67787
67791
  text: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("b", { style: { display: "contents" } }, "Attestation"), " de parution et facture disponibles immédiatement après la publication")
67788
67792
  }
67789
67793
  ],
67790
- mb: "xxl-2"
67794
+ mb: "xxl-2",
67795
+ mx: { xs: "m", md: "0" }
67791
67796
  }
67792
67797
  ), /* @__PURE__ */ t.createElement(
67793
67798
  ex,