@pstdio/ui 0.35.0 → 0.36.1
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/{MermaidComponent-DGDnQ6pb.js → MermaidComponent-Cxg7NtjX.js} +2 -2
- package/dist/{MermaidComponent-DGDnQ6pb.js.map → MermaidComponent-Cxg7NtjX.js.map} +1 -1
- package/dist/chat-ui.d.ts +3 -3
- package/dist/chat-ui.js +1 -1
- package/dist/{data-table-stats-row-DNJG8tLZ.js → data-table-stats-row-UuTinYfL.js} +2 -2
- package/dist/{data-table-stats-row-DNJG8tLZ.js.map → data-table-stats-row-UuTinYfL.js.map} +1 -1
- package/dist/data-table.d.ts +32 -1
- package/dist/data-table.js +540 -406
- package/dist/data-table.js.map +1 -1
- package/dist/index.d.ts +17 -21
- package/dist/index.js +861 -907
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer.d.ts +3 -1
- package/dist/kanban-renderer.js +171 -171
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/{param-editor-IJzw1cA2.js → param-editor-I0dKQeeZ.js} +2 -2
- package/dist/{param-editor-IJzw1cA2.js.map → param-editor-I0dKQeeZ.js.map} +1 -1
- package/dist/{param-editor-field-DscIjv8s.js → param-editor-field-CBguLs_b.js} +2 -2
- package/dist/{param-editor-field-DscIjv8s.js.map → param-editor-field-CBguLs_b.js.map} +1 -1
- package/dist/param-editor.js +2 -2
- package/dist/{rich-text-DtQpHBlX.js → rich-text-BgDvOEGH.js} +657 -654
- package/dist/rich-text-BgDvOEGH.js.map +1 -0
- package/dist/rich-text.js +1 -1
- package/dist/{theme-kSkOHzbV.js → theme-0cbWICbg.js} +247 -163
- package/dist/theme-0cbWICbg.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/{workspace-badge-CkJ_jTQw.d.ts → workspace-badge-Brm3Xr3m.d.ts} +1 -1
- package/dist/{workspace-badge-9g78pXHS.js → workspace-badge-DrvH8WKV.js} +38 -42
- package/dist/workspace-badge-DrvH8WKV.js.map +1 -0
- package/package.json +2 -2
- package/dist/rich-text-DtQpHBlX.js.map +0 -1
- package/dist/theme-kSkOHzbV.js.map +0 -1
- package/dist/workspace-badge-9g78pXHS.js.map +0 -1
|
@@ -1976,44 +1976,47 @@ function La(e) {
|
|
|
1976
1976
|
default: return e ? String(e) : "-";
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id : String(t),
|
|
1979
|
+
var Ra = Tn(), za = (e) => typeof e == "object" && !!e && typeof e.additions == "number" && typeof e.deletions == "number", Ba = (e, t) => Aa(e) ? e.sortValue : t?.type === "diff" && za(e) ? e.additions + e.deletions : e, Va = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id : String(t), Ha = (e) => typeof e.initialPageSize == "number" && e.initialPageSize > 0 ? e.initialPageSize : 30, Ua = (e) => e.map((e) => e.original), Wa = (e) => {
|
|
1980
1980
|
let t = [...e.selectionActions ?? []];
|
|
1981
1981
|
return e.onCSVDownload && t.push({
|
|
1982
1982
|
label: "Download CSV",
|
|
1983
1983
|
onSelect: (t) => {
|
|
1984
|
-
e.onCSVDownload?.(t.map((t, n) =>
|
|
1984
|
+
e.onCSVDownload?.(t.map((t, n) => Va(t, n, e.getRowId)));
|
|
1985
1985
|
}
|
|
1986
1986
|
}), t;
|
|
1987
|
-
},
|
|
1988
|
-
let
|
|
1989
|
-
return typeof
|
|
1990
|
-
},
|
|
1991
|
-
let
|
|
1992
|
-
return
|
|
1993
|
-
},
|
|
1987
|
+
}, Ga = (e) => e.selectionMode === "multiple" || !!e.onCSVDownload || !!e.selectionActions?.length, Ka = (e) => e.enableRowActivation === !0 && e.activeRowId === e.rowId, qa = (e, t) => {
|
|
1988
|
+
let n = Ba(e, t);
|
|
1989
|
+
return typeof n == "boolean" ? String(n) : n;
|
|
1990
|
+
}, Ja = (e, t, n) => {
|
|
1991
|
+
let r = e.map((e) => qa(e[t], n?.[t])).filter((e) => e != null);
|
|
1992
|
+
return r.length > 0 && r.every((e) => typeof e == "number");
|
|
1993
|
+
}, Ya = (e, t, n) => Ja(e, t, n) ? { kind: "number" } : { kind: "string" }, Xa = (e, t, n, r) => t.map((t) => ({
|
|
1994
1994
|
id: t,
|
|
1995
1995
|
label: n?.[t] ?? t,
|
|
1996
|
-
type:
|
|
1996
|
+
type: Ya(e, t, r),
|
|
1997
1997
|
filterable: !0,
|
|
1998
1998
|
sortable: !0,
|
|
1999
1999
|
displayable: !0
|
|
2000
|
-
})),
|
|
2001
|
-
let
|
|
2000
|
+
})), Za = (e, t, n, r) => e.map((e, i) => {
|
|
2001
|
+
let a = Object.fromEntries(t.map((t) => [t, qa(e[t], r?.[t])])), o = Va(e, i, n), s = t.length > 0 ? a[t[0]] : o;
|
|
2002
2002
|
return {
|
|
2003
|
-
id:
|
|
2004
|
-
title: String(
|
|
2005
|
-
attributes:
|
|
2003
|
+
id: o,
|
|
2004
|
+
title: String(s ?? o),
|
|
2005
|
+
attributes: a,
|
|
2006
2006
|
sourceRow: e
|
|
2007
2007
|
};
|
|
2008
|
-
}),
|
|
2008
|
+
}), Qa = (e, t, n) => Ki(e, t, n), $a = (e, t) => {
|
|
2009
2009
|
let n = new Set(e), r = t.filter((e) => n.has(e)), i = new Set(r), a = e.filter((e) => !i.has(e));
|
|
2010
2010
|
return [...r, ...a];
|
|
2011
|
-
},
|
|
2011
|
+
}, eo = (e, t, n) => {
|
|
2012
|
+
let r = new Set(e);
|
|
2013
|
+
return n ? r.delete(t) : r.add(t), r;
|
|
2014
|
+
}, to = (e, t, n) => {
|
|
2012
2015
|
let r = e.indexOf(t), i = e.indexOf(n);
|
|
2013
2016
|
if (r < 0 || i < 0 || r === i) return e;
|
|
2014
2017
|
let a = [...e], [o] = a.splice(r, 1);
|
|
2015
2018
|
return o ? (a.splice(i, 0, o), a) : e;
|
|
2016
|
-
},
|
|
2019
|
+
}, no = (e) => e.toolbarStorageKey ?? `data-table:${e.columnKeys.join("|") || "empty"}`, ro = (e) => {
|
|
2017
2020
|
let t = H(11), { cancelLabel: n, saveLabel: r, onCancel: i, onSave: a } = e, o;
|
|
2018
2021
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ W(de, {}), t[0] = o) : o = t[0];
|
|
2019
2022
|
let s;
|
|
@@ -2042,7 +2045,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2042
2045
|
flexShrink: "0",
|
|
2043
2046
|
children: [s, l]
|
|
2044
2047
|
}), t[8] = s, t[9] = l, t[10] = u) : u = t[10], u;
|
|
2045
|
-
},
|
|
2048
|
+
}, io = (e) => {
|
|
2046
2049
|
let t = H(12), { accessibleName: n, textStyle: r, value: i, onCancel: a, onChange: o, onSave: s } = e, c = Q(null), l = Q(i), u, d;
|
|
2047
2050
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
2048
2051
|
let e = c.current;
|
|
@@ -2079,9 +2082,9 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2079
2082
|
onInput: m,
|
|
2080
2083
|
onKeyDown: p
|
|
2081
2084
|
}), t[7] = n, t[8] = p, t[9] = m, t[10] = r, t[11] = h) : h = t[11], h;
|
|
2082
|
-
},
|
|
2085
|
+
}, ao = (e) => {
|
|
2083
2086
|
let t = H(12), { accessibleName: n, draft: r, onCancel: i, onChange: a, onSave: o } = e, s = `Rename column ${n}`, c;
|
|
2084
|
-
t[0] !== r || t[1] !== i || t[2] !== a || t[3] !== o || t[4] !== s ? (c = /* @__PURE__ */ W(
|
|
2087
|
+
t[0] !== r || t[1] !== i || t[2] !== a || t[3] !== o || t[4] !== s ? (c = /* @__PURE__ */ W(io, {
|
|
2085
2088
|
accessibleName: s,
|
|
2086
2089
|
textStyle: "label/S/medium",
|
|
2087
2090
|
value: r,
|
|
@@ -2096,7 +2099,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2096
2099
|
right: "2xs",
|
|
2097
2100
|
transform: "translateY(-50%)",
|
|
2098
2101
|
background: "bg.subtle",
|
|
2099
|
-
children: /* @__PURE__ */ W(
|
|
2102
|
+
children: /* @__PURE__ */ W(ro, {
|
|
2100
2103
|
saveLabel: "Save column name",
|
|
2101
2104
|
cancelLabel: "Cancel column rename",
|
|
2102
2105
|
onSave: o,
|
|
@@ -2113,7 +2116,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2113
2116
|
zIndex: "1",
|
|
2114
2117
|
children: [c, l]
|
|
2115
2118
|
}), t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2116
|
-
},
|
|
2119
|
+
}, oo = (e) => {
|
|
2117
2120
|
let t = H(22), { anchorRef: n, customEditor: r, draft: i, onCancel: a, onChange: o, onSave: s } = e, c;
|
|
2118
2121
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (c = { mainAxis: -40 }, t[0] = c) : c = t[0];
|
|
2119
2122
|
let l;
|
|
@@ -2128,7 +2131,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2128
2131
|
overscrollBehavior: "contain"
|
|
2129
2132
|
}, t[3] = u, t[4] = f) : (u = t[3], f = t[4]);
|
|
2130
2133
|
let p;
|
|
2131
|
-
t[5] !== r || t[6] !== i || t[7] !== a || t[8] !== o || t[9] !== s ? (p = r ?? /* @__PURE__ */ W(
|
|
2134
|
+
t[5] !== r || t[6] !== i || t[7] !== a || t[8] !== o || t[9] !== s ? (p = r ?? /* @__PURE__ */ W(io, {
|
|
2132
2135
|
accessibleName: "Edit cell",
|
|
2133
2136
|
textStyle: "paragraph/S/regular",
|
|
2134
2137
|
value: i,
|
|
@@ -2157,7 +2160,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2157
2160
|
borderTopWidth: "1px",
|
|
2158
2161
|
borderColor: "border.subtle",
|
|
2159
2162
|
background: "bg.subtle",
|
|
2160
|
-
children: /* @__PURE__ */ W(
|
|
2163
|
+
children: /* @__PURE__ */ W(ro, {
|
|
2161
2164
|
saveLabel: "Save cell",
|
|
2162
2165
|
cancelLabel: "Cancel cell edit",
|
|
2163
2166
|
onSave: s,
|
|
@@ -2184,7 +2187,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2184
2187
|
positioning: l,
|
|
2185
2188
|
children: g
|
|
2186
2189
|
}), t[19] = l, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
2187
|
-
},
|
|
2190
|
+
}, so = (e) => e ? {
|
|
2188
2191
|
height: void 0,
|
|
2189
2192
|
maxHeight: void 0,
|
|
2190
2193
|
overflowWrap: "anywhere",
|
|
@@ -2198,11 +2201,11 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2198
2201
|
textOverflow: "ellipsis",
|
|
2199
2202
|
verticalAlign: "middle",
|
|
2200
2203
|
whiteSpace: "nowrap"
|
|
2201
|
-
},
|
|
2204
|
+
}, co = (e) => {
|
|
2202
2205
|
let t = H(45), { activeDraft: n, column: r, context: i, editMode: a, isActive: o, isReadOnly: s, wrapRows: c, onActivate: l, onCancel: u, onDraftChange: d, onSave: f } = e, p = n === void 0 ? "" : n, m = Q(null), h;
|
|
2203
2206
|
t[0] !== i || t[1] !== a || t[2] !== s ? (h = !s && (a.isCellEditable?.(i) ?? !0), t[0] = i, t[1] = a, t[2] = s, t[3] = h) : h = t[3];
|
|
2204
2207
|
let g = h, v;
|
|
2205
|
-
t[4] === c ? v = t[5] : (v =
|
|
2208
|
+
t[4] === c ? v = t[5] : (v = so(c), t[4] = c, t[5] = v);
|
|
2206
2209
|
let y = v, b;
|
|
2207
2210
|
if (o) {
|
|
2208
2211
|
let e;
|
|
@@ -2212,7 +2215,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2212
2215
|
onChange: d
|
|
2213
2216
|
}), t[6] = p, t[7] = i, t[8] = a, t[9] = d, t[10] = e) : e = t[10];
|
|
2214
2217
|
let n = e, r;
|
|
2215
|
-
t[11] !== p || t[12] !== n || t[13] !== u || t[14] !== d || t[15] !== f ? (r = /* @__PURE__ */ W(
|
|
2218
|
+
t[11] !== p || t[12] !== n || t[13] !== u || t[14] !== d || t[15] !== f ? (r = /* @__PURE__ */ W(oo, {
|
|
2216
2219
|
anchorRef: m,
|
|
2217
2220
|
draft: p,
|
|
2218
2221
|
customEditor: n,
|
|
@@ -2263,9 +2266,9 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2263
2266
|
onKeyDown: S,
|
|
2264
2267
|
children: b
|
|
2265
2268
|
}), t[28] = r.id, t[29] = b, t[30] = S, t[31] = y.height, t[32] = y.maxHeight, t[33] = y.textOverflow, t[34] = y.verticalAlign, t[35] = y.whiteSpace, t[36] = k, t[37] = A, t[38] = j, t[39] = w, t[40] = T, t[41] = E, t[42] = D, t[43] = O, t[44] = M) : M = t[44], M;
|
|
2266
|
-
},
|
|
2269
|
+
}, lo = (e) => {
|
|
2267
2270
|
e.stopPropagation();
|
|
2268
|
-
},
|
|
2271
|
+
}, uo = (e) => {
|
|
2269
2272
|
let n = H(8), { checked: r, indeterminate: i, onChange: a } = e, o = r ? !0 : i ? "indeterminate" : !1, s = i ? Pe : de, c;
|
|
2270
2273
|
n[0] === s ? c = n[1] : (c = /* @__PURE__ */ W(w, {
|
|
2271
2274
|
as: s,
|
|
@@ -2279,10 +2282,10 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2279
2282
|
checked: o,
|
|
2280
2283
|
"aria-label": "Select all",
|
|
2281
2284
|
icon: c,
|
|
2282
|
-
onClick:
|
|
2285
|
+
onClick: lo,
|
|
2283
2286
|
onCheckedChange: l
|
|
2284
2287
|
}), n[4] = o, n[5] = c, n[6] = l, n[7] = u) : u = n[7], u;
|
|
2285
|
-
},
|
|
2288
|
+
}, fo = (e) => {
|
|
2286
2289
|
let n = H(6), { checked: r, onChange: i } = e, a;
|
|
2287
2290
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ W(w, {
|
|
2288
2291
|
as: de,
|
|
@@ -2305,11 +2308,11 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2305
2308
|
checked: r,
|
|
2306
2309
|
"aria-label": "Select row",
|
|
2307
2310
|
icon: a,
|
|
2308
|
-
onClick:
|
|
2311
|
+
onClick: lo,
|
|
2309
2312
|
onCheckedChange: o
|
|
2310
2313
|
})
|
|
2311
2314
|
}), n[3] = r, n[4] = o, n[5] = s) : s = n[5], s;
|
|
2312
|
-
},
|
|
2315
|
+
}, po = (e) => {
|
|
2313
2316
|
let t = H(46), { activeCell: n, columns: r, data: i, editMode: a, enableSelection: o, isReadOnly: s, pageIndex: c, pageRows: l, pageSize: u, selectedRowIds: d, showNewRow: p, wrapRows: m, onActivateCell: h, onAddRow: g, onCancelCell: _, onCommitCell: y, onDraftChange: b, onRemoveRow: x, onToggleRowSelection: S, rowIdFor: C } = e, T;
|
|
2314
2317
|
if (t[0] !== n || t[1] !== r || t[2] !== i || t[3] !== a || t[4] !== o || t[5] !== s || t[6] !== h || t[7] !== _ || t[8] !== y || t[9] !== b || t[10] !== x || t[11] !== S || t[12] !== c || t[13] !== l || t[14] !== u || t[15] !== C || t[16] !== d || t[17] !== m) {
|
|
2315
2318
|
let e;
|
|
@@ -2334,7 +2337,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2334
2337
|
verticalAlign: m ? "top" : "middle",
|
|
2335
2338
|
children: l + 1
|
|
2336
2339
|
}),
|
|
2337
|
-
o ? /* @__PURE__ */ W(
|
|
2340
|
+
o ? /* @__PURE__ */ W(fo, {
|
|
2338
2341
|
checked: d.has(g),
|
|
2339
2342
|
onChange: (e) => S(g, e)
|
|
2340
2343
|
}) : null,
|
|
@@ -2345,7 +2348,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2345
2348
|
columnId: t.id,
|
|
2346
2349
|
value: e[t.id] ?? ""
|
|
2347
2350
|
}, i = n?.rowId === g && n.columnId === t.id;
|
|
2348
|
-
return /* @__PURE__ */ W(
|
|
2351
|
+
return /* @__PURE__ */ W(co, {
|
|
2349
2352
|
activeDraft: i ? n?.draft : void 0,
|
|
2350
2353
|
column: t,
|
|
2351
2354
|
context: r,
|
|
@@ -2414,7 +2417,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2414
2417
|
}) }) : null, t[37] = r, t[38] = o, t[39] = s, t[40] = g, t[41] = p, t[42] = E) : E = t[42];
|
|
2415
2418
|
let D;
|
|
2416
2419
|
return t[43] !== T || t[44] !== E ? (D = /* @__PURE__ */ G(I.Body, { children: [T, E] }), t[43] = T, t[44] = E, t[45] = D) : D = t[45], D;
|
|
2417
|
-
},
|
|
2420
|
+
}, mo = (e) => {
|
|
2418
2421
|
let t = H(37), { activeHeader: n, columnIcons: r, columns: i, data: a, editMode: o, isReadOnly: s, rowDisplayControl: c, selectionHeader: l, onAddColumn: u, onCancelHeaderEdit: d, onDeleteColumn: p, onHeaderDraftChange: m, onHeaderEdit: h, onSaveHeader: g } = e, _ = c ? "2xs" : "xs", v;
|
|
2419
2422
|
t[0] !== c || t[1] !== _ ? (v = /* @__PURE__ */ W(I.ColumnHeader, {
|
|
2420
2423
|
"data-column-id": "rowIndex",
|
|
@@ -2454,7 +2457,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2454
2457
|
borderBottomWidth: "1px",
|
|
2455
2458
|
borderColor: "border.subtle",
|
|
2456
2459
|
cursor: s ? "default" : "context-menu",
|
|
2457
|
-
children: t ? /* @__PURE__ */ W(
|
|
2460
|
+
children: t ? /* @__PURE__ */ W(ao, {
|
|
2458
2461
|
accessibleName: e.label || "empty",
|
|
2459
2462
|
draft: n.draft,
|
|
2460
2463
|
onChange: m,
|
|
@@ -2530,7 +2533,7 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2530
2533
|
x
|
|
2531
2534
|
]
|
|
2532
2535
|
}) }), t[32] = v, t[33] = y, t[34] = b, t[35] = x, t[36] = C) : C = t[36], C;
|
|
2533
|
-
},
|
|
2536
|
+
}, ho = K.forwardRef(function(e, t) {
|
|
2534
2537
|
let n = H(8), r, i;
|
|
2535
2538
|
n[0] === e ? (r = n[1], i = n[2]) : ({children: r, ...i} = e, n[0] = e, n[1] = r, n[2] = i);
|
|
2536
2539
|
let a;
|
|
@@ -2542,10 +2545,10 @@ var Ra = Tn(), za = (e, t, n) => n ? n(e, t) : typeof e.id == "string" ? e.id :
|
|
|
2542
2545
|
...i,
|
|
2543
2546
|
children: [r, a]
|
|
2544
2547
|
}), n[4] = r, n[5] = t, n[6] = i, n[7] = o) : o = n[7], o;
|
|
2545
|
-
}),
|
|
2548
|
+
}), go = j.Input;
|
|
2546
2549
|
//#endregion
|
|
2547
2550
|
//#region src/components/data-table/pagination-footer.tsx
|
|
2548
|
-
function
|
|
2551
|
+
function _o(e) {
|
|
2549
2552
|
let t = H(68), { pageCount: n, pageIndex: r, pageSize: i, pageSizeOptions: a, totalRows: o, onPageChange: s, onPageSizeChange: c } = e, l = Math.max(n, 1), u = r > 0, d = r < l - 1, f;
|
|
2550
2553
|
t[0] === o ? f = t[1] : (f = /* @__PURE__ */ G(R, {
|
|
2551
2554
|
textStyle: "label/S/regular",
|
|
@@ -2660,9 +2663,9 @@ function mo(e) {
|
|
|
2660
2663
|
s(Math.min(l, Math.max(1, t)) - 1);
|
|
2661
2664
|
}, t[45] = s, t[46] = l, t[47] = q) : q = t[47];
|
|
2662
2665
|
let te;
|
|
2663
|
-
t[48] === Symbol.for("react.memo_cache_sentinel") ? (te = /* @__PURE__ */ W(
|
|
2666
|
+
t[48] === Symbol.for("react.memo_cache_sentinel") ? (te = /* @__PURE__ */ W(go, { className: "nodrag" }), t[48] = te) : te = t[48];
|
|
2664
2667
|
let J;
|
|
2665
|
-
t[49] !== ee || t[50] !== q || t[51] !== l ? (J = /* @__PURE__ */ W(
|
|
2668
|
+
t[49] !== ee || t[50] !== q || t[51] !== l ? (J = /* @__PURE__ */ W(ho, {
|
|
2666
2669
|
margin: "2xs",
|
|
2667
2670
|
width: "3rem",
|
|
2668
2671
|
size: "xs",
|
|
@@ -2714,7 +2717,7 @@ function mo(e) {
|
|
|
2714
2717
|
}
|
|
2715
2718
|
//#endregion
|
|
2716
2719
|
//#region src/components/data-table/selection-toolbar.tsx
|
|
2717
|
-
function
|
|
2720
|
+
function vo(e) {
|
|
2718
2721
|
let t = H(24), { selectedCount: n, totalCount: r, onClearSelection: i, onSelectAll: a, actions: o, selectedRows: s } = e, c = o.length === 1 ? o[0]?.label : "Actions", l;
|
|
2719
2722
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ W(w, {
|
|
2720
2723
|
as: Ye,
|
|
@@ -2796,11 +2799,11 @@ function ho(e) {
|
|
|
2796
2799
|
}
|
|
2797
2800
|
//#endregion
|
|
2798
2801
|
//#region src/components/data-table/edit-mode-data-table.tsx
|
|
2799
|
-
var
|
|
2802
|
+
var yo = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random()}`}`, bo = (e) => ({
|
|
2800
2803
|
settings: { viewMode: "list" },
|
|
2801
2804
|
views: e.defaultViews,
|
|
2802
2805
|
activeViewId: e.defaultActiveViewId
|
|
2803
|
-
}),
|
|
2806
|
+
}), xo = (e) => {
|
|
2804
2807
|
let t = H(151), { data: n, editMode: r, fullWidth: i, initialPageSize: a, pageSizeOptions: o, isReadOnly: s, getRowId: c, columnIcons: l, toolbarStorageKey: u, defaultViews: f, defaultActiveViewId: p } = e, m = i !== void 0 && i, h = a === void 0 ? 30 : a, g = o === void 0 ? [
|
|
2805
2808
|
10,
|
|
2806
2809
|
20,
|
|
@@ -2808,17 +2811,17 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2808
2811
|
50
|
|
2809
2812
|
] : o, v = s === void 0 || s, [y, b] = $(0), x;
|
|
2810
2813
|
t[0] === h ? x = t[1] : (x = () => Math.min(Math.max(h, 1), 50), t[0] = h, t[1] = x);
|
|
2811
|
-
let [C, w] = $(x), [T, E] = $(null), [D, O] = $(null), [k, A] = $(
|
|
2814
|
+
let [C, w] = $(x), [T, E] = $(null), [D, O] = $(null), [k, A] = $(So), [j, M] = $(!1), N = r?.columns ?? [], P = N.map(Co), F = Xa(n, P, Object.fromEntries(N.map(wo))), L = Za(n, P, c), R = no({
|
|
2812
2815
|
toolbarStorageKey: u,
|
|
2813
2816
|
columnKeys: P
|
|
2814
2817
|
}), z;
|
|
2815
|
-
t[2] === e ? z = t[3] : (z =
|
|
2816
|
-
let B =
|
|
2818
|
+
t[2] === e ? z = t[3] : (z = bo(e), t[2] = e, t[3] = z);
|
|
2819
|
+
let B = Qa(L, xi(R, To, z), F), V = B.map(Eo), U = [...new Set(g.filter(Do))], K = Math.max(Math.ceil(V.length / C), 1), ee = V.slice(y * C, (y + 1) * C), q = "fit-content";
|
|
2817
2820
|
m && (q = v ? "100%" : "calc(100% + var(--chakra-spacing-10))");
|
|
2818
2821
|
let te;
|
|
2819
|
-
t[4] === e ? te = t[5] : (te =
|
|
2822
|
+
t[4] === e ? te = t[5] : (te = Ga(e), t[4] = e, t[5] = te);
|
|
2820
2823
|
let J = te, Y;
|
|
2821
|
-
t[6] === e ? Y = t[7] : (Y =
|
|
2824
|
+
t[6] === e ? Y = t[7] : (Y = Wa(e), t[6] = e, t[7] = Y);
|
|
2822
2825
|
let X = Y, ne;
|
|
2823
2826
|
t[8] !== K || t[9] !== y || t[10] !== b ? (ne = () => {
|
|
2824
2827
|
y < K || b(K - 1);
|
|
@@ -2827,7 +2830,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2827
2830
|
t[12] !== K || t[13] !== y ? (re = [K, y], t[12] = K, t[13] = y, t[14] = re) : re = t[14], Z(ne, re);
|
|
2828
2831
|
let ie;
|
|
2829
2832
|
t[15] !== B || t[16] !== A ? (ie = () => {
|
|
2830
|
-
let e = new Set(B.map(
|
|
2833
|
+
let e = new Set(B.map(Oo));
|
|
2831
2834
|
A((t) => {
|
|
2832
2835
|
let n = new Set([...t].filter((t) => e.has(t)));
|
|
2833
2836
|
return n.size === t.size && [...n].every((e) => t.has(e)) ? t : n;
|
|
@@ -2858,7 +2861,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2858
2861
|
}, t[31] = D, t[32] = O, t[33] = ue, t[34] = de) : de = t[34];
|
|
2859
2862
|
let fe = de, pe;
|
|
2860
2863
|
t[35] !== N || t[36] !== r ? (pe = () => {
|
|
2861
|
-
let e =
|
|
2864
|
+
let e = yo("column");
|
|
2862
2865
|
r.onColumnsChange([...N, {
|
|
2863
2866
|
id: e,
|
|
2864
2867
|
label: `Column ${N.length + 1}`,
|
|
@@ -2871,8 +2874,8 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2871
2874
|
}, t[38] = D?.columnId, t[39] = N, t[40] = r, t[41] = O, t[42] = he) : he = t[42];
|
|
2872
2875
|
let ge = he, _e;
|
|
2873
2876
|
t[43] !== N || t[44] !== n || t[45] !== r ? (_e = () => {
|
|
2874
|
-
let e = Object.fromEntries(N.map(
|
|
2875
|
-
e.id =
|
|
2877
|
+
let e = Object.fromEntries(N.map(ko));
|
|
2878
|
+
e.id = yo("row"), r.onDataChange([...n, e]);
|
|
2876
2879
|
}, t[43] = N, t[44] = n, t[45] = r, t[46] = _e) : _e = t[46];
|
|
2877
2880
|
let ve = _e, ye;
|
|
2878
2881
|
t[47] !== b || t[48] !== w ? (ye = (e) => {
|
|
@@ -2892,7 +2895,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2892
2895
|
let we = Ce, Te = B.length > 0 && k.size === B.length, Ee;
|
|
2893
2896
|
if (t[56] !== B || t[57] !== k) {
|
|
2894
2897
|
let e;
|
|
2895
|
-
t[59] === k ? e = t[60] : (e = (e) => k.has(e.id), t[59] = k, t[60] = e), Ee = B.filter(e).map(
|
|
2898
|
+
t[59] === k ? e = t[60] : (e = (e) => k.has(e.id), t[59] = k, t[60] = e), Ee = B.filter(e).map(Ao), t[56] = B, t[57] = k, t[58] = Ee;
|
|
2896
2899
|
} else Ee = t[58];
|
|
2897
2900
|
let De = Ee, Oe = !u, ke;
|
|
2898
2901
|
t[61] !== M || t[62] !== Oe || t[63] !== j ? (ke = /* @__PURE__ */ W(ka, {
|
|
@@ -2922,7 +2925,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2922
2925
|
width: "9"
|
|
2923
2926
|
}) : null, t[75] = J, t[76] = Fe);
|
|
2924
2927
|
let Ie;
|
|
2925
|
-
t[77] === N ? Ie = t[78] : (Ie = N.map(
|
|
2928
|
+
t[77] === N ? Ie = t[78] : (Ie = N.map(jo), t[77] = N, t[78] = Ie);
|
|
2926
2929
|
let Le;
|
|
2927
2930
|
t[79] === v ? Le = t[80] : (Le = v ? null : /* @__PURE__ */ W(_, {
|
|
2928
2931
|
as: "col",
|
|
@@ -2946,13 +2949,13 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2946
2949
|
draft: e.label
|
|
2947
2950
|
}), t[87] = O, t[88] = Ve, t[89] = He);
|
|
2948
2951
|
let Ue;
|
|
2949
|
-
t[90] !== Te || t[91] !== J || t[92] !== B || t[93] !== k || t[94] !== A ? (Ue = J ? /* @__PURE__ */ W(
|
|
2952
|
+
t[90] !== Te || t[91] !== J || t[92] !== B || t[93] !== k || t[94] !== A ? (Ue = J ? /* @__PURE__ */ W(uo, {
|
|
2950
2953
|
checked: Te,
|
|
2951
2954
|
indeterminate: k.size > 0 && !Te,
|
|
2952
|
-
onChange: (e) => A(e ? new Set(B.map(
|
|
2955
|
+
onChange: (e) => A(e ? new Set(B.map(Mo)) : /* @__PURE__ */ new Set())
|
|
2953
2956
|
}) : void 0, t[90] = Te, t[91] = J, t[92] = B, t[93] = k, t[94] = A, t[95] = Ue) : Ue = t[95];
|
|
2954
2957
|
let We;
|
|
2955
|
-
t[96] !== D || t[97] !== me || t[98] !== l || t[99] !== N || t[100] !== fe || t[101] !== n || t[102] !== r || t[103] !== v || t[104] !== ge || t[105] !== ze || t[106] !== Be || t[107] !== Ve || t[108] !== He || t[109] !== Ue ? (We = /* @__PURE__ */ W(
|
|
2958
|
+
t[96] !== D || t[97] !== me || t[98] !== l || t[99] !== N || t[100] !== fe || t[101] !== n || t[102] !== r || t[103] !== v || t[104] !== ge || t[105] !== ze || t[106] !== Be || t[107] !== Ve || t[108] !== He || t[109] !== Ue ? (We = /* @__PURE__ */ W(mo, {
|
|
2956
2959
|
activeHeader: D,
|
|
2957
2960
|
columnIcons: l,
|
|
2958
2961
|
columns: N,
|
|
@@ -2971,7 +2974,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
2971
2974
|
let Ge = y === K - 1, Ke;
|
|
2972
2975
|
t[111] === E ? Ke = t[112] : (Ke = () => E(null), t[111] = E, t[112] = Ke);
|
|
2973
2976
|
let qe;
|
|
2974
|
-
t[113] !== T || t[114] !== ve || t[115] !== N || t[116] !== ce || t[117] !== n || t[118] !== r || t[119] !== J || t[120] !== v || t[121] !== y || t[122] !== ee || t[123] !== C || t[124] !== Se || t[125] !== Q || t[126] !== k || t[127] !== E || t[128] !== Ge || t[129] !== Ke || t[130] !== we || t[131] !== j ? (qe = /* @__PURE__ */ W(
|
|
2977
|
+
t[113] !== T || t[114] !== ve || t[115] !== N || t[116] !== ce || t[117] !== n || t[118] !== r || t[119] !== J || t[120] !== v || t[121] !== y || t[122] !== ee || t[123] !== C || t[124] !== Se || t[125] !== Q || t[126] !== k || t[127] !== E || t[128] !== Ge || t[129] !== Ke || t[130] !== we || t[131] !== j ? (qe = /* @__PURE__ */ W(po, {
|
|
2975
2978
|
activeCell: T,
|
|
2976
2979
|
columns: N,
|
|
2977
2980
|
data: n,
|
|
@@ -3015,11 +3018,11 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
3015
3018
|
})
|
|
3016
3019
|
}), t[133] = Re, t[134] = We, t[135] = qe, t[136] = q, t[137] = Je) : Je = t[137];
|
|
3017
3020
|
let Ye;
|
|
3018
|
-
t[138] !== J || t[139] !== B || t[140] !== De || t[141] !== X || t[142] !== A ? (Ye = J && De.length > 0 ? /* @__PURE__ */ W(
|
|
3021
|
+
t[138] !== J || t[139] !== B || t[140] !== De || t[141] !== X || t[142] !== A ? (Ye = J && De.length > 0 ? /* @__PURE__ */ W(vo, {
|
|
3019
3022
|
selectedCount: De.length,
|
|
3020
3023
|
totalCount: B.length,
|
|
3021
3024
|
onClearSelection: () => A(/* @__PURE__ */ new Set()),
|
|
3022
|
-
onSelectAll: () => A(new Set(B.map(
|
|
3025
|
+
onSelectAll: () => A(new Set(B.map(No))),
|
|
3023
3026
|
actions: X,
|
|
3024
3027
|
selectedRows: De
|
|
3025
3028
|
}) : null, t[138] = J, t[139] = B, t[140] = De, t[141] = X, t[142] = A, t[143] = Ye) : Ye = t[143];
|
|
@@ -3029,7 +3032,7 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
3029
3032
|
width: "100%",
|
|
3030
3033
|
children: [Je, Ye]
|
|
3031
3034
|
}), t[144] = Je, t[145] = Ye, t[146] = Xe) : Xe = t[146];
|
|
3032
|
-
let Ze = K > 1 ? /* @__PURE__ */ W(
|
|
3035
|
+
let Ze = K > 1 ? /* @__PURE__ */ W(_o, {
|
|
3033
3036
|
pageCount: K,
|
|
3034
3037
|
pageIndex: y,
|
|
3035
3038
|
pageSize: C,
|
|
@@ -3049,51 +3052,51 @@ var go = (e) => `${e}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Ma
|
|
|
3049
3052
|
]
|
|
3050
3053
|
}), t[147] = je, t[148] = Xe, t[149] = Ze, t[150] = Qe) : Qe = t[150], Qe;
|
|
3051
3054
|
};
|
|
3052
|
-
function
|
|
3055
|
+
function So() {
|
|
3053
3056
|
return /* @__PURE__ */ new Set();
|
|
3054
3057
|
}
|
|
3055
|
-
function
|
|
3058
|
+
function Co(e) {
|
|
3056
3059
|
return e.id;
|
|
3057
3060
|
}
|
|
3058
|
-
function
|
|
3061
|
+
function wo(e) {
|
|
3059
3062
|
return [e.id, e.label];
|
|
3060
3063
|
}
|
|
3061
|
-
function
|
|
3064
|
+
function To(e) {
|
|
3062
3065
|
return e.filters;
|
|
3063
3066
|
}
|
|
3064
|
-
function
|
|
3067
|
+
function Eo(e) {
|
|
3065
3068
|
return e.sourceRow;
|
|
3066
3069
|
}
|
|
3067
|
-
function
|
|
3070
|
+
function Do(e) {
|
|
3068
3071
|
return e > 0 && e <= 50;
|
|
3069
3072
|
}
|
|
3070
|
-
function
|
|
3073
|
+
function Oo(e) {
|
|
3071
3074
|
return e.id;
|
|
3072
3075
|
}
|
|
3073
|
-
function
|
|
3076
|
+
function ko(e) {
|
|
3074
3077
|
return [e.id, ""];
|
|
3075
3078
|
}
|
|
3076
|
-
function
|
|
3079
|
+
function Ao(e) {
|
|
3077
3080
|
return e.sourceRow;
|
|
3078
3081
|
}
|
|
3079
|
-
function
|
|
3082
|
+
function jo(e) {
|
|
3080
3083
|
return /* @__PURE__ */ W("col", {}, e.id);
|
|
3081
3084
|
}
|
|
3082
|
-
function
|
|
3085
|
+
function Mo(e) {
|
|
3083
3086
|
return e.id;
|
|
3084
3087
|
}
|
|
3085
|
-
function
|
|
3088
|
+
function No(e) {
|
|
3086
3089
|
return e.id;
|
|
3087
3090
|
}
|
|
3088
3091
|
//#endregion
|
|
3089
3092
|
//#region src/components/rich-text/lazy-markdown-editor.tsx
|
|
3090
|
-
var
|
|
3093
|
+
var Po = (e) => {
|
|
3091
3094
|
let [t, n] = $(null);
|
|
3092
3095
|
return Z(() => {
|
|
3093
3096
|
let e = !1;
|
|
3094
3097
|
return (async () => {
|
|
3095
3098
|
await l();
|
|
3096
|
-
let t = await Promise.resolve().then(() =>
|
|
3099
|
+
let t = await Promise.resolve().then(() => ou);
|
|
3097
3100
|
e || n(() => t.MarkdownEditor);
|
|
3098
3101
|
})(), () => {
|
|
3099
3102
|
e = !0;
|
|
@@ -3104,10 +3107,10 @@ var jo = (e) => {
|
|
|
3104
3107
|
borderColor: "border",
|
|
3105
3108
|
borderRadius: "xs"
|
|
3106
3109
|
});
|
|
3107
|
-
},
|
|
3110
|
+
}, Fo = {
|
|
3108
3111
|
extensions: [Mn(), Nn()],
|
|
3109
3112
|
mdastExtensions: [Dn(), kn()]
|
|
3110
|
-
},
|
|
3113
|
+
}, Io = {
|
|
3111
3114
|
bullet: "-",
|
|
3112
3115
|
emphasis: "*",
|
|
3113
3116
|
extensions: [On(), An()],
|
|
@@ -3116,7 +3119,7 @@ var jo = (e) => {
|
|
|
3116
3119
|
listItemIndent: "one",
|
|
3117
3120
|
rule: "-",
|
|
3118
3121
|
strong: "*"
|
|
3119
|
-
},
|
|
3122
|
+
}, Lo = (e) => e.match(/^ {0,3}(`{3,}|~{3,})/), Ro = (e) => {
|
|
3120
3123
|
let t = null, n = "";
|
|
3121
3124
|
for (let r = 0; r < e.length;) {
|
|
3122
3125
|
if (e[r] === "`") {
|
|
@@ -3138,7 +3141,7 @@ var jo = (e) => {
|
|
|
3138
3141
|
n += e[r], r += 1;
|
|
3139
3142
|
}
|
|
3140
3143
|
return n;
|
|
3141
|
-
},
|
|
3144
|
+
}, zo = (e) => {
|
|
3142
3145
|
let t = null, n = [];
|
|
3143
3146
|
for (let r of e.split("\n")) {
|
|
3144
3147
|
if (t) {
|
|
@@ -3147,7 +3150,7 @@ var jo = (e) => {
|
|
|
3147
3150
|
e?.[0] === t.character && e.length >= t.length && (t = null);
|
|
3148
3151
|
continue;
|
|
3149
3152
|
}
|
|
3150
|
-
let e =
|
|
3153
|
+
let e = Lo(r)?.[1];
|
|
3151
3154
|
if (e) {
|
|
3152
3155
|
t = {
|
|
3153
3156
|
character: e[0] ?? "`",
|
|
@@ -3169,43 +3172,43 @@ var jo = (e) => {
|
|
|
3169
3172
|
n.push(r.replace("\\]", () => "$$"));
|
|
3170
3173
|
continue;
|
|
3171
3174
|
}
|
|
3172
|
-
n.push(
|
|
3175
|
+
n.push(Ro(r));
|
|
3173
3176
|
}
|
|
3174
3177
|
return n.join("\n");
|
|
3175
|
-
},
|
|
3178
|
+
}, Bo = (e) => En(zo(e), Fo), Vo = (e) => En(e, Fo), Ho = (e) => jn(e, Io).trimEnd(), Uo = (e) => Ho({
|
|
3176
3179
|
type: "root",
|
|
3177
3180
|
children: [e]
|
|
3178
|
-
}),
|
|
3181
|
+
}), Wo = (e) => Uo({
|
|
3179
3182
|
type: "paragraph",
|
|
3180
3183
|
children: e
|
|
3181
|
-
}),
|
|
3182
|
-
let t =
|
|
3184
|
+
}), Go = (e) => {
|
|
3185
|
+
let t = Bo(e).children[0];
|
|
3183
3186
|
return t?.type === "paragraph" || t?.type === "heading" ? t.children : [];
|
|
3184
|
-
},
|
|
3187
|
+
}, Ko = /* @__PURE__ */ new Set([
|
|
3185
3188
|
"http:",
|
|
3186
3189
|
"https:",
|
|
3187
3190
|
"mailto:",
|
|
3188
3191
|
"sms:",
|
|
3189
3192
|
"tel:"
|
|
3190
|
-
]),
|
|
3191
|
-
if (e.startsWith("#") || e.startsWith("/") || e.startsWith("./") || e.startsWith("../") || !
|
|
3193
|
+
]), qo = /^data:image\/(?:png|gif|jpeg|webp);base64,[a-z0-9+/=]+$/i, Jo = /^[a-z][a-z\d+.-]*:/i, Yo = (e) => {
|
|
3194
|
+
if (e.startsWith("#") || e.startsWith("/") || e.startsWith("./") || e.startsWith("../") || !Jo.test(e)) return !0;
|
|
3192
3195
|
try {
|
|
3193
|
-
return
|
|
3196
|
+
return Ko.has(new URL(e).protocol);
|
|
3194
3197
|
} catch {
|
|
3195
3198
|
return !1;
|
|
3196
3199
|
}
|
|
3197
|
-
},
|
|
3200
|
+
}, Xo = (e) => e.startsWith("https://") ? !0 : qo.test(e), Zo = (e, t, n) => {
|
|
3198
3201
|
let r = n ? n(e, t) : e;
|
|
3199
|
-
return r === null ? null : t === "image" ? !
|
|
3200
|
-
},
|
|
3202
|
+
return r === null ? null : t === "image" ? !Jo.test(e) && !n ? null : Xo(r) ? r : null : Yo(r) ? r : null;
|
|
3203
|
+
}, Qo = te(void 0), $o = (e) => {
|
|
3201
3204
|
let t = H(3), { children: n, resolver: r } = e, i;
|
|
3202
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ W(
|
|
3205
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ W(Qo.Provider, {
|
|
3203
3206
|
value: r,
|
|
3204
3207
|
children: n
|
|
3205
3208
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
3206
|
-
},
|
|
3207
|
-
let t = H(10), { source: n, alt: r, title: i, onLoad: a } = e, o =
|
|
3208
|
-
t[0] !== o || t[1] !== n ? (s =
|
|
3209
|
+
}, es = () => re(Qo), ts = (e) => {
|
|
3210
|
+
let t = H(10), { source: n, alt: r, title: i, onLoad: a } = e, o = es(), s;
|
|
3211
|
+
t[0] !== o || t[1] !== n ? (s = Zo(n, "image", o), t[0] = o, t[1] = n, t[2] = s) : s = t[2];
|
|
3209
3212
|
let c = s;
|
|
3210
3213
|
if (!c) {
|
|
3211
3214
|
let e = r || "Image", n;
|
|
@@ -3233,7 +3236,7 @@ var jo = (e) => {
|
|
|
3233
3236
|
referrerPolicy: "no-referrer",
|
|
3234
3237
|
onLoad: a
|
|
3235
3238
|
}), t[5] = r, t[6] = a, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
3236
|
-
},
|
|
3239
|
+
}, ns = class e extends on {
|
|
3237
3240
|
__source;
|
|
3238
3241
|
__alt;
|
|
3239
3242
|
__title;
|
|
@@ -3277,10 +3280,10 @@ var jo = (e) => {
|
|
|
3277
3280
|
};
|
|
3278
3281
|
}
|
|
3279
3282
|
static importJSON(e) {
|
|
3280
|
-
return
|
|
3283
|
+
return rs(e.source, e.alt, e.title);
|
|
3281
3284
|
}
|
|
3282
3285
|
decorate(e) {
|
|
3283
|
-
return /* @__PURE__ */ W(
|
|
3286
|
+
return /* @__PURE__ */ W(ts, {
|
|
3284
3287
|
source: this.__source,
|
|
3285
3288
|
alt: this.__alt,
|
|
3286
3289
|
title: this.__title,
|
|
@@ -3300,7 +3303,7 @@ var jo = (e) => {
|
|
|
3300
3303
|
}
|
|
3301
3304
|
});
|
|
3302
3305
|
}
|
|
3303
|
-
},
|
|
3306
|
+
}, rs = (e, t, n = null) => zt(new ns(e, t, n)), is = (e) => e instanceof ns, as = (e) => /^<!--[\s\S]*-->$/.test(e.trim()), os = (e, t) => {
|
|
3304
3307
|
if (typeof document > "u") return null;
|
|
3305
3308
|
let n = Pn.sanitize(e, { FORBID_TAGS: [
|
|
3306
3309
|
"script",
|
|
@@ -3316,27 +3319,27 @@ var jo = (e) => {
|
|
|
3316
3319
|
] }), r = document.createElement("template");
|
|
3317
3320
|
r.innerHTML = n;
|
|
3318
3321
|
for (let e of r.content.querySelectorAll("[href], [src]")) {
|
|
3319
|
-
let n = e.hasAttribute("href") ? "href" : "src", r = n === "href" ? "link" : "image", i =
|
|
3322
|
+
let n = e.hasAttribute("href") ? "href" : "src", r = n === "href" ? "link" : "image", i = Zo(e.getAttribute(n) ?? "", r, t);
|
|
3320
3323
|
i ? e.setAttribute(n, i) : e.removeAttribute(n);
|
|
3321
3324
|
}
|
|
3322
3325
|
return r.content;
|
|
3323
|
-
},
|
|
3324
|
-
let t = H(7), { source: n, display: r } = e, i =
|
|
3326
|
+
}, ss = (e) => {
|
|
3327
|
+
let t = H(7), { source: n, display: r } = e, i = es(), a = Q(null), o;
|
|
3325
3328
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = (e) => {
|
|
3326
3329
|
a.current = e;
|
|
3327
3330
|
}, t[0] = o) : o = t[0];
|
|
3328
3331
|
let s = o, c, l;
|
|
3329
3332
|
if (t[1] !== i || t[2] !== n ? (c = () => {
|
|
3330
|
-
let e =
|
|
3333
|
+
let e = os(n, i), t = a.current;
|
|
3331
3334
|
t && t.replaceChildren(e ? e.cloneNode(!0) : document.createTextNode(""));
|
|
3332
|
-
}, l = [i, n], t[1] = i, t[2] = n, t[3] = c, t[4] = l) : (c = t[3], l = t[4]), Z(c, l),
|
|
3335
|
+
}, l = [i, n], t[1] = i, t[2] = n, t[3] = c, t[4] = l) : (c = t[3], l = t[4]), Z(c, l), as(n)) return null;
|
|
3333
3336
|
if (r === "inline") {
|
|
3334
3337
|
let e;
|
|
3335
3338
|
return t[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ W("span", { ref: s }), t[5] = e) : e = t[5], e;
|
|
3336
3339
|
}
|
|
3337
3340
|
let u;
|
|
3338
3341
|
return t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ W("div", { ref: s }), t[6] = u) : u = t[6], u;
|
|
3339
|
-
},
|
|
3342
|
+
}, cs = class e extends on {
|
|
3340
3343
|
__source;
|
|
3341
3344
|
__display;
|
|
3342
3345
|
static getType() {
|
|
@@ -3364,7 +3367,7 @@ var jo = (e) => {
|
|
|
3364
3367
|
return this.__display;
|
|
3365
3368
|
}
|
|
3366
3369
|
getTextContent() {
|
|
3367
|
-
return
|
|
3370
|
+
return as(this.__source) ? "" : this.__source;
|
|
3368
3371
|
}
|
|
3369
3372
|
exportJSON() {
|
|
3370
3373
|
return {
|
|
@@ -3375,16 +3378,16 @@ var jo = (e) => {
|
|
|
3375
3378
|
};
|
|
3376
3379
|
}
|
|
3377
3380
|
static importJSON(e) {
|
|
3378
|
-
return
|
|
3381
|
+
return ls(e.source, e.display);
|
|
3379
3382
|
}
|
|
3380
3383
|
decorate() {
|
|
3381
|
-
return /* @__PURE__ */ W(
|
|
3384
|
+
return /* @__PURE__ */ W(ss, {
|
|
3382
3385
|
source: this.__source,
|
|
3383
3386
|
display: this.__display
|
|
3384
3387
|
});
|
|
3385
3388
|
}
|
|
3386
|
-
},
|
|
3387
|
-
let t = H(5), { nodes: n } = e, r =
|
|
3389
|
+
}, ls = (e, t) => zt(new cs(e, t)), us = (e) => e instanceof cs, ds = (e) => {
|
|
3390
|
+
let t = H(5), { nodes: n } = e, r = es(), i;
|
|
3388
3391
|
if (t[0] !== n || t[1] !== r) {
|
|
3389
3392
|
let e;
|
|
3390
3393
|
t[3] === r ? e = t[4] : (e = (e, t) => {
|
|
@@ -3394,34 +3397,34 @@ var jo = (e) => {
|
|
|
3394
3397
|
case "strong": return /* @__PURE__ */ W(R, {
|
|
3395
3398
|
as: "strong",
|
|
3396
3399
|
fontWeight: "semibold",
|
|
3397
|
-
children: /* @__PURE__ */ W(
|
|
3400
|
+
children: /* @__PURE__ */ W(ds, { nodes: e.children })
|
|
3398
3401
|
}, n);
|
|
3399
3402
|
case "emphasis": return /* @__PURE__ */ W(_, {
|
|
3400
3403
|
as: "em",
|
|
3401
|
-
children: /* @__PURE__ */ W(
|
|
3404
|
+
children: /* @__PURE__ */ W(ds, { nodes: e.children })
|
|
3402
3405
|
}, n);
|
|
3403
3406
|
case "delete": return /* @__PURE__ */ W(_, {
|
|
3404
3407
|
as: "del",
|
|
3405
|
-
children: /* @__PURE__ */ W(
|
|
3408
|
+
children: /* @__PURE__ */ W(ds, { nodes: e.children })
|
|
3406
3409
|
}, n);
|
|
3407
3410
|
case "inlineCode": return /* @__PURE__ */ W(y, { children: e.value }, n);
|
|
3408
3411
|
case "break": return /* @__PURE__ */ W("br", {}, n);
|
|
3409
3412
|
case "link": {
|
|
3410
|
-
let t =
|
|
3413
|
+
let t = Zo(e.url, "link", r);
|
|
3411
3414
|
return t ? /* @__PURE__ */ W(k, {
|
|
3412
3415
|
href: t,
|
|
3413
3416
|
title: e.title ?? void 0,
|
|
3414
3417
|
target: "_blank",
|
|
3415
3418
|
rel: "noopener noreferrer",
|
|
3416
|
-
children: /* @__PURE__ */ W(
|
|
3417
|
-
}, n) : /* @__PURE__ */ W(
|
|
3419
|
+
children: /* @__PURE__ */ W(ds, { nodes: e.children })
|
|
3420
|
+
}, n) : /* @__PURE__ */ W(ds, { nodes: e.children }, n);
|
|
3418
3421
|
}
|
|
3419
|
-
case "image": return /* @__PURE__ */ W(
|
|
3422
|
+
case "image": return /* @__PURE__ */ W(ts, {
|
|
3420
3423
|
source: e.url,
|
|
3421
3424
|
alt: e.alt ?? "",
|
|
3422
3425
|
title: e.title ?? null
|
|
3423
3426
|
}, n);
|
|
3424
|
-
case "html": return /* @__PURE__ */ W(
|
|
3427
|
+
case "html": return /* @__PURE__ */ W(ss, {
|
|
3425
3428
|
source: e.value,
|
|
3426
3429
|
display: "inline"
|
|
3427
3430
|
}, n);
|
|
@@ -3431,15 +3434,15 @@ var jo = (e) => {
|
|
|
3431
3434
|
}, t[3] = r, t[4] = e), i = n.map(e), t[0] = n, t[1] = r, t[2] = i;
|
|
3432
3435
|
} else i = t[2];
|
|
3433
3436
|
return i;
|
|
3434
|
-
},
|
|
3437
|
+
}, fs = (e) => {
|
|
3435
3438
|
let t = H(4), { value: n } = e, r;
|
|
3436
|
-
t[0] === n ? r = t[1] : (r =
|
|
3439
|
+
t[0] === n ? r = t[1] : (r = Go(n), t[0] = n, t[1] = r);
|
|
3437
3440
|
let i;
|
|
3438
|
-
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ W(
|
|
3439
|
-
},
|
|
3441
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ W(ds, { nodes: r }), t[2] = r, t[3] = i), i;
|
|
3442
|
+
}, ps = (e) => e.rows.map((e) => ({
|
|
3440
3443
|
id: e.id,
|
|
3441
3444
|
...e.cells
|
|
3442
|
-
})),
|
|
3445
|
+
})), ms = (e) => e.columns, hs = (e) => {
|
|
3443
3446
|
let t = H(38), { editor: n, nodeKey: r, table: i } = e, [a, o] = $(!1), s = Q(null), c;
|
|
3444
3447
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
|
|
3445
3448
|
setTimeout(() => s.current?.focus(), 0);
|
|
@@ -3448,7 +3451,7 @@ var jo = (e) => {
|
|
|
3448
3451
|
t[1] !== n || t[2] !== r ? (u = (e) => {
|
|
3449
3452
|
n.update(() => {
|
|
3450
3453
|
let t = Ut(r);
|
|
3451
|
-
|
|
3454
|
+
vs(t) && t.setTable(e(t.getTable()));
|
|
3452
3455
|
}, { tag: un }), l();
|
|
3453
3456
|
}, t[1] = n, t[2] = r, t[3] = u) : u = t[3];
|
|
3454
3457
|
let d = u, f;
|
|
@@ -3475,7 +3478,7 @@ var jo = (e) => {
|
|
|
3475
3478
|
t[8] !== n || t[9] !== r ? (g = () => {
|
|
3476
3479
|
n.update(() => {
|
|
3477
3480
|
let e = Ut(r);
|
|
3478
|
-
if (
|
|
3481
|
+
if (vs(e)) {
|
|
3479
3482
|
let t = Vt();
|
|
3480
3483
|
e.replace(t), t.select();
|
|
3481
3484
|
}
|
|
@@ -3501,26 +3504,26 @@ var jo = (e) => {
|
|
|
3501
3504
|
let w = C, T = String(a), E = a ? "2px solid" : "none", D;
|
|
3502
3505
|
t[17] === Symbol.for("react.memo_cache_sentinel") ? (D = () => o(!0), t[17] = D) : D = t[17];
|
|
3503
3506
|
let O;
|
|
3504
|
-
t[18] === i ? O = t[19] : (O =
|
|
3507
|
+
t[18] === i ? O = t[19] : (O = ps(i), t[18] = i, t[19] = O);
|
|
3505
3508
|
let k;
|
|
3506
|
-
t[20] === i ? k = t[21] : (k =
|
|
3509
|
+
t[20] === i ? k = t[21] : (k = ms(i), t[20] = i, t[21] = k);
|
|
3507
3510
|
let A;
|
|
3508
3511
|
t[22] !== p || t[23] !== h || t[24] !== k ? (A = {
|
|
3509
3512
|
columns: k,
|
|
3510
3513
|
onColumnsChange: p,
|
|
3511
3514
|
onDataChange: h,
|
|
3512
|
-
renderHeader:
|
|
3513
|
-
renderCell:
|
|
3514
|
-
renderCellEditor:
|
|
3515
|
+
renderHeader: ys,
|
|
3516
|
+
renderCell: bs,
|
|
3517
|
+
renderCellEditor: xs
|
|
3515
3518
|
}, t[22] = p, t[23] = h, t[24] = k, t[25] = A) : A = t[25];
|
|
3516
3519
|
let j;
|
|
3517
3520
|
t[26] === n ? j = t[27] : (j = n.isEditable(), t[26] = n, t[27] = j);
|
|
3518
3521
|
let M = !j, N;
|
|
3519
|
-
t[28] !== O || t[29] !== A || t[30] !== M ? (N = /* @__PURE__ */ W(
|
|
3522
|
+
t[28] !== O || t[29] !== A || t[30] !== M ? (N = /* @__PURE__ */ W(xo, {
|
|
3520
3523
|
data: O,
|
|
3521
3524
|
editMode: A,
|
|
3522
3525
|
fullWidth: !0,
|
|
3523
|
-
getRowId:
|
|
3526
|
+
getRowId: Ss,
|
|
3524
3527
|
initialPageSize: 30,
|
|
3525
3528
|
isReadOnly: M
|
|
3526
3529
|
}), t[28] = O, t[29] = A, t[30] = M, t[31] = N) : N = t[31];
|
|
@@ -3542,7 +3545,7 @@ var jo = (e) => {
|
|
|
3542
3545
|
onKeyDownCapture: w,
|
|
3543
3546
|
children: N
|
|
3544
3547
|
}), t[32] = w, t[33] = a, t[34] = N, t[35] = T, t[36] = E, t[37] = P) : P = t[37], P;
|
|
3545
|
-
},
|
|
3548
|
+
}, gs = class e extends on {
|
|
3546
3549
|
__table;
|
|
3547
3550
|
static getType() {
|
|
3548
3551
|
return "data_table";
|
|
@@ -3567,7 +3570,7 @@ var jo = (e) => {
|
|
|
3567
3570
|
return !1;
|
|
3568
3571
|
}
|
|
3569
3572
|
decorate(e) {
|
|
3570
|
-
return /* @__PURE__ */ W(
|
|
3573
|
+
return /* @__PURE__ */ W(hs, {
|
|
3571
3574
|
editor: e,
|
|
3572
3575
|
nodeKey: this.__key,
|
|
3573
3576
|
table: this.__table
|
|
@@ -3581,7 +3584,7 @@ var jo = (e) => {
|
|
|
3581
3584
|
};
|
|
3582
3585
|
}
|
|
3583
3586
|
static importJSON(e) {
|
|
3584
|
-
return
|
|
3587
|
+
return _s(e.table);
|
|
3585
3588
|
}
|
|
3586
3589
|
getTextContent() {
|
|
3587
3590
|
return [
|
|
@@ -3590,16 +3593,16 @@ var jo = (e) => {
|
|
|
3590
3593
|
...this.__table.rows.map((e) => this.__table.columns.map((t) => e.cells[t.id] ?? "").join(" | "))
|
|
3591
3594
|
].join("\n");
|
|
3592
3595
|
}
|
|
3593
|
-
},
|
|
3594
|
-
function
|
|
3595
|
-
return /* @__PURE__ */ W(
|
|
3596
|
+
}, _s = (e) => zt(new gs(e)), vs = (e) => e instanceof gs;
|
|
3597
|
+
function ys(e) {
|
|
3598
|
+
return /* @__PURE__ */ W(fs, { value: e.label });
|
|
3596
3599
|
}
|
|
3597
|
-
function
|
|
3598
|
-
return /* @__PURE__ */ W(
|
|
3600
|
+
function bs(e) {
|
|
3601
|
+
return /* @__PURE__ */ W(fs, { value: String(e.value ?? "") });
|
|
3599
3602
|
}
|
|
3600
|
-
function
|
|
3603
|
+
function xs(e) {
|
|
3601
3604
|
let { value: t, onChange: n } = e;
|
|
3602
|
-
return /* @__PURE__ */ W(
|
|
3605
|
+
return /* @__PURE__ */ W(Po, {
|
|
3603
3606
|
autoFocus: !0,
|
|
3604
3607
|
defaultState: t,
|
|
3605
3608
|
fullWidth: !0,
|
|
@@ -3609,12 +3612,12 @@ function vs(e) {
|
|
|
3609
3612
|
onChange: n
|
|
3610
3613
|
});
|
|
3611
3614
|
}
|
|
3612
|
-
function
|
|
3615
|
+
function Ss(e) {
|
|
3613
3616
|
return String(e.id);
|
|
3614
3617
|
}
|
|
3615
3618
|
//#endregion
|
|
3616
3619
|
//#region src/components/rich-text/shared/nodes/MarkdownLinkNode.ts
|
|
3617
|
-
var
|
|
3620
|
+
var Cs = (e, t) => Zo(e, "link", t) ?? "about:blank", ws = class e extends _t {
|
|
3618
3621
|
__source;
|
|
3619
3622
|
static getType() {
|
|
3620
3623
|
return "markdown-link";
|
|
@@ -3627,14 +3630,14 @@ var bs = (e, t) => Jo(e, "link", t) ?? "about:blank", xs = class e extends _t {
|
|
|
3627
3630
|
}, t.__key);
|
|
3628
3631
|
}
|
|
3629
3632
|
constructor(e = "", t, n, r) {
|
|
3630
|
-
super(t ??
|
|
3633
|
+
super(t ?? Cs(e), n, r), this.__source = e;
|
|
3631
3634
|
}
|
|
3632
3635
|
getSource() {
|
|
3633
3636
|
return this.__source;
|
|
3634
3637
|
}
|
|
3635
3638
|
setURL(e) {
|
|
3636
3639
|
let t = this.getWritable();
|
|
3637
|
-
return t.__source = e, t.__url =
|
|
3640
|
+
return t.__source = e, t.__url = Cs(e), t;
|
|
3638
3641
|
}
|
|
3639
3642
|
exportJSON() {
|
|
3640
3643
|
return {
|
|
@@ -3645,18 +3648,18 @@ var bs = (e, t) => Jo(e, "link", t) ?? "about:blank", xs = class e extends _t {
|
|
|
3645
3648
|
};
|
|
3646
3649
|
}
|
|
3647
3650
|
static importJSON(e) {
|
|
3648
|
-
return
|
|
3651
|
+
return Ts(e.source, void 0, {
|
|
3649
3652
|
rel: e.rel,
|
|
3650
3653
|
target: e.target,
|
|
3651
3654
|
title: e.title
|
|
3652
3655
|
});
|
|
3653
3656
|
}
|
|
3654
|
-
},
|
|
3655
|
-
function
|
|
3657
|
+
}, Ts = (e, t, n) => zt(new ws(e, Cs(e, t), n)), Es = (e) => e instanceof ws, Ds = K.lazy(() => import("./EquationComponent-DDd5UoIP.js"));
|
|
3658
|
+
function Os(e) {
|
|
3656
3659
|
let t = e.getAttribute("data-lexical-equation"), n = e.getAttribute("data-lexical-inline") === "true";
|
|
3657
|
-
return t = atob(t || ""), t ? { node:
|
|
3660
|
+
return t = atob(t || ""), t ? { node: As(t, n) } : null;
|
|
3658
3661
|
}
|
|
3659
|
-
var
|
|
3662
|
+
var ks = class e extends on {
|
|
3660
3663
|
__equation;
|
|
3661
3664
|
__inline;
|
|
3662
3665
|
static getType() {
|
|
@@ -3669,7 +3672,7 @@ var Es = class e extends on {
|
|
|
3669
3672
|
super(n), this.__equation = e, this.__inline = t ?? !1;
|
|
3670
3673
|
}
|
|
3671
3674
|
static importJSON(e) {
|
|
3672
|
-
return
|
|
3675
|
+
return As(e.equation, e.inline);
|
|
3673
3676
|
}
|
|
3674
3677
|
exportJSON() {
|
|
3675
3678
|
return {
|
|
@@ -3697,11 +3700,11 @@ var Es = class e extends on {
|
|
|
3697
3700
|
static importDOM() {
|
|
3698
3701
|
return {
|
|
3699
3702
|
div: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
3700
|
-
conversion:
|
|
3703
|
+
conversion: Os,
|
|
3701
3704
|
priority: 2
|
|
3702
3705
|
} : null,
|
|
3703
3706
|
span: (e) => e.hasAttribute("data-lexical-equation") ? {
|
|
3704
|
-
conversion:
|
|
3707
|
+
conversion: Os,
|
|
3705
3708
|
priority: 1
|
|
3706
3709
|
} : null
|
|
3707
3710
|
};
|
|
@@ -3725,46 +3728,46 @@ var Es = class e extends on {
|
|
|
3725
3728
|
decorate() {
|
|
3726
3729
|
return /* @__PURE__ */ W(q, {
|
|
3727
3730
|
fallback: null,
|
|
3728
|
-
children: /* @__PURE__ */ W(
|
|
3731
|
+
children: /* @__PURE__ */ W(Ds, {
|
|
3729
3732
|
equation: this.__equation,
|
|
3730
3733
|
inline: this.__inline
|
|
3731
3734
|
})
|
|
3732
3735
|
});
|
|
3733
3736
|
}
|
|
3734
3737
|
};
|
|
3735
|
-
function
|
|
3736
|
-
let n = new
|
|
3738
|
+
function As(e = "", t = !1) {
|
|
3739
|
+
let n = new ks(e, t);
|
|
3737
3740
|
return zt(n);
|
|
3738
3741
|
}
|
|
3739
|
-
function
|
|
3740
|
-
return e instanceof
|
|
3742
|
+
function js(e) {
|
|
3743
|
+
return e instanceof ks;
|
|
3741
3744
|
}
|
|
3742
3745
|
//#endregion
|
|
3743
3746
|
//#region src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.tsx
|
|
3744
|
-
var
|
|
3745
|
-
dependencies: [
|
|
3746
|
-
export: (e) =>
|
|
3747
|
+
var Ms = {
|
|
3748
|
+
dependencies: [ks],
|
|
3749
|
+
export: (e) => js(e) && e.isInline() ? `\\( ${e.getEquation().trim()} \\)` : null,
|
|
3747
3750
|
importRegExp: /\\\((.*?)\\\)/,
|
|
3748
3751
|
regExp: /\\\((.*?)\\\)/,
|
|
3749
3752
|
replace: (e, t) => {
|
|
3750
|
-
let n =
|
|
3753
|
+
let n = As(t[1].trim(), !0);
|
|
3751
3754
|
e.replace(n);
|
|
3752
3755
|
},
|
|
3753
3756
|
type: "text-match"
|
|
3754
|
-
},
|
|
3755
|
-
dependencies: [
|
|
3757
|
+
}, Ns = {
|
|
3758
|
+
dependencies: [ks],
|
|
3756
3759
|
regExpStart: /\\\[/,
|
|
3757
3760
|
regExpEnd: /\\]/,
|
|
3758
|
-
export: (e) =>
|
|
3759
|
-
replace: (e, t, n, r, i) => i ? (e.append(
|
|
3761
|
+
export: (e) => js(e) && !e.isInline() ? `\\[ ${e.getEquation().trim()} \\]` : null,
|
|
3762
|
+
replace: (e, t, n, r, i) => i ? (e.append(As(i.join(" "), !1)), !0) : !1,
|
|
3760
3763
|
type: "multiline-element"
|
|
3761
3764
|
};
|
|
3762
|
-
function
|
|
3765
|
+
function Ps() {
|
|
3763
3766
|
return null;
|
|
3764
3767
|
}
|
|
3765
3768
|
//#endregion
|
|
3766
3769
|
//#region src/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.ts
|
|
3767
|
-
var
|
|
3770
|
+
var Fs = class e extends sn {
|
|
3768
3771
|
static getType() {
|
|
3769
3772
|
return "hr";
|
|
3770
3773
|
}
|
|
@@ -3772,7 +3775,7 @@ var Ms = class e extends sn {
|
|
|
3772
3775
|
return new e(t?.__key);
|
|
3773
3776
|
}
|
|
3774
3777
|
static importJSON(e) {
|
|
3775
|
-
return
|
|
3778
|
+
return Is();
|
|
3776
3779
|
}
|
|
3777
3780
|
exportJSON() {
|
|
3778
3781
|
return { ...super.exportJSON() };
|
|
@@ -3788,15 +3791,15 @@ var Ms = class e extends sn {
|
|
|
3788
3791
|
return null;
|
|
3789
3792
|
}
|
|
3790
3793
|
};
|
|
3791
|
-
function
|
|
3792
|
-
return new
|
|
3794
|
+
function Is() {
|
|
3795
|
+
return new Fs();
|
|
3793
3796
|
}
|
|
3794
|
-
function
|
|
3795
|
-
return e instanceof
|
|
3797
|
+
function Ls(e) {
|
|
3798
|
+
return e instanceof Fs;
|
|
3796
3799
|
}
|
|
3797
3800
|
//#endregion
|
|
3798
3801
|
//#region src/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.tsx
|
|
3799
|
-
var
|
|
3802
|
+
var Rs = ne(() => import("./MermaidComponent-Cxg7NtjX.js")), zs = class e extends on {
|
|
3800
3803
|
__code;
|
|
3801
3804
|
static getType() {
|
|
3802
3805
|
return "mermaid";
|
|
@@ -3836,31 +3839,31 @@ var Fs = ne(() => import("./MermaidComponent-DGDnQ6pb.js")), Is = class e extend
|
|
|
3836
3839
|
decorate() {
|
|
3837
3840
|
return /* @__PURE__ */ W(q, {
|
|
3838
3841
|
fallback: null,
|
|
3839
|
-
children: /* @__PURE__ */ W(
|
|
3842
|
+
children: /* @__PURE__ */ W(Rs, {
|
|
3840
3843
|
code: this.__code,
|
|
3841
3844
|
nodeKey: this.__key
|
|
3842
3845
|
})
|
|
3843
3846
|
});
|
|
3844
3847
|
}
|
|
3845
3848
|
};
|
|
3846
|
-
function
|
|
3847
|
-
return e instanceof
|
|
3849
|
+
function Bs(e) {
|
|
3850
|
+
return e instanceof zs;
|
|
3848
3851
|
}
|
|
3849
|
-
function
|
|
3850
|
-
return zt(new
|
|
3852
|
+
function Vs(e) {
|
|
3853
|
+
return zt(new zs(e));
|
|
3851
3854
|
}
|
|
3852
3855
|
//#endregion
|
|
3853
3856
|
//#region src/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.ts
|
|
3854
|
-
var
|
|
3855
|
-
dependencies: [
|
|
3856
|
-
export: (e) =>
|
|
3857
|
+
var Hs = {
|
|
3858
|
+
dependencies: [Fs],
|
|
3859
|
+
export: (e) => Ls(e) ? "***" : null,
|
|
3857
3860
|
regExp: /^(---|\*\*\*|___)\s?$/,
|
|
3858
3861
|
replace: (e) => {
|
|
3859
|
-
let t =
|
|
3862
|
+
let t = Is();
|
|
3860
3863
|
e.replace(t);
|
|
3861
3864
|
},
|
|
3862
3865
|
type: "element"
|
|
3863
|
-
},
|
|
3866
|
+
}, Us = {
|
|
3864
3867
|
dependencies: [hn],
|
|
3865
3868
|
export: (e, t) => {
|
|
3866
3869
|
if (e instanceof hn) {
|
|
@@ -3880,7 +3883,7 @@ var zs = {
|
|
|
3880
3883
|
n.toggleFormat("underline"), e.replace(n);
|
|
3881
3884
|
},
|
|
3882
3885
|
type: "text-match"
|
|
3883
|
-
},
|
|
3886
|
+
}, Ws = {
|
|
3884
3887
|
dependencies: [hn],
|
|
3885
3888
|
export: (e, t) => null,
|
|
3886
3889
|
regExp: /<u>(.*)<\/u>/,
|
|
@@ -3890,31 +3893,31 @@ var zs = {
|
|
|
3890
3893
|
n.toggleFormat("underline"), e.replace(n);
|
|
3891
3894
|
},
|
|
3892
3895
|
type: "text-match"
|
|
3893
|
-
},
|
|
3896
|
+
}, Gs = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, Ks = (e) => e.replace(/\\([*_`~\\])/g, "$1"), qs = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\""), Js = (e) => e?.replace(/\\(["\\])/g, "$1"), Ys = (e, t, n) => {
|
|
3894
3897
|
if (e !== t) return n;
|
|
3895
3898
|
let r = t.replace(/([*_`~\\])/g, "\\$1");
|
|
3896
3899
|
return n.replace(r, t);
|
|
3897
|
-
},
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3900
|
+
}, Xs = [
|
|
3901
|
+
Hs,
|
|
3902
|
+
Us,
|
|
3903
|
+
Ws,
|
|
3901
3904
|
{
|
|
3902
3905
|
dependencies: [_t],
|
|
3903
3906
|
export: (e, t) => {
|
|
3904
3907
|
if (!ht(e) || mt(e)) return null;
|
|
3905
|
-
let n = e.getTitle(), r =
|
|
3906
|
-
return n == null ? `[${i}](${r})` : `[${i}](${r} "${
|
|
3908
|
+
let n = e.getTitle(), r = Ks(e.getURL()), i = Ys(e.getTextContent(), r, t(e));
|
|
3909
|
+
return n == null ? `[${i}](${r})` : `[${i}](${r} "${qs(n)}")`;
|
|
3907
3910
|
},
|
|
3908
3911
|
importRegExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,
|
|
3909
3912
|
regExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,
|
|
3910
3913
|
replace: (e, t) => {
|
|
3911
|
-
let [, n, r, i] = t, a =
|
|
3914
|
+
let [, n, r, i] = t, a = Ks(r), o = pt(a, { title: Js(i) }), s = n.split("[").length - 1, c = n.split("]").length - 1, l = n, u = "";
|
|
3912
3915
|
if (s < c) return;
|
|
3913
3916
|
if (s > c) {
|
|
3914
3917
|
let e = n.split("[");
|
|
3915
3918
|
u = `[${e[0]}`, l = e.slice(1).join("[");
|
|
3916
3919
|
}
|
|
3917
|
-
let d =
|
|
3920
|
+
let d = Ks(l), f = Ht(d === a ? a : d);
|
|
3918
3921
|
return f.setFormat(e.getFormat()), o.append(f), e.replace(o), u && o.insertBefore(Ht(u)), f;
|
|
3919
3922
|
},
|
|
3920
3923
|
trigger: ")",
|
|
@@ -3924,45 +3927,45 @@ var zs = {
|
|
|
3924
3927
|
dependencies: [gt],
|
|
3925
3928
|
export: (e, t) => {
|
|
3926
3929
|
if (!mt(e)) return null;
|
|
3927
|
-
let n =
|
|
3928
|
-
return
|
|
3930
|
+
let n = Ks(e.getURL());
|
|
3931
|
+
return Ys(e.getTextContent(), n, t(e));
|
|
3929
3932
|
},
|
|
3930
|
-
regExp:
|
|
3931
|
-
importRegExp:
|
|
3933
|
+
regExp: Gs,
|
|
3934
|
+
importRegExp: Gs,
|
|
3932
3935
|
replace: (e, t) => {
|
|
3933
|
-
let n =
|
|
3936
|
+
let n = Ks(t[0]), r = ft(n), i = Ht(n);
|
|
3934
3937
|
i.setFormat(e.getFormat()), r.append(i), e.replace(r);
|
|
3935
3938
|
},
|
|
3936
3939
|
type: "text-match"
|
|
3937
3940
|
}
|
|
3938
|
-
],
|
|
3941
|
+
], Zs = [
|
|
3939
3942
|
Lt,
|
|
3940
3943
|
_t,
|
|
3941
3944
|
gt,
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3945
|
+
ws,
|
|
3946
|
+
ns,
|
|
3947
|
+
cs,
|
|
3948
|
+
gs,
|
|
3946
3949
|
It,
|
|
3947
3950
|
Dt,
|
|
3948
3951
|
Et,
|
|
3949
3952
|
Cn,
|
|
3950
3953
|
Sn,
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
+
zs,
|
|
3955
|
+
ks,
|
|
3956
|
+
Fs,
|
|
3954
3957
|
rr
|
|
3955
|
-
],
|
|
3958
|
+
], Qs = [
|
|
3956
3959
|
kt,
|
|
3957
3960
|
...jt.filter((e) => e !== At),
|
|
3958
|
-
...
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
+
...Xs,
|
|
3962
|
+
Ms,
|
|
3963
|
+
Ns,
|
|
3961
3964
|
sr
|
|
3962
|
-
],
|
|
3965
|
+
], $s = cr;
|
|
3963
3966
|
//#endregion
|
|
3964
3967
|
//#region src/components/rich-text/shared/plugins/CodePlugin/CodeBlockActionsPlugin.tsx
|
|
3965
|
-
function
|
|
3968
|
+
function ec(e) {
|
|
3966
3969
|
let t = Gt();
|
|
3967
3970
|
if (!Xt(t)) return null;
|
|
3968
3971
|
let n = t.anchor.getNode(), r = xn(n) ? n : Ln(n, (e) => xn(e));
|
|
@@ -3970,17 +3973,17 @@ function Zs(e) {
|
|
|
3970
3973
|
let i = e.getElementByKey(r.getKey());
|
|
3971
3974
|
return i instanceof HTMLElement ? i : null;
|
|
3972
3975
|
}
|
|
3973
|
-
function
|
|
3976
|
+
function tc(e) {
|
|
3974
3977
|
return e instanceof HTMLElement ? e.closest(".rich-text__code") : null;
|
|
3975
3978
|
}
|
|
3976
|
-
function
|
|
3979
|
+
function nc(e, t) {
|
|
3977
3980
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
3978
3981
|
return {
|
|
3979
3982
|
top: r.top - n.top + 6,
|
|
3980
3983
|
left: r.right - n.left - 30
|
|
3981
3984
|
};
|
|
3982
3985
|
}
|
|
3983
|
-
function
|
|
3986
|
+
function rc(e) {
|
|
3984
3987
|
let t = H(31), { anchorElem: n } = e, [r] = In(), [i, a] = $(null), [o, s] = $(!1), c = Q(null), l, d;
|
|
3985
3988
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = () => () => {
|
|
3986
3989
|
c.current !== null && window.clearTimeout(c.current);
|
|
@@ -3990,11 +3993,11 @@ function ec(e) {
|
|
|
3990
3993
|
let e = r.getRootElement();
|
|
3991
3994
|
if (!e) return;
|
|
3992
3995
|
let t = (e) => {
|
|
3993
|
-
let t =
|
|
3996
|
+
let t = tc(e.target);
|
|
3994
3997
|
a(t instanceof HTMLElement ? t : null);
|
|
3995
3998
|
}, n = () => {
|
|
3996
3999
|
r.getEditorState().read(() => {
|
|
3997
|
-
let e =
|
|
4000
|
+
let e = ec(r);
|
|
3998
4001
|
a(e);
|
|
3999
4002
|
});
|
|
4000
4003
|
};
|
|
@@ -4006,19 +4009,19 @@ function ec(e) {
|
|
|
4006
4009
|
if (t[5] === r ? (m = t[6], h = t[7]) : (m = () => zn(r.registerUpdateListener((e) => {
|
|
4007
4010
|
let { editorState: t } = e;
|
|
4008
4011
|
t.read(() => {
|
|
4009
|
-
let e =
|
|
4012
|
+
let e = ec(r);
|
|
4010
4013
|
e && a(e);
|
|
4011
4014
|
});
|
|
4012
4015
|
}), r.registerCommand(mn, () => (r.getEditorState().read(() => {
|
|
4013
|
-
let e =
|
|
4016
|
+
let e = ec(r);
|
|
4014
4017
|
if (!e) {
|
|
4015
|
-
a(
|
|
4018
|
+
a(ic);
|
|
4016
4019
|
return;
|
|
4017
4020
|
}
|
|
4018
4021
|
a(e);
|
|
4019
4022
|
}), !1), nn)), h = [r], t[5] = r, t[6] = m, t[7] = h), Z(m, h), !n || !i) return null;
|
|
4020
4023
|
let g;
|
|
4021
|
-
t[8] !== i || t[9] !== n ? (g =
|
|
4024
|
+
t[8] !== i || t[9] !== n ? (g = nc(n, i), t[8] = i, t[9] = n, t[10] = g) : g = t[10];
|
|
4022
4025
|
let _ = g, v;
|
|
4023
4026
|
t[11] !== _.left || t[12] !== _.top ? (v = {
|
|
4024
4027
|
position: "absolute",
|
|
@@ -4060,46 +4063,46 @@ function ec(e) {
|
|
|
4060
4063
|
let O;
|
|
4061
4064
|
return t[28] !== n || t[29] !== D ? (O = Vn(D, n), t[28] = n, t[29] = D, t[30] = O) : O = t[30], O;
|
|
4062
4065
|
}
|
|
4063
|
-
function
|
|
4066
|
+
function ic(e) {
|
|
4064
4067
|
return e?.matches(":hover") ? e : null;
|
|
4065
4068
|
}
|
|
4066
4069
|
//#endregion
|
|
4067
4070
|
//#region src/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.tsx
|
|
4068
|
-
function
|
|
4071
|
+
function ac(e) {
|
|
4069
4072
|
return e.trim().toLowerCase() === "mermaid";
|
|
4070
4073
|
}
|
|
4071
|
-
function
|
|
4072
|
-
return
|
|
4074
|
+
function oc(e) {
|
|
4075
|
+
return ac(e.getLanguage() ?? "plaintext") ? (e.replace(new zs(e.getTextContent())), !0) : !1;
|
|
4073
4076
|
}
|
|
4074
|
-
function
|
|
4077
|
+
function sc() {
|
|
4075
4078
|
let e = H(3), [t] = In(), n, r;
|
|
4076
4079
|
return e[0] === t ? (n = e[1], r = e[2]) : (n = () => {
|
|
4077
|
-
t.update(
|
|
4080
|
+
t.update(cc);
|
|
4078
4081
|
}, r = [t], e[0] = t, e[1] = n, e[2] = r), Z(n, r), null;
|
|
4079
4082
|
}
|
|
4080
|
-
function
|
|
4083
|
+
function cc() {
|
|
4081
4084
|
let e = $t(Cn);
|
|
4082
|
-
for (let t of e)
|
|
4085
|
+
for (let t of e) oc(t);
|
|
4083
4086
|
}
|
|
4084
4087
|
//#endregion
|
|
4085
4088
|
//#region src/components/rich-text/shared/plugins/CodePlugin/CodeHighlightingPlugin.tsx
|
|
4086
|
-
function
|
|
4089
|
+
function lc() {
|
|
4087
4090
|
let e = H(3), [t] = In(), n, r;
|
|
4088
4091
|
return e[0] === t ? (n = e[1], r = e[2]) : (n = () => wn(t), r = [t], e[0] = t, e[1] = n, e[2] = r), Z(n, r), null;
|
|
4089
4092
|
}
|
|
4090
4093
|
//#endregion
|
|
4091
4094
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/commands.ts
|
|
4092
|
-
var
|
|
4095
|
+
var uc = _n("TOGGLE_LINK_EDIT_MODE_COMMAND");
|
|
4093
4096
|
//#endregion
|
|
4094
4097
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/getSelectedNode.ts
|
|
4095
|
-
function
|
|
4098
|
+
function dc(e) {
|
|
4096
4099
|
let t = e.anchor, n = e.focus, r = e.anchor.getNode(), i = e.focus.getNode();
|
|
4097
4100
|
return r === i ? r : e.isBackward() ? Hn(n) ? r : i : Hn(t) ? r : i;
|
|
4098
4101
|
}
|
|
4099
4102
|
//#endregion
|
|
4100
4103
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.ts
|
|
4101
|
-
var
|
|
4102
|
-
function
|
|
4104
|
+
var fc = 10, pc = 5;
|
|
4105
|
+
function mc(e, t, n, r = fc, i = pc, a = "legacy", o = "anchor") {
|
|
4103
4106
|
let s = n.parentElement;
|
|
4104
4107
|
if (e === null || !s) {
|
|
4105
4108
|
t.style.opacity = "0", t.style.transform = "translate(-10000px, -10000px)";
|
|
@@ -4110,7 +4113,7 @@ function dc(e, t, n, r = lc, i = uc, a = "legacy", o = "anchor") {
|
|
|
4110
4113
|
}
|
|
4111
4114
|
//#endregion
|
|
4112
4115
|
//#region src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/floating-toolbar-buttons.tsx
|
|
4113
|
-
function
|
|
4116
|
+
function hc() {
|
|
4114
4117
|
let e = H(1), t;
|
|
4115
4118
|
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W("span", { style: {
|
|
4116
4119
|
display: "inline-flex",
|
|
@@ -4119,7 +4122,7 @@ function fc() {
|
|
|
4119
4122
|
borderLeft: "1px solid var(--chakra-colors-border-subtle)"
|
|
4120
4123
|
} }), e[0] = t) : t = e[0], t;
|
|
4121
4124
|
}
|
|
4122
|
-
function
|
|
4125
|
+
function gc(e) {
|
|
4123
4126
|
let t = H(88), { editor: n, blockType: r, isBold: i, isItalic: a, isUnderline: o, isCode: s, isLink: c, formatHeading: l, formatList: d, formatQuote: f, insertLink: p } = e, m = i || void 0, h;
|
|
4124
4127
|
t[0] === n ? h = t[1] : (h = () => n.dispatchCommand(cn, "bold"), t[0] = n, t[1] = h);
|
|
4125
4128
|
let g;
|
|
@@ -4181,7 +4184,7 @@ function pc(e) {
|
|
|
4181
4184
|
})
|
|
4182
4185
|
}), t[15] = S, t[16] = C, t[17] = E) : E = t[17];
|
|
4183
4186
|
let D;
|
|
4184
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ W(
|
|
4187
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ W(hc, {}), t[18] = D) : D = t[18];
|
|
4185
4188
|
let O = r === "h1" || void 0, k;
|
|
4186
4189
|
t[19] === l ? k = t[20] : (k = () => l("h1"), t[19] = l, t[20] = k);
|
|
4187
4190
|
let A;
|
|
@@ -4243,7 +4246,7 @@ function pc(e) {
|
|
|
4243
4246
|
})
|
|
4244
4247
|
}), t[34] = L, t[35] = z, t[36] = V) : V = t[36];
|
|
4245
4248
|
let U;
|
|
4246
|
-
t[37] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ W(
|
|
4249
|
+
t[37] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ W(hc, {}), t[37] = U) : U = t[37];
|
|
4247
4250
|
let K = s || void 0, ee;
|
|
4248
4251
|
t[38] === n ? ee = t[39] : (ee = () => n.dispatchCommand(cn, "code"), t[38] = n, t[39] = ee);
|
|
4249
4252
|
let q;
|
|
@@ -4291,7 +4294,7 @@ function pc(e) {
|
|
|
4291
4294
|
})
|
|
4292
4295
|
}), t[53] = f, t[54] = ie, t[55] = oe) : oe = t[55];
|
|
4293
4296
|
let Q;
|
|
4294
|
-
t[56] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ W(
|
|
4297
|
+
t[56] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ W(hc, {}), t[56] = Q) : Q = t[56];
|
|
4295
4298
|
let $ = r === "bullet" || void 0, se;
|
|
4296
4299
|
t[57] === d ? se = t[58] : (se = () => d("bullet"), t[57] = d, t[58] = se);
|
|
4297
4300
|
let ce;
|
|
@@ -4366,7 +4369,7 @@ function pc(e) {
|
|
|
4366
4369
|
}
|
|
4367
4370
|
//#endregion
|
|
4368
4371
|
//#region src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/resolve-block-type.ts
|
|
4369
|
-
var
|
|
4372
|
+
var _c = {
|
|
4370
4373
|
bullet: "Bulleted List",
|
|
4371
4374
|
check: "Check List",
|
|
4372
4375
|
code: "Code Block",
|
|
@@ -4379,25 +4382,25 @@ var mc = {
|
|
|
4379
4382
|
number: "Numbered List",
|
|
4380
4383
|
paragraph: "Normal",
|
|
4381
4384
|
quote: "Quote"
|
|
4382
|
-
},
|
|
4385
|
+
}, vc = (e) => e in _c ? e : null, yc = (e) => (e.getKey() === "root" ? e : Ln(e, (e) => {
|
|
4383
4386
|
let t = e.getParent();
|
|
4384
4387
|
return t !== null && Zt(t);
|
|
4385
|
-
})) ?? e.getTopLevelElementOrThrow(),
|
|
4386
|
-
let t =
|
|
4388
|
+
})) ?? e.getTopLevelElementOrThrow(), bc = (e) => {
|
|
4389
|
+
let t = yc(e);
|
|
4387
4390
|
if (St(t)) return t.getListType();
|
|
4388
4391
|
let n = Ln(e, (e) => St(e));
|
|
4389
|
-
return n !== null && St(n) ? n.getListType() :
|
|
4392
|
+
return n !== null && St(n) ? n.getListType() : vc(Pt(t) ? t.getTag() : t.getType());
|
|
4390
4393
|
};
|
|
4391
4394
|
//#endregion
|
|
4392
4395
|
//#region src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/should-show-floating-toolbar.ts
|
|
4393
|
-
function
|
|
4396
|
+
function xc(e) {
|
|
4394
4397
|
let { hasSelection: t, isRangeSelection: n, isCollapsed: r, hasNativeSelection: i, hasNativeRange: a, isAnchorInsideEditor: o, isEditorEditable: s, isPointerSelecting: c } = e;
|
|
4395
4398
|
return t && n && !r && i && a && o && s && !c;
|
|
4396
4399
|
}
|
|
4397
4400
|
//#endregion
|
|
4398
4401
|
//#region src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.tsx
|
|
4399
|
-
var
|
|
4400
|
-
function
|
|
4402
|
+
var Sc = -4;
|
|
4403
|
+
function Cc({ editor: e, anchorElem: t, isToolbarActive: n, setIsToolbarActive: r }) {
|
|
4401
4404
|
let i = Q(null), [a, o] = $("paragraph"), [s, c] = $(!1), [l, u] = $(!1), [d, f] = $(!1), [p, m] = $(!1), [h, g] = $(!1), v = Q(!1), y = Q(() => void 0), b = (t) => {
|
|
4402
4405
|
e.update(() => {
|
|
4403
4406
|
let e = Gt();
|
|
@@ -4436,21 +4439,21 @@ function bc({ editor: e, anchorElem: t, isToolbarActive: n, setIsToolbarActive:
|
|
|
4436
4439
|
e.dispatchCommand(vt, null);
|
|
4437
4440
|
return;
|
|
4438
4441
|
}
|
|
4439
|
-
e.dispatchCommand(
|
|
4442
|
+
e.dispatchCommand(uc, !0);
|
|
4440
4443
|
}, w = () => {
|
|
4441
4444
|
let e = Gt();
|
|
4442
4445
|
if (!Xt(e)) return;
|
|
4443
4446
|
c(e.hasFormat("bold")), u(e.hasFormat("italic")), f(e.hasFormat("underline")), m(e.hasFormat("code"));
|
|
4444
|
-
let t =
|
|
4447
|
+
let t = dc(e), n = Ln(t, ht), r = Ln(t, mt);
|
|
4445
4448
|
g(n !== null || r !== null);
|
|
4446
|
-
let i =
|
|
4449
|
+
let i = bc(e.anchor.getNode());
|
|
4447
4450
|
i && o(i);
|
|
4448
4451
|
};
|
|
4449
4452
|
return y.current = () => {
|
|
4450
4453
|
let n = Gt(), a = i.current, o = window.getSelection();
|
|
4451
4454
|
if (a === null) return;
|
|
4452
4455
|
let s = e.getRootElement(), c = o !== null, l = c && o.rangeCount > 0, u = !!s?.contains(c ? o.anchorNode : null);
|
|
4453
|
-
if (
|
|
4456
|
+
if (xc({
|
|
4454
4457
|
hasSelection: n !== null,
|
|
4455
4458
|
isRangeSelection: Xt(n),
|
|
4456
4459
|
isCollapsed: Xt(n) ? n.isCollapsed() : !1,
|
|
@@ -4461,8 +4464,8 @@ function bc({ editor: e, anchorElem: t, isToolbarActive: n, setIsToolbarActive:
|
|
|
4461
4464
|
isPointerSelecting: v.current
|
|
4462
4465
|
}) && o) {
|
|
4463
4466
|
let e = o.getRangeAt(0).getBoundingClientRect();
|
|
4464
|
-
e &&
|
|
4465
|
-
} else s !== null &&
|
|
4467
|
+
e && mc(new DOMRect(e.left, e.bottom, 0, 0), a, t, Sc, void 0, "legacy", "viewport"), r(!0);
|
|
4468
|
+
} else s !== null && mc(null, a, t, void 0, void 0, "legacy", "viewport"), r(!1);
|
|
4466
4469
|
return w(), !0;
|
|
4467
4470
|
}, Z(() => {
|
|
4468
4471
|
let t = e.getRootElement();
|
|
@@ -4497,7 +4500,7 @@ function bc({ editor: e, anchorElem: t, isToolbarActive: n, setIsToolbarActive:
|
|
|
4497
4500
|
ref: i,
|
|
4498
4501
|
zIndex: "tooltip",
|
|
4499
4502
|
className: `floating-text-format-toolbar ${n ? "active" : ""}`,
|
|
4500
|
-
children: /* @__PURE__ */ W(
|
|
4503
|
+
children: /* @__PURE__ */ W(gc, {
|
|
4501
4504
|
editor: e,
|
|
4502
4505
|
blockType: a,
|
|
4503
4506
|
isBold: s,
|
|
@@ -4512,9 +4515,9 @@ function bc({ editor: e, anchorElem: t, isToolbarActive: n, setIsToolbarActive:
|
|
|
4512
4515
|
})
|
|
4513
4516
|
});
|
|
4514
4517
|
}
|
|
4515
|
-
function
|
|
4518
|
+
function wc(e) {
|
|
4516
4519
|
let t = H(4), { anchorElem: n } = e, r = n === void 0 ? document.body : n, [i] = In(), [a, o] = $(!1), s;
|
|
4517
|
-
return t[0] !== r || t[1] !== i || t[2] !== a ? (s = Vn(/* @__PURE__ */ W(
|
|
4520
|
+
return t[0] !== r || t[1] !== i || t[2] !== a ? (s = Vn(/* @__PURE__ */ W(Cc, {
|
|
4518
4521
|
editor: i,
|
|
4519
4522
|
anchorElem: r,
|
|
4520
4523
|
isToolbarActive: a,
|
|
@@ -4523,16 +4526,16 @@ function xc(e) {
|
|
|
4523
4526
|
}
|
|
4524
4527
|
//#endregion
|
|
4525
4528
|
//#region src/components/rich-text/collaborative-markdown-editor/awareness-cursors.tsx
|
|
4526
|
-
function
|
|
4529
|
+
function Tc() {
|
|
4527
4530
|
let e = H(1), t;
|
|
4528
4531
|
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W("style", { children: "\n .collaboration-cursor-container {\n position: relative;\n display: inline;\n }\n\n .collaboration-cursor-caret {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 2px;\n pointer-events: none;\n }\n\n .collaboration-cursor-label {\n position: absolute;\n top: -18px;\n left: -2px;\n padding: 1px 6px;\n font-size: 11px;\n font-weight: 600;\n line-height: 16px;\n white-space: nowrap;\n border-radius: 4px 4px 4px 0;\n color: #fff;\n pointer-events: none;\n user-select: none;\n }\n\n .collaboration-cursor-selection {\n position: absolute;\n pointer-events: none;\n opacity: 0.25;\n }\n " }), e[0] = t) : t = e[0], t;
|
|
4529
4532
|
}
|
|
4530
4533
|
//#endregion
|
|
4531
4534
|
//#region src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.tsx
|
|
4532
|
-
function
|
|
4535
|
+
function Ec(e) {
|
|
4533
4536
|
let t = H(42), { roomId: n, wsUrl: r, wsParams: i, userName: a, userColor: o, placeholder: s } = e, c;
|
|
4534
4537
|
t[0] === i ? c = t[1] : (c = i === void 0 ? {} : i, t[0] = i, t[1] = c);
|
|
4535
|
-
let l = c, u = a === void 0 ? "Anonymous" : a, d = o === void 0 ? "#30bced" : o, f = Q(null), [p, m] = $(null), [h, g] = $(!1), [v] = $(
|
|
4538
|
+
let l = c, u = a === void 0 ? "Anonymous" : a, d = o === void 0 ? "#30bced" : o, f = Q(null), [p, m] = $(null), [h, g] = $(!1), [v] = $(Oc), y;
|
|
4536
4539
|
t[2] !== v || t[3] !== n || t[4] !== l || t[5] !== r ? (y = () => {
|
|
4537
4540
|
let e = new lt(r, n, v, {
|
|
4538
4541
|
params: l,
|
|
@@ -4553,14 +4556,14 @@ function Cc(e) {
|
|
|
4553
4556
|
let E;
|
|
4554
4557
|
t[12] === Symbol.for("react.memo_cache_sentinel") ? (E = {
|
|
4555
4558
|
namespace: "COLLABORATIVE_EDITOR",
|
|
4556
|
-
nodes:
|
|
4559
|
+
nodes: Zs,
|
|
4557
4560
|
editorState: null,
|
|
4558
|
-
onError:
|
|
4561
|
+
onError: Dc,
|
|
4559
4562
|
editable: !0,
|
|
4560
|
-
theme:
|
|
4563
|
+
theme: $s
|
|
4561
4564
|
}, t[12] = E) : E = t[12];
|
|
4562
4565
|
let D = E, O;
|
|
4563
|
-
t[13] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ W(
|
|
4566
|
+
t[13] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ W(Tc, {}), t[13] = O) : O = t[13];
|
|
4564
4567
|
let k = b, A;
|
|
4565
4568
|
t[14] !== v || t[15] !== n || t[16] !== k || t[17] !== d || t[18] !== u ? (A = /* @__PURE__ */ W(tt, {
|
|
4566
4569
|
id: n,
|
|
@@ -4571,11 +4574,11 @@ function Cc(e) {
|
|
|
4571
4574
|
cursorColor: d
|
|
4572
4575
|
}), t[14] = v, t[15] = n, t[16] = k, t[17] = d, t[18] = u, t[19] = A) : A = t[19];
|
|
4573
4576
|
let j, M, N, P, F, I;
|
|
4574
|
-
t[20] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ W(at, {}), M = /* @__PURE__ */ W(ot, {}), N = /* @__PURE__ */ W(ct, { maxIndent: 7 }), P = /* @__PURE__ */ W(it, {}), F = /* @__PURE__ */ W(
|
|
4577
|
+
t[20] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ W(at, {}), M = /* @__PURE__ */ W(ot, {}), N = /* @__PURE__ */ W(ct, { maxIndent: 7 }), P = /* @__PURE__ */ W(it, {}), F = /* @__PURE__ */ W(lc, {}), I = /* @__PURE__ */ W(sc, {}), t[20] = j, t[21] = M, t[22] = N, t[23] = P, t[24] = F, t[25] = I) : (j = t[20], M = t[21], N = t[22], P = t[23], F = t[24], I = t[25]);
|
|
4575
4578
|
let L;
|
|
4576
|
-
t[26] === p ? L = t[27] : (L = /* @__PURE__ */ W(
|
|
4579
|
+
t[26] === p ? L = t[27] : (L = /* @__PURE__ */ W(rc, { anchorElem: p }), t[26] = p, t[27] = L);
|
|
4577
4580
|
let R;
|
|
4578
|
-
t[28] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ W(
|
|
4581
|
+
t[28] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ W(Ps, {}), t[28] = R) : R = t[28];
|
|
4579
4582
|
let z;
|
|
4580
4583
|
t[29] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ W(nr, { fullWidth: !1 }), t[29] = z) : z = t[29];
|
|
4581
4584
|
let B;
|
|
@@ -4595,7 +4598,7 @@ function Cc(e) {
|
|
|
4595
4598
|
ErrorBoundary: rt
|
|
4596
4599
|
}), t[33] = B, t[34] = V);
|
|
4597
4600
|
let U;
|
|
4598
|
-
t[35] === p ? U = t[36] : (U = p ? /* @__PURE__ */ W(
|
|
4601
|
+
t[35] === p ? U = t[36] : (U = p ? /* @__PURE__ */ W(wc, { anchorElem: p }) : null, t[35] = p, t[36] = U);
|
|
4599
4602
|
let K;
|
|
4600
4603
|
return t[37] !== A || t[38] !== L || t[39] !== V || t[40] !== U ? (K = /* @__PURE__ */ G(S, {
|
|
4601
4604
|
ref: f,
|
|
@@ -4625,15 +4628,15 @@ function Cc(e) {
|
|
|
4625
4628
|
})]
|
|
4626
4629
|
}), t[37] = A, t[38] = L, t[39] = V, t[40] = U, t[41] = K) : K = t[41], K;
|
|
4627
4630
|
}
|
|
4628
|
-
function
|
|
4631
|
+
function Dc(e) {
|
|
4629
4632
|
return console.error(e);
|
|
4630
4633
|
}
|
|
4631
|
-
function
|
|
4634
|
+
function Oc() {
|
|
4632
4635
|
return new ut.Doc();
|
|
4633
4636
|
}
|
|
4634
4637
|
//#endregion
|
|
4635
4638
|
//#region src/components/rich-text/shared/markdown-export.ts
|
|
4636
|
-
var
|
|
4639
|
+
var kc = (e) => {
|
|
4637
4640
|
let t = e.hasFormat("code") ? {
|
|
4638
4641
|
type: "inlineCode",
|
|
4639
4642
|
value: e.getTextContent()
|
|
@@ -4661,20 +4664,20 @@ var Ec = (e) => {
|
|
|
4661
4664
|
value: "</ins>"
|
|
4662
4665
|
}
|
|
4663
4666
|
] : [t];
|
|
4664
|
-
},
|
|
4665
|
-
if (Qt(e)) return
|
|
4667
|
+
}, Ac = (e) => {
|
|
4668
|
+
if (Qt(e)) return kc(e);
|
|
4666
4669
|
if (Jt(e)) return [{ type: "break" }];
|
|
4667
|
-
if (
|
|
4670
|
+
if (is(e)) return [{
|
|
4668
4671
|
type: "image",
|
|
4669
4672
|
url: e.getSource(),
|
|
4670
4673
|
alt: e.getAlt(),
|
|
4671
4674
|
title: e.getTitle()
|
|
4672
4675
|
}];
|
|
4673
|
-
if (
|
|
4676
|
+
if (js(e) && e.isInline()) return [{
|
|
4674
4677
|
type: "inlineMath",
|
|
4675
4678
|
value: e.getEquation()
|
|
4676
4679
|
}];
|
|
4677
|
-
if (
|
|
4680
|
+
if (us(e)) return [{
|
|
4678
4681
|
type: "html",
|
|
4679
4682
|
value: e.getSource()
|
|
4680
4683
|
}];
|
|
@@ -4684,42 +4687,42 @@ var Ec = (e) => {
|
|
|
4684
4687
|
}];
|
|
4685
4688
|
if (ht(e)) return [{
|
|
4686
4689
|
type: "link",
|
|
4687
|
-
url:
|
|
4690
|
+
url: Es(e) ? e.getSource() : e.getURL(),
|
|
4688
4691
|
title: e.getTitle(),
|
|
4689
|
-
children:
|
|
4692
|
+
children: jc(e)
|
|
4690
4693
|
}];
|
|
4691
|
-
if (Kt(e)) return
|
|
4694
|
+
if (Kt(e)) return jc(e);
|
|
4692
4695
|
let t = e.getTextContent();
|
|
4693
4696
|
return t ? [{
|
|
4694
4697
|
type: "text",
|
|
4695
4698
|
value: t
|
|
4696
4699
|
}] : [];
|
|
4697
|
-
},
|
|
4700
|
+
}, jc = (e) => e.getChildren().flatMap(Ac), Mc = (e) => {
|
|
4698
4701
|
let t = [], n = [], r = () => {
|
|
4699
4702
|
n.length && t.push({
|
|
4700
4703
|
type: "paragraph",
|
|
4701
4704
|
children: n.splice(0)
|
|
4702
4705
|
});
|
|
4703
4706
|
};
|
|
4704
|
-
for (let i of e.getChildren()) if (Qt(i) || Jt(i) || qt(i)) n.push(...
|
|
4707
|
+
for (let i of e.getChildren()) if (Qt(i) || Jt(i) || qt(i)) n.push(...Ac(i));
|
|
4705
4708
|
else {
|
|
4706
4709
|
r();
|
|
4707
|
-
let e =
|
|
4710
|
+
let e = Rc(i);
|
|
4708
4711
|
e && t.push(e);
|
|
4709
4712
|
}
|
|
4710
4713
|
return r(), t;
|
|
4711
|
-
},
|
|
4714
|
+
}, Nc = (e) => ({
|
|
4712
4715
|
type: "paragraph",
|
|
4713
|
-
children:
|
|
4714
|
-
}),
|
|
4716
|
+
children: jc(e)
|
|
4717
|
+
}), Pc = (e) => {
|
|
4715
4718
|
let t = [], n = [];
|
|
4716
4719
|
for (let r of e.getChildren()) St(r) ? (n.length && t.push({
|
|
4717
4720
|
type: "paragraph",
|
|
4718
4721
|
children: n.splice(0)
|
|
4719
|
-
}), t.push(
|
|
4722
|
+
}), t.push(Fc(r))) : Yt(r) ? (n.length && t.push({
|
|
4720
4723
|
type: "paragraph",
|
|
4721
4724
|
children: n.splice(0)
|
|
4722
|
-
}), t.push(
|
|
4725
|
+
}), t.push(Nc(r))) : n.push(...Ac(r));
|
|
4723
4726
|
return (n.length || t.length === 0) && t.unshift({
|
|
4724
4727
|
type: "paragraph",
|
|
4725
4728
|
children: n
|
|
@@ -4729,64 +4732,64 @@ var Ec = (e) => {
|
|
|
4729
4732
|
spread: !1,
|
|
4730
4733
|
children: t
|
|
4731
4734
|
};
|
|
4732
|
-
},
|
|
4735
|
+
}, Fc = (e) => ({
|
|
4733
4736
|
type: "list",
|
|
4734
4737
|
ordered: e.getListType() === "number",
|
|
4735
4738
|
start: e.getListType() === "number" ? e.getStart() : null,
|
|
4736
4739
|
spread: !1,
|
|
4737
|
-
children: e.getChildren().filter(xt).map(
|
|
4738
|
-
}),
|
|
4740
|
+
children: e.getChildren().filter(xt).map(Pc)
|
|
4741
|
+
}), Ic = (e) => ({
|
|
4739
4742
|
type: "tableCell",
|
|
4740
|
-
children:
|
|
4741
|
-
}),
|
|
4743
|
+
children: Go(e)
|
|
4744
|
+
}), Lc = (e) => {
|
|
4742
4745
|
let t = e.getTable();
|
|
4743
4746
|
return {
|
|
4744
4747
|
type: "table",
|
|
4745
4748
|
align: t.columns.map((e) => e.alignment),
|
|
4746
4749
|
children: [{
|
|
4747
4750
|
type: "tableRow",
|
|
4748
|
-
children: t.columns.map((e) =>
|
|
4751
|
+
children: t.columns.map((e) => Ic(e.label))
|
|
4749
4752
|
}, ...t.rows.map((e) => ({
|
|
4750
4753
|
type: "tableRow",
|
|
4751
|
-
children: t.columns.map((t) =>
|
|
4754
|
+
children: t.columns.map((t) => Ic(e.cells[t.id] ?? ""))
|
|
4752
4755
|
}))]
|
|
4753
4756
|
};
|
|
4754
|
-
},
|
|
4755
|
-
if (Yt(e)) return
|
|
4757
|
+
}, Rc = (e) => {
|
|
4758
|
+
if (Yt(e)) return Nc(e);
|
|
4756
4759
|
if (Pt(e)) return {
|
|
4757
4760
|
type: "heading",
|
|
4758
4761
|
depth: Number(e.getTag().slice(1)),
|
|
4759
|
-
children:
|
|
4762
|
+
children: jc(e)
|
|
4760
4763
|
};
|
|
4761
4764
|
if (Ft(e)) return {
|
|
4762
4765
|
type: "blockquote",
|
|
4763
|
-
children:
|
|
4766
|
+
children: Mc(e)
|
|
4764
4767
|
};
|
|
4765
|
-
if (St(e)) return
|
|
4768
|
+
if (St(e)) return Fc(e);
|
|
4766
4769
|
if (xn(e)) return {
|
|
4767
4770
|
type: "code",
|
|
4768
4771
|
lang: e.getLanguage() || null,
|
|
4769
4772
|
meta: null,
|
|
4770
4773
|
value: e.getTextContent()
|
|
4771
4774
|
};
|
|
4772
|
-
if (
|
|
4775
|
+
if (Bs(e)) return {
|
|
4773
4776
|
type: "code",
|
|
4774
4777
|
lang: "mermaid",
|
|
4775
4778
|
meta: null,
|
|
4776
4779
|
value: e.getCode()
|
|
4777
4780
|
};
|
|
4778
|
-
if (
|
|
4781
|
+
if (js(e)) return {
|
|
4779
4782
|
type: "math",
|
|
4780
4783
|
meta: null,
|
|
4781
4784
|
value: e.getEquation()
|
|
4782
4785
|
};
|
|
4783
|
-
if (
|
|
4784
|
-
if (
|
|
4785
|
-
if (
|
|
4786
|
+
if (Ls(e)) return { type: "thematicBreak" };
|
|
4787
|
+
if (vs(e)) return Lc(e);
|
|
4788
|
+
if (us(e)) return {
|
|
4786
4789
|
type: "html",
|
|
4787
4790
|
value: e.getSource()
|
|
4788
4791
|
};
|
|
4789
|
-
if (Kt(e)) return
|
|
4792
|
+
if (Kt(e)) return Nc(e);
|
|
4790
4793
|
let t = e.getTextContent();
|
|
4791
4794
|
return t ? {
|
|
4792
4795
|
type: "paragraph",
|
|
@@ -4795,52 +4798,52 @@ var Ec = (e) => {
|
|
|
4795
4798
|
value: t
|
|
4796
4799
|
}]
|
|
4797
4800
|
} : null;
|
|
4798
|
-
},
|
|
4801
|
+
}, zc = (e) => Ho({
|
|
4799
4802
|
type: "root",
|
|
4800
|
-
children: e.getChildren().map(
|
|
4801
|
-
}),
|
|
4803
|
+
children: e.getChildren().map(Rc).filter((e) => e !== null)
|
|
4804
|
+
}), Bc = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/g, Vc = (e, t) => {
|
|
4802
4805
|
let n = Ht(e);
|
|
4803
4806
|
for (let e of t) n.toggleFormat(e);
|
|
4804
4807
|
return n;
|
|
4805
|
-
},
|
|
4808
|
+
}, Hc = (e, t) => {
|
|
4806
4809
|
let n = [], r = 0;
|
|
4807
|
-
for (let i of e.matchAll(
|
|
4810
|
+
for (let i of e.matchAll(Bc)) {
|
|
4808
4811
|
let a = i.index ?? 0;
|
|
4809
|
-
a > r && n.push(
|
|
4812
|
+
a > r && n.push(Vc(e.slice(r, a), t));
|
|
4810
4813
|
let o = i[2] ?? "", s = /^(?:https?:\/\/|\/)/i.test(o) ? o : `#${o}`;
|
|
4811
4814
|
n.push(ir(s, o)), r = a + i[0].length;
|
|
4812
4815
|
}
|
|
4813
|
-
return r < e.length && n.push(
|
|
4814
|
-
},
|
|
4815
|
-
function
|
|
4816
|
+
return r < e.length && n.push(Vc(e.slice(r), t)), n;
|
|
4817
|
+
}, Uc = (e, t) => t.definitions.get(e.identifier.toLowerCase());
|
|
4818
|
+
function Wc(e, t, n) {
|
|
4816
4819
|
switch (e.type) {
|
|
4817
|
-
case "text": return
|
|
4818
|
-
case "strong": return
|
|
4819
|
-
case "emphasis": return
|
|
4820
|
-
case "delete": return
|
|
4821
|
-
case "inlineCode": return [
|
|
4820
|
+
case "text": return Hc(e.value, n);
|
|
4821
|
+
case "strong": return Gc(e.children, t, /* @__PURE__ */ new Set([...n, "bold"]));
|
|
4822
|
+
case "emphasis": return Gc(e.children, t, /* @__PURE__ */ new Set([...n, "italic"]));
|
|
4823
|
+
case "delete": return Gc(e.children, t, /* @__PURE__ */ new Set([...n, "strikethrough"]));
|
|
4824
|
+
case "inlineCode": return [Vc(e.value, /* @__PURE__ */ new Set([...n, "code"]))];
|
|
4822
4825
|
case "break": return [Bt()];
|
|
4823
4826
|
case "link": {
|
|
4824
|
-
let r =
|
|
4825
|
-
return r.append(...
|
|
4827
|
+
let r = Ts(e.url, t.resolver, { title: e.title });
|
|
4828
|
+
return r.append(...Gc(e.children, t, n)), [r];
|
|
4826
4829
|
}
|
|
4827
4830
|
case "linkReference": {
|
|
4828
|
-
let r =
|
|
4829
|
-
if (!r) return [
|
|
4830
|
-
let i =
|
|
4831
|
-
return i.append(...
|
|
4831
|
+
let r = Uc(e, t);
|
|
4832
|
+
if (!r) return [Vc(Wo([e]), n)];
|
|
4833
|
+
let i = Ts(r.url, t.resolver, { title: r.title });
|
|
4834
|
+
return i.append(...Gc(e.children, t, n)), [i];
|
|
4832
4835
|
}
|
|
4833
|
-
case "image": return [
|
|
4836
|
+
case "image": return [rs(e.url, e.alt ?? "", e.title ?? null)];
|
|
4834
4837
|
case "imageReference": {
|
|
4835
|
-
let r =
|
|
4836
|
-
return r ? [
|
|
4838
|
+
let r = Uc(e, t);
|
|
4839
|
+
return r ? [rs(r.url, e.alt ?? "", r.title ?? null)] : [Vc(Wo([e]), n)];
|
|
4837
4840
|
}
|
|
4838
|
-
case "inlineMath": return [
|
|
4839
|
-
case "html": return [
|
|
4840
|
-
default: return [
|
|
4841
|
+
case "inlineMath": return [As(e.value, !0)];
|
|
4842
|
+
case "html": return [ls(e.value, "inline")];
|
|
4843
|
+
default: return [Vc(Wo([e]), n)];
|
|
4841
4844
|
}
|
|
4842
4845
|
}
|
|
4843
|
-
function
|
|
4846
|
+
function Gc(e, t, n = /* @__PURE__ */ new Set()) {
|
|
4844
4847
|
let r = [], i = 0;
|
|
4845
4848
|
for (let a of e) {
|
|
4846
4849
|
if (a.type === "html" && /^<(?:ins|u)>$/i.test(a.value.trim())) {
|
|
@@ -4852,45 +4855,45 @@ function Hc(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
4852
4855
|
continue;
|
|
4853
4856
|
}
|
|
4854
4857
|
let e = new Set(n);
|
|
4855
|
-
i > 0 && e.add("underline"), r.push(...
|
|
4858
|
+
i > 0 && e.add("underline"), r.push(...Wc(a, t, e));
|
|
4856
4859
|
}
|
|
4857
4860
|
return r;
|
|
4858
4861
|
}
|
|
4859
|
-
var
|
|
4862
|
+
var Kc = (e, t) => {
|
|
4860
4863
|
t.tableIndex += 1;
|
|
4861
4864
|
let n = `table-${t.tableIndex}`, r = e.children[0], i = Math.max(r?.children.length ?? 0, 1), a = Array.from({ length: i }, (t, i) => ({
|
|
4862
4865
|
id: `${n}-column-${i + 1}`,
|
|
4863
|
-
label: r?.children[i] ?
|
|
4866
|
+
label: r?.children[i] ? Wo(r.children[i].children) : "",
|
|
4864
4867
|
alignment: e.align?.[i] ?? null
|
|
4865
4868
|
}));
|
|
4866
4869
|
return {
|
|
4867
4870
|
columns: a,
|
|
4868
4871
|
rows: e.children.slice(1).map((e, t) => ({
|
|
4869
4872
|
id: `${n}-row-${t + 1}`,
|
|
4870
|
-
cells: Object.fromEntries(a.map((t, n) => [t.id, e.children[n] ?
|
|
4873
|
+
cells: Object.fromEntries(a.map((t, n) => [t.id, e.children[n] ? Wo(e.children[n].children) : ""]))
|
|
4871
4874
|
}))
|
|
4872
4875
|
};
|
|
4873
|
-
},
|
|
4876
|
+
}, qc = (e, t, n) => {
|
|
4874
4877
|
if (t.type !== "listItem") return;
|
|
4875
4878
|
let r = yt(t.checked ?? void 0);
|
|
4876
4879
|
e.append(r);
|
|
4877
|
-
for (let e of t.children) e.type === "paragraph" ? r.append(...
|
|
4878
|
-
},
|
|
4880
|
+
for (let e of t.children) e.type === "paragraph" ? r.append(...Gc(e.children, n)) : e.type === "list" ? Jc(r, e, n) : r.append(Vc(Uo(e), /* @__PURE__ */ new Set()));
|
|
4881
|
+
}, Jc = (e, t, n) => {
|
|
4879
4882
|
switch (t.type) {
|
|
4880
4883
|
case "paragraph": {
|
|
4881
4884
|
let r = Vt();
|
|
4882
|
-
r.append(...
|
|
4885
|
+
r.append(...Gc(t.children, n)), e.append(r);
|
|
4883
4886
|
break;
|
|
4884
4887
|
}
|
|
4885
4888
|
case "heading": {
|
|
4886
4889
|
let r = Mt(`h${t.depth}`);
|
|
4887
|
-
r.append(...
|
|
4890
|
+
r.append(...Gc(t.children, n)), e.append(r);
|
|
4888
4891
|
break;
|
|
4889
4892
|
}
|
|
4890
4893
|
case "blockquote": {
|
|
4891
4894
|
let r = Nt();
|
|
4892
4895
|
e.append(r);
|
|
4893
|
-
for (let [e, i] of t.children.entries()) i.type === "paragraph" ? (t.children[e - 1]?.type === "paragraph" && r.append(Ht("\n\n")), r.append(...
|
|
4896
|
+
for (let [e, i] of t.children.entries()) i.type === "paragraph" ? (t.children[e - 1]?.type === "paragraph" && r.append(Ht("\n\n")), r.append(...Gc(i.children, n))) : Jc(r, i, n);
|
|
4894
4897
|
break;
|
|
4895
4898
|
}
|
|
4896
4899
|
case "list": {
|
|
@@ -4898,57 +4901,57 @@ var Uc = (e, t) => {
|
|
|
4898
4901
|
t.ordered ? i = "number" : r && (i = "check");
|
|
4899
4902
|
let a = bt(i, t.start ?? 1);
|
|
4900
4903
|
e.append(a);
|
|
4901
|
-
for (let e of t.children)
|
|
4904
|
+
for (let e of t.children) qc(a, e, n);
|
|
4902
4905
|
break;
|
|
4903
4906
|
}
|
|
4904
4907
|
case "code":
|
|
4905
|
-
e.append(t.lang === "mermaid" ?
|
|
4908
|
+
e.append(t.lang === "mermaid" ? Vs(t.value) : bn(t.lang ?? void 0).append(Ht(t.value)));
|
|
4906
4909
|
break;
|
|
4907
4910
|
case "math":
|
|
4908
|
-
e.append(
|
|
4911
|
+
e.append(As(t.value, !1));
|
|
4909
4912
|
break;
|
|
4910
4913
|
case "thematicBreak":
|
|
4911
|
-
e.append(
|
|
4914
|
+
e.append(Is());
|
|
4912
4915
|
break;
|
|
4913
4916
|
case "table":
|
|
4914
|
-
e.append(
|
|
4917
|
+
e.append(_s(Kc(t, n)));
|
|
4915
4918
|
break;
|
|
4916
4919
|
case "html":
|
|
4917
|
-
e.append(
|
|
4920
|
+
e.append(ls(t.value, "block"));
|
|
4918
4921
|
break;
|
|
4919
4922
|
case "definition": break;
|
|
4920
4923
|
default: {
|
|
4921
4924
|
let n = Vt();
|
|
4922
|
-
n.append(Ht(
|
|
4925
|
+
n.append(Ht(Uo(t))), e.append(n);
|
|
4923
4926
|
}
|
|
4924
4927
|
}
|
|
4925
|
-
},
|
|
4926
|
-
let n =
|
|
4928
|
+
}, Yc = (e, t) => {
|
|
4929
|
+
let n = Bo(e), r = {
|
|
4927
4930
|
definitions: new Map(n.children.filter((e) => e.type === "definition").map((e) => [e.identifier.toLowerCase(), e])),
|
|
4928
4931
|
resolver: t,
|
|
4929
4932
|
tableIndex: 0
|
|
4930
4933
|
}, i = Wt();
|
|
4931
4934
|
i.clear();
|
|
4932
|
-
for (let e of n.children)
|
|
4935
|
+
for (let e of n.children) Jc(i, e, r);
|
|
4933
4936
|
i.isEmpty() && i.append(Vt());
|
|
4934
|
-
},
|
|
4937
|
+
}, Xc = (e) => {
|
|
4935
4938
|
let t = e.position?.start.offset, n = e.position?.end.offset;
|
|
4936
4939
|
return t === void 0 || n === void 0 ? null : {
|
|
4937
4940
|
end: n,
|
|
4938
4941
|
start: t
|
|
4939
4942
|
};
|
|
4940
|
-
},
|
|
4943
|
+
}, Zc = (e) => typeof e == "object" && !!e && "children" in e && Array.isArray(e.children), Qc = (e) => typeof e == "object" && !!e && "type" in e && (e.type === "link" || e.type === "linkReference"), $c = (e) => {
|
|
4941
4944
|
let t = [];
|
|
4942
|
-
if (!
|
|
4943
|
-
for (let n of e.children)
|
|
4945
|
+
if (!Zc(e)) return t;
|
|
4946
|
+
for (let n of e.children) Qc(n) && t.push(n), Zc(n) && t.push(...$c(n));
|
|
4944
4947
|
return t;
|
|
4945
|
-
},
|
|
4948
|
+
}, el = (e) => Vo(e).children.flatMap((e) => e.type === "table" ? [] : $c(e).map((t) => ({
|
|
4946
4949
|
block: e,
|
|
4947
4950
|
node: t
|
|
4948
|
-
}))),
|
|
4949
|
-
let o =
|
|
4951
|
+
}))), tl = (e, t, n, r, i, a) => {
|
|
4952
|
+
let o = Xc(r), s = Xc(a);
|
|
4950
4953
|
if (!o || !s) return [];
|
|
4951
|
-
let c = i.map(
|
|
4954
|
+
let c = i.map(Xc);
|
|
4952
4955
|
if (c.some((e) => !e)) return [];
|
|
4953
4956
|
let l = [], u = o.start;
|
|
4954
4957
|
for (let t of c) {
|
|
@@ -4969,8 +4972,8 @@ var Uc = (e, t) => {
|
|
|
4969
4972
|
}), m = n + t.length;
|
|
4970
4973
|
}
|
|
4971
4974
|
return m === d.length ? p.flatMap((t, r) => {
|
|
4972
|
-
if (
|
|
4973
|
-
let i =
|
|
4975
|
+
if (el(t.value).length > 0) return [];
|
|
4976
|
+
let i = Xc(n[r]?.node ?? {}), a = c[r];
|
|
4974
4977
|
return !i || !a ? [] : [{
|
|
4975
4978
|
edit: {
|
|
4976
4979
|
...i,
|
|
@@ -4983,33 +4986,33 @@ var Uc = (e, t) => {
|
|
|
4983
4986
|
}
|
|
4984
4987
|
}];
|
|
4985
4988
|
}) : [];
|
|
4986
|
-
},
|
|
4989
|
+
}, nl = (e, t, n, r, i, a, o, s) => {
|
|
4987
4990
|
let c = a.map((e, t) => t);
|
|
4988
4991
|
c.sort((e, t) => Number(t === o) - Number(e === o));
|
|
4989
4992
|
for (let o of c) {
|
|
4990
4993
|
if (s.has(o)) continue;
|
|
4991
4994
|
let c = a[o];
|
|
4992
4995
|
if (!c) continue;
|
|
4993
|
-
let l =
|
|
4996
|
+
let l = $c(c);
|
|
4994
4997
|
if (i.length <= l.length) continue;
|
|
4995
|
-
let u =
|
|
4998
|
+
let u = tl(t, n, e, r, i, c);
|
|
4996
4999
|
if (u.length === i.length - l.length) return {
|
|
4997
5000
|
currentBlockIndex: o,
|
|
4998
5001
|
replacements: u
|
|
4999
5002
|
};
|
|
5000
5003
|
}
|
|
5001
5004
|
return null;
|
|
5002
|
-
},
|
|
5003
|
-
let r =
|
|
5004
|
-
if (
|
|
5005
|
+
}, rl = (e, t, n) => {
|
|
5006
|
+
let r = el(e);
|
|
5007
|
+
if (el(n).length >= el(t).length) return {
|
|
5005
5008
|
edits: [],
|
|
5006
5009
|
normalizedCurrent: n
|
|
5007
5010
|
};
|
|
5008
|
-
let i =
|
|
5011
|
+
let i = Vo(t), a = Vo(n), o = [], s = [], c = /* @__PURE__ */ new Set(), l = 0;
|
|
5009
5012
|
for (let e = 0; e < i.children.length; e += 1) {
|
|
5010
5013
|
let u = i.children[e];
|
|
5011
5014
|
if (!u || u.type === "table") continue;
|
|
5012
|
-
let d =
|
|
5015
|
+
let d = $c(u), f = nl(r.slice(l, l + d.length), t, n, u, d, a.children, e, c);
|
|
5013
5016
|
if (f) {
|
|
5014
5017
|
for (let e of f.replacements) o.push(e.edit), s.push(e.normalization);
|
|
5015
5018
|
c.add(f.currentBlockIndex);
|
|
@@ -5025,8 +5028,8 @@ var Uc = (e, t) => {
|
|
|
5025
5028
|
};
|
|
5026
5029
|
//#endregion
|
|
5027
5030
|
//#region src/components/rich-text/shared/markdown-source-map.ts
|
|
5028
|
-
function*
|
|
5029
|
-
let n =
|
|
5031
|
+
function* il(e, t) {
|
|
5032
|
+
let n = Vo(e).children, r = Vo(t).children;
|
|
5030
5033
|
if (!(n.length === r.length && n.every((e, t) => e.type === r[t]?.type && e.position?.end.offset !== void 0 && r[t]?.position?.end.offset !== void 0))) {
|
|
5031
5034
|
yield* Jn(e, t);
|
|
5032
5035
|
return;
|
|
@@ -5038,10 +5041,10 @@ function* tl(e, t) {
|
|
|
5038
5041
|
}
|
|
5039
5042
|
yield* Jn(e.slice(i), t.slice(a));
|
|
5040
5043
|
}
|
|
5041
|
-
var
|
|
5044
|
+
var al = (e, t) => {
|
|
5042
5045
|
let n = Array.from({ length: e.length + 1 }).fill(-1), r = Array.from({ length: e.length + 1 }).fill(-1), i = 0, a = 0, o = !1;
|
|
5043
5046
|
n[0] = 0, r[0] = 0;
|
|
5044
|
-
for (let s of
|
|
5047
|
+
for (let s of il(e, t)) {
|
|
5045
5048
|
let e = s.value.length;
|
|
5046
5049
|
if (s.added) {
|
|
5047
5050
|
r[i] = a, a += e, n[i] = a, o && (r[i] = a), o = !1;
|
|
@@ -5062,19 +5065,19 @@ var nl = (e, t) => {
|
|
|
5062
5065
|
end: r,
|
|
5063
5066
|
start: n
|
|
5064
5067
|
};
|
|
5065
|
-
},
|
|
5068
|
+
}, ol = (e, t, n) => {
|
|
5066
5069
|
for (let r = t; r >= 0 && r < e.length; r += n) {
|
|
5067
5070
|
let t = e[r];
|
|
5068
5071
|
if (t !== void 0 && t >= 0) return t;
|
|
5069
5072
|
}
|
|
5070
5073
|
return n === -1 ? 0 : e.at(-1) ?? 0;
|
|
5071
|
-
},
|
|
5074
|
+
}, sl = (e, t) => {
|
|
5072
5075
|
let n = e.start[t];
|
|
5073
|
-
return n !== void 0 && n >= 0 ? n :
|
|
5074
|
-
},
|
|
5076
|
+
return n !== void 0 && n >= 0 ? n : ol(e.start, t, -1);
|
|
5077
|
+
}, cl = (e, t) => {
|
|
5075
5078
|
let n = e.end[t];
|
|
5076
|
-
return n !== void 0 && n >= 0 ? n :
|
|
5077
|
-
},
|
|
5079
|
+
return n !== void 0 && n >= 0 ? n : ol(e.end, t, 1);
|
|
5080
|
+
}, ll = (e, t) => {
|
|
5078
5081
|
let n = [], r = 0, i = null, a = () => {
|
|
5079
5082
|
i &&= (n.push(i), null);
|
|
5080
5083
|
};
|
|
@@ -5094,53 +5097,53 @@ var nl = (e, t) => {
|
|
|
5094
5097
|
r += n.value.length, i.end = r;
|
|
5095
5098
|
}
|
|
5096
5099
|
return a(), n;
|
|
5097
|
-
},
|
|
5098
|
-
let n =
|
|
5100
|
+
}, ul = (e) => e.includes("\r\n") ? "\r\n" : "\n", dl = (e, t) => {
|
|
5101
|
+
let n = ul(t);
|
|
5099
5102
|
return n === "\n" ? e : e.replaceAll("\n", n);
|
|
5100
|
-
},
|
|
5103
|
+
}, fl = (e) => Array.isArray(e) ? e.map(fl) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([e]) => e !== "position").map(([e, t]) => [e, fl(t)])), pl = (e, t) => JSON.stringify(fl(e)) === JSON.stringify(fl(t)), ml = (e) => Vo(e).children.filter((e) => e.type === "table" && !!e.position), hl = (e) => e.children.flatMap((e) => e.children), gl = (e, t) => e.children.length === t.children.length && e.children.every((e, n) => e.children.length === t.children[n]?.children.length), _l = (e) => {
|
|
5101
5104
|
let t = e.position?.start.offset, n = e.position?.end.offset;
|
|
5102
5105
|
return t === void 0 || n === void 0 ? null : {
|
|
5103
5106
|
end: n,
|
|
5104
5107
|
start: t
|
|
5105
5108
|
};
|
|
5106
|
-
},
|
|
5109
|
+
}, vl = (e, t) => {
|
|
5107
5110
|
let n = t.children[0], r = t.children.at(-1), i = n?.position?.start.offset, a = r?.position?.end.offset;
|
|
5108
5111
|
if (i !== void 0 && a !== void 0) return {
|
|
5109
5112
|
start: i,
|
|
5110
5113
|
end: a
|
|
5111
5114
|
};
|
|
5112
|
-
let o =
|
|
5115
|
+
let o = _l(t);
|
|
5113
5116
|
if (!o) return null;
|
|
5114
5117
|
let s = e.slice(o.start, o.end), c = s.indexOf("|"), l = s.endsWith("|") ? s.length - 1 : s.length, u = c < 0 ? 0 : c + 1, d = s.slice(u, l).match(/^\s*/)?.[0].length ?? 0, f = o.start + u + d;
|
|
5115
5118
|
return {
|
|
5116
5119
|
start: f,
|
|
5117
5120
|
end: f
|
|
5118
5121
|
};
|
|
5119
|
-
},
|
|
5120
|
-
let n =
|
|
5122
|
+
}, yl = (e, t) => {
|
|
5123
|
+
let n = vl(e, t);
|
|
5121
5124
|
return n ? e.slice(n.start, n.end) : "";
|
|
5122
|
-
},
|
|
5123
|
-
let a =
|
|
5124
|
-
return
|
|
5125
|
+
}, bl = (e, t, n, r, i) => {
|
|
5126
|
+
let a = hl(n), o = hl(r);
|
|
5127
|
+
return hl(i).flatMap((n, r) => {
|
|
5125
5128
|
let i = a[r], s = o[r];
|
|
5126
|
-
if (!i || !s ||
|
|
5127
|
-
let c =
|
|
5129
|
+
if (!i || !s || pl(s, n)) return [];
|
|
5130
|
+
let c = vl(e, i);
|
|
5128
5131
|
return c ? [{
|
|
5129
5132
|
...c,
|
|
5130
|
-
replacement:
|
|
5133
|
+
replacement: yl(t, n)
|
|
5131
5134
|
}] : [];
|
|
5132
5135
|
});
|
|
5133
|
-
},
|
|
5134
|
-
if (
|
|
5135
|
-
if (
|
|
5136
|
-
let a =
|
|
5136
|
+
}, xl = (e, t, n, r, i) => {
|
|
5137
|
+
if (pl(r, i)) return [];
|
|
5138
|
+
if (gl(r, i) && gl(n, r) && JSON.stringify(r.align) === JSON.stringify(i.align)) return bl(e, t, n, r, i);
|
|
5139
|
+
let a = _l(n), o = _l(i);
|
|
5137
5140
|
return !a || !o ? [] : [{
|
|
5138
5141
|
start: a.start,
|
|
5139
5142
|
end: a.end,
|
|
5140
5143
|
replacement: t.slice(o.start, o.end)
|
|
5141
5144
|
}];
|
|
5142
|
-
},
|
|
5143
|
-
let r =
|
|
5145
|
+
}, Sl = (e, t, n) => {
|
|
5146
|
+
let r = ml(e), i = ml(t), a = ml(n);
|
|
5144
5147
|
if (r.length !== i.length || i.length !== a.length) return {
|
|
5145
5148
|
edits: [],
|
|
5146
5149
|
normalizedCurrent: n
|
|
@@ -5149,43 +5152,43 @@ var nl = (e, t) => {
|
|
|
5149
5152
|
for (let c = a.length - 1; c >= 0; --c) {
|
|
5150
5153
|
let l = r[c], u = i[c], d = a[c];
|
|
5151
5154
|
if (!l || !u || !d) continue;
|
|
5152
|
-
let f =
|
|
5153
|
-
f && p && (s = s.slice(0, p.start) + t.slice(f.start, f.end) + s.slice(p.end), o.push(...
|
|
5155
|
+
let f = _l(u), p = _l(d);
|
|
5156
|
+
f && p && (s = s.slice(0, p.start) + t.slice(f.start, f.end) + s.slice(p.end), o.push(...xl(e, n, l, u, d)));
|
|
5154
5157
|
}
|
|
5155
5158
|
return {
|
|
5156
5159
|
edits: o,
|
|
5157
5160
|
normalizedCurrent: s
|
|
5158
5161
|
};
|
|
5159
|
-
},
|
|
5162
|
+
}, Cl = (e, t, n, r) => {
|
|
5160
5163
|
if (n === r) return e;
|
|
5161
|
-
let i =
|
|
5162
|
-
start: n.start === n.end ?
|
|
5163
|
-
end:
|
|
5164
|
-
replacement:
|
|
5164
|
+
let i = rl(e, n, r), a = Sl(e, n, i.normalizedCurrent), o = ll(n, a.normalizedCurrent).map((n) => ({
|
|
5165
|
+
start: n.start === n.end ? cl(t, n.start) : sl(t, n.start),
|
|
5166
|
+
end: cl(t, n.end),
|
|
5167
|
+
replacement: dl(n.replacement, e)
|
|
5165
5168
|
})).concat(i.edits.map((t) => ({
|
|
5166
5169
|
...t,
|
|
5167
|
-
replacement:
|
|
5170
|
+
replacement: dl(t.replacement, e)
|
|
5168
5171
|
}))).concat(a.edits.map((t) => ({
|
|
5169
5172
|
...t,
|
|
5170
|
-
replacement:
|
|
5173
|
+
replacement: dl(t.replacement, e)
|
|
5171
5174
|
}))).sort((e, t) => t.start - e.start), s = e;
|
|
5172
5175
|
for (let e of o) s = s.slice(0, e.start) + e.replacement + s.slice(e.end);
|
|
5173
5176
|
return s;
|
|
5174
|
-
},
|
|
5177
|
+
}, wl = (e, t) => {
|
|
5175
5178
|
let n = null, r = null;
|
|
5176
5179
|
return {
|
|
5177
5180
|
importToLexical() {
|
|
5178
|
-
|
|
5181
|
+
Yc(e, t), n = zc(Wt()), r = al(n, e);
|
|
5179
5182
|
},
|
|
5180
5183
|
exportFromLexical(t) {
|
|
5181
|
-
let i =
|
|
5182
|
-
return
|
|
5184
|
+
let i = zc(t), a = n ?? i;
|
|
5185
|
+
return Cl(e, r ?? al(a, e), a, i);
|
|
5183
5186
|
}
|
|
5184
5187
|
};
|
|
5185
5188
|
};
|
|
5186
5189
|
//#endregion
|
|
5187
5190
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/link-editor-content.tsx
|
|
5188
|
-
function
|
|
5191
|
+
function Tl(e) {
|
|
5189
5192
|
let t = H(32), { isActive: n, isLinkEditMode: r, editedLinkUrl: i, editedLinkUrlIsValid: a, linkUrl: o, href: s, inputRef: c, onEditedLinkUrlChange: l, onInputKeyDown: d, onClose: f, onSubmit: p, onEdit: m, onRemove: h } = e;
|
|
5190
5193
|
if (!n) return null;
|
|
5191
5194
|
if (r) {
|
|
@@ -5215,7 +5218,7 @@ function Sl(e) {
|
|
|
5215
5218
|
variant: "ghost",
|
|
5216
5219
|
size: "xs",
|
|
5217
5220
|
"aria-label": "Cancel link edit",
|
|
5218
|
-
onMouseDown:
|
|
5221
|
+
onMouseDown: El,
|
|
5219
5222
|
onClick: f,
|
|
5220
5223
|
children: o
|
|
5221
5224
|
})
|
|
@@ -5230,7 +5233,7 @@ function Sl(e) {
|
|
|
5230
5233
|
size: "xs",
|
|
5231
5234
|
"aria-label": "Confirm link edit",
|
|
5232
5235
|
disabled: m,
|
|
5233
|
-
onMouseDown:
|
|
5236
|
+
onMouseDown: El,
|
|
5234
5237
|
onClick: p,
|
|
5235
5238
|
children: h
|
|
5236
5239
|
})
|
|
@@ -5270,7 +5273,7 @@ function Sl(e) {
|
|
|
5270
5273
|
variant: "ghost",
|
|
5271
5274
|
size: "xs",
|
|
5272
5275
|
"aria-label": "Edit link",
|
|
5273
|
-
onMouseDown:
|
|
5276
|
+
onMouseDown: El,
|
|
5274
5277
|
onClick: m,
|
|
5275
5278
|
children: _
|
|
5276
5279
|
})
|
|
@@ -5284,7 +5287,7 @@ function Sl(e) {
|
|
|
5284
5287
|
variant: "ghost",
|
|
5285
5288
|
size: "xs",
|
|
5286
5289
|
"aria-label": "Remove link",
|
|
5287
|
-
onMouseDown:
|
|
5290
|
+
onMouseDown: El,
|
|
5288
5291
|
onClick: h,
|
|
5289
5292
|
children: y
|
|
5290
5293
|
})
|
|
@@ -5303,64 +5306,64 @@ function Sl(e) {
|
|
|
5303
5306
|
]
|
|
5304
5307
|
}), t[28] = g, t[29] = v, t[30] = b, t[31] = x) : x = t[31], x;
|
|
5305
5308
|
}
|
|
5306
|
-
function
|
|
5309
|
+
function El(e) {
|
|
5307
5310
|
e.preventDefault();
|
|
5308
5311
|
}
|
|
5309
5312
|
//#endregion
|
|
5310
5313
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/link-edit-state.ts
|
|
5311
|
-
function
|
|
5314
|
+
function Dl(e, t, n) {
|
|
5312
5315
|
return e && t && n === "";
|
|
5313
5316
|
}
|
|
5314
5317
|
//#endregion
|
|
5315
5318
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/selection-link-url.ts
|
|
5316
|
-
function
|
|
5317
|
-
let t =
|
|
5319
|
+
function Ol(e) {
|
|
5320
|
+
let t = dc(e), n = Ln(t, ht);
|
|
5318
5321
|
return n ? n.getURL() : ht(t) ? t.getURL() : "";
|
|
5319
5322
|
}
|
|
5320
5323
|
//#endregion
|
|
5321
5324
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/url.ts
|
|
5322
|
-
var
|
|
5325
|
+
var kl = /* @__PURE__ */ new Set([
|
|
5323
5326
|
"http:",
|
|
5324
5327
|
"https:",
|
|
5325
5328
|
"mailto:",
|
|
5326
5329
|
"sms:",
|
|
5327
5330
|
"tel:"
|
|
5328
5331
|
]);
|
|
5329
|
-
function
|
|
5332
|
+
function Al(e) {
|
|
5330
5333
|
try {
|
|
5331
5334
|
let t = new URL(e);
|
|
5332
|
-
if (!
|
|
5335
|
+
if (!kl.has(t.protocol)) return "about:blank";
|
|
5333
5336
|
} catch {
|
|
5334
5337
|
return e;
|
|
5335
5338
|
}
|
|
5336
5339
|
return e;
|
|
5337
5340
|
}
|
|
5338
|
-
function
|
|
5341
|
+
function jl(e) {
|
|
5339
5342
|
try {
|
|
5340
5343
|
let t = new URL(e);
|
|
5341
|
-
return
|
|
5344
|
+
return kl.has(t.protocol) ? t.protocol === "http:" || t.protocol === "https:" ? t.hostname !== "" : t.pathname.trim() !== "" : !1;
|
|
5342
5345
|
} catch {
|
|
5343
5346
|
return !1;
|
|
5344
5347
|
}
|
|
5345
5348
|
}
|
|
5346
5349
|
//#endregion
|
|
5347
5350
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.tsx
|
|
5348
|
-
var
|
|
5349
|
-
function
|
|
5350
|
-
let o = Q(null), s = Q(null), c = Q(() => void 0), [l, u] = $(""), [d, f] = $("https://"), [p, m] = $(null), h = t || i, g =
|
|
5351
|
+
var Ml = 8;
|
|
5352
|
+
function Nl({ editor: e, isLink: t, setIsLink: n, anchorElem: r, isLinkEditMode: i, setIsLinkEditMode: a }) {
|
|
5353
|
+
let o = Q(null), s = Q(null), c = Q(() => void 0), [l, u] = $(""), [d, f] = $("https://"), [p, m] = $(null), h = t || i, g = jl(d);
|
|
5351
5354
|
c.current = () => {
|
|
5352
5355
|
let n = Gt();
|
|
5353
5356
|
if (Xt(n)) {
|
|
5354
|
-
let e =
|
|
5355
|
-
u(e),
|
|
5357
|
+
let e = Ol(n);
|
|
5358
|
+
u(e), Dl(i, t, e) && y(), i && e !== "" && f(e);
|
|
5356
5359
|
}
|
|
5357
5360
|
let s = o.current, c = window.getSelection(), l = document.activeElement;
|
|
5358
5361
|
if (s === null) return;
|
|
5359
5362
|
let d = e.getRootElement(), p = c !== null && c.rangeCount > 0;
|
|
5360
5363
|
if (n !== null && c !== null && p && d?.contains(c.anchorNode) && e.isEditable()) {
|
|
5361
5364
|
let e = c.getRangeAt(0).getBoundingClientRect();
|
|
5362
|
-
|
|
5363
|
-
} else s.contains(l) || (d !== null &&
|
|
5365
|
+
mc(new DOMRect(e.left, e.top, 0, e.height), s, r, Ml, void 0, "above", "viewport"), m(n);
|
|
5366
|
+
} else s.contains(l) || (d !== null && mc(null, s, r, void 0, void 0, "legacy", "viewport"), m(null), a(!1), u(""));
|
|
5364
5367
|
}, Z(() => {
|
|
5365
5368
|
let t = r.parentElement, n = () => {
|
|
5366
5369
|
e.getEditorState().read(() => {
|
|
@@ -5396,10 +5399,10 @@ function Al({ editor: e, isLink: t, setIsLink: n, anchorElem: r, isLinkEditMode:
|
|
|
5396
5399
|
}, b = () => {
|
|
5397
5400
|
p !== null && g && (e.update(() => {
|
|
5398
5401
|
en(p);
|
|
5399
|
-
}), e.dispatchCommand(vt,
|
|
5402
|
+
}), e.dispatchCommand(vt, Al(d)), e.update(() => {
|
|
5400
5403
|
let e = Gt();
|
|
5401
5404
|
if (Xt(e)) {
|
|
5402
|
-
let t =
|
|
5405
|
+
let t = dc(e).getParent();
|
|
5403
5406
|
if (mt(t)) {
|
|
5404
5407
|
let e = pt(t.getURL(), {
|
|
5405
5408
|
rel: t.__rel,
|
|
@@ -5415,13 +5418,13 @@ function Al({ editor: e, isLink: t, setIsLink: n, anchorElem: r, isLinkEditMode:
|
|
|
5415
5418
|
ref: o,
|
|
5416
5419
|
zIndex: "tooltip",
|
|
5417
5420
|
className: `link-editor ${h ? "active" : ""}`,
|
|
5418
|
-
children: /* @__PURE__ */ W(
|
|
5421
|
+
children: /* @__PURE__ */ W(Tl, {
|
|
5419
5422
|
isActive: h,
|
|
5420
5423
|
isLinkEditMode: i,
|
|
5421
5424
|
editedLinkUrl: d,
|
|
5422
5425
|
editedLinkUrlIsValid: g,
|
|
5423
5426
|
linkUrl: l,
|
|
5424
|
-
href:
|
|
5427
|
+
href: Al(l),
|
|
5425
5428
|
inputRef: s,
|
|
5426
5429
|
onEditedLinkUrlChange: f,
|
|
5427
5430
|
onInputKeyDown: v,
|
|
@@ -5436,18 +5439,18 @@ function Al({ editor: e, isLink: t, setIsLink: n, anchorElem: r, isLinkEditMode:
|
|
|
5436
5439
|
})
|
|
5437
5440
|
});
|
|
5438
5441
|
}
|
|
5439
|
-
function
|
|
5442
|
+
function Pl(e, t, n, r) {
|
|
5440
5443
|
let i = H(10), [a, o] = $(e), [s, c] = $(!1), l, u;
|
|
5441
5444
|
i[0] !== e || i[1] !== r ? (l = () => {
|
|
5442
5445
|
let t = function() {
|
|
5443
5446
|
let e = Gt();
|
|
5444
5447
|
if (Xt(e)) {
|
|
5445
|
-
let t =
|
|
5448
|
+
let t = dc(e), n = Ln(t, ht), r = Ln(t, mt);
|
|
5446
5449
|
if (!(n || r)) {
|
|
5447
5450
|
c(!1);
|
|
5448
5451
|
return;
|
|
5449
5452
|
}
|
|
5450
|
-
e.getNodes().filter(
|
|
5453
|
+
e.getNodes().filter(Il).find((e) => {
|
|
5451
5454
|
let t = Ln(e, ht), i = Ln(e, mt), a = mt(i) && i.getIsUnlinked();
|
|
5452
5455
|
return n && !n.is(t) || t && !t.is(n) || r && !r.is(i) || i && (!i.is(r) || a);
|
|
5453
5456
|
}) ? c(!1) : c(!0);
|
|
@@ -5458,10 +5461,10 @@ function jl(e, t, n, r) {
|
|
|
5458
5461
|
n.read(() => {
|
|
5459
5462
|
t();
|
|
5460
5463
|
});
|
|
5461
|
-
}), e.registerCommand(mn, (e, n) => (t(), o(n), !1), nn), e.registerCommand(tn,
|
|
5464
|
+
}), e.registerCommand(mn, (e, n) => (t(), o(n), !1), nn), e.registerCommand(tn, Fl, an), e.registerCommand(uc, (e) => (r(e), !0), an));
|
|
5462
5465
|
}, u = [e, r], i[0] = e, i[1] = r, i[2] = l, i[3] = u) : (l = i[2], u = i[3]), Z(l, u);
|
|
5463
5466
|
let d;
|
|
5464
|
-
return i[4] !== a || i[5] !== t || i[6] !== s || i[7] !== n || i[8] !== r ? (d = Vn(/* @__PURE__ */ W(
|
|
5467
|
+
return i[4] !== a || i[5] !== t || i[6] !== s || i[7] !== n || i[8] !== r ? (d = Vn(/* @__PURE__ */ W(Nl, {
|
|
5465
5468
|
editor: a,
|
|
5466
5469
|
isLink: s,
|
|
5467
5470
|
anchorElem: t,
|
|
@@ -5470,30 +5473,30 @@ function jl(e, t, n, r) {
|
|
|
5470
5473
|
setIsLinkEditMode: r
|
|
5471
5474
|
}), document.body), i[4] = a, i[5] = t, i[6] = s, i[7] = n, i[8] = r, i[9] = d) : d = i[9], d;
|
|
5472
5475
|
}
|
|
5473
|
-
function
|
|
5476
|
+
function Fl(e) {
|
|
5474
5477
|
let t = Gt();
|
|
5475
5478
|
if (Xt(t)) {
|
|
5476
|
-
let n =
|
|
5477
|
-
if (ht(r) && (e.metaKey || e.ctrlKey)) return window.open(
|
|
5479
|
+
let n = dc(t), r = Ln(n, ht);
|
|
5480
|
+
if (ht(r) && (e.metaKey || e.ctrlKey)) return window.open(Al(r.getURL()), "_blank", "noopener,noreferrer"), !0;
|
|
5478
5481
|
}
|
|
5479
5482
|
return !1;
|
|
5480
5483
|
}
|
|
5481
|
-
function
|
|
5484
|
+
function Il(e) {
|
|
5482
5485
|
return !Jt(e);
|
|
5483
5486
|
}
|
|
5484
|
-
function
|
|
5487
|
+
function Ll(e) {
|
|
5485
5488
|
let { anchorElem: t } = e, n = t === void 0 ? document.body : t, [r, i] = $(!1), [a] = In();
|
|
5486
|
-
return
|
|
5489
|
+
return Pl(a, n, r, i);
|
|
5487
5490
|
}
|
|
5488
5491
|
//#endregion
|
|
5489
5492
|
//#region src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkPlugin.tsx
|
|
5490
|
-
function
|
|
5493
|
+
function Rl() {
|
|
5491
5494
|
let e = H(1), t;
|
|
5492
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W(at, { validateUrl:
|
|
5495
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ W(at, { validateUrl: jl }), e[0] = t) : t = e[0], t;
|
|
5493
5496
|
}
|
|
5494
5497
|
//#endregion
|
|
5495
5498
|
//#region src/components/rich-text/shared/plugins/ToggleEditablePlugin.tsx
|
|
5496
|
-
function
|
|
5499
|
+
function zl(e) {
|
|
5497
5500
|
let t = H(4), { isEditable: n } = e, [r] = In(), i, a;
|
|
5498
5501
|
return t[0] !== r || t[1] !== n ? (i = () => {
|
|
5499
5502
|
r.setEditable(n);
|
|
@@ -5501,7 +5504,7 @@ function Il(e) {
|
|
|
5501
5504
|
}
|
|
5502
5505
|
//#endregion
|
|
5503
5506
|
//#region src/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.tsx
|
|
5504
|
-
function
|
|
5507
|
+
function Bl() {
|
|
5505
5508
|
let e = H(2), [t] = In(), n;
|
|
5506
5509
|
return e[0] === t ? n = e[1] : (n = /* @__PURE__ */ W(_, {
|
|
5507
5510
|
fontSize: "xs",
|
|
@@ -5520,9 +5523,9 @@ function Ll() {
|
|
|
5520
5523
|
}
|
|
5521
5524
|
//#endregion
|
|
5522
5525
|
//#region src/components/rich-text/utils/markdown.ts
|
|
5523
|
-
var
|
|
5524
|
-
function
|
|
5525
|
-
let t = e.match(
|
|
5526
|
+
var Vl = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/;
|
|
5527
|
+
function Hl(e) {
|
|
5528
|
+
let t = e.match(Vl);
|
|
5526
5529
|
return t ? {
|
|
5527
5530
|
frontmatter: t[0],
|
|
5528
5531
|
body: e.slice(t[0].length)
|
|
@@ -5533,10 +5536,10 @@ function zl(e) {
|
|
|
5533
5536
|
}
|
|
5534
5537
|
//#endregion
|
|
5535
5538
|
//#region src/components/rich-text/markdown-editor/plugins/markdown-section-navigation.ts
|
|
5536
|
-
var
|
|
5537
|
-
let n = e.map(
|
|
5539
|
+
var Ul = (e) => e.trim().replace(/\s+/g, " "), Wl = (e, t) => {
|
|
5540
|
+
let n = e.map(Ul), r = /* @__PURE__ */ new Map(), i = [];
|
|
5538
5541
|
for (let e of t) {
|
|
5539
|
-
let t =
|
|
5542
|
+
let t = Ul(e.heading), a = e.occurrence ?? r.get(t) ?? 0;
|
|
5540
5543
|
r.set(t, a + 1);
|
|
5541
5544
|
let o = 0;
|
|
5542
5545
|
for (let [r, s] of n.entries()) if (s === t) {
|
|
@@ -5551,14 +5554,14 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5551
5554
|
}
|
|
5552
5555
|
}
|
|
5553
5556
|
return i.sort((e, t) => e.headingIndex - t.headingIndex);
|
|
5554
|
-
},
|
|
5557
|
+
}, Gl = (e, t) => {
|
|
5555
5558
|
let n = e[0]?.id;
|
|
5556
5559
|
for (let r of e) {
|
|
5557
5560
|
if (r.top > t) break;
|
|
5558
5561
|
n = r.id;
|
|
5559
5562
|
}
|
|
5560
5563
|
return n;
|
|
5561
|
-
},
|
|
5564
|
+
}, Kl = (e) => {
|
|
5562
5565
|
let t = e.parentElement;
|
|
5563
5566
|
for (; t;) {
|
|
5564
5567
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -5570,13 +5573,13 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5570
5573
|
t = t.parentElement;
|
|
5571
5574
|
}
|
|
5572
5575
|
return null;
|
|
5573
|
-
},
|
|
5576
|
+
}, ql = (e) => {
|
|
5574
5577
|
let { anchors: t, targetId: n, onActiveSectionChange: r } = e, [i] = In(), a = Q(r);
|
|
5575
5578
|
return a.current = r, Z(() => {
|
|
5576
5579
|
let e = () => {}, r = requestAnimationFrame(() => {
|
|
5577
5580
|
let r = i.getRootElement();
|
|
5578
5581
|
if (!r) return;
|
|
5579
|
-
let o = Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")), s =
|
|
5582
|
+
let o = Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")), s = Wl(o.map((e) => e.textContent ?? ""), t).map((e) => ({
|
|
5580
5583
|
id: e.id,
|
|
5581
5584
|
element: o[e.headingIndex]
|
|
5582
5585
|
}));
|
|
@@ -5587,8 +5590,8 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5587
5590
|
return;
|
|
5588
5591
|
}
|
|
5589
5592
|
c.element.tabIndex = -1, c.element.scrollIntoView({ block: "start" }), c.element.focus({ preventScroll: !0 });
|
|
5590
|
-
let l =
|
|
5591
|
-
let e = l?.getBoundingClientRect().top ?? 0, t =
|
|
5593
|
+
let l = Kl(r), u, d = () => {
|
|
5594
|
+
let e = l?.getBoundingClientRect().top ?? 0, t = Gl(s.map((t) => ({
|
|
5592
5595
|
id: t.id,
|
|
5593
5596
|
top: t.element.getBoundingClientRect().top - e
|
|
5594
5597
|
})), 8);
|
|
@@ -5606,7 +5609,7 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5606
5609
|
i,
|
|
5607
5610
|
n
|
|
5608
5611
|
]), null;
|
|
5609
|
-
},
|
|
5612
|
+
}, Jl = (e) => ({
|
|
5610
5613
|
columns: [{
|
|
5611
5614
|
id: `${e}-column-1`,
|
|
5612
5615
|
label: "Column 1",
|
|
@@ -5623,7 +5626,7 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5623
5626
|
[`${e}-column-2`]: ""
|
|
5624
5627
|
}
|
|
5625
5628
|
}]
|
|
5626
|
-
}),
|
|
5629
|
+
}), Yl = [
|
|
5627
5630
|
{
|
|
5628
5631
|
id: "table",
|
|
5629
5632
|
label: "Table",
|
|
@@ -5644,20 +5647,20 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5644
5647
|
label: "Divider",
|
|
5645
5648
|
icon: Pe
|
|
5646
5649
|
}
|
|
5647
|
-
],
|
|
5650
|
+
], Xl = (e) => {
|
|
5648
5651
|
let t = /^\/([a-z ]*)$/i.exec(e);
|
|
5649
5652
|
return t ? {
|
|
5650
5653
|
leadOffset: 0,
|
|
5651
5654
|
matchingString: t[1] ?? "",
|
|
5652
5655
|
replaceableString: t[0]
|
|
5653
5656
|
} : null;
|
|
5654
|
-
},
|
|
5657
|
+
}, Zl = () => `table-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random()}`}`, Ql = (e, t) => {
|
|
5655
5658
|
let n = e?.getParent();
|
|
5656
5659
|
if (!Yt(n)) return;
|
|
5657
5660
|
n.replace(t);
|
|
5658
5661
|
let r = Vt();
|
|
5659
5662
|
t.insertAfter(r), r.select();
|
|
5660
|
-
},
|
|
5663
|
+
}, $l = (e) => {
|
|
5661
5664
|
let t = H(18), { options: n, selectedIndex: r, onSelect: i, onHighlight: a } = e, o, s;
|
|
5662
5665
|
t[0] === r ? (o = t[1], s = t[2]) : (o = () => {
|
|
5663
5666
|
document.getElementById(`slash-command-${r}`)?.scrollIntoView({ block: "nearest" });
|
|
@@ -5695,7 +5698,7 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5695
5698
|
background: n ? "bg.active" : "transparent",
|
|
5696
5699
|
_hover: { background: n ? "bg.active" : "bg.hover" },
|
|
5697
5700
|
onMouseEnter: () => a(t),
|
|
5698
|
-
onPointerDown:
|
|
5701
|
+
onPointerDown: tu,
|
|
5699
5702
|
onClick: () => i(e, t),
|
|
5700
5703
|
children: [/* @__PURE__ */ W(w, {
|
|
5701
5704
|
as: e.icon,
|
|
@@ -5726,9 +5729,9 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5726
5729
|
u
|
|
5727
5730
|
]
|
|
5728
5731
|
}), t[15] = l, t[16] = u, t[17] = d) : d = t[17], d;
|
|
5729
|
-
},
|
|
5732
|
+
}, eu = () => {
|
|
5730
5733
|
let e = H(52), [t] = In(), [n, r] = $(null), [i, a] = $(null), [o, s] = $(""), [c, l] = $("Image"), u;
|
|
5731
|
-
e[0] === n ? u = e[1] : (u =
|
|
5734
|
+
e[0] === n ? u = e[1] : (u = Yl.filter((e) => !n || e.label.toLowerCase().includes(n.toLowerCase())).map(ru), e[0] = n, e[1] = u);
|
|
5732
5735
|
let d = u, f;
|
|
5733
5736
|
e[2] !== t || e[3] !== i ? (f = () => {
|
|
5734
5737
|
i && t.update(() => {
|
|
@@ -5744,7 +5747,7 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5744
5747
|
e.preventDefault(), i && o.trim() && (t.update(() => {
|
|
5745
5748
|
let e = Ut(i);
|
|
5746
5749
|
if (Qt(e)) {
|
|
5747
|
-
let t =
|
|
5750
|
+
let t = rs(o.trim(), c.trim() || "Image"), n = e.getParent();
|
|
5748
5751
|
if (e.replace(t), Yt(n)) {
|
|
5749
5752
|
let e = Vt();
|
|
5750
5753
|
n.insertAfter(e), e.select();
|
|
@@ -5758,15 +5761,15 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5758
5761
|
s(""), l("Image"), a(t?.getKey() ?? null), n();
|
|
5759
5762
|
return;
|
|
5760
5763
|
}
|
|
5761
|
-
Rt(ln), e.id === "table" &&
|
|
5764
|
+
Rt(ln), e.id === "table" && Ql(t, _s(Jl(Zl()))), e.id === "code" && Ql(t, yn()), e.id === "divider" && Ql(t, Xn()), n();
|
|
5762
5765
|
}, e[10] = g) : g = e[10];
|
|
5763
5766
|
let _;
|
|
5764
5767
|
e[11] === d ? _ = e[12] : (_ = /* @__PURE__ */ W(Zn, {
|
|
5765
5768
|
onQueryChange: r,
|
|
5766
|
-
triggerFn:
|
|
5769
|
+
triggerFn: Xl,
|
|
5767
5770
|
options: d,
|
|
5768
5771
|
onSelectOption: g,
|
|
5769
|
-
menuRenderFn:
|
|
5772
|
+
menuRenderFn: iu
|
|
5770
5773
|
}), e[11] = d, e[12] = _);
|
|
5771
5774
|
let y = !!i, C;
|
|
5772
5775
|
e[13] === t ? C = e[14] : (C = () => t.getRootElement(), e[13] = t, e[14] = C);
|
|
@@ -5846,19 +5849,19 @@ var Bl = (e) => e.trim().replace(/\s+/g, " "), Vl = (e, t) => {
|
|
|
5846
5849
|
let K;
|
|
5847
5850
|
return e[49] !== V || e[50] !== _ ? (K = /* @__PURE__ */ G(U, { children: [_, V] }), e[49] = V, e[50] = _, e[51] = K) : K = e[51], K;
|
|
5848
5851
|
};
|
|
5849
|
-
function
|
|
5852
|
+
function tu(e) {
|
|
5850
5853
|
return e.preventDefault();
|
|
5851
5854
|
}
|
|
5852
|
-
function
|
|
5853
|
-
function
|
|
5855
|
+
function nu() {}
|
|
5856
|
+
function ru(e) {
|
|
5854
5857
|
return {
|
|
5855
5858
|
...e,
|
|
5856
5859
|
key: e.id,
|
|
5857
|
-
setRefElement:
|
|
5860
|
+
setRefElement: nu
|
|
5858
5861
|
};
|
|
5859
5862
|
}
|
|
5860
|
-
function
|
|
5861
|
-
return e.current ? Bn.createPortal(/* @__PURE__ */ W(
|
|
5863
|
+
function iu(e, t) {
|
|
5864
|
+
return e.current ? Bn.createPortal(/* @__PURE__ */ W($l, {
|
|
5862
5865
|
options: t.options,
|
|
5863
5866
|
selectedIndex: t.selectedIndex,
|
|
5864
5867
|
onHighlight: t.setHighlightedIndex,
|
|
@@ -5869,7 +5872,7 @@ function tu(e, t) {
|
|
|
5869
5872
|
}
|
|
5870
5873
|
//#endregion
|
|
5871
5874
|
//#region src/components/rich-text/markdown-editor/plugins/markdown-history-plugin.tsx
|
|
5872
|
-
var
|
|
5875
|
+
var au = () => {
|
|
5873
5876
|
let [e] = In(), [t] = $(() => ({
|
|
5874
5877
|
current: {
|
|
5875
5878
|
editor: e,
|
|
@@ -5887,10 +5890,10 @@ var nu = () => {
|
|
|
5887
5890
|
let n = t.target;
|
|
5888
5891
|
return n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || !t.ctrlKey && !t.metaKey || t.key.toLowerCase() !== "z" ? !1 : (t.preventDefault(), e.dispatchCommand(t.shiftKey ? pn : gn, void 0), !0);
|
|
5889
5892
|
}, rn), [e]), /* @__PURE__ */ W(Qn, { externalHistoryState: t });
|
|
5890
|
-
},
|
|
5891
|
-
function
|
|
5892
|
-
let { autoFocus: t = !1, debug: n = !1, defaultState: r = "", fullWidth: i = !1, isEditable: a = !1, padding: o = "sm", placeholder: s, scrollable: c = !0, sectionNavigation: l, resolveMarkdownUrl: u, onActiveSectionChange: d, onChange: f } = e, { frontmatter: p, body: m } =
|
|
5893
|
-
v.current ??=
|
|
5893
|
+
}, ou = /* @__PURE__ */ e({ MarkdownEditor: () => cu }), su = "markdown-initial-import";
|
|
5894
|
+
function cu(e) {
|
|
5895
|
+
let { autoFocus: t = !1, debug: n = !1, defaultState: r = "", fullWidth: i = !1, isEditable: a = !1, padding: o = "sm", placeholder: s, scrollable: c = !0, sectionNavigation: l, resolveMarkdownUrl: u, onActiveSectionChange: d, onChange: f } = e, { frontmatter: p, body: m } = Hl(r), h = a && !!f, g = Q(null), v = Q(null);
|
|
5896
|
+
v.current ??= wl(m, u);
|
|
5894
5897
|
let y = v.current, [b, x] = $(null);
|
|
5895
5898
|
return Z(() => {
|
|
5896
5899
|
x(g.current);
|
|
@@ -5904,38 +5907,38 @@ function au(e) {
|
|
|
5904
5907
|
position: "relative",
|
|
5905
5908
|
direction: "column",
|
|
5906
5909
|
overflow: "visible",
|
|
5907
|
-
children: /* @__PURE__ */ W(
|
|
5910
|
+
children: /* @__PURE__ */ W($o, {
|
|
5908
5911
|
resolver: u,
|
|
5909
5912
|
children: /* @__PURE__ */ G(nt, {
|
|
5910
5913
|
initialConfig: {
|
|
5911
5914
|
namespace: "MARKDOWN_EDITOR",
|
|
5912
|
-
nodes:
|
|
5915
|
+
nodes: Zs,
|
|
5913
5916
|
editorState: () => {
|
|
5914
|
-
Rt(
|
|
5917
|
+
Rt(su), y.importToLexical();
|
|
5915
5918
|
},
|
|
5916
5919
|
onError: (e) => console.error(e),
|
|
5917
5920
|
editable: a,
|
|
5918
|
-
theme:
|
|
5921
|
+
theme: $s
|
|
5919
5922
|
},
|
|
5920
5923
|
children: [
|
|
5921
|
-
a ? /* @__PURE__ */ W(
|
|
5922
|
-
l ? /* @__PURE__ */ W(
|
|
5924
|
+
a ? /* @__PURE__ */ W(eu, {}) : null,
|
|
5925
|
+
l ? /* @__PURE__ */ W(ql, {
|
|
5923
5926
|
anchors: l.anchors,
|
|
5924
5927
|
targetId: l.targetId,
|
|
5925
5928
|
onActiveSectionChange: d
|
|
5926
5929
|
}) : null,
|
|
5927
5930
|
t ? /* @__PURE__ */ W(Wn, {}) : null,
|
|
5928
|
-
/* @__PURE__ */ W(
|
|
5929
|
-
/* @__PURE__ */ W(
|
|
5931
|
+
/* @__PURE__ */ W(au, {}),
|
|
5932
|
+
/* @__PURE__ */ W(Rl, {}),
|
|
5930
5933
|
/* @__PURE__ */ W(ot, {}),
|
|
5931
5934
|
a ? /* @__PURE__ */ W(ct, { maxIndent: 7 }) : null,
|
|
5932
5935
|
/* @__PURE__ */ W(Gn, {}),
|
|
5933
|
-
a ? /* @__PURE__ */ W(Kn, { transformers:
|
|
5936
|
+
a ? /* @__PURE__ */ W(Kn, { transformers: Qs }) : null,
|
|
5934
5937
|
/* @__PURE__ */ W(it, {}),
|
|
5935
|
-
/* @__PURE__ */ W(
|
|
5936
|
-
/* @__PURE__ */ W(
|
|
5937
|
-
/* @__PURE__ */ W(
|
|
5938
|
-
/* @__PURE__ */ W(
|
|
5938
|
+
/* @__PURE__ */ W(lc, {}),
|
|
5939
|
+
/* @__PURE__ */ W(sc, {}),
|
|
5940
|
+
/* @__PURE__ */ W(rc, { anchorElem: b }),
|
|
5941
|
+
/* @__PURE__ */ W(Ps, {}),
|
|
5939
5942
|
/* @__PURE__ */ W(st, {
|
|
5940
5943
|
contentEditable: /* @__PURE__ */ W(nr, {
|
|
5941
5944
|
fullWidth: i,
|
|
@@ -5961,19 +5964,19 @@ function au(e) {
|
|
|
5961
5964
|
}) : null,
|
|
5962
5965
|
ErrorBoundary: rt
|
|
5963
5966
|
}),
|
|
5964
|
-
a && b ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(
|
|
5967
|
+
a && b ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(wc, { anchorElem: b }), /* @__PURE__ */ W(Ll, { anchorElem: b })] }) : null,
|
|
5965
5968
|
h ? /* @__PURE__ */ W(qn, {
|
|
5966
5969
|
ignoreSelectionChange: !0,
|
|
5967
5970
|
ignoreHistoryMergeTagChange: !1,
|
|
5968
5971
|
onChange: (e, t, n) => {
|
|
5969
|
-
n.has(
|
|
5972
|
+
n.has(su) || e.read(() => {
|
|
5970
5973
|
let e = Wt(), t = y.exportFromLexical(e);
|
|
5971
5974
|
f?.(p + t);
|
|
5972
5975
|
});
|
|
5973
5976
|
}
|
|
5974
5977
|
}) : null,
|
|
5975
|
-
/* @__PURE__ */ W(
|
|
5976
|
-
n && /* @__PURE__ */ W(
|
|
5978
|
+
/* @__PURE__ */ W(zl, { isEditable: a }),
|
|
5979
|
+
n && /* @__PURE__ */ W(Bl, {})
|
|
5977
5980
|
]
|
|
5978
5981
|
})
|
|
5979
5982
|
})
|
|
@@ -5981,14 +5984,14 @@ function au(e) {
|
|
|
5981
5984
|
}
|
|
5982
5985
|
//#endregion
|
|
5983
5986
|
//#region src/components/rich-text/prompt-input/events.ts
|
|
5984
|
-
var
|
|
5987
|
+
var lu = "INSERT_REFERENCE", uu = "INSERT_BLOCK", du = _n(lu), fu = _n(uu);
|
|
5985
5988
|
//#endregion
|
|
5986
5989
|
//#region src/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.tsx
|
|
5987
|
-
function
|
|
5988
|
-
let t =
|
|
5990
|
+
function pu(e) {
|
|
5991
|
+
let t = hu();
|
|
5989
5992
|
return e.style !== null && t.setFormat(e.style.textAlign), { node: t };
|
|
5990
5993
|
}
|
|
5991
|
-
var
|
|
5994
|
+
var mu = class e extends sn {
|
|
5992
5995
|
static getType() {
|
|
5993
5996
|
return "comment";
|
|
5994
5997
|
}
|
|
@@ -6004,7 +6007,7 @@ var du = class e extends sn {
|
|
|
6004
6007
|
}
|
|
6005
6008
|
static importDOM() {
|
|
6006
6009
|
return { blockquote: () => ({
|
|
6007
|
-
conversion:
|
|
6010
|
+
conversion: pu,
|
|
6008
6011
|
priority: 0
|
|
6009
6012
|
}) };
|
|
6010
6013
|
}
|
|
@@ -6020,7 +6023,7 @@ var du = class e extends sn {
|
|
|
6020
6023
|
return { element: t };
|
|
6021
6024
|
}
|
|
6022
6025
|
static importJSON(e) {
|
|
6023
|
-
let t =
|
|
6026
|
+
let t = hu();
|
|
6024
6027
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
|
|
6025
6028
|
}
|
|
6026
6029
|
exportJSON() {
|
|
@@ -6043,61 +6046,61 @@ var du = class e extends sn {
|
|
|
6043
6046
|
}), this.replace(e), !0;
|
|
6044
6047
|
}
|
|
6045
6048
|
};
|
|
6046
|
-
function
|
|
6047
|
-
return new
|
|
6049
|
+
function hu() {
|
|
6050
|
+
return new mu();
|
|
6048
6051
|
}
|
|
6049
6052
|
//#endregion
|
|
6050
6053
|
//#region src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.ts
|
|
6051
|
-
var
|
|
6052
|
-
let n = Gt(), r =
|
|
6054
|
+
var gu = (e, t) => {
|
|
6055
|
+
let n = Gt(), r = hu();
|
|
6053
6056
|
if (t) {
|
|
6054
6057
|
t.getParent()?.replace(r, !0), t.remove(), r.selectEnd();
|
|
6055
6058
|
return;
|
|
6056
6059
|
}
|
|
6057
|
-
Xt(n) && Un(n,
|
|
6060
|
+
Xt(n) && Un(n, hu);
|
|
6058
6061
|
};
|
|
6059
|
-
function
|
|
6062
|
+
function _u() {
|
|
6060
6063
|
let e = H(3), [t] = In(), n, r;
|
|
6061
|
-
return e[0] === t ? (n = e[1], r = e[2]) : (n = () => zn(t.registerCommand(
|
|
6064
|
+
return e[0] === t ? (n = e[1], r = e[2]) : (n = () => zn(t.registerCommand(fu, vu, an)), r = [t], e[0] = t, e[1] = n, e[2] = r), Z(n, r), null;
|
|
6062
6065
|
}
|
|
6063
|
-
function
|
|
6066
|
+
function vu(e) {
|
|
6064
6067
|
let { optionId: t, nodeToReplace: n } = e;
|
|
6065
|
-
return
|
|
6068
|
+
return gu(t, n), !1;
|
|
6066
6069
|
}
|
|
6067
6070
|
//#endregion
|
|
6068
6071
|
//#region src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.ts
|
|
6069
|
-
var
|
|
6072
|
+
var yu = () => {
|
|
6070
6073
|
let e = H(3), [t] = In(), n, r;
|
|
6071
|
-
e[0] === t ? (n = e[1], r = e[2]) : (n = () => zn(t.registerNodeTransform(
|
|
6072
|
-
let n = e.getChildren().filter(
|
|
6074
|
+
e[0] === t ? (n = e[1], r = e[2]) : (n = () => zn(t.registerNodeTransform(mu, (e) => {
|
|
6075
|
+
let n = e.getChildren().filter(bu);
|
|
6073
6076
|
n.length > 0 && t.update(() => {
|
|
6074
|
-
n.forEach(
|
|
6077
|
+
n.forEach(xu);
|
|
6075
6078
|
});
|
|
6076
6079
|
})), r = [t], e[0] = t, e[1] = n, e[2] = r), Z(n, r);
|
|
6077
6080
|
};
|
|
6078
|
-
function
|
|
6081
|
+
function bu(e) {
|
|
6079
6082
|
return e.getType() === "comment";
|
|
6080
6083
|
}
|
|
6081
|
-
function
|
|
6084
|
+
function xu(e) {
|
|
6082
6085
|
e.replace(Vt(), !0);
|
|
6083
6086
|
}
|
|
6084
6087
|
//#endregion
|
|
6085
6088
|
//#region src/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.tsx
|
|
6086
|
-
function
|
|
6087
|
-
return
|
|
6089
|
+
function Su() {
|
|
6090
|
+
return yu(), _u(), null;
|
|
6088
6091
|
}
|
|
6089
6092
|
//#endregion
|
|
6090
6093
|
//#region src/components/rich-text/prompt-input/utils.ts
|
|
6091
|
-
var
|
|
6094
|
+
var Cu = (e) => {
|
|
6092
6095
|
let t = "", n = e.getChildren(), r = n.length;
|
|
6093
6096
|
for (let e = 0; e < r; e++) {
|
|
6094
6097
|
let i = n[e];
|
|
6095
6098
|
t += i.getTextContent(), Kt(i) && e !== r - 1 && !i.isInline() && (t += "\n");
|
|
6096
6099
|
}
|
|
6097
6100
|
return t;
|
|
6098
|
-
},
|
|
6101
|
+
}, wu = (e) => e.type === "reference" ? `#${e.name ?? e.referenceId ?? ""}` : null, Tu = (e) => e.type === "paragraph" && !!e.children?.length, Eu = (e) => {
|
|
6099
6102
|
if (e.type === "comment") return "";
|
|
6100
|
-
let t =
|
|
6103
|
+
let t = wu(e);
|
|
6101
6104
|
if (t !== null) return t;
|
|
6102
6105
|
let n = typeof e.text == "string" ? e.text : "", r = e.children;
|
|
6103
6106
|
if (!Array.isArray(r)) return n;
|
|
@@ -6108,16 +6111,16 @@ var bu = (e) => {
|
|
|
6108
6111
|
e !== i - 1 && (n += "\n");
|
|
6109
6112
|
continue;
|
|
6110
6113
|
}
|
|
6111
|
-
n +=
|
|
6114
|
+
n += Eu(t), Tu(t) && (n += "\n");
|
|
6112
6115
|
}
|
|
6113
6116
|
return n;
|
|
6114
|
-
},
|
|
6117
|
+
}, Du = (e) => {
|
|
6115
6118
|
try {
|
|
6116
|
-
return
|
|
6119
|
+
return Eu(JSON.parse(e).root ?? {});
|
|
6117
6120
|
} catch {
|
|
6118
6121
|
return "";
|
|
6119
6122
|
}
|
|
6120
|
-
},
|
|
6123
|
+
}, Ou = { root: {
|
|
6121
6124
|
direction: "ltr",
|
|
6122
6125
|
format: "",
|
|
6123
6126
|
indent: 0,
|
|
@@ -6133,7 +6136,7 @@ var bu = (e) => {
|
|
|
6133
6136
|
children: []
|
|
6134
6137
|
}]
|
|
6135
6138
|
} };
|
|
6136
|
-
function
|
|
6139
|
+
function ku(e = "") {
|
|
6137
6140
|
return e.trim() ? { root: {
|
|
6138
6141
|
direction: "ltr",
|
|
6139
6142
|
format: "",
|
|
@@ -6157,28 +6160,28 @@ function Eu(e = "") {
|
|
|
6157
6160
|
style: ""
|
|
6158
6161
|
}] : []
|
|
6159
6162
|
}))
|
|
6160
|
-
} } : JSON.parse(JSON.stringify(
|
|
6163
|
+
} } : JSON.parse(JSON.stringify(Ou));
|
|
6161
6164
|
}
|
|
6162
6165
|
//#endregion
|
|
6163
6166
|
//#region src/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.tsx
|
|
6164
|
-
function
|
|
6167
|
+
function Au(e) {
|
|
6165
6168
|
let t = H(4), { editorRef: n, previousTextRef: r } = e, [i] = In(), a, o;
|
|
6166
6169
|
return t[0] !== i || t[1] !== r ? (a = () => ({ setEditorValue: (e) => {
|
|
6167
|
-
let t = i.parseEditorState(JSON.stringify(
|
|
6170
|
+
let t = i.parseEditorState(JSON.stringify(ku(e)), ju);
|
|
6168
6171
|
i.setEditorState(t), r.current = e, i.focus();
|
|
6169
6172
|
} }), o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), ie(n, a, o), null;
|
|
6170
6173
|
}
|
|
6171
|
-
function
|
|
6174
|
+
function ju() {
|
|
6172
6175
|
Wt().selectEnd();
|
|
6173
6176
|
}
|
|
6174
6177
|
//#endregion
|
|
6175
6178
|
//#region src/components/rich-text/prompt-input/plugins/keyboard-shortcuts.ts
|
|
6176
|
-
var
|
|
6179
|
+
var Mu = (e) => e.key === "Enter" && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey, Nu = (e) => e.key === "ArrowUp" && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey, Pu = (e) => e.key === "ArrowDown" && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey;
|
|
6177
6180
|
//#endregion
|
|
6178
6181
|
//#region src/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.tsx
|
|
6179
|
-
function
|
|
6182
|
+
function Fu(e) {
|
|
6180
6183
|
let t = H(6), { onSubmit: n, onRecallPrevious: r, onRecallNext: i } = e, [a] = In(), o, s;
|
|
6181
|
-
return t[0] !== a || t[1] !== i || t[2] !== r || t[3] !== n ? (o = () => a.registerCommand(dn, (e) =>
|
|
6184
|
+
return t[0] !== a || t[1] !== i || t[2] !== r || t[3] !== n ? (o = () => a.registerCommand(dn, (e) => Mu(e) ? (e.preventDefault(), n?.(), !0) : Nu(e) && r?.() || Pu(e) && i?.() ? (e.preventDefault(), !0) : !1, rn), s = [
|
|
6182
6185
|
a,
|
|
6183
6186
|
n,
|
|
6184
6187
|
r,
|
|
@@ -6187,7 +6190,7 @@ function Mu(e) {
|
|
|
6187
6190
|
}
|
|
6188
6191
|
//#endregion
|
|
6189
6192
|
//#region src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.ts
|
|
6190
|
-
var
|
|
6193
|
+
var Iu = ["table", "connector"], Lu = (e) => e.sort((e, t) => Iu.indexOf(e.group) - Iu.indexOf(t.group)).map((e, t) => ({
|
|
6191
6194
|
...e,
|
|
6192
6195
|
index: t
|
|
6193
6196
|
})).reduce((e, t) => {
|
|
@@ -6196,7 +6199,7 @@ var Nu = ["table", "connector"], Pu = (e) => e.sort((e, t) => Nu.indexOf(e.group
|
|
|
6196
6199
|
}, {});
|
|
6197
6200
|
//#endregion
|
|
6198
6201
|
//#region src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.tsx
|
|
6199
|
-
function
|
|
6202
|
+
function Ru(e) {
|
|
6200
6203
|
let t = H(22), { id: n, isSelected: r, onClick: i, onMouseEnter: a, setRefElement: o, secondaryLabel: s, primaryLabel: c, tabIndex: l } = e, u = l === void 0 ? -1 : l, d = r ? "bg.active" : "transparent", f = r ? "bg.active" : "bg.hover", p;
|
|
6201
6204
|
t[0] === f ? p = t[1] : (p = { bg: f }, t[0] = f, t[1] = p);
|
|
6202
6205
|
let m;
|
|
@@ -6240,8 +6243,8 @@ function Fu(e) {
|
|
|
6240
6243
|
}
|
|
6241
6244
|
//#endregion
|
|
6242
6245
|
//#region src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.tsx
|
|
6243
|
-
var
|
|
6244
|
-
let t = H(12), { options: n, selectedIndex: r, onSelectItem: i, onMouseEnterItem: a } = e, { table: o, connector: s } =
|
|
6246
|
+
var zu = (e) => {
|
|
6247
|
+
let t = H(12), { options: n, selectedIndex: r, onSelectItem: i, onMouseEnterItem: a } = e, { table: o, connector: s } = Lu(n), c = o === void 0 ? [] : o, l = s === void 0 ? [] : s, u = [...c, ...l].length, f, p;
|
|
6245
6248
|
t[0] === r ? (f = t[1], p = t[2]) : (f = () => {
|
|
6246
6249
|
document.getElementById(`typeahead-item-${r}`)?.scrollIntoView({
|
|
6247
6250
|
behavior: "instant",
|
|
@@ -6262,7 +6265,7 @@ var Iu = (e) => {
|
|
|
6262
6265
|
color: "fg.muted",
|
|
6263
6266
|
textStyle: "label/S/medium",
|
|
6264
6267
|
children: "Tables"
|
|
6265
|
-
}), /* @__PURE__ */ W(_, { children: c.map((e) => /* @__PURE__ */ W(
|
|
6268
|
+
}), /* @__PURE__ */ W(_, { children: c.map((e) => /* @__PURE__ */ W(Ru, {
|
|
6266
6269
|
id: `typeahead-item-${e.index}`,
|
|
6267
6270
|
isSelected: r === e.index,
|
|
6268
6271
|
onClick: () => i(e, e.index),
|
|
@@ -6278,7 +6281,7 @@ var Iu = (e) => {
|
|
|
6278
6281
|
color: "fg.muted",
|
|
6279
6282
|
textStyle: "label/S/medium",
|
|
6280
6283
|
children: "Data Sources"
|
|
6281
|
-
}), /* @__PURE__ */ W(_, { children: l.map((e) => /* @__PURE__ */ W(
|
|
6284
|
+
}), /* @__PURE__ */ W(_, { children: l.map((e) => /* @__PURE__ */ W(Ru, {
|
|
6282
6285
|
id: `typeahead-item-${e.index}`,
|
|
6283
6286
|
isSelected: r === e.index,
|
|
6284
6287
|
onClick: () => i(e, e.index),
|
|
@@ -6301,8 +6304,8 @@ var Iu = (e) => {
|
|
|
6301
6304
|
y
|
|
6302
6305
|
]
|
|
6303
6306
|
}), t[6] = m, t[7] = g, t[8] = v, t[9] = y, t[10] = h, t[11] = b) : b = t[11], b;
|
|
6304
|
-
},
|
|
6305
|
-
function
|
|
6307
|
+
}, Bu = (e, t) => e.filter((e) => e.name.replace(/ /g, "_").toLowerCase().includes(t.toLowerCase()));
|
|
6308
|
+
function Vu(e, t = []) {
|
|
6306
6309
|
let n = t.map((e, t) => ({
|
|
6307
6310
|
id: e.resourceId,
|
|
6308
6311
|
key: e.resourceId,
|
|
@@ -6312,14 +6315,14 @@ function Ru(e, t = []) {
|
|
|
6312
6315
|
description: e.description,
|
|
6313
6316
|
setRefElement: () => {}
|
|
6314
6317
|
}));
|
|
6315
|
-
return e == null || e === "" ? n :
|
|
6318
|
+
return e == null || e === "" ? n : Bu(n, e);
|
|
6316
6319
|
}
|
|
6317
6320
|
//#endregion
|
|
6318
6321
|
//#region src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.ts
|
|
6319
|
-
var
|
|
6320
|
-
function
|
|
6321
|
-
let n =
|
|
6322
|
-
if (n === null && (n =
|
|
6322
|
+
var Hu = "\\.\\-<>_:", Uu = ["#"].join(""), Wu = `[^${Uu}${Hu}\\s]`, Gu = `(?:[${Hu}]|)`, Ku = 75, qu = RegExp(`(^|\\s|\\()([${Uu}]((?:${Wu}${Gu}){0,${Ku}}))$`), Ju = RegExp(`(^|\\s|\\()([${Uu}]((?:${Wu}){0,${Ku}}))$`);
|
|
6323
|
+
function Yu(e, t) {
|
|
6324
|
+
let n = qu.exec(e);
|
|
6325
|
+
if (n === null && (n = Ju.exec(e)), n !== null) {
|
|
6323
6326
|
let e = n[1], r = n[3];
|
|
6324
6327
|
if (r.length >= t) return {
|
|
6325
6328
|
leadOffset: n.index + e.length,
|
|
@@ -6331,14 +6334,14 @@ function Ku(e, t) {
|
|
|
6331
6334
|
}
|
|
6332
6335
|
//#endregion
|
|
6333
6336
|
//#region src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.tsx
|
|
6334
|
-
var
|
|
6335
|
-
function
|
|
6337
|
+
var Xu = 20;
|
|
6338
|
+
function Zu(e) {
|
|
6336
6339
|
let t = H(9), { items: n } = e, r;
|
|
6337
6340
|
t[0] === n ? r = t[1] : (r = n === void 0 ? [] : n, t[0] = n, t[1] = r);
|
|
6338
|
-
let i = r, [a, o] = $(null), [s] = In(), c =
|
|
6341
|
+
let i = r, [a, o] = $(null), [s] = In(), c = Vu(a, i), l;
|
|
6339
6342
|
t[2] === s ? l = t[3] : (l = (e, t, n) => {
|
|
6340
6343
|
s.update(() => {
|
|
6341
|
-
t && (s.dispatchCommand(
|
|
6344
|
+
t && (s.dispatchCommand(du, {
|
|
6342
6345
|
resourceId: e.id,
|
|
6343
6346
|
resourceType: e.group,
|
|
6344
6347
|
name: e.name,
|
|
@@ -6346,20 +6349,20 @@ function Ju(e) {
|
|
|
6346
6349
|
}), n());
|
|
6347
6350
|
});
|
|
6348
6351
|
}, t[2] = s, t[3] = l);
|
|
6349
|
-
let u = l, d =
|
|
6350
|
-
t[4] === c ? f = t[5] : (f = c.slice(0,
|
|
6352
|
+
let u = l, d = $u, f;
|
|
6353
|
+
t[4] === c ? f = t[5] : (f = c.slice(0, Xu), t[4] = c, t[5] = f);
|
|
6351
6354
|
let p = f, m;
|
|
6352
6355
|
return t[6] !== p || t[7] !== u ? (m = /* @__PURE__ */ W(Zn, {
|
|
6353
6356
|
onQueryChange: o,
|
|
6354
6357
|
onSelectOption: u,
|
|
6355
6358
|
triggerFn: d,
|
|
6356
6359
|
options: p,
|
|
6357
|
-
menuRenderFn:
|
|
6360
|
+
menuRenderFn: Qu
|
|
6358
6361
|
}), t[6] = p, t[7] = u, t[8] = m) : m = t[8], m;
|
|
6359
6362
|
}
|
|
6360
|
-
function
|
|
6363
|
+
function Qu(e, t) {
|
|
6361
6364
|
let { options: n, selectedIndex: r, selectOptionAndCleanUp: i, setHighlightedIndex: a } = t;
|
|
6362
|
-
return e.current ? Bn.createPortal(/* @__PURE__ */ W(
|
|
6365
|
+
return e.current ? Bn.createPortal(/* @__PURE__ */ W(zu, {
|
|
6363
6366
|
options: n,
|
|
6364
6367
|
selectedIndex: r,
|
|
6365
6368
|
onSelectItem: (e, t) => {
|
|
@@ -6370,12 +6373,12 @@ function Yu(e, t) {
|
|
|
6370
6373
|
}
|
|
6371
6374
|
}), e.current) : null;
|
|
6372
6375
|
}
|
|
6373
|
-
function
|
|
6374
|
-
return
|
|
6376
|
+
function $u(e) {
|
|
6377
|
+
return Yu(e, 0);
|
|
6375
6378
|
}
|
|
6376
6379
|
//#endregion
|
|
6377
6380
|
//#region src/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.tsx
|
|
6378
|
-
var
|
|
6381
|
+
var ed = class e extends hn {
|
|
6379
6382
|
__referenceId;
|
|
6380
6383
|
__name;
|
|
6381
6384
|
static getType() {
|
|
@@ -6412,7 +6415,7 @@ var Zu = class e extends hn {
|
|
|
6412
6415
|
}
|
|
6413
6416
|
static importDOM() {
|
|
6414
6417
|
return { span: (e) => !e.hasAttribute("data-reference-id") || !e.hasAttribute("data-name") ? null : {
|
|
6415
|
-
conversion:
|
|
6418
|
+
conversion: td,
|
|
6416
6419
|
priority: 1
|
|
6417
6420
|
} };
|
|
6418
6421
|
}
|
|
@@ -6431,54 +6434,54 @@ var Zu = class e extends hn {
|
|
|
6431
6434
|
return `#${this.__name}`;
|
|
6432
6435
|
}
|
|
6433
6436
|
};
|
|
6434
|
-
function
|
|
6437
|
+
function td(e) {
|
|
6435
6438
|
let t = e.getAttribute("data-reference-id"), n = e.getAttribute("data-name");
|
|
6436
|
-
return !t || !n ? null : { node:
|
|
6439
|
+
return !t || !n ? null : { node: nd(t, n) };
|
|
6437
6440
|
}
|
|
6438
|
-
function
|
|
6439
|
-
return new
|
|
6441
|
+
function nd(e, t) {
|
|
6442
|
+
return new ed(e, t);
|
|
6440
6443
|
}
|
|
6441
6444
|
//#endregion
|
|
6442
6445
|
//#region src/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.tsx
|
|
6443
|
-
var
|
|
6444
|
-
let r =
|
|
6446
|
+
var rd = (e, t, n) => {
|
|
6447
|
+
let r = nd(t, n);
|
|
6445
6448
|
if (e) {
|
|
6446
6449
|
e?.replace(r), e.remove(), r.selectEnd();
|
|
6447
6450
|
return;
|
|
6448
6451
|
}
|
|
6449
6452
|
};
|
|
6450
|
-
function
|
|
6453
|
+
function id(e) {
|
|
6451
6454
|
let t = H(4), { onAddReference: n } = e, [r] = In(), i, a;
|
|
6452
|
-
return t[0] !== r || t[1] !== n ? (i = () => zn(r.registerCommand(
|
|
6455
|
+
return t[0] !== r || t[1] !== n ? (i = () => zn(r.registerCommand(du, (e) => {
|
|
6453
6456
|
let { resourceId: t, resourceType: i, name: a, nodeToReplace: o } = e;
|
|
6454
6457
|
return r.update(() => {
|
|
6455
|
-
|
|
6458
|
+
rd(o, t, a);
|
|
6456
6459
|
}), n?.(t, i), !0;
|
|
6457
6460
|
}, an)), a = [r, n], t[0] = r, t[1] = n, t[2] = i, t[3] = a) : (i = t[2], a = t[3]), Z(i, a), null;
|
|
6458
6461
|
}
|
|
6459
6462
|
//#endregion
|
|
6460
6463
|
//#region src/components/rich-text/prompt-input/theme/prompt-input-theme.ts
|
|
6461
|
-
var
|
|
6464
|
+
var ad = {
|
|
6462
6465
|
...cr,
|
|
6463
6466
|
paragraph: "rich-text__p rich-text__p--no-margin"
|
|
6464
|
-
},
|
|
6465
|
-
|
|
6467
|
+
}, od = [
|
|
6468
|
+
mu,
|
|
6466
6469
|
$n,
|
|
6467
|
-
|
|
6468
|
-
],
|
|
6469
|
-
let n = H(41), { defaultState: r, debug: i, isEditable: a, placeholder: o } = e, s = i !== void 0 && i, c = a === void 0 || a, { onChange: l, onError: u, onSubmit: d, onRecallPrevious: f, onRecallNext: p, references: m, onAddReference: h } = e, g = u === void 0 ?
|
|
6470
|
+
ed
|
|
6471
|
+
], sd = Y((e, t) => {
|
|
6472
|
+
let n = H(41), { defaultState: r, debug: i, isEditable: a, placeholder: o } = e, s = i !== void 0 && i, c = a === void 0 || a, { onChange: l, onError: u, onSubmit: d, onRecallPrevious: f, onRecallNext: p, references: m, onAddReference: h } = e, g = u === void 0 ? cd : u, _;
|
|
6470
6473
|
n[0] === m ? _ = n[1] : (_ = m === void 0 ? [] : m, n[0] = m, n[1] = _);
|
|
6471
6474
|
let v = _, y;
|
|
6472
6475
|
n[2] !== r || n[3] !== c || n[4] !== g ? (y = {
|
|
6473
6476
|
namespace: "PROMPT_EDITOR",
|
|
6474
|
-
nodes:
|
|
6477
|
+
nodes: od,
|
|
6475
6478
|
editorState: r,
|
|
6476
6479
|
editable: c,
|
|
6477
6480
|
onError: g,
|
|
6478
|
-
theme:
|
|
6481
|
+
theme: ad
|
|
6479
6482
|
}, n[2] = r, n[3] = c, n[4] = g, n[5] = y) : y = n[5];
|
|
6480
6483
|
let b = y, x;
|
|
6481
|
-
n[6] === r ? x = n[7] : (x =
|
|
6484
|
+
n[6] === r ? x = n[7] : (x = Du(r), n[6] = r, n[7] = x);
|
|
6482
6485
|
let C = Q(x), w;
|
|
6483
6486
|
n[8] === o ? w = n[9] : (w = o ?? /* @__PURE__ */ G(R, {
|
|
6484
6487
|
textStyle: "label/M/regular",
|
|
@@ -6511,32 +6514,32 @@ var nd = {
|
|
|
6511
6514
|
ignoreHistoryMergeTagChange: !1,
|
|
6512
6515
|
onChange: (e) => {
|
|
6513
6516
|
e.read(() => {
|
|
6514
|
-
let t =
|
|
6517
|
+
let t = Cu(Wt());
|
|
6515
6518
|
t !== C.current && (C.current = t, l?.(t, e.toJSON()));
|
|
6516
6519
|
});
|
|
6517
6520
|
}
|
|
6518
6521
|
}), n[14] = l, n[15] = A);
|
|
6519
6522
|
let j;
|
|
6520
|
-
n[16] === t ? j = n[17] : (j = /* @__PURE__ */ W(
|
|
6523
|
+
n[16] === t ? j = n[17] : (j = /* @__PURE__ */ W(Au, {
|
|
6521
6524
|
editorRef: t,
|
|
6522
6525
|
previousTextRef: C
|
|
6523
6526
|
}), n[16] = t, n[17] = j);
|
|
6524
6527
|
let M;
|
|
6525
|
-
n[18] === c ? M = n[19] : (M = /* @__PURE__ */ W(
|
|
6528
|
+
n[18] === c ? M = n[19] : (M = /* @__PURE__ */ W(zl, { isEditable: c }), n[18] = c, n[19] = M);
|
|
6526
6529
|
let N;
|
|
6527
|
-
n[20] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ W(
|
|
6530
|
+
n[20] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ W(Su, {}), n[20] = N) : N = n[20];
|
|
6528
6531
|
let P;
|
|
6529
|
-
n[21] !== p || n[22] !== f || n[23] !== d ? (P = /* @__PURE__ */ W(
|
|
6532
|
+
n[21] !== p || n[22] !== f || n[23] !== d ? (P = /* @__PURE__ */ W(Fu, {
|
|
6530
6533
|
onSubmit: d,
|
|
6531
6534
|
onRecallPrevious: f,
|
|
6532
6535
|
onRecallNext: p
|
|
6533
6536
|
}), n[21] = p, n[22] = f, n[23] = d, n[24] = P) : P = n[24];
|
|
6534
6537
|
let F;
|
|
6535
|
-
n[25] === v ? F = n[26] : (F = /* @__PURE__ */ W(
|
|
6538
|
+
n[25] === v ? F = n[26] : (F = /* @__PURE__ */ W(Zu, { items: v }), n[25] = v, n[26] = F);
|
|
6536
6539
|
let I;
|
|
6537
|
-
n[27] === h ? I = n[28] : (I = /* @__PURE__ */ W(
|
|
6540
|
+
n[27] === h ? I = n[28] : (I = /* @__PURE__ */ W(id, { onAddReference: h }), n[27] = h, n[28] = I);
|
|
6538
6541
|
let L;
|
|
6539
|
-
n[29] === s ? L = n[30] : (L = s ? /* @__PURE__ */ W(
|
|
6542
|
+
n[29] === s ? L = n[30] : (L = s ? /* @__PURE__ */ W(Bl, {}) : "", n[29] = s, n[30] = L);
|
|
6540
6543
|
let z;
|
|
6541
6544
|
return n[31] !== b || n[32] !== k || n[33] !== A || n[34] !== j || n[35] !== M || n[36] !== P || n[37] !== F || n[38] !== I || n[39] !== L ? (z = /* @__PURE__ */ W(S, {
|
|
6542
6545
|
direction: "column",
|
|
@@ -6560,10 +6563,10 @@ var nd = {
|
|
|
6560
6563
|
})
|
|
6561
6564
|
}), n[31] = b, n[32] = k, n[33] = A, n[34] = j, n[35] = M, n[36] = P, n[37] = F, n[38] = I, n[39] = L, n[40] = z) : z = n[40], z;
|
|
6562
6565
|
});
|
|
6563
|
-
function
|
|
6566
|
+
function cd() {}
|
|
6564
6567
|
//#endregion
|
|
6565
6568
|
//#region src/components/rich-text/shared/plugins/StateUpdatePlugin.tsx
|
|
6566
|
-
function
|
|
6569
|
+
function ld(e) {
|
|
6567
6570
|
let t = H(5), { value: n, onUpdate: r } = e, [i] = In(), a, o;
|
|
6568
6571
|
return t[0] !== i || t[1] !== r || t[2] !== n ? (a = () => {
|
|
6569
6572
|
i && i.update(() => r(n), { tag: "history-merge" });
|
|
@@ -6575,10 +6578,10 @@ function od(e) {
|
|
|
6575
6578
|
}
|
|
6576
6579
|
//#endregion
|
|
6577
6580
|
//#region src/components/rich-text/rich-message/rich-message.tsx
|
|
6578
|
-
var
|
|
6579
|
-
function
|
|
6580
|
-
let { debug: t = !1, defaultState: n = "", fullWidth: r = !1, isEditable: i = !1, resolveMarkdownUrl: a, onChange: o } = e, { frontmatter: s, body: c } =
|
|
6581
|
-
return u.current ??=
|
|
6581
|
+
var ud = "markdown-source-import";
|
|
6582
|
+
function dd(e) {
|
|
6583
|
+
let { debug: t = !1, defaultState: n = "", fullWidth: r = !1, isEditable: i = !1, resolveMarkdownUrl: a, onChange: o } = e, { frontmatter: s, body: c } = Hl(n), l = i && !!o, u = Q(null);
|
|
6584
|
+
return u.current ??= wl(c, a), /* @__PURE__ */ W(S, {
|
|
6582
6585
|
className: "rich-text",
|
|
6583
6586
|
"data-rich-message": "true",
|
|
6584
6587
|
justifyContent: "space-between",
|
|
@@ -6588,25 +6591,25 @@ function cd(e) {
|
|
|
6588
6591
|
position: "relative",
|
|
6589
6592
|
direction: "column",
|
|
6590
6593
|
overflow: "hidden",
|
|
6591
|
-
children: /* @__PURE__ */ W(
|
|
6594
|
+
children: /* @__PURE__ */ W($o, {
|
|
6592
6595
|
resolver: a,
|
|
6593
6596
|
children: /* @__PURE__ */ G(nt, {
|
|
6594
6597
|
initialConfig: {
|
|
6595
6598
|
namespace: "RICH_MESSAGE",
|
|
6596
|
-
nodes:
|
|
6599
|
+
nodes: Zs,
|
|
6597
6600
|
editorState: () => {
|
|
6598
|
-
Rt(
|
|
6601
|
+
Rt(ud), u.current?.importToLexical();
|
|
6599
6602
|
},
|
|
6600
6603
|
onError: (e) => console.error(e),
|
|
6601
6604
|
editable: i,
|
|
6602
|
-
theme:
|
|
6605
|
+
theme: $s
|
|
6603
6606
|
},
|
|
6604
6607
|
children: [
|
|
6605
|
-
/* @__PURE__ */ W(
|
|
6608
|
+
/* @__PURE__ */ W(ld, {
|
|
6606
6609
|
value: c,
|
|
6607
6610
|
onUpdate: (e) => {
|
|
6608
|
-
let t =
|
|
6609
|
-
u.current = t, Rt(
|
|
6611
|
+
let t = wl(e, a);
|
|
6612
|
+
u.current = t, Rt(ud), t.importToLexical();
|
|
6610
6613
|
}
|
|
6611
6614
|
}),
|
|
6612
6615
|
/* @__PURE__ */ W(at, {}),
|
|
@@ -6614,9 +6617,9 @@ function cd(e) {
|
|
|
6614
6617
|
/* @__PURE__ */ W(ot, {}),
|
|
6615
6618
|
i ? /* @__PURE__ */ W(ct, { maxIndent: 7 }) : null,
|
|
6616
6619
|
/* @__PURE__ */ W(it, {}),
|
|
6617
|
-
/* @__PURE__ */ W(
|
|
6618
|
-
/* @__PURE__ */ W(
|
|
6619
|
-
/* @__PURE__ */ W(
|
|
6620
|
+
/* @__PURE__ */ W(lc, {}),
|
|
6621
|
+
/* @__PURE__ */ W(sc, {}),
|
|
6622
|
+
/* @__PURE__ */ W(Ps, {}),
|
|
6620
6623
|
/* @__PURE__ */ W(st, {
|
|
6621
6624
|
contentEditable: /* @__PURE__ */ W(nr, {
|
|
6622
6625
|
fullWidth: r,
|
|
@@ -6628,14 +6631,14 @@ function cd(e) {
|
|
|
6628
6631
|
ignoreSelectionChange: !0,
|
|
6629
6632
|
ignoreHistoryMergeTagChange: !1,
|
|
6630
6633
|
onChange: (e, t, n) => {
|
|
6631
|
-
n.has(
|
|
6634
|
+
n.has(ud) || e.read(() => {
|
|
6632
6635
|
let e = Wt(), t = u.current?.exportFromLexical(e) ?? "";
|
|
6633
6636
|
o?.(s + t);
|
|
6634
6637
|
});
|
|
6635
6638
|
}
|
|
6636
6639
|
}) : null,
|
|
6637
|
-
/* @__PURE__ */ W(
|
|
6638
|
-
t && /* @__PURE__ */ W(
|
|
6640
|
+
/* @__PURE__ */ W(zl, { isEditable: i }),
|
|
6641
|
+
t && /* @__PURE__ */ W(Bl, {})
|
|
6639
6642
|
]
|
|
6640
6643
|
})
|
|
6641
6644
|
})
|
|
@@ -6643,7 +6646,7 @@ function cd(e) {
|
|
|
6643
6646
|
}
|
|
6644
6647
|
//#endregion
|
|
6645
6648
|
//#region src/components/rich-text/resource-activity-feed/resource-activity-feed.tsx
|
|
6646
|
-
var
|
|
6649
|
+
var fd = {
|
|
6647
6650
|
activity: ce,
|
|
6648
6651
|
bell: le,
|
|
6649
6652
|
"circle-alert": ve,
|
|
@@ -6654,13 +6657,13 @@ var ld = {
|
|
|
6654
6657
|
"message-circle": Ne,
|
|
6655
6658
|
"scan-search": Re,
|
|
6656
6659
|
sparkles: Ue
|
|
6657
|
-
},
|
|
6658
|
-
let t = H(2), n =
|
|
6660
|
+
}, pd = (e) => {
|
|
6661
|
+
let t = H(2), n = fd[e.name], r;
|
|
6659
6662
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ W(w, {
|
|
6660
6663
|
as: n,
|
|
6661
6664
|
boxSize: "13px"
|
|
6662
6665
|
}), t[0] = n, t[1] = r), r;
|
|
6663
|
-
},
|
|
6666
|
+
}, md = (e) => {
|
|
6664
6667
|
let t = H(12), { item: n, size: r, onActionSelect: i, onRelatedResourceSelect: a } = e, o = n.kind === "message" ? n.attention?.actions : void 0;
|
|
6665
6668
|
if (!n.relatedResources?.length && !o?.length) return null;
|
|
6666
6669
|
let s;
|
|
@@ -6670,7 +6673,7 @@ var ld = {
|
|
|
6670
6673
|
variant: "outline",
|
|
6671
6674
|
disabled: !i,
|
|
6672
6675
|
onClick: () => i?.(e, n),
|
|
6673
|
-
children: [e.icon ? /* @__PURE__ */ W(
|
|
6676
|
+
children: [e.icon ? /* @__PURE__ */ W(pd, { name: e.icon }) : null, e.label]
|
|
6674
6677
|
}, e.id)), t[0] = o, t[1] = n, t[2] = i, t[3] = r, t[4] = s) : s = t[4];
|
|
6675
6678
|
let c;
|
|
6676
6679
|
t[5] !== n || t[6] !== a || t[7] !== r ? (c = n.relatedResources?.map((e) => /* @__PURE__ */ W(v, {
|
|
@@ -6687,11 +6690,11 @@ var ld = {
|
|
|
6687
6690
|
flexWrap: "wrap",
|
|
6688
6691
|
children: [s, c]
|
|
6689
6692
|
}), t[9] = s, t[10] = c, t[11] = l) : l = t[11], l;
|
|
6690
|
-
},
|
|
6693
|
+
}, hd = (e) => {
|
|
6691
6694
|
let t = H(7), { attention: n } = e;
|
|
6692
6695
|
if (!n.statusLabel) return null;
|
|
6693
6696
|
let r = n.icon ?? "bell", i;
|
|
6694
|
-
t[0] === r ? i = t[1] : (i = /* @__PURE__ */ W(
|
|
6697
|
+
t[0] === r ? i = t[1] : (i = /* @__PURE__ */ W(pd, { name: r }), t[0] = r, t[1] = i);
|
|
6695
6698
|
let a;
|
|
6696
6699
|
t[2] === n.statusLabel ? a = t[3] : (a = /* @__PURE__ */ W(R, {
|
|
6697
6700
|
textStyle: "label/XS/medium",
|
|
@@ -6703,7 +6706,7 @@ var ld = {
|
|
|
6703
6706
|
color: "fg.warning",
|
|
6704
6707
|
children: [i, a]
|
|
6705
6708
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
6706
|
-
},
|
|
6709
|
+
}, gd = (e) => {
|
|
6707
6710
|
let t = H(50), { item: n, size: a, fallbackActorName: o, formatTimestamp: s, onActionSelect: l, onRelatedResourceSelect: u } = e, d;
|
|
6708
6711
|
t[0] !== o || t[1] !== n.actor ? (d = n.actor ?? { name: o }, t[0] = o, t[1] = n.actor, t[2] = d) : d = t[2];
|
|
6709
6712
|
let f = d, p;
|
|
@@ -6716,14 +6719,14 @@ var ld = {
|
|
|
6716
6719
|
let h = m;
|
|
6717
6720
|
if (n.kind === "event") {
|
|
6718
6721
|
let e;
|
|
6719
|
-
t[9] === n.icon ? e = t[10] : (e = n.icon ? /* @__PURE__ */ W(
|
|
6722
|
+
t[9] === n.icon ? e = t[10] : (e = n.icon ? /* @__PURE__ */ W(pd, { name: n.icon }) : void 0, t[9] = n.icon, t[10] = e);
|
|
6720
6723
|
let i = a === "compact" ? "sm" : "md", o;
|
|
6721
6724
|
t[11] === n.summary ? o = t[12] : (o = /* @__PURE__ */ W(R, {
|
|
6722
6725
|
as: "span",
|
|
6723
6726
|
children: n.summary
|
|
6724
6727
|
}), t[11] = n.summary, t[12] = o);
|
|
6725
6728
|
let s;
|
|
6726
|
-
t[13] !== n || t[14] !== u || t[15] !== a ? (s = /* @__PURE__ */ W(
|
|
6729
|
+
t[13] !== n || t[14] !== u || t[15] !== a ? (s = /* @__PURE__ */ W(md, {
|
|
6727
6730
|
item: n,
|
|
6728
6731
|
size: a,
|
|
6729
6732
|
onRelatedResourceSelect: u
|
|
@@ -6738,16 +6741,16 @@ var ld = {
|
|
|
6738
6741
|
}) }), t[17] = f, t[18] = e, t[19] = i, t[20] = o, t[21] = s, t[22] = h, t[23] = l) : l = t[23], l;
|
|
6739
6742
|
}
|
|
6740
6743
|
let g = n.attention?.icon ?? "bell", _;
|
|
6741
|
-
t[24] !== g || t[25] !== n.attention ? (_ = n.attention ? /* @__PURE__ */ W(
|
|
6744
|
+
t[24] !== g || t[25] !== n.attention ? (_ = n.attention ? /* @__PURE__ */ W(pd, { name: g }) : void 0, t[24] = g, t[25] = n.attention, t[26] = _) : _ = t[26];
|
|
6742
6745
|
let v = n.attention ? "fg.warning" : void 0, y = n.attention ? "bg.warning" : void 0, b;
|
|
6743
|
-
t[27] === n.attention ? b = t[28] : (b = n.attention ? /* @__PURE__ */ W(
|
|
6746
|
+
t[27] === n.attention ? b = t[28] : (b = n.attention ? /* @__PURE__ */ W(hd, { attention: n.attention }) : void 0, t[27] = n.attention, t[28] = b);
|
|
6744
6747
|
let x = n.attention ? "attention" : "default", S = a === "compact" ? "xs" : "sm", C;
|
|
6745
|
-
t[29] === n.markdown ? C = t[30] : (C = /* @__PURE__ */ W(
|
|
6748
|
+
t[29] === n.markdown ? C = t[30] : (C = /* @__PURE__ */ W(dd, {
|
|
6746
6749
|
defaultState: n.markdown,
|
|
6747
6750
|
fullWidth: !0
|
|
6748
6751
|
}), t[29] = n.markdown, t[30] = C);
|
|
6749
6752
|
let w;
|
|
6750
|
-
t[31] !== n || t[32] !== l || t[33] !== u || t[34] !== a ? (w = /* @__PURE__ */ W(
|
|
6753
|
+
t[31] !== n || t[32] !== l || t[33] !== u || t[34] !== a ? (w = /* @__PURE__ */ W(md, {
|
|
6751
6754
|
item: n,
|
|
6752
6755
|
size: a,
|
|
6753
6756
|
onActionSelect: l,
|
|
@@ -6770,10 +6773,10 @@ var ld = {
|
|
|
6770
6773
|
size: a,
|
|
6771
6774
|
children: T
|
|
6772
6775
|
}), t[40] = f, t[41] = a, t[42] = T, t[43] = _, t[44] = v, t[45] = y, t[46] = b, t[47] = x, t[48] = h, t[49] = E) : E = t[49], E;
|
|
6773
|
-
},
|
|
6776
|
+
}, _d = (e) => e, vd = (e) => {
|
|
6774
6777
|
let t = H(56), r, i, a, s, c, l, u, d, f, p, h, g, _, y, b, x, S;
|
|
6775
6778
|
t[0] === e ? (r = t[1], i = t[2], a = t[3], s = t[4], c = t[5], l = t[6], u = t[7], d = t[8], f = t[9], p = t[10], h = t[11], g = t[12], _ = t[13], y = t[14], b = t[15], x = t[16], S = t[17]) : ({items: i, size: u, isLoading: d, error: r, hasMore: p, isLoadingMore: h, emptyTitle: g, emptyDescription: _, errorTitle: y, loadMoreLabel: b, loadingLabel: x, fallbackActorName: S, formatTimestamp: f, onActionSelect: a, onLoadMore: s, onRelatedResourceSelect: c, ...l} = e, t[0] = e, t[1] = r, t[2] = i, t[3] = a, t[4] = s, t[5] = c, t[6] = l, t[7] = u, t[8] = d, t[9] = f, t[10] = p, t[11] = h, t[12] = g, t[13] = _, t[14] = y, t[15] = b, t[16] = x, t[17] = S);
|
|
6776
|
-
let w = u === void 0 ? "comfortable" : u, T = d !== void 0 && d, E = p !== void 0 && p, D = h !== void 0 && h, O = g === void 0 ? "No activity yet" : g, k = _ === void 0 ? "Events and messages will appear here." : _, A = y === void 0 ? "Activity unavailable" : y, j = b === void 0 ? "Load more" : b, M = x === void 0 ? "Loading activity" : x, N = S === void 0 ? "System" : S, F = f === void 0 ?
|
|
6779
|
+
let w = u === void 0 ? "comfortable" : u, T = d !== void 0 && d, E = p !== void 0 && p, D = h !== void 0 && h, O = g === void 0 ? "No activity yet" : g, k = _ === void 0 ? "Events and messages will appear here." : _, A = y === void 0 ? "Activity unavailable" : y, j = b === void 0 ? "Load more" : b, M = x === void 0 ? "Loading activity" : x, N = S === void 0 ? "System" : S, F = f === void 0 ? _d : f;
|
|
6777
6780
|
if (r) {
|
|
6778
6781
|
let e;
|
|
6779
6782
|
return t[18] !== r || t[19] !== A || t[20] !== l ? (e = /* @__PURE__ */ W(o, {
|
|
@@ -6814,7 +6817,7 @@ var ld = {
|
|
|
6814
6817
|
let I = w === "compact" ? "sm" : "md", L;
|
|
6815
6818
|
if (t[32] !== N || t[33] !== F || t[34] !== i || t[35] !== a || t[36] !== c || t[37] !== w) {
|
|
6816
6819
|
let e;
|
|
6817
|
-
t[39] !== N || t[40] !== F || t[41] !== a || t[42] !== c || t[43] !== w ? (e = (e) => /* @__PURE__ */ W(
|
|
6820
|
+
t[39] !== N || t[40] !== F || t[41] !== a || t[42] !== c || t[43] !== w ? (e = (e) => /* @__PURE__ */ W(gd, {
|
|
6818
6821
|
item: e,
|
|
6819
6822
|
size: w,
|
|
6820
6823
|
fallbackActorName: N,
|
|
@@ -6839,14 +6842,14 @@ var ld = {
|
|
|
6839
6842
|
...l,
|
|
6840
6843
|
children: [L, z]
|
|
6841
6844
|
}), t[51] = l, t[52] = I, t[53] = L, t[54] = z, t[55] = B) : B = t[55], B;
|
|
6842
|
-
},
|
|
6845
|
+
}, yd = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", bd = (e) => e == null ? "-" : typeof e == "string" ? e.length ? e : "-" : typeof e == "number" || typeof e == "boolean" ? String(e).toUpperCase() : e instanceof Date ? e.toISOString() : JSON.stringify(e), xd = (e) => {
|
|
6843
6846
|
let t = H(8), { defaultCode: n, isEditable: r, showLineNumbers: i, disableScroll: a } = e, o = n === void 0 ? "" : n, s = r !== void 0 && r, c = i !== void 0 && i, l = a !== void 0 && a;
|
|
6844
6847
|
if (s) {
|
|
6845
6848
|
let e;
|
|
6846
6849
|
return t[0] === o ? e = t[1] : (e = /* @__PURE__ */ W(z, {
|
|
6847
6850
|
defaultValue: o,
|
|
6848
6851
|
fontFamily: "mono",
|
|
6849
|
-
fontSize:
|
|
6852
|
+
fontSize: yd,
|
|
6850
6853
|
resize: "vertical",
|
|
6851
6854
|
minHeight: "100%"
|
|
6852
6855
|
}), t[0] = o, t[1] = e), e;
|
|
@@ -6859,7 +6862,7 @@ var ld = {
|
|
|
6859
6862
|
margin: 0,
|
|
6860
6863
|
padding: "sm",
|
|
6861
6864
|
fontFamily: "mono",
|
|
6862
|
-
fontSize:
|
|
6865
|
+
fontSize: yd,
|
|
6863
6866
|
lineHeight: "1.5",
|
|
6864
6867
|
background: "bg.code",
|
|
6865
6868
|
borderRadius: "md",
|
|
@@ -6870,7 +6873,7 @@ var ld = {
|
|
|
6870
6873
|
display: "grid",
|
|
6871
6874
|
gridTemplateColumns: "auto 1fr",
|
|
6872
6875
|
columnGap: "sm",
|
|
6873
|
-
children: e.map(
|
|
6876
|
+
children: e.map(Cd)
|
|
6874
6877
|
}) : /* @__PURE__ */ W(_, {
|
|
6875
6878
|
as: "code",
|
|
6876
6879
|
children: o
|
|
@@ -6887,7 +6890,7 @@ var ld = {
|
|
|
6887
6890
|
showHorizontalScrollbar: !0,
|
|
6888
6891
|
children: f
|
|
6889
6892
|
}), t[6] = f, t[7] = p), p;
|
|
6890
|
-
},
|
|
6893
|
+
}, Sd = (e) => {
|
|
6891
6894
|
let t = H(26), { data: n, fullWidth: r, noBorder: i, hiddenColumns: a } = e, o = r !== void 0 && r, s = i !== void 0 && i, c;
|
|
6892
6895
|
t[0] === a ? c = t[1] : (c = a === void 0 ? [] : a, t[0] = a, t[1] = c);
|
|
6893
6896
|
let l = c;
|
|
@@ -6895,7 +6898,7 @@ var ld = {
|
|
|
6895
6898
|
let e = s ? "0" : "1px", n;
|
|
6896
6899
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ W(R, {
|
|
6897
6900
|
textStyle: "label/S/regular",
|
|
6898
|
-
fontSize:
|
|
6901
|
+
fontSize: yd,
|
|
6899
6902
|
color: "fg.muted",
|
|
6900
6903
|
children: "No data"
|
|
6901
6904
|
}), t[2] = n) : n = t[2];
|
|
@@ -6916,7 +6919,7 @@ var ld = {
|
|
|
6916
6919
|
let h = m, g = o ? "100%" : "fit-content", v = s ? "0" : "1px", y;
|
|
6917
6920
|
t[12] === h ? y = t[13] : (y = /* @__PURE__ */ W(I.Header, { children: /* @__PURE__ */ W(I.Row, {
|
|
6918
6921
|
background: "bg.muted",
|
|
6919
|
-
children: h.map(
|
|
6922
|
+
children: h.map(wd)
|
|
6920
6923
|
}) }), t[12] = h, t[13] = y);
|
|
6921
6924
|
let b;
|
|
6922
6925
|
if (t[14] !== h || t[15] !== n) {
|
|
@@ -6926,8 +6929,8 @@ var ld = {
|
|
|
6926
6929
|
paddingY: "2xs",
|
|
6927
6930
|
children: /* @__PURE__ */ W(R, {
|
|
6928
6931
|
textStyle: "paragraph/S/regular",
|
|
6929
|
-
fontSize:
|
|
6930
|
-
children:
|
|
6932
|
+
fontSize: yd,
|
|
6933
|
+
children: bd(e[n])
|
|
6931
6934
|
})
|
|
6932
6935
|
}, `${t}-${n}`)) }, `${t}-${h.join("-")}`), t[17] = h, t[18] = e), b = n.map(e), t[14] = h, t[15] = n, t[16] = b;
|
|
6933
6936
|
} else b = t[16];
|
|
@@ -6947,7 +6950,7 @@ var ld = {
|
|
|
6947
6950
|
})
|
|
6948
6951
|
}), t[21] = x, t[22] = g, t[23] = v, t[24] = y, t[25] = S) : S = t[25], S;
|
|
6949
6952
|
};
|
|
6950
|
-
function
|
|
6953
|
+
function Cd(e, t) {
|
|
6951
6954
|
return /* @__PURE__ */ G(_, {
|
|
6952
6955
|
as: "span",
|
|
6953
6956
|
display: "contents",
|
|
@@ -6964,27 +6967,27 @@ function bd(e, t) {
|
|
|
6964
6967
|
})]
|
|
6965
6968
|
}, `${t}-${e}`);
|
|
6966
6969
|
}
|
|
6967
|
-
function
|
|
6970
|
+
function wd(e) {
|
|
6968
6971
|
return /* @__PURE__ */ W(I.ColumnHeader, {
|
|
6969
6972
|
textTransform: "none",
|
|
6970
6973
|
paddingX: "xs",
|
|
6971
6974
|
paddingY: "2xs",
|
|
6972
6975
|
children: /* @__PURE__ */ W(R, {
|
|
6973
6976
|
textStyle: "label/S/medium",
|
|
6974
|
-
fontSize:
|
|
6977
|
+
fontSize: yd,
|
|
6975
6978
|
children: e
|
|
6976
6979
|
})
|
|
6977
6980
|
}, e);
|
|
6978
6981
|
}
|
|
6979
6982
|
//#endregion
|
|
6980
6983
|
//#region src/components/rich-text/utils/inferResourceType.ts
|
|
6981
|
-
function
|
|
6984
|
+
function Td(e) {
|
|
6982
6985
|
let t = e.toLowerCase().trim();
|
|
6983
6986
|
return t ? t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t === "text/markdown" ? "markdown" : t === "text/csv" || t === "text/tab-separated-values" ? "table" : t === "application/json" ? "json" : (t.startsWith("text/") || t.startsWith("application/"), "text") : "text";
|
|
6984
6987
|
}
|
|
6985
6988
|
//#endregion
|
|
6986
6989
|
//#region src/components/rich-text/utils/mediaType.ts
|
|
6987
|
-
var
|
|
6990
|
+
var Ed = {
|
|
6988
6991
|
csv: "text/csv",
|
|
6989
6992
|
tsv: "text/tab-separated-values",
|
|
6990
6993
|
json: "application/json",
|
|
@@ -7008,11 +7011,11 @@ var Cd = {
|
|
|
7008
7011
|
yml: "text/yaml",
|
|
7009
7012
|
yaml: "text/yaml"
|
|
7010
7013
|
};
|
|
7011
|
-
function
|
|
7014
|
+
function Dd(e) {
|
|
7012
7015
|
let t = (e.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
7013
|
-
return t ?
|
|
7016
|
+
return t ? Ed[t] ?? null : null;
|
|
7014
7017
|
}
|
|
7015
7018
|
//#endregion
|
|
7016
|
-
export {
|
|
7019
|
+
export { Ur as $, Ka as A, ha as B, to as C, Ha as D, no as E, La as F, Ui as G, pa as H, Ia as I, Si as J, Mi as K, Aa as L, za as M, Ba as N, Wa as O, Ra as P, Hr as Q, Oa as R, Ua as S, Va as T, Ki as U, fa as V, Wi as W, ei as X, xi as Y, Gr as Z, go as _, mr as _t, vd as a, Rr as at, Za as b, ku as c, qr as ct, Ec as d, xr as dt, Wr as et, Bs as f, yr as ft, _o as g, hr as gt, vo as h, _r as ht, Sd as i, Er as it, eo as j, Ga as k, Du as l, Qr as lt, xo as m, fr as mt, Td as n, Br as nt, dd as o, Lr as ot, Po as p, pr as pt, Ti as q, xd as r, Dr as rt, sd as s, Jr as st, Dd as t, zr as tt, cu as u, Zr as ut, ho as v, $a as w, Qa as x, Xa as y, Da as z };
|
|
7017
7020
|
|
|
7018
|
-
//# sourceMappingURL=rich-text-
|
|
7021
|
+
//# sourceMappingURL=rich-text-BgDvOEGH.js.map
|