@quartz-community/breadcrumbs 1.0.4 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - ac440d9: Bundles utils 1.3.1: `slugs.stripDiacritics` now strips accents from Latin letters only and writes ł, ø, ß, æ … in ASCII; other scripts are left as written.
8
+
3
9
  ## 1.0.4
4
10
 
5
11
  ### Patch Changes
@@ -76,8 +76,39 @@ var SLUG_OPTIONS = /* @__PURE__ */ Symbol.for("@quartz-community/utils/slugOptio
76
76
  function getSlugOptions() {
77
77
  return globalThis[SLUG_OPTIONS] ?? {};
78
78
  }
79
+ var LATIN_FOLDS = {
80
+ \u0142: "l",
81
+ \u0141: "L",
82
+ \u00F8: "o",
83
+ \u00D8: "O",
84
+ \u0111: "d",
85
+ \u0110: "D",
86
+ \u00F0: "d",
87
+ \u00D0: "D",
88
+ \u0127: "h",
89
+ \u0126: "H",
90
+ \u0167: "t",
91
+ \u0166: "T",
92
+ \u0140: "l",
93
+ \u013F: "L",
94
+ \u0131: "i",
95
+ \u019A: "l",
96
+ \u0180: "b",
97
+ \u0268: "i",
98
+ \u0289: "u",
99
+ \u00DF: "ss",
100
+ "\u1E9E": "SS",
101
+ \u00E6: "ae",
102
+ \u00C6: "AE",
103
+ \u0153: "oe",
104
+ \u0152: "OE",
105
+ \u00FE: "th",
106
+ \u00DE: "Th"
107
+ };
108
+ var LATIN_FOLD_RE = new RegExp(`[${Object.keys(LATIN_FOLDS).join("")}]`, "gu");
109
+ var LATIN_WITH_MARKS_RE = /(\p{Script=Latin})\p{M}+/gu;
79
110
  function stripDiacritics(s) {
80
- return s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").normalize("NFC");
111
+ return s.normalize("NFD").replace(LATIN_WITH_MARKS_RE, "$1").replace(LATIN_FOLD_RE, (c) => LATIN_FOLDS[c] ?? c).normalize("NFC");
81
112
  }
82
113
  function slugifyPath(s) {
83
114
  const normalized = s.normalize("NFC");
@@ -367,6 +398,36 @@ function stripSlashes2(s, onlyStripPrefix) {
367
398
  }
368
399
  return s;
369
400
  }
401
+ var LATIN_FOLDS2 = {
402
+ \u0142: "l",
403
+ \u0141: "L",
404
+ \u00F8: "o",
405
+ \u00D8: "O",
406
+ \u0111: "d",
407
+ \u0110: "D",
408
+ \u00F0: "d",
409
+ \u00D0: "D",
410
+ \u0127: "h",
411
+ \u0126: "H",
412
+ \u0167: "t",
413
+ \u0166: "T",
414
+ \u0140: "l",
415
+ \u013F: "L",
416
+ \u0131: "i",
417
+ \u019A: "l",
418
+ \u0180: "b",
419
+ \u0268: "i",
420
+ \u0289: "u",
421
+ \u00DF: "ss",
422
+ "\u1E9E": "SS",
423
+ \u00E6: "ae",
424
+ \u00C6: "AE",
425
+ \u0153: "oe",
426
+ \u0152: "OE",
427
+ \u00FE: "th",
428
+ \u00DE: "Th"
429
+ };
430
+ new RegExp(`[${Object.keys(LATIN_FOLDS2).join("")}]`, "gu");
370
431
  var Schema = class {
371
432
  /**
372
433
  * @param {SchemaType['property']} property