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