@edifice.io/wiki 3.6.14 → 3.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index2.js +35 -35
- package/package.json +2 -2
package/lib/index2.js
CHANGED
|
@@ -5,7 +5,7 @@ var L1 = (e, t, i) => t.has(e) || S1("Cannot " + i);
|
|
|
5
5
|
var v = (e, t, i) => (L1(e, t, "read from private field"), i ? i.call(e) : t.get(e)), N = (e, t, i) => t.has(e) ? S1("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), A = (e, t, i, s) => (L1(e, t, "write to private field"), s ? s.call(e, i) : t.set(e, i), i);
|
|
6
6
|
import { jsx as o, jsxs as p, Fragment as c2 } from "react/jsx-runtime";
|
|
7
7
|
import * as r2 from "react";
|
|
8
|
-
import { createContext as ot, useState as i2, useEffect as a2, useCallback as
|
|
8
|
+
import { createContext as ot, useState as i2, useEffect as a2, useCallback as J2, useContext as Xi, Suspense as l0, useRef as C0, lazy as M2, forwardRef as r1, useMemo as l1 } from "react";
|
|
9
9
|
import { createRoot as $i } from "react-dom/client";
|
|
10
10
|
import { useRouteError as _i, useNavigate as _, useActionData as es, Form as U0, useParams as X, useSubmit as rt, redirect as se, useLocation as me, useBlocker as ts, useBeforeUnload as is, useNavigation as ss, matchPath as ns, useMatch as ne, Outlet as as, createMemoryRouter as os, RouterProvider as rs } from "react-router-dom";
|
|
11
11
|
import { ERROR_CODE as ls, FOLDER as R2, SORT_ORDER as cs, ResourceService as pe, odeServices as W } from "@edifice.io/client";
|
|
@@ -1283,7 +1283,7 @@ var jn = class {
|
|
|
1283
1283
|
findByName(e) {
|
|
1284
1284
|
return this.transfomers[e];
|
|
1285
1285
|
}
|
|
1286
|
-
}, Dn = (e) => Object.prototype.toString.call(e).slice(8, -1), si = (e) => typeof e > "u", Hn = (e) => e === null, S0 = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, e1 = (e) => S0(e) && Object.keys(e).length === 0,
|
|
1286
|
+
}, Dn = (e) => Object.prototype.toString.call(e).slice(8, -1), si = (e) => typeof e > "u", Hn = (e) => e === null, S0 = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, e1 = (e) => S0(e) && Object.keys(e).length === 0, w2 = (e) => Array.isArray(e), Fn = (e) => typeof e == "string", Gn = (e) => typeof e == "number" && !isNaN(e), Yn = (e) => typeof e == "boolean", Pn = (e) => e instanceof RegExp, L0 = (e) => e instanceof Map, R0 = (e) => e instanceof Set, ni = (e) => Dn(e) === "Symbol", Bn = (e) => e instanceof Date && !isNaN(e.valueOf()), Qn = (e) => e instanceof Error, Z1 = (e) => typeof e == "number" && isNaN(e), Vn = (e) => Yn(e) || Hn(e) || si(e) || Gn(e) || Fn(e) || ni(e), Kn = (e) => typeof e == "bigint", Xn = (e) => e === 1 / 0 || e === -1 / 0, $n = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), _n = (e) => e instanceof URL, ai = (e) => e.replace(/\./g, "\\."), Te = (e) => e.map(String).map(ai).join("."), y0 = (e) => {
|
|
1287
1287
|
const t = [];
|
|
1288
1288
|
let i = "";
|
|
1289
1289
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -1413,7 +1413,7 @@ oi.forEach((e) => {
|
|
|
1413
1413
|
mi[e.annotation] = e;
|
|
1414
1414
|
});
|
|
1415
1415
|
var ia = (e, t, i) => {
|
|
1416
|
-
if (
|
|
1416
|
+
if (w2(t))
|
|
1417
1417
|
switch (t[0]) {
|
|
1418
1418
|
case "symbol":
|
|
1419
1419
|
return ri.untransform(e, t, i);
|
|
@@ -1474,7 +1474,7 @@ var sa = (e, t) => {
|
|
|
1474
1474
|
let s = e;
|
|
1475
1475
|
for (let a = 0; a < t.length - 1; a++) {
|
|
1476
1476
|
const r = t[a];
|
|
1477
|
-
if (
|
|
1477
|
+
if (w2(s)) {
|
|
1478
1478
|
const l = +r;
|
|
1479
1479
|
s = s[l];
|
|
1480
1480
|
} else if (S0(s))
|
|
@@ -1497,7 +1497,7 @@ var sa = (e, t) => {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
const n = t[t.length - 1];
|
|
1500
|
-
if (
|
|
1500
|
+
if (w2(s) ? s[+n] = i(s[+n]) : S0(s) && (s[n] = i(s[n])), R0(s)) {
|
|
1501
1501
|
const a = D2(s, +n), r = i(a);
|
|
1502
1502
|
a !== r && (s.delete(a), s.add(r));
|
|
1503
1503
|
}
|
|
@@ -1520,7 +1520,7 @@ var sa = (e, t) => {
|
|
|
1520
1520
|
function i1(e, t, i = []) {
|
|
1521
1521
|
if (!e)
|
|
1522
1522
|
return;
|
|
1523
|
-
if (!
|
|
1523
|
+
if (!w2(e)) {
|
|
1524
1524
|
r0(e, (a, r) => i1(a, t, [...i, ...y0(r)]));
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
@@ -1541,7 +1541,7 @@ function aa(e, t) {
|
|
|
1541
1541
|
e = t1(e, r, () => a);
|
|
1542
1542
|
});
|
|
1543
1543
|
}
|
|
1544
|
-
if (
|
|
1544
|
+
if (w2(t)) {
|
|
1545
1545
|
const [s, n] = t;
|
|
1546
1546
|
s.forEach((a) => {
|
|
1547
1547
|
e = t1(e, y0(a), () => e);
|
|
@@ -1550,7 +1550,7 @@ function aa(e, t) {
|
|
|
1550
1550
|
r0(t, i);
|
|
1551
1551
|
return e;
|
|
1552
1552
|
}
|
|
1553
|
-
var oa = (e, t) => S0(e) ||
|
|
1553
|
+
var oa = (e, t) => S0(e) || w2(e) || L0(e) || R0(e) || ci(e, t);
|
|
1554
1554
|
function ra(e, t, i) {
|
|
1555
1555
|
const s = i.get(e);
|
|
1556
1556
|
s ? s.push(t) : i.set(e, [t]);
|
|
@@ -1589,12 +1589,12 @@ var Ci = (e, t, i, s, n = [], a = [], r = /* @__PURE__ */ new Map()) => {
|
|
|
1589
1589
|
return {
|
|
1590
1590
|
transformedValue: null
|
|
1591
1591
|
};
|
|
1592
|
-
const c = N1(e, i), d = (c == null ? void 0 : c.value) ?? e, m =
|
|
1592
|
+
const c = N1(e, i), d = (c == null ? void 0 : c.value) ?? e, m = w2(d) ? [] : {}, u = {};
|
|
1593
1593
|
r0(d, (h, f) => {
|
|
1594
1594
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
1595
1595
|
throw new Error(`Detected property ${f}. This is a prototype pollution risk, please remove it from your object.`);
|
|
1596
1596
|
const k = Ci(h, t, i, s, [...n, f], [...a, e], r);
|
|
1597
|
-
m[f] = k.transformedValue,
|
|
1597
|
+
m[f] = k.transformedValue, w2(k.annotations) ? u[f] = k.annotations : S0(k.annotations) && r0(k.annotations, (y, b) => {
|
|
1598
1598
|
u[ai(f) + "." + b] = y;
|
|
1599
1599
|
});
|
|
1600
1600
|
});
|
|
@@ -2153,11 +2153,11 @@ var U1;
|
|
|
2153
2153
|
(function(e) {
|
|
2154
2154
|
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
2155
2155
|
})(U1 || (U1 = {}));
|
|
2156
|
-
var
|
|
2156
|
+
var A2;
|
|
2157
2157
|
(function(e) {
|
|
2158
|
-
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter"
|
|
2159
|
-
})(
|
|
2160
|
-
|
|
2158
|
+
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter";
|
|
2159
|
+
})(A2 || (A2 = {}));
|
|
2160
|
+
A2.Space, A2.Enter, A2.Esc, A2.Space, A2.Enter;
|
|
2161
2161
|
var j1;
|
|
2162
2162
|
(function(e) {
|
|
2163
2163
|
e[e.RightClick = 2] = "RightClick";
|
|
@@ -3447,7 +3447,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3447
3447
|
mutation: f,
|
|
3448
3448
|
shouldIncludeSubPages: k,
|
|
3449
3449
|
toggleShouldIncludeSubPages: y
|
|
3450
|
-
} = So(), [b, S] = i2([]), M =
|
|
3450
|
+
} = So(), [b, S] = i2([]), M = J2(async (J) => {
|
|
3451
3451
|
s(!0);
|
|
3452
3452
|
const {
|
|
3453
3453
|
addToastMessage: O
|
|
@@ -3471,7 +3471,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3471
3471
|
count: z.newPageIds.length
|
|
3472
3472
|
})
|
|
3473
3473
|
}));
|
|
3474
|
-
}, [f, h, t, e, k, a]), g =
|
|
3474
|
+
}, [f, h, t, e, k, a]), g = J2((J) => {
|
|
3475
3475
|
if (J.length > 0) {
|
|
3476
3476
|
const O = J.map((z) => z.assetId);
|
|
3477
3477
|
S(O);
|
|
@@ -3778,7 +3778,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3778
3778
|
} = wo({
|
|
3779
3779
|
data: n,
|
|
3780
3780
|
selectedItems: c
|
|
3781
|
-
}), g =
|
|
3781
|
+
}), g = J2((x) => {
|
|
3782
3782
|
b(!1), i(`/id/${t.wikiId}/page/${e}/version/${x}`);
|
|
3783
3783
|
}, [b, i, t.wikiId, e]);
|
|
3784
3784
|
return a ? /* @__PURE__ */ o(p2, {}) : /* @__PURE__ */ u1(/* @__PURE__ */ p(Y, { id: "revision-modal", isOpen: y, size: "lg", onModalClose: () => b(!1), children: [
|
|
@@ -3897,7 +3897,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3897
3897
|
}, Di = (e) => {
|
|
3898
3898
|
const t = g2();
|
|
3899
3899
|
return {
|
|
3900
|
-
handleSortPage:
|
|
3900
|
+
handleSortPage: J2(async (s) => {
|
|
3901
3901
|
try {
|
|
3902
3902
|
const n = await B.getWikiPages(e, !1);
|
|
3903
3903
|
for (const a of s) {
|
|
@@ -3957,7 +3957,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3957
3957
|
setOpenMoveModal: f
|
|
3958
3958
|
} = y2(), {
|
|
3959
3959
|
addToastMessage: k
|
|
3960
|
-
} = H0(), [y, b] = i2(null), S = zo(s, t), M =
|
|
3960
|
+
} = H0(), [y, b] = i2(null), S = zo(s, t), M = J2(async () => {
|
|
3961
3961
|
if (y && l && a)
|
|
3962
3962
|
try {
|
|
3963
3963
|
h(!0);
|
|
@@ -4097,17 +4097,17 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4097
4097
|
d() && /* @__PURE__ */ o(Z, { onClick: c, leftIcon: /* @__PURE__ */ o(It, {}), variant: "filled", isLoading: r, disabled: r, children: s("wiki.version.restore") })
|
|
4098
4098
|
] })
|
|
4099
4099
|
] });
|
|
4100
|
-
},
|
|
4100
|
+
}, I2 = (e, t) => e.get(t), K0 = (e, t) => async ({
|
|
4101
4101
|
params: i,
|
|
4102
4102
|
request: s
|
|
4103
4103
|
}) => {
|
|
4104
4104
|
var u;
|
|
4105
4105
|
const n = await s.formData(), {
|
|
4106
4106
|
addToastMessage: a
|
|
4107
|
-
} = H0(), r =
|
|
4108
|
-
title:
|
|
4109
|
-
content:
|
|
4110
|
-
isHidden:
|
|
4107
|
+
} = H0(), r = I2(n, "isConfirmVisibilityForm"), l = r ? JSON.parse(I2(n, "actionData")) : {
|
|
4108
|
+
title: I2(n, "title"),
|
|
4109
|
+
content: I2(n, "content"),
|
|
4110
|
+
isHidden: I2(n, "isHidden") === "true"
|
|
4111
4111
|
};
|
|
4112
4112
|
if (!r) {
|
|
4113
4113
|
const h = (u = (await e.ensureQueryData($.findOne(i.wikiId))).pages) == null ? void 0 : u.find((f) => f._id === i.pageId);
|
|
@@ -10444,21 +10444,21 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10444
10444
|
return () => clearInterval(n2);
|
|
10445
10445
|
}
|
|
10446
10446
|
}, [g == null ? void 0 : g.aiMetadata, O]);
|
|
10447
|
-
const H = ko(), R = xo(), L = yo(), w = async (n2,
|
|
10447
|
+
const H = ko(), R = xo(), L = yo(), w = async (n2, z2) => {
|
|
10448
10448
|
await H.mutate({
|
|
10449
10449
|
wikiId: i.wikiId,
|
|
10450
10450
|
pageId: i.pageId,
|
|
10451
10451
|
comment: n2,
|
|
10452
|
-
replyTo:
|
|
10452
|
+
replyTo: z2
|
|
10453
10453
|
});
|
|
10454
10454
|
}, U = async ({
|
|
10455
10455
|
comment: n2,
|
|
10456
|
-
commentId:
|
|
10456
|
+
commentId: z2
|
|
10457
10457
|
}) => {
|
|
10458
10458
|
await L.mutateAsync({
|
|
10459
10459
|
wikiId: i.wikiId,
|
|
10460
10460
|
pageId: i.pageId,
|
|
10461
|
-
commentId:
|
|
10461
|
+
commentId: z2,
|
|
10462
10462
|
comment: n2
|
|
10463
10463
|
});
|
|
10464
10464
|
}, s2 = async (n2) => {
|
|
@@ -10498,13 +10498,13 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10498
10498
|
maxReplies: Aa,
|
|
10499
10499
|
additionalReplies: Oa
|
|
10500
10500
|
}, type: u ? "edit" : "read", rights: m, callbacks: {
|
|
10501
|
-
post: (n2,
|
|
10501
|
+
post: (n2, z2) => w(n2, z2),
|
|
10502
10502
|
put: ({
|
|
10503
10503
|
comment: n2,
|
|
10504
|
-
commentId:
|
|
10504
|
+
commentId: z2
|
|
10505
10505
|
}) => U({
|
|
10506
10506
|
comment: n2,
|
|
10507
|
-
commentId:
|
|
10507
|
+
commentId: z2
|
|
10508
10508
|
}),
|
|
10509
10509
|
delete: (n2) => s2(n2)
|
|
10510
10510
|
} }),
|
|
@@ -10636,7 +10636,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10636
10636
|
}, ar = (e) => {
|
|
10637
10637
|
const [t, i] = i2(e == null ? void 0 : e.content), s = me(), n = X(), a = rt(), {
|
|
10638
10638
|
data: r
|
|
10639
|
-
} = m0(n.wikiId), l = u2(), c = s.pathname.includes("subpage") || !!(e != null && e.parentId), d = !!(e != null && e._id), m =
|
|
10639
|
+
} = m0(n.wikiId), l = u2(), c = s.pathname.includes("subpage") || !!(e != null && e.parentId), d = !!(e != null && e._id), m = J2(() => {
|
|
10640
10640
|
let H = !1;
|
|
10641
10641
|
if (d)
|
|
10642
10642
|
H = !(e != null && e.isVisible);
|
|
@@ -10669,7 +10669,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10669
10669
|
shouldDirty: !0
|
|
10670
10670
|
});
|
|
10671
10671
|
}, [t]);
|
|
10672
|
-
const M =
|
|
10672
|
+
const M = J2(() => {
|
|
10673
10673
|
if (c) {
|
|
10674
10674
|
const H = d ? e.parentId : n.pageId, R = B1(r, H);
|
|
10675
10675
|
return !(R != null && R.isVisible);
|
|
@@ -11043,7 +11043,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11043
11043
|
} = H0(), r = (await e.fetchQuery(V.findAllFromWiki({
|
|
11044
11044
|
wikiId: t.wikiId,
|
|
11045
11045
|
content: !1
|
|
11046
|
-
})) ?? []).map((C) => C.position ?? 0), l =
|
|
11046
|
+
})) ?? []).map((C) => C.position ?? 0), l = I2(s, "title"), c = I2(s, "content"), d = I2(s, "isHidden") === "false", m = r.length > 0 ? Math.max(...r) + 1 : 1, u = await B.createPage({
|
|
11047
11047
|
wikiId: t.wikiId,
|
|
11048
11048
|
data: {
|
|
11049
11049
|
title: l,
|
|
@@ -11376,7 +11376,7 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11376
11376
|
}, 5e3);
|
|
11377
11377
|
return () => clearInterval(w);
|
|
11378
11378
|
}, [b, y, S]);
|
|
11379
|
-
const R =
|
|
11379
|
+
const R = J2((w) => !w.aiMetadata || w.aiMetadata && w.aiMetadata.contentGenerated, []);
|
|
11380
11380
|
return S ? /* @__PURE__ */ o(Sr, {}) : /* @__PURE__ */ p(c2, { children: [
|
|
11381
11381
|
x && /* @__PURE__ */ o(tr, {}),
|
|
11382
11382
|
/* @__PURE__ */ p(e2, { className: "flex-grow-1", children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/wiki",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.15",
|
|
4
4
|
"description": "Wiki application",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "Edifice",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"i18next": "23.8.1",
|
|
28
28
|
"i18next-http-backend": "2.4.2",
|
|
29
29
|
"lottie-react": "2.4.1",
|
|
30
|
-
"ode-explorer": "2.6.
|
|
30
|
+
"ode-explorer": "2.6.12",
|
|
31
31
|
"react": "18.3.1",
|
|
32
32
|
"react-dom": "18.3.1",
|
|
33
33
|
"react-error-boundary": "4.0.13",
|