@notificationapi/react 1.1.1 → 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.
- package/dist/assets/ButtonBase.js +1 -1
- package/dist/assets/Inbox.js +1 -1
- package/dist/assets/Notification.js +89 -85
- package/package.json +2 -2
package/dist/assets/Inbox.js
CHANGED
|
@@ -1409,7 +1409,7 @@ function Xn(e, t) {
|
|
|
1409
1409
|
var r, n, o = fn(e, t);
|
|
1410
1410
|
if (Object.getOwnPropertySymbols) {
|
|
1411
1411
|
var i = Object.getOwnPropertySymbols(e);
|
|
1412
|
-
for (n = 0; n < i.length; n++) r = i[n], t.
|
|
1412
|
+
for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
1413
1413
|
}
|
|
1414
1414
|
return o;
|
|
1415
1415
|
}
|
|
@@ -304,7 +304,7 @@ function h(t) {
|
|
|
304
304
|
return t = m(t), N(t) ? t : $(t) ? "" : A(t) ? t.map((e) => h(e)).join("") : String(t);
|
|
305
305
|
}
|
|
306
306
|
function jt(t) {
|
|
307
|
-
return t = m(t), A(t) ? t : N(t) && t.length > 0 ? [t] :
|
|
307
|
+
return t = m(t), A(t) ? t : N(t) && t.length > 0 ? [t] : Pi(t) ? Array.from(t) : nt(t) ? Object.keys(t).map((e) => [e, t[e]]) : [];
|
|
308
308
|
}
|
|
309
309
|
function L(t) {
|
|
310
310
|
return t = m(t), $(t) ? [] : A(t) ? t : [t];
|
|
@@ -324,13 +324,13 @@ function yn(t) {
|
|
|
324
324
|
function $(t) {
|
|
325
325
|
return t == null;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ri(t) {
|
|
328
328
|
return t === void 0;
|
|
329
329
|
}
|
|
330
330
|
function A(t) {
|
|
331
331
|
return Fi.call(t) === "[object Array]";
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Pi(t) {
|
|
334
334
|
return nt(t) && Symbol.iterator in t;
|
|
335
335
|
}
|
|
336
336
|
function ir(t, e) {
|
|
@@ -468,14 +468,14 @@ function Be(t) {
|
|
|
468
468
|
}
|
|
469
469
|
w[160] = w[5760] = w[6158] = w[8192] = w[8193] = w[8194] = w[8195] = w[8196] = w[8197] = w[8198] = w[8199] = w[8200] = w[8201] = w[8202] = w[8232] = w[8233] = w[8239] = w[8287] = w[12288] = ve;
|
|
470
470
|
w[8220] = w[8221] = Yi;
|
|
471
|
-
function
|
|
471
|
+
function R(t, e) {
|
|
472
472
|
if (!t) {
|
|
473
473
|
const r = typeof e == "function" ? e() : e || `expect ${t} to be true`;
|
|
474
474
|
throw new qi(r);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
function Je(t, e = `unexpected ${JSON.stringify(t)}`) {
|
|
478
|
-
|
|
478
|
+
R(!t, e);
|
|
479
479
|
}
|
|
480
480
|
class Ji extends ce {
|
|
481
481
|
equals(e) {
|
|
@@ -904,10 +904,10 @@ class yt {
|
|
|
904
904
|
this.base = 0, this.message = `${e} limit exceeded`, this.limit = r;
|
|
905
905
|
}
|
|
906
906
|
use(e) {
|
|
907
|
-
e = nr(e),
|
|
907
|
+
e = nr(e), R(this.base + e <= this.limit, this.message), this.base += e;
|
|
908
908
|
}
|
|
909
909
|
check(e) {
|
|
910
|
-
e = nr(e),
|
|
910
|
+
e = nr(e), R(e <= this.limit, this.message);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
class Ut extends j {
|
|
@@ -1128,7 +1128,7 @@ class ks {
|
|
|
1128
1128
|
this.postfix = [...As(e)];
|
|
1129
1129
|
}
|
|
1130
1130
|
*evaluate(e, r) {
|
|
1131
|
-
|
|
1131
|
+
R(e, "unable to evaluate: context not defined");
|
|
1132
1132
|
const n = [];
|
|
1133
1133
|
for (const i of this.postfix)
|
|
1134
1134
|
if ($n(i)) {
|
|
@@ -1175,7 +1175,7 @@ function* xs(t, e, r) {
|
|
|
1175
1175
|
throw new Mi(i, t);
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Rn(t) {
|
|
1179
1179
|
return t.content;
|
|
1180
1180
|
}
|
|
1181
1181
|
function* Ls(t, e) {
|
|
@@ -1255,7 +1255,7 @@ class br {
|
|
|
1255
1255
|
this.size > this.limit && this.remove(this.tail.prev.key);
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function Pn(t, e) {
|
|
1259
1259
|
const r = document.createElement("base");
|
|
1260
1260
|
r.href = t;
|
|
1261
1261
|
const n = document.getElementsByTagName("head")[0];
|
|
@@ -1265,13 +1265,13 @@ function Rn(t, e) {
|
|
|
1265
1265
|
const s = i.href;
|
|
1266
1266
|
return n.removeChild(r), s;
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return t.length && wn(t) !== "/" && (t += "/"),
|
|
1268
|
+
function Rs(t, e, r) {
|
|
1269
|
+
return t.length && wn(t) !== "/" && (t += "/"), Pn(t, e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/, (i, s, o) => {
|
|
1270
1270
|
const a = o.split("/").pop();
|
|
1271
1271
|
return /\.\w+$/.test(a) ? i : s + o + r;
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Ps(t) {
|
|
1275
1275
|
return C(this, void 0, void 0, function* () {
|
|
1276
1276
|
return new Promise((e, r) => {
|
|
1277
1277
|
const n = new XMLHttpRequest();
|
|
@@ -1298,13 +1298,13 @@ function $s(t) {
|
|
|
1298
1298
|
return !0;
|
|
1299
1299
|
}
|
|
1300
1300
|
function Is(t) {
|
|
1301
|
-
return
|
|
1301
|
+
return Pn(t, ".");
|
|
1302
1302
|
}
|
|
1303
1303
|
const js = "/";
|
|
1304
1304
|
var zs = /* @__PURE__ */ Object.freeze({
|
|
1305
1305
|
__proto__: null,
|
|
1306
|
-
resolve:
|
|
1307
|
-
readFile:
|
|
1306
|
+
resolve: Rs,
|
|
1307
|
+
readFile: Ps,
|
|
1308
1308
|
readFileSync: Es,
|
|
1309
1309
|
exists: Ns,
|
|
1310
1310
|
existsSync: $s,
|
|
@@ -1464,7 +1464,7 @@ function Xs(t) {
|
|
|
1464
1464
|
return t = Object.assign(Object.assign(Object.assign({}, de), t.jekyllInclude ? { dynamicPartials: !1 } : {}), t), (!t.fs.dirname || !t.fs.sep) && t.relativeReference && (console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"), t.relativeReference = !1), t.root = We(t.root), t.partials = We(t.partials), t.layouts = We(t.layouts), t.outputEscape = t.outputEscape && Ks(t.outputEscape), t.locale || (t.locale = (r = (e = Ln()) === null || e === void 0 ? void 0 : e().resolvedOptions().locale) !== null && r !== void 0 ? r : "en-US"), t.templates && (t.fs = new Gs(t.templates), t.relativeReference = !0, t.root = t.partials = t.layouts = "."), t;
|
|
1465
1465
|
}
|
|
1466
1466
|
function Ks(t) {
|
|
1467
|
-
return t === "escape" ? st : t === "json" ? En.json : (
|
|
1467
|
+
return t === "escape" ? st : t === "json" ? En.json : (R(x(t), "`outputEscape` need to be of type string or function"), t);
|
|
1468
1468
|
}
|
|
1469
1469
|
function We(t) {
|
|
1470
1470
|
let e = [];
|
|
@@ -1926,7 +1926,7 @@ class I {
|
|
|
1926
1926
|
}
|
|
1927
1927
|
getFilter(e, r) {
|
|
1928
1928
|
const n = e.filters[r];
|
|
1929
|
-
return
|
|
1929
|
+
return R(n || !e.options.strictFilters, () => `undefined filter: ${r}`), n;
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
1932
|
class oo extends Vt {
|
|
@@ -1962,7 +1962,7 @@ class uo {
|
|
|
1962
1962
|
constructor(e) {
|
|
1963
1963
|
if (this.options = e, e.relativeReference) {
|
|
1964
1964
|
const r = e.fs.sep;
|
|
1965
|
-
|
|
1965
|
+
R(r, "`fs.sep` is required for relative reference");
|
|
1966
1966
|
const n = new RegExp(["." + r, ".." + r, "./", "../"].map((i) => _i(i)).join("|"));
|
|
1967
1967
|
this.shouldLoadRelative = (i) => n.test(i);
|
|
1968
1968
|
} else
|
|
@@ -1997,7 +1997,7 @@ class uo {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
dirname(e) {
|
|
1999
1999
|
const r = this.options.fs;
|
|
2000
|
-
return
|
|
2000
|
+
return R(r.dirname, "`fs.dirname` is required for relative reference"), r.dirname(e);
|
|
2001
2001
|
}
|
|
2002
2002
|
lookupError(e, r) {
|
|
2003
2003
|
const n = new Error("ENOENT");
|
|
@@ -2033,7 +2033,7 @@ class te {
|
|
|
2033
2033
|
try {
|
|
2034
2034
|
if (he(e)) {
|
|
2035
2035
|
const n = this.liquid.tags[e.name];
|
|
2036
|
-
return
|
|
2036
|
+
return R(n, `tag "${e.name}" not found`), new n(e, r, this.liquid, this);
|
|
2037
2037
|
}
|
|
2038
2038
|
return co(e) ? new oo(e, this.liquid) : new ao(e);
|
|
2039
2039
|
} catch (n) {
|
|
@@ -2133,7 +2133,7 @@ class ie {
|
|
|
2133
2133
|
*_getFromScope(e, r, n = this.strictVariables) {
|
|
2134
2134
|
N(r) && (r = r.split("."));
|
|
2135
2135
|
for (let i = 0; i < r.length; i++)
|
|
2136
|
-
if (e = yield mo(e, r[i], this.ownPropertyOnly), n &&
|
|
2136
|
+
if (e = yield mo(e, r[i], this.ownPropertyOnly), n && Ri(e))
|
|
2137
2137
|
throw new Ci(r.slice(0, i + 1).join("."));
|
|
2138
2138
|
return e;
|
|
2139
2139
|
}
|
|
@@ -2204,7 +2204,7 @@ function Do(t, e = 0) {
|
|
|
2204
2204
|
function _o(t, e) {
|
|
2205
2205
|
return t = m(t), e = m(e), Number(t) + Number(e);
|
|
2206
2206
|
}
|
|
2207
|
-
var
|
|
2207
|
+
var Ro = /* @__PURE__ */ Object.freeze({
|
|
2208
2208
|
__proto__: null,
|
|
2209
2209
|
abs: bo,
|
|
2210
2210
|
at_least: To,
|
|
@@ -2218,7 +2218,7 @@ var Po = /* @__PURE__ */ Object.freeze({
|
|
|
2218
2218
|
round: Do,
|
|
2219
2219
|
plus: _o
|
|
2220
2220
|
});
|
|
2221
|
-
const
|
|
2221
|
+
const Po = (t) => decodeURIComponent(h(t)).replace(/\+/g, " "), Eo = (t) => encodeURIComponent(h(t)).replace(/%20/g, "+"), No = (t) => encodeURIComponent(h(t)).replace(/%20/g, "+").replace(/[!'()*]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase()), $o = (t) => encodeURI(h(t)).replace(/%5B/g, "[").replace(/%5D/g, "]"), Or = /[^\p{M}\p{L}\p{Nd}]+/ug, Io = {
|
|
2222
2222
|
raw: /\s+/g,
|
|
2223
2223
|
default: Or,
|
|
2224
2224
|
pretty: /[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug,
|
|
@@ -2236,7 +2236,7 @@ function zo(t) {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
var Mo = /* @__PURE__ */ Object.freeze({
|
|
2238
2238
|
__proto__: null,
|
|
2239
|
-
url_decode:
|
|
2239
|
+
url_decode: Po,
|
|
2240
2240
|
url_encode: Eo,
|
|
2241
2241
|
cgi_escape: No,
|
|
2242
2242
|
uri_escape: $o,
|
|
@@ -2444,12 +2444,12 @@ var da = /* @__PURE__ */ Object.freeze({
|
|
|
2444
2444
|
});
|
|
2445
2445
|
const ft = /[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu, Sr = /[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;
|
|
2446
2446
|
function ma(t, e) {
|
|
2447
|
-
|
|
2447
|
+
R(arguments.length === 2, "append expect 2 arguments");
|
|
2448
2448
|
const r = h(t), n = h(e);
|
|
2449
2449
|
return this.context.memoryLimit.use(r.length + n.length), r + n;
|
|
2450
2450
|
}
|
|
2451
2451
|
function ga(t, e) {
|
|
2452
|
-
|
|
2452
|
+
R(arguments.length === 2, "prepend expect 2 arguments");
|
|
2453
2453
|
const r = h(t), n = h(e);
|
|
2454
2454
|
return this.context.memoryLimit.use(r.length + n.length), n + r;
|
|
2455
2455
|
}
|
|
@@ -2518,11 +2518,11 @@ function _a(t, e, r) {
|
|
|
2518
2518
|
const o = h(r);
|
|
2519
2519
|
return n.substring(0, s) + o + n.substring(s + i.length);
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function Ra(t, e = 50, r = "...") {
|
|
2522
2522
|
const n = h(t);
|
|
2523
2523
|
return this.context.memoryLimit.use(n.length), n.length <= e ? t : n.substring(0, e - r.length) + r;
|
|
2524
2524
|
}
|
|
2525
|
-
function
|
|
2525
|
+
function Pa(t, e = 15, r = "...") {
|
|
2526
2526
|
const n = h(t);
|
|
2527
2527
|
this.context.memoryLimit.use(n.length);
|
|
2528
2528
|
const i = n.split(/\s+/);
|
|
@@ -2577,13 +2577,13 @@ var Ia = /* @__PURE__ */ Object.freeze({
|
|
|
2577
2577
|
replace: Fa,
|
|
2578
2578
|
replace_first: Da,
|
|
2579
2579
|
replace_last: _a,
|
|
2580
|
-
truncate:
|
|
2581
|
-
truncatewords:
|
|
2580
|
+
truncate: Ra,
|
|
2581
|
+
truncatewords: Pa,
|
|
2582
2582
|
normalize_whitespace: Ea,
|
|
2583
2583
|
number_of_words: Na,
|
|
2584
2584
|
array_to_sentence_string: $a
|
|
2585
2585
|
});
|
|
2586
|
-
const ja = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Zs),
|
|
2586
|
+
const ja = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Zs), Ro), Mo), la), da), Ia), En);
|
|
2587
2587
|
class za extends T {
|
|
2588
2588
|
constructor(e, r, n) {
|
|
2589
2589
|
super(e, r, n), this.key = this.tokenizer.readIdentifier().content, this.tokenizer.assert(this.key, "expected variable name"), this.tokenizer.skipBlank(), this.tokenizer.assert(this.tokenizer.peek() === "=", 'expected "="'), this.tokenizer.advance(), this.value = new I(this.tokenizer.readFilteredValue(), this.liquid);
|
|
@@ -2662,7 +2662,7 @@ class Va extends T {
|
|
|
2662
2662
|
return e;
|
|
2663
2663
|
const r = this.tokenizer.readQuoted();
|
|
2664
2664
|
if (r)
|
|
2665
|
-
return
|
|
2665
|
+
return Rn(r);
|
|
2666
2666
|
throw this.tokenizer.error("invalid capture name");
|
|
2667
2667
|
}
|
|
2668
2668
|
}
|
|
@@ -2739,7 +2739,7 @@ class Wa extends T {
|
|
|
2739
2739
|
}
|
|
2740
2740
|
*render(e, r) {
|
|
2741
2741
|
const { liquid: n, hash: i } = this, s = yield Yt(this.file, e, n);
|
|
2742
|
-
|
|
2742
|
+
R(s, () => `illegal file path "${s}"`);
|
|
2743
2743
|
const o = e.spawn(), a = o.bottom();
|
|
2744
2744
|
if (Qe(a, yield i.render(e)), this.with) {
|
|
2745
2745
|
const { value: l, alias: c } = this.with;
|
|
@@ -2765,7 +2765,7 @@ function Wt(t, e, r) {
|
|
|
2765
2765
|
if (t.assert(s, "illegal file path"), s.getText() === "none")
|
|
2766
2766
|
return;
|
|
2767
2767
|
if (fo(s)) {
|
|
2768
|
-
const o = r.parse(
|
|
2768
|
+
const o = r.parse(Rn(s));
|
|
2769
2769
|
return xr(o);
|
|
2770
2770
|
}
|
|
2771
2771
|
return s;
|
|
@@ -2789,7 +2789,7 @@ class Ya extends T {
|
|
|
2789
2789
|
}
|
|
2790
2790
|
*render(e, r) {
|
|
2791
2791
|
const { liquid: n, hash: i, withVar: s } = this, { renderer: o } = n, a = yield Yt(this.file, e, n);
|
|
2792
|
-
|
|
2792
|
+
R(a, () => `illegal file path "${a}"`);
|
|
2793
2793
|
const l = e.saveRegister("blocks", "blockMode");
|
|
2794
2794
|
e.setRegister("blocks", {}), e.setRegister("blockMode", oe.OUTPUT);
|
|
2795
2795
|
const c = yield i.render(e);
|
|
@@ -2833,12 +2833,12 @@ class Za extends T {
|
|
|
2833
2833
|
value: new I(e.args, this.liquid),
|
|
2834
2834
|
templates: s = []
|
|
2835
2835
|
})).on("tag:elsif", (o) => {
|
|
2836
|
-
|
|
2836
|
+
R(!this.elseTemplates, "unexpected elsif after else"), this.branches.push({
|
|
2837
2837
|
value: new I(o.args, this.liquid),
|
|
2838
2838
|
templates: s = []
|
|
2839
2839
|
});
|
|
2840
2840
|
}).on("tag:else", (o) => {
|
|
2841
|
-
Je(o.args),
|
|
2841
|
+
Je(o.args), R(!this.elseTemplates, "duplicated else"), s = this.elseTemplates = [];
|
|
2842
2842
|
}).on("tag:endif", function(o) {
|
|
2843
2843
|
Je(o.args), this.stop();
|
|
2844
2844
|
}).on("template", (o) => s.push(o)).on("end", () => {
|
|
@@ -2879,7 +2879,7 @@ class Xa extends T {
|
|
|
2879
2879
|
return;
|
|
2880
2880
|
}
|
|
2881
2881
|
const a = yield Yt(this.file, e, n);
|
|
2882
|
-
|
|
2882
|
+
R(a, () => `illegal file path "${a}"`);
|
|
2883
2883
|
const l = yield n._parseLayoutFile(a, e.sync, this.currentFile);
|
|
2884
2884
|
e.setRegister("blockMode", oe.STORE);
|
|
2885
2885
|
const c = yield o.renderTemplates(this.templates, e), f = e.getRegister("blocks");
|
|
@@ -3507,7 +3507,7 @@ function _r(t, e) {
|
|
|
3507
3507
|
}
|
|
3508
3508
|
return r;
|
|
3509
3509
|
}
|
|
3510
|
-
function
|
|
3510
|
+
function Rr(t) {
|
|
3511
3511
|
for (var e = 1; e < arguments.length; e++) {
|
|
3512
3512
|
var r = arguments[e] != null ? arguments[e] : {};
|
|
3513
3513
|
e % 2 ? _r(Object(r), !0).forEach(function(n) {
|
|
@@ -3521,7 +3521,7 @@ function Pr(t) {
|
|
|
3521
3521
|
function yu(t, e, r) {
|
|
3522
3522
|
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Pr(t, e) {
|
|
3525
3525
|
return Tu(t) || bu(t, e) || vu(t, e) || wu();
|
|
3526
3526
|
}
|
|
3527
3527
|
function wu() {
|
|
@@ -3608,7 +3608,7 @@ var xu = ["second", "minute", "hour", "day", "week", "month", "quarter", "year"]
|
|
|
3608
3608
|
return ku(t, [{
|
|
3609
3609
|
key: "format",
|
|
3610
3610
|
value: function() {
|
|
3611
|
-
var r = Nr(arguments), n =
|
|
3611
|
+
var r = Nr(arguments), n = Pr(r, 2), i = n[0], s = n[1];
|
|
3612
3612
|
return this.getRule(i, s).replace("{0}", this.formatNumber(Math.abs(i)));
|
|
3613
3613
|
}
|
|
3614
3614
|
/**
|
|
@@ -3637,7 +3637,7 @@ var xu = ["second", "minute", "hour", "day", "week", "month", "quarter", "year"]
|
|
|
3637
3637
|
}, {
|
|
3638
3638
|
key: "formatToParts",
|
|
3639
3639
|
value: function() {
|
|
3640
|
-
var r = Nr(arguments), n =
|
|
3640
|
+
var r = Nr(arguments), n = Pr(r, 2), i = n[0], s = n[1], o = this.getRule(i, s), a = o.indexOf("{0}");
|
|
3641
3641
|
if (a < 0)
|
|
3642
3642
|
return [{
|
|
3643
3643
|
type: "literal",
|
|
@@ -3648,7 +3648,7 @@ var xu = ["second", "minute", "hour", "day", "week", "month", "quarter", "year"]
|
|
|
3648
3648
|
type: "literal",
|
|
3649
3649
|
value: o.slice(0, a)
|
|
3650
3650
|
}), l = l.concat(this.formatNumberToParts(Math.abs(i)).map(function(c) {
|
|
3651
|
-
return
|
|
3651
|
+
return Rr(Rr({}, c), {}, {
|
|
3652
3652
|
unit: s
|
|
3653
3653
|
});
|
|
3654
3654
|
})), a + 3 < o.length - 1 && l.push({
|
|
@@ -3757,21 +3757,21 @@ function Du(t) {
|
|
|
3757
3757
|
return t;
|
|
3758
3758
|
}
|
|
3759
3759
|
var _u = 'Invalid "number" argument';
|
|
3760
|
-
function
|
|
3760
|
+
function Ru(t) {
|
|
3761
3761
|
if (t = Number(t), Number.isFinite && !Number.isFinite(t))
|
|
3762
3762
|
throw new RangeError("".concat(_u, ": ").concat(t));
|
|
3763
3763
|
return t;
|
|
3764
3764
|
}
|
|
3765
|
-
function
|
|
3765
|
+
function Pu(t) {
|
|
3766
3766
|
return 1 / t === -1 / 0;
|
|
3767
3767
|
}
|
|
3768
3768
|
function Eu(t) {
|
|
3769
|
-
return t < 0 || t === 0 &&
|
|
3769
|
+
return t < 0 || t === 0 && Pu(t);
|
|
3770
3770
|
}
|
|
3771
3771
|
function Nr(t) {
|
|
3772
3772
|
if (t.length < 2)
|
|
3773
3773
|
throw new TypeError('"unit" argument is required');
|
|
3774
|
-
return [
|
|
3774
|
+
return [Ru(t[0]), Du(t[1])];
|
|
3775
3775
|
}
|
|
3776
3776
|
function Ze(t) {
|
|
3777
3777
|
"@babel/helpers - typeof";
|
|
@@ -3915,7 +3915,7 @@ function ye(t) {
|
|
|
3915
3915
|
function Vn(t) {
|
|
3916
3916
|
return t.factor !== void 0 ? t.factor : ye(t.unit || t.formatAs) || 1;
|
|
3917
3917
|
}
|
|
3918
|
-
function
|
|
3918
|
+
function Re(t) {
|
|
3919
3919
|
switch (t) {
|
|
3920
3920
|
case "floor":
|
|
3921
3921
|
return Math.floor;
|
|
@@ -4011,7 +4011,7 @@ function Yu(t, e, r) {
|
|
|
4011
4011
|
if (o !== -1) {
|
|
4012
4012
|
var a = t[o];
|
|
4013
4013
|
if (a.granularity) {
|
|
4014
|
-
var l =
|
|
4014
|
+
var l = Re(s)(Math.abs(e) / Vn(a) / a.granularity) * a.granularity;
|
|
4015
4015
|
if (l === 0 && o > 0)
|
|
4016
4016
|
return t[o - 1];
|
|
4017
4017
|
}
|
|
@@ -4035,7 +4035,7 @@ function Ju(t, e) {
|
|
|
4035
4035
|
function Qu(t, e, r) {
|
|
4036
4036
|
var n = r.now, i = r.round;
|
|
4037
4037
|
if (ye(t)) {
|
|
4038
|
-
var s = ye(t) * 1e3, o = e > n, a = Math.abs(e - n), l =
|
|
4038
|
+
var s = ye(t) * 1e3, o = e > n, a = Math.abs(e - n), l = Re(i)(a / s) * s;
|
|
4039
4039
|
return o ? l > 0 ? a - l + Gu(i, s) : a - l + 1 : -(a - l) + Zu(i, s);
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
@@ -4063,7 +4063,7 @@ function Ku(t, e, r) {
|
|
|
4063
4063
|
var d;
|
|
4064
4064
|
if (e && (e.getTimeToNextUpdate && (d = e.getTimeToNextUpdate(l, {
|
|
4065
4065
|
getTimeToNextUpdateForUnit: c,
|
|
4066
|
-
getRoundFunction:
|
|
4066
|
+
getRoundFunction: Re,
|
|
4067
4067
|
now: s,
|
|
4068
4068
|
future: o,
|
|
4069
4069
|
round: a
|
|
@@ -4446,7 +4446,7 @@ const pl = Ce(Ce({}, le), {}, {
|
|
|
4446
4446
|
minTime: Y
|
|
4447
4447
|
}) : t;
|
|
4448
4448
|
})
|
|
4449
|
-
}),
|
|
4449
|
+
}), Pe = {
|
|
4450
4450
|
steps: [{
|
|
4451
4451
|
formatAs: "second"
|
|
4452
4452
|
}, {
|
|
@@ -4501,11 +4501,11 @@ function Zr(t) {
|
|
|
4501
4501
|
function dl(t, e, r) {
|
|
4502
4502
|
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
4503
4503
|
}
|
|
4504
|
-
const ml = Zr(Zr({},
|
|
4504
|
+
const ml = Zr(Zr({}, Pe), {}, {
|
|
4505
4505
|
// Add "now".
|
|
4506
4506
|
steps: [{
|
|
4507
4507
|
formatAs: "now"
|
|
4508
|
-
}].concat(
|
|
4508
|
+
}].concat(Pe.steps)
|
|
4509
4509
|
});
|
|
4510
4510
|
function Gr(t, e) {
|
|
4511
4511
|
var r = Object.keys(t);
|
|
@@ -4531,9 +4531,9 @@ function Xr(t) {
|
|
|
4531
4531
|
function gl(t, e, r) {
|
|
4532
4532
|
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
4533
4533
|
}
|
|
4534
|
-
const _t = Xr(Xr({},
|
|
4534
|
+
const _t = Xr(Xr({}, Pe), {}, {
|
|
4535
4535
|
// Skip "seconds".
|
|
4536
|
-
steps:
|
|
4536
|
+
steps: Pe.steps.filter(function(t) {
|
|
4537
4537
|
return t.formatAs !== "second";
|
|
4538
4538
|
})
|
|
4539
4539
|
});
|
|
@@ -4582,7 +4582,7 @@ function vl(t) {
|
|
|
4582
4582
|
case "approximate-time":
|
|
4583
4583
|
return il;
|
|
4584
4584
|
case "mini":
|
|
4585
|
-
return
|
|
4585
|
+
return Pe;
|
|
4586
4586
|
case "mini-now":
|
|
4587
4587
|
return ml;
|
|
4588
4588
|
case "mini-minute":
|
|
@@ -4680,7 +4680,7 @@ function Ll(t, e) {
|
|
|
4680
4680
|
function Al(t, e, r) {
|
|
4681
4681
|
return e && Ll(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
4682
4682
|
}
|
|
4683
|
-
var
|
|
4683
|
+
var P = /* @__PURE__ */ function() {
|
|
4684
4684
|
function t() {
|
|
4685
4685
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = r.polyfill;
|
|
4686
4686
|
xl(this, t), typeof e == "string" && (e = [e]), this.locale = Mu(e.concat(t.getDefaultLocale()), me), typeof Intl < "u" && Intl.NumberFormat && (this.numberFormat = new Intl.NumberFormat(this.locale)), n === !1 ? (this.IntlRelativeTimeFormat = Intl.RelativeTimeFormat, this.IntlPluralRules = Intl.PluralRules) : (this.IntlRelativeTimeFormat = X, this.IntlPluralRules = X.PluralRules), this.relativeTimeFormatCache = new $r(), this.pluralRulesCache = new $r();
|
|
@@ -4688,10 +4688,10 @@ var R = /* @__PURE__ */ function() {
|
|
|
4688
4688
|
return Al(t, [{
|
|
4689
4689
|
key: "format",
|
|
4690
4690
|
value: function(r, n, i) {
|
|
4691
|
-
i || (n && !
|
|
4691
|
+
i || (n && !Pl(n) ? (i = n, n = void 0) : i = {}), n || (n = At), typeof n == "string" && (n = vl(n));
|
|
4692
4692
|
var s = Fl(r), o = this.getLabels(n.flavour || n.labels), a = o.labels, l = o.labelsType, c;
|
|
4693
4693
|
n.now !== void 0 && (c = n.now), c === void 0 && i.now !== void 0 && (c = i.now), c === void 0 && (c = Date.now());
|
|
4694
|
-
var f = (c - s) / 1e3, d = i.future || f < 0, g =
|
|
4694
|
+
var f = (c - s) / 1e3, d = i.future || f < 0, g = Rl(a, me(this.locale).now, me(this.locale).long, d);
|
|
4695
4695
|
if (n.custom) {
|
|
4696
4696
|
var v = n.custom({
|
|
4697
4697
|
now: c,
|
|
@@ -4764,8 +4764,8 @@ var R = /* @__PURE__ */ function() {
|
|
|
4764
4764
|
if (v === "now")
|
|
4765
4765
|
return c;
|
|
4766
4766
|
var F = Math.abs(i) / Vn(n);
|
|
4767
|
-
n.granularity && (F =
|
|
4768
|
-
var k = -1 * Math.sign(i) *
|
|
4767
|
+
n.granularity && (F = Re(g)(F / n.granularity) * n.granularity);
|
|
4768
|
+
var k = -1 * Math.sign(i) * Re(g)(F);
|
|
4769
4769
|
switch (k === 0 && (d ? k = 0 : k = -0), l) {
|
|
4770
4770
|
case "long":
|
|
4771
4771
|
case "short":
|
|
@@ -4883,23 +4883,23 @@ var R = /* @__PURE__ */ function() {
|
|
|
4883
4883
|
}
|
|
4884
4884
|
}]), t;
|
|
4885
4885
|
}(), Xn = "en";
|
|
4886
|
-
|
|
4886
|
+
P.getDefaultLocale = function() {
|
|
4887
4887
|
return Xn;
|
|
4888
4888
|
};
|
|
4889
|
-
|
|
4889
|
+
P.setDefaultLocale = function(t) {
|
|
4890
4890
|
return Xn = t;
|
|
4891
4891
|
};
|
|
4892
|
-
|
|
4892
|
+
P.addDefaultLocale = function(t) {
|
|
4893
4893
|
if (rn)
|
|
4894
4894
|
return console.error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");
|
|
4895
|
-
rn = !0,
|
|
4895
|
+
rn = !0, P.setDefaultLocale(t.locale), P.addLocale(t);
|
|
4896
4896
|
};
|
|
4897
4897
|
var rn;
|
|
4898
|
-
|
|
4898
|
+
P.addLocale = function(t) {
|
|
4899
4899
|
Jn(t), X.addLocale(t);
|
|
4900
4900
|
};
|
|
4901
|
-
|
|
4902
|
-
|
|
4901
|
+
P.locale = P.addLocale;
|
|
4902
|
+
P.addLabels = function(t, e, r) {
|
|
4903
4903
|
var n = me(t);
|
|
4904
4904
|
n || (Jn({
|
|
4905
4905
|
locale: t
|
|
@@ -4921,14 +4921,14 @@ function _l(t, e, r) {
|
|
|
4921
4921
|
return i === "now" || n.indexOf(i) >= 0;
|
|
4922
4922
|
})), n;
|
|
4923
4923
|
}
|
|
4924
|
-
function
|
|
4924
|
+
function Rl(t, e, r, n) {
|
|
4925
4925
|
var i = t.now || e && e.now;
|
|
4926
4926
|
if (i)
|
|
4927
4927
|
return typeof i == "string" ? i : n ? i.future : i.past;
|
|
4928
4928
|
if (r && r.second && r.second.current)
|
|
4929
4929
|
return r.second.current;
|
|
4930
4930
|
}
|
|
4931
|
-
function
|
|
4931
|
+
function Pl(t) {
|
|
4932
4932
|
return typeof t == "string" || qu(t);
|
|
4933
4933
|
}
|
|
4934
4934
|
const Kn = {
|
|
@@ -5210,15 +5210,15 @@ const Kn = {
|
|
|
5210
5210
|
}
|
|
5211
5211
|
};
|
|
5212
5212
|
var El = ["date", "verboseDate", "tooltip", "children"];
|
|
5213
|
-
function
|
|
5214
|
-
return
|
|
5213
|
+
function Rt() {
|
|
5214
|
+
return Rt = Object.assign || function(t) {
|
|
5215
5215
|
for (var e = 1; e < arguments.length; e++) {
|
|
5216
5216
|
var r = arguments[e];
|
|
5217
5217
|
for (var n in r)
|
|
5218
5218
|
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
5219
5219
|
}
|
|
5220
5220
|
return t;
|
|
5221
|
-
},
|
|
5221
|
+
}, Rt.apply(this, arguments);
|
|
5222
5222
|
}
|
|
5223
5223
|
function Nl(t, e) {
|
|
5224
5224
|
if (t == null) return {};
|
|
@@ -5241,7 +5241,7 @@ function Ke(t, e) {
|
|
|
5241
5241
|
var r = t.date, n = t.verboseDate, i = t.tooltip, s = t.children, o = Nl(t, El), a = ne(function() {
|
|
5242
5242
|
return r.toISOString();
|
|
5243
5243
|
}, [r]);
|
|
5244
|
-
return /* @__PURE__ */ De.createElement("time",
|
|
5244
|
+
return /* @__PURE__ */ De.createElement("time", Rt({
|
|
5245
5245
|
ref: e
|
|
5246
5246
|
}, o, {
|
|
5247
5247
|
dateTime: a,
|
|
@@ -5288,20 +5288,20 @@ function zl(t, e) {
|
|
|
5288
5288
|
r = null;
|
|
5289
5289
|
}, n;
|
|
5290
5290
|
}
|
|
5291
|
-
function
|
|
5291
|
+
function Pt(t) {
|
|
5292
5292
|
"@babel/helpers - typeof";
|
|
5293
|
-
return
|
|
5293
|
+
return Pt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
5294
5294
|
return typeof e;
|
|
5295
5295
|
} : function(e) {
|
|
5296
5296
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
5297
|
-
},
|
|
5297
|
+
}, Pt(t);
|
|
5298
5298
|
}
|
|
5299
5299
|
function Ml(t) {
|
|
5300
5300
|
if (ei())
|
|
5301
5301
|
return Intl.DateTimeFormat.supportedLocalesOf(t)[0];
|
|
5302
5302
|
}
|
|
5303
5303
|
function ei() {
|
|
5304
|
-
var t = (typeof Intl > "u" ? "undefined" :
|
|
5304
|
+
var t = (typeof Intl > "u" ? "undefined" : Pt(Intl)) === "object";
|
|
5305
5305
|
return t && typeof Intl.DateTimeFormat == "function";
|
|
5306
5306
|
}
|
|
5307
5307
|
function et(t) {
|
|
@@ -5391,7 +5391,7 @@ function Zl(t) {
|
|
|
5391
5391
|
var on = new ti();
|
|
5392
5392
|
function Gl(t, e) {
|
|
5393
5393
|
var r = e.polyfill, n = String(t) + ":" + String(r);
|
|
5394
|
-
return on.get(n) || on.put(n, new
|
|
5394
|
+
return on.get(n) || on.put(n, new P(t, {
|
|
5395
5395
|
polyfill: r
|
|
5396
5396
|
}));
|
|
5397
5397
|
}
|
|
@@ -5613,7 +5613,7 @@ function dc(t) {
|
|
|
5613
5613
|
}
|
|
5614
5614
|
function mc(t) {
|
|
5615
5615
|
var e = t.date, r = t.future, n = t.locale, i = t.locales, s = t.timeStyle, o = t.round, a = t.minTimeLeft, l = t.formatVerboseDate, c = t.verboseDateFormat, f = c === void 0 ? wc : c, d = t.updateInterval, g = t.tick, v = g === void 0 ? !0 : g, F = t.now, k = t.timeOffset, D = k === void 0 ? 0 : k, O = t.polyfill, y = ne(function() {
|
|
5616
|
-
return n && (i = [n]), i.concat(
|
|
5616
|
+
return n && (i = [n]), i.concat(P.getDefaultLocale());
|
|
5617
5617
|
}, [n, i]), U = ne(function() {
|
|
5618
5618
|
return Gl(y, {
|
|
5619
5619
|
polyfill: O
|
|
@@ -5836,8 +5836,8 @@ rt.propTypes = {
|
|
|
5836
5836
|
wrapperProps: p.object
|
|
5837
5837
|
};
|
|
5838
5838
|
rt = /* @__PURE__ */ De.memo(rt);
|
|
5839
|
-
|
|
5840
|
-
|
|
5839
|
+
P.addDefaultLocale(Kn);
|
|
5840
|
+
P.addLocale(Kn);
|
|
5841
5841
|
const kc = di.div`
|
|
5842
5842
|
cursor: ${(t) => t.$redirect ? "pointer" : "default"};
|
|
5843
5843
|
|
|
@@ -5858,7 +5858,11 @@ const kc = di.div`
|
|
|
5858
5858
|
var F, k, D, O;
|
|
5859
5859
|
if (t.renderer)
|
|
5860
5860
|
return t.renderer(t.notifications);
|
|
5861
|
-
const e = new Jt(), r = t.notifications.length, n = t.notifications[r - 1], i = (k = (F = n.deliveryOptions) == null ? void 0 : F.instant) != null && k.batching ? (D = n.template) == null ? void 0 : D.batch : (O = n.template) == null ? void 0 : O.instant
|
|
5861
|
+
const e = new Jt(), r = t.notifications.length, n = t.notifications[r - 1], i = (k = (F = n.deliveryOptions) == null ? void 0 : F.instant) != null && k.batching ? (D = n.template) == null ? void 0 : D.batch : ((O = n.template) == null ? void 0 : O.instant) ?? {
|
|
5862
|
+
title: n.title,
|
|
5863
|
+
redirectURL: n.redirectURL,
|
|
5864
|
+
imageURL: n.imageURL
|
|
5865
|
+
};
|
|
5862
5866
|
let s = { _items: [] };
|
|
5863
5867
|
t.notifications.forEach((y) => {
|
|
5864
5868
|
s = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notificationapi/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"overrides": {
|
|
7
7
|
"esbuild": "^0.25.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"glob": "^10.4.1",
|
|
48
48
|
"prettier": "^3.3.3",
|
|
49
49
|
"typescript": "^5.2.2",
|
|
50
|
-
"vite": "^5.4.
|
|
50
|
+
"vite": "^5.4.16",
|
|
51
51
|
"vite-plugin-dts": "^3.9.1",
|
|
52
52
|
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
53
53
|
},
|