@warp-ds/elements 2.1.0 → 2.1.1-next.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.
@@ -729,9 +729,9 @@ var require_moo = __commonJS({
729
729
  }
730
730
  });
731
731
 
732
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
732
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
733
733
  var require_lexer = __commonJS({
734
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
734
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
735
735
  "use strict";
736
736
  var __importDefault = exports && exports.__importDefault || function(mod) {
737
737
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -744,7 +744,7 @@ var require_lexer = __commonJS({
744
744
  doubleapos: { match: "''", value: () => "'" },
745
745
  quoted: {
746
746
  lineBreaks: true,
747
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
747
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
748
748
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
749
749
  },
750
750
  argument: {
@@ -796,12 +796,13 @@ var require_lexer = __commonJS({
796
796
  }
797
797
  });
798
798
 
799
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
799
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
800
800
  var require_parser = __commonJS({
801
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
801
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
802
802
  "use strict";
803
803
  Object.defineProperty(exports, "__esModule", { value: true });
804
- exports.parse = exports.ParseError = void 0;
804
+ exports.ParseError = void 0;
805
+ exports.parse = parse2;
805
806
  var lexer_js_1 = require_lexer();
806
807
  var getContext = (lt) => ({
807
808
  offset: lt.offset,
@@ -867,8 +868,9 @@ var require_parser = __commonJS({
867
868
  }
868
869
  checkSelectKey(lt, type, key) {
869
870
  if (key[0] === "=") {
870
- if (type === "select")
871
+ if (type === "select") {
871
872
  throw new ParseError(lt, `The case ${key} is not valid with select`);
873
+ }
872
874
  } else if (type !== "select") {
873
875
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
874
876
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -886,10 +888,12 @@ var require_parser = __commonJS({
886
888
  for (const lt of this.lexer) {
887
889
  switch (lt.type) {
888
890
  case "offset":
889
- if (type === "select")
891
+ if (type === "select") {
890
892
  throw new ParseError(lt, "Unexpected plural offset for select");
891
- if (sel.cases.length > 0)
893
+ }
894
+ if (sel.cases.length > 0) {
892
895
  throw new ParseError(lt, "Plural offset must be set before cases");
896
+ }
893
897
  sel.pluralOffset = Number(lt.value);
894
898
  ctx.text += lt.text;
895
899
  ctx.lineBreaks += lt.lineBreaks;
@@ -929,11 +933,13 @@ var require_parser = __commonJS({
929
933
  const end = this.lexer.next();
930
934
  if (!end)
931
935
  throw new ParseError(null, "Unexpected message end");
932
- if (end.type !== "end")
936
+ if (end.type !== "end") {
933
937
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
938
+ }
934
939
  ctx.text += end.text;
935
- if (isSelectType(argType.value.toLowerCase()))
940
+ if (isSelectType(argType.value.toLowerCase())) {
936
941
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
942
+ }
937
943
  return {
938
944
  type: "function",
939
945
  arg: lt.value,
@@ -947,8 +953,9 @@ var require_parser = __commonJS({
947
953
  throw new ParseError(argType, msg);
948
954
  }
949
955
  let param = this.parseBody(this.strict ? false : inPlural);
950
- if (this.strict && param.length > 0)
956
+ if (this.strict && param.length > 0) {
951
957
  param = strictArgStyleParam(lt, param);
958
+ }
952
959
  return {
953
960
  type: "function",
954
961
  arg: lt.value,
@@ -958,10 +965,11 @@ var require_parser = __commonJS({
958
965
  };
959
966
  }
960
967
  case "select":
961
- if (isSelectType(argType.value))
968
+ if (isSelectType(argType.value)) {
962
969
  return this.parseSelect(lt, inPlural, ctx, argType.value);
963
- else
970
+ } else {
964
971
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
972
+ }
965
973
  default:
966
974
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
967
975
  }
@@ -1008,7 +1016,6 @@ var require_parser = __commonJS({
1008
1016
  const parser = new Parser(src, options);
1009
1017
  return parser.parse();
1010
1018
  }
1011
- exports.parse = parse2;
1012
1019
  }
1013
1020
  });
1014
1021
 
@@ -1025,7 +1032,7 @@ var r = function() {
1025
1032
  }, []).join(" ");
1026
1033
  };
1027
1034
 
1028
- // node_modules/.pnpm/@warp-ds+css@2.0.0_@warp-ds+uno@2.0.0_unocss@0.62.0_postcss@8.4.41_rollup@4.20.0_vite@5.3.3_@_vyiy5vwpqfzwy5hpmfkwp3zmle/node_modules/@warp-ds/css/component-classes/index.js
1035
+ // node_modules/.pnpm/@warp-ds+css@2.0.1_@warp-ds+uno@2.0.2_unocss@0.62.0_postcss@8.5.1_rollup@4.32.1_vite@5.3.3_@t_2s4pctzvx7cgxzqlrreqkg4h34/node_modules/@warp-ds/css/component-classes/index.js
1029
1036
  var box = {
1030
1037
  base: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1031
1038
  // Relative here enables w-clickable
@@ -1306,18 +1313,18 @@ function kebabCaseAttributes(constructor) {
1306
1313
  };
1307
1314
  }
1308
1315
 
1309
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1316
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1310
1317
  import { LitElement } from "lit";
1311
1318
  import { unsafeStatic, html } from "lit/static-html.js";
1312
1319
 
1313
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1320
+ // node_modules/.pnpm/@lingui+core@5.1.2_@lingui+babel-plugin-lingui-macro@5.1.2_babel-plugin-macros@3.1.0_typescri_g2ngrxg2kfutsfck3yn2icllca/node_modules/@lingui/core/dist/index.mjs
1314
1321
  var import_unraw = __toESM(require_dist(), 1);
1315
1322
 
1316
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1323
+ // node_modules/.pnpm/@lingui+message-utils@5.1.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1317
1324
  var import_parser = __toESM(require_parser(), 1);
1318
1325
  function processTokens(tokens, mapText) {
1319
1326
  if (!tokens.filter((token) => token.type !== "content").length) {
1320
- return tokens.map((token) => mapText(token.value)).join("");
1327
+ return tokens.map((token) => mapText(token.value));
1321
1328
  }
1322
1329
  return tokens.map((token) => {
1323
1330
  var _a;
@@ -1357,11 +1364,11 @@ function compileMessage(message, mapText = (v) => v) {
1357
1364
  console.error(`${e.message}
1358
1365
 
1359
1366
  Message: ${message}`);
1360
- return message;
1367
+ return [message];
1361
1368
  }
1362
1369
  }
1363
1370
 
1364
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1371
+ // node_modules/.pnpm/@lingui+core@5.1.2_@lingui+babel-plugin-lingui-macro@5.1.2_babel-plugin-macros@3.1.0_typescri_g2ngrxg2kfutsfck3yn2icllca/node_modules/@lingui/core/dist/index.mjs
1365
1372
  var isString = (s) => typeof s === "string";
1366
1373
  var isFunction = (f) => typeof f === "function";
1367
1374
  var cache = /* @__PURE__ */ new Map();
@@ -1412,7 +1419,7 @@ function cacheKey(type, locales, options) {
1412
1419
  const localeKey = locales.join("-");
1413
1420
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1414
1421
  }
1415
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1422
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1416
1423
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1417
1424
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1418
1425
  const locales = passedLocales || locale;
@@ -1544,7 +1551,11 @@ var I18n = class extends EventEmitter {
1544
1551
  __publicField2(this, "_localeData", {});
1545
1552
  __publicField2(this, "_messages", {});
1546
1553
  __publicField2(this, "_missing");
1554
+ __publicField2(this, "_messageCompiler");
1547
1555
  __publicField2(this, "t", this._.bind(this));
1556
+ if (true) {
1557
+ this.setMessagesCompiler(compileMessage);
1558
+ }
1548
1559
  if (params.missing != null)
1549
1560
  this._missing = params.missing;
1550
1561
  if (params.messages != null)
@@ -1580,6 +1591,25 @@ var I18n = class extends EventEmitter {
1580
1591
  Object.assign(maybeLocaleData, localeData);
1581
1592
  }
1582
1593
  }
1594
+ /**
1595
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1596
+ *
1597
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1598
+ * By default, message catalogs should be precompiled during the build process. However,
1599
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1600
+ *
1601
+ * Example usage:
1602
+ *
1603
+ * ```ts
1604
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1605
+ *
1606
+ * i18n.setMessagesCompiler(compileMessage);
1607
+ * ```
1608
+ */
1609
+ setMessagesCompiler(compiler) {
1610
+ this._messageCompiler = compiler;
1611
+ return this;
1612
+ }
1583
1613
  /**
1584
1614
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1585
1615
  */
@@ -1651,8 +1681,20 @@ var I18n = class extends EventEmitter {
1651
1681
  this.emit("missing", { id, locale: this._locale });
1652
1682
  }
1653
1683
  let translation = messageForId || message || id;
1654
- if (true) {
1655
- translation = isString(translation) ? compileMessage(translation) : translation;
1684
+ if (isString(translation)) {
1685
+ if (this._messageCompiler) {
1686
+ translation = this._messageCompiler(translation);
1687
+ } else {
1688
+ console.warn(`Uncompiled message detected! Message:
1689
+
1690
+ > ${translation}
1691
+
1692
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1693
+ ICU features such as interpolation and plurals will not work properly for that message.
1694
+
1695
+ Please compile your catalog first.
1696
+ `);
1697
+ }
1656
1698
  }
1657
1699
  if (isString(translation) && UNICODE_REGEX.test(translation))
1658
1700
  return JSON.parse(`"${translation}"`);
@@ -1676,12 +1718,12 @@ function setupI18n(params = {}) {
1676
1718
  }
1677
1719
  var i18n = setupI18n();
1678
1720
 
1679
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1680
- var messages = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
1681
- var messages2 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
1682
- var messages3 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
1683
- var messages4 = JSON.parse('{"icon.title.chevron-down":"Pil nedad"}');
1684
- var messages5 = JSON.parse('{"icon.title.chevron-down":"Pil ned"}');
1721
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1722
+ var messages = JSON.parse('{"icon.title.chevron-down":["Nedoverpil"]}');
1723
+ var messages2 = JSON.parse('{"icon.title.chevron-down":["Downward arrow"]}');
1724
+ var messages3 = JSON.parse('{"icon.title.chevron-down":["Nuoli alasp\xE4in"]}');
1725
+ var messages4 = JSON.parse('{"icon.title.chevron-down":["Pil nedad"]}');
1726
+ var messages5 = JSON.parse('{"icon.title.chevron-down":["Pil ned"]}');
1685
1727
  var supportedLocales = ["en", "nb", "fi", "da", "sv"];
1686
1728
  var defaultLocale2 = "en";
1687
1729
  var detectByBrand = () => {
@@ -1768,14 +1810,14 @@ if (!customElements.get("w-icon-chevron-down-16")) {
1768
1810
  customElements.define("w-icon-chevron-down-16", IconChevronDown16);
1769
1811
  }
1770
1812
 
1771
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
1813
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
1772
1814
  import { LitElement as LitElement2 } from "lit";
1773
1815
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1774
- var messages6 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
1775
- var messages22 = JSON.parse('{"icon.title.chevron-up":"Upward arrow"}');
1776
- var messages32 = JSON.parse('{"icon.title.chevron-up":"Nuoli yl\xF6sp\xE4in"}');
1777
- var messages42 = JSON.parse('{"icon.title.chevron-up":"Pil opad"}');
1778
- var messages52 = JSON.parse('{"icon.title.chevron-up":"Pil upp"}');
1816
+ var messages6 = JSON.parse('{"icon.title.chevron-up":["Oppoverpil"]}');
1817
+ var messages22 = JSON.parse('{"icon.title.chevron-up":["Upward arrow"]}');
1818
+ var messages32 = JSON.parse('{"icon.title.chevron-up":["Nuoli yl\xF6sp\xE4in"]}');
1819
+ var messages42 = JSON.parse('{"icon.title.chevron-up":["Pil opad"]}');
1820
+ var messages52 = JSON.parse('{"icon.title.chevron-up":["Pil upp"]}');
1779
1821
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1780
1822
  var defaultLocale3 = "en";
1781
1823
  var detectByBrand2 = () => {