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