@instructure/platform-notebook 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ContentWithNoteWrapper.d.ts +9 -0
- package/dist/ContentWithNoteWrapper.d.ts.map +1 -0
- package/dist/Highlight.d.ts +11 -0
- package/dist/Highlight.d.ts.map +1 -0
- package/dist/NoteCard.d.ts +32 -0
- package/dist/NoteCard.d.ts.map +1 -0
- package/dist/NoteChip.d.ts +8 -0
- package/dist/NoteChip.d.ts.map +1 -0
- package/dist/NoteReactionMenu.d.ts +7 -0
- package/dist/NoteReactionMenu.d.ts.map +1 -0
- package/dist/NotebookTray.d.ts +6 -0
- package/dist/NotebookTray.d.ts.map +1 -0
- package/dist/NotesListView.d.ts +30 -0
- package/dist/NotesListView.d.ts.map +1 -0
- package/dist/SingleNote.d.ts +15 -0
- package/dist/SingleNote.d.ts.map +1 -0
- package/dist/TranslationsContext.d.ts.map +1 -1
- package/dist/highlighter.d.ts +1 -0
- package/dist/highlighter.d.ts.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1164 -372
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/locales/en.json +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,102 +1,116 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as i, jsxs as N, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as De, useContext as Le, useMemo as me, useReducer as Ke, useRef as ne, useEffect as ee, useState as H, useCallback as Ae } from "react";
|
|
3
|
+
import { createPortal as Xe } from "react-dom";
|
|
4
|
+
import { z as a } from "zod";
|
|
5
|
+
import Qe from "diff-match-patch";
|
|
6
|
+
import { useQueryClient as ge, useMutation as he, useQuery as Ye } from "@tanstack/react-query";
|
|
7
|
+
import { IconQuestionLine as pe, IconPinLine as Ne, IconWarningLine as Ve, IconArrowOpenDownLine as Ze, IconEditLine as de, IconTrashLine as se, IconArrowOpenStartLine as Je, IconArrowOpenEndLine as et, IconArrowStartLine as tt } from "@instructure/ui-icons";
|
|
8
|
+
import { Menu as Z } from "@instructure/ui-menu";
|
|
9
|
+
import { Flex as v } from "@instructure/ui-flex";
|
|
10
|
+
import { TruncateText as ue } from "@instructure/ui-truncate-text";
|
|
11
|
+
import { CloseButton as nt, Button as W, IconButton as G } from "@instructure/ui-buttons";
|
|
12
|
+
import { Heading as ie } from "@instructure/ui-heading";
|
|
13
|
+
import { Tray as ot } from "@instructure/ui-tray";
|
|
14
|
+
import { View as K } from "@instructure/ui-view";
|
|
15
|
+
import { ScreenReaderContent as rt } from "@instructure/ui-a11y-content";
|
|
16
|
+
import { Text as U } from "@instructure/ui-text";
|
|
17
|
+
import { TextArea as Pe } from "@instructure/ui-text-area";
|
|
18
|
+
import { Pill as Ie } from "@instructure/ui-pill";
|
|
19
|
+
import { Spinner as st } from "@instructure/ui-spinner";
|
|
20
|
+
const it = a.object({
|
|
21
|
+
startContainer: a.string(),
|
|
22
|
+
endContainer: a.string(),
|
|
23
|
+
startOffset: a.number(),
|
|
24
|
+
endOffset: a.number()
|
|
25
|
+
}), lt = a.object({
|
|
26
|
+
start: a.number(),
|
|
27
|
+
end: a.number()
|
|
28
|
+
}), be = a.object({
|
|
29
|
+
selectedText: a.string(),
|
|
30
|
+
hasNoHighlightAnymore: a.boolean().optional(),
|
|
31
|
+
textPosition: lt.nullable(),
|
|
32
|
+
range: it.nullable(),
|
|
33
|
+
pageLastModifiedAt: a.string()
|
|
20
34
|
});
|
|
21
|
-
var
|
|
22
|
-
const
|
|
35
|
+
var L = /* @__PURE__ */ ((n) => (n.IMPORTANT = "Important", n.CONFUSING = "Confusing", n))(L || {});
|
|
36
|
+
const ye = a.enum([
|
|
23
37
|
"Important",
|
|
24
38
|
"Confusing"
|
|
25
39
|
/* CONFUSING */
|
|
26
|
-
]),
|
|
27
|
-
startCursor:
|
|
28
|
-
endCursor:
|
|
29
|
-
hasNextPage:
|
|
30
|
-
hasPreviousPage:
|
|
31
|
-
}),
|
|
32
|
-
id:
|
|
33
|
-
rootAccountUuid:
|
|
34
|
-
userId:
|
|
35
|
-
courseId:
|
|
36
|
-
objectId:
|
|
37
|
-
objectType:
|
|
38
|
-
userText:
|
|
39
|
-
reaction:
|
|
40
|
-
highlightData:
|
|
41
|
-
createdAt:
|
|
42
|
-
updatedAt:
|
|
43
|
-
}),
|
|
44
|
-
cursor:
|
|
45
|
-
node:
|
|
40
|
+
]), Me = a.object({
|
|
41
|
+
startCursor: a.string().nullish(),
|
|
42
|
+
endCursor: a.string().nullish(),
|
|
43
|
+
hasNextPage: a.boolean().nullish(),
|
|
44
|
+
hasPreviousPage: a.boolean().nullish()
|
|
45
|
+
}), le = a.object({
|
|
46
|
+
id: a.string(),
|
|
47
|
+
rootAccountUuid: a.string(),
|
|
48
|
+
userId: a.string(),
|
|
49
|
+
courseId: a.string(),
|
|
50
|
+
objectId: a.string(),
|
|
51
|
+
objectType: a.string(),
|
|
52
|
+
userText: a.string().optional(),
|
|
53
|
+
reaction: a.array(ye),
|
|
54
|
+
highlightData: be,
|
|
55
|
+
createdAt: a.string(),
|
|
56
|
+
updatedAt: a.string()
|
|
57
|
+
}), at = a.object({
|
|
58
|
+
cursor: a.string(),
|
|
59
|
+
node: le
|
|
46
60
|
});
|
|
47
|
-
|
|
48
|
-
notes:
|
|
49
|
-
edges:
|
|
50
|
-
nodes:
|
|
51
|
-
pageInfo:
|
|
61
|
+
a.object({
|
|
62
|
+
notes: a.object({
|
|
63
|
+
edges: a.array(at),
|
|
64
|
+
nodes: a.array(le),
|
|
65
|
+
pageInfo: Me
|
|
52
66
|
})
|
|
53
67
|
});
|
|
54
|
-
const
|
|
55
|
-
type:
|
|
56
|
-
id:
|
|
57
|
-
}),
|
|
58
|
-
courseId:
|
|
59
|
-
learningObject:
|
|
60
|
-
reactions:
|
|
68
|
+
const ct = a.object({
|
|
69
|
+
type: a.string(),
|
|
70
|
+
id: a.string()
|
|
71
|
+
}), dt = a.object({
|
|
72
|
+
courseId: a.string().optional(),
|
|
73
|
+
learningObject: ct.optional(),
|
|
74
|
+
reactions: a.array(a.string()).optional()
|
|
61
75
|
}).optional();
|
|
62
|
-
|
|
63
|
-
courseId:
|
|
64
|
-
filter:
|
|
65
|
-
pageParams:
|
|
66
|
-
direction:
|
|
67
|
-
pageSize:
|
|
76
|
+
a.object({
|
|
77
|
+
courseId: a.string().optional(),
|
|
78
|
+
filter: dt,
|
|
79
|
+
pageParams: Me.optional(),
|
|
80
|
+
direction: a.enum(["next", "prev"]).optional(),
|
|
81
|
+
pageSize: a.number().optional()
|
|
68
82
|
});
|
|
69
|
-
|
|
70
|
-
courseId:
|
|
71
|
-
objectId:
|
|
72
|
-
objectType:
|
|
73
|
-
userText:
|
|
74
|
-
reaction:
|
|
75
|
-
highlightData:
|
|
83
|
+
a.object({
|
|
84
|
+
courseId: a.string(),
|
|
85
|
+
objectId: a.string(),
|
|
86
|
+
objectType: a.string(),
|
|
87
|
+
userText: a.string().optional(),
|
|
88
|
+
reaction: a.array(ye),
|
|
89
|
+
highlightData: be
|
|
76
90
|
});
|
|
77
|
-
|
|
78
|
-
createNote:
|
|
91
|
+
a.object({
|
|
92
|
+
createNote: le
|
|
79
93
|
});
|
|
80
|
-
|
|
81
|
-
id:
|
|
82
|
-
userText:
|
|
83
|
-
reaction:
|
|
84
|
-
highlightData:
|
|
94
|
+
a.object({
|
|
95
|
+
id: a.string(),
|
|
96
|
+
userText: a.string().optional(),
|
|
97
|
+
reaction: a.array(ye),
|
|
98
|
+
highlightData: be
|
|
85
99
|
});
|
|
86
|
-
|
|
87
|
-
updateNote:
|
|
100
|
+
a.object({
|
|
101
|
+
updateNote: le
|
|
88
102
|
});
|
|
89
|
-
|
|
90
|
-
deleteNote:
|
|
103
|
+
a.object({
|
|
104
|
+
deleteNote: a.string()
|
|
91
105
|
});
|
|
92
|
-
var
|
|
93
|
-
class
|
|
106
|
+
var Fe = /* @__PURE__ */ ((n) => (n[n.FORWARDS = 1] = "FORWARDS", n[n.BACKWARDS = 2] = "BACKWARDS", n))(Fe || {});
|
|
107
|
+
class q {
|
|
94
108
|
constructor(e, t) {
|
|
95
109
|
this.start = e, this.end = t;
|
|
96
110
|
}
|
|
97
111
|
toRange() {
|
|
98
112
|
let e, t;
|
|
99
|
-
if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, t] =
|
|
113
|
+
if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, t] = He(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
|
|
100
114
|
direction: 1
|
|
101
115
|
/* FORWARDS */
|
|
102
116
|
}), t = this.end.resolve({
|
|
@@ -108,28 +122,28 @@ class S {
|
|
|
108
122
|
return o.setStart(e.node, e.offset), o.setEnd(t.node, t.offset), o;
|
|
109
123
|
}
|
|
110
124
|
static fromRange(e) {
|
|
111
|
-
const t =
|
|
112
|
-
return !t || !o ? null : new
|
|
125
|
+
const t = z.fromPoint(e.startContainer, e.startOffset), o = z.fromPoint(e.endContainer, e.endOffset);
|
|
126
|
+
return !t || !o ? null : new q(t, o);
|
|
113
127
|
}
|
|
114
128
|
static fromOffsets(e, t, o) {
|
|
115
|
-
return new
|
|
129
|
+
return new q(new z(e, t), new z(e, o));
|
|
116
130
|
}
|
|
117
131
|
relativeTo(e) {
|
|
118
|
-
return new
|
|
132
|
+
return new q(this.start.relativeTo(e), this.end.relativeTo(e));
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
|
-
class
|
|
135
|
+
class z {
|
|
122
136
|
constructor(e, t) {
|
|
123
137
|
t < 0 && console.error("Offset is invalid"), this.element = e, this.offset = t;
|
|
124
138
|
}
|
|
125
139
|
resolve(e = {}) {
|
|
126
140
|
try {
|
|
127
|
-
return
|
|
141
|
+
return He(this.element, this.offset)[0];
|
|
128
142
|
} catch (t) {
|
|
129
143
|
if (this.offset === 0 && e.direction !== void 0) {
|
|
130
144
|
const o = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);
|
|
131
145
|
o.currentNode = this.element;
|
|
132
|
-
const r = e.direction ===
|
|
146
|
+
const r = e.direction === Fe.FORWARDS, s = r ? o.nextNode() : o.previousNode();
|
|
133
147
|
if (!s)
|
|
134
148
|
throw t;
|
|
135
149
|
return { node: s, offset: r ? 0 : s.data.length };
|
|
@@ -140,9 +154,9 @@ class E {
|
|
|
140
154
|
static fromCharOffset(e, t) {
|
|
141
155
|
switch (e.nodeType) {
|
|
142
156
|
case Node.TEXT_NODE:
|
|
143
|
-
return
|
|
157
|
+
return z.fromPoint(e, t);
|
|
144
158
|
case Node.ELEMENT_NODE:
|
|
145
|
-
return new
|
|
159
|
+
return new z(e, t);
|
|
146
160
|
default:
|
|
147
161
|
return console.error("Node is not an element or text node"), null;
|
|
148
162
|
}
|
|
@@ -154,16 +168,16 @@ class E {
|
|
|
154
168
|
return console.error("Text node offset is out of range"), null;
|
|
155
169
|
if (!e.parentElement)
|
|
156
170
|
return console.error("Text node has no parent"), null;
|
|
157
|
-
const o =
|
|
158
|
-
return new
|
|
171
|
+
const o = ke(e) + t;
|
|
172
|
+
return new z(e.parentElement, o);
|
|
159
173
|
}
|
|
160
174
|
case Node.ELEMENT_NODE: {
|
|
161
175
|
if (t < 0 || t > e.childNodes.length)
|
|
162
176
|
return console.error("Child node offset is out of range"), null;
|
|
163
177
|
let o = 0;
|
|
164
178
|
for (let r = 0; r < t; r++)
|
|
165
|
-
o +=
|
|
166
|
-
return new
|
|
179
|
+
o += Be(e.childNodes[r]);
|
|
180
|
+
return new z(e, o);
|
|
167
181
|
}
|
|
168
182
|
default:
|
|
169
183
|
return console.error("Point is not in an element or text node"), null;
|
|
@@ -174,99 +188,99 @@ class E {
|
|
|
174
188
|
throw new Error("Parent is not an ancestor of current element");
|
|
175
189
|
let t = this.element, o = this.offset;
|
|
176
190
|
for (; t !== e; )
|
|
177
|
-
o +=
|
|
178
|
-
return new
|
|
191
|
+
o += ke(t), t.parentElement && (t = t.parentElement);
|
|
192
|
+
return new z(t, o);
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
|
-
const
|
|
195
|
+
const ut = (n) => {
|
|
182
196
|
const e = n.nodeName.toLowerCase();
|
|
183
197
|
return e === "#text" ? "text()" : e;
|
|
184
198
|
};
|
|
185
|
-
function
|
|
199
|
+
function ft(n) {
|
|
186
200
|
let e = 0, t = n;
|
|
187
201
|
for (; t; )
|
|
188
202
|
t.nodeName === n.nodeName && (e += 1), t = t.previousSibling;
|
|
189
203
|
return e;
|
|
190
204
|
}
|
|
191
|
-
const
|
|
192
|
-
const e =
|
|
205
|
+
const mt = (n) => {
|
|
206
|
+
const e = ut(n), t = ft(n);
|
|
193
207
|
return `${e}[${t}]`;
|
|
194
|
-
},
|
|
208
|
+
}, xe = (n, e) => {
|
|
195
209
|
let t = "", o = n;
|
|
196
210
|
for (; o !== e; ) {
|
|
197
211
|
if (!o) {
|
|
198
212
|
console.error("Node is not a descendant of root");
|
|
199
213
|
return;
|
|
200
214
|
}
|
|
201
|
-
t = `${
|
|
215
|
+
t = `${mt(o)}/${t}`, o = o.parentNode;
|
|
202
216
|
}
|
|
203
217
|
return t = `/${t}`, t = t.replace(/\/$/, ""), t;
|
|
204
|
-
},
|
|
218
|
+
}, gt = (n, e, t) => {
|
|
205
219
|
const o = e.toUpperCase();
|
|
206
220
|
let r = -1;
|
|
207
221
|
for (let s = 0; s < n.children.length; s++) {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
return
|
|
222
|
+
const l = n.children[s];
|
|
223
|
+
if (l.nodeName.toUpperCase() === o && (++r, r === t))
|
|
224
|
+
return l;
|
|
211
225
|
}
|
|
212
226
|
return null;
|
|
213
|
-
},
|
|
227
|
+
}, ht = (n, e) => {
|
|
214
228
|
if (!(n.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
|
|
215
229
|
return console.error("Expression is not a simple XPath"), null;
|
|
216
230
|
const o = n.split("/");
|
|
217
231
|
let r = e;
|
|
218
232
|
o.shift();
|
|
219
233
|
for (const s of o) {
|
|
220
|
-
let
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
234
|
+
let l, d;
|
|
235
|
+
const f = s.indexOf("[");
|
|
236
|
+
if (f !== -1) {
|
|
237
|
+
l = s.slice(0, f);
|
|
238
|
+
const g = s.slice(f + 1, s.indexOf("]"));
|
|
239
|
+
if (d = Number.parseInt(g, 10) - 1, d < 0)
|
|
226
240
|
return null;
|
|
227
241
|
} else
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
242
|
+
l = s, d = 0;
|
|
243
|
+
const c = gt(r, l, d);
|
|
244
|
+
if (!c)
|
|
231
245
|
return null;
|
|
232
|
-
r =
|
|
246
|
+
r = c;
|
|
233
247
|
}
|
|
234
248
|
return r;
|
|
235
|
-
},
|
|
249
|
+
}, we = (n, e = document.body) => {
|
|
236
250
|
try {
|
|
237
|
-
return
|
|
251
|
+
return ht(n, e);
|
|
238
252
|
} catch {
|
|
239
253
|
return document.evaluate(`.${n}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
240
254
|
}
|
|
241
255
|
};
|
|
242
|
-
class
|
|
256
|
+
class X {
|
|
243
257
|
constructor(e, t) {
|
|
244
258
|
this.root = e, this.range = t;
|
|
245
259
|
}
|
|
246
260
|
static fromRange(e, t) {
|
|
247
|
-
return new
|
|
261
|
+
return new X(e, t);
|
|
248
262
|
}
|
|
249
263
|
static fromSelector(e, t) {
|
|
250
264
|
if (!(t != null && t.startContainer) || !(t != null && t.endContainer))
|
|
251
265
|
return console.error("No start or end container in selector"), null;
|
|
252
|
-
const o =
|
|
266
|
+
const o = we(t.startContainer, e);
|
|
253
267
|
if (!o)
|
|
254
268
|
return console.error("Failed to resolve startContainer XPath"), null;
|
|
255
|
-
const r =
|
|
269
|
+
const r = we(t.endContainer, e);
|
|
256
270
|
if (!r)
|
|
257
271
|
return console.error("Failed to resolve endContainer XPath"), null;
|
|
258
|
-
const s =
|
|
259
|
-
if (!s || !
|
|
272
|
+
const s = z.fromCharOffset(o, t.startOffset), l = z.fromCharOffset(r, t.endOffset);
|
|
273
|
+
if (!s || !l)
|
|
260
274
|
return null;
|
|
261
|
-
const
|
|
262
|
-
return
|
|
275
|
+
const d = new q(s, l).toRange();
|
|
276
|
+
return d ? new X(e, d) : null;
|
|
263
277
|
}
|
|
264
278
|
toRange() {
|
|
265
279
|
return this.range;
|
|
266
280
|
}
|
|
267
281
|
toSelector() {
|
|
268
282
|
var s;
|
|
269
|
-
const e = (s =
|
|
283
|
+
const e = (s = q.fromRange(this.range)) == null ? void 0 : s.toRange(), t = e && q.fromRange(e), o = t && xe(t.start.element, this.root), r = t && xe(t.end.element, this.root);
|
|
270
284
|
return !o || !r ? null : {
|
|
271
285
|
startContainer: o,
|
|
272
286
|
startOffset: t.start.offset,
|
|
@@ -275,17 +289,17 @@ class A {
|
|
|
275
289
|
};
|
|
276
290
|
}
|
|
277
291
|
}
|
|
278
|
-
class
|
|
292
|
+
class $ {
|
|
279
293
|
constructor(e, t, o) {
|
|
280
294
|
this.root = e, this.start = t, this.end = o;
|
|
281
295
|
}
|
|
282
296
|
static fromRange(e, t) {
|
|
283
297
|
var r;
|
|
284
|
-
const o = (r =
|
|
285
|
-
return o ? new
|
|
298
|
+
const o = (r = q.fromRange(t)) == null ? void 0 : r.relativeTo(e);
|
|
299
|
+
return o ? new $(e, o.start.offset, o.end.offset) : null;
|
|
286
300
|
}
|
|
287
301
|
static fromSelector(e, t) {
|
|
288
|
-
return new
|
|
302
|
+
return new $(e, t.start, t.end);
|
|
289
303
|
}
|
|
290
304
|
toSelector() {
|
|
291
305
|
return {
|
|
@@ -294,10 +308,10 @@ class v {
|
|
|
294
308
|
};
|
|
295
309
|
}
|
|
296
310
|
toRange() {
|
|
297
|
-
return
|
|
311
|
+
return q.fromOffsets(this.root, this.start, this.end).toRange();
|
|
298
312
|
}
|
|
299
313
|
}
|
|
300
|
-
const
|
|
314
|
+
const Be = (n) => {
|
|
301
315
|
var e;
|
|
302
316
|
switch (n.nodeType) {
|
|
303
317
|
case Node.ELEMENT_NODE:
|
|
@@ -306,70 +320,70 @@ const J = (n) => {
|
|
|
306
320
|
default:
|
|
307
321
|
return 0;
|
|
308
322
|
}
|
|
309
|
-
},
|
|
323
|
+
}, ke = (n) => {
|
|
310
324
|
let e = n.previousSibling, t = 0;
|
|
311
325
|
for (; e; )
|
|
312
|
-
t +=
|
|
326
|
+
t += Be(e), e = e.previousSibling;
|
|
313
327
|
return t;
|
|
314
|
-
},
|
|
328
|
+
}, He = (n, ...e) => {
|
|
315
329
|
let t = e.shift();
|
|
316
330
|
const o = n.ownerDocument.createNodeIterator(n, NodeFilter.SHOW_TEXT), r = [];
|
|
317
|
-
let s = o.nextNode(),
|
|
331
|
+
let s = o.nextNode(), l = null, d = 0;
|
|
318
332
|
for (; t !== void 0 && s; )
|
|
319
|
-
|
|
320
|
-
for (; t !== void 0 &&
|
|
321
|
-
r.push({ node:
|
|
333
|
+
l = s, d + l.data.length > t ? (r.push({ node: l, offset: t - d }), t = e.shift()) : (s = o.nextNode(), d += l.data.length);
|
|
334
|
+
for (; t !== void 0 && l && d === t; )
|
|
335
|
+
r.push({ node: l, offset: l.data.length }), t = e.shift();
|
|
322
336
|
return t !== void 0 && console.error("Offset exceeds text length"), r;
|
|
323
|
-
},
|
|
337
|
+
}, pt = (n, e, t, o) => {
|
|
324
338
|
const r = t - e;
|
|
325
|
-
return Math.abs(r - o) <= 5 ?
|
|
339
|
+
return Math.abs(r - o) <= 5 ? $.fromSelector(n, {
|
|
326
340
|
start: e,
|
|
327
341
|
end: t
|
|
328
342
|
}) : null;
|
|
329
|
-
},
|
|
330
|
-
const r = new
|
|
343
|
+
}, Nt = (n, e, t, o) => {
|
|
344
|
+
const r = new Qe();
|
|
331
345
|
r.Match_Distance = 5e3;
|
|
332
346
|
const s = n.textContent;
|
|
333
347
|
if (!s)
|
|
334
348
|
return null;
|
|
335
349
|
if (e.length > 32) {
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
350
|
+
const l = e.slice(0, 32), d = e.slice(-32), f = o - t;
|
|
351
|
+
let c = r.match_main(s, l, t);
|
|
352
|
+
const g = r.match_main(s, d, o), m = g + d.length;
|
|
353
|
+
if (c === -1 || g === -1)
|
|
340
354
|
return null;
|
|
341
|
-
const
|
|
342
|
-
if ((
|
|
343
|
-
return
|
|
344
|
-
if (
|
|
345
|
-
return
|
|
346
|
-
start:
|
|
347
|
-
end:
|
|
355
|
+
const u = m - c, S = Math.abs(u - f);
|
|
356
|
+
if ((c > m || S > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(s, l, m), c !== -1 && c < m))
|
|
357
|
+
return pt(n, c, m, f);
|
|
358
|
+
if (c < m && S <= 5)
|
|
359
|
+
return $.fromSelector(n, {
|
|
360
|
+
start: c,
|
|
361
|
+
end: m
|
|
348
362
|
});
|
|
349
363
|
} else {
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
return
|
|
353
|
-
start:
|
|
354
|
-
end:
|
|
364
|
+
const l = r.match_main(s, e, t);
|
|
365
|
+
if (l !== -1)
|
|
366
|
+
return $.fromSelector(n, {
|
|
367
|
+
start: l,
|
|
368
|
+
end: l + e.length
|
|
355
369
|
});
|
|
356
370
|
}
|
|
357
371
|
return null;
|
|
358
|
-
},
|
|
372
|
+
}, bt = (n, e) => {
|
|
359
373
|
if (!e) return null;
|
|
360
374
|
const { highlightData: t } = n, { textPosition: o, selectedText: r } = t;
|
|
361
|
-
return
|
|
375
|
+
return Nt(
|
|
362
376
|
e,
|
|
363
377
|
r,
|
|
364
378
|
(o == null ? void 0 : o.start) ?? 0,
|
|
365
379
|
(o == null ? void 0 : o.end) ?? 0
|
|
366
380
|
);
|
|
367
|
-
},
|
|
381
|
+
}, yt = (n, e, t) => {
|
|
368
382
|
const o = [], r = [];
|
|
369
383
|
for (const s of e) {
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
const
|
|
384
|
+
const l = bt(s, n);
|
|
385
|
+
if (l) {
|
|
386
|
+
const d = l.toRange(), f = d && X.fromRange(n, d);
|
|
373
387
|
o.push({
|
|
374
388
|
id: s.id,
|
|
375
389
|
reaction: s.reaction,
|
|
@@ -377,8 +391,8 @@ const J = (n) => {
|
|
|
377
391
|
highlightData: {
|
|
378
392
|
...s.highlightData,
|
|
379
393
|
hasNoHighlightAnymore: !1,
|
|
380
|
-
range: (
|
|
381
|
-
textPosition:
|
|
394
|
+
range: (f == null ? void 0 : f.toSelector()) ?? null,
|
|
395
|
+
textPosition: l.toSelector(),
|
|
382
396
|
pageLastModifiedAt: t
|
|
383
397
|
}
|
|
384
398
|
});
|
|
@@ -395,54 +409,59 @@ const J = (n) => {
|
|
|
395
409
|
}) : r.push(s.id);
|
|
396
410
|
}
|
|
397
411
|
return { notesForUpdate: o, noteIdsForDelete: r };
|
|
398
|
-
},
|
|
399
|
-
|
|
412
|
+
}, Oe = (n, e) => {
|
|
413
|
+
var l;
|
|
414
|
+
if (!e) return;
|
|
415
|
+
const { highlightData: t, id: o } = n, { range: r } = t ?? {};
|
|
416
|
+
r && ((l = X.fromSelector(e, r)) == null ? void 0 : l.toRange()) && wt({ id: o });
|
|
417
|
+
}, St = (n) => {
|
|
418
|
+
const e = document.getElementById(Ce(n));
|
|
400
419
|
if (e) {
|
|
401
420
|
const t = e.getBoundingClientRect();
|
|
402
421
|
t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
403
422
|
}
|
|
404
|
-
},
|
|
423
|
+
}, oe = 90, re = 172, Ct = (n) => {
|
|
405
424
|
const e = n.getClientRects();
|
|
406
425
|
if (!e.length)
|
|
407
426
|
return null;
|
|
408
|
-
const t = e[0], o = e[e.length - 1], r = 4, s = 16,
|
|
409
|
-
const
|
|
410
|
-
return
|
|
411
|
-
},
|
|
412
|
-
const
|
|
413
|
-
return
|
|
427
|
+
const t = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, d = window.innerHeight || document.documentElement.clientHeight, f = (C) => {
|
|
428
|
+
const I = C + re;
|
|
429
|
+
return C >= s && I <= l - s;
|
|
430
|
+
}, c = (C) => {
|
|
431
|
+
const I = C + oe;
|
|
432
|
+
return C >= s && I <= d - s;
|
|
414
433
|
};
|
|
415
|
-
let
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
|
|
434
|
+
let g;
|
|
435
|
+
const m = t.right - re;
|
|
436
|
+
if (f(m))
|
|
437
|
+
g = m;
|
|
419
438
|
else {
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
422
|
-
|
|
439
|
+
const C = t.left;
|
|
440
|
+
if (f(C))
|
|
441
|
+
g = C;
|
|
423
442
|
else {
|
|
424
|
-
const
|
|
425
|
-
|
|
443
|
+
const O = (t.left + t.right) / 2 - re / 2;
|
|
444
|
+
f(O) ? g = O : m < s ? g = s : g = l - re - s;
|
|
426
445
|
}
|
|
427
446
|
}
|
|
428
|
-
let
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
|
|
447
|
+
let u;
|
|
448
|
+
const S = o.bottom + r;
|
|
449
|
+
if (c(S))
|
|
450
|
+
u = S;
|
|
432
451
|
else {
|
|
433
|
-
const
|
|
434
|
-
|
|
452
|
+
const C = t.top - oe - r;
|
|
453
|
+
c(C) ? u = C : S + oe > d - s ? u = d - oe - s : u = s;
|
|
435
454
|
}
|
|
436
|
-
return { top:
|
|
437
|
-
},
|
|
455
|
+
return { top: u, left: g };
|
|
456
|
+
}, vt = (n, e) => {
|
|
438
457
|
for (const t of e)
|
|
439
458
|
if (n.start < t.end && n.end > t.start)
|
|
440
459
|
return !0;
|
|
441
460
|
return !1;
|
|
442
|
-
},
|
|
461
|
+
}, Se = (n) => `highlight-wrapper-${n}`, Ce = (n) => `${Se(n)}-start`, ze = (n) => `${Se(n)}-end`, te = (n) => `[data-highlight-id="${CSS.escape(n)}"]`, ae = (n, e) => {
|
|
443
462
|
const t = Number.parseInt(n.slice(1, 3), 16), o = Number.parseInt(n.slice(3, 5), 16), r = Number.parseInt(n.slice(5, 7), 16);
|
|
444
463
|
return `rgba(${t}, ${o}, ${r}, ${e})`;
|
|
445
|
-
},
|
|
464
|
+
}, Et = (n, e) => {
|
|
446
465
|
var t;
|
|
447
466
|
try {
|
|
448
467
|
const o = ((t = e.nodeValue) == null ? void 0 : t.length) ?? e.childNodes.length;
|
|
@@ -450,7 +469,7 @@ const J = (n) => {
|
|
|
450
469
|
} catch {
|
|
451
470
|
return !1;
|
|
452
471
|
}
|
|
453
|
-
},
|
|
472
|
+
}, Tt = (n) => {
|
|
454
473
|
var s;
|
|
455
474
|
if (n.collapsed)
|
|
456
475
|
return [];
|
|
@@ -460,216 +479,223 @@ const J = (n) => {
|
|
|
460
479
|
const t = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
|
|
461
480
|
let r = (o == null ? void 0 : o.nextNode()) || null;
|
|
462
481
|
for (; r; ) {
|
|
463
|
-
if (!
|
|
482
|
+
if (!Et(n, r)) {
|
|
464
483
|
r = (o == null ? void 0 : o.nextNode()) || null;
|
|
465
484
|
continue;
|
|
466
485
|
}
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
|
|
486
|
+
const l = r;
|
|
487
|
+
if (l === n.startContainer && n.startOffset > 0) {
|
|
488
|
+
l.splitText(n.startOffset), r = (o == null ? void 0 : o.nextNode()) || null;
|
|
470
489
|
continue;
|
|
471
490
|
}
|
|
472
|
-
|
|
491
|
+
l === n.endContainer && n.endOffset < l.data.length && l.splitText(n.endOffset), t.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
|
|
473
492
|
}
|
|
474
493
|
return t;
|
|
475
|
-
},
|
|
494
|
+
}, It = (n, e, t) => {
|
|
476
495
|
if (n.collapsed) return;
|
|
477
|
-
const o = e.id ?? "", r =
|
|
478
|
-
if (document.getElementById(
|
|
479
|
-
|
|
496
|
+
const o = e.id ?? "", r = Se(o);
|
|
497
|
+
if (document.getElementById(Ce(o))) {
|
|
498
|
+
xt(e, t);
|
|
480
499
|
return;
|
|
481
500
|
}
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
var
|
|
495
|
-
const
|
|
496
|
-
if ((
|
|
497
|
-
const
|
|
498
|
-
let
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
}), (
|
|
505
|
-
}),
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
}),
|
|
509
|
-
var
|
|
510
|
-
if (
|
|
511
|
-
|
|
512
|
-
else if (
|
|
513
|
-
const
|
|
514
|
-
for (const
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
|
|
501
|
+
const l = e.type === L.IMPORTANT ? t.colors.importantBackground : t.colors.confusingBackground, f = e.id === e.selectedNoteId ? l : ae(l, 0.5), c = e.type === L.IMPORTANT ? t.colors.importantUnderline : t.colors.confusingUnderline, g = e.type === L.IMPORTANT ? "solid" : "dashed", m = n.toString(), u = document.createElement("span");
|
|
502
|
+
u.id = `${r}-start`, u.className = "highlight-marker-start", u.dataset.highlightId = o || "", u.setAttribute("role", "button"), u.setAttribute("tabindex", "0"), u.setAttribute("aria-label", m), u.style.position = "relative", u.style.fontSize = "0", u.style.lineHeight = "0", u.style.width = "0", u.style.height = "0", u.style.margin = "0", u.style.padding = "0", u.style.border = "0";
|
|
503
|
+
const S = document.createElement("span");
|
|
504
|
+
S.id = ze(o), S.className = "highlight-marker-end", S.dataset.highlightId = o || "";
|
|
505
|
+
const C = n.cloneRange();
|
|
506
|
+
C.collapse(!1), C.insertNode(S);
|
|
507
|
+
const I = n.cloneRange();
|
|
508
|
+
I.collapse(!0), I.insertNode(u);
|
|
509
|
+
const O = document.createRange();
|
|
510
|
+
O.setStartAfter(u), O.setEndBefore(S);
|
|
511
|
+
const w = Tt(O).filter((b) => b.textContent && b.textContent.length > 0);
|
|
512
|
+
w.forEach((b, k) => {
|
|
513
|
+
var Y;
|
|
514
|
+
const D = b.parentElement;
|
|
515
|
+
if ((D == null ? void 0 : D.dataset.highlightId) === o) return;
|
|
516
|
+
const B = k === 0, E = k === w.length - 1, j = w.length === 1;
|
|
517
|
+
let A;
|
|
518
|
+
j ? A = "single" : B ? A = "first" : E ? A = "last" : A = "middle";
|
|
519
|
+
const x = document.createElement("span");
|
|
520
|
+
x.className = "highlight-content", x.dataset.highlightId = o || "", x.dataset.position = A, x.style.backgroundColor = f, x.style.textDecorationLine = "underline", x.style.textDecorationColor = c, x.style.textDecorationStyle = g, x.style.textDecorationThickness = t.borderWidthSmall, x.style.textUnderlineOffset = t.underlineOffset, x.style.cursor = "pointer", x.addEventListener("click", (T) => {
|
|
521
|
+
var p;
|
|
522
|
+
T.target.tagName !== "A" && ((p = e.onClick) == null || p.call(e));
|
|
523
|
+
}), (Y = b.parentNode) == null || Y.insertBefore(x, b), x.appendChild(b);
|
|
524
|
+
}), u.addEventListener("click", (b) => {
|
|
525
|
+
var k;
|
|
526
|
+
b.target.tagName !== "A" && ((k = e.onClick) == null || k.call(e));
|
|
527
|
+
}), u.addEventListener("keydown", (b) => {
|
|
528
|
+
var k;
|
|
529
|
+
if (b.key === "Enter" || b.key === " ")
|
|
530
|
+
b.preventDefault(), (k = e.onClick) == null || k.call(e);
|
|
531
|
+
else if (b.key === "Tab" && !b.shiftKey) {
|
|
532
|
+
const D = document.querySelectorAll(te(o));
|
|
533
|
+
for (const B of D) {
|
|
534
|
+
const E = B.querySelector("a");
|
|
535
|
+
if (E) {
|
|
536
|
+
b.preventDefault(), E.focus();
|
|
518
537
|
break;
|
|
519
538
|
}
|
|
520
539
|
}
|
|
521
540
|
}
|
|
522
|
-
}),
|
|
541
|
+
}), u.addEventListener("focus", () => {
|
|
523
542
|
document.querySelectorAll(
|
|
524
|
-
|
|
525
|
-
).forEach((
|
|
526
|
-
|
|
543
|
+
te(o)
|
|
544
|
+
).forEach((k) => {
|
|
545
|
+
k.classList.add("highlight-focused");
|
|
527
546
|
});
|
|
528
|
-
}),
|
|
547
|
+
}), u.addEventListener("blur", () => {
|
|
529
548
|
document.querySelectorAll(
|
|
530
|
-
|
|
531
|
-
).forEach((
|
|
532
|
-
|
|
549
|
+
te(o)
|
|
550
|
+
).forEach((k) => {
|
|
551
|
+
k.classList.remove("highlight-focused");
|
|
533
552
|
});
|
|
534
553
|
});
|
|
535
554
|
};
|
|
536
|
-
function
|
|
537
|
-
const t = n.type ===
|
|
555
|
+
function xt(n, e) {
|
|
556
|
+
const t = n.type === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, r = n.id === n.selectedNoteId ? t : ae(t, 0.5);
|
|
538
557
|
document.querySelectorAll(
|
|
539
|
-
|
|
540
|
-
).forEach((
|
|
541
|
-
|
|
558
|
+
te(n.id ?? "")
|
|
559
|
+
).forEach((l) => {
|
|
560
|
+
l.style.backgroundColor = r;
|
|
542
561
|
});
|
|
543
562
|
}
|
|
544
|
-
const
|
|
545
|
-
const e = n.id ?? "", t = document.getElementById(
|
|
563
|
+
const wt = (n) => {
|
|
564
|
+
const e = n.id ?? "", t = document.getElementById(Ce(e)), o = document.getElementById(ze(e));
|
|
546
565
|
document.querySelectorAll(
|
|
547
|
-
|
|
566
|
+
te(e)
|
|
548
567
|
).forEach((s) => {
|
|
549
|
-
var
|
|
568
|
+
var l;
|
|
550
569
|
for (; s.firstChild; )
|
|
551
|
-
(
|
|
570
|
+
(l = s.parentNode) == null || l.insertBefore(s.firstChild, s);
|
|
552
571
|
s.remove();
|
|
553
572
|
}), t == null || t.remove(), o == null || o.remove();
|
|
554
|
-
},
|
|
573
|
+
}, J = {
|
|
555
574
|
all: ["notebook"],
|
|
556
575
|
notes: (n) => ["notebook", "notes", n]
|
|
557
576
|
};
|
|
558
|
-
function
|
|
559
|
-
const e =
|
|
560
|
-
return
|
|
577
|
+
function kt(n) {
|
|
578
|
+
const e = ge();
|
|
579
|
+
return he({
|
|
561
580
|
mutationFn: (t) => n.createNote(t),
|
|
562
581
|
onSuccess: () => {
|
|
563
|
-
e.invalidateQueries({ queryKey:
|
|
582
|
+
e.invalidateQueries({ queryKey: J.all });
|
|
564
583
|
}
|
|
565
584
|
});
|
|
566
585
|
}
|
|
567
|
-
function
|
|
568
|
-
const e =
|
|
569
|
-
return
|
|
586
|
+
function Ot(n) {
|
|
587
|
+
const e = ge();
|
|
588
|
+
return he({
|
|
570
589
|
mutationFn: (t) => n.deleteNote(t),
|
|
571
590
|
onSuccess: () => {
|
|
572
|
-
e.invalidateQueries({ queryKey:
|
|
591
|
+
e.invalidateQueries({ queryKey: J.all });
|
|
573
592
|
}
|
|
574
593
|
});
|
|
575
594
|
}
|
|
576
|
-
function
|
|
595
|
+
function Rt({
|
|
577
596
|
api: n,
|
|
578
597
|
enabled: e = !0,
|
|
579
598
|
...t
|
|
580
599
|
}) {
|
|
581
|
-
return
|
|
582
|
-
queryKey:
|
|
600
|
+
return Ye({
|
|
601
|
+
queryKey: J.notes(t),
|
|
583
602
|
queryFn: () => n.getNotes(t),
|
|
584
603
|
enabled: e
|
|
585
604
|
});
|
|
586
605
|
}
|
|
587
|
-
function
|
|
588
|
-
const e =
|
|
589
|
-
return
|
|
606
|
+
function Dt(n) {
|
|
607
|
+
const e = ge();
|
|
608
|
+
return he({
|
|
590
609
|
mutationFn: ({ id: t, input: o }) => n.updateNote(t, o),
|
|
591
610
|
onMutate: async ({ id: t, input: o }) => {
|
|
592
|
-
await e.cancelQueries({ queryKey:
|
|
593
|
-
const s = e.getQueryCache().findAll({ queryKey:
|
|
594
|
-
for (const
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
...
|
|
598
|
-
notes:
|
|
599
|
-
(
|
|
611
|
+
await e.cancelQueries({ queryKey: J.all });
|
|
612
|
+
const s = e.getQueryCache().findAll({ queryKey: J.all }), l = /* @__PURE__ */ new Map();
|
|
613
|
+
for (const d of s) {
|
|
614
|
+
const f = d.state.data;
|
|
615
|
+
f && (l.set(d.queryKey, f), e.setQueryData(d.queryKey, {
|
|
616
|
+
...f,
|
|
617
|
+
notes: f.notes.map(
|
|
618
|
+
(c) => c.id === t ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
|
|
600
619
|
)
|
|
601
620
|
}));
|
|
602
621
|
}
|
|
603
|
-
return { previousData:
|
|
622
|
+
return { previousData: l };
|
|
604
623
|
},
|
|
605
624
|
onError: (t, o, r) => {
|
|
606
625
|
if (r != null && r.previousData)
|
|
607
|
-
for (const [s,
|
|
608
|
-
e.setQueryData(s,
|
|
626
|
+
for (const [s, l] of r.previousData)
|
|
627
|
+
e.setQueryData(s, l);
|
|
609
628
|
},
|
|
610
629
|
onSettled: () => {
|
|
611
|
-
e.invalidateQueries({ queryKey:
|
|
630
|
+
e.invalidateQueries({ queryKey: J.all });
|
|
612
631
|
}
|
|
613
632
|
});
|
|
614
633
|
}
|
|
615
|
-
const
|
|
616
|
-
notebook:
|
|
617
|
-
notes:
|
|
618
|
-
important:
|
|
619
|
-
unclear:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
634
|
+
const Lt = "Notebook", At = "Notes", Pt = "Important", Mt = "Unclear", Ft = "Back", Bt = "Edit note", Ht = "Save", zt = "Cancel", jt = "Delete note", _t = "note", Ut = "Add note (optional)", Wt = "Remove from Notebook", qt = "Add a note (optional).", $t = "Mark important", Gt = "Mark unclear", Kt = "Saved to Notebook.", Xt = "Note updated", Qt = "Note deleted", Yt = "Error saving to Notebook.", Vt = "Error updating note", Zt = "Note deletion failed", Jt = "Loading notes", en = "Failed to load notes", tn = "Start capturing your notes", nn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", on = "Nothing here yet", rn = "Adjust your filters or create a new note to get started.", sn = "You have no notes for the selected filter", ln = "Previous page", an = "Next page", cn = "All courses", dn = "All notes", un = "Close Notebook panel", fn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", mn = "The content you highlighted is no longer available.", ve = {
|
|
635
|
+
notebook: Lt,
|
|
636
|
+
notes: At,
|
|
637
|
+
important: Pt,
|
|
638
|
+
unclear: Mt,
|
|
639
|
+
back: Ft,
|
|
640
|
+
editNote: Bt,
|
|
641
|
+
save: Ht,
|
|
642
|
+
cancel: zt,
|
|
643
|
+
deleteNote: jt,
|
|
644
|
+
note: _t,
|
|
645
|
+
addNotePrompt: Ut,
|
|
646
|
+
removeFromNotebook: Wt,
|
|
647
|
+
addNoteOptional: qt,
|
|
648
|
+
markImportant: $t,
|
|
649
|
+
markUnclear: Gt,
|
|
650
|
+
savedToNotebook: Kt,
|
|
651
|
+
noteUpdated: Xt,
|
|
652
|
+
noteDeleted: Qt,
|
|
653
|
+
errorSavingNote: Yt,
|
|
654
|
+
errorUpdatingNote: Vt,
|
|
655
|
+
noteDeletionFailed: Zt,
|
|
656
|
+
loadingNotes: Jt,
|
|
657
|
+
failedToLoadNotes: en,
|
|
658
|
+
emptyStateHeading: tn,
|
|
659
|
+
emptyStateDescription: nn,
|
|
660
|
+
nothingHereYet: on,
|
|
661
|
+
adjustFiltersOrCreate: rn,
|
|
662
|
+
noNotesForFilter: sn,
|
|
663
|
+
previousPage: ln,
|
|
664
|
+
nextPage: an,
|
|
665
|
+
allCourses: cn,
|
|
666
|
+
allNotes: dn,
|
|
667
|
+
closeNotebookPanel: un,
|
|
668
|
+
featureDescription: fn,
|
|
669
|
+
highlightUnavailable: mn
|
|
670
|
+
}, je = De(null);
|
|
671
|
+
function _e(n, e) {
|
|
672
|
+
const t = ve[n] ?? n;
|
|
650
673
|
return e ? t.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : t;
|
|
651
674
|
}
|
|
652
|
-
function
|
|
675
|
+
function gn({
|
|
653
676
|
translations: n,
|
|
654
677
|
translate: e,
|
|
655
678
|
children: t
|
|
656
679
|
}) {
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
680
|
+
const o = me(
|
|
681
|
+
() => ({
|
|
682
|
+
translations: { ...ve, ...n },
|
|
683
|
+
translate: e ?? _e
|
|
684
|
+
}),
|
|
685
|
+
[n, e]
|
|
686
|
+
);
|
|
687
|
+
return /* @__PURE__ */ i(je.Provider, { value: o, children: t });
|
|
662
688
|
}
|
|
663
|
-
function
|
|
664
|
-
const n =
|
|
665
|
-
return n || { translations:
|
|
689
|
+
function Q() {
|
|
690
|
+
const n = Le(je);
|
|
691
|
+
return n || { translations: ve, translate: _e };
|
|
666
692
|
}
|
|
667
|
-
const
|
|
693
|
+
const hn = {
|
|
668
694
|
selectedNoteId: null,
|
|
669
695
|
isNoteEditing: !1,
|
|
670
696
|
isTrayOpen: !1
|
|
671
697
|
};
|
|
672
|
-
function
|
|
698
|
+
function pn(n, e) {
|
|
673
699
|
switch (e.type) {
|
|
674
700
|
case "SELECT_NOTE":
|
|
675
701
|
return {
|
|
@@ -689,20 +715,20 @@ function at(n, e) {
|
|
|
689
715
|
return n;
|
|
690
716
|
}
|
|
691
717
|
}
|
|
692
|
-
const
|
|
693
|
-
function
|
|
718
|
+
const Ue = De(null);
|
|
719
|
+
function Wn({
|
|
694
720
|
api: n,
|
|
695
721
|
currentUserId: e,
|
|
696
722
|
objectId: t,
|
|
697
723
|
objectType: o,
|
|
698
724
|
courseId: r,
|
|
699
725
|
pageLastModifiedAt: s,
|
|
700
|
-
onAnalyticsEvent:
|
|
701
|
-
translations:
|
|
702
|
-
translate:
|
|
703
|
-
children:
|
|
726
|
+
onAnalyticsEvent: l,
|
|
727
|
+
translations: d,
|
|
728
|
+
translate: f,
|
|
729
|
+
children: c
|
|
704
730
|
}) {
|
|
705
|
-
const [
|
|
731
|
+
const [g, m] = Ke(pn, hn), u = me(
|
|
706
732
|
() => ({
|
|
707
733
|
api: n,
|
|
708
734
|
currentUserId: e,
|
|
@@ -710,13 +736,13 @@ function Ot({
|
|
|
710
736
|
objectType: o,
|
|
711
737
|
courseId: r,
|
|
712
738
|
pageLastModifiedAt: s,
|
|
713
|
-
onAnalyticsEvent:
|
|
714
|
-
...
|
|
715
|
-
selectNote: (
|
|
716
|
-
clearSelectedNote: () =>
|
|
717
|
-
setEditing: (
|
|
718
|
-
openTray: () =>
|
|
719
|
-
closeTray: () =>
|
|
739
|
+
onAnalyticsEvent: l,
|
|
740
|
+
...g,
|
|
741
|
+
selectNote: (S, C = !1) => m({ type: "SELECT_NOTE", payload: { id: S, isEditing: C } }),
|
|
742
|
+
clearSelectedNote: () => m({ type: "CLEAR_SELECTED_NOTE" }),
|
|
743
|
+
setEditing: (S) => m({ type: "SET_EDITING", payload: S }),
|
|
744
|
+
openTray: () => m({ type: "OPEN_TRAY" }),
|
|
745
|
+
closeTray: () => m({ type: "CLOSE_TRAY" })
|
|
720
746
|
}),
|
|
721
747
|
[
|
|
722
748
|
n,
|
|
@@ -725,37 +751,803 @@ function Ot({
|
|
|
725
751
|
o,
|
|
726
752
|
r,
|
|
727
753
|
s,
|
|
728
|
-
|
|
729
|
-
|
|
754
|
+
l,
|
|
755
|
+
g
|
|
730
756
|
]
|
|
731
757
|
);
|
|
732
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ i(Ue.Provider, { value: u, children: /* @__PURE__ */ i(gn, { translations: d, translate: f, children: c }) });
|
|
733
759
|
}
|
|
734
|
-
function
|
|
735
|
-
const n =
|
|
760
|
+
function We() {
|
|
761
|
+
const n = Le(Ue);
|
|
736
762
|
if (!n)
|
|
737
763
|
throw new Error("useNotebook must be used within a NotebookProvider");
|
|
738
764
|
return n;
|
|
739
765
|
}
|
|
766
|
+
const Nn = ({ currentType: n, onSelectReaction: e }) => {
|
|
767
|
+
const { translations: t } = Q(), o = ne(null), r = ne(null);
|
|
768
|
+
return ee(() => {
|
|
769
|
+
n === L.CONFUSING && o.current ? o.current.focus() : n === L.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
|
|
770
|
+
}, [n]), /* @__PURE__ */ N(Z, { children: [
|
|
771
|
+
/* @__PURE__ */ N(Z.Item, { ref: o, onClick: () => e(L.CONFUSING), children: [
|
|
772
|
+
/* @__PURE__ */ i(pe, { size: "x-small" }),
|
|
773
|
+
` ${t.markUnclear}`
|
|
774
|
+
] }),
|
|
775
|
+
/* @__PURE__ */ N(Z.Item, { ref: r, onClick: () => e(L.IMPORTANT), children: [
|
|
776
|
+
/* @__PURE__ */ i(Ne, { size: "x-small" }),
|
|
777
|
+
` ${t.markImportant}`
|
|
778
|
+
] })
|
|
779
|
+
] });
|
|
780
|
+
}, ce = "notebook-inline-reaction-menu";
|
|
781
|
+
function qn({
|
|
782
|
+
containerRef: n,
|
|
783
|
+
highlightTheme: e,
|
|
784
|
+
debounceTime: t = 500
|
|
785
|
+
}) {
|
|
786
|
+
const {
|
|
787
|
+
api: o,
|
|
788
|
+
objectId: r,
|
|
789
|
+
objectType: s,
|
|
790
|
+
courseId: l,
|
|
791
|
+
pageLastModifiedAt: d,
|
|
792
|
+
selectedNoteId: f,
|
|
793
|
+
selectNote: c,
|
|
794
|
+
openTray: g
|
|
795
|
+
} = We(), { data: m } = Rt({
|
|
796
|
+
api: o,
|
|
797
|
+
filter: {
|
|
798
|
+
learningObject: { type: s, id: r }
|
|
799
|
+
},
|
|
800
|
+
courseId: l,
|
|
801
|
+
pageSize: 100
|
|
802
|
+
}), { mutate: u } = kt(o), { mutate: S } = Dt(o), { mutate: C } = Ot(o), I = ne([]), [O, R] = H([]), [w, b] = H(null), [k, D] = H(""), [B, E] = H(null), [j, A] = H(!1);
|
|
803
|
+
ee(() => {
|
|
804
|
+
const T = n.current;
|
|
805
|
+
if (!T) return;
|
|
806
|
+
const p = T.closest(".user_content") ?? T;
|
|
807
|
+
if (p.classList.contains("enhanced")) {
|
|
808
|
+
A(!0);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
const P = new MutationObserver((M) => {
|
|
812
|
+
for (const F of M)
|
|
813
|
+
if (F.type === "attributes" && F.attributeName === "class" && F.target.classList.contains("enhanced")) {
|
|
814
|
+
A(!0), P.disconnect();
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
return P.observe(p, { attributes: !0, attributeFilter: ["class"] }), () => P.disconnect();
|
|
819
|
+
}, [n]), ee(() => {
|
|
820
|
+
if (!j || !n.current) return;
|
|
821
|
+
let p = null;
|
|
822
|
+
const P = () => {
|
|
823
|
+
p && clearTimeout(p), p = setTimeout(() => {
|
|
824
|
+
var Te;
|
|
825
|
+
const y = window.getSelection(), h = n.current;
|
|
826
|
+
if (!(y != null && y.rangeCount) || !h) return;
|
|
827
|
+
const _ = y.toString().trim();
|
|
828
|
+
if (_ === "") return;
|
|
829
|
+
const V = y.getRangeAt(0);
|
|
830
|
+
if (!h.contains(V.commonAncestorContainer)) return;
|
|
831
|
+
const Ee = (Te = $.fromRange(h, V)) == null ? void 0 : Te.toSelector();
|
|
832
|
+
Ee && !vt(Ee, O) && (b(V.cloneRange()), D(_), E(Ct(V)));
|
|
833
|
+
}, t);
|
|
834
|
+
}, M = (y) => {
|
|
835
|
+
if (!(y.target instanceof Node)) return;
|
|
836
|
+
const h = document.getElementById(ce);
|
|
837
|
+
h != null && h.contains(y.target) ? (y.preventDefault(), y.stopImmediatePropagation()) : (E(null), b(null), D(""));
|
|
838
|
+
}, F = () => {
|
|
839
|
+
E(null), b(null), D("");
|
|
840
|
+
};
|
|
841
|
+
return document.addEventListener("selectionchange", P), document.addEventListener("mousedown", M), document.addEventListener("touchstart", M), window.addEventListener("scroll", F, !0), () => {
|
|
842
|
+
p && clearTimeout(p), document.removeEventListener("selectionchange", P), document.removeEventListener("mousedown", M), document.removeEventListener("touchstart", M), window.removeEventListener("scroll", F, !0);
|
|
843
|
+
};
|
|
844
|
+
}, [j, O, t, n]), ee(() => {
|
|
845
|
+
f && St(f);
|
|
846
|
+
}, [f]);
|
|
847
|
+
const x = Ae(
|
|
848
|
+
(T) => {
|
|
849
|
+
var _;
|
|
850
|
+
const p = n.current;
|
|
851
|
+
if (!p || !T.highlightData) return null;
|
|
852
|
+
const { highlightData: P, reaction: M, id: F } = T, { range: y } = P, h = y && ((_ = X.fromSelector(p, y)) == null ? void 0 : _.toRange());
|
|
853
|
+
if (h) {
|
|
854
|
+
const V = {
|
|
855
|
+
id: F,
|
|
856
|
+
selectedNoteId: f,
|
|
857
|
+
type: M[0],
|
|
858
|
+
onClick: () => {
|
|
859
|
+
c(F), g();
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
return It(h, V, e), P.textPosition;
|
|
863
|
+
}
|
|
864
|
+
return null;
|
|
865
|
+
},
|
|
866
|
+
[n, f, e, c, g]
|
|
867
|
+
);
|
|
868
|
+
ee(() => {
|
|
869
|
+
if (!j || !m || !n.current) return;
|
|
870
|
+
const T = n.current, p = m.notes, P = /* @__PURE__ */ new Set(), M = [], F = [];
|
|
871
|
+
if (p.length === 0) {
|
|
872
|
+
if (I.current.length > 0) {
|
|
873
|
+
for (const y of I.current)
|
|
874
|
+
Oe(y, T);
|
|
875
|
+
I.current = [], R([]);
|
|
876
|
+
}
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
if (d && p[0].highlightData.pageLastModifiedAt !== d) {
|
|
880
|
+
const { notesForUpdate: y, noteIdsForDelete: h } = yt(
|
|
881
|
+
T,
|
|
882
|
+
p,
|
|
883
|
+
d
|
|
884
|
+
);
|
|
885
|
+
for (const _ of y)
|
|
886
|
+
S({ id: _.id, input: _ });
|
|
887
|
+
for (const _ of h)
|
|
888
|
+
C(_);
|
|
889
|
+
} else {
|
|
890
|
+
for (const y of p) {
|
|
891
|
+
const h = x(y);
|
|
892
|
+
P.add(y.id), h && (M.push(y), F.push(h));
|
|
893
|
+
}
|
|
894
|
+
for (const y of I.current)
|
|
895
|
+
P.has(y.id) || Oe(y, T);
|
|
896
|
+
R(F), I.current = M;
|
|
897
|
+
}
|
|
898
|
+
}, [
|
|
899
|
+
j,
|
|
900
|
+
m,
|
|
901
|
+
x,
|
|
902
|
+
d,
|
|
903
|
+
n,
|
|
904
|
+
S,
|
|
905
|
+
C
|
|
906
|
+
]);
|
|
907
|
+
const Y = (T) => {
|
|
908
|
+
const p = n.current;
|
|
909
|
+
if (!w || !p) return;
|
|
910
|
+
const P = X.fromRange(p, w), M = $.fromRange(p, w);
|
|
911
|
+
u(
|
|
912
|
+
{
|
|
913
|
+
courseId: l,
|
|
914
|
+
objectId: r,
|
|
915
|
+
objectType: s,
|
|
916
|
+
userText: "",
|
|
917
|
+
reaction: [T],
|
|
918
|
+
highlightData: {
|
|
919
|
+
selectedText: k,
|
|
920
|
+
textPosition: (M == null ? void 0 : M.toSelector()) ?? null,
|
|
921
|
+
range: P.toSelector(),
|
|
922
|
+
pageLastModifiedAt: d ?? ""
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
onSuccess: (F) => {
|
|
927
|
+
var h;
|
|
928
|
+
const y = F.id;
|
|
929
|
+
b(null), D(""), E(null), (h = window.getSelection()) == null || h.removeAllRanges(), c(y), g();
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
);
|
|
933
|
+
};
|
|
934
|
+
return !w || !B ? null : Xe(
|
|
935
|
+
/* @__PURE__ */ i(
|
|
936
|
+
"div",
|
|
937
|
+
{
|
|
938
|
+
id: ce,
|
|
939
|
+
role: "toolbar",
|
|
940
|
+
style: {
|
|
941
|
+
position: "fixed",
|
|
942
|
+
zIndex: 100,
|
|
943
|
+
top: B.top,
|
|
944
|
+
left: B.left,
|
|
945
|
+
whiteSpace: "nowrap"
|
|
946
|
+
},
|
|
947
|
+
onBlur: (T) => {
|
|
948
|
+
const p = document.getElementById(ce);
|
|
949
|
+
p != null && p.contains(T.relatedTarget) || (E(null), b(null), D(""));
|
|
950
|
+
},
|
|
951
|
+
children: /* @__PURE__ */ i(Nn, { onSelectReaction: Y })
|
|
952
|
+
}
|
|
953
|
+
),
|
|
954
|
+
document.body
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
const bn = (n, e) => ({
|
|
958
|
+
backgroundColor: n === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
|
|
959
|
+
underlineColor: n === L.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
|
|
960
|
+
underlineStyle: n === L.IMPORTANT ? "solid" : "dashed"
|
|
961
|
+
}), fe = ({
|
|
962
|
+
children: n,
|
|
963
|
+
type: e = L.IMPORTANT,
|
|
964
|
+
isCardActive: t = !0,
|
|
965
|
+
theme: o
|
|
966
|
+
}) => {
|
|
967
|
+
const r = bn(e, o), l = {
|
|
968
|
+
position: "relative",
|
|
969
|
+
backgroundColor: t ? r.backgroundColor : ae(r.backgroundColor, 0.5),
|
|
970
|
+
textDecorationLine: "underline",
|
|
971
|
+
textDecorationStyle: r.underlineStyle,
|
|
972
|
+
textDecorationColor: r.underlineColor,
|
|
973
|
+
textDecorationThickness: o.borderWidthSmall,
|
|
974
|
+
textUnderlineOffset: o.underlineOffset,
|
|
975
|
+
lineHeight: "normal"
|
|
976
|
+
};
|
|
977
|
+
return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: l, children: n });
|
|
978
|
+
}, qe = () => {
|
|
979
|
+
const { translations: n } = Q();
|
|
980
|
+
return /* @__PURE__ */ N(v, { gap: "xx-small", alignItems: "start", as: "div", children: [
|
|
981
|
+
/* @__PURE__ */ i(v.Item, { as: "div", children: /* @__PURE__ */ i(Ve, { color: "error" }) }),
|
|
982
|
+
/* @__PURE__ */ i(v.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(ue, { maxLines: 3, children: n.highlightUnavailable }) })
|
|
983
|
+
] });
|
|
984
|
+
}, $n = ({ children: n }) => {
|
|
985
|
+
const { isTrayOpen: e, closeTray: t } = We(), { translations: o } = Q();
|
|
986
|
+
return /* @__PURE__ */ i(
|
|
987
|
+
ot,
|
|
988
|
+
{
|
|
989
|
+
label: o.notebook,
|
|
990
|
+
open: e,
|
|
991
|
+
onDismiss: t,
|
|
992
|
+
placement: "end",
|
|
993
|
+
size: "regular",
|
|
994
|
+
children: /* @__PURE__ */ N(v, { direction: "column", height: "100vh", children: [
|
|
995
|
+
/* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(K, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ N(v, { justifyItems: "space-between", alignItems: "center", children: [
|
|
996
|
+
/* @__PURE__ */ i(ie, { level: "h3", children: o.notebook }),
|
|
997
|
+
/* @__PURE__ */ i(
|
|
998
|
+
nt,
|
|
999
|
+
{
|
|
1000
|
+
screenReaderLabel: o.closeNotebookPanel,
|
|
1001
|
+
onClick: t,
|
|
1002
|
+
size: "small",
|
|
1003
|
+
"data-testid": "notebook-tray-close"
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
] }) }) }),
|
|
1007
|
+
/* @__PURE__ */ i(v.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: n })
|
|
1008
|
+
] })
|
|
1009
|
+
}
|
|
1010
|
+
);
|
|
1011
|
+
}, yn = {
|
|
1012
|
+
[L.IMPORTANT]: {
|
|
1013
|
+
color: "info",
|
|
1014
|
+
translationKey: "important",
|
|
1015
|
+
icon: /* @__PURE__ */ i(Ne, { size: "x-small" })
|
|
1016
|
+
},
|
|
1017
|
+
[L.CONFUSING]: {
|
|
1018
|
+
color: "danger",
|
|
1019
|
+
translationKey: "unclear",
|
|
1020
|
+
icon: /* @__PURE__ */ i(pe, { size: "x-small" })
|
|
1021
|
+
}
|
|
1022
|
+
}, $e = ({ type: n, onTypeChange: e, renderAsMenuTrigger: t = !1 }) => {
|
|
1023
|
+
const { translations: o } = Q(), r = yn[n], s = o[r.translationKey], [l, d] = H(!1), f = ne(null), c = ne(null), g = Ae(
|
|
1024
|
+
(m) => {
|
|
1025
|
+
e == null || e(m), d(!1);
|
|
1026
|
+
},
|
|
1027
|
+
[e]
|
|
1028
|
+
);
|
|
1029
|
+
return t && e ? /* @__PURE__ */ N(
|
|
1030
|
+
Z,
|
|
1031
|
+
{
|
|
1032
|
+
placement: "bottom start",
|
|
1033
|
+
show: l,
|
|
1034
|
+
onToggle: (m) => d(m),
|
|
1035
|
+
shouldHideOnSelect: !0,
|
|
1036
|
+
shouldFocusTriggerOnClose: !0,
|
|
1037
|
+
trigger: /* @__PURE__ */ N(Ie, { color: r.color, renderIcon: r.icon, children: [
|
|
1038
|
+
s,
|
|
1039
|
+
" ",
|
|
1040
|
+
/* @__PURE__ */ i(Ze, { size: "x-small" })
|
|
1041
|
+
] }),
|
|
1042
|
+
children: [
|
|
1043
|
+
/* @__PURE__ */ N(Z.Item, { ref: f, onClick: () => g(L.CONFUSING), children: [
|
|
1044
|
+
/* @__PURE__ */ i(pe, { size: "x-small" }),
|
|
1045
|
+
` ${o.markUnclear}`
|
|
1046
|
+
] }),
|
|
1047
|
+
/* @__PURE__ */ N(Z.Item, { ref: c, onClick: () => g(L.IMPORTANT), children: [
|
|
1048
|
+
/* @__PURE__ */ i(Ne, { size: "x-small" }),
|
|
1049
|
+
` ${o.markImportant}`
|
|
1050
|
+
] })
|
|
1051
|
+
]
|
|
1052
|
+
}
|
|
1053
|
+
) : /* @__PURE__ */ i(Ie, { color: r.color, renderIcon: r.icon, children: s });
|
|
1054
|
+
};
|
|
1055
|
+
function Re(n, e) {
|
|
1056
|
+
return (n instanceof Date ? n : new Date(n)).toLocaleString(e, {
|
|
1057
|
+
year: "numeric",
|
|
1058
|
+
month: "short",
|
|
1059
|
+
day: "numeric"
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
const Sn = ({
|
|
1063
|
+
noteId: n,
|
|
1064
|
+
date: e,
|
|
1065
|
+
highlight: t,
|
|
1066
|
+
note: o,
|
|
1067
|
+
type: r,
|
|
1068
|
+
onClick: s,
|
|
1069
|
+
onDelete: l,
|
|
1070
|
+
onSaveNote: d,
|
|
1071
|
+
onTypeChange: f,
|
|
1072
|
+
isActive: c,
|
|
1073
|
+
isPanelView: g = !1,
|
|
1074
|
+
courseName: m,
|
|
1075
|
+
locale: u,
|
|
1076
|
+
highlightTheme: S,
|
|
1077
|
+
cardTheme: C,
|
|
1078
|
+
renderLink: I,
|
|
1079
|
+
href: O
|
|
1080
|
+
}) => {
|
|
1081
|
+
const { translations: R } = Q(), [w, b] = H(!1), [k, D] = H(!1), [B, E] = H(o || ""), [j, A] = H(!1), x = r === L.IMPORTANT ? R.important : R.unclear, Y = (h) => {
|
|
1082
|
+
h.key === "Enter" && (h.preventDefault(), s == null || s());
|
|
1083
|
+
}, T = [x, R.note];
|
|
1084
|
+
t && T.push(t), o && T.push(o), e && T.push(Re(e, u)), m && T.push(m);
|
|
1085
|
+
const p = T.join(", "), P = r === L.CONFUSING ? C.confusingBorderColor : C.importantBorderColor, F = {
|
|
1086
|
+
borderStyle: "solid",
|
|
1087
|
+
borderColor: c || w ? P : ae(P, 0.5),
|
|
1088
|
+
borderWidth: "0.0625rem 0.0625rem 0.25rem 0.25rem",
|
|
1089
|
+
borderRadius: "1rem",
|
|
1090
|
+
padding: "1rem",
|
|
1091
|
+
cursor: k ? "default" : "pointer",
|
|
1092
|
+
position: "relative"
|
|
1093
|
+
}, y = (
|
|
1094
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: role is conditionally set to "button"
|
|
1095
|
+
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label applies when role="button"
|
|
1096
|
+
/* @__PURE__ */ N(
|
|
1097
|
+
"div",
|
|
1098
|
+
{
|
|
1099
|
+
role: O || k ? void 0 : "button",
|
|
1100
|
+
"aria-label": O ? void 0 : p,
|
|
1101
|
+
"aria-pressed": O || k ? void 0 : c,
|
|
1102
|
+
tabIndex: O || c ? -1 : 0,
|
|
1103
|
+
"data-testid": "note-card",
|
|
1104
|
+
onClick: c ? void 0 : s,
|
|
1105
|
+
onMouseEnter: () => b(!0),
|
|
1106
|
+
onMouseLeave: () => b(!1),
|
|
1107
|
+
onKeyDown: c ? void 0 : Y,
|
|
1108
|
+
style: F,
|
|
1109
|
+
children: [
|
|
1110
|
+
/* @__PURE__ */ N(v, { direction: "column", gap: "small", children: [
|
|
1111
|
+
/* @__PURE__ */ i(
|
|
1112
|
+
$e,
|
|
1113
|
+
{
|
|
1114
|
+
type: r,
|
|
1115
|
+
onTypeChange: g && f ? (h) => f(n, h) : void 0,
|
|
1116
|
+
renderAsMenuTrigger: g && !!f && !!c
|
|
1117
|
+
}
|
|
1118
|
+
),
|
|
1119
|
+
t ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(U, { children: c && g ? /* @__PURE__ */ i(
|
|
1120
|
+
fe,
|
|
1121
|
+
{
|
|
1122
|
+
type: r,
|
|
1123
|
+
isCardActive: !!c || w,
|
|
1124
|
+
theme: S,
|
|
1125
|
+
children: t
|
|
1126
|
+
}
|
|
1127
|
+
) : /* @__PURE__ */ i(ue, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ i(
|
|
1128
|
+
fe,
|
|
1129
|
+
{
|
|
1130
|
+
type: r,
|
|
1131
|
+
isCardActive: !!c || w,
|
|
1132
|
+
theme: S,
|
|
1133
|
+
children: t
|
|
1134
|
+
}
|
|
1135
|
+
) }) }) }) : /* @__PURE__ */ i(qe, {}),
|
|
1136
|
+
/* @__PURE__ */ N(v, { direction: "column", gap: c ? "small" : "none", children: [
|
|
1137
|
+
k && g ? /* @__PURE__ */ N(v, { direction: "column", gap: "x-small", children: [
|
|
1138
|
+
/* @__PURE__ */ i(
|
|
1139
|
+
Pe,
|
|
1140
|
+
{
|
|
1141
|
+
label: /* @__PURE__ */ i(rt, { children: R.editNote }),
|
|
1142
|
+
value: B,
|
|
1143
|
+
onChange: (h) => E(h.target.value),
|
|
1144
|
+
placeholder: R.addNoteOptional
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ N(v, { gap: "xx-small", children: [
|
|
1148
|
+
/* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1149
|
+
W,
|
|
1150
|
+
{
|
|
1151
|
+
display: "block",
|
|
1152
|
+
size: "small",
|
|
1153
|
+
"data-testid": "note-card-cancel",
|
|
1154
|
+
onClick: () => {
|
|
1155
|
+
E(o || ""), D(!1);
|
|
1156
|
+
},
|
|
1157
|
+
children: R.cancel
|
|
1158
|
+
}
|
|
1159
|
+
) }),
|
|
1160
|
+
/* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1161
|
+
W,
|
|
1162
|
+
{
|
|
1163
|
+
display: "block",
|
|
1164
|
+
color: "primary",
|
|
1165
|
+
size: "small",
|
|
1166
|
+
"data-testid": "note-card-save",
|
|
1167
|
+
onClick: () => {
|
|
1168
|
+
d == null || d(n, B), D(!1);
|
|
1169
|
+
},
|
|
1170
|
+
interaction: B.trim() ? "enabled" : "disabled",
|
|
1171
|
+
children: R.save
|
|
1172
|
+
}
|
|
1173
|
+
) })
|
|
1174
|
+
] })
|
|
1175
|
+
] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && g ? /* @__PURE__ */ N(U, { children: [
|
|
1176
|
+
o,
|
|
1177
|
+
" ",
|
|
1178
|
+
/* @__PURE__ */ i(
|
|
1179
|
+
G,
|
|
1180
|
+
{
|
|
1181
|
+
size: "small",
|
|
1182
|
+
withBackground: !1,
|
|
1183
|
+
withBorder: !1,
|
|
1184
|
+
screenReaderLabel: R.editNote,
|
|
1185
|
+
"data-testid": "note-card-edit",
|
|
1186
|
+
onClick: (h) => {
|
|
1187
|
+
h.stopPropagation(), D(!0);
|
|
1188
|
+
},
|
|
1189
|
+
children: /* @__PURE__ */ i(de, {})
|
|
1190
|
+
}
|
|
1191
|
+
)
|
|
1192
|
+
] }) : /* @__PURE__ */ i(U, { children: /* @__PURE__ */ i(ue, { maxLines: 3, truncate: "word", children: o }) }) }) : g && c ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ N(U, { color: "secondary", children: [
|
|
1193
|
+
R.addNotePrompt,
|
|
1194
|
+
" ",
|
|
1195
|
+
/* @__PURE__ */ i(
|
|
1196
|
+
G,
|
|
1197
|
+
{
|
|
1198
|
+
size: "small",
|
|
1199
|
+
withBackground: !1,
|
|
1200
|
+
withBorder: !1,
|
|
1201
|
+
screenReaderLabel: R.editNote,
|
|
1202
|
+
"data-testid": "note-card-edit",
|
|
1203
|
+
onClick: (h) => {
|
|
1204
|
+
h.stopPropagation(), D(!0);
|
|
1205
|
+
},
|
|
1206
|
+
children: /* @__PURE__ */ i(de, {})
|
|
1207
|
+
}
|
|
1208
|
+
)
|
|
1209
|
+
] }) }) : null,
|
|
1210
|
+
/* @__PURE__ */ N(v, { justifyItems: "space-between", alignItems: "center", children: [
|
|
1211
|
+
/* @__PURE__ */ i(U, { size: "small", color: "secondary", children: Re(e, u) }),
|
|
1212
|
+
c && l && /* @__PURE__ */ i(
|
|
1213
|
+
G,
|
|
1214
|
+
{
|
|
1215
|
+
size: "small",
|
|
1216
|
+
withBackground: !1,
|
|
1217
|
+
withBorder: !1,
|
|
1218
|
+
color: "danger",
|
|
1219
|
+
screenReaderLabel: R.deleteNote,
|
|
1220
|
+
"data-testid": "note-card-delete",
|
|
1221
|
+
onClick: (h) => {
|
|
1222
|
+
h.stopPropagation(), A(!0);
|
|
1223
|
+
},
|
|
1224
|
+
children: /* @__PURE__ */ i(se, {})
|
|
1225
|
+
}
|
|
1226
|
+
)
|
|
1227
|
+
] }),
|
|
1228
|
+
m && /* @__PURE__ */ i(U, { size: "small", color: "secondary", children: m })
|
|
1229
|
+
] })
|
|
1230
|
+
] }),
|
|
1231
|
+
j && l && /* @__PURE__ */ i(
|
|
1232
|
+
K,
|
|
1233
|
+
{
|
|
1234
|
+
as: "div",
|
|
1235
|
+
background: "primary",
|
|
1236
|
+
padding: "medium",
|
|
1237
|
+
borderRadius: "large",
|
|
1238
|
+
position: "absolute",
|
|
1239
|
+
insetBlockStart: "0",
|
|
1240
|
+
insetBlockEnd: "0",
|
|
1241
|
+
insetInlineStart: "0",
|
|
1242
|
+
insetInlineEnd: "0",
|
|
1243
|
+
stacking: "above",
|
|
1244
|
+
children: /* @__PURE__ */ N(
|
|
1245
|
+
v,
|
|
1246
|
+
{
|
|
1247
|
+
direction: "column",
|
|
1248
|
+
justifyItems: "center",
|
|
1249
|
+
alignItems: "center",
|
|
1250
|
+
gap: "x-small",
|
|
1251
|
+
height: "100%",
|
|
1252
|
+
children: [
|
|
1253
|
+
/* @__PURE__ */ i(
|
|
1254
|
+
W,
|
|
1255
|
+
{
|
|
1256
|
+
display: "block",
|
|
1257
|
+
color: "danger",
|
|
1258
|
+
size: "small",
|
|
1259
|
+
renderIcon: /* @__PURE__ */ i(se, {}),
|
|
1260
|
+
"data-testid": "note-card-confirm-delete",
|
|
1261
|
+
onClick: (h) => {
|
|
1262
|
+
h.stopPropagation(), l(n), A(!1);
|
|
1263
|
+
},
|
|
1264
|
+
children: R.deleteNote
|
|
1265
|
+
}
|
|
1266
|
+
),
|
|
1267
|
+
/* @__PURE__ */ i(
|
|
1268
|
+
W,
|
|
1269
|
+
{
|
|
1270
|
+
display: "block",
|
|
1271
|
+
size: "small",
|
|
1272
|
+
"data-testid": "note-card-cancel-delete",
|
|
1273
|
+
onClick: (h) => {
|
|
1274
|
+
h.stopPropagation(), A(!1);
|
|
1275
|
+
},
|
|
1276
|
+
children: R.cancel
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
]
|
|
1280
|
+
}
|
|
1281
|
+
)
|
|
1282
|
+
}
|
|
1283
|
+
)
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
)
|
|
1287
|
+
);
|
|
1288
|
+
return O && I ? I({ href: O, children: y, ariaLabel: p }) : y;
|
|
1289
|
+
};
|
|
1290
|
+
function Cn(n, e) {
|
|
1291
|
+
const t = Array.from({ length: e }, () => []);
|
|
1292
|
+
return n.forEach((o, r) => {
|
|
1293
|
+
t[r % e].push(o);
|
|
1294
|
+
}), t;
|
|
1295
|
+
}
|
|
1296
|
+
const vn = {
|
|
1297
|
+
display: "flex",
|
|
1298
|
+
gap: "1rem",
|
|
1299
|
+
padding: "1rem",
|
|
1300
|
+
boxSizing: "border-box",
|
|
1301
|
+
width: "100%",
|
|
1302
|
+
alignItems: "flex-start"
|
|
1303
|
+
}, En = {
|
|
1304
|
+
display: "flex",
|
|
1305
|
+
flexDirection: "column",
|
|
1306
|
+
gap: "1rem",
|
|
1307
|
+
flex: 1,
|
|
1308
|
+
minWidth: 0
|
|
1309
|
+
}, Gn = ({
|
|
1310
|
+
notes: n,
|
|
1311
|
+
isLoading: e,
|
|
1312
|
+
isError: t,
|
|
1313
|
+
pageInfo: o,
|
|
1314
|
+
onPreviousPage: r,
|
|
1315
|
+
onNextPage: s,
|
|
1316
|
+
onNoteSelect: l,
|
|
1317
|
+
onNoteDelete: d,
|
|
1318
|
+
onNoteSave: f,
|
|
1319
|
+
onNoteTypeChange: c,
|
|
1320
|
+
selectedNoteId: g,
|
|
1321
|
+
hasActiveFilter: m = !1,
|
|
1322
|
+
columnCount: u = 1,
|
|
1323
|
+
highlightTheme: S,
|
|
1324
|
+
cardTheme: C,
|
|
1325
|
+
locale: I,
|
|
1326
|
+
renderNoteLink: O,
|
|
1327
|
+
noteHref: R
|
|
1328
|
+
}) => {
|
|
1329
|
+
const { translations: w } = Q(), b = me(
|
|
1330
|
+
() => Cn(n, u),
|
|
1331
|
+
[n, u]
|
|
1332
|
+
), k = (o == null ? void 0 : o.hasNextPage) || (o == null ? void 0 : o.hasPreviousPage);
|
|
1333
|
+
if (e)
|
|
1334
|
+
return /* @__PURE__ */ i(K, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(st, { renderTitle: w.loadingNotes }) });
|
|
1335
|
+
if (t)
|
|
1336
|
+
return /* @__PURE__ */ i(K, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(ie, { level: "h4", children: w.failedToLoadNotes }) });
|
|
1337
|
+
if (n.length === 0) {
|
|
1338
|
+
const D = m ? w.nothingHereYet : w.emptyStateHeading, B = m ? w.adjustFiltersOrCreate : w.emptyStateDescription;
|
|
1339
|
+
return /* @__PURE__ */ N(
|
|
1340
|
+
v,
|
|
1341
|
+
{
|
|
1342
|
+
direction: "column",
|
|
1343
|
+
alignItems: "center",
|
|
1344
|
+
justifyItems: "center",
|
|
1345
|
+
padding: "large",
|
|
1346
|
+
gap: "small",
|
|
1347
|
+
"data-testid": "empty-notes",
|
|
1348
|
+
children: [
|
|
1349
|
+
/* @__PURE__ */ i(ie, { level: "h3", children: D }),
|
|
1350
|
+
/* @__PURE__ */ i(U, { color: "secondary", children: B })
|
|
1351
|
+
]
|
|
1352
|
+
}
|
|
1353
|
+
);
|
|
1354
|
+
}
|
|
1355
|
+
return /* @__PURE__ */ N(Ge, { children: [
|
|
1356
|
+
/* @__PURE__ */ i("div", { style: vn, "data-testid": "notes-grid", children: b.map((D, B) => (
|
|
1357
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional, index is stable
|
|
1358
|
+
/* @__PURE__ */ i("div", { style: En, children: D.map((E) => {
|
|
1359
|
+
var j;
|
|
1360
|
+
return /* @__PURE__ */ i(
|
|
1361
|
+
Sn,
|
|
1362
|
+
{
|
|
1363
|
+
noteId: E.id,
|
|
1364
|
+
date: E.createdAt,
|
|
1365
|
+
type: E.reaction[0] ?? L.IMPORTANT,
|
|
1366
|
+
highlight: (j = E.highlightData) == null ? void 0 : j.selectedText,
|
|
1367
|
+
note: E.userText,
|
|
1368
|
+
isActive: g === E.id,
|
|
1369
|
+
isPanelView: !!g,
|
|
1370
|
+
onClick: l ? () => l(E.id) : void 0,
|
|
1371
|
+
onDelete: d ? (A) => d(A) : void 0,
|
|
1372
|
+
onSaveNote: f ? (A, x) => f(A, x) : void 0,
|
|
1373
|
+
onTypeChange: c ? (A, x) => c(A, x) : void 0,
|
|
1374
|
+
highlightTheme: S,
|
|
1375
|
+
cardTheme: C,
|
|
1376
|
+
locale: I,
|
|
1377
|
+
renderLink: O,
|
|
1378
|
+
href: R ? R(E.id, E) : void 0
|
|
1379
|
+
},
|
|
1380
|
+
E.id
|
|
1381
|
+
);
|
|
1382
|
+
}) }, B)
|
|
1383
|
+
)) }),
|
|
1384
|
+
k && /* @__PURE__ */ N(v, { justifyItems: "center", gap: "small", padding: "small", "data-testid": "notes-pagination", children: [
|
|
1385
|
+
/* @__PURE__ */ i(
|
|
1386
|
+
G,
|
|
1387
|
+
{
|
|
1388
|
+
size: "small",
|
|
1389
|
+
screenReaderLabel: w.previousPage,
|
|
1390
|
+
"data-testid": "notes-prev-page",
|
|
1391
|
+
interaction: o != null && o.hasPreviousPage ? "enabled" : "disabled",
|
|
1392
|
+
onClick: r,
|
|
1393
|
+
children: /* @__PURE__ */ i(Je, {})
|
|
1394
|
+
}
|
|
1395
|
+
),
|
|
1396
|
+
/* @__PURE__ */ i(
|
|
1397
|
+
G,
|
|
1398
|
+
{
|
|
1399
|
+
size: "small",
|
|
1400
|
+
screenReaderLabel: w.nextPage,
|
|
1401
|
+
"data-testid": "notes-next-page",
|
|
1402
|
+
interaction: o != null && o.hasNextPage ? "enabled" : "disabled",
|
|
1403
|
+
onClick: s,
|
|
1404
|
+
children: /* @__PURE__ */ i(et, {})
|
|
1405
|
+
}
|
|
1406
|
+
)
|
|
1407
|
+
] })
|
|
1408
|
+
] });
|
|
1409
|
+
}, Kn = ({
|
|
1410
|
+
noteText: n,
|
|
1411
|
+
reaction: e,
|
|
1412
|
+
highlightText: t,
|
|
1413
|
+
highlightTheme: o,
|
|
1414
|
+
onSave: r,
|
|
1415
|
+
onDelete: s,
|
|
1416
|
+
onTypeChange: l,
|
|
1417
|
+
onBack: d,
|
|
1418
|
+
editing: f = !1
|
|
1419
|
+
}) => {
|
|
1420
|
+
const { translations: c } = Q(), [g, m] = H(f), [u, S] = H(n || ""), [C, I] = H(!1);
|
|
1421
|
+
return /* @__PURE__ */ N(v, { direction: "column", gap: "small", "data-testid": "single-note", children: [
|
|
1422
|
+
t != null ? /* @__PURE__ */ i(K, { as: "div", children: /* @__PURE__ */ i(U, { children: /* @__PURE__ */ i(fe, { type: e, isCardActive: !0, theme: o, children: t }) }) }) : /* @__PURE__ */ i(qe, {}),
|
|
1423
|
+
/* @__PURE__ */ i($e, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
|
|
1424
|
+
g ? /* @__PURE__ */ N(v, { direction: "column", gap: "x-small", children: [
|
|
1425
|
+
/* @__PURE__ */ i(
|
|
1426
|
+
Pe,
|
|
1427
|
+
{
|
|
1428
|
+
label: c.addNoteOptional,
|
|
1429
|
+
value: u,
|
|
1430
|
+
onChange: (O) => S(O.target.value),
|
|
1431
|
+
resize: "vertical"
|
|
1432
|
+
}
|
|
1433
|
+
),
|
|
1434
|
+
/* @__PURE__ */ N(v, { gap: "xx-small", children: [
|
|
1435
|
+
/* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1436
|
+
W,
|
|
1437
|
+
{
|
|
1438
|
+
display: "block",
|
|
1439
|
+
size: "small",
|
|
1440
|
+
"data-testid": "single-note-cancel",
|
|
1441
|
+
onClick: () => {
|
|
1442
|
+
S(n || ""), m(!1);
|
|
1443
|
+
},
|
|
1444
|
+
children: c.cancel
|
|
1445
|
+
}
|
|
1446
|
+
) }),
|
|
1447
|
+
/* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1448
|
+
W,
|
|
1449
|
+
{
|
|
1450
|
+
display: "block",
|
|
1451
|
+
color: "primary",
|
|
1452
|
+
size: "small",
|
|
1453
|
+
"data-testid": "single-note-save",
|
|
1454
|
+
onClick: () => {
|
|
1455
|
+
r(u), m(!1);
|
|
1456
|
+
},
|
|
1457
|
+
children: c.save
|
|
1458
|
+
}
|
|
1459
|
+
) })
|
|
1460
|
+
] })
|
|
1461
|
+
] }) : /* @__PURE__ */ N(v, { direction: "column", gap: "small", children: [
|
|
1462
|
+
n && /* @__PURE__ */ N(K, { as: "div", children: [
|
|
1463
|
+
/* @__PURE__ */ i(ie, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
|
|
1464
|
+
/* @__PURE__ */ i(U, { children: n })
|
|
1465
|
+
] }),
|
|
1466
|
+
/* @__PURE__ */ N(v, { justifyItems: "space-between", children: [
|
|
1467
|
+
/* @__PURE__ */ i(
|
|
1468
|
+
W,
|
|
1469
|
+
{
|
|
1470
|
+
size: "small",
|
|
1471
|
+
renderIcon: /* @__PURE__ */ i(tt, {}),
|
|
1472
|
+
"data-testid": "single-note-back",
|
|
1473
|
+
onClick: () => d == null ? void 0 : d(),
|
|
1474
|
+
children: c.back
|
|
1475
|
+
}
|
|
1476
|
+
),
|
|
1477
|
+
/* @__PURE__ */ N(v, { gap: "xx-small", children: [
|
|
1478
|
+
s && /* @__PURE__ */ i(
|
|
1479
|
+
G,
|
|
1480
|
+
{
|
|
1481
|
+
size: "small",
|
|
1482
|
+
withBackground: !1,
|
|
1483
|
+
withBorder: !1,
|
|
1484
|
+
color: "danger",
|
|
1485
|
+
screenReaderLabel: c.deleteNote,
|
|
1486
|
+
"data-testid": "single-note-delete",
|
|
1487
|
+
onClick: () => I(!0),
|
|
1488
|
+
children: /* @__PURE__ */ i(se, {})
|
|
1489
|
+
}
|
|
1490
|
+
),
|
|
1491
|
+
/* @__PURE__ */ i(
|
|
1492
|
+
G,
|
|
1493
|
+
{
|
|
1494
|
+
size: "small",
|
|
1495
|
+
withBackground: !1,
|
|
1496
|
+
withBorder: !1,
|
|
1497
|
+
screenReaderLabel: c.editNote,
|
|
1498
|
+
"data-testid": "single-note-edit",
|
|
1499
|
+
onClick: () => m(!0),
|
|
1500
|
+
children: /* @__PURE__ */ i(de, {})
|
|
1501
|
+
}
|
|
1502
|
+
)
|
|
1503
|
+
] })
|
|
1504
|
+
] }),
|
|
1505
|
+
C && s && /* @__PURE__ */ i(K, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ N(v, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
|
|
1506
|
+
/* @__PURE__ */ i(
|
|
1507
|
+
W,
|
|
1508
|
+
{
|
|
1509
|
+
display: "block",
|
|
1510
|
+
color: "danger",
|
|
1511
|
+
size: "small",
|
|
1512
|
+
renderIcon: /* @__PURE__ */ i(se, {}),
|
|
1513
|
+
"data-testid": "single-note-confirm-delete",
|
|
1514
|
+
onClick: () => {
|
|
1515
|
+
s(), I(!1);
|
|
1516
|
+
},
|
|
1517
|
+
children: c.deleteNote
|
|
1518
|
+
}
|
|
1519
|
+
),
|
|
1520
|
+
/* @__PURE__ */ i(
|
|
1521
|
+
W,
|
|
1522
|
+
{
|
|
1523
|
+
display: "block",
|
|
1524
|
+
size: "small",
|
|
1525
|
+
"data-testid": "single-note-cancel-delete",
|
|
1526
|
+
onClick: () => I(!1),
|
|
1527
|
+
children: c.cancel
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
] }) })
|
|
1531
|
+
] })
|
|
1532
|
+
] });
|
|
1533
|
+
};
|
|
740
1534
|
export {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
Ct as useUpdateNote,
|
|
760
|
-
K as xpathFromNode
|
|
1535
|
+
qn as ContentWithNoteWrapper,
|
|
1536
|
+
fe as Highlight,
|
|
1537
|
+
qe as HighlightError,
|
|
1538
|
+
Sn as NoteCard,
|
|
1539
|
+
$e as NoteChip,
|
|
1540
|
+
Nn as NoteReactionMenu,
|
|
1541
|
+
Wn as NotebookProvider,
|
|
1542
|
+
$n as NotebookTray,
|
|
1543
|
+
Gn as NotesListView,
|
|
1544
|
+
L as REACTION_TYPE,
|
|
1545
|
+
Kn as SingleNote,
|
|
1546
|
+
ae as createTransparentColor,
|
|
1547
|
+
kt as useCreateNote,
|
|
1548
|
+
Ot as useDeleteNote,
|
|
1549
|
+
Rt as useGetNotes,
|
|
1550
|
+
We as useNotebook,
|
|
1551
|
+
Q as useNotebookTranslations,
|
|
1552
|
+
Dt as useUpdateNote
|
|
761
1553
|
};
|