1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

common: add routeName to component props in mapRoutes

This commit is contained in:
David Sevilla Martin
2020-05-03 10:48:33 -04:00
parent 717e8aa27e
commit b00eae1ce9
6 changed files with 9168 additions and 8329 deletions

495
js/dist/admin.js vendored
View File

@@ -175,6 +175,33 @@ function _inheritsLoose(subClass, superClass) {
/***/ }), /***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; });
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
/***/ }),
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/imports-loader/index.js?this=>window!./node_modules/source-map-loader/index.js!./node_modules/zepto/dist/zepto.js": /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/imports-loader/index.js?this=>window!./node_modules/source-map-loader/index.js!./node_modules/zepto/dist/zepto.js":
/*!**************************************************************************************************************************************************************!*\ /*!**************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib??ref--5!./node_modules/imports-loader?this=>window!./node_modules/source-map-loader!./node_modules/zepto/dist/zepto.js ***! !*** ./node_modules/babel-loader/lib??ref--5!./node_modules/imports-loader?this=>window!./node_modules/source-map-loader!./node_modules/zepto/dist/zepto.js ***!
@@ -1975,14 +2002,14 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
/*! no static exports found */ /*! no static exports found */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
!function (t, n) { !function (t, e) {
true ? module.exports = n() : undefined; true ? module.exports = e() : undefined;
}(this, function () { }(this, function () {
"use strict"; "use strict";
var t = "millisecond", var t = "millisecond",
n = "second", e = "second",
e = "minute", n = "minute",
r = "hour", r = "hour",
i = "day", i = "day",
s = "week", s = "week",
@@ -1991,25 +2018,25 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
a = "year", a = "year",
h = /^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/, h = /^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,
f = /\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, f = /\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
c = function c(t, n, e) { c = function c(t, e, n) {
var r = String(t); var r = String(t);
return !r || r.length >= n ? t : "" + Array(n + 1 - r.length).join(e) + t; return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
}, },
d = { d = {
s: c, s: c,
z: function z(t) { z: function z(t) {
var n = -t.utcOffset(), var e = -t.utcOffset(),
e = Math.abs(n), n = Math.abs(e),
r = Math.floor(e / 60), r = Math.floor(n / 60),
i = e % 60; i = n % 60;
return (n <= 0 ? "+" : "-") + c(r, 2, "0") + ":" + c(i, 2, "0"); return (e <= 0 ? "+" : "-") + c(r, 2, "0") + ":" + c(i, 2, "0");
}, },
m: function m(t, n) { m: function m(t, e) {
var e = 12 * (n.year() - t.year()) + (n.month() - t.month()), var n = 12 * (e.year() - t.year()) + (e.month() - t.month()),
r = t.clone().add(e, u), r = t.clone().add(n, u),
i = n - r < 0, i = e - r < 0,
s = t.clone().add(e + (i ? -1 : 1), u); s = t.clone().add(n + (i ? -1 : 1), u);
return Number(-(e + (n - r) / (i ? r - s : s - r)) || 0); return Number(-(n + (e - r) / (i ? r - s : s - r)) || 0);
}, },
a: function a(t) { a: function a(t) {
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
@@ -2022,8 +2049,8 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
d: i, d: i,
D: "date", D: "date",
h: r, h: r,
m: e, m: n,
s: n, s: e,
ms: t, ms: t,
Q: o Q: o
}[h] || String(h || "").toLowerCase().replace(/s$/, ""); }[h] || String(h || "").toLowerCase().replace(/s$/, "");
@@ -2045,30 +2072,27 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
var y = function y(t) { var y = function y(t) {
return t instanceof v; return t instanceof v;
}, },
M = function M(t, n, e) { M = function M(t, e, n) {
var r; var r;
if (!t) return l; if (!t) return l;
if ("string" == typeof t) m[t] && (r = t), n && (m[t] = n, r = t);else { if ("string" == typeof t) m[t] && (r = t), e && (m[t] = e, r = t);else {
var i = t.name; var i = t.name;
m[i] = t, r = i; m[i] = t, r = i;
} }
return !e && r && (l = r), r || !e && l; return !n && r && (l = r), r || !n && l;
}, },
g = function g(t, n, e) { g = function g(t, e) {
if (y(t)) return t.clone(); if (y(t)) return t.clone();
var r = n ? "string" == typeof n ? { var n = "object" == typeof e ? e : {};
format: n, return n.date = t, n.args = arguments, new v(n);
pl: e
} : n : {};
return r.date = t, new v(r);
}, },
D = d; D = d;
D.l = M, D.i = y, D.w = function (t, n) { D.l = M, D.i = y, D.w = function (t, e) {
return g(t, { return g(t, {
locale: n.$L, locale: e.$L,
utc: n.$u, utc: e.$u,
$offset: n.$offset $offset: e.$offset
}); });
}; };
@@ -2080,18 +2104,18 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
var d = c.prototype; var d = c.prototype;
return d.parse = function (t) { return d.parse = function (t) {
this.$d = function (t) { this.$d = function (t) {
var n = t.date, var e = t.date,
e = t.utc; n = t.utc;
if (null === n) return new Date(NaN); if (null === e) return new Date(NaN);
if (D.u(n)) return new Date(); if (D.u(e)) return new Date();
if (n instanceof Date) return new Date(n); if (e instanceof Date) return new Date(e);
if ("string" == typeof n && !/Z$/i.test(n)) { if ("string" == typeof e && !/Z$/i.test(e)) {
var r = n.match(h); var r = e.match(h);
if (r) return e ? new Date(Date.UTC(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0)) : new Date(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0); if (r) return n ? new Date(Date.UTC(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0)) : new Date(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0);
} }
return new Date(n); return new Date(e);
}(t), this.init(); }(t), this.init();
}, d.init = function () { }, d.init = function () {
var t = this.$d; var t = this.$d;
@@ -2100,15 +2124,15 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
return D; return D;
}, d.isValid = function () { }, d.isValid = function () {
return !("Invalid Date" === this.$d.toString()); return !("Invalid Date" === this.$d.toString());
}, d.isSame = function (t, n) { }, d.isSame = function (t, e) {
var e = g(t); var n = g(t);
return this.startOf(n) <= e && e <= this.endOf(n); return this.startOf(e) <= n && n <= this.endOf(e);
}, d.isAfter = function (t, n) { }, d.isAfter = function (t, e) {
return g(t) < this.startOf(n); return g(t) < this.startOf(e);
}, d.isBefore = function (t, n) { }, d.isBefore = function (t, e) {
return this.endOf(n) < g(t); return this.endOf(e) < g(t);
}, d.$g = function (t, n, e) { }, d.$g = function (t, e, n) {
return D.u(t) ? this[n] : this.set(e, t); return D.u(t) ? this[e] : this.set(n, t);
}, d.year = function (t) { }, d.year = function (t) {
return this.$g(t, "$y", a); return this.$g(t, "$y", a);
}, d.month = function (t) { }, d.month = function (t) {
@@ -2120,11 +2144,11 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}, d.hour = function (t) { }, d.hour = function (t) {
return this.$g(t, "$H", r); return this.$g(t, "$H", r);
}, d.minute = function (t) { }, d.minute = function (t) {
return this.$g(t, "$m", e); return this.$g(t, "$m", n);
}, d.second = function (t) { }, d.second = function (t) {
return this.$g(t, "$s", n); return this.$g(t, "$s", e);
}, d.millisecond = function (n) { }, d.millisecond = function (e) {
return this.$g(n, "$ms", t); return this.$g(e, "$ms", t);
}, d.unix = function () { }, d.unix = function () {
return Math.floor(this.valueOf() / 1e3); return Math.floor(this.valueOf() / 1e3);
}, d.valueOf = function () { }, d.valueOf = function () {
@@ -2133,12 +2157,12 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
var h = this, var h = this,
f = !!D.u(o) || o, f = !!D.u(o) || o,
c = D.p(t), c = D.p(t),
d = function d(t, n) { d = function d(t, e) {
var e = D.w(h.$u ? Date.UTC(h.$y, n, t) : new Date(h.$y, n, t), h); var n = D.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h);
return f ? e : e.endOf(i); return f ? n : n.endOf(i);
}, },
$ = function $(t, n) { $ = function $(t, e) {
return D.w(h.toDate()[t].apply(h.toDate(), (f ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(n)), h); return D.w(h.toDate()[t].apply(h.toDate("s"), (f ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h);
}, },
l = this.$W, l = this.$W,
m = this.$M, m = this.$M,
@@ -2164,10 +2188,10 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
case r: case r:
return $(M + "Minutes", 1); return $(M + "Minutes", 1);
case e: case n:
return $(M + "Seconds", 2); return $(M + "Seconds", 2);
case n: case e:
return $(M + "Milliseconds", 3); return $(M + "Milliseconds", 3);
default: default:
@@ -2179,7 +2203,7 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
var h, var h,
f = D.p(s), f = D.p(s),
c = "set" + (this.$u ? "UTC" : ""), c = "set" + (this.$u ? "UTC" : ""),
d = (h = {}, h[i] = c + "Date", h.date = c + "Date", h[u] = c + "Month", h[a] = c + "FullYear", h[r] = c + "Hours", h[e] = c + "Minutes", h[n] = c + "Seconds", h[t] = c + "Milliseconds", h)[f], d = (h = {}, h[i] = c + "Date", h.date = c + "Date", h[u] = c + "Month", h[a] = c + "FullYear", h[r] = c + "Hours", h[n] = c + "Minutes", h[e] = c + "Seconds", h[t] = c + "Milliseconds", h)[f],
$ = f === i ? this.$D + (o - this.$W) : o; $ = f === i ? this.$D + (o - this.$W) : o;
if (f === u || f === a) { if (f === u || f === a) {
@@ -2188,8 +2212,8 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
} else d && this.$d[d]($); } else d && this.$d[d]($);
return this.init(), this; return this.init(), this;
}, d.set = function (t, n) { }, d.set = function (t, e) {
return this.clone().$set(t, n); return this.clone().$set(t, e);
}, d.get = function (t) { }, d.get = function (t) {
return this[D.p(t)](); return this[D.p(t)]();
}, d.add = function (t, o) { }, d.add = function (t, o) {
@@ -2198,25 +2222,25 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
t = Number(t); t = Number(t);
var c = D.p(o), var c = D.p(o),
d = function d(n) { d = function d(e) {
var e = g(f); var n = g(f);
return D.w(e.date(e.date() + Math.round(n * t)), f); return D.w(n.date(n.date() + Math.round(e * t)), f);
}; };
if (c === u) return this.set(u, this.$M + t); if (c === u) return this.set(u, this.$M + t);
if (c === a) return this.set(a, this.$y + t); if (c === a) return this.set(a, this.$y + t);
if (c === i) return d(1); if (c === i) return d(1);
if (c === s) return d(7); if (c === s) return d(7);
var $ = (h = {}, h[e] = 6e4, h[r] = 36e5, h[n] = 1e3, h)[c] || 1, var $ = (h = {}, h[n] = 6e4, h[r] = 36e5, h[e] = 1e3, h)[c] || 1,
l = this.$d.getTime() + t * $; l = this.$d.getTime() + t * $;
return D.w(l, this); return D.w(l, this);
}, d.subtract = function (t, n) { }, d.subtract = function (t, e) {
return this.add(-1 * t, n); return this.add(-1 * t, e);
}, d.format = function (t) { }, d.format = function (t) {
var n = this; var e = this;
if (!this.isValid()) return "Invalid Date"; if (!this.isValid()) return "Invalid Date";
var e = t || "YYYY-MM-DDTHH:mm:ssZ", var n = t || "YYYY-MM-DDTHH:mm:ssZ",
r = D.z(this), r = D.z(this),
i = this.$locale(), i = this.$locale(),
s = this.$H, s = this.$H,
@@ -2225,14 +2249,14 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
a = i.weekdays, a = i.weekdays,
h = i.months, h = i.months,
c = function c(t, r, i, s) { c = function c(t, r, i, s) {
return t && (t[r] || t(n, e)) || i[r].substr(0, s); return t && (t[r] || t(e, n)) || i[r].substr(0, s);
}, },
d = function d(t) { d = function d(t) {
return D.s(s % 12 || 12, t, "0"); return D.s(s % 12 || 12, t, "0");
}, },
$ = i.meridiem || function (t, n, e) { $ = i.meridiem || function (t, e, n) {
var r = t < 12 ? "AM" : "PM"; var r = t < 12 ? "AM" : "PM";
return e ? r.toLowerCase() : r; return n ? r.toLowerCase() : r;
}, },
l = { l = {
YY: String(this.$y).slice(-2), YY: String(this.$y).slice(-2),
@@ -2240,7 +2264,7 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
M: o + 1, M: o + 1,
MM: D.s(o + 1, 2, "0"), MM: D.s(o + 1, 2, "0"),
MMM: c(i.monthsShort, o, h, 3), MMM: c(i.monthsShort, o, h, 3),
MMMM: h[o] || h(this, e), MMMM: h[o] || h(this, n),
D: this.$D, D: this.$D,
DD: D.s(this.$D, 2, "0"), DD: D.s(this.$D, 2, "0"),
d: String(this.$W), d: String(this.$W),
@@ -2261,8 +2285,8 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Z: r Z: r
}; };
return e.replace(f, function (t, n) { return n.replace(f, function (t, e) {
return n || l[t] || r.replace(":", ""); return e || l[t] || r.replace(":", "");
}); });
}, d.utcOffset = function () { }, d.utcOffset = function () {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
@@ -2273,16 +2297,16 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
l = 6e4 * ($.utcOffset() - this.utcOffset()), l = 6e4 * ($.utcOffset() - this.utcOffset()),
m = this - $, m = this - $,
y = D.m(this, $); y = D.m(this, $);
return y = (c = {}, c[a] = y / 12, c[u] = y, c[o] = y / 3, c[s] = (m - l) / 6048e5, c[i] = (m - l) / 864e5, c[r] = m / 36e5, c[e] = m / 6e4, c[n] = m / 1e3, c)[d] || m, f ? y : D.a(y); return y = (c = {}, c[a] = y / 12, c[u] = y, c[o] = y / 3, c[s] = (m - l) / 6048e5, c[i] = (m - l) / 864e5, c[r] = m / 36e5, c[n] = m / 6e4, c[e] = m / 1e3, c)[d] || m, f ? y : D.a(y);
}, d.daysInMonth = function () { }, d.daysInMonth = function () {
return this.endOf(u).$D; return this.endOf(u).$D;
}, d.$locale = function () { }, d.$locale = function () {
return m[this.$L]; return m[this.$L];
}, d.locale = function (t, n) { }, d.locale = function (t, e) {
if (!t) return this.$L; if (!t) return this.$L;
var e = this.clone(), var n = this.clone(),
r = M(t, n, !0); r = M(t, e, !0);
return r && (e.$L = r), e; return r && (n.$L = r), n;
}, d.clone = function () { }, d.clone = function () {
return D.w(this.$d, this); return D.w(this.$d, this);
}, d.toDate = function () { }, d.toDate = function () {
@@ -2296,8 +2320,8 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}, c; }, c;
}(); }();
return g.prototype = v.prototype, g.extend = function (t, n) { return g.prototype = v.prototype, g.extend = function (t, e) {
return t(n, v, g), g; return t(e, v, g), g;
}, g.locale = M, g.isDayjs = y, g.unix = function (t) { }, g.locale = M, g.isDayjs = y, g.unix = function (t) {
return g(1e3 * t); return g(1e3 * t);
}, g.en = m[l], g.Ls = m, g; }, g.en = m[l], g.Ls = m, g;
@@ -3768,8 +3792,8 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
return function (r, t, e) { return function (r, t, e) {
r = r || {}; r = r || {};
var n = t.prototype; var n = t.prototype,
e.en.relativeTime = { o = {
future: "in %s", future: "in %s",
past: "%s ago", past: "%s ago",
s: "a few seconds", s: "a few seconds",
@@ -3784,9 +3808,10 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
y: "a year", y: "a year",
yy: "%d years" yy: "%d years"
}; };
e.en.relativeTime = o;
var o = function o(t, n, _o, d) { var d = function d(t, n, _d, i) {
for (var i, u, a, s = _o.$locale().relativeTime, f = r.thresholds || [{ for (var u, a, s, f = _d.$locale().relativeTime || o, l = r.thresholds || [{
l: "s", l: "s",
r: 44, r: 44,
d: "second" d: "second"
@@ -3824,36 +3849,36 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
}, { }, {
l: "yy", l: "yy",
d: "year" d: "year"
}], l = f.length, h = 0; h < l; h += 1) { }], h = l.length, m = 0; m < h; m += 1) {
var m = f[h]; var c = l[m];
m.d && (i = d ? e(t).diff(_o, m.d, !0) : _o.diff(t, m.d, !0)); c.d && (u = i ? e(t).diff(_d, c.d, !0) : _d.diff(t, c.d, !0));
var c = (r.rounding || Math.round)(Math.abs(i)); var y = (r.rounding || Math.round)(Math.abs(u));
if (a = i > 0, c <= m.r || !m.r) { if (s = u > 0, y <= c.r || !c.r) {
c <= 1 && h > 0 && (m = f[h - 1]); y <= 1 && m > 0 && (c = l[m - 1]);
var y = s[m.l]; var p = f[c.l];
u = "string" == typeof y ? y.replace("%d", c) : y(c, n, m.l, a); a = "string" == typeof p ? p.replace("%d", y) : p(y, n, c.l, s);
break; break;
} }
} }
return n ? u : (a ? s.future : s.past).replace("%s", u); return n ? a : (s ? f.future : f.past).replace("%s", a);
}; };
n.to = function (r, t) { n.to = function (r, t) {
return o(r, t, this, !0); return d(r, t, this, !0);
}, n.from = function (r, t) { }, n.from = function (r, t) {
return o(r, t, this); return d(r, t, this);
}; };
var d = function d(r) { var i = function i(r) {
return r.$u ? e.utc() : e(); return r.$u ? e.utc() : e();
}; };
n.toNow = function (r) { n.toNow = function (r) {
return this.to(d(this), r); return this.to(i(this), r);
}, n.fromNow = function (r) { }, n.fromNow = function (r) {
return this.from(d(this), r); return this.from(i(this), r);
}; };
}; };
}); });
@@ -13056,10 +13081,10 @@ var AdminNav = /*#__PURE__*/function (_Component) {
buttonClassName: "Button" buttonClassName: "Button"
}, this.items().toArray()); }, this.items().toArray());
} }
/** /**
* Build an item list of links to show in the admin navigation. * Build an item list of links to show in the admin navigation.
* *
* @return {ItemList} * @return {ItemList}
*/ */
; ;
@@ -13419,12 +13444,12 @@ var BasicsPage = /*#__PURE__*/function (_Page) {
return _this4.values[key]() !== _app__WEBPACK_IMPORTED_MODULE_1__["default"].data.settings[key]; return _this4.values[key]() !== _app__WEBPACK_IMPORTED_MODULE_1__["default"].data.settings[key];
}); });
} }
/** /**
* Build a list of options for the default homepage. Each option must be an * Build a list of options for the default homepage. Each option must be an
* object with `path` and `label` properties. * object with `path` and `label` properties.
* *
* @return {ItemList} * @return {ItemList}
* @public * @public
*/ */
; ;
@@ -13540,20 +13565,20 @@ var DashboardWidget = /*#__PURE__*/function (_Component) {
className: 'DashboardWidget ' + this.className() className: 'DashboardWidget ' + this.className()
}, this.content()); }, this.content());
} }
/** /**
* Get the class name to apply to the widget. * Get the class name to apply to the widget.
* *
* @return {String} * @return {String}
*/ */
; ;
_proto.className = function className() { _proto.className = function className() {
return ''; return '';
} }
/** /**
* Get the content of the widget. * Get the content of the widget.
* *
* @return {VirtualElement} * @return {VirtualElement}
*/ */
; ;
@@ -13753,9 +13778,9 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `EditGroupModal` component shows a modal dialog which allows the user * The `EditGroupModal` component shows a modal dialog which allows the user
* to create or edit a group. * to create or edit a group.
*/ */
var EditGroupModal = /*#__PURE__*/function (_Modal) { var EditGroupModal = /*#__PURE__*/function (_Modal) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(EditGroupModal, _Modal); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(EditGroupModal, _Modal);
@@ -14071,9 +14096,9 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `HeaderPrimary` component displays primary header controls. On the * The `HeaderPrimary` component displays primary header controls. On the
* default skin, these are shown just to the right of the forum title. * default skin, these are shown just to the right of the forum title.
*/ */
var HeaderPrimary = /*#__PURE__*/function (_Component) { var HeaderPrimary = /*#__PURE__*/function (_Component) {
@@ -14090,10 +14115,10 @@ var HeaderPrimary = /*#__PURE__*/function (_Component) {
className: "Header-controls" className: "Header-controls"
}, Object(_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__["default"])(this.items().toArray())); }, Object(_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_3__["default"])(this.items().toArray()));
} }
/** /**
* Build an item list for the controls. * Build an item list for the controls.
* *
* @return {ItemList} * @return {ItemList}
*/ */
; ;
@@ -14128,8 +14153,8 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `HeaderSecondary` component displays secondary header controls. * The `HeaderSecondary` component displays secondary header controls.
*/ */
var HeaderSecondary = /*#__PURE__*/function (_Component) { var HeaderSecondary = /*#__PURE__*/function (_Component) {
@@ -14146,10 +14171,10 @@ var HeaderSecondary = /*#__PURE__*/function (_Component) {
className: "Header-controls" className: "Header-controls"
}, Object(_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_4__["default"])(this.items().toArray())); }, Object(_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_4__["default"])(this.items().toArray()));
} }
/** /**
* Build an item list for the controls. * Build an item list for the controls.
* *
* @return {ItemList} * @return {ItemList}
*/ */
; ;
@@ -14348,7 +14373,7 @@ var MailPage = /*#__PURE__*/function (_Page) {
options: Object.keys(this.driverFields).reduce(function (memo, val) { options: Object.keys(this.driverFields).reduce(function (memo, val) {
var _extends2; var _extends2;
return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, memo, (_extends2 = {}, _extends2[val] = val, _extends2)); return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, memo), {}, (_extends2 = {}, _extends2[val] = val, _extends2));
}, {}), }, {}),
onchange: this.values.mail_driver onchange: this.values.mail_driver
})))] })))]
@@ -14447,8 +14472,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/Component */ "./src/common/Component.ts"); /* harmony import */ var _common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/Component */ "./src/common/Component.ts");
/** /**
* The `Page` component * The `Page` component
*/ */
var Page = /*#__PURE__*/function (_Component) { var Page = /*#__PURE__*/function (_Component) {
@@ -15060,9 +15085,9 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `SessionDropdown` component shows a button with the current user's * The `SessionDropdown` component shows a button with the current user's
* avatar/name, with a dropdown of session controls. * avatar/name, with a dropdown of session controls.
*/ */
var SessionDropdown = /*#__PURE__*/function (_Dropdown) { var SessionDropdown = /*#__PURE__*/function (_Dropdown) {
@@ -15093,10 +15118,10 @@ var SessionDropdown = /*#__PURE__*/function (_Dropdown) {
className: "Button-label" className: "Button-label"
}, Object(_common_helpers_username__WEBPACK_IMPORTED_MODULE_2__["default"])(user))]; }, Object(_common_helpers_username__WEBPACK_IMPORTED_MODULE_2__["default"])(user))];
} }
/** /**
* Build an item list for the contents of the dropdown menu. * Build an item list for the contents of the dropdown menu.
* *
* @return {ItemList} * @return {ItemList}
*/ */
; ;
@@ -15411,8 +15436,8 @@ var UploadImageButton = /*#__PURE__*/function (_Button) {
return _Button.prototype.view.call(this); return _Button.prototype.view.call(this);
} }
/** /**
* Prompt the user to upload an image. * Prompt the user to upload an image.
*/ */
; ;
@@ -15436,8 +15461,8 @@ var UploadImageButton = /*#__PURE__*/function (_Button) {
}).then(_this2.success.bind(_this2), _this2.failure.bind(_this2)); }).then(_this2.success.bind(_this2), _this2.failure.bind(_this2));
}); });
} }
/** /**
* Remove the logo. * Remove the logo.
*/ */
; ;
@@ -15453,22 +15478,22 @@ var UploadImageButton = /*#__PURE__*/function (_Button) {
_proto.resourceUrl = function resourceUrl() { _proto.resourceUrl = function resourceUrl() {
return _app__WEBPACK_IMPORTED_MODULE_1__["default"].forum.attribute('apiUrl') + '/' + this.props.name; return _app__WEBPACK_IMPORTED_MODULE_1__["default"].forum.attribute('apiUrl') + '/' + this.props.name;
} }
/** /**
* After a successful upload/removal, reload the page. * After a successful upload/removal, reload the page.
* *
* @param {Object} response * @param {Object} response
* @protected * @protected
*/ */
; ;
_proto.success = function success(response) { _proto.success = function success(response) {
window.location.reload(); window.location.reload();
} }
/** /**
* If upload/removal fails, stop loading. * If upload/removal fails, stop loading.
* *
* @param {Object} response * @param {Object} response
* @protected * @protected
*/ */
; ;
@@ -15629,7 +15654,7 @@ __webpack_require__.r(__webpack_exports__);
function _createForOfIteratorHelperLoose(o) { var i = 0; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } i = o[Symbol.iterator](); return i.next.bind(i); } function _createForOfIteratorHelperLoose(o) { var i = 0; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } i = o[Symbol.iterator](); return i.next.bind(i); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
@@ -17382,7 +17407,7 @@ var Badge = /*#__PURE__*/function (_Component) {
"use strict"; "use strict";
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Button; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Button; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
/* harmony import */ var _Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Component */ "./src/common/Component.ts"); /* harmony import */ var _Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Component */ "./src/common/Component.ts");
/* harmony import */ var _helpers_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/icon */ "./src/common/helpers/icon.tsx"); /* harmony import */ var _helpers_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/icon */ "./src/common/helpers/icon.tsx");
@@ -17397,12 +17422,12 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `Button` component defines an element which, when clicked, performs an * The `Button` component defines an element which, when clicked, performs an
* action. * action.
* *
* Note that a Button has no default class names. This is because a Button can * Note that a Button has no default class names. This is because a Button can
* be used to represent any generic clickable control, like a menu item. * be used to represent any generic clickable control, like a menu item.
*/ */
var Button = /*#__PURE__*/function (_Component) { var Button = /*#__PURE__*/function (_Component) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Button, _Component); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Button, _Component);
@@ -17414,9 +17439,14 @@ var Button = /*#__PURE__*/function (_Component) {
var _proto = Button.prototype; var _proto = Button.prototype;
_proto.view = function view() { _proto.view = function view() {
var attrs = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props); var attrs = function (_ref) {
var children = _ref.children,
o = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, ["children"]);
var children = Object(_utils_extract__WEBPACK_IMPORTED_MODULE_4__["default"])(attrs, 'children'); return o;
}(this.props);
var children = this.props.children;
attrs.className = attrs.className || ''; attrs.className = attrs.className || '';
attrs.type = attrs.type || 'button'; // If a tooltip was provided for buttons without additional content, we also attrs.type = attrs.type || 'button'; // If a tooltip was provided for buttons without additional content, we also
// use this tooltip as text for screen readers // use this tooltip as text for screen readers
@@ -17427,7 +17457,7 @@ var Button = /*#__PURE__*/function (_Component) {
if (!attrs.title && children) { if (!attrs.title && children) {
attrs.title = Object(_utils_extractText__WEBPACK_IMPORTED_MODULE_5__["default"])(this.props.children); attrs.title = Object(_utils_extractText__WEBPACK_IMPORTED_MODULE_5__["default"])(children);
} }
var iconName = Object(_utils_extract__WEBPACK_IMPORTED_MODULE_4__["default"])(attrs, 'icon'); var iconName = Object(_utils_extract__WEBPACK_IMPORTED_MODULE_4__["default"])(attrs, 'icon');
@@ -17441,8 +17471,8 @@ var Button = /*#__PURE__*/function (_Component) {
return m("button", attrs, this.getButtonContent(iconName, loading, children)); return m("button", attrs, this.getButtonContent(iconName, loading, children));
} }
/** /**
* Get the template for the button's content. * Get the template for the button's content.
*/ */
; ;
@@ -17561,21 +17591,21 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `Dropdown` component displays a button which, when clicked, shows a * The `Dropdown` component displays a button which, when clicked, shows a
* dropdown menu beneath it. * dropdown menu beneath it.
* *
* ### Props * ### Props
* *
* - `buttonClassName` A class name to apply to the dropdown toggle button. * - `buttonClassName` A class name to apply to the dropdown toggle button.
* - `menuClassName` A class name to apply to the dropdown menu. * - `menuClassName` A class name to apply to the dropdown menu.
* - `icon` The name of an icon to show in the dropdown toggle button. * - `icon` The name of an icon to show in the dropdown toggle button.
* - `caretIcon` The name of an icon to show on the right of the button. * - `caretIcon` The name of an icon to show on the right of the button.
* - `label` The label of the dropdown toggle button. Defaults to 'Controls'. * - `label` The label of the dropdown toggle button. Defaults to 'Controls'.
* - `onhide` * - `onhide`
* - `onshow` * - `onshow`
* *
* The children will be displayed as a list inside of the dropdown menu. * The children will be displayed as a list inside of the dropdown menu.
*/ */
var Dropdown = /*#__PURE__*/function (_Component) { var Dropdown = /*#__PURE__*/function (_Component) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Dropdown, _Component); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Dropdown, _Component);
@@ -17649,8 +17679,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
m.redraw(); m.redraw();
}); });
} }
/** /**
* Get the template for the button. * Get the template for the button.
*/ */
; ;
@@ -17661,10 +17691,10 @@ var Dropdown = /*#__PURE__*/function (_Component) {
onclick: this.props.onclick onclick: this.props.onclick
}, this.getButtonContent()); }, this.getButtonContent());
} }
/** /**
* Get the template for the button's content. * Get the template for the button's content.
* *
* @return {*} * @return {*}
*/ */
; ;
@@ -17798,8 +17828,8 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `LinkButton` component defines a `Button` which links to a route. * The `LinkButton` component defines a `Button` which links to a route.
*/ */
var LinkButton = /*#__PURE__*/function (_Button) { var LinkButton = /*#__PURE__*/function (_Button) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(LinkButton, _Button); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(LinkButton, _Button);
@@ -17821,8 +17851,8 @@ var LinkButton = /*#__PURE__*/function (_Button) {
vdom.attrs.active = String(vdom.attrs.active); vdom.attrs.active = String(vdom.attrs.active);
return vdom; return vdom;
} }
/** /**
* Determine whether a component with the given props is 'active'. * Determine whether a component with the given props is 'active'.
*/ */
; ;
@@ -17917,7 +17947,7 @@ var LoadingIndicator = /*#__PURE__*/function (_Component) {
}; };
} }
new spin_js__WEBPACK_IMPORTED_MODULE_3__["Spinner"](Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, {}, sizeOptions)).spin(this.element); new spin_js__WEBPACK_IMPORTED_MODULE_3__["Spinner"](Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options), sizeOptions)).spin(this.element);
}; };
return LoadingIndicator; return LoadingIndicator;
@@ -17944,9 +17974,9 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `Modal` component displays a modal dialog, wrapped in a form. Subclasses * The `Modal` component displays a modal dialog, wrapped in a form. Subclasses
* should implement the `className`, `title`, and `content` methods. * should implement the `className`, `title`, and `content` methods.
*/ */
var Modal = /*#__PURE__*/function (_Component) { var Modal = /*#__PURE__*/function (_Component) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Modal, _Component); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Modal, _Component);
@@ -17991,25 +18021,25 @@ var Modal = /*#__PURE__*/function (_Component) {
className: "Modal-alert" className: "Modal-alert"
}, this.alert), this.content()))); }, this.alert), this.content())));
} }
/** /**
* Determine whether or not the modal should be dismissible via an 'x' button. * Determine whether or not the modal should be dismissible via an 'x' button.
*/ */
; ;
_proto.isDismissible = function isDismissible() { _proto.isDismissible = function isDismissible() {
return true; return true;
} }
/** /**
* Get the class name to apply to the modal. * Get the class name to apply to the modal.
*/ */
; ;
/** /**
* Handle the modal form's submit event. * Handle the modal form's submit event.
*/ */
_proto.onsubmit = function onsubmit(e) {} _proto.onsubmit = function onsubmit(e) {}
/** /**
* Focus on the first input when the modal is ready to be used. * Focus on the first input when the modal is ready to be used.
*/ */
; ;
@@ -18018,16 +18048,16 @@ var Modal = /*#__PURE__*/function (_Component) {
}; };
_proto.onhide = function onhide() {} _proto.onhide = function onhide() {}
/** /**
* Hide the modal. * Hide the modal.
*/ */
; ;
_proto.hide = function hide() { _proto.hide = function hide() {
app.modal.close(); app.modal.close();
} }
/** /**
* Stop loading. * Stop loading.
*/ */
; ;
@@ -18035,9 +18065,9 @@ var Modal = /*#__PURE__*/function (_Component) {
this.loading = false; this.loading = false;
m.redraw(); m.redraw();
} }
/** /**
* Show an alert describing an error returned from the API, and give focus to * Show an alert describing an error returned from the API, and give focus to
* the first relevant field. * the first relevant field.
*/ */
; ;
@@ -18456,9 +18486,9 @@ __webpack_require__.r(__webpack_exports__);
/** /**
* The `Select` component displays a <select> input, surrounded with some extra * The `Select` component displays a <select> input, surrounded with some extra
* elements for styling. * elements for styling.
*/ */
var Select = /*#__PURE__*/function (_Component) { var Select = /*#__PURE__*/function (_Component) {
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Select, _Component); Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Select, _Component);
@@ -18487,8 +18517,8 @@ var Select = /*#__PURE__*/function (_Component) {
className: 'Select-caret' className: 'Select-caret'
})); }));
} }
/** /**
* Run a callback when the state of the checkbox is changed. * Run a callback when the state of the checkbox is changed.
*/ */
; ;
@@ -20396,15 +20426,22 @@ function mapRoutes(routes, basePath) {
var map = {}; var map = {};
for (var key in routes) { var _loop = function _loop(key) {
if (!routes.hasOwnProperty(key)) return "continue";
var route = routes[key]; var route = routes[key];
map[basePath + route.path] = {
render: function render() {
return m(route.component, {
routeName: key
});
}
};
};
if (route.component) { for (var key in routes) {
if (!route.component.attrs) route.component.attrs = {}; var _ret = _loop(key);
route.component.attrs.routeName = key;
}
map[basePath + route.path] = route.component; if (_ret === "continue") continue;
} }
return map; return map;

File diff suppressed because one or more lines are too long

16983
js/dist/forum.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -10,14 +10,15 @@ export default function mapRoutes(routes: object, basePath: string = ''): RouteD
const map = {}; const map = {};
for (const key in routes) { for (const key in routes) {
if (!routes.hasOwnProperty(key)) continue;
const route = routes[key]; const route = routes[key];
if (route.component) { map[basePath + route.path] = {
if (!route.component.attrs) route.component.attrs = {}; render() {
route.component.attrs.routeName = key; return m(route.component, { routeName: key });
} },
};
map[basePath + route.path] = route.component;
} }
return map; return map;

View File

@@ -316,7 +316,7 @@ export default class IndexPage extends Page {
params.sort = sort; params.sort = sort;
} }
m.route(app.route(this.props.routeName, params)); m.route.set(app.route(this.props.routeName, params));
} }
/** /**