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