@warp-ds/elements 2.1.0-next.2 → 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.
@@ -723,9 +723,9 @@ var require_moo = __commonJS({
723
723
  }
724
724
  });
725
725
 
726
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
726
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
727
727
  var require_lexer = __commonJS({
728
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
728
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
729
729
  "use strict";
730
730
  var __importDefault = exports && exports.__importDefault || function(mod) {
731
731
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -738,7 +738,7 @@ var require_lexer = __commonJS({
738
738
  doubleapos: { match: "''", value: () => "'" },
739
739
  quoted: {
740
740
  lineBreaks: true,
741
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
741
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
742
742
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
743
743
  },
744
744
  argument: {
@@ -790,12 +790,13 @@ var require_lexer = __commonJS({
790
790
  }
791
791
  });
792
792
 
793
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
793
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
794
794
  var require_parser = __commonJS({
795
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
795
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
796
796
  "use strict";
797
797
  Object.defineProperty(exports, "__esModule", { value: true });
798
- exports.parse = exports.ParseError = void 0;
798
+ exports.ParseError = void 0;
799
+ exports.parse = parse2;
799
800
  var lexer_js_1 = require_lexer();
800
801
  var getContext = (lt) => ({
801
802
  offset: lt.offset,
@@ -861,8 +862,9 @@ var require_parser = __commonJS({
861
862
  }
862
863
  checkSelectKey(lt, type, key) {
863
864
  if (key[0] === "=") {
864
- if (type === "select")
865
+ if (type === "select") {
865
866
  throw new ParseError(lt, `The case ${key} is not valid with select`);
867
+ }
866
868
  } else if (type !== "select") {
867
869
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
868
870
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -880,10 +882,12 @@ var require_parser = __commonJS({
880
882
  for (const lt of this.lexer) {
881
883
  switch (lt.type) {
882
884
  case "offset":
883
- if (type === "select")
885
+ if (type === "select") {
884
886
  throw new ParseError(lt, "Unexpected plural offset for select");
885
- if (sel.cases.length > 0)
887
+ }
888
+ if (sel.cases.length > 0) {
886
889
  throw new ParseError(lt, "Plural offset must be set before cases");
890
+ }
887
891
  sel.pluralOffset = Number(lt.value);
888
892
  ctx.text += lt.text;
889
893
  ctx.lineBreaks += lt.lineBreaks;
@@ -923,11 +927,13 @@ var require_parser = __commonJS({
923
927
  const end = this.lexer.next();
924
928
  if (!end)
925
929
  throw new ParseError(null, "Unexpected message end");
926
- if (end.type !== "end")
930
+ if (end.type !== "end") {
927
931
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
932
+ }
928
933
  ctx.text += end.text;
929
- if (isSelectType(argType.value.toLowerCase()))
934
+ if (isSelectType(argType.value.toLowerCase())) {
930
935
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
936
+ }
931
937
  return {
932
938
  type: "function",
933
939
  arg: lt.value,
@@ -941,8 +947,9 @@ var require_parser = __commonJS({
941
947
  throw new ParseError(argType, msg);
942
948
  }
943
949
  let param = this.parseBody(this.strict ? false : inPlural);
944
- if (this.strict && param.length > 0)
950
+ if (this.strict && param.length > 0) {
945
951
  param = strictArgStyleParam(lt, param);
952
+ }
946
953
  return {
947
954
  type: "function",
948
955
  arg: lt.value,
@@ -952,10 +959,11 @@ var require_parser = __commonJS({
952
959
  };
953
960
  }
954
961
  case "select":
955
- if (isSelectType(argType.value))
962
+ if (isSelectType(argType.value)) {
956
963
  return this.parseSelect(lt, inPlural, ctx, argType.value);
957
- else
964
+ } else {
958
965
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
966
+ }
959
967
  default:
960
968
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
961
969
  }
@@ -1002,7 +1010,6 @@ var require_parser = __commonJS({
1002
1010
  const parser = new Parser(src, options);
1003
1011
  return parser.parse();
1004
1012
  }
1005
- exports.parse = parse2;
1006
1013
  }
1007
1014
  });
1008
1015
 
@@ -1019,7 +1026,7 @@ var r = function() {
1019
1026
  }, []).join(" ");
1020
1027
  };
1021
1028
 
1022
- // 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
1029
+ // 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
1023
1030
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1024
1031
  var buttonColors = {
1025
1032
  primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
@@ -1252,18 +1259,18 @@ var attention = {
1252
1259
  import WarpElement from "@warp-ds/elements-core";
1253
1260
  import { ifDefined } from "lit/directives/if-defined.js";
1254
1261
 
1255
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1262
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1256
1263
  import { LitElement } from "lit";
1257
1264
  import { unsafeStatic, html } from "lit/static-html.js";
1258
1265
 
1259
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1266
+ // 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
1260
1267
  var import_unraw = __toESM(require_dist(), 1);
1261
1268
 
1262
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1269
+ // node_modules/.pnpm/@lingui+message-utils@5.1.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1263
1270
  var import_parser = __toESM(require_parser(), 1);
1264
1271
  function processTokens(tokens, mapText) {
1265
1272
  if (!tokens.filter((token) => token.type !== "content").length) {
1266
- return tokens.map((token) => mapText(token.value)).join("");
1273
+ return tokens.map((token) => mapText(token.value));
1267
1274
  }
1268
1275
  return tokens.map((token) => {
1269
1276
  var _a;
@@ -1303,11 +1310,11 @@ function compileMessage(message, mapText = (v) => v) {
1303
1310
  console.error(`${e.message}
1304
1311
 
1305
1312
  Message: ${message}`);
1306
- return message;
1313
+ return [message];
1307
1314
  }
1308
1315
  }
1309
1316
 
1310
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1317
+ // 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
1311
1318
  var isString = (s) => typeof s === "string";
1312
1319
  var isFunction = (f) => typeof f === "function";
1313
1320
  var cache = /* @__PURE__ */ new Map();
@@ -1358,7 +1365,7 @@ function cacheKey(type, locales, options) {
1358
1365
  const localeKey = locales.join("-");
1359
1366
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1360
1367
  }
1361
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1368
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1362
1369
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1363
1370
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1364
1371
  const locales = passedLocales || locale;
@@ -1490,7 +1497,11 @@ var I18n = class extends EventEmitter {
1490
1497
  __publicField2(this, "_localeData", {});
1491
1498
  __publicField2(this, "_messages", {});
1492
1499
  __publicField2(this, "_missing");
1500
+ __publicField2(this, "_messageCompiler");
1493
1501
  __publicField2(this, "t", this._.bind(this));
1502
+ if (true) {
1503
+ this.setMessagesCompiler(compileMessage);
1504
+ }
1494
1505
  if (params.missing != null)
1495
1506
  this._missing = params.missing;
1496
1507
  if (params.messages != null)
@@ -1526,6 +1537,25 @@ var I18n = class extends EventEmitter {
1526
1537
  Object.assign(maybeLocaleData, localeData);
1527
1538
  }
1528
1539
  }
1540
+ /**
1541
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1542
+ *
1543
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1544
+ * By default, message catalogs should be precompiled during the build process. However,
1545
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1546
+ *
1547
+ * Example usage:
1548
+ *
1549
+ * ```ts
1550
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1551
+ *
1552
+ * i18n.setMessagesCompiler(compileMessage);
1553
+ * ```
1554
+ */
1555
+ setMessagesCompiler(compiler) {
1556
+ this._messageCompiler = compiler;
1557
+ return this;
1558
+ }
1529
1559
  /**
1530
1560
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1531
1561
  */
@@ -1597,8 +1627,20 @@ var I18n = class extends EventEmitter {
1597
1627
  this.emit("missing", { id, locale: this._locale });
1598
1628
  }
1599
1629
  let translation = messageForId || message || id;
1600
- if (true) {
1601
- translation = isString(translation) ? compileMessage(translation) : translation;
1630
+ if (isString(translation)) {
1631
+ if (this._messageCompiler) {
1632
+ translation = this._messageCompiler(translation);
1633
+ } else {
1634
+ console.warn(`Uncompiled message detected! Message:
1635
+
1636
+ > ${translation}
1637
+
1638
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1639
+ ICU features such as interpolation and plurals will not work properly for that message.
1640
+
1641
+ Please compile your catalog first.
1642
+ `);
1643
+ }
1602
1644
  }
1603
1645
  if (isString(translation) && UNICODE_REGEX.test(translation))
1604
1646
  return JSON.parse(`"${translation}"`);
@@ -1622,12 +1664,12 @@ function setupI18n(params = {}) {
1622
1664
  }
1623
1665
  var i18n = setupI18n();
1624
1666
 
1625
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1626
- var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
1627
- var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
1628
- var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
1629
- var messages4 = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglas"}');
1630
- var messages5 = JSON.parse('{"icon.title.search":"F\xF6rstoringsglas"}');
1667
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1668
+ var messages = JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglass"]}');
1669
+ var messages2 = JSON.parse('{"icon.title.search":["Magnifying glass"]}');
1670
+ var messages3 = JSON.parse('{"icon.title.search":["Suurennuslasi"]}');
1671
+ var messages4 = JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglas"]}');
1672
+ var messages5 = JSON.parse('{"icon.title.search":["F\xF6rstoringsglas"]}');
1631
1673
  var supportedLocales = ["en", "nb", "fi", "da", "sv"];
1632
1674
  var defaultLocale2 = "en";
1633
1675
  var detectByBrand = () => {
@@ -1714,14 +1756,14 @@ if (!customElements.get("w-icon-search-16")) {
1714
1756
  customElements.define("w-icon-search-16", IconSearch16);
1715
1757
  }
1716
1758
 
1717
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
1759
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1718
1760
  import { LitElement as LitElement2 } from "lit";
1719
1761
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1720
- var messages6 = JSON.parse('{"icon.title.close":"Kryss"}');
1721
- var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
1722
- var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
1723
- var messages42 = JSON.parse('{"icon.title.close":"Kryds"}');
1724
- var messages52 = JSON.parse('{"icon.title.close":"Kryss"}');
1762
+ var messages6 = JSON.parse('{"icon.title.close":["Kryss"]}');
1763
+ var messages22 = JSON.parse('{"icon.title.close":["Cross"]}');
1764
+ var messages32 = JSON.parse('{"icon.title.close":["Rasti"]}');
1765
+ var messages42 = JSON.parse('{"icon.title.close":["Kryds"]}');
1766
+ var messages52 = JSON.parse('{"icon.title.close":["Kryss"]}');
1725
1767
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1726
1768
  var defaultLocale3 = "en";
1727
1769
  var detectByBrand2 = () => {