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