@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.
@@ -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,21 +1010,20 @@ 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
 
1009
1016
  // packages/breadcrumbs/index.js
1010
1017
  import { html } from "lit";
1011
1018
 
1012
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1019
+ // 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
1013
1020
  var import_unraw = __toESM(require_dist(), 1);
1014
1021
 
1015
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1022
+ // node_modules/.pnpm/@lingui+message-utils@5.1.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1016
1023
  var import_parser = __toESM(require_parser(), 1);
1017
1024
  function processTokens(tokens, mapText) {
1018
1025
  if (!tokens.filter((token) => token.type !== "content").length) {
1019
- return tokens.map((token) => mapText(token.value)).join("");
1026
+ return tokens.map((token) => mapText(token.value));
1020
1027
  }
1021
1028
  return tokens.map((token) => {
1022
1029
  var _a;
@@ -1056,11 +1063,11 @@ function compileMessage(message, mapText = (v) => v) {
1056
1063
  console.error(`${e.message}
1057
1064
 
1058
1065
  Message: ${message}`);
1059
- return message;
1066
+ return [message];
1060
1067
  }
1061
1068
  }
1062
1069
 
1063
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1070
+ // 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
1064
1071
  var isString = (s) => typeof s === "string";
1065
1072
  var isFunction = (f) => typeof f === "function";
1066
1073
  var cache = /* @__PURE__ */ new Map();
@@ -1111,7 +1118,7 @@ function cacheKey(type, locales, options) {
1111
1118
  const localeKey = locales.join("-");
1112
1119
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1113
1120
  }
1114
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1121
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1115
1122
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1116
1123
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1117
1124
  const locales = passedLocales || locale;
@@ -1243,7 +1250,11 @@ var I18n = class extends EventEmitter {
1243
1250
  __publicField2(this, "_localeData", {});
1244
1251
  __publicField2(this, "_messages", {});
1245
1252
  __publicField2(this, "_missing");
1253
+ __publicField2(this, "_messageCompiler");
1246
1254
  __publicField2(this, "t", this._.bind(this));
1255
+ if (true) {
1256
+ this.setMessagesCompiler(compileMessage);
1257
+ }
1247
1258
  if (params.missing != null)
1248
1259
  this._missing = params.missing;
1249
1260
  if (params.messages != null)
@@ -1279,6 +1290,25 @@ var I18n = class extends EventEmitter {
1279
1290
  Object.assign(maybeLocaleData, localeData);
1280
1291
  }
1281
1292
  }
1293
+ /**
1294
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1295
+ *
1296
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1297
+ * By default, message catalogs should be precompiled during the build process. However,
1298
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1299
+ *
1300
+ * Example usage:
1301
+ *
1302
+ * ```ts
1303
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1304
+ *
1305
+ * i18n.setMessagesCompiler(compileMessage);
1306
+ * ```
1307
+ */
1308
+ setMessagesCompiler(compiler) {
1309
+ this._messageCompiler = compiler;
1310
+ return this;
1311
+ }
1282
1312
  /**
1283
1313
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1284
1314
  */
@@ -1350,8 +1380,20 @@ var I18n = class extends EventEmitter {
1350
1380
  this.emit("missing", { id, locale: this._locale });
1351
1381
  }
1352
1382
  let translation = messageForId || message || id;
1353
- if (true) {
1354
- translation = isString(translation) ? compileMessage(translation) : translation;
1383
+ if (isString(translation)) {
1384
+ if (this._messageCompiler) {
1385
+ translation = this._messageCompiler(translation);
1386
+ } else {
1387
+ console.warn(`Uncompiled message detected! Message:
1388
+
1389
+ > ${translation}
1390
+
1391
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1392
+ ICU features such as interpolation and plurals will not work properly for that message.
1393
+
1394
+ Please compile your catalog first.
1395
+ `);
1396
+ }
1355
1397
  }
1356
1398
  if (isString(translation) && UNICODE_REGEX.test(translation))
1357
1399
  return JSON.parse(`"${translation}"`);
@@ -1375,12 +1417,12 @@ function setupI18n(params = {}) {
1375
1417
  }
1376
1418
  var i18n = setupI18n();
1377
1419
 
1378
- // node_modules/.pnpm/@warp-ds+core@1.1.8_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
1420
+ // node_modules/.pnpm/@warp-ds+core@1.1.8_@floating-ui+dom@1.6.13/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
1379
1421
  function interleave(array, separator2) {
1380
1422
  return array.flatMap((el) => [el, separator2]).slice(0, -1);
1381
1423
  }
1382
1424
 
1383
- // 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
1425
+ // 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
1384
1426
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1385
1427
  var buttonColors = {
1386
1428
  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]",
@@ -1672,19 +1714,19 @@ function kebabCaseAttributes(constructor) {
1672
1714
  }
1673
1715
 
1674
1716
  // packages/breadcrumbs/locales/da/messages.mjs
1675
- var messages = JSON.parse('{"breadcrumbs.ariaLabel":"Du er her"}');
1717
+ var messages = JSON.parse('{"breadcrumbs.ariaLabel":["Du er her"]}');
1676
1718
 
1677
1719
  // packages/breadcrumbs/locales/en/messages.mjs
1678
- var messages2 = JSON.parse('{"breadcrumbs.ariaLabel":"You are here"}');
1720
+ var messages2 = JSON.parse('{"breadcrumbs.ariaLabel":["You are here"]}');
1679
1721
 
1680
1722
  // packages/breadcrumbs/locales/fi/messages.mjs
1681
- var messages3 = JSON.parse('{"breadcrumbs.ariaLabel":"Olet t\xE4ss\xE4"}');
1723
+ var messages3 = JSON.parse('{"breadcrumbs.ariaLabel":["Olet t\xE4ss\xE4"]}');
1682
1724
 
1683
1725
  // packages/breadcrumbs/locales/nb/messages.mjs
1684
- var messages4 = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}');
1726
+ var messages4 = JSON.parse('{"breadcrumbs.ariaLabel":["Her er du"]}');
1685
1727
 
1686
1728
  // packages/breadcrumbs/locales/sv/messages.mjs
1687
- var messages5 = JSON.parse('{"breadcrumbs.ariaLabel":"Du \xE4r h\xE4r"}');
1729
+ var messages5 = JSON.parse('{"breadcrumbs.ariaLabel":["Du \xE4r h\xE4r"]}');
1688
1730
 
1689
1731
  // packages/breadcrumbs/index.js
1690
1732
  var separator = html`<span class=${breadcrumbs.separator}>/</span>`;