yxuse 3.0.45 → 3.0.46

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/lib/index.es7.js CHANGED
@@ -38,10 +38,10 @@ var __async = (__this, __arguments, generator) => {
38
38
  });
39
39
  };
40
40
  import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h, Fragment, inject, onMounted, onUnmounted, createVNode, Text } from "vue";
41
- import { e as getSystemConfig } from "./index.es12.js";
41
+ import { f as getSystemConfig } from "./index.es12.js";
42
42
  /*!
43
- * shared v10.0.5
44
- * (c) 2024 kazuya kawaguchi
43
+ * shared v10.0.7
44
+ * (c) 2025 kazuya kawaguchi
45
45
  * Released under the MIT License.
46
46
  */
47
47
  const inBrowser = typeof window !== "undefined";
@@ -203,8 +203,8 @@ function deepCopy(src, des) {
203
203
  }
204
204
  }
205
205
  /*!
206
- * message-compiler v10.0.5
207
- * (c) 2024 kazuya kawaguchi
206
+ * message-compiler v10.0.7
207
+ * (c) 2025 kazuya kawaguchi
208
208
  * Released under the MIT License.
209
209
  */
210
210
  function createPosition(line, column, offset) {
@@ -1667,8 +1667,8 @@ function baseCompile$1(source, options = {}) {
1667
1667
  }
1668
1668
  }
1669
1669
  /*!
1670
- * core-base v10.0.5
1671
- * (c) 2024 kazuya kawaguchi
1670
+ * core-base v10.0.7
1671
+ * (c) 2025 kazuya kawaguchi
1672
1672
  * Released under the MIT License.
1673
1673
  */
1674
1674
  function initFeatureFlags$1() {
@@ -1679,6 +1679,76 @@ function initFeatureFlags$1() {
1679
1679
  getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
1680
1680
  }
1681
1681
  }
1682
+ function isMessageAST(val) {
1683
+ return isObject(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
1684
+ }
1685
+ const PROPS_BODY = ["b", "body"];
1686
+ function resolveBody(node) {
1687
+ return resolveProps(node, PROPS_BODY);
1688
+ }
1689
+ const PROPS_CASES = ["c", "cases"];
1690
+ function resolveCases(node) {
1691
+ return resolveProps(node, PROPS_CASES, []);
1692
+ }
1693
+ const PROPS_STATIC = ["s", "static"];
1694
+ function resolveStatic(node) {
1695
+ return resolveProps(node, PROPS_STATIC);
1696
+ }
1697
+ const PROPS_ITEMS = ["i", "items"];
1698
+ function resolveItems(node) {
1699
+ return resolveProps(node, PROPS_ITEMS, []);
1700
+ }
1701
+ const PROPS_TYPE = ["t", "type"];
1702
+ function resolveType(node) {
1703
+ return resolveProps(node, PROPS_TYPE);
1704
+ }
1705
+ const PROPS_VALUE = ["v", "value"];
1706
+ function resolveValue$1(node, type) {
1707
+ const resolved = resolveProps(node, PROPS_VALUE);
1708
+ if (resolved != null) {
1709
+ return resolved;
1710
+ } else {
1711
+ throw createUnhandleNodeError(type);
1712
+ }
1713
+ }
1714
+ const PROPS_MODIFIER = ["m", "modifier"];
1715
+ function resolveLinkedModifier(node) {
1716
+ return resolveProps(node, PROPS_MODIFIER);
1717
+ }
1718
+ const PROPS_KEY = ["k", "key"];
1719
+ function resolveLinkedKey(node) {
1720
+ const resolved = resolveProps(node, PROPS_KEY);
1721
+ if (resolved) {
1722
+ return resolved;
1723
+ } else {
1724
+ throw createUnhandleNodeError(
1725
+ 6
1726
+ /* NodeTypes.Linked */
1727
+ );
1728
+ }
1729
+ }
1730
+ function resolveProps(node, props, defaultValue) {
1731
+ for (let i = 0; i < props.length; i++) {
1732
+ const prop = props[i];
1733
+ if (hasOwn(node, prop) && node[prop] != null) {
1734
+ return node[prop];
1735
+ }
1736
+ }
1737
+ return defaultValue;
1738
+ }
1739
+ const AST_NODE_PROPS_KEYS = [
1740
+ ...PROPS_BODY,
1741
+ ...PROPS_CASES,
1742
+ ...PROPS_STATIC,
1743
+ ...PROPS_ITEMS,
1744
+ ...PROPS_KEY,
1745
+ ...PROPS_MODIFIER,
1746
+ ...PROPS_VALUE,
1747
+ ...PROPS_TYPE
1748
+ ];
1749
+ function createUnhandleNodeError(type) {
1750
+ return new Error(`unhandled node type: ${type}`);
1751
+ }
1682
1752
  function format(ast) {
1683
1753
  const msg = (ctx) => formatParts(ctx, ast);
1684
1754
  return msg;
@@ -1703,14 +1773,6 @@ function formatParts(ctx, ast) {
1703
1773
  return formatMessageParts(ctx, body);
1704
1774
  }
1705
1775
  }
1706
- const PROPS_BODY = ["b", "body"];
1707
- function resolveBody(node) {
1708
- return resolveProps(node, PROPS_BODY);
1709
- }
1710
- const PROPS_CASES = ["c", "cases"];
1711
- function resolveCases(node) {
1712
- return resolveProps(node, PROPS_CASES, []);
1713
- }
1714
1776
  function formatMessageParts(ctx, node) {
1715
1777
  const static_ = resolveStatic(node);
1716
1778
  if (static_ != null) {
@@ -1720,14 +1782,6 @@ function formatMessageParts(ctx, node) {
1720
1782
  return ctx.normalize(messages2);
1721
1783
  }
1722
1784
  }
1723
- const PROPS_STATIC = ["s", "static"];
1724
- function resolveStatic(node) {
1725
- return resolveProps(node, PROPS_STATIC);
1726
- }
1727
- const PROPS_ITEMS = ["i", "items"];
1728
- function resolveItems(node) {
1729
- return resolveProps(node, PROPS_ITEMS, []);
1730
- }
1731
1785
  function formatMessagePart(ctx, node) {
1732
1786
  const type = resolveType(node);
1733
1787
  switch (type) {
@@ -1773,47 +1827,6 @@ function formatMessagePart(ctx, node) {
1773
1827
  throw new Error(`unhandled node on format message part: ${type}`);
1774
1828
  }
1775
1829
  }
1776
- const PROPS_TYPE = ["t", "type"];
1777
- function resolveType(node) {
1778
- return resolveProps(node, PROPS_TYPE);
1779
- }
1780
- const PROPS_VALUE = ["v", "value"];
1781
- function resolveValue$1(node, type) {
1782
- const resolved = resolveProps(node, PROPS_VALUE);
1783
- if (resolved) {
1784
- return resolved;
1785
- } else {
1786
- throw createUnhandleNodeError(type);
1787
- }
1788
- }
1789
- const PROPS_MODIFIER = ["m", "modifier"];
1790
- function resolveLinkedModifier(node) {
1791
- return resolveProps(node, PROPS_MODIFIER);
1792
- }
1793
- const PROPS_KEY = ["k", "key"];
1794
- function resolveLinkedKey(node) {
1795
- const resolved = resolveProps(node, PROPS_KEY);
1796
- if (resolved) {
1797
- return resolved;
1798
- } else {
1799
- throw createUnhandleNodeError(
1800
- 6
1801
- /* NodeTypes.Linked */
1802
- );
1803
- }
1804
- }
1805
- function resolveProps(node, props, defaultValue) {
1806
- for (let i = 0; i < props.length; i++) {
1807
- const prop = props[i];
1808
- if (hasOwn(node, prop) && node[prop] != null) {
1809
- return node[prop];
1810
- }
1811
- }
1812
- return defaultValue;
1813
- }
1814
- function createUnhandleNodeError(type) {
1815
- return new Error(`unhandled node type: ${type}`);
1816
- }
1817
1830
  const WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;
1818
1831
  function checkHtmlMessage(source, warnHtmlMessage) {
1819
1832
  if (warnHtmlMessage && detectHtmlTag(source)) {
@@ -1822,9 +1835,6 @@ function checkHtmlMessage(source, warnHtmlMessage) {
1822
1835
  }
1823
1836
  const defaultOnCacheKey = (message) => message;
1824
1837
  let compileCache = create();
1825
- function isMessageAST(val) {
1826
- return isObject(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body"));
1827
- }
1828
1838
  function baseCompile(message, options = {}) {
1829
1839
  let detectError = false;
1830
1840
  const onError = options.onError || defaultOnError;
@@ -2419,7 +2429,11 @@ function resolveValue(obj, path) {
2419
2429
  let last = obj;
2420
2430
  let i = 0;
2421
2431
  while (i < len) {
2422
- const val = last[hit[i]];
2432
+ const key = hit[i];
2433
+ if (AST_NODE_PROPS_KEYS.includes(key) && isMessageAST(last)) {
2434
+ return null;
2435
+ }
2436
+ const val = last[key];
2423
2437
  if (val === void 0) {
2424
2438
  return null;
2425
2439
  }
@@ -2453,7 +2467,7 @@ const warnMessages$1 = {
2453
2467
  function getWarnMessage$1(code, ...args) {
2454
2468
  return format$1(warnMessages$1[code], ...args);
2455
2469
  }
2456
- const VERSION$1 = "10.0.5";
2470
+ const VERSION$1 = "10.0.7";
2457
2471
  const NOT_REOSLVED = -1;
2458
2472
  const DEFAULT_LOCALE = "en-US";
2459
2473
  const MISSING_RESOLVE_VALUE = "";
@@ -3496,11 +3510,11 @@ function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
3496
3510
  }
3497
3511
  }
3498
3512
  /*!
3499
- * vue-i18n v10.0.5
3500
- * (c) 2024 kazuya kawaguchi
3513
+ * vue-i18n v10.0.7
3514
+ * (c) 2025 kazuya kawaguchi
3501
3515
  * Released under the MIT License.
3502
3516
  */
3503
- const VERSION = "10.0.5";
3517
+ const VERSION = "10.0.7";
3504
3518
  function initFeatureFlags() {
3505
3519
  if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
3506
3520
  getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
@@ -3581,6 +3595,9 @@ function handleFlatJson(obj) {
3581
3595
  if (!isObject(obj)) {
3582
3596
  return obj;
3583
3597
  }
3598
+ if (isMessageAST(obj)) {
3599
+ return obj;
3600
+ }
3584
3601
  for (const key in obj) {
3585
3602
  if (!hasOwn(obj, key)) {
3586
3603
  continue;
@@ -3595,6 +3612,9 @@ function handleFlatJson(obj) {
3595
3612
  let currentObj = obj;
3596
3613
  let hasStringValue = false;
3597
3614
  for (let i = 0; i < lastIndex; i++) {
3615
+ if (subKeys[i] === "__proto__") {
3616
+ throw new Error(`unsafe key: ${subKeys[i]}`);
3617
+ }
3598
3618
  if (!(subKeys[i] in currentObj)) {
3599
3619
  currentObj[subKeys[i]] = create();
3600
3620
  }
@@ -3608,11 +3628,20 @@ function handleFlatJson(obj) {
3608
3628
  currentObj = currentObj[subKeys[i]];
3609
3629
  }
3610
3630
  if (!hasStringValue) {
3611
- currentObj[subKeys[lastIndex]] = obj[key];
3612
- delete obj[key];
3631
+ if (!isMessageAST(currentObj)) {
3632
+ currentObj[subKeys[lastIndex]] = obj[key];
3633
+ delete obj[key];
3634
+ } else {
3635
+ if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) {
3636
+ delete obj[key];
3637
+ }
3638
+ }
3613
3639
  }
3614
- if (isObject(currentObj[subKeys[lastIndex]])) {
3615
- handleFlatJson(currentObj[subKeys[lastIndex]]);
3640
+ if (!isMessageAST(currentObj)) {
3641
+ const target = currentObj[subKeys[lastIndex]];
3642
+ if (isObject(target)) {
3643
+ handleFlatJson(target);
3644
+ }
3616
3645
  }
3617
3646
  }
3618
3647
  }
Binary file