@instructure/platform-notebook 1.10.3 → 1.11.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/Highlight.d.ts +7 -2
- package/dist/Highlight.d.ts.map +1 -1
- package/dist/NoteCard.d.ts +3 -2
- package/dist/NoteCard.d.ts.map +1 -1
- package/dist/NoteChip.d.ts +3 -1
- package/dist/NoteChip.d.ts.map +1 -1
- package/dist/NotebookEmptyState.d.ts.map +1 -1
- package/dist/NotesListView.d.ts.map +1 -1
- package/dist/SingleNote.d.ts.map +1 -1
- package/dist/highlighter.d.ts +1 -0
- package/dist/highlighter.d.ts.map +1 -1
- package/dist/hooks/useNotesData.d.ts +1 -0
- package/dist/hooks/useNotesData.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +836 -800
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/locales/en.json +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,107 +1,111 @@
|
|
|
1
1
|
import { jsx as i, jsxs as T, Fragment as Xe } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as Ve, useMemo as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { z as
|
|
5
|
-
import
|
|
6
|
-
import { useQueryClient as ke, useMutation as
|
|
7
|
-
import { CloseButton as
|
|
8
|
-
import { Flex as
|
|
9
|
-
import { Heading as
|
|
2
|
+
import { createContext as Ve, useMemo as pe, useContext as Qe, useReducer as Ye, useRef as F, useEffect as q, useState as W, useCallback as K } from "react";
|
|
3
|
+
import { createPortal as pt } from "react-dom";
|
|
4
|
+
import { z as d } from "zod";
|
|
5
|
+
import yt from "diff-match-patch";
|
|
6
|
+
import { useQueryClient as ke, useMutation as Le, useQuery as Nt } from "@tanstack/react-query";
|
|
7
|
+
import { CloseButton as bt, Button as ne, IconButton as ge } from "@instructure/ui-buttons/v11_7";
|
|
8
|
+
import { Flex as I } from "@instructure/ui-flex/v11_7";
|
|
9
|
+
import { Heading as ve } from "@instructure/ui-heading/v11_7";
|
|
10
10
|
import { Tray as Et } from "@instructure/ui-tray/v11_7";
|
|
11
11
|
import { View as V } from "@instructure/ui-view/v11_7";
|
|
12
|
-
import { IconQuestionLine as
|
|
13
|
-
import { Menu as
|
|
14
|
-
import { TruncateText as
|
|
12
|
+
import { IconQuestionLine as Ae, IconPinLine as De, IconWarningLine as Tt, NotebookInstUIIcon as St, IconEditLine as Oe, IconTrashLine as Se, IconArrowStartLine as vt } from "@instructure/ui-icons";
|
|
13
|
+
import { Menu as fe } from "@instructure/ui-menu/v11_7";
|
|
14
|
+
import { TruncateText as Te } from "@instructure/ui-truncate-text/v11_7";
|
|
15
15
|
import { SimpleSelect as He } from "@instructure/ui-simple-select/v11_7";
|
|
16
|
-
import { Text as
|
|
17
|
-
import { ScreenReaderContent as
|
|
16
|
+
import { Text as Z } from "@instructure/ui-text/v11_7";
|
|
17
|
+
import { ScreenReaderContent as ye } from "@instructure/ui-a11y-content";
|
|
18
18
|
import { Dialog as Ct } from "@instructure/ui-dialog";
|
|
19
19
|
import { TextArea as Ze } from "@instructure/ui-text-area/v11_7";
|
|
20
|
-
import { Pill as
|
|
21
|
-
import { Pagination as
|
|
22
|
-
import { Spinner as
|
|
23
|
-
const
|
|
24
|
-
startContainer:
|
|
25
|
-
endContainer:
|
|
26
|
-
startOffset:
|
|
27
|
-
endOffset:
|
|
28
|
-
}),
|
|
29
|
-
start:
|
|
30
|
-
end:
|
|
31
|
-
}),
|
|
32
|
-
selectedText:
|
|
33
|
-
hasNoHighlightAnymore:
|
|
34
|
-
textPosition:
|
|
35
|
-
range:
|
|
36
|
-
pageLastModifiedAt:
|
|
20
|
+
import { Pill as $e } from "@instructure/ui-pill/v11_7";
|
|
21
|
+
import { Pagination as It } from "@instructure/ui-pagination/v11_7";
|
|
22
|
+
import { Spinner as xt } from "@instructure/ui-spinner/v11_7";
|
|
23
|
+
const Rt = d.object({
|
|
24
|
+
startContainer: d.string(),
|
|
25
|
+
endContainer: d.string(),
|
|
26
|
+
startOffset: d.number(),
|
|
27
|
+
endOffset: d.number()
|
|
28
|
+
}), Ot = d.object({
|
|
29
|
+
start: d.number(),
|
|
30
|
+
end: d.number()
|
|
31
|
+
}), Pe = d.object({
|
|
32
|
+
selectedText: d.string(),
|
|
33
|
+
hasNoHighlightAnymore: d.boolean().optional(),
|
|
34
|
+
textPosition: Ot.nullable(),
|
|
35
|
+
range: Rt.nullable(),
|
|
36
|
+
pageLastModifiedAt: d.string()
|
|
37
37
|
});
|
|
38
|
-
var
|
|
39
|
-
const
|
|
38
|
+
var L = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(L || {});
|
|
39
|
+
const _e = d.enum([
|
|
40
40
|
"Important",
|
|
41
41
|
"Confusing"
|
|
42
42
|
/* CONFUSING */
|
|
43
|
-
]), wt =
|
|
44
|
-
totalCount:
|
|
45
|
-
totalNrOfPages:
|
|
46
|
-
}), Ce =
|
|
47
|
-
id:
|
|
48
|
-
rootAccountUuid:
|
|
49
|
-
userId:
|
|
50
|
-
courseId:
|
|
51
|
-
objectId:
|
|
52
|
-
objectType:
|
|
53
|
-
userText:
|
|
54
|
-
reaction:
|
|
55
|
-
highlightData:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
]), wt = d.object({
|
|
44
|
+
totalCount: d.number().nullish(),
|
|
45
|
+
totalNrOfPages: d.number().nullish()
|
|
46
|
+
}), Ce = d.object({
|
|
47
|
+
id: d.string(),
|
|
48
|
+
rootAccountUuid: d.string(),
|
|
49
|
+
userId: d.string(),
|
|
50
|
+
courseId: d.string(),
|
|
51
|
+
objectId: d.string(),
|
|
52
|
+
objectType: d.string(),
|
|
53
|
+
userText: d.string().optional(),
|
|
54
|
+
reaction: d.array(_e),
|
|
55
|
+
highlightData: Pe,
|
|
56
|
+
// Set by the host when the note's highlight is gone specifically because its source
|
|
57
|
+
// (the page/assignment/quiz it was captured from) was unpublished or deleted, as opposed
|
|
58
|
+
// to the note never having had a highlight. Selects the HighlightError reason in NoteCard.
|
|
59
|
+
highlightSourceUnavailable: d.boolean().optional(),
|
|
60
|
+
createdAt: d.string(),
|
|
61
|
+
updatedAt: d.string()
|
|
62
|
+
}), kt = d.object({
|
|
63
|
+
cursor: d.string(),
|
|
60
64
|
node: Ce
|
|
61
65
|
});
|
|
62
|
-
|
|
63
|
-
notes:
|
|
64
|
-
edges:
|
|
65
|
-
nodes:
|
|
66
|
+
d.object({
|
|
67
|
+
notes: d.object({
|
|
68
|
+
edges: d.array(kt),
|
|
69
|
+
nodes: d.array(Ce),
|
|
66
70
|
pageInfo: wt
|
|
67
71
|
})
|
|
68
72
|
});
|
|
69
|
-
const
|
|
70
|
-
type:
|
|
71
|
-
id:
|
|
72
|
-
}),
|
|
73
|
-
courseId:
|
|
74
|
-
learningObject:
|
|
75
|
-
reactions:
|
|
73
|
+
const Lt = d.object({
|
|
74
|
+
type: d.string(),
|
|
75
|
+
id: d.string()
|
|
76
|
+
}), At = d.object({
|
|
77
|
+
courseId: d.string().optional(),
|
|
78
|
+
learningObject: Lt.optional(),
|
|
79
|
+
reactions: d.array(d.string()).optional()
|
|
76
80
|
}).optional();
|
|
77
|
-
|
|
78
|
-
courseId:
|
|
79
|
-
filter:
|
|
80
|
-
offset:
|
|
81
|
-
pageSize:
|
|
81
|
+
d.object({
|
|
82
|
+
courseId: d.string().optional(),
|
|
83
|
+
filter: At,
|
|
84
|
+
offset: d.number().optional(),
|
|
85
|
+
pageSize: d.number().optional()
|
|
82
86
|
});
|
|
83
|
-
|
|
84
|
-
courseId:
|
|
85
|
-
objectId:
|
|
86
|
-
objectType:
|
|
87
|
-
userText:
|
|
88
|
-
reaction:
|
|
89
|
-
highlightData:
|
|
87
|
+
d.object({
|
|
88
|
+
courseId: d.string(),
|
|
89
|
+
objectId: d.string(),
|
|
90
|
+
objectType: d.string(),
|
|
91
|
+
userText: d.string().optional(),
|
|
92
|
+
reaction: d.array(_e),
|
|
93
|
+
highlightData: Pe
|
|
90
94
|
});
|
|
91
|
-
|
|
95
|
+
d.object({
|
|
92
96
|
createNote: Ce
|
|
93
97
|
});
|
|
94
|
-
|
|
95
|
-
id:
|
|
96
|
-
userText:
|
|
97
|
-
reaction:
|
|
98
|
-
highlightData:
|
|
98
|
+
d.object({
|
|
99
|
+
id: d.string(),
|
|
100
|
+
userText: d.string().optional(),
|
|
101
|
+
reaction: d.array(_e),
|
|
102
|
+
highlightData: Pe
|
|
99
103
|
});
|
|
100
|
-
|
|
104
|
+
d.object({
|
|
101
105
|
updateNote: Ce
|
|
102
106
|
});
|
|
103
|
-
|
|
104
|
-
deleteNote:
|
|
107
|
+
d.object({
|
|
108
|
+
deleteNote: d.string()
|
|
105
109
|
});
|
|
106
110
|
var Je = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Je || {});
|
|
107
111
|
class oe {
|
|
@@ -200,18 +204,18 @@ class X {
|
|
|
200
204
|
return new X(n, o);
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
|
-
const
|
|
207
|
+
const Dt = (t) => {
|
|
204
208
|
const e = t.nodeName.toLowerCase();
|
|
205
209
|
return e === "#text" ? "text()" : e;
|
|
206
210
|
};
|
|
207
|
-
function
|
|
211
|
+
function Pt(t) {
|
|
208
212
|
let e = 0, n = t;
|
|
209
213
|
for (; n; )
|
|
210
214
|
n.nodeName === t.nodeName && (e += 1), n = n.previousSibling;
|
|
211
215
|
return e;
|
|
212
216
|
}
|
|
213
|
-
const
|
|
214
|
-
const e =
|
|
217
|
+
const _t = (t) => {
|
|
218
|
+
const e = Dt(t), n = Pt(t);
|
|
215
219
|
return `${e}[${n}]`;
|
|
216
220
|
}, Ge = (t, e) => {
|
|
217
221
|
let n = "", o = t;
|
|
@@ -220,10 +224,10 @@ const Pt = (t) => {
|
|
|
220
224
|
console.error("Node is not a descendant of root");
|
|
221
225
|
return;
|
|
222
226
|
}
|
|
223
|
-
n = `${
|
|
227
|
+
n = `${_t(o)}/${n}`, o = o.parentNode;
|
|
224
228
|
}
|
|
225
229
|
return n = `/${n}`, n = n.replace(/\/$/, ""), n;
|
|
226
|
-
},
|
|
230
|
+
}, Ft = (t, e, n) => {
|
|
227
231
|
const o = e.toUpperCase();
|
|
228
232
|
let r = -1;
|
|
229
233
|
for (let s = 0; s < t.children.length; s++) {
|
|
@@ -232,7 +236,7 @@ const Pt = (t) => {
|
|
|
232
236
|
return l;
|
|
233
237
|
}
|
|
234
238
|
return null;
|
|
235
|
-
},
|
|
239
|
+
}, Mt = (t, e) => {
|
|
236
240
|
if (!(t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
|
|
237
241
|
return console.error("Expression is not a simple XPath"), null;
|
|
238
242
|
const o = t.split("/");
|
|
@@ -240,35 +244,35 @@ const Pt = (t) => {
|
|
|
240
244
|
o.shift();
|
|
241
245
|
for (const s of o) {
|
|
242
246
|
let l, a;
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
l = s.slice(0,
|
|
246
|
-
const
|
|
247
|
-
if (a = Number.parseInt(
|
|
247
|
+
const f = s.indexOf("[");
|
|
248
|
+
if (f !== -1) {
|
|
249
|
+
l = s.slice(0, f);
|
|
250
|
+
const m = s.slice(f + 1, s.indexOf("]"));
|
|
251
|
+
if (a = Number.parseInt(m, 10) - 1, a < 0)
|
|
248
252
|
return null;
|
|
249
253
|
} else
|
|
250
254
|
l = s, a = 0;
|
|
251
|
-
const
|
|
252
|
-
if (!
|
|
255
|
+
const u = Ft(r, l, a);
|
|
256
|
+
if (!u)
|
|
253
257
|
return null;
|
|
254
|
-
r =
|
|
258
|
+
r = u;
|
|
255
259
|
}
|
|
256
260
|
return r;
|
|
257
261
|
}, je = (t, e = document.body) => {
|
|
258
262
|
if (t === "")
|
|
259
263
|
return e;
|
|
260
264
|
try {
|
|
261
|
-
return
|
|
265
|
+
return Mt(t, e);
|
|
262
266
|
} catch {
|
|
263
267
|
return document.evaluate(`.${t}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
264
268
|
}
|
|
265
269
|
};
|
|
266
|
-
class
|
|
270
|
+
class ce {
|
|
267
271
|
constructor(e, n) {
|
|
268
272
|
this.root = e, this.range = n;
|
|
269
273
|
}
|
|
270
274
|
static fromRange(e, n) {
|
|
271
|
-
return new
|
|
275
|
+
return new ce(e, n);
|
|
272
276
|
}
|
|
273
277
|
static fromSelector(e, n) {
|
|
274
278
|
if ((n == null ? void 0 : n.startContainer) == null || (n == null ? void 0 : n.endContainer) == null)
|
|
@@ -283,7 +287,7 @@ class ae {
|
|
|
283
287
|
if (!s || !l)
|
|
284
288
|
return null;
|
|
285
289
|
const a = new oe(s, l).toRange();
|
|
286
|
-
return a ? !e.contains(a.startContainer) || !e.contains(a.endContainer) ? (console.error("Resolved range escapes root"), null) : new
|
|
290
|
+
return a ? !e.contains(a.startContainer) || !e.contains(a.endContainer) ? (console.error("Resolved range escapes root"), null) : new ce(e, a) : null;
|
|
287
291
|
}
|
|
288
292
|
toRange() {
|
|
289
293
|
return this.range;
|
|
@@ -299,17 +303,17 @@ class ae {
|
|
|
299
303
|
};
|
|
300
304
|
}
|
|
301
305
|
}
|
|
302
|
-
class
|
|
306
|
+
class le {
|
|
303
307
|
constructor(e, n, o) {
|
|
304
308
|
this.root = e, this.start = n, this.end = o;
|
|
305
309
|
}
|
|
306
310
|
static fromRange(e, n) {
|
|
307
311
|
var r;
|
|
308
312
|
const o = (r = oe.fromRange(n)) == null ? void 0 : r.relativeTo(e);
|
|
309
|
-
return o ? new
|
|
313
|
+
return o ? new le(e, o.start.offset, o.end.offset) : null;
|
|
310
314
|
}
|
|
311
315
|
static fromSelector(e, n) {
|
|
312
|
-
return new
|
|
316
|
+
return new le(e, n.start, n.end);
|
|
313
317
|
}
|
|
314
318
|
toSelector() {
|
|
315
319
|
return {
|
|
@@ -344,65 +348,65 @@ const et = (t) => {
|
|
|
344
348
|
for (; n !== void 0 && l && a === n; )
|
|
345
349
|
r.push({ node: l, offset: l.data.length }), n = e.shift();
|
|
346
350
|
return n !== void 0 && console.error("Offset exceeds text length"), r;
|
|
347
|
-
},
|
|
351
|
+
}, Bt = (t, e, n, o) => {
|
|
348
352
|
const r = n - e;
|
|
349
|
-
return Math.abs(r - o) <= 5 ?
|
|
353
|
+
return Math.abs(r - o) <= 5 ? le.fromSelector(t, {
|
|
350
354
|
start: e,
|
|
351
355
|
end: n
|
|
352
356
|
}) : null;
|
|
353
|
-
},
|
|
354
|
-
const r = new
|
|
357
|
+
}, Ut = (t, e, n, o) => {
|
|
358
|
+
const r = new yt();
|
|
355
359
|
r.Match_Distance = 5e3;
|
|
356
360
|
const s = t.textContent;
|
|
357
361
|
if (!s)
|
|
358
362
|
return null;
|
|
359
363
|
if (e.length > 32) {
|
|
360
|
-
const l = e.slice(0, 32), a = e.slice(-32),
|
|
361
|
-
let
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
+
const l = e.slice(0, 32), a = e.slice(-32), f = o - n;
|
|
365
|
+
let u = r.match_main(s, l, n);
|
|
366
|
+
const m = r.match_main(s, a, o), c = m + a.length;
|
|
367
|
+
if (u === -1 || m === -1)
|
|
364
368
|
return null;
|
|
365
|
-
const
|
|
366
|
-
if ((
|
|
367
|
-
return
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
370
|
-
start:
|
|
371
|
-
end:
|
|
369
|
+
const y = c - u, N = Math.abs(y - f);
|
|
370
|
+
if ((u > c || N > 5) && (r.Match_Distance = e.length + 100, u = r.match_main(s, l, c), u !== -1 && u < c))
|
|
371
|
+
return Bt(t, u, c, f);
|
|
372
|
+
if (u < c && N <= 5)
|
|
373
|
+
return le.fromSelector(t, {
|
|
374
|
+
start: u,
|
|
375
|
+
end: c
|
|
372
376
|
});
|
|
373
377
|
} else {
|
|
374
378
|
const l = r.match_main(s, e, n);
|
|
375
379
|
if (l !== -1)
|
|
376
|
-
return
|
|
380
|
+
return le.fromSelector(t, {
|
|
377
381
|
start: l,
|
|
378
382
|
end: l + e.length
|
|
379
383
|
});
|
|
380
384
|
}
|
|
381
385
|
return null;
|
|
382
|
-
},
|
|
386
|
+
}, Ht = (t, e) => {
|
|
383
387
|
if (!e) return null;
|
|
384
388
|
const { highlightData: n } = t, { textPosition: o, selectedText: r } = n;
|
|
385
|
-
return
|
|
389
|
+
return Ut(
|
|
386
390
|
e,
|
|
387
391
|
r,
|
|
388
392
|
(o == null ? void 0 : o.start) ?? 0,
|
|
389
393
|
(o == null ? void 0 : o.end) ?? 0
|
|
390
394
|
);
|
|
391
|
-
},
|
|
395
|
+
}, $t = (t, e, n) => {
|
|
392
396
|
const o = [], r = [];
|
|
393
397
|
for (const s of e) {
|
|
394
|
-
const l =
|
|
398
|
+
const l = Ht(s, t);
|
|
395
399
|
if (l) {
|
|
396
|
-
const a = l.toRange(),
|
|
400
|
+
const a = l.toRange(), f = a && ce.fromRange(t, a), u = (a == null ? void 0 : a.toString().trim()) || s.highlightData.selectedText;
|
|
397
401
|
o.push({
|
|
398
402
|
id: s.id,
|
|
399
403
|
reaction: s.reaction,
|
|
400
404
|
userText: s.userText,
|
|
401
405
|
highlightData: {
|
|
402
406
|
...s.highlightData,
|
|
403
|
-
selectedText:
|
|
407
|
+
selectedText: u,
|
|
404
408
|
hasNoHighlightAnymore: !1,
|
|
405
|
-
range: (
|
|
409
|
+
range: (f == null ? void 0 : f.toSelector()) ?? null,
|
|
406
410
|
textPosition: l.toSelector(),
|
|
407
411
|
pageLastModifiedAt: n
|
|
408
412
|
}
|
|
@@ -424,59 +428,59 @@ const et = (t) => {
|
|
|
424
428
|
var l;
|
|
425
429
|
if (!e) return;
|
|
426
430
|
const { highlightData: n, id: o } = t, { range: r } = n ?? {};
|
|
427
|
-
r && ((l =
|
|
428
|
-
},
|
|
431
|
+
r && ((l = ce.fromSelector(e, r)) == null ? void 0 : l.toRange()) && en({ id: o });
|
|
432
|
+
}, Gt = (t) => {
|
|
429
433
|
const n = document.querySelector(
|
|
430
434
|
`[data-highlight-id="${CSS.escape(t)}"].highlight-content`
|
|
431
|
-
) ?? document.getElementById(
|
|
435
|
+
) ?? document.getElementById(Ie(t));
|
|
432
436
|
if (n) {
|
|
433
437
|
const o = n.getBoundingClientRect();
|
|
434
438
|
o.top >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) || n.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
435
439
|
}
|
|
436
|
-
},
|
|
440
|
+
}, Ne = 90, be = 172, jt = (t) => {
|
|
437
441
|
const e = t.getClientRects();
|
|
438
442
|
if (!e.length)
|
|
439
443
|
return null;
|
|
440
|
-
const n = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight,
|
|
441
|
-
const
|
|
442
|
-
return
|
|
443
|
-
},
|
|
444
|
-
const
|
|
445
|
-
return
|
|
444
|
+
const n = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, f = (h) => {
|
|
445
|
+
const x = h + be;
|
|
446
|
+
return h >= s && x <= l - s;
|
|
447
|
+
}, u = (h) => {
|
|
448
|
+
const x = h + Ne;
|
|
449
|
+
return h >= s && x <= a - s;
|
|
446
450
|
};
|
|
447
|
-
let
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
+
let m;
|
|
452
|
+
const c = n.right - be;
|
|
453
|
+
if (f(c))
|
|
454
|
+
m = c;
|
|
451
455
|
else {
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
|
|
456
|
+
const h = n.left;
|
|
457
|
+
if (f(h))
|
|
458
|
+
m = h;
|
|
455
459
|
else {
|
|
456
|
-
const
|
|
457
|
-
|
|
460
|
+
const p = (n.left + n.right) / 2 - be / 2;
|
|
461
|
+
f(p) ? m = p : c < s ? m = s : m = l - be - s;
|
|
458
462
|
}
|
|
459
463
|
}
|
|
460
|
-
let
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
+
let y;
|
|
465
|
+
const N = o.bottom + r;
|
|
466
|
+
if (u(N))
|
|
467
|
+
y = N;
|
|
464
468
|
else {
|
|
465
|
-
const
|
|
466
|
-
|
|
469
|
+
const h = n.top - Ne - r;
|
|
470
|
+
u(h) ? y = h : N + Ne > a - s ? y = a - Ne - s : y = s;
|
|
467
471
|
}
|
|
468
|
-
return { top:
|
|
469
|
-
},
|
|
472
|
+
return { top: y, left: m };
|
|
473
|
+
}, Wt = (t, e) => {
|
|
470
474
|
for (const n of e)
|
|
471
475
|
if (t.start < n.end && t.end > n.start)
|
|
472
476
|
return !0;
|
|
473
477
|
return !1;
|
|
474
|
-
},
|
|
478
|
+
}, Fe = (t) => `highlight-wrapper-${t}`, Ie = (t) => `${Fe(t)}-start`, nt = (t) => `${Fe(t)}-end`, he = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, zt = "2px", qt = "3px", Kt = "1px", ot = "3px", Xt = "1px", rt = "Notebook note", Me = (t, e) => {
|
|
475
479
|
const n = Number.parseInt(t.slice(1, 3), 16), o = Number.parseInt(t.slice(3, 5), 16), r = Number.parseInt(t.slice(5, 7), 16);
|
|
476
480
|
return `rgba(${n}, ${o}, ${r}, ${e})`;
|
|
477
481
|
}, st = (t, e, n, o, r) => {
|
|
478
|
-
t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${
|
|
479
|
-
},
|
|
482
|
+
t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${Kt} ${r} ${o}`, t.style.outlineOffset = Xt, t.style.borderRadius = ot, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
|
|
483
|
+
}, Vt = /* @__PURE__ */ new Set([
|
|
480
484
|
"AREA",
|
|
481
485
|
"BASE",
|
|
482
486
|
"BR",
|
|
@@ -495,11 +499,11 @@ const et = (t) => {
|
|
|
495
499
|
const n = t.cloneRange();
|
|
496
500
|
n.collapse(e);
|
|
497
501
|
const o = n.startContainer;
|
|
498
|
-
if (!(o.nodeType === Node.ELEMENT_NODE &&
|
|
502
|
+
if (!(o.nodeType === Node.ELEMENT_NODE && Vt.has(o.tagName)) || !o.parentNode)
|
|
499
503
|
return n;
|
|
500
504
|
const s = o.parentNode, l = Array.from(s.childNodes).indexOf(o), a = document.createRange();
|
|
501
505
|
return a.setStart(s, l), a.collapse(!0), a;
|
|
502
|
-
},
|
|
506
|
+
}, Qt = (t, e) => {
|
|
503
507
|
var n;
|
|
504
508
|
try {
|
|
505
509
|
const o = ((n = e.nodeValue) == null ? void 0 : n.length) ?? e.childNodes.length;
|
|
@@ -507,7 +511,7 @@ const et = (t) => {
|
|
|
507
511
|
} catch {
|
|
508
512
|
return !1;
|
|
509
513
|
}
|
|
510
|
-
},
|
|
514
|
+
}, Yt = (t) => {
|
|
511
515
|
var s;
|
|
512
516
|
if (t.collapsed)
|
|
513
517
|
return [];
|
|
@@ -517,7 +521,7 @@ const et = (t) => {
|
|
|
517
521
|
const n = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
|
|
518
522
|
let r = (o == null ? void 0 : o.nextNode()) || null;
|
|
519
523
|
for (; r; ) {
|
|
520
|
-
if (!
|
|
524
|
+
if (!Qt(t, r)) {
|
|
521
525
|
r = (o == null ? void 0 : o.nextNode()) || null;
|
|
522
526
|
continue;
|
|
523
527
|
}
|
|
@@ -529,106 +533,106 @@ const et = (t) => {
|
|
|
529
533
|
l === t.endContainer && t.endOffset < l.data.length && l.splitText(t.endOffset), n.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
|
|
530
534
|
}
|
|
531
535
|
return n;
|
|
532
|
-
},
|
|
536
|
+
}, Zt = (t, e, n) => {
|
|
533
537
|
if (t.collapsed) return;
|
|
534
|
-
const o = e.id ?? "", r =
|
|
535
|
-
if (document.getElementById(
|
|
536
|
-
|
|
538
|
+
const o = e.id ?? "", r = Fe(o);
|
|
539
|
+
if (document.getElementById(Ie(o))) {
|
|
540
|
+
Jt(e, n);
|
|
537
541
|
return;
|
|
538
542
|
}
|
|
539
|
-
const l = e.type ===
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
var
|
|
550
|
-
const
|
|
551
|
-
if ((
|
|
552
|
-
const D =
|
|
543
|
+
const l = e.type === L.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, f = a ? l : Me(l, 0.5), u = e.type === L.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, m = e.type === L.IMPORTANT ? "solid" : "dashed", c = document.createElement("span");
|
|
544
|
+
c.id = `${r}-start`, c.className = "highlight-marker-start", c.dataset.highlightId = o || "";
|
|
545
|
+
const y = e.labelPrefix ?? rt;
|
|
546
|
+
c.setAttribute("role", "button"), c.setAttribute("tabindex", "0"), c.setAttribute("aria-label", y), c.setAttribute("aria-haspopup", "dialog"), c.setAttribute("aria-expanded", String(a && !!e.isTrayOpen)), a && c.setAttribute("aria-current", "true"), e.popupId && c.setAttribute("aria-controls", e.popupId), c.style.position = "relative", c.style.fontSize = "0", c.style.lineHeight = "0", c.style.width = "0", c.style.height = "0", c.style.margin = "0", c.style.padding = "0", c.style.border = "0", c.style.outline = "none";
|
|
547
|
+
const N = document.createElement("span");
|
|
548
|
+
N.id = nt(o), N.className = "highlight-marker-end", N.dataset.highlightId = o || "", qe(t, !1).insertNode(N), qe(t, !0).insertNode(c);
|
|
549
|
+
const p = document.createRange();
|
|
550
|
+
p.setStartAfter(c), p.setEndBefore(N);
|
|
551
|
+
const z = Yt(p).filter((b) => b.textContent && b.textContent.length > 0);
|
|
552
|
+
z.forEach((b, S) => {
|
|
553
|
+
var j;
|
|
554
|
+
const P = b.parentElement;
|
|
555
|
+
if ((P == null ? void 0 : P.dataset.highlightId) === o) return;
|
|
556
|
+
const D = S === 0, G = S === z.length - 1, E = z.length === 1;
|
|
553
557
|
let w;
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
}), (
|
|
560
|
-
}),
|
|
561
|
-
var
|
|
562
|
-
|
|
563
|
-
}),
|
|
564
|
-
var
|
|
565
|
-
if (
|
|
566
|
-
|
|
567
|
-
else if (
|
|
568
|
-
const
|
|
569
|
-
for (const D of
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
|
|
558
|
+
E ? w = "single" : D ? w = "first" : G ? w = "last" : w = "middle";
|
|
559
|
+
const v = document.createElement("span");
|
|
560
|
+
v.className = "highlight-content", v.dataset.highlightId = o || "", v.dataset.position = w, v.style.textDecorationLine = "underline", v.style.textDecorationThickness = n.borderWidthSmall, v.style.textUnderlineOffset = n.underlineOffset, v.style.cursor = "pointer", st(v, a, f, u, m), v.addEventListener("click", (ee) => {
|
|
561
|
+
var Q;
|
|
562
|
+
ee.target.tagName !== "A" && ((Q = e.onClick) == null || Q.call(e));
|
|
563
|
+
}), (j = b.parentNode) == null || j.insertBefore(v, b), v.appendChild(b);
|
|
564
|
+
}), c.addEventListener("click", (b) => {
|
|
565
|
+
var S;
|
|
566
|
+
b.target.tagName !== "A" && ((S = e.onClick) == null || S.call(e));
|
|
567
|
+
}), c.addEventListener("keydown", (b) => {
|
|
568
|
+
var S;
|
|
569
|
+
if (b.key === "Enter" || b.key === " ")
|
|
570
|
+
b.preventDefault(), (S = e.onClick) == null || S.call(e);
|
|
571
|
+
else if (b.key === "Tab" && !b.shiftKey) {
|
|
572
|
+
const P = document.querySelectorAll(he(o));
|
|
573
|
+
for (const D of P) {
|
|
574
|
+
const G = D.querySelector("a");
|
|
575
|
+
if (G) {
|
|
576
|
+
b.preventDefault(), G.focus();
|
|
573
577
|
break;
|
|
574
578
|
}
|
|
575
579
|
}
|
|
576
580
|
}
|
|
577
|
-
}),
|
|
581
|
+
}), c.addEventListener("focus", () => {
|
|
578
582
|
document.querySelectorAll(
|
|
579
|
-
`.highlight-content${
|
|
580
|
-
).forEach((
|
|
581
|
-
|
|
583
|
+
`.highlight-content${he(o)}`
|
|
584
|
+
).forEach((S) => {
|
|
585
|
+
S.style.boxShadow = `0 0 0 ${zt} ${n.colors.focusOutline}`, S.style.borderRadius = qt;
|
|
582
586
|
});
|
|
583
|
-
}),
|
|
587
|
+
}), c.addEventListener("blur", () => {
|
|
584
588
|
document.querySelectorAll(
|
|
585
|
-
`.highlight-content${
|
|
586
|
-
).forEach((
|
|
587
|
-
|
|
589
|
+
`.highlight-content${he(o)}`
|
|
590
|
+
).forEach((S) => {
|
|
591
|
+
S.style.boxShadow = "", S.style.borderRadius = S.dataset.selected ? ot : "";
|
|
588
592
|
});
|
|
589
593
|
});
|
|
590
594
|
};
|
|
591
|
-
function
|
|
592
|
-
const n = t.type ===
|
|
595
|
+
function Jt(t, e) {
|
|
596
|
+
const n = t.type === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Me(n, 0.5), s = t.type === L.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === L.IMPORTANT ? "solid" : "dashed";
|
|
593
597
|
document.querySelectorAll(
|
|
594
|
-
`.highlight-content${
|
|
595
|
-
).forEach((
|
|
596
|
-
st(
|
|
598
|
+
`.highlight-content${he(t.id ?? "")}`
|
|
599
|
+
).forEach((u) => {
|
|
600
|
+
st(u, o, r, s, l);
|
|
597
601
|
});
|
|
598
|
-
const
|
|
599
|
-
|
|
602
|
+
const f = document.getElementById(
|
|
603
|
+
Ie(t.id ?? "")
|
|
600
604
|
);
|
|
601
|
-
|
|
605
|
+
f && (f.setAttribute("aria-label", t.labelPrefix ?? rt), f.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? f.setAttribute("aria-current", "true") : f.removeAttribute("aria-current"));
|
|
602
606
|
}
|
|
603
|
-
const
|
|
604
|
-
const e = t.id ?? "", n = document.getElementById(
|
|
607
|
+
const en = (t) => {
|
|
608
|
+
const e = t.id ?? "", n = document.getElementById(Ie(e)), o = document.getElementById(nt(e));
|
|
605
609
|
document.querySelectorAll(
|
|
606
|
-
|
|
610
|
+
he(e)
|
|
607
611
|
).forEach((s) => {
|
|
608
612
|
var l;
|
|
609
613
|
for (; s.firstChild; )
|
|
610
614
|
(l = s.parentNode) == null || l.insertBefore(s.firstChild, s);
|
|
611
615
|
s.remove();
|
|
612
616
|
}), n == null || n.remove(), o == null || o.remove();
|
|
613
|
-
},
|
|
617
|
+
}, me = {
|
|
614
618
|
all: ["notebook"],
|
|
615
619
|
notes: (t) => ["notebook", "notes", t]
|
|
616
620
|
};
|
|
617
|
-
function
|
|
621
|
+
function tn(t) {
|
|
618
622
|
const e = ke();
|
|
619
|
-
return
|
|
623
|
+
return Le({
|
|
620
624
|
mutationFn: (n) => t.createNote(n),
|
|
621
625
|
onSuccess: () => {
|
|
622
|
-
e.invalidateQueries({ queryKey:
|
|
626
|
+
e.invalidateQueries({ queryKey: me.all });
|
|
623
627
|
}
|
|
624
628
|
});
|
|
625
629
|
}
|
|
626
|
-
function
|
|
630
|
+
function nn(t) {
|
|
627
631
|
const e = ke();
|
|
628
|
-
return
|
|
632
|
+
return Le({
|
|
629
633
|
mutationFn: (n) => t.deleteNote(n),
|
|
630
634
|
onSuccess: () => {
|
|
631
|
-
e.invalidateQueries({ queryKey:
|
|
635
|
+
e.invalidateQueries({ queryKey: me.all });
|
|
632
636
|
}
|
|
633
637
|
});
|
|
634
638
|
}
|
|
@@ -637,13 +641,13 @@ function it({
|
|
|
637
641
|
enabled: e = !0,
|
|
638
642
|
...n
|
|
639
643
|
}) {
|
|
640
|
-
return
|
|
641
|
-
queryKey:
|
|
644
|
+
return Nt({
|
|
645
|
+
queryKey: me.notes(n),
|
|
642
646
|
queryFn: () => t.getNotes(n),
|
|
643
647
|
enabled: e
|
|
644
648
|
});
|
|
645
649
|
}
|
|
646
|
-
const
|
|
650
|
+
const on = 100;
|
|
647
651
|
function lt({
|
|
648
652
|
api: t,
|
|
649
653
|
courseId: e,
|
|
@@ -659,23 +663,23 @@ function lt({
|
|
|
659
663
|
...o != null && o.length ? { reactions: o } : {}
|
|
660
664
|
},
|
|
661
665
|
offset: 0,
|
|
662
|
-
pageSize:
|
|
666
|
+
pageSize: on,
|
|
663
667
|
enabled: r
|
|
664
668
|
});
|
|
665
669
|
}
|
|
666
|
-
function
|
|
670
|
+
function rn(t) {
|
|
667
671
|
const e = ke();
|
|
668
|
-
return
|
|
672
|
+
return Le({
|
|
669
673
|
mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
|
|
670
674
|
onMutate: async ({ id: n, input: o }) => {
|
|
671
|
-
await e.cancelQueries({ queryKey:
|
|
672
|
-
const s = e.getQueryCache().findAll({ queryKey:
|
|
675
|
+
await e.cancelQueries({ queryKey: me.all });
|
|
676
|
+
const s = e.getQueryCache().findAll({ queryKey: me.all }), l = /* @__PURE__ */ new Map();
|
|
673
677
|
for (const a of s) {
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
...
|
|
677
|
-
notes:
|
|
678
|
-
(
|
|
678
|
+
const f = a.state.data;
|
|
679
|
+
f && (l.set(a.queryKey, f), e.setQueryData(a.queryKey, {
|
|
680
|
+
...f,
|
|
681
|
+
notes: f.notes.map(
|
|
682
|
+
(u) => u.id === n ? { ...u, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : u
|
|
679
683
|
)
|
|
680
684
|
}));
|
|
681
685
|
}
|
|
@@ -687,61 +691,63 @@ function on(t) {
|
|
|
687
691
|
e.setQueryData(s, l);
|
|
688
692
|
},
|
|
689
693
|
onSettled: () => {
|
|
690
|
-
e.invalidateQueries({ queryKey:
|
|
694
|
+
e.invalidateQueries({ queryKey: me.all });
|
|
691
695
|
}
|
|
692
696
|
});
|
|
693
697
|
}
|
|
694
|
-
const
|
|
695
|
-
notebook:
|
|
696
|
-
notes:
|
|
697
|
-
important:
|
|
698
|
-
unclear:
|
|
699
|
-
back:
|
|
700
|
-
editNote:
|
|
701
|
-
save:
|
|
702
|
-
cancel:
|
|
703
|
-
deleteNote:
|
|
704
|
-
deleteNoteConfirmation:
|
|
705
|
-
note:
|
|
706
|
-
addNotePrompt:
|
|
707
|
-
removeFromNotebook:
|
|
708
|
-
addNoteOptional:
|
|
698
|
+
const sn = "Notebook", ln = "Notes", an = "Important", cn = "Unclear", dn = "Back", un = "Edit note", fn = "Save", mn = "Cancel", gn = "Delete note", hn = "Delete note confirmation", pn = "note", yn = "Add note (optional)", Nn = "Remove from Notebook", bn = "Add a note (optional)", En = "Mark important", Tn = "Mark unclear", Sn = "Saved to Notebook.", vn = "Note updated", Cn = "Note deleted", In = "Error saving to Notebook.", xn = "Error updating note", Rn = "Note deletion failed", On = "Loading notes", wn = "Failed to load notes", kn = "Start capturing your notes", Ln = "To use the Notebook feature, select text on a page to mark it as Important or Unclear, and add an optional note.", An = "Only you can see your Notebook. Instructors and classmates don't see your notes.", Dn = "Nothing here yet", Pn = "Adjust your filters or create a new note to get started.", _n = "You have no notes for the selected filter", Fn = "Filter", Mn = "Previous page", Bn = "Next page", Un = "All courses", Hn = "All notes", $n = "Close Notebook panel", Gn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", jn = "The content you highlighted is no longer available.", Wn = "This source is no longer available.", zn = "Notebook note", Be = {
|
|
699
|
+
notebook: sn,
|
|
700
|
+
notes: ln,
|
|
701
|
+
important: an,
|
|
702
|
+
unclear: cn,
|
|
703
|
+
back: dn,
|
|
704
|
+
editNote: un,
|
|
705
|
+
save: fn,
|
|
706
|
+
cancel: mn,
|
|
707
|
+
deleteNote: gn,
|
|
708
|
+
deleteNoteConfirmation: hn,
|
|
709
|
+
note: pn,
|
|
710
|
+
addNotePrompt: yn,
|
|
711
|
+
removeFromNotebook: Nn,
|
|
712
|
+
addNoteOptional: bn,
|
|
709
713
|
markImportant: En,
|
|
710
|
-
markUnclear:
|
|
711
|
-
savedToNotebook:
|
|
712
|
-
noteUpdated:
|
|
714
|
+
markUnclear: Tn,
|
|
715
|
+
savedToNotebook: Sn,
|
|
716
|
+
noteUpdated: vn,
|
|
713
717
|
noteDeleted: Cn,
|
|
714
|
-
errorSavingNote:
|
|
715
|
-
errorUpdatingNote:
|
|
716
|
-
noteDeletionFailed:
|
|
717
|
-
loadingNotes:
|
|
718
|
+
errorSavingNote: In,
|
|
719
|
+
errorUpdatingNote: xn,
|
|
720
|
+
noteDeletionFailed: Rn,
|
|
721
|
+
loadingNotes: On,
|
|
718
722
|
failedToLoadNotes: wn,
|
|
719
723
|
emptyStateHeading: kn,
|
|
720
|
-
emptyStateDescription:
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
724
|
+
emptyStateDescription: Ln,
|
|
725
|
+
emptyStatePrecision: An,
|
|
726
|
+
nothingHereYet: Dn,
|
|
727
|
+
adjustFiltersOrCreate: Pn,
|
|
728
|
+
noNotesForFilter: _n,
|
|
729
|
+
filter: Fn,
|
|
730
|
+
previousPage: Mn,
|
|
731
|
+
nextPage: Bn,
|
|
732
|
+
allCourses: Un,
|
|
733
|
+
allNotes: Hn,
|
|
729
734
|
closeNotebookPanel: $n,
|
|
730
|
-
featureDescription:
|
|
731
|
-
highlightUnavailable:
|
|
732
|
-
|
|
735
|
+
featureDescription: Gn,
|
|
736
|
+
highlightUnavailable: jn,
|
|
737
|
+
highlightSourceUnavailable: Wn,
|
|
738
|
+
notebookNote: zn
|
|
733
739
|
}, at = Ve(null);
|
|
734
740
|
function ct(t, e) {
|
|
735
|
-
const n =
|
|
741
|
+
const n = Be[t] ?? t;
|
|
736
742
|
return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
|
|
737
743
|
}
|
|
738
|
-
function
|
|
744
|
+
function qn({
|
|
739
745
|
translations: t,
|
|
740
746
|
translate: e,
|
|
741
747
|
children: n
|
|
742
748
|
}) {
|
|
743
|
-
const o =
|
|
744
|
-
translations: new Proxy(
|
|
749
|
+
const o = pe(() => ({
|
|
750
|
+
translations: new Proxy(Be, {
|
|
745
751
|
get(s, l) {
|
|
746
752
|
return (t == null ? void 0 : t[l]) ?? s[l];
|
|
747
753
|
}
|
|
@@ -750,16 +756,16 @@ function jn({
|
|
|
750
756
|
}), [t, e]);
|
|
751
757
|
return /* @__PURE__ */ i(at.Provider, { value: o, children: n });
|
|
752
758
|
}
|
|
753
|
-
function
|
|
759
|
+
function J() {
|
|
754
760
|
const t = Qe(at);
|
|
755
|
-
return t || { translations:
|
|
761
|
+
return t || { translations: Be, translate: ct };
|
|
756
762
|
}
|
|
757
|
-
const
|
|
763
|
+
const Kn = (t) => ({
|
|
758
764
|
selectedNoteId: t ?? null,
|
|
759
765
|
isNoteEditing: !1,
|
|
760
766
|
isTrayOpen: t != null
|
|
761
767
|
});
|
|
762
|
-
function
|
|
768
|
+
function Xn(t, e) {
|
|
763
769
|
switch (e.type) {
|
|
764
770
|
case "SELECT_NOTE":
|
|
765
771
|
return {
|
|
@@ -780,7 +786,7 @@ function zn(t, e) {
|
|
|
780
786
|
}
|
|
781
787
|
}
|
|
782
788
|
const dt = Ve(null);
|
|
783
|
-
function
|
|
789
|
+
function Ro({
|
|
784
790
|
api: t,
|
|
785
791
|
currentUserId: e,
|
|
786
792
|
objectId: n,
|
|
@@ -789,11 +795,11 @@ function Co({
|
|
|
789
795
|
pageLastModifiedAt: s,
|
|
790
796
|
onOpen: l,
|
|
791
797
|
initialNoteId: a,
|
|
792
|
-
translations:
|
|
793
|
-
translate:
|
|
794
|
-
children:
|
|
798
|
+
translations: f,
|
|
799
|
+
translate: u,
|
|
800
|
+
children: m
|
|
795
801
|
}) {
|
|
796
|
-
const [
|
|
802
|
+
const [c, y] = Ye(Xn, Kn(a)), N = F(a != null), h = pe(
|
|
797
803
|
() => ({
|
|
798
804
|
api: t,
|
|
799
805
|
currentUserId: e,
|
|
@@ -801,20 +807,20 @@ function Co({
|
|
|
801
807
|
objectType: o,
|
|
802
808
|
courseId: r,
|
|
803
809
|
pageLastModifiedAt: s,
|
|
804
|
-
...
|
|
805
|
-
selectNote: (
|
|
806
|
-
clearSelectedNote: () =>
|
|
807
|
-
setEditing: (
|
|
810
|
+
...c,
|
|
811
|
+
selectNote: (x, p = !1) => y({ type: "SELECT_NOTE", payload: { id: x, isEditing: p } }),
|
|
812
|
+
clearSelectedNote: () => y({ type: "CLEAR_SELECTED_NOTE" }),
|
|
813
|
+
setEditing: (x) => y({ type: "SET_EDITING", payload: x }),
|
|
808
814
|
openTray: () => {
|
|
809
|
-
|
|
815
|
+
N.current || (N.current = !0, l == null || l()), y({ type: "OPEN_TRAY" });
|
|
810
816
|
},
|
|
811
817
|
closeTray: () => {
|
|
812
|
-
|
|
818
|
+
N.current = !1, y({ type: "CLOSE_TRAY" });
|
|
813
819
|
}
|
|
814
820
|
}),
|
|
815
|
-
[t, e, n, o, r, s, l,
|
|
821
|
+
[t, e, n, o, r, s, l, c]
|
|
816
822
|
);
|
|
817
|
-
return /* @__PURE__ */ i(dt.Provider, { value:
|
|
823
|
+
return /* @__PURE__ */ i(dt.Provider, { value: h, children: /* @__PURE__ */ i(qn, { translations: f, translate: u, children: m }) });
|
|
818
824
|
}
|
|
819
825
|
function ut() {
|
|
820
826
|
const t = Qe(dt);
|
|
@@ -822,8 +828,8 @@ function ut() {
|
|
|
822
828
|
throw new Error("useNotebook must be used within a NotebookProvider");
|
|
823
829
|
return t;
|
|
824
830
|
}
|
|
825
|
-
const ft = "notebook-tray-content",
|
|
826
|
-
const { isTrayOpen: e, closeTray: n } = ut(), { translations: o } =
|
|
831
|
+
const ft = "notebook-tray-content", Oo = ({ children: t }) => {
|
|
832
|
+
const { isTrayOpen: e, closeTray: n } = ut(), { translations: o } = J();
|
|
827
833
|
return /* @__PURE__ */ i(
|
|
828
834
|
Et,
|
|
829
835
|
{
|
|
@@ -832,11 +838,11 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
|
|
|
832
838
|
onDismiss: n,
|
|
833
839
|
placement: "end",
|
|
834
840
|
size: "regular",
|
|
835
|
-
children: /* @__PURE__ */ T(
|
|
836
|
-
/* @__PURE__ */ i(
|
|
837
|
-
/* @__PURE__ */ i(
|
|
841
|
+
children: /* @__PURE__ */ T(I, { direction: "column", height: "100vh", id: ft, children: [
|
|
842
|
+
/* @__PURE__ */ i(I.Item, { children: /* @__PURE__ */ i(V, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ T(I, { justifyItems: "space-between", alignItems: "center", children: [
|
|
843
|
+
/* @__PURE__ */ i(ve, { level: "h3", children: o.notebook }),
|
|
838
844
|
/* @__PURE__ */ i(
|
|
839
|
-
|
|
845
|
+
bt,
|
|
840
846
|
{
|
|
841
847
|
screenReaderLabel: o.closeNotebookPanel,
|
|
842
848
|
onClick: n,
|
|
@@ -845,18 +851,18 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
|
|
|
845
851
|
}
|
|
846
852
|
)
|
|
847
853
|
] }) }) }),
|
|
848
|
-
/* @__PURE__ */ i(
|
|
854
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
|
|
849
855
|
] })
|
|
850
856
|
}
|
|
851
857
|
);
|
|
852
|
-
},
|
|
858
|
+
}, Vn = ({
|
|
853
859
|
currentType: t,
|
|
854
860
|
disabled: e = !1,
|
|
855
861
|
onSelectReaction: n
|
|
856
862
|
}) => {
|
|
857
|
-
const { translations: o } =
|
|
858
|
-
return
|
|
859
|
-
t ===
|
|
863
|
+
const { translations: o } = J(), r = F(null), s = F(null);
|
|
864
|
+
return q(() => {
|
|
865
|
+
t === L.CONFUSING && r.current ? r.current.focus() : t === L.IMPORTANT && s.current ? s.current.focus() : r.current && r.current.focus();
|
|
860
866
|
}, [t]), /* @__PURE__ */ i(
|
|
861
867
|
V,
|
|
862
868
|
{
|
|
@@ -866,27 +872,27 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
|
|
|
866
872
|
borderColor: "secondary",
|
|
867
873
|
borderRadius: "medium",
|
|
868
874
|
shadow: "resting",
|
|
869
|
-
children: /* @__PURE__ */ T(
|
|
875
|
+
children: /* @__PURE__ */ T(fe, { children: [
|
|
870
876
|
/* @__PURE__ */ T(
|
|
871
|
-
|
|
877
|
+
fe.Item,
|
|
872
878
|
{
|
|
873
879
|
ref: r,
|
|
874
880
|
disabled: e,
|
|
875
|
-
onClick: () => n(
|
|
881
|
+
onClick: () => n(L.CONFUSING),
|
|
876
882
|
children: [
|
|
877
|
-
/* @__PURE__ */ i(
|
|
883
|
+
/* @__PURE__ */ i(Ae, { size: "x-small" }),
|
|
878
884
|
` ${o.markUnclear}`
|
|
879
885
|
]
|
|
880
886
|
}
|
|
881
887
|
),
|
|
882
888
|
/* @__PURE__ */ T(
|
|
883
|
-
|
|
889
|
+
fe.Item,
|
|
884
890
|
{
|
|
885
891
|
ref: s,
|
|
886
892
|
disabled: e,
|
|
887
|
-
onClick: () => n(
|
|
893
|
+
onClick: () => n(L.IMPORTANT),
|
|
888
894
|
children: [
|
|
889
|
-
/* @__PURE__ */ i(
|
|
895
|
+
/* @__PURE__ */ i(De, { size: "x-small" }),
|
|
890
896
|
` ${o.markImportant}`
|
|
891
897
|
]
|
|
892
898
|
}
|
|
@@ -894,8 +900,8 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
|
|
|
894
900
|
] })
|
|
895
901
|
}
|
|
896
902
|
);
|
|
897
|
-
},
|
|
898
|
-
function
|
|
903
|
+
}, xe = "notebook-inline-reaction-menu";
|
|
904
|
+
function wo({
|
|
899
905
|
containerRef: t,
|
|
900
906
|
highlightTheme: e,
|
|
901
907
|
debounceTime: n = 500,
|
|
@@ -906,202 +912,202 @@ function Io({
|
|
|
906
912
|
}) {
|
|
907
913
|
const {
|
|
908
914
|
api: a,
|
|
909
|
-
objectId:
|
|
910
|
-
objectType:
|
|
911
|
-
courseId:
|
|
912
|
-
pageLastModifiedAt:
|
|
913
|
-
selectedNoteId:
|
|
914
|
-
isTrayOpen:
|
|
915
|
-
selectNote:
|
|
916
|
-
openTray:
|
|
917
|
-
} = ut(), { translations:
|
|
915
|
+
objectId: f,
|
|
916
|
+
objectType: u,
|
|
917
|
+
courseId: m,
|
|
918
|
+
pageLastModifiedAt: c,
|
|
919
|
+
selectedNoteId: y,
|
|
920
|
+
isTrayOpen: N,
|
|
921
|
+
selectNote: h,
|
|
922
|
+
openTray: x
|
|
923
|
+
} = ut(), { translations: p } = J(), { data: R } = lt({
|
|
918
924
|
api: a,
|
|
919
|
-
courseId:
|
|
920
|
-
learningObject: { type:
|
|
921
|
-
}), { mutate:
|
|
922
|
-
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
if (!
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
|
|
925
|
+
courseId: m,
|
|
926
|
+
learningObject: { type: u, id: f }
|
|
927
|
+
}), { mutate: z, isPending: b } = tn(a), { mutateAsync: S } = rn(a), { mutate: P } = nn(a), D = F([]), [G, E] = W([]), [w, v] = W(null), [j, ee] = W(""), [Q, ae] = W(null), de = F(null);
|
|
928
|
+
de.current = Q;
|
|
929
|
+
const te = F(!1), [re, se] = W(!1);
|
|
930
|
+
q(() => {
|
|
931
|
+
const M = t.current;
|
|
932
|
+
if (!M) return;
|
|
933
|
+
const C = M.closest(".user_content") ?? M;
|
|
934
|
+
if (C.classList.contains("enhanced")) {
|
|
935
|
+
se(!0);
|
|
930
936
|
return;
|
|
931
937
|
}
|
|
932
|
-
const
|
|
933
|
-
for (const
|
|
934
|
-
if (
|
|
935
|
-
|
|
938
|
+
const _ = new MutationObserver((B) => {
|
|
939
|
+
for (const H of B)
|
|
940
|
+
if (H.type === "attributes" && H.attributeName === "class" && H.target.classList.contains("enhanced")) {
|
|
941
|
+
se(!0), _.disconnect();
|
|
936
942
|
return;
|
|
937
943
|
}
|
|
938
944
|
});
|
|
939
|
-
return
|
|
945
|
+
return _.observe(C, { attributes: !0, attributeFilter: ["class"] }), () => _.disconnect();
|
|
940
946
|
}, [t]);
|
|
941
|
-
const
|
|
942
|
-
|
|
947
|
+
const A = K(() => {
|
|
948
|
+
ae(null), v(null), ee("");
|
|
943
949
|
}, []);
|
|
944
|
-
|
|
945
|
-
if (!
|
|
946
|
-
let
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
var
|
|
950
|
-
const
|
|
951
|
-
if (!(
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
const
|
|
955
|
-
if (!
|
|
956
|
-
const
|
|
957
|
-
|
|
950
|
+
q(() => {
|
|
951
|
+
if (!re || !t.current) return;
|
|
952
|
+
let C = null;
|
|
953
|
+
const _ = () => {
|
|
954
|
+
C && clearTimeout(C), C = setTimeout(() => {
|
|
955
|
+
var Ue;
|
|
956
|
+
const O = window.getSelection(), U = t.current;
|
|
957
|
+
if (!(O != null && O.rangeCount) || !U) return;
|
|
958
|
+
const g = O.toString().trim();
|
|
959
|
+
if (g === "") return;
|
|
960
|
+
const $ = O.getRangeAt(0);
|
|
961
|
+
if (!U.contains($.commonAncestorContainer)) return;
|
|
962
|
+
const ie = (Ue = le.fromRange(U, $)) == null ? void 0 : Ue.toSelector();
|
|
963
|
+
ie && !Wt(ie, G) && (v($.cloneRange()), ee(g), ae(jt($)));
|
|
958
964
|
}, n);
|
|
959
|
-
},
|
|
960
|
-
if (!(
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
|
|
965
|
+
}, B = (O) => {
|
|
966
|
+
if (!(O.target instanceof Node)) return;
|
|
967
|
+
const U = document.getElementById(xe);
|
|
968
|
+
U != null && U.contains(O.target) ? (O.preventDefault(), O.stopImmediatePropagation()) : A();
|
|
969
|
+
}, H = () => {
|
|
970
|
+
A();
|
|
971
|
+
}, k = (O) => {
|
|
972
|
+
O.key === "Escape" && de.current !== null && (A(), O.stopImmediatePropagation());
|
|
967
973
|
};
|
|
968
|
-
return document.addEventListener("selectionchange",
|
|
969
|
-
|
|
974
|
+
return document.addEventListener("selectionchange", _), document.addEventListener("mousedown", B), document.addEventListener("touchstart", B), document.addEventListener("keydown", k), window.addEventListener("scroll", H, !0), () => {
|
|
975
|
+
C && clearTimeout(C), document.removeEventListener("selectionchange", _), document.removeEventListener("mousedown", B), document.removeEventListener("touchstart", B), document.removeEventListener("keydown", k), window.removeEventListener("scroll", H, !0);
|
|
970
976
|
};
|
|
971
|
-
}, [
|
|
977
|
+
}, [re, G, n, t, A]);
|
|
972
978
|
const Y = K(
|
|
973
|
-
(
|
|
974
|
-
var
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
977
|
-
const { highlightData:
|
|
978
|
-
if (
|
|
979
|
-
const
|
|
980
|
-
id:
|
|
981
|
-
selectedNoteId:
|
|
982
|
-
type:
|
|
983
|
-
isTrayOpen:
|
|
984
|
-
labelPrefix: `${
|
|
979
|
+
(M) => {
|
|
980
|
+
var U;
|
|
981
|
+
const C = t.current;
|
|
982
|
+
if (!C || !M.highlightData) return null;
|
|
983
|
+
const { highlightData: _, reaction: B, id: H } = M, { range: k } = _, O = k && ((U = ce.fromSelector(C, k)) == null ? void 0 : U.toRange());
|
|
984
|
+
if (O) {
|
|
985
|
+
const g = B[0] === L.IMPORTANT ? p.important : p.unclear, $ = {
|
|
986
|
+
id: H,
|
|
987
|
+
selectedNoteId: y,
|
|
988
|
+
type: B[0],
|
|
989
|
+
isTrayOpen: N,
|
|
990
|
+
labelPrefix: `${p.notebookNote} (${g})`,
|
|
985
991
|
popupId: ft,
|
|
986
992
|
onClick: () => {
|
|
987
|
-
|
|
993
|
+
h(H), x();
|
|
988
994
|
}
|
|
989
995
|
};
|
|
990
|
-
return
|
|
996
|
+
return Zt(O, $, e), _.textPosition;
|
|
991
997
|
}
|
|
992
998
|
return null;
|
|
993
999
|
},
|
|
994
|
-
[t,
|
|
1000
|
+
[t, y, N, e, p, h, x]
|
|
995
1001
|
);
|
|
996
|
-
|
|
997
|
-
if (!
|
|
998
|
-
const
|
|
999
|
-
if (
|
|
1002
|
+
q(() => {
|
|
1003
|
+
if (!re || !R || !t.current) return;
|
|
1004
|
+
const M = t.current, C = R.notes, _ = /* @__PURE__ */ new Set(), B = [], H = [];
|
|
1005
|
+
if (C.length === 0) {
|
|
1000
1006
|
if (D.current.length > 0) {
|
|
1001
|
-
for (const
|
|
1002
|
-
ze(
|
|
1003
|
-
D.current = [],
|
|
1007
|
+
for (const k of D.current)
|
|
1008
|
+
ze(k, M);
|
|
1009
|
+
D.current = [], E([]);
|
|
1004
1010
|
}
|
|
1005
1011
|
return;
|
|
1006
1012
|
}
|
|
1007
|
-
if (
|
|
1008
|
-
const { notesForUpdate:
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1013
|
+
if (c && C[0].highlightData.pageLastModifiedAt !== c) {
|
|
1014
|
+
const { notesForUpdate: k, noteIdsForDelete: O } = $t(
|
|
1015
|
+
M,
|
|
1016
|
+
C,
|
|
1017
|
+
c
|
|
1012
1018
|
);
|
|
1013
|
-
for (const
|
|
1014
|
-
|
|
1015
|
-
for (const
|
|
1016
|
-
|
|
1019
|
+
for (const U of k)
|
|
1020
|
+
S({ id: U.id, input: U }).catch((g) => r == null ? void 0 : r(g));
|
|
1021
|
+
for (const U of O)
|
|
1022
|
+
P(U, { onError: s });
|
|
1017
1023
|
} else {
|
|
1018
|
-
for (const
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1024
|
+
for (const k of C) {
|
|
1025
|
+
const O = Y(k);
|
|
1026
|
+
_.add(k.id), O && (B.push(k), H.push(O));
|
|
1021
1027
|
}
|
|
1022
|
-
for (const
|
|
1023
|
-
|
|
1024
|
-
|
|
1028
|
+
for (const k of D.current)
|
|
1029
|
+
_.has(k.id) || ze(k, M);
|
|
1030
|
+
E(H), D.current = B, y && Gt(y);
|
|
1025
1031
|
}
|
|
1026
1032
|
}, [
|
|
1027
|
-
|
|
1028
|
-
|
|
1033
|
+
re,
|
|
1034
|
+
R,
|
|
1029
1035
|
Y,
|
|
1030
|
-
|
|
1036
|
+
c,
|
|
1031
1037
|
t,
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1038
|
+
S,
|
|
1039
|
+
P,
|
|
1040
|
+
y
|
|
1035
1041
|
]);
|
|
1036
|
-
const
|
|
1037
|
-
const
|
|
1038
|
-
if (!w || !
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
+
const ue = (M) => {
|
|
1043
|
+
const C = t.current;
|
|
1044
|
+
if (!w || !C || te.current) return;
|
|
1045
|
+
te.current = !0;
|
|
1046
|
+
const _ = ce.fromRange(C, w), B = le.fromRange(C, w);
|
|
1047
|
+
z(
|
|
1042
1048
|
{
|
|
1043
|
-
courseId:
|
|
1044
|
-
objectId:
|
|
1045
|
-
objectType:
|
|
1049
|
+
courseId: m,
|
|
1050
|
+
objectId: f,
|
|
1051
|
+
objectType: u,
|
|
1046
1052
|
userText: "",
|
|
1047
|
-
reaction: [
|
|
1053
|
+
reaction: [M],
|
|
1048
1054
|
highlightData: {
|
|
1049
|
-
selectedText:
|
|
1050
|
-
textPosition: (
|
|
1051
|
-
range:
|
|
1052
|
-
pageLastModifiedAt:
|
|
1055
|
+
selectedText: j,
|
|
1056
|
+
textPosition: (B == null ? void 0 : B.toSelector()) ?? null,
|
|
1057
|
+
range: _.toSelector(),
|
|
1058
|
+
pageLastModifiedAt: c ?? ""
|
|
1053
1059
|
}
|
|
1054
1060
|
},
|
|
1055
1061
|
{
|
|
1056
|
-
onSuccess: (
|
|
1057
|
-
var
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1062
|
+
onSuccess: (H) => {
|
|
1063
|
+
var O;
|
|
1064
|
+
const k = H.id;
|
|
1065
|
+
A(), (O = window.getSelection()) == null || O.removeAllRanges(), h(k), x(), l == null || l(H);
|
|
1060
1066
|
},
|
|
1061
1067
|
onError: o,
|
|
1062
1068
|
// Unlock on failure too, so the user can retry from the still-open menu
|
|
1063
1069
|
onSettled: () => {
|
|
1064
|
-
|
|
1070
|
+
te.current = !1;
|
|
1065
1071
|
}
|
|
1066
1072
|
}
|
|
1067
1073
|
);
|
|
1068
1074
|
};
|
|
1069
|
-
return !w || !
|
|
1075
|
+
return !w || !Q ? null : pt(
|
|
1070
1076
|
/* @__PURE__ */ i(
|
|
1071
1077
|
"div",
|
|
1072
1078
|
{
|
|
1073
|
-
id:
|
|
1079
|
+
id: xe,
|
|
1074
1080
|
role: "toolbar",
|
|
1075
1081
|
style: {
|
|
1076
1082
|
position: "fixed",
|
|
1077
1083
|
zIndex: 100,
|
|
1078
|
-
top:
|
|
1079
|
-
left:
|
|
1084
|
+
top: Q.top,
|
|
1085
|
+
left: Q.left,
|
|
1080
1086
|
whiteSpace: "nowrap"
|
|
1081
1087
|
},
|
|
1082
|
-
onBlur: (
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1088
|
+
onBlur: (M) => {
|
|
1089
|
+
const C = document.getElementById(xe);
|
|
1090
|
+
C != null && C.contains(M.relatedTarget) || A();
|
|
1085
1091
|
},
|
|
1086
|
-
children: /* @__PURE__ */ i(
|
|
1092
|
+
children: /* @__PURE__ */ i(Vn, { onSelectReaction: ue, disabled: b })
|
|
1087
1093
|
}
|
|
1088
1094
|
),
|
|
1089
1095
|
document.body
|
|
1090
1096
|
);
|
|
1091
1097
|
}
|
|
1092
|
-
const
|
|
1093
|
-
backgroundColor: t ===
|
|
1094
|
-
underlineColor: t ===
|
|
1095
|
-
underlineStyle: t ===
|
|
1098
|
+
const Qn = (t, e) => ({
|
|
1099
|
+
backgroundColor: t === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
|
|
1100
|
+
underlineColor: t === L.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
|
|
1101
|
+
underlineStyle: t === L.IMPORTANT ? "solid" : "dashed"
|
|
1096
1102
|
}), we = ({
|
|
1097
1103
|
children: t,
|
|
1098
|
-
type: e =
|
|
1104
|
+
type: e = L.IMPORTANT,
|
|
1099
1105
|
isCardActive: n = !0,
|
|
1100
1106
|
theme: o
|
|
1101
1107
|
}) => {
|
|
1102
|
-
const r =
|
|
1108
|
+
const r = Qn(e, o), l = {
|
|
1103
1109
|
position: "relative",
|
|
1104
|
-
backgroundColor: n ? r.backgroundColor :
|
|
1110
|
+
backgroundColor: n ? r.backgroundColor : Me(r.backgroundColor, 0.5),
|
|
1105
1111
|
textDecorationLine: "underline",
|
|
1106
1112
|
textDecorationStyle: r.underlineStyle,
|
|
1107
1113
|
textDecorationColor: r.underlineColor,
|
|
@@ -1110,13 +1116,17 @@ const Kn = (t, e) => ({
|
|
|
1110
1116
|
lineHeight: "normal"
|
|
1111
1117
|
};
|
|
1112
1118
|
return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: l, children: t });
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
return
|
|
1116
|
-
|
|
1117
|
-
|
|
1119
|
+
};
|
|
1120
|
+
function mt(t, e = "noHighlight") {
|
|
1121
|
+
return e === "sourceUnavailable" ? t.highlightSourceUnavailable : t.highlightUnavailable;
|
|
1122
|
+
}
|
|
1123
|
+
const gt = ({ reason: t } = {}) => {
|
|
1124
|
+
const { translations: e } = J();
|
|
1125
|
+
return /* @__PURE__ */ T(I, { gap: "xx-small", alignItems: "start", as: "div", children: [
|
|
1126
|
+
/* @__PURE__ */ i(I.Item, { as: "div", children: /* @__PURE__ */ i(Tt, { color: "error" }) }),
|
|
1127
|
+
/* @__PURE__ */ i(I.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(Te, { maxLines: 3, children: mt(e, t) }) })
|
|
1118
1128
|
] });
|
|
1119
|
-
},
|
|
1129
|
+
}, Yn = {
|
|
1120
1130
|
filter: null,
|
|
1121
1131
|
courseFilter: null,
|
|
1122
1132
|
currentPage: 1,
|
|
@@ -1126,7 +1136,7 @@ function Ee(t, e) {
|
|
|
1126
1136
|
const n = typeof e == "number" ? Math.min(e, t) : t;
|
|
1127
1137
|
return Math.max(1, n);
|
|
1128
1138
|
}
|
|
1129
|
-
function
|
|
1139
|
+
function Zn(t, e) {
|
|
1130
1140
|
switch (e.type) {
|
|
1131
1141
|
case "SET_FILTER":
|
|
1132
1142
|
return { ...t, filter: e.payload, currentPage: 1 };
|
|
@@ -1150,7 +1160,7 @@ function Vn(t, e) {
|
|
|
1150
1160
|
return t;
|
|
1151
1161
|
}
|
|
1152
1162
|
}
|
|
1153
|
-
function
|
|
1163
|
+
function ko({
|
|
1154
1164
|
api: t,
|
|
1155
1165
|
courseId: e,
|
|
1156
1166
|
enableCourseFilter: n = !1,
|
|
@@ -1158,109 +1168,109 @@ function xo({
|
|
|
1158
1168
|
pageSize: r = 16,
|
|
1159
1169
|
focusNoteId: s
|
|
1160
1170
|
}) {
|
|
1161
|
-
var
|
|
1162
|
-
const [l, a] = Ye(
|
|
1163
|
-
|
|
1171
|
+
var se;
|
|
1172
|
+
const [l, a] = Ye(Zn, Yn), { filter: f, courseFilter: u, currentPage: m, totalPages: c } = l;
|
|
1173
|
+
q(() => {
|
|
1164
1174
|
a({ type: "SET_PAGE", payload: 1 });
|
|
1165
1175
|
}, [r]);
|
|
1166
|
-
const
|
|
1167
|
-
...
|
|
1168
|
-
...
|
|
1176
|
+
const y = n ? u : e, N = (m - 1) * r, h = !!o, x = {
|
|
1177
|
+
...y ? { courseId: y } : {},
|
|
1178
|
+
...f ? { reactions: [f] } : {},
|
|
1169
1179
|
...o ? { learningObject: o } : {}
|
|
1170
1180
|
}, {
|
|
1171
|
-
data:
|
|
1172
|
-
isLoading:
|
|
1173
|
-
isError:
|
|
1181
|
+
data: p,
|
|
1182
|
+
isLoading: R,
|
|
1183
|
+
isError: z
|
|
1174
1184
|
} = it({
|
|
1175
1185
|
api: t,
|
|
1176
|
-
filter:
|
|
1177
|
-
offset:
|
|
1186
|
+
filter: x,
|
|
1187
|
+
offset: N,
|
|
1178
1188
|
pageSize: r,
|
|
1179
|
-
enabled: !
|
|
1189
|
+
enabled: !h
|
|
1180
1190
|
}), {
|
|
1181
|
-
data:
|
|
1182
|
-
isLoading:
|
|
1183
|
-
isError:
|
|
1191
|
+
data: b,
|
|
1192
|
+
isLoading: S,
|
|
1193
|
+
isError: P
|
|
1184
1194
|
} = lt({
|
|
1185
1195
|
api: t,
|
|
1186
|
-
courseId:
|
|
1196
|
+
courseId: y ?? void 0,
|
|
1187
1197
|
learningObject: o,
|
|
1188
|
-
enabled:
|
|
1189
|
-
}), D =
|
|
1190
|
-
const
|
|
1191
|
-
return
|
|
1192
|
-
}, [
|
|
1193
|
-
|
|
1198
|
+
enabled: h
|
|
1199
|
+
}), D = pe(() => {
|
|
1200
|
+
const A = (b == null ? void 0 : b.notes) ?? [];
|
|
1201
|
+
return f ? A.filter((Y) => Y.reaction.includes(f)) : A;
|
|
1202
|
+
}, [b, f]), G = F(null);
|
|
1203
|
+
q(() => {
|
|
1194
1204
|
if (!s) {
|
|
1195
|
-
|
|
1205
|
+
G.current = null;
|
|
1196
1206
|
return;
|
|
1197
1207
|
}
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1200
|
-
if (
|
|
1201
|
-
|
|
1202
|
-
const Y = Math.floor(
|
|
1203
|
-
Y !==
|
|
1204
|
-
}, [s, D, r,
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
a({ type: "SET_TOTAL_PAGES", payload:
|
|
1208
|
-
}, [
|
|
1209
|
-
const
|
|
1210
|
-
a({ type: "SET_PAGE", payload:
|
|
1211
|
-
}, []),
|
|
1208
|
+
if (G.current === s) return;
|
|
1209
|
+
const A = D.findIndex((ue) => ue.id === s);
|
|
1210
|
+
if (A === -1) return;
|
|
1211
|
+
G.current = s;
|
|
1212
|
+
const Y = Math.floor(A / r) + 1;
|
|
1213
|
+
Y !== m && a({ type: "FOCUS_PAGE", payload: Y });
|
|
1214
|
+
}, [s, D, r, m]);
|
|
1215
|
+
const E = h ? D.slice(N, N + r) : (p == null ? void 0 : p.notes) ?? [], w = h ? S : R, v = h ? P : z, j = h ? Math.max(1, Math.ceil(D.length / r)) : ((se = p == null ? void 0 : p.pageInfo) == null ? void 0 : se.totalNrOfPages) ?? void 0, ee = h ? { totalCount: D.length, totalNrOfPages: j } : p == null ? void 0 : p.pageInfo;
|
|
1216
|
+
q(() => {
|
|
1217
|
+
a({ type: "SET_TOTAL_PAGES", payload: j });
|
|
1218
|
+
}, [j]);
|
|
1219
|
+
const Q = K((A) => {
|
|
1220
|
+
a({ type: "SET_PAGE", payload: A });
|
|
1221
|
+
}, []), ae = K(() => {
|
|
1212
1222
|
a({
|
|
1213
1223
|
type: "INCREMENT_PAGE"
|
|
1214
1224
|
/* IncrementPage */
|
|
1215
1225
|
});
|
|
1216
|
-
}, []),
|
|
1226
|
+
}, []), de = K(() => {
|
|
1217
1227
|
a({
|
|
1218
1228
|
type: "DECREMENT_PAGE"
|
|
1219
1229
|
/* DecrementPage */
|
|
1220
1230
|
});
|
|
1221
|
-
}, []),
|
|
1222
|
-
a({ type: "SET_FILTER", payload:
|
|
1223
|
-
}, []),
|
|
1224
|
-
a({ type: "SET_COURSE_FILTER", payload:
|
|
1231
|
+
}, []), te = K((A) => {
|
|
1232
|
+
a({ type: "SET_FILTER", payload: A });
|
|
1233
|
+
}, []), re = K((A) => {
|
|
1234
|
+
a({ type: "SET_COURSE_FILTER", payload: A });
|
|
1225
1235
|
}, []);
|
|
1226
1236
|
return {
|
|
1227
|
-
notes:
|
|
1228
|
-
pageInfo:
|
|
1237
|
+
notes: E,
|
|
1238
|
+
pageInfo: ee,
|
|
1229
1239
|
isLoading: w,
|
|
1230
|
-
isError:
|
|
1231
|
-
filter:
|
|
1232
|
-
courseFilter:
|
|
1233
|
-
currentPage:
|
|
1234
|
-
totalPages:
|
|
1235
|
-
setFilter:
|
|
1236
|
-
setCourseFilter:
|
|
1237
|
-
setPage:
|
|
1238
|
-
fetchNextPage:
|
|
1239
|
-
fetchPreviousPage:
|
|
1240
|
+
isError: v,
|
|
1241
|
+
filter: f,
|
|
1242
|
+
courseFilter: u,
|
|
1243
|
+
currentPage: m,
|
|
1244
|
+
totalPages: c,
|
|
1245
|
+
setFilter: te,
|
|
1246
|
+
setCourseFilter: re,
|
|
1247
|
+
setPage: Q,
|
|
1248
|
+
fetchNextPage: ae,
|
|
1249
|
+
fetchPreviousPage: de
|
|
1240
1250
|
};
|
|
1241
1251
|
}
|
|
1242
|
-
const
|
|
1243
|
-
function
|
|
1244
|
-
const { translations: n } =
|
|
1252
|
+
const Re = "all";
|
|
1253
|
+
function Lo({ filter: t, setFilter: e }) {
|
|
1254
|
+
const { translations: n } = J(), o = pe(
|
|
1245
1255
|
() => [
|
|
1246
|
-
{ label: n.allNotes, value:
|
|
1247
|
-
{ label: n.important, value:
|
|
1248
|
-
{ label: n.unclear, value:
|
|
1256
|
+
{ label: n.allNotes, value: Re },
|
|
1257
|
+
{ label: n.important, value: L.IMPORTANT },
|
|
1258
|
+
{ label: n.unclear, value: L.CONFUSING }
|
|
1249
1259
|
],
|
|
1250
1260
|
[n]
|
|
1251
1261
|
), r = K(
|
|
1252
1262
|
(l, { value: a }) => {
|
|
1253
|
-
e(!a || a ===
|
|
1263
|
+
e(!a || a === Re ? null : a);
|
|
1254
1264
|
},
|
|
1255
1265
|
[e]
|
|
1256
1266
|
);
|
|
1257
1267
|
return {
|
|
1258
|
-
filterElement:
|
|
1268
|
+
filterElement: pe(
|
|
1259
1269
|
() => /* @__PURE__ */ i(
|
|
1260
1270
|
He,
|
|
1261
1271
|
{
|
|
1262
1272
|
renderLabel: n.filter,
|
|
1263
|
-
value: t ??
|
|
1273
|
+
value: t ?? Re,
|
|
1264
1274
|
onChange: r,
|
|
1265
1275
|
children: o.map((l) => /* @__PURE__ */ i(He.Option, { id: l.value, value: l.value, children: l.label }, l.value))
|
|
1266
1276
|
}
|
|
@@ -1271,73 +1281,85 @@ function Ro({ filter: t, setFilter: e }) {
|
|
|
1271
1281
|
handleReactionFilterChange: r
|
|
1272
1282
|
};
|
|
1273
1283
|
}
|
|
1274
|
-
const
|
|
1275
|
-
const { translations: e } =
|
|
1276
|
-
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(
|
|
1277
|
-
!t && /* @__PURE__ */ i(
|
|
1278
|
-
/* @__PURE__ */ i(
|
|
1279
|
-
/* @__PURE__ */ i(
|
|
1284
|
+
const Jn = ({ hasActiveFilter: t = !1 }) => {
|
|
1285
|
+
const { translations: e } = J(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
|
|
1286
|
+
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(I, { direction: "column", alignItems: "center", gap: "small", children: [
|
|
1287
|
+
!t && /* @__PURE__ */ i(St, { size: "medium" }),
|
|
1288
|
+
/* @__PURE__ */ i(ve, { level: "h3", children: n }),
|
|
1289
|
+
/* @__PURE__ */ i(Z, { color: "secondary", children: o }),
|
|
1290
|
+
!t && /* @__PURE__ */ i(Z, { color: "secondary", children: e.emptyStatePrecision })
|
|
1280
1291
|
] }) });
|
|
1281
|
-
},
|
|
1282
|
-
[
|
|
1292
|
+
}, eo = "#2871AF", to = (t) => ({
|
|
1293
|
+
[L.IMPORTANT]: {
|
|
1283
1294
|
color: "success",
|
|
1295
|
+
themeOverride: {
|
|
1296
|
+
successTextColor: t,
|
|
1297
|
+
successBorderColor: t
|
|
1298
|
+
},
|
|
1284
1299
|
translationKey: "important",
|
|
1285
|
-
icon: /* @__PURE__ */ i(
|
|
1300
|
+
icon: /* @__PURE__ */ i(De, { size: "x-small" })
|
|
1286
1301
|
},
|
|
1287
|
-
[
|
|
1302
|
+
[L.CONFUSING]: {
|
|
1288
1303
|
color: "error",
|
|
1304
|
+
themeOverride: void 0,
|
|
1289
1305
|
translationKey: "unclear",
|
|
1290
|
-
icon: /* @__PURE__ */ i(
|
|
1306
|
+
icon: /* @__PURE__ */ i(Ae, { size: "x-small" })
|
|
1291
1307
|
}
|
|
1292
|
-
},
|
|
1293
|
-
|
|
1308
|
+
}), ht = ({
|
|
1309
|
+
type: t,
|
|
1310
|
+
onTypeChange: e,
|
|
1311
|
+
renderAsMenuTrigger: n = !1,
|
|
1312
|
+
theme: o
|
|
1313
|
+
}) => {
|
|
1314
|
+
const { translations: r } = J(), l = to((o == null ? void 0 : o.importantPill) ?? eo)[t], a = r[l.translationKey], [f, u] = W(!1), m = F(null), c = F(null), y = F(null), N = K(
|
|
1294
1315
|
(h) => {
|
|
1295
|
-
e == null || e(h),
|
|
1316
|
+
e == null || e(h), u(!1);
|
|
1296
1317
|
},
|
|
1297
1318
|
[e]
|
|
1298
1319
|
);
|
|
1299
|
-
return
|
|
1300
|
-
if (!
|
|
1301
|
-
const h = (
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1304
|
-
var
|
|
1305
|
-
|
|
1320
|
+
return q(() => {
|
|
1321
|
+
if (!f) return;
|
|
1322
|
+
const h = (p) => {
|
|
1323
|
+
p.key === "Escape" && p.stopPropagation();
|
|
1324
|
+
}, x = (p) => {
|
|
1325
|
+
var R;
|
|
1326
|
+
p.key === "Escape" && (p.stopPropagation(), u(!1), (R = y.current) == null || R.focus());
|
|
1306
1327
|
};
|
|
1307
|
-
return document.addEventListener("keydown", h, !0), document.addEventListener("keyup",
|
|
1308
|
-
document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup",
|
|
1328
|
+
return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", x, !0), () => {
|
|
1329
|
+
document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", x, !0);
|
|
1309
1330
|
};
|
|
1310
|
-
}, [
|
|
1311
|
-
|
|
1331
|
+
}, [f]), n && e ? /* @__PURE__ */ T(
|
|
1332
|
+
fe,
|
|
1312
1333
|
{
|
|
1313
1334
|
placement: "bottom start",
|
|
1314
|
-
show:
|
|
1315
|
-
onToggle: (h) =>
|
|
1335
|
+
show: f,
|
|
1336
|
+
onToggle: (h) => u(h),
|
|
1316
1337
|
shouldHideOnSelect: !0,
|
|
1317
1338
|
shouldFocusTriggerOnClose: !0,
|
|
1318
1339
|
trigger: /* @__PURE__ */ i(
|
|
1319
|
-
|
|
1340
|
+
$e,
|
|
1320
1341
|
{
|
|
1321
|
-
color:
|
|
1322
|
-
|
|
1342
|
+
color: l.color,
|
|
1343
|
+
themeOverride: l.themeOverride,
|
|
1344
|
+
renderIcon: l.icon,
|
|
1323
1345
|
elementRef: (h) => {
|
|
1324
|
-
|
|
1346
|
+
y.current = h;
|
|
1325
1347
|
},
|
|
1326
|
-
children:
|
|
1348
|
+
children: a
|
|
1327
1349
|
}
|
|
1328
1350
|
),
|
|
1329
1351
|
children: [
|
|
1330
|
-
/* @__PURE__ */ T(
|
|
1331
|
-
/* @__PURE__ */ i(Le, { size: "x-small" }),
|
|
1332
|
-
` ${o.markUnclear}`
|
|
1333
|
-
] }),
|
|
1334
|
-
/* @__PURE__ */ T(ue.Item, { ref: c, onClick: () => d(k.IMPORTANT), children: [
|
|
1352
|
+
/* @__PURE__ */ T(fe.Item, { ref: m, onClick: () => N(L.CONFUSING), children: [
|
|
1335
1353
|
/* @__PURE__ */ i(Ae, { size: "x-small" }),
|
|
1336
|
-
` ${
|
|
1354
|
+
` ${r.markUnclear}`
|
|
1355
|
+
] }),
|
|
1356
|
+
/* @__PURE__ */ T(fe.Item, { ref: c, onClick: () => N(L.IMPORTANT), children: [
|
|
1357
|
+
/* @__PURE__ */ i(De, { size: "x-small" }),
|
|
1358
|
+
` ${r.markImportant}`
|
|
1337
1359
|
] })
|
|
1338
1360
|
]
|
|
1339
1361
|
}
|
|
1340
|
-
) : /* @__PURE__ */ i(V, { display: "inline-flex", children: /* @__PURE__ */ i(
|
|
1362
|
+
) : /* @__PURE__ */ i(V, { display: "inline-flex", children: /* @__PURE__ */ i($e, { color: l.color, themeOverride: l.themeOverride, renderIcon: l.icon, children: a }) });
|
|
1341
1363
|
};
|
|
1342
1364
|
function Ke(t, e) {
|
|
1343
1365
|
return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
|
|
@@ -1346,59 +1368,62 @@ function Ke(t, e) {
|
|
|
1346
1368
|
day: "numeric"
|
|
1347
1369
|
});
|
|
1348
1370
|
}
|
|
1349
|
-
const
|
|
1371
|
+
const no = ({
|
|
1350
1372
|
noteId: t,
|
|
1351
1373
|
date: e,
|
|
1352
1374
|
highlight: n,
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1375
|
+
highlightUnavailableReason: o,
|
|
1376
|
+
note: r,
|
|
1377
|
+
type: s,
|
|
1378
|
+
onClick: l,
|
|
1379
|
+
onDelete: a,
|
|
1380
|
+
onSaveNote: f,
|
|
1381
|
+
onTypeChange: u,
|
|
1382
|
+
isActive: m,
|
|
1383
|
+
isPanelView: c = !1,
|
|
1384
|
+
courseName: y,
|
|
1385
|
+
locale: N,
|
|
1386
|
+
highlightTheme: h,
|
|
1387
|
+
renderLink: x,
|
|
1388
|
+
href: p
|
|
1366
1389
|
}) => {
|
|
1367
|
-
const { translations:
|
|
1368
|
-
|
|
1369
|
-
}, []),
|
|
1370
|
-
|
|
1371
|
-
var
|
|
1372
|
-
|
|
1373
|
-
}, [
|
|
1374
|
-
var
|
|
1375
|
-
|
|
1376
|
-
}, [
|
|
1377
|
-
if (!
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1390
|
+
const { translations: R } = J(), [z, b] = W(!1), [S, P] = W(!1), [D, G] = W(r || ""), [E, w] = W(!1), [v, j] = W(!1), [ee, Q] = W(!1), [ae, de] = W(!1), te = F(null), re = K((g) => {
|
|
1391
|
+
te.current = g;
|
|
1392
|
+
}, []), se = F(null), A = F(null), Y = F(!1), ue = F(null), M = F(null), C = F(!1);
|
|
1393
|
+
q(() => {
|
|
1394
|
+
var g, $;
|
|
1395
|
+
m ? ((g = te.current) == null || g.scrollIntoView({ behavior: "smooth", block: "nearest" }), ($ = te.current) == null || $.focus()) : w(!1);
|
|
1396
|
+
}, [m]), q(() => {
|
|
1397
|
+
var g, $;
|
|
1398
|
+
S ? (Y.current = !0, (g = se.current) == null || g.focus()) : Y.current && (Y.current = !1, ($ = A.current) == null || $.focus());
|
|
1399
|
+
}, [S]), q(() => {
|
|
1400
|
+
if (!E && C.current) {
|
|
1401
|
+
C.current = !1;
|
|
1402
|
+
const g = ue.current;
|
|
1403
|
+
g != null && g.isConnected && g.focus();
|
|
1381
1404
|
}
|
|
1382
|
-
}, [
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1405
|
+
}, [E]);
|
|
1406
|
+
const _ = K((g, $) => {
|
|
1407
|
+
C.current = !$, w(!1);
|
|
1385
1408
|
}, []);
|
|
1386
|
-
|
|
1387
|
-
if (!
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
|
|
1409
|
+
q(() => {
|
|
1410
|
+
if (!E) return;
|
|
1411
|
+
const g = (ie) => {
|
|
1412
|
+
ie.key === "Escape" && ie.stopPropagation();
|
|
1413
|
+
}, $ = (ie) => {
|
|
1414
|
+
ie.key === "Escape" && (ie.stopPropagation(), _());
|
|
1392
1415
|
};
|
|
1393
|
-
return window.addEventListener("keydown",
|
|
1394
|
-
window.removeEventListener("keydown",
|
|
1416
|
+
return window.addEventListener("keydown", g, !0), window.addEventListener("keyup", $, !0), () => {
|
|
1417
|
+
window.removeEventListener("keydown", g, !0), window.removeEventListener("keyup", $, !0);
|
|
1395
1418
|
};
|
|
1396
|
-
}, [
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1401
|
-
|
|
1419
|
+
}, [E, _]);
|
|
1420
|
+
const B = s === L.IMPORTANT ? R.important : R.unclear, H = (g) => {
|
|
1421
|
+
g.key === "Enter" && (g.preventDefault(), l == null || l());
|
|
1422
|
+
}, k = [R.note, B];
|
|
1423
|
+
k.push(
|
|
1424
|
+
n || mt(R, o)
|
|
1425
|
+
), r && k.push(r), e && k.push(Ke(e, N)), y && k.push(y);
|
|
1426
|
+
const O = k.join(", "), U = /* @__PURE__ */ T(
|
|
1402
1427
|
V,
|
|
1403
1428
|
{
|
|
1404
1429
|
as: "div",
|
|
@@ -1407,17 +1432,17 @@ const Zn = ({
|
|
|
1407
1432
|
borderRadius: "medium",
|
|
1408
1433
|
padding: "small",
|
|
1409
1434
|
position: "relative",
|
|
1410
|
-
role:
|
|
1411
|
-
"aria-label":
|
|
1412
|
-
"aria-pressed":
|
|
1413
|
-
tabIndex:
|
|
1435
|
+
role: p ? void 0 : m || S ? "group" : "button",
|
|
1436
|
+
"aria-label": p ? void 0 : O,
|
|
1437
|
+
"aria-pressed": p || m || S ? void 0 : m,
|
|
1438
|
+
tabIndex: p || m ? -1 : 0,
|
|
1414
1439
|
"data-testid": `note-card-${t}`,
|
|
1415
|
-
elementRef:
|
|
1416
|
-
onClick:
|
|
1417
|
-
onMouseEnter: () =>
|
|
1418
|
-
onMouseLeave: () =>
|
|
1419
|
-
onKeyDown:
|
|
1420
|
-
cursor:
|
|
1440
|
+
elementRef: re,
|
|
1441
|
+
onClick: m ? void 0 : l,
|
|
1442
|
+
onMouseEnter: () => b(!0),
|
|
1443
|
+
onMouseLeave: () => b(!1),
|
|
1444
|
+
onKeyDown: m ? void 0 : H,
|
|
1445
|
+
cursor: S ? "default" : "pointer",
|
|
1421
1446
|
children: [
|
|
1422
1447
|
/* @__PURE__ */ i(
|
|
1423
1448
|
"div",
|
|
@@ -1425,15 +1450,16 @@ const Zn = ({
|
|
|
1425
1450
|
"data-testid": `note-card-${t}-content`,
|
|
1426
1451
|
style: {
|
|
1427
1452
|
height: "100%",
|
|
1428
|
-
opacity:
|
|
1453
|
+
opacity: m && E && a ? 0.25 : void 0
|
|
1429
1454
|
},
|
|
1430
|
-
children: /* @__PURE__ */ T(
|
|
1455
|
+
children: /* @__PURE__ */ T(I, { direction: "column", gap: "small", height: "100%", children: [
|
|
1431
1456
|
/* @__PURE__ */ i(
|
|
1432
|
-
|
|
1457
|
+
ht,
|
|
1433
1458
|
{
|
|
1434
|
-
type:
|
|
1435
|
-
onTypeChange:
|
|
1436
|
-
renderAsMenuTrigger:
|
|
1459
|
+
type: s,
|
|
1460
|
+
onTypeChange: c && u ? (g) => u(t, g) : void 0,
|
|
1461
|
+
renderAsMenuTrigger: c && !!u && !!m,
|
|
1462
|
+
theme: h.colors
|
|
1437
1463
|
}
|
|
1438
1464
|
),
|
|
1439
1465
|
n ? /* @__PURE__ */ i(
|
|
@@ -1444,56 +1470,56 @@ const Zn = ({
|
|
|
1444
1470
|
overflowWrap: "break-word",
|
|
1445
1471
|
whiteSpace: "pre-wrap"
|
|
1446
1472
|
},
|
|
1447
|
-
children: /* @__PURE__ */ i(
|
|
1473
|
+
children: /* @__PURE__ */ i(Z, { children: m && c ? /* @__PURE__ */ i(
|
|
1448
1474
|
we,
|
|
1449
1475
|
{
|
|
1450
|
-
type:
|
|
1451
|
-
isCardActive: !!
|
|
1452
|
-
theme:
|
|
1476
|
+
type: s,
|
|
1477
|
+
isCardActive: !!m || z,
|
|
1478
|
+
theme: h,
|
|
1453
1479
|
children: n
|
|
1454
1480
|
}
|
|
1455
1481
|
) : /* @__PURE__ */ T(Xe, { children: [
|
|
1456
|
-
|
|
1457
|
-
/* @__PURE__ */ i("span", { "aria-hidden":
|
|
1482
|
+
v && /* @__PURE__ */ i(ye, { children: n }),
|
|
1483
|
+
/* @__PURE__ */ i("span", { "aria-hidden": v, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", onUpdate: j, children: /* @__PURE__ */ i(
|
|
1458
1484
|
we,
|
|
1459
1485
|
{
|
|
1460
|
-
type:
|
|
1461
|
-
isCardActive: !!
|
|
1462
|
-
theme:
|
|
1486
|
+
type: s,
|
|
1487
|
+
isCardActive: !!m || z,
|
|
1488
|
+
theme: h,
|
|
1463
1489
|
children: n
|
|
1464
1490
|
}
|
|
1465
1491
|
) }) })
|
|
1466
1492
|
] }) })
|
|
1467
1493
|
}
|
|
1468
|
-
) : /* @__PURE__ */ i(
|
|
1469
|
-
/* @__PURE__ */ i(
|
|
1470
|
-
|
|
1494
|
+
) : /* @__PURE__ */ i(gt, { reason: o }),
|
|
1495
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ T(I, { direction: "column", gap: "small", height: "100%", children: [
|
|
1496
|
+
S && c ? /* @__PURE__ */ T(I, { direction: "column", gap: "x-small", margin: "xx-small", children: [
|
|
1471
1497
|
/* @__PURE__ */ i(
|
|
1472
1498
|
Ze,
|
|
1473
1499
|
{
|
|
1474
|
-
label: /* @__PURE__ */ i(
|
|
1475
|
-
value:
|
|
1476
|
-
onChange: (
|
|
1477
|
-
placeholder:
|
|
1478
|
-
textareaRef: (
|
|
1479
|
-
|
|
1500
|
+
label: /* @__PURE__ */ i(ye, { children: R.editNote }),
|
|
1501
|
+
value: D,
|
|
1502
|
+
onChange: (g) => G(g.target.value),
|
|
1503
|
+
placeholder: R.addNoteOptional,
|
|
1504
|
+
textareaRef: (g) => {
|
|
1505
|
+
se.current = g;
|
|
1480
1506
|
}
|
|
1481
1507
|
}
|
|
1482
1508
|
),
|
|
1483
|
-
/* @__PURE__ */ T(
|
|
1484
|
-
/* @__PURE__ */ i(
|
|
1509
|
+
/* @__PURE__ */ T(I, { gap: "xx-small", children: [
|
|
1510
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1485
1511
|
ne,
|
|
1486
1512
|
{
|
|
1487
1513
|
display: "block",
|
|
1488
1514
|
size: "small",
|
|
1489
1515
|
"data-testid": `note-card-${t}-cancel`,
|
|
1490
1516
|
onClick: () => {
|
|
1491
|
-
|
|
1517
|
+
G(r || ""), P(!1);
|
|
1492
1518
|
},
|
|
1493
|
-
children:
|
|
1519
|
+
children: R.cancel
|
|
1494
1520
|
}
|
|
1495
1521
|
) }),
|
|
1496
|
-
/* @__PURE__ */ i(
|
|
1522
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1497
1523
|
ne,
|
|
1498
1524
|
{
|
|
1499
1525
|
display: "block",
|
|
@@ -1501,13 +1527,13 @@ const Zn = ({
|
|
|
1501
1527
|
size: "small",
|
|
1502
1528
|
"data-testid": `note-card-${t}-save`,
|
|
1503
1529
|
onClick: () => {
|
|
1504
|
-
|
|
1530
|
+
f == null || f(t, D.trim()), P(!1);
|
|
1505
1531
|
},
|
|
1506
|
-
children:
|
|
1532
|
+
children: R.save
|
|
1507
1533
|
}
|
|
1508
1534
|
) })
|
|
1509
1535
|
] })
|
|
1510
|
-
] }) :
|
|
1536
|
+
] }) : r ? /* @__PURE__ */ i(
|
|
1511
1537
|
"div",
|
|
1512
1538
|
{
|
|
1513
1539
|
style: {
|
|
@@ -1515,86 +1541,86 @@ const Zn = ({
|
|
|
1515
1541
|
overflowWrap: "break-word",
|
|
1516
1542
|
whiteSpace: "pre-wrap"
|
|
1517
1543
|
},
|
|
1518
|
-
children:
|
|
1519
|
-
|
|
1544
|
+
children: m && c ? /* @__PURE__ */ T(Z, { children: [
|
|
1545
|
+
r,
|
|
1520
1546
|
" ",
|
|
1521
1547
|
/* @__PURE__ */ i(
|
|
1522
|
-
|
|
1548
|
+
ge,
|
|
1523
1549
|
{
|
|
1524
1550
|
size: "small",
|
|
1525
1551
|
withBackground: !1,
|
|
1526
1552
|
withBorder: !1,
|
|
1527
1553
|
margin: "xx-small 0 0 xxx-small",
|
|
1528
|
-
screenReaderLabel:
|
|
1554
|
+
screenReaderLabel: R.editNote,
|
|
1529
1555
|
"data-testid": `note-card-${t}-edit`,
|
|
1530
|
-
elementRef: (
|
|
1531
|
-
|
|
1556
|
+
elementRef: (g) => {
|
|
1557
|
+
A.current = g;
|
|
1532
1558
|
},
|
|
1533
|
-
onClick: (
|
|
1534
|
-
|
|
1559
|
+
onClick: (g) => {
|
|
1560
|
+
g.stopPropagation(), P(!0);
|
|
1535
1561
|
},
|
|
1536
|
-
children: /* @__PURE__ */ i(
|
|
1562
|
+
children: /* @__PURE__ */ i(Oe, {})
|
|
1537
1563
|
}
|
|
1538
1564
|
)
|
|
1539
|
-
] }) : /* @__PURE__ */ T(
|
|
1540
|
-
|
|
1541
|
-
/* @__PURE__ */ i("span", { "aria-hidden":
|
|
1565
|
+
] }) : /* @__PURE__ */ T(Z, { children: [
|
|
1566
|
+
ee && /* @__PURE__ */ i(ye, { children: r }),
|
|
1567
|
+
/* @__PURE__ */ i("span", { "aria-hidden": ee, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", onUpdate: Q, children: r }) })
|
|
1542
1568
|
] })
|
|
1543
1569
|
}
|
|
1544
|
-
) :
|
|
1545
|
-
|
|
1570
|
+
) : c && m ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ T(Z, { color: "secondary", children: [
|
|
1571
|
+
R.addNotePrompt,
|
|
1546
1572
|
" ",
|
|
1547
1573
|
/* @__PURE__ */ i(
|
|
1548
|
-
|
|
1574
|
+
ge,
|
|
1549
1575
|
{
|
|
1550
1576
|
size: "small",
|
|
1551
1577
|
withBackground: !1,
|
|
1552
1578
|
withBorder: !1,
|
|
1553
1579
|
margin: "xx-small 0 0 xxx-small",
|
|
1554
|
-
screenReaderLabel:
|
|
1580
|
+
screenReaderLabel: R.editNote,
|
|
1555
1581
|
"data-testid": `note-card-${t}-edit`,
|
|
1556
|
-
elementRef: (
|
|
1557
|
-
|
|
1582
|
+
elementRef: (g) => {
|
|
1583
|
+
A.current = g;
|
|
1558
1584
|
},
|
|
1559
|
-
onClick: (
|
|
1560
|
-
|
|
1585
|
+
onClick: (g) => {
|
|
1586
|
+
g.stopPropagation(), P(!0);
|
|
1561
1587
|
},
|
|
1562
|
-
children: /* @__PURE__ */ i(
|
|
1588
|
+
children: /* @__PURE__ */ i(Oe, {})
|
|
1563
1589
|
}
|
|
1564
1590
|
)
|
|
1565
1591
|
] }) }) : null,
|
|
1566
|
-
/* @__PURE__ */ T(
|
|
1567
|
-
/* @__PURE__ */ i(
|
|
1568
|
-
|
|
1569
|
-
|
|
1592
|
+
/* @__PURE__ */ T(I, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
|
|
1593
|
+
/* @__PURE__ */ i(Z, { as: "div", size: "small", color: "secondary", children: Ke(e, N) }),
|
|
1594
|
+
m && a && /* @__PURE__ */ i(
|
|
1595
|
+
ge,
|
|
1570
1596
|
{
|
|
1571
1597
|
size: "small",
|
|
1572
1598
|
withBackground: !1,
|
|
1573
1599
|
withBorder: !1,
|
|
1574
1600
|
color: "danger",
|
|
1575
1601
|
margin: "xx-small",
|
|
1576
|
-
screenReaderLabel:
|
|
1602
|
+
screenReaderLabel: R.deleteNote,
|
|
1577
1603
|
"data-testid": `note-card-${t}-delete`,
|
|
1578
|
-
elementRef: (
|
|
1579
|
-
|
|
1604
|
+
elementRef: (g) => {
|
|
1605
|
+
ue.current = g;
|
|
1580
1606
|
},
|
|
1581
|
-
onClick: (
|
|
1582
|
-
|
|
1607
|
+
onClick: (g) => {
|
|
1608
|
+
g.stopPropagation(), C.current = !1, w(!0);
|
|
1583
1609
|
},
|
|
1584
|
-
children: /* @__PURE__ */ i(
|
|
1610
|
+
children: /* @__PURE__ */ i(Se, {})
|
|
1585
1611
|
}
|
|
1586
1612
|
)
|
|
1587
1613
|
] }),
|
|
1588
|
-
|
|
1589
|
-
|
|
1614
|
+
y && /* @__PURE__ */ T(
|
|
1615
|
+
Z,
|
|
1590
1616
|
{
|
|
1591
1617
|
as: "div",
|
|
1592
1618
|
size: "small",
|
|
1593
1619
|
color: "secondary",
|
|
1594
1620
|
"data-testid": `note-card-${t}-course`,
|
|
1595
1621
|
children: [
|
|
1596
|
-
|
|
1597
|
-
/* @__PURE__ */ i("span", { "aria-hidden":
|
|
1622
|
+
ae && /* @__PURE__ */ i(ye, { children: y }),
|
|
1623
|
+
/* @__PURE__ */ i("span", { "aria-hidden": ae, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 1, onUpdate: de, children: y }) })
|
|
1598
1624
|
]
|
|
1599
1625
|
}
|
|
1600
1626
|
)
|
|
@@ -1602,19 +1628,19 @@ const Zn = ({
|
|
|
1602
1628
|
] })
|
|
1603
1629
|
}
|
|
1604
1630
|
),
|
|
1605
|
-
|
|
1631
|
+
m && E && a && /* @__PURE__ */ i(
|
|
1606
1632
|
Ct,
|
|
1607
1633
|
{
|
|
1608
1634
|
open: !0,
|
|
1609
1635
|
as: "div",
|
|
1610
|
-
label:
|
|
1636
|
+
label: R.deleteNoteConfirmation,
|
|
1611
1637
|
shouldContainFocus: !0,
|
|
1612
1638
|
shouldFocusOnOpen: !0,
|
|
1613
|
-
defaultFocusElement: () =>
|
|
1639
|
+
defaultFocusElement: () => M.current,
|
|
1614
1640
|
shouldCloseOnDocumentClick: !0,
|
|
1615
1641
|
shouldCloseOnEscape: !1,
|
|
1616
1642
|
shouldReturnFocus: !1,
|
|
1617
|
-
onDismiss:
|
|
1643
|
+
onDismiss: _,
|
|
1618
1644
|
children: /* @__PURE__ */ i(
|
|
1619
1645
|
V,
|
|
1620
1646
|
{
|
|
@@ -1629,7 +1655,7 @@ const Zn = ({
|
|
|
1629
1655
|
insetInlineEnd: "0",
|
|
1630
1656
|
stacking: "above",
|
|
1631
1657
|
children: /* @__PURE__ */ T(
|
|
1632
|
-
|
|
1658
|
+
I,
|
|
1633
1659
|
{
|
|
1634
1660
|
direction: "column",
|
|
1635
1661
|
justifyItems: "center",
|
|
@@ -1643,12 +1669,12 @@ const Zn = ({
|
|
|
1643
1669
|
display: "block",
|
|
1644
1670
|
color: "danger",
|
|
1645
1671
|
withBackground: !1,
|
|
1646
|
-
renderIcon: /* @__PURE__ */ i(
|
|
1672
|
+
renderIcon: /* @__PURE__ */ i(Se, {}),
|
|
1647
1673
|
"data-testid": `note-card-${t}-confirm-delete`,
|
|
1648
|
-
onClick: (
|
|
1649
|
-
|
|
1674
|
+
onClick: (g) => {
|
|
1675
|
+
g.stopPropagation(), a(t), w(!1);
|
|
1650
1676
|
},
|
|
1651
|
-
children:
|
|
1677
|
+
children: R.deleteNote
|
|
1652
1678
|
}
|
|
1653
1679
|
),
|
|
1654
1680
|
/* @__PURE__ */ i(
|
|
@@ -1657,13 +1683,13 @@ const Zn = ({
|
|
|
1657
1683
|
display: "block",
|
|
1658
1684
|
withBackground: !1,
|
|
1659
1685
|
"data-testid": `note-card-${t}-cancel-delete`,
|
|
1660
|
-
elementRef: (
|
|
1661
|
-
|
|
1686
|
+
elementRef: (g) => {
|
|
1687
|
+
M.current = g;
|
|
1662
1688
|
},
|
|
1663
|
-
onClick: (
|
|
1664
|
-
|
|
1689
|
+
onClick: (g) => {
|
|
1690
|
+
g.stopPropagation(), _();
|
|
1665
1691
|
},
|
|
1666
|
-
children:
|
|
1692
|
+
children: R.cancel
|
|
1667
1693
|
}
|
|
1668
1694
|
)
|
|
1669
1695
|
]
|
|
@@ -1676,8 +1702,8 @@ const Zn = ({
|
|
|
1676
1702
|
]
|
|
1677
1703
|
}
|
|
1678
1704
|
);
|
|
1679
|
-
return
|
|
1680
|
-
},
|
|
1705
|
+
return p && x ? x({ href: p, children: U, ariaLabel: O }) : U;
|
|
1706
|
+
}, oo = {
|
|
1681
1707
|
display: "grid",
|
|
1682
1708
|
gap: "1rem",
|
|
1683
1709
|
boxSizing: "border-box",
|
|
@@ -1685,7 +1711,7 @@ const Zn = ({
|
|
|
1685
1711
|
margin: 0,
|
|
1686
1712
|
padding: 0,
|
|
1687
1713
|
listStyle: "none"
|
|
1688
|
-
},
|
|
1714
|
+
}, Ao = ({
|
|
1689
1715
|
notes: t,
|
|
1690
1716
|
isLoading: e,
|
|
1691
1717
|
isError: n,
|
|
@@ -1694,93 +1720,94 @@ const Zn = ({
|
|
|
1694
1720
|
onPageChange: s,
|
|
1695
1721
|
onNoteSelect: l,
|
|
1696
1722
|
onNoteDelete: a,
|
|
1697
|
-
onNoteSave:
|
|
1698
|
-
onNoteTypeChange:
|
|
1699
|
-
onNotesEmptied:
|
|
1700
|
-
selectedNoteId:
|
|
1701
|
-
hasActiveFilter:
|
|
1702
|
-
columnCount:
|
|
1703
|
-
highlightTheme:
|
|
1704
|
-
locale:
|
|
1705
|
-
courseNames:
|
|
1706
|
-
renderNoteLink:
|
|
1707
|
-
noteHref:
|
|
1723
|
+
onNoteSave: f,
|
|
1724
|
+
onNoteTypeChange: u,
|
|
1725
|
+
onNotesEmptied: m,
|
|
1726
|
+
selectedNoteId: c,
|
|
1727
|
+
hasActiveFilter: y = !1,
|
|
1728
|
+
columnCount: N = 1,
|
|
1729
|
+
highlightTheme: h,
|
|
1730
|
+
locale: x,
|
|
1731
|
+
courseNames: p,
|
|
1732
|
+
renderNoteLink: R,
|
|
1733
|
+
noteHref: z
|
|
1708
1734
|
}) => {
|
|
1709
|
-
const { translations:
|
|
1710
|
-
(
|
|
1711
|
-
const w = t.findIndex((
|
|
1712
|
-
let
|
|
1713
|
-
t.length > 1 && (
|
|
1735
|
+
const { translations: b } = J(), S = F(null), P = F(null), D = K(
|
|
1736
|
+
(E) => {
|
|
1737
|
+
const w = t.findIndex((j) => j.id === E);
|
|
1738
|
+
let v = null;
|
|
1739
|
+
t.length > 1 && (v = w > 0 ? t[w - 1].id : t[1].id), P.current = { targetId: v }, a == null || a(E);
|
|
1714
1740
|
},
|
|
1715
1741
|
[t, a]
|
|
1716
1742
|
);
|
|
1717
|
-
if (
|
|
1743
|
+
if (q(() => {
|
|
1718
1744
|
var w;
|
|
1719
|
-
const
|
|
1720
|
-
if (
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
1745
|
+
const E = P.current;
|
|
1746
|
+
if (E)
|
|
1747
|
+
if (P.current = null, E.targetId === null)
|
|
1748
|
+
m == null || m();
|
|
1723
1749
|
else {
|
|
1724
|
-
const
|
|
1725
|
-
`[data-testid="note-card-${
|
|
1750
|
+
const v = (w = S.current) == null ? void 0 : w.querySelector(
|
|
1751
|
+
`[data-testid="note-card-${E.targetId}"]`
|
|
1726
1752
|
);
|
|
1727
|
-
|
|
1753
|
+
v == null || v.focus();
|
|
1728
1754
|
}
|
|
1729
|
-
}, [t,
|
|
1730
|
-
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(
|
|
1755
|
+
}, [t, m]), e)
|
|
1756
|
+
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(xt, { renderTitle: b.loadingNotes }) });
|
|
1731
1757
|
if (n)
|
|
1732
|
-
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(
|
|
1758
|
+
return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(ve, { level: "h4", children: b.failedToLoadNotes }) });
|
|
1733
1759
|
if (t.length === 0)
|
|
1734
|
-
return /* @__PURE__ */ i(V, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(
|
|
1735
|
-
const
|
|
1760
|
+
return /* @__PURE__ */ i(V, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Jn, { hasActiveFilter: y }) });
|
|
1761
|
+
const G = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
|
|
1736
1762
|
return /* @__PURE__ */ T(Xe, { children: [
|
|
1737
1763
|
/* @__PURE__ */ i(
|
|
1738
1764
|
"ul",
|
|
1739
1765
|
{
|
|
1740
|
-
ref:
|
|
1741
|
-
style: { ...
|
|
1766
|
+
ref: S,
|
|
1767
|
+
style: { ...oo, gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))` },
|
|
1742
1768
|
role: "list",
|
|
1743
1769
|
"data-testid": "notes-grid",
|
|
1744
|
-
children: t.map((
|
|
1770
|
+
children: t.map((E) => {
|
|
1745
1771
|
var w;
|
|
1746
1772
|
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
1747
|
-
|
|
1773
|
+
no,
|
|
1748
1774
|
{
|
|
1749
|
-
noteId:
|
|
1750
|
-
date:
|
|
1751
|
-
type:
|
|
1752
|
-
highlight: (w =
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1775
|
+
noteId: E.id,
|
|
1776
|
+
date: E.createdAt,
|
|
1777
|
+
type: E.reaction[0] ?? L.IMPORTANT,
|
|
1778
|
+
highlight: (w = E.highlightData) == null ? void 0 : w.selectedText,
|
|
1779
|
+
highlightUnavailableReason: E.highlightSourceUnavailable ? "sourceUnavailable" : void 0,
|
|
1780
|
+
note: E.userText,
|
|
1781
|
+
isActive: c === E.id,
|
|
1782
|
+
isPanelView: !!c,
|
|
1783
|
+
onClick: l ? () => l(E.id) : void 0,
|
|
1757
1784
|
onDelete: a ? D : void 0,
|
|
1758
|
-
onSaveNote:
|
|
1759
|
-
onTypeChange:
|
|
1760
|
-
highlightTheme:
|
|
1761
|
-
locale:
|
|
1762
|
-
courseName:
|
|
1763
|
-
renderLink:
|
|
1764
|
-
href:
|
|
1785
|
+
onSaveNote: f ? (v, j) => f(v, j) : void 0,
|
|
1786
|
+
onTypeChange: u ? (v, j) => u(v, j) : void 0,
|
|
1787
|
+
highlightTheme: h,
|
|
1788
|
+
locale: x,
|
|
1789
|
+
courseName: p == null ? void 0 : p.get(E.courseId),
|
|
1790
|
+
renderLink: R,
|
|
1791
|
+
href: z ? z(E.id, E) : void 0
|
|
1765
1792
|
}
|
|
1766
|
-
) },
|
|
1793
|
+
) }, E.id);
|
|
1767
1794
|
})
|
|
1768
1795
|
}
|
|
1769
1796
|
),
|
|
1770
|
-
|
|
1771
|
-
|
|
1797
|
+
G && /* @__PURE__ */ i(I, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(I.Item, { children: /* @__PURE__ */ i(
|
|
1798
|
+
It,
|
|
1772
1799
|
{
|
|
1773
1800
|
as: "nav",
|
|
1774
1801
|
variant: "input",
|
|
1775
|
-
labelNext:
|
|
1776
|
-
labelPrev:
|
|
1802
|
+
labelNext: b.nextPage,
|
|
1803
|
+
labelPrev: b.previousPage,
|
|
1777
1804
|
currentPage: o,
|
|
1778
1805
|
totalPageNumber: r,
|
|
1779
1806
|
onPageChange: s
|
|
1780
1807
|
}
|
|
1781
1808
|
) }) })
|
|
1782
1809
|
] });
|
|
1783
|
-
},
|
|
1810
|
+
}, Do = ({
|
|
1784
1811
|
noteText: t,
|
|
1785
1812
|
reaction: e,
|
|
1786
1813
|
highlightText: n,
|
|
@@ -1789,36 +1816,44 @@ const Zn = ({
|
|
|
1789
1816
|
onDelete: s,
|
|
1790
1817
|
onTypeChange: l,
|
|
1791
1818
|
onBack: a,
|
|
1792
|
-
editing:
|
|
1819
|
+
editing: f = !1
|
|
1793
1820
|
}) => {
|
|
1794
|
-
const { translations:
|
|
1795
|
-
return /* @__PURE__ */ T(
|
|
1796
|
-
n != null ? /* @__PURE__ */ i(V, { as: "div", children: /* @__PURE__ */ i(
|
|
1797
|
-
/* @__PURE__ */ i(
|
|
1798
|
-
|
|
1821
|
+
const { translations: u } = J(), [m, c] = W(f), [y, N] = W(t || ""), [h, x] = W(!1);
|
|
1822
|
+
return /* @__PURE__ */ T(I, { direction: "column", gap: "small", "data-testid": "single-note", children: [
|
|
1823
|
+
n != null ? /* @__PURE__ */ i(V, { as: "div", children: /* @__PURE__ */ i(Z, { children: /* @__PURE__ */ i(we, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(gt, {}),
|
|
1824
|
+
/* @__PURE__ */ i(
|
|
1825
|
+
ht,
|
|
1826
|
+
{
|
|
1827
|
+
type: e,
|
|
1828
|
+
onTypeChange: l,
|
|
1829
|
+
renderAsMenuTrigger: !!l,
|
|
1830
|
+
theme: o.colors
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
m ? /* @__PURE__ */ T(I, { direction: "column", gap: "x-small", children: [
|
|
1799
1834
|
/* @__PURE__ */ i(
|
|
1800
1835
|
Ze,
|
|
1801
1836
|
{
|
|
1802
|
-
label:
|
|
1803
|
-
value:
|
|
1804
|
-
onChange: (
|
|
1837
|
+
label: u.addNoteOptional,
|
|
1838
|
+
value: y,
|
|
1839
|
+
onChange: (p) => N(p.target.value),
|
|
1805
1840
|
resize: "vertical"
|
|
1806
1841
|
}
|
|
1807
1842
|
),
|
|
1808
|
-
/* @__PURE__ */ T(
|
|
1809
|
-
/* @__PURE__ */ i(
|
|
1843
|
+
/* @__PURE__ */ T(I, { gap: "xx-small", children: [
|
|
1844
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1810
1845
|
ne,
|
|
1811
1846
|
{
|
|
1812
1847
|
display: "block",
|
|
1813
1848
|
size: "small",
|
|
1814
1849
|
"data-testid": "single-note-cancel",
|
|
1815
1850
|
onClick: () => {
|
|
1816
|
-
|
|
1851
|
+
N(t || ""), c(!1);
|
|
1817
1852
|
},
|
|
1818
|
-
children:
|
|
1853
|
+
children: u.cancel
|
|
1819
1854
|
}
|
|
1820
1855
|
) }),
|
|
1821
|
-
/* @__PURE__ */ i(
|
|
1856
|
+
/* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1822
1857
|
ne,
|
|
1823
1858
|
{
|
|
1824
1859
|
display: "block",
|
|
@@ -1826,69 +1861,69 @@ const Zn = ({
|
|
|
1826
1861
|
size: "small",
|
|
1827
1862
|
"data-testid": "single-note-save",
|
|
1828
1863
|
onClick: () => {
|
|
1829
|
-
r(
|
|
1864
|
+
r(y), c(!1);
|
|
1830
1865
|
},
|
|
1831
|
-
children:
|
|
1866
|
+
children: u.save
|
|
1832
1867
|
}
|
|
1833
1868
|
) })
|
|
1834
1869
|
] })
|
|
1835
|
-
] }) : /* @__PURE__ */ T(
|
|
1870
|
+
] }) : /* @__PURE__ */ T(I, { direction: "column", gap: "small", children: [
|
|
1836
1871
|
t && /* @__PURE__ */ T(V, { as: "div", children: [
|
|
1837
|
-
/* @__PURE__ */ i(
|
|
1838
|
-
/* @__PURE__ */ i(
|
|
1872
|
+
/* @__PURE__ */ i(ve, { level: "h4", margin: "0 0 xx-small 0", children: u.note }),
|
|
1873
|
+
/* @__PURE__ */ i(Z, { children: t })
|
|
1839
1874
|
] }),
|
|
1840
|
-
/* @__PURE__ */ T(
|
|
1875
|
+
/* @__PURE__ */ T(I, { justifyItems: "space-between", children: [
|
|
1841
1876
|
/* @__PURE__ */ i(
|
|
1842
1877
|
ne,
|
|
1843
1878
|
{
|
|
1844
1879
|
size: "small",
|
|
1845
|
-
renderIcon: /* @__PURE__ */ i(
|
|
1880
|
+
renderIcon: /* @__PURE__ */ i(vt, {}),
|
|
1846
1881
|
"data-testid": "single-note-back",
|
|
1847
1882
|
onClick: () => a == null ? void 0 : a(),
|
|
1848
|
-
children:
|
|
1883
|
+
children: u.back
|
|
1849
1884
|
}
|
|
1850
1885
|
),
|
|
1851
|
-
/* @__PURE__ */ T(
|
|
1886
|
+
/* @__PURE__ */ T(I, { gap: "xx-small", children: [
|
|
1852
1887
|
s && /* @__PURE__ */ i(
|
|
1853
|
-
|
|
1888
|
+
ge,
|
|
1854
1889
|
{
|
|
1855
1890
|
size: "small",
|
|
1856
1891
|
withBackground: !1,
|
|
1857
1892
|
withBorder: !1,
|
|
1858
1893
|
color: "danger",
|
|
1859
|
-
screenReaderLabel:
|
|
1894
|
+
screenReaderLabel: u.deleteNote,
|
|
1860
1895
|
"data-testid": "single-note-delete",
|
|
1861
|
-
onClick: () =>
|
|
1862
|
-
children: /* @__PURE__ */ i(
|
|
1896
|
+
onClick: () => x(!0),
|
|
1897
|
+
children: /* @__PURE__ */ i(Se, {})
|
|
1863
1898
|
}
|
|
1864
1899
|
),
|
|
1865
1900
|
/* @__PURE__ */ i(
|
|
1866
|
-
|
|
1901
|
+
ge,
|
|
1867
1902
|
{
|
|
1868
1903
|
size: "small",
|
|
1869
1904
|
withBackground: !1,
|
|
1870
1905
|
withBorder: !1,
|
|
1871
|
-
screenReaderLabel:
|
|
1906
|
+
screenReaderLabel: u.editNote,
|
|
1872
1907
|
"data-testid": "single-note-edit",
|
|
1873
|
-
onClick: () =>
|
|
1874
|
-
children: /* @__PURE__ */ i(
|
|
1908
|
+
onClick: () => c(!0),
|
|
1909
|
+
children: /* @__PURE__ */ i(Oe, {})
|
|
1875
1910
|
}
|
|
1876
1911
|
)
|
|
1877
1912
|
] })
|
|
1878
1913
|
] }),
|
|
1879
|
-
|
|
1914
|
+
h && s && /* @__PURE__ */ i(V, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ T(I, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
|
|
1880
1915
|
/* @__PURE__ */ i(
|
|
1881
1916
|
ne,
|
|
1882
1917
|
{
|
|
1883
1918
|
display: "block",
|
|
1884
1919
|
color: "danger",
|
|
1885
1920
|
size: "small",
|
|
1886
|
-
renderIcon: /* @__PURE__ */ i(
|
|
1921
|
+
renderIcon: /* @__PURE__ */ i(Se, {}),
|
|
1887
1922
|
"data-testid": "single-note-confirm-delete",
|
|
1888
1923
|
onClick: () => {
|
|
1889
|
-
s(),
|
|
1924
|
+
s(), x(!1);
|
|
1890
1925
|
},
|
|
1891
|
-
children:
|
|
1926
|
+
children: u.deleteNote
|
|
1892
1927
|
}
|
|
1893
1928
|
),
|
|
1894
1929
|
/* @__PURE__ */ i(
|
|
@@ -1897,8 +1932,8 @@ const Zn = ({
|
|
|
1897
1932
|
display: "block",
|
|
1898
1933
|
size: "small",
|
|
1899
1934
|
"data-testid": "single-note-cancel-delete",
|
|
1900
|
-
onClick: () =>
|
|
1901
|
-
children:
|
|
1935
|
+
onClick: () => x(!1),
|
|
1936
|
+
children: u.cancel
|
|
1902
1937
|
}
|
|
1903
1938
|
)
|
|
1904
1939
|
] }) })
|
|
@@ -1906,26 +1941,27 @@ const Zn = ({
|
|
|
1906
1941
|
] });
|
|
1907
1942
|
};
|
|
1908
1943
|
export {
|
|
1909
|
-
|
|
1944
|
+
wo as ContentWithNoteWrapper,
|
|
1910
1945
|
we as Highlight,
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
tn as
|
|
1946
|
+
gt as HighlightError,
|
|
1947
|
+
no as NoteCard,
|
|
1948
|
+
ht as NoteChip,
|
|
1949
|
+
Vn as NoteReactionMenu,
|
|
1950
|
+
Jn as NotebookEmptyState,
|
|
1951
|
+
Ro as NotebookProvider,
|
|
1952
|
+
qn as NotebookTranslationsProvider,
|
|
1953
|
+
Oo as NotebookTray,
|
|
1954
|
+
Ao as NotesListView,
|
|
1955
|
+
L as REACTION_TYPE,
|
|
1956
|
+
Do as SingleNote,
|
|
1957
|
+
Me as createTransparentColor,
|
|
1958
|
+
mt as getHighlightUnavailableMessage,
|
|
1959
|
+
tn as useCreateNote,
|
|
1960
|
+
nn as useDeleteNote,
|
|
1925
1961
|
it as useGetNotes,
|
|
1926
1962
|
ut as useNotebook,
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1963
|
+
J as useNotebookTranslations,
|
|
1964
|
+
ko as useNotesData,
|
|
1965
|
+
Lo as useReactionFilter,
|
|
1966
|
+
rn as useUpdateNote
|
|
1931
1967
|
};
|