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