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