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