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