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