@openuverse/uvapi 0.0.0-stage → 1.1.2

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.
Files changed (137) hide show
  1. package/README.md +3871 -3
  2. package/dist/_virtual/_commonjsHelpers.js +6 -0
  3. package/dist/_virtual/index.js +4 -0
  4. package/dist/api/RestAPIClient.d.ts +191 -0
  5. package/dist/api/RestAPIClient.js +328 -0
  6. package/dist/api/WebSocketClient.d.ts +174 -0
  7. package/dist/api/WebSocketClient.js +277 -0
  8. package/dist/api/index.d.ts +6 -0
  9. package/dist/api/modules/index.d.ts +2 -0
  10. package/dist/api/modules/task.d.ts +124 -0
  11. package/dist/api/modules/task.js +121 -0
  12. package/dist/api/modules/user.d.ts +114 -0
  13. package/dist/api/modules/user.js +113 -0
  14. package/dist/config/index.d.ts +120 -0
  15. package/dist/config/index.js +112 -0
  16. package/dist/hooks/index.d.ts +1 -0
  17. package/dist/hooks/useAttributeMonitor.d.ts +45 -0
  18. package/dist/hooks/useAttributeMonitor.js +115 -0
  19. package/dist/index.d.ts +20 -0
  20. package/dist/index.js +93 -0
  21. package/dist/locale/de-DE.d.ts +18 -0
  22. package/dist/locale/de-DE.js +20 -0
  23. package/dist/locale/en-US.d.ts +18 -0
  24. package/dist/locale/en-US.js +20 -0
  25. package/dist/locale/es-ES.d.ts +18 -0
  26. package/dist/locale/es-ES.js +20 -0
  27. package/dist/locale/fr-FR.d.ts +18 -0
  28. package/dist/locale/fr-FR.js +20 -0
  29. package/dist/locale/id-ID.d.ts +18 -0
  30. package/dist/locale/id-ID.js +20 -0
  31. package/dist/locale/index.d.ts +19 -0
  32. package/dist/locale/index.js +70 -0
  33. package/dist/locale/ja-JP.d.ts +18 -0
  34. package/dist/locale/ja-JP.js +20 -0
  35. package/dist/locale/ko-KR.d.ts +18 -0
  36. package/dist/locale/ko-KR.js +20 -0
  37. package/dist/locale/pl-PL.d.ts +18 -0
  38. package/dist/locale/pl-PL.js +20 -0
  39. package/dist/locale/pt-BR.d.ts +18 -0
  40. package/dist/locale/pt-BR.js +20 -0
  41. package/dist/locale/ru-RU.d.ts +18 -0
  42. package/dist/locale/ru-RU.js +20 -0
  43. package/dist/locale/th-TH.d.ts +18 -0
  44. package/dist/locale/th-TH.js +20 -0
  45. package/dist/locale/zh-CN.d.ts +18 -0
  46. package/dist/locale/zh-CN.js +20 -0
  47. package/dist/locale/zh-TW.d.ts +18 -0
  48. package/dist/locale/zh-TW.js +20 -0
  49. package/dist/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.js +38 -0
  50. package/dist/node_modules/@msgpack/msgpack/dist.esm/DecodeError.js +14 -0
  51. package/dist/node_modules/@msgpack/msgpack/dist.esm/Decoder.js +474 -0
  52. package/dist/node_modules/@msgpack/msgpack/dist.esm/Encoder.js +232 -0
  53. package/dist/node_modules/@msgpack/msgpack/dist.esm/ExtData.js +8 -0
  54. package/dist/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.js +46 -0
  55. package/dist/node_modules/@msgpack/msgpack/dist.esm/decode.js +7 -0
  56. package/dist/node_modules/@msgpack/msgpack/dist.esm/encode.js +7 -0
  57. package/dist/node_modules/@msgpack/msgpack/dist.esm/timestamp.js +66 -0
  58. package/dist/node_modules/@msgpack/msgpack/dist.esm/utils/int.js +24 -0
  59. package/dist/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.js +6 -0
  60. package/dist/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.js +9 -0
  61. package/dist/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.js +93 -0
  62. package/dist/node_modules/axios/index.js +38 -0
  63. package/dist/node_modules/axios/lib/adapters/adapters.js +55 -0
  64. package/dist/node_modules/axios/lib/adapters/fetch.js +169 -0
  65. package/dist/node_modules/axios/lib/adapters/xhr.js +72 -0
  66. package/dist/node_modules/axios/lib/axios.js +46 -0
  67. package/dist/node_modules/axios/lib/cancel/CancelToken.js +77 -0
  68. package/dist/node_modules/axios/lib/cancel/CanceledError.js +11 -0
  69. package/dist/node_modules/axios/lib/cancel/isCancel.js +6 -0
  70. package/dist/node_modules/axios/lib/core/Axios.js +136 -0
  71. package/dist/node_modules/axios/lib/core/AxiosError.js +56 -0
  72. package/dist/node_modules/axios/lib/core/AxiosHeaders.js +181 -0
  73. package/dist/node_modules/axios/lib/core/InterceptorManager.js +58 -0
  74. package/dist/node_modules/axios/lib/core/buildFullPath.js +9 -0
  75. package/dist/node_modules/axios/lib/core/dispatchRequest.js +31 -0
  76. package/dist/node_modules/axios/lib/core/mergeConfig.js +70 -0
  77. package/dist/node_modules/axios/lib/core/settle.js +14 -0
  78. package/dist/node_modules/axios/lib/core/transformData.js +13 -0
  79. package/dist/node_modules/axios/lib/defaults/index.js +89 -0
  80. package/dist/node_modules/axios/lib/defaults/transitional.js +8 -0
  81. package/dist/node_modules/axios/lib/env/data.js +4 -0
  82. package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +33 -0
  83. package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  84. package/dist/node_modules/axios/lib/helpers/bind.js +8 -0
  85. package/dist/node_modules/axios/lib/helpers/buildURL.js +23 -0
  86. package/dist/node_modules/axios/lib/helpers/combineURLs.js +6 -0
  87. package/dist/node_modules/axios/lib/helpers/composeSignals.js +30 -0
  88. package/dist/node_modules/axios/lib/helpers/cookies.js +32 -0
  89. package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +31 -0
  90. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +6 -0
  91. package/dist/node_modules/axios/lib/helpers/isAxiosError.js +7 -0
  92. package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +8 -0
  93. package/dist/node_modules/axios/lib/helpers/null.js +4 -0
  94. package/dist/node_modules/axios/lib/helpers/parseHeaders.js +30 -0
  95. package/dist/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
  96. package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +35 -0
  97. package/dist/node_modules/axios/lib/helpers/resolveConfig.js +33 -0
  98. package/dist/node_modules/axios/lib/helpers/speedometer.js +19 -0
  99. package/dist/node_modules/axios/lib/helpers/spread.js +8 -0
  100. package/dist/node_modules/axios/lib/helpers/throttle.js +15 -0
  101. package/dist/node_modules/axios/lib/helpers/toFormData.js +85 -0
  102. package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +14 -0
  103. package/dist/node_modules/axios/lib/helpers/trackStream.js +63 -0
  104. package/dist/node_modules/axios/lib/helpers/validator.js +54 -0
  105. package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
  106. package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
  107. package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
  108. package/dist/node_modules/axios/lib/platform/browser/index.js +15 -0
  109. package/dist/node_modules/axios/lib/platform/common/utils.js +9 -0
  110. package/dist/node_modules/axios/lib/platform/index.js +9 -0
  111. package/dist/node_modules/axios/lib/utils.js +237 -0
  112. package/dist/node_modules/postcss-pxtorem/index.js +109 -0
  113. package/dist/node_modules/postcss-pxtorem/lib/filter-prop-list.js +13 -0
  114. package/dist/node_modules/postcss-pxtorem/lib/pixel-unit-regex.js +7 -0
  115. package/dist/node_modules/postcss-pxtorem/lib/type.js +14 -0
  116. package/dist/preload/index.d.ts +125 -0
  117. package/dist/preload/index.js +79 -0
  118. package/dist/store/index.d.ts +1 -0
  119. package/dist/store/storeFactory.d.ts +584 -0
  120. package/dist/store/storeFactory.js +216 -0
  121. package/dist/theme/index.d.ts +1 -0
  122. package/dist/theme/index.js +14 -0
  123. package/dist/types/index.d.ts +57 -0
  124. package/dist/types/uVerseAPI.d.ts +67 -0
  125. package/dist/utils/_internal.d.ts +14 -0
  126. package/dist/utils/_internal.js +72 -0
  127. package/dist/utils/constance.d.ts +16 -0
  128. package/dist/utils/constance.js +7 -0
  129. package/dist/utils/index.d.ts +79 -0
  130. package/dist/utils/index.js +96 -0
  131. package/dist/utils/logger.d.ts +118 -0
  132. package/dist/utils/logger.js +170 -0
  133. package/dist/utils/px2rem/remAdapter.d.ts +17 -0
  134. package/dist/utils/px2rem/remAdapter.js +62 -0
  135. package/dist/utils/px2rem/vite.d.ts +14 -0
  136. package/dist/utils/px2rem/vite.js +33 -0
  137. package/package.json +102 -4
@@ -0,0 +1,63 @@
1
+ const f = function* (e, t) {
2
+ let n = e.byteLength;
3
+ if (n < t) {
4
+ yield e;
5
+ return;
6
+ }
7
+ let a = 0, r;
8
+ for (; a < n; )
9
+ r = a + t, yield e.slice(a, r), a = r;
10
+ }, w = async function* (e, t) {
11
+ for await (const n of b(e))
12
+ yield* f(n, t);
13
+ }, b = async function* (e) {
14
+ if (e[Symbol.asyncIterator]) {
15
+ yield* e;
16
+ return;
17
+ }
18
+ const t = e.getReader();
19
+ try {
20
+ for (; ; ) {
21
+ const { done: n, value: a } = await t.read();
22
+ if (n)
23
+ break;
24
+ yield a;
25
+ }
26
+ } finally {
27
+ await t.cancel();
28
+ }
29
+ }, h = (e, t, n, a) => {
30
+ const r = w(e, t);
31
+ let d = 0, o, c = (l) => {
32
+ o || (o = !0, a && a(l));
33
+ };
34
+ return new ReadableStream({
35
+ async pull(l) {
36
+ try {
37
+ const { done: i, value: y } = await r.next();
38
+ if (i) {
39
+ c(), l.close();
40
+ return;
41
+ }
42
+ let s = y.byteLength;
43
+ if (n) {
44
+ let u = d += s;
45
+ n(u);
46
+ }
47
+ l.enqueue(new Uint8Array(y));
48
+ } catch (i) {
49
+ throw c(i), i;
50
+ }
51
+ },
52
+ cancel(l) {
53
+ return c(l), r.return();
54
+ }
55
+ }, {
56
+ highWaterMark: 2
57
+ });
58
+ };
59
+ export {
60
+ w as readBytes,
61
+ f as streamChunk,
62
+ h as trackStream
63
+ };
@@ -0,0 +1,54 @@
1
+ import { VERSION as w } from "../env/data.js";
2
+ import s from "../core/AxiosError.js";
3
+ const l = {};
4
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
5
+ l[n] = function(o) {
6
+ return typeof o === n || "a" + (t < 1 ? "n " : " ") + n;
7
+ };
8
+ });
9
+ const f = {};
10
+ l.transitional = function(t, i, o) {
11
+ function a(r, e) {
12
+ return "[Axios v" + w + "] Transitional option '" + r + "'" + e + (o ? ". " + o : "");
13
+ }
14
+ return (r, e, u) => {
15
+ if (t === !1)
16
+ throw new s(
17
+ a(e, " has been removed" + (i ? " in " + i : "")),
18
+ s.ERR_DEPRECATED
19
+ );
20
+ return i && !f[e] && (f[e] = !0, console.warn(
21
+ a(
22
+ e,
23
+ " has been deprecated since v" + i + " and will be removed in the near future"
24
+ )
25
+ )), t ? t(r, e, u) : !0;
26
+ };
27
+ };
28
+ l.spelling = function(t) {
29
+ return (i, o) => (console.warn(`${o} is likely a misspelling of ${t}`), !0);
30
+ };
31
+ function b(n, t, i) {
32
+ if (typeof n != "object")
33
+ throw new s("options must be an object", s.ERR_BAD_OPTION_VALUE);
34
+ const o = Object.keys(n);
35
+ let a = o.length;
36
+ for (; a-- > 0; ) {
37
+ const r = o[a], e = t[r];
38
+ if (e) {
39
+ const u = n[r], c = u === void 0 || e(u, r, n);
40
+ if (c !== !0)
41
+ throw new s("option " + r + " must be " + c, s.ERR_BAD_OPTION_VALUE);
42
+ continue;
43
+ }
44
+ if (i !== !0)
45
+ throw new s("Unknown option " + r, s.ERR_BAD_OPTION);
46
+ }
47
+ }
48
+ const m = {
49
+ assertOptions: b,
50
+ validators: l
51
+ };
52
+ export {
53
+ m as default
54
+ };
@@ -0,0 +1,4 @@
1
+ const l = typeof Blob < "u" ? Blob : null;
2
+ export {
3
+ l as default
4
+ };
@@ -0,0 +1,4 @@
1
+ const a = typeof FormData < "u" ? FormData : null;
2
+ export {
3
+ a as default
4
+ };
@@ -0,0 +1,5 @@
1
+ import a from "../../../helpers/AxiosURLSearchParams.js";
2
+ const e = typeof URLSearchParams < "u" ? URLSearchParams : a;
3
+ export {
4
+ e as default
5
+ };
@@ -0,0 +1,15 @@
1
+ import o from "./classes/URLSearchParams.js";
2
+ import r from "./classes/FormData.js";
3
+ import t from "./classes/Blob.js";
4
+ const l = {
5
+ isBrowser: !0,
6
+ classes: {
7
+ URLSearchParams: o,
8
+ FormData: r,
9
+ Blob: t
10
+ },
11
+ protocols: ["http", "https", "file", "blob", "url", "data"]
12
+ };
13
+ export {
14
+ l as default
15
+ };
@@ -0,0 +1,9 @@
1
+ const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
3
+ export {
4
+ e as hasBrowserEnv,
5
+ n as hasStandardBrowserEnv,
6
+ t as hasStandardBrowserWebWorkerEnv,
7
+ o as navigator,
8
+ r as origin
9
+ };
@@ -0,0 +1,9 @@
1
+ import o from "./browser/index.js";
2
+ import * as t from "./common/utils.js";
3
+ const m = {
4
+ ...t,
5
+ ...o
6
+ };
7
+ export {
8
+ m as default
9
+ };
@@ -0,0 +1,237 @@
1
+ import R from "./helpers/bind.js";
2
+ const { toString: T } = Object.prototype, { getPrototypeOf: A } = Object, { iterator: g, toStringTag: S } = Symbol, F = /* @__PURE__ */ ((e) => (t) => {
3
+ const n = T.call(t);
4
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
5
+ })(/* @__PURE__ */ Object.create(null)), f = (e) => (e = e.toLowerCase(), (t) => F(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
6
+ function d(e) {
7
+ return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
8
+ }
9
+ const B = f("ArrayBuffer");
10
+ function M(e) {
11
+ let t;
12
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && B(e.buffer), t;
13
+ }
14
+ const k = O("string"), c = O("function"), E = O("number"), y = (e) => e !== null && typeof e == "object", N = (e) => e === !0 || e === !1, w = (e) => {
15
+ if (F(e) !== "object")
16
+ return !1;
17
+ const t = A(e);
18
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(S in e) && !(g in e);
19
+ }, U = (e) => {
20
+ if (!y(e) || d(e))
21
+ return !1;
22
+ try {
23
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
24
+ } catch {
25
+ return !1;
26
+ }
27
+ }, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
28
+ let t;
29
+ return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = F(e)) === "formdata" || // detect form-data instance
30
+ t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
31
+ }, J = f("URLSearchParams"), [K, $, W, G] = ["ReadableStream", "Request", "Response", "Headers"].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
32
+ function m(e, t, { allOwnKeys: n = !1 } = {}) {
33
+ if (e === null || typeof e > "u")
34
+ return;
35
+ let r, s;
36
+ if (typeof e != "object" && (e = [e]), p(e))
37
+ for (r = 0, s = e.length; r < s; r++)
38
+ t.call(null, e[r], r, e);
39
+ else {
40
+ if (d(e))
41
+ return;
42
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
43
+ let l;
44
+ for (r = 0; r < i; r++)
45
+ l = o[r], t.call(null, e[l], l, e);
46
+ }
47
+ }
48
+ function P(e, t) {
49
+ if (d(e))
50
+ return null;
51
+ t = t.toLowerCase();
52
+ const n = Object.keys(e);
53
+ let r = n.length, s;
54
+ for (; r-- > 0; )
55
+ if (s = n[r], t === s.toLowerCase())
56
+ return s;
57
+ return null;
58
+ }
59
+ const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
60
+ function h() {
61
+ const { caseless: e, skipUndefined: t } = L(this) && this || {}, n = {}, r = (s, o) => {
62
+ const i = e && P(n, o) || o;
63
+ w(n[i]) && w(s) ? n[i] = h(n[i], s) : w(s) ? n[i] = h({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
64
+ };
65
+ for (let s = 0, o = arguments.length; s < o; s++)
66
+ arguments[s] && m(arguments[s], r);
67
+ return n;
68
+ }
69
+ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(t, (s, o) => {
70
+ n && c(s) ? e[o] = R(s, n) : e[o] = s;
71
+ }, { allOwnKeys: r }), e), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, n, r) => {
72
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
73
+ value: t.prototype
74
+ }), n && Object.assign(e.prototype, n);
75
+ }, j = (e, t, n, r) => {
76
+ let s, o, i;
77
+ const l = {};
78
+ if (t = t || {}, e == null) return t;
79
+ do {
80
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
81
+ i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
82
+ e = n !== !1 && A(e);
83
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
84
+ return t;
85
+ }, v = (e, t, n) => {
86
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
87
+ const r = e.indexOf(t, n);
88
+ return r !== -1 && r === n;
89
+ }, ee = (e) => {
90
+ if (!e) return null;
91
+ if (p(e)) return e;
92
+ let t = e.length;
93
+ if (!E(t)) return null;
94
+ const n = new Array(t);
95
+ for (; t-- > 0; )
96
+ n[t] = e[t];
97
+ return n;
98
+ }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && A(Uint8Array)), ne = (e, t) => {
99
+ const r = (e && e[g]).call(e);
100
+ let s;
101
+ for (; (s = r.next()) && !s.done; ) {
102
+ const o = s.value;
103
+ t.call(e, o[0], o[1]);
104
+ }
105
+ }, re = (e, t) => {
106
+ let n;
107
+ const r = [];
108
+ for (; (n = e.exec(t)) !== null; )
109
+ r.push(n);
110
+ return r;
111
+ }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(
112
+ /[-_\s]([a-z\d])(\w*)/g,
113
+ function(n, r, s) {
114
+ return r.toUpperCase() + s;
115
+ }
116
+ ), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
117
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
118
+ m(n, (s, o) => {
119
+ let i;
120
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
121
+ }), Object.defineProperties(e, r);
122
+ }, ce = (e) => {
123
+ C(e, (t, n) => {
124
+ if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
125
+ return !1;
126
+ const r = e[n];
127
+ if (c(r)) {
128
+ if (t.enumerable = !1, "writable" in t) {
129
+ t.writable = !1;
130
+ return;
131
+ }
132
+ t.set || (t.set = () => {
133
+ throw Error("Can not rewrite read-only method '" + n + "'");
134
+ });
135
+ }
136
+ });
137
+ }, fe = (e, t) => {
138
+ const n = {}, r = (s) => {
139
+ s.forEach((o) => {
140
+ n[o] = !0;
141
+ });
142
+ };
143
+ return p(e) ? r(e) : r(String(e).split(t)), n;
144
+ }, le = () => {
145
+ }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
146
+ function ae(e) {
147
+ return !!(e && c(e.append) && e[S] === "FormData" && e[g]);
148
+ }
149
+ const pe = (e) => {
150
+ const t = new Array(10), n = (r, s) => {
151
+ if (y(r)) {
152
+ if (t.indexOf(r) >= 0)
153
+ return;
154
+ if (d(r))
155
+ return r;
156
+ if (!("toJSON" in r)) {
157
+ t[s] = r;
158
+ const o = p(r) ? [] : {};
159
+ return m(r, (i, l) => {
160
+ const b = n(i, s + 1);
161
+ !a(b) && (o[l] = b);
162
+ }), t[s] = void 0, o;
163
+ }
164
+ }
165
+ return r;
166
+ };
167
+ return n(e, 0);
168
+ }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener("message", ({ source: s, data: o }) => {
169
+ s === u && o === n && r.length && r.shift()();
170
+ }, !1), (s) => {
171
+ r.push(s), u.postMessage(n, "*");
172
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
173
+ typeof setImmediate == "function",
174
+ c(u.postMessage)
175
+ ), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), Fe = {
176
+ isArray: p,
177
+ isArrayBuffer: B,
178
+ isBuffer: d,
179
+ isFormData: z,
180
+ isArrayBufferView: M,
181
+ isString: k,
182
+ isNumber: E,
183
+ isBoolean: N,
184
+ isObject: y,
185
+ isPlainObject: w,
186
+ isEmptyObject: U,
187
+ isReadableStream: K,
188
+ isRequest: $,
189
+ isResponse: W,
190
+ isHeaders: G,
191
+ isUndefined: a,
192
+ isDate: I,
193
+ isFile: V,
194
+ isBlob: _,
195
+ isRegExp: ie,
196
+ isFunction: c,
197
+ isStream: H,
198
+ isURLSearchParams: J,
199
+ isTypedArray: te,
200
+ isFileList: q,
201
+ forEach: m,
202
+ merge: h,
203
+ extend: X,
204
+ trim: Q,
205
+ stripBOM: Y,
206
+ inherits: Z,
207
+ toFlatObject: j,
208
+ kindOf: F,
209
+ kindOfTest: f,
210
+ endsWith: v,
211
+ toArray: ee,
212
+ forEachEntry: ne,
213
+ matchAll: re,
214
+ isHTMLForm: se,
215
+ hasOwnProperty: x,
216
+ hasOwnProp: x,
217
+ // an alias to avoid ESLint no-prototype-builtins detection
218
+ reduceDescriptors: C,
219
+ freezeMethods: ce,
220
+ toObjectSet: fe,
221
+ toCamelCase: oe,
222
+ noop: le,
223
+ toFiniteNumber: ue,
224
+ findKey: P,
225
+ global: u,
226
+ isContextDefined: L,
227
+ isSpecCompliantForm: ae,
228
+ toJSONObject: pe,
229
+ isAsyncFn: de,
230
+ isThenable: ye,
231
+ setImmediate: D,
232
+ asap: me,
233
+ isIterable: we
234
+ };
235
+ export {
236
+ Fe as default
237
+ };
@@ -0,0 +1,109 @@
1
+ import { getDefaultExportFromCjs as h } from "../../_virtual/_commonjsHelpers.js";
2
+ import { __module as c } from "../../_virtual/index.js";
3
+ import { p as d } from "./lib/pixel-unit-regex.js";
4
+ import { f as m } from "./lib/filter-prop-list.js";
5
+ import { t as O } from "./lib/type.js";
6
+ const l = d, a = m, f = O, g = {
7
+ rootValue: 16,
8
+ unitPrecision: 5,
9
+ selectorBlackList: [],
10
+ propList: ["font", "font-size", "line-height", "letter-spacing"],
11
+ replace: !0,
12
+ mediaQuery: !1,
13
+ minPixelValue: 0,
14
+ exclude: null,
15
+ unit: "px"
16
+ }, x = {
17
+ root_value: "rootValue",
18
+ unit_precision: "unitPrecision",
19
+ selector_black_list: "selectorBlackList",
20
+ prop_white_list: "propList",
21
+ media_query: "mediaQuery",
22
+ propWhiteList: "propList"
23
+ };
24
+ function W(t) {
25
+ typeof t == "object" && ((typeof t.prop_white_list < "u" && t.prop_white_list.length === 0 || typeof t.propWhiteList < "u" && t.propWhiteList.length === 0) && typeof t.propList > "u" && (t.propList = ["*"], delete t.prop_white_list, delete t.propWhiteList), Object.keys(x).forEach((e) => {
26
+ Reflect.has(t, e) && (t[x[e]] = t[e], delete t[e]);
27
+ }));
28
+ }
29
+ function _(t, e, s) {
30
+ return (n, o) => {
31
+ if (!o) return n;
32
+ const i = parseFloat(o);
33
+ if (i < s) return n;
34
+ const r = P(i / t, e);
35
+ return r === 0 ? "0" : r + "rem";
36
+ };
37
+ }
38
+ function P(t, e) {
39
+ const s = Math.pow(10, e + 1), n = Math.floor(t * s);
40
+ return Math.round(n / 10) * 10 / s;
41
+ }
42
+ function y(t, e, s) {
43
+ return t.some((n) => n.prop === e && n.value === s);
44
+ }
45
+ function E(t, e) {
46
+ if (typeof e == "string")
47
+ return t.some((s) => typeof s == "string" ? e.indexOf(s) !== -1 : e.match(s));
48
+ }
49
+ function v(t) {
50
+ const e = t.indexOf("*") > -1, s = e && t.length === 1, n = {
51
+ exact: a.exact(t),
52
+ contain: a.contain(t),
53
+ startWith: a.startWith(t),
54
+ endWith: a.endWith(t),
55
+ notExact: a.notExact(t),
56
+ notContain: a.notContain(t),
57
+ notStartWith: a.notStartWith(t),
58
+ notEndWith: a.notEndWith(t)
59
+ };
60
+ return (o) => s ? !0 : (e || n.exact.indexOf(o) > -1 || n.contain.some(function(i) {
61
+ return o.indexOf(i) > -1;
62
+ }) || n.startWith.some(function(i) {
63
+ return o.indexOf(i) === 0;
64
+ }) || n.endWith.some(function(i) {
65
+ return o.indexOf(i) === o.length - i.length;
66
+ })) && !(n.notExact.indexOf(o) > -1 || n.notContain.some(function(i) {
67
+ return o.indexOf(i) > -1;
68
+ }) || n.notStartWith.some(function(i) {
69
+ return o.indexOf(i) === 0;
70
+ }) || n.notEndWith.some(function(i) {
71
+ return o.indexOf(i) === o.length - i.length;
72
+ }));
73
+ }
74
+ c.exports = (t = {}) => {
75
+ W(t);
76
+ const e = Object.assign({}, g, t), s = v(e.propList), n = e.exclude;
77
+ let o = !1, i;
78
+ return {
79
+ postcssPlugin: "postcss-pxtorem",
80
+ Once(r) {
81
+ const u = r.source.input.file;
82
+ n && (f.isFunction(n) && n(u) || f.isString(n) && u.indexOf(n) !== -1 || u.match(n) !== null) ? o = !0 : o = !1;
83
+ const p = typeof e.rootValue == "function" ? e.rootValue(r.source.input) : e.rootValue;
84
+ i = _(
85
+ p,
86
+ e.unitPrecision,
87
+ e.minPixelValue
88
+ );
89
+ },
90
+ Declaration(r) {
91
+ if (o || r.value.indexOf(e.unit) === -1 || !s(r.prop) || E(e.selectorBlackList, r.parent.selector))
92
+ return;
93
+ const u = r.value.replace(l(e.unit), i);
94
+ y(r.parent, r.prop, u) || (e.replace ? r.value = u : r.cloneAfter({ value: u }));
95
+ },
96
+ AtRule(r) {
97
+ if (!o && e.mediaQuery && r.name === "media") {
98
+ if (r.params.indexOf(e.unit) === -1) return;
99
+ r.params = r.params.replace(l(e.unit), i);
100
+ }
101
+ }
102
+ };
103
+ };
104
+ c.exports.postcss = !0;
105
+ var L = c.exports;
106
+ const j = /* @__PURE__ */ h(L);
107
+ export {
108
+ j as default
109
+ };
@@ -0,0 +1,13 @@
1
+ var r = {
2
+ exact: (a) => a.filter((t) => t.match(/^[^*!]+$/)),
3
+ contain: (a) => a.filter((t) => t.match(/^\*.+\*$/)).map((t) => t.substr(1, t.length - 2)),
4
+ endWith: (a) => a.filter((t) => t.match(/^\*[^*]+$/)).map((t) => t.substr(1)),
5
+ startWith: (a) => a.filter((t) => t.match(/^[^*!]+\*$/)).map((t) => t.substr(0, t.length - 1)),
6
+ notExact: (a) => a.filter((t) => t.match(/^![^*].*$/)).map((t) => t.substr(1)),
7
+ notContain: (a) => a.filter((t) => t.match(/^!\*.+\*$/)).map((t) => t.substr(2, t.length - 3)),
8
+ notEndWith: (a) => a.filter((t) => t.match(/^!\*[^*]+$/)).map((t) => t.substr(2)),
9
+ notStartWith: (a) => a.filter((t) => t.match(/^![^*]+\*$/)).map((t) => t.substr(1, t.length - 2))
10
+ };
11
+ export {
12
+ r as f
13
+ };
@@ -0,0 +1,7 @@
1
+ var p = (e) => new RegExp(
2
+ `"[^"]+"|'[^']+'|url\\([^)]+\\)|var\\([^)]+\\)|(\\d*\\.?\\d+)${e}`,
3
+ "g"
4
+ );
5
+ export {
6
+ p
7
+ };
@@ -0,0 +1,14 @@
1
+ const r = (e) => Object.prototype.toString.call(e).slice(8, -1).toLowerCase(), n = [
2
+ "String",
3
+ "Array",
4
+ "Undefined",
5
+ "Boolean",
6
+ "Number",
7
+ "Function",
8
+ "Symbol",
9
+ "Object"
10
+ ];
11
+ var s = n.reduce((e, t) => (e["is" + t] = (o) => r(o) === t.toLowerCase(), e), {});
12
+ export {
13
+ s as t
14
+ };
@@ -0,0 +1,125 @@
1
+ import { SceneType } from '../utils/constance';
2
+ import { UVerseOpenDialogOptions, UVerseOpenDialogResult, UVerseSaveDialogOptions, UVerseSaveDialogResult } from '../types';
3
+ export { SceneType };
4
+ /**
5
+ * 解析主进程通过 additionalArguments 传递的命令行参数
6
+ *
7
+ * 自动解析所有 --key=value 格式的参数
8
+ * 例如: --initial-language=zh-CN → { 'initial-language': 'zh-CN' }
9
+ */
10
+ export declare const getMainProcessArgs: () => Record<string, string>;
11
+ /**
12
+ * IPC 渲染器接口
13
+ *
14
+ * 此接口定义了 IPC 渲染器所需的最小方法集合,与 Electron 的 IpcRenderer 完全兼容。
15
+ */
16
+ interface IIpcRenderer {
17
+ /**
18
+ * 监听指定频道的消息
19
+ * @param channel 频道名称
20
+ * @param listener 监听器函数
21
+ */
22
+ on(channel: string, listener: (event: any, ...args: any[]) => void): any;
23
+ /**
24
+ * 移除指定频道的监听器
25
+ * @param channel 频道名称
26
+ * @param listener 监听器函数
27
+ */
28
+ off(channel: string, listener: (event: any, ...args: any[]) => void): any;
29
+ send(channel: string, ...args: any[]): void;
30
+ sendSync(channel: string, ...args: any[]): any;
31
+ invoke(channel: string, ...args: any[]): Promise<any>;
32
+ }
33
+ /**
34
+ * 初始化 uVerse 平台 API
35
+ *
36
+ * 在 Electron 的 preload 脚本中调用此函数来创建 uVerseAPI 对象。
37
+ * 该对象将通过 contextBridge 暴露给渲染进程,供 UV-API 和应用使用。
38
+ *
39
+ * @param ipcRenderer - Electron 的 ipcRenderer 实例
40
+ *
41
+ * @returns 包含平台配置和事件监听方法的 API 对象
42
+ *
43
+ * @remarks
44
+ * 视图类型通过主进程参数 `--view-type` 传递,默认为 `ELECTRON_WEBCONTENTSVIEW`。
45
+ *
46
+ * 返回的 API 对象包含:
47
+ * - `viewType` - 视图类型标识(从 `--view-type` 参数读取)
48
+ * - `runningEnvironment` - 运行环境标识(固定为 'uVerse')
49
+ * - `initialConfig` - 初始配置(语言、主题)
50
+ * - `serverConfig` - 服务器配置(hostname、port、protocol、mcp_port)
51
+ * - `registerLanguageChangeEvent` - 注册语言变更监听器
52
+ * - `registerThemeChangeEvent` - 注册主题变更监听器
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * // 在 Electron preload 脚本中使用
57
+ * import { contextBridge, ipcRenderer } from 'electron'
58
+ * import { initMandatoryUVerseAPI } from '@openuverse/uvapi'
59
+ *
60
+ * const uVerseAPI = initMandatoryUVerseAPI(ipcRenderer)
61
+ *
62
+ * contextBridge.exposeInMainWorld('uVerseAPI', uVerseAPI)
63
+ * ```
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * // 在渲染进程中使用(通过 window.uVerseAPI)
68
+ * const { language, theme } = window.uVerseAPI.initialConfig
69
+ * console.log('当前语言:', language)
70
+ * console.log('当前主题:', theme)
71
+ *
72
+ * // 监听语言变化
73
+ * const unsubscribe = window.uVerseAPI.registerLanguageChangeEvent((newLanguage) => {
74
+ * console.log('语言已更改为:', newLanguage)
75
+ * })
76
+ *
77
+ * // 取消监听
78
+ * unsubscribe()
79
+ * ```
80
+ */
81
+ export declare const initMandatoryUVerseAPI: (ipcRenderer: IIpcRenderer) => {
82
+ viewType: "STANDALONE" | "ELECTRON_BROWSERWINDOW" | "ELECTRON_WEBCONTENTSVIEW";
83
+ runningEnvironment: "UVerse";
84
+ initialConfig: {
85
+ language: string;
86
+ theme: string;
87
+ supported_languages: {
88
+ name: string;
89
+ key: string;
90
+ }[] | undefined;
91
+ };
92
+ serverConfig: {
93
+ hostname: string;
94
+ port: string;
95
+ protocol: string;
96
+ mcp_port: string;
97
+ };
98
+ /**
99
+ * 注册语言变更事件监听器
100
+ *
101
+ * 由 UV-API 插件调用,监听平台语言配置变化
102
+ * 当主窗口修改语言时,所有视图(包括用户应用)会收到通知
103
+ *
104
+ * @param callback 回调函数,参数为新的语言代码
105
+ * @returns 取消注册的函数
106
+ */
107
+ registerLanguageChangeEvent: (callback: (language: string) => void) => () => any;
108
+ /**
109
+ * 注册主题变更事件监听器
110
+ *
111
+ * 由 UV-API 插件调用,监听平台主题配置变化
112
+ * 当主窗口修改主题时,所有视图(包括用户应用)会收到通知
113
+ *
114
+ * @param callback 回调函数,参数为新的主题名称
115
+ * @returns 取消注册的函数
116
+ */
117
+ registerThemeChangeEvent: (callback: (theme: string) => void) => () => any;
118
+ navTo: (appId: string, url: string) => Promise<any>;
119
+ registerAppEvent: (event: string, callback: (...args: any[]) => void) => () => any;
120
+ emitAppEvent: (targetAppId: string, event: string, ...eventArgs: any[]) => void;
121
+ sendLog: (level: string, message: string, logArgs: any[], source?: string) => void;
122
+ update: () => void;
123
+ showOpenDialog: (options: UVerseOpenDialogOptions) => Promise<UVerseOpenDialogResult>;
124
+ showSaveDialog: (options: UVerseSaveDialogOptions) => Promise<UVerseSaveDialogResult>;
125
+ };