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