@supersoniks/concorde 3.1.46 → 3.1.47

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.
@@ -556,7 +556,7 @@ let T = (k = class {
556
556
  const h = await new Response(a.readable).arrayBuffer();
557
557
  return new TextDecoder().decode(h);
558
558
  }
559
- }, k.buildDate = "Fri Nov 15 2024 15:26:12 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
559
+ }, k.buildDate = "Wed Nov 20 2024 09:12:09 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
560
560
  if (typeof window < "u") {
561
561
  const r = window;
562
562
  r[Cs + "PublisherManager"] = r[Cs + "PublisherManager"] || T;
@@ -2392,7 +2392,7 @@ const yn = "sonic-date";
2392
2392
  Ei(() => R.updateComponentsLanguage());
2393
2393
  let R = class extends G(cs(_)) {
2394
2394
  constructor() {
2395
- super(...arguments), this.pageLanguage = "fr", this.duAu = [], this._wording_billet_periode_validite = "", this.designMode = null, this.time_zone = null, this.date = null, this.date_string = null, this.start_date_string = null, this.end_date_string = null, this.start_date = 0, this.hide_hours = !1, this.end_date = 0, this.era = "", this.year = "numeric", this.month = "short", this.day = "2-digit", this.weekday = "short", this.hour = "2-digit", this.hour12 = !1, this.minute = "2-digit", this.language = "", this.renderIf = !0, this.now = !1, this.startDateObject = /* @__PURE__ */ new Date(), this.endDateObject = /* @__PURE__ */ new Date();
2395
+ super(...arguments), this.pageLanguage = "fr", this.duAu = [], this._wording_billet_periode_validite = "", this.designMode = null, this.time_zone = null, this.date = null, this.date_string = null, this.start_date_string = null, this.end_date_string = null, this.start_date = 0, this.computedStartDate = 0, this.end_date = 0, this.computedEndDate = 0, this.hide_hours = !1, this.era = "", this.year = "numeric", this.month = "short", this.day = "2-digit", this.weekday = "short", this.hour = "2-digit", this.hour12 = !1, this.minute = "2-digit", this.language = "", this.renderIf = !0, this.now = !1, this.startDateObject = /* @__PURE__ */ new Date(), this.endDateObject = /* @__PURE__ */ new Date();
2396
2396
  }
2397
2397
  static updateComponentsLanguage() {
2398
2398
  R.dateCompnents.forEach(
@@ -2447,13 +2447,14 @@ let R = class extends G(cs(_)) {
2447
2447
  return new Date(r).getTime() / 1e3;
2448
2448
  }
2449
2449
  willUpdate(r) {
2450
- if (this.date_string && (this.date = this.dateStringToSeconds(this.date_string)), this.date && (this.start_date = this.date), this.start_date_string && (this.start_date = this.dateStringToSeconds(this.start_date_string)), this.end_date_string && (this.end_date = this.dateStringToSeconds(this.end_date_string)), !(!this.start_date && !this.now && !this.end_date) && (this.start_date || (this.start_date = Date.now() / 1e3), this.end_date > 0 && this.end_date < this.start_date)) {
2451
- const t = this.start_date;
2452
- this.start_date = this.end_date, this.end_date = t;
2450
+ if (this.computedStartDate = 0, this.computedEndDate = 0, this.date_string && (this.date = this.dateStringToSeconds(this.date_string)), this.date && (this.computedStartDate = this.date), this.start_date_string && (this.computedStartDate = this.dateStringToSeconds(this.start_date_string)), this.end_date_string && (this.end_date = this.dateStringToSeconds(this.end_date_string)), this.start_date && (this.computedStartDate = this.start_date), !(!this.computedStartDate && !this.now && !this.end_date) && (this.computedStartDate || (this.computedStartDate = Date.now() / 1e3), this.end_date && (this.computedEndDate = this.end_date), this.computedEndDate > 0 && this.computedEndDate < this.computedStartDate)) {
2451
+ const t = this.computedStartDate;
2452
+ this.computedStartDate = this.computedEndDate, this.computedEndDate = t;
2453
2453
  }
2454
2454
  }
2455
2455
  render() {
2456
- if (!this.renderIf || !this.start_date && !this.now && !this.end_date) return A;
2456
+ if (!this.renderIf || !this.computedStartDate && !this.now && !this.computedEndDate)
2457
+ return A;
2457
2458
  const r = {
2458
2459
  year: this.year || "numeric",
2459
2460
  month: this.month || "short",
@@ -2461,7 +2462,11 @@ let R = class extends G(cs(_)) {
2461
2462
  hour12: this.hour12 || !1
2462
2463
  };
2463
2464
  this.weekday !== "hidden" && (r.weekday = this.weekday || "short"), this.hour !== "hidden" && (r.hour = this.hour || "2-digit"), this.minute !== "hidden" && (r.minute = this.minute || "2-digit"), this.era && (r.era = this.era), this.time_zone && (r.timeZone = this.time_zone);
2464
- const t = this.getDatesParts(this.start_date, this.end_date, r);
2465
+ const t = this.getDatesParts(
2466
+ this.computedStartDate,
2467
+ this.computedEndDate,
2468
+ r
2469
+ );
2465
2470
  return z(
2466
2471
  `${t.map((s) => {
2467
2472
  const i = this.templateParts[s.type];
@@ -2500,12 +2505,12 @@ Z([
2500
2505
  Z([
2501
2506
  l({ type: Number })
2502
2507
  ], R.prototype, "start_date", 2);
2503
- Z([
2504
- l({ type: Boolean })
2505
- ], R.prototype, "hide_hours", 2);
2506
2508
  Z([
2507
2509
  l({ type: Number })
2508
2510
  ], R.prototype, "end_date", 2);
2511
+ Z([
2512
+ l({ type: Boolean })
2513
+ ], R.prototype, "hide_hours", 2);
2509
2514
  Z([
2510
2515
  l({ type: String })
2511
2516
  ], R.prototype, "era", 2);
@@ -10984,6 +10989,7 @@ At.styles = [
10984
10989
  .content {
10985
10990
  z-index: 2;
10986
10991
  position: relative;
10992
+ flex: 1;
10987
10993
  }
10988
10994
 
10989
10995
  slot {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "3.1.46",
3
+ "version": "3.1.47",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
@@ -57,8 +57,10 @@ export class SonicDate extends Subscriber(TemplatesContainer(LitElement)) {
57
57
  @property({ type: String }) start_date_string: string | null = null;
58
58
  @property({ type: String }) end_date_string: string | null = null;
59
59
  @property({ type: Number }) start_date = 0;
60
- @property({ type: Boolean }) hide_hours = false;
60
+ computedStartDate = 0;
61
61
  @property({ type: Number }) end_date = 0;
62
+ computedEndDate = 0;
63
+ @property({ type: Boolean }) hide_hours = false;
62
64
  @property({ type: String }) era: "narrow" | "short" | "long" | "" = "";
63
65
  @property({ type: String }) year: "numeric" | "2-digit" = "numeric";
64
66
  @property({ type: String }) month:
@@ -164,26 +166,35 @@ export class SonicDate extends Subscriber(TemplatesContainer(LitElement)) {
164
166
  /* *
165
167
  * Normalisation en fonction des valeurs de dates passées *
166
168
  * */
169
+ this.computedStartDate = 0;
170
+ this.computedEndDate = 0;
171
+
167
172
  if (this.date_string)
168
173
  this.date = this.dateStringToSeconds(this.date_string);
169
- if (this.date) this.start_date = this.date;
174
+ if (this.date) this.computedStartDate = this.date;
170
175
  if (this.start_date_string)
171
- this.start_date = this.dateStringToSeconds(this.start_date_string);
176
+ this.computedStartDate = this.dateStringToSeconds(this.start_date_string);
172
177
  if (this.end_date_string)
173
178
  this.end_date = this.dateStringToSeconds(this.end_date_string);
179
+ if (this.start_date) this.computedStartDate = this.start_date;
174
180
 
175
- if (!this.start_date && !this.now && !this.end_date) return;
176
- if (!this.start_date) this.start_date = Date.now() / 1000;
177
- if (this.end_date > 0 && this.end_date < this.start_date) {
178
- const copy = this.start_date;
179
- this.start_date = this.end_date;
180
- this.end_date = copy;
181
+ if (!this.computedStartDate && !this.now && !this.end_date) return;
182
+ if (!this.computedStartDate) this.computedStartDate = Date.now() / 1000;
183
+ if (this.end_date) this.computedEndDate = this.end_date;
184
+ if (
185
+ this.computedEndDate > 0 &&
186
+ this.computedEndDate < this.computedStartDate
187
+ ) {
188
+ const copy = this.computedStartDate;
189
+ this.computedStartDate = this.computedEndDate;
190
+ this.computedEndDate = copy;
181
191
  }
182
192
  }
183
193
 
184
194
  render() {
185
195
  if (!this.renderIf) return nothing;
186
- if (!this.start_date && !this.now && !this.end_date) return nothing;
196
+ if (!this.computedStartDate && !this.now && !this.computedEndDate)
197
+ return nothing;
187
198
 
188
199
  /* *
189
200
  * gestion des options d'affichage des dates
@@ -204,7 +215,11 @@ export class SonicDate extends Subscriber(TemplatesContainer(LitElement)) {
204
215
  /**
205
216
  * On récupère les différentes partie affichées en vu de l'injection dans le template
206
217
  */
207
- const parts = this.getDatesParts(this.start_date, this.end_date, options);
218
+ const parts = this.getDatesParts(
219
+ this.computedStartDate,
220
+ this.computedEndDate,
221
+ options
222
+ );
208
223
 
209
224
  return unsafeHTML(
210
225
  `${parts
@@ -84,6 +84,7 @@ export class Alert extends LitElement {
84
84
  .content {
85
85
  z-index: 2;
86
86
  position: relative;
87
+ flex: 1;
87
88
  }
88
89
 
89
90
  slot {
@@ -574,10 +574,50 @@ export const configLog = (newConfig: APIConfiguration, endPoint = "log") => {
574
574
  logConfiguration = newConfig;
575
575
  logIsConf = true;
576
576
 
577
- window.addEventListener("error", (e) => {
577
+ window.addEventListener("error", (event) => {
578
578
  if (errorCount > 3) return;
579
- log(e.message, e);
580
579
  errorCount++;
580
+
581
+ let href = "";
582
+ try {
583
+ href = window.location.href;
584
+ } catch (e) {
585
+ href = "unknown";
586
+ }
587
+
588
+ const errorDetails = {
589
+ eventType: "error",
590
+ page: href,
591
+ filename: event.filename || "unknown",
592
+ lineno: event.lineno || null,
593
+ colno: event.colno || null,
594
+ stack: event.error?.stack || "Stack not available",
595
+ isCrossOrigin: event.message === "Script error.",
596
+ };
597
+ log(event.message || "Script error.", errorDetails);
581
598
  return false;
582
599
  });
600
+ window.addEventListener(
601
+ "unhandledrejection",
602
+ (event: PromiseRejectionEvent) => {
603
+ if (errorCount > 3) return;
604
+ errorCount++;
605
+
606
+ let href = "";
607
+ try {
608
+ href = window.location.href;
609
+ } catch (e) {
610
+ href = "unknown";
611
+ }
612
+
613
+ const errorDetails = {
614
+ eventType: "unhandledrejection",
615
+ page: href,
616
+ code: event.reason?.code || "none",
617
+ stack: event.reason?.stack || "Stack not available",
618
+ timestamp: new Date().toISOString(),
619
+ };
620
+ log(event.reason?.message || "Unknown rejection reason.", errorDetails);
621
+ }
622
+ );
583
623
  };