@floegence/floe-webapp-core 0.35.42 → 0.35.44
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/components/notes/NotesBoard.d.ts +36 -0
- package/dist/components/notes/NotesBoard.js +141 -0
- package/dist/components/notes/NotesBoardNote.d.ts +17 -0
- package/dist/components/notes/NotesBoardNote.js +114 -0
- package/dist/components/notes/NotesContextMenu.js +7 -7
- package/dist/components/notes/NotesEditorFlyout.d.ts +19 -0
- package/dist/components/notes/NotesEditorFlyout.js +92 -0
- package/dist/components/notes/NotesOverlay.d.ts +9 -1
- package/dist/components/notes/NotesOverlay.js +445 -0
- package/dist/components/notes/NotesOverlayLegacy.d.ts +1 -8
- package/dist/components/notes/NotesOverviewPanel.d.ts +22 -0
- package/dist/components/notes/NotesOverviewPanel.js +52 -0
- package/dist/components/notes/NotesTopicRail.d.ts +18 -0
- package/dist/components/notes/NotesTopicRail.js +94 -0
- package/dist/components/notes/NotesTrashFlyout.d.ts +13 -0
- package/dist/components/notes/NotesTrashFlyout.js +90 -0
- package/dist/components/notes/index.d.ts +1 -1
- package/dist/components/notes/notesOverlayHelpers.d.ts +93 -0
- package/dist/components/notes/notesOverlayHelpers.js +159 -0
- package/dist/components/notes/useNotesOverlayModel.d.ts +196 -0
- package/dist/components/notes/useNotesOverlayModel.js +559 -0
- package/dist/floe.css +3 -1
- package/dist/full.js +1 -1
- package/dist/hooks/useOverlayMask.d.ts +3 -2
- package/dist/hooks/useOverlayMask.js +37 -27
- package/dist/notes-legacy.css +46 -12
- package/dist/notes.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/notes/NotesOverlayLegacy.js +0 -1551
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import { createComponent as o, insert as a, addEventListener as m, effect as f, setAttribute as S, Portal as u, memo as $, template as c, delegateEvents as k } from "solid-js/web";
|
|
2
|
+
import { Show as s } from "solid-js";
|
|
3
|
+
import { Motion as _ } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
|
+
import { easing as O, duration as T } from "../../utils/animations.js";
|
|
5
|
+
import { useOverlayMask as x } from "../../hooks/useOverlayMask.js";
|
|
6
|
+
import { X as D } from "../icons/index.js";
|
|
7
|
+
import { NotesBoard as I } from "./NotesBoard.js";
|
|
8
|
+
import { NotesContextMenu as F } from "./NotesContextMenu.js";
|
|
9
|
+
import { NotesEditorFlyout as R, NotesManualPasteFlyout as L } from "./NotesEditorFlyout.js";
|
|
10
|
+
import { NotesOverviewPanel as C } from "./NotesOverviewPanel.js";
|
|
11
|
+
import { NotesTopicRail as P } from "./NotesTopicRail.js";
|
|
12
|
+
import { NotesTrashFlyout as B } from "./NotesTrashFlyout.js";
|
|
13
|
+
import { NotesTrashCanIcon as E } from "./notesAppearance.js";
|
|
14
|
+
import { useNotesOverlayModel as Z } from "./useNotesOverlayModel.js";
|
|
15
|
+
var z = /* @__PURE__ */ c('<header class=notes-overlay__header data-floe-canvas-interactive=true><div class=notes-overlay__header-brand><div class=notes-overlay__header-title>Notes</div><div class=notes-overlay__header-separator></div><div class=notes-overlay__header-stat> topics</div><div class=notes-overlay__header-stat> live note</div><div class=notes-overlay__header-stat> trash</div></div><div class=notes-overlay__header-actions><button type=button class=notes-overlay__close aria-label="Close notes overlay"data-floe-overlay-close=true>'), W = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), q = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), V = /* @__PURE__ */ c("<div class=notes-overview-backdrop>"), A = /* @__PURE__ */ c("<div class=notes-overview-flyout>"), H = /* @__PURE__ */ c("<div class=notes-menu-backdrop>");
|
|
16
|
+
function X(l) {
|
|
17
|
+
return l === "floating" ? {
|
|
18
|
+
mode: l,
|
|
19
|
+
ariaModal: void 0,
|
|
20
|
+
lockBodyScroll: !1,
|
|
21
|
+
trapFocus: !1,
|
|
22
|
+
closeOnEscape: "inside",
|
|
23
|
+
blockWheel: "none",
|
|
24
|
+
blockTouchMove: "none",
|
|
25
|
+
autoFocus: !1
|
|
26
|
+
} : {
|
|
27
|
+
mode: "modal",
|
|
28
|
+
ariaModal: !0,
|
|
29
|
+
lockBodyScroll: !0,
|
|
30
|
+
trapFocus: !0,
|
|
31
|
+
closeOnEscape: !0,
|
|
32
|
+
blockWheel: "outside",
|
|
33
|
+
blockTouchMove: "outside",
|
|
34
|
+
autoFocus: {
|
|
35
|
+
selector: '[data-floe-overlay-close="true"]'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function le(l) {
|
|
40
|
+
const e = Z(l);
|
|
41
|
+
let v;
|
|
42
|
+
const i = () => X(l.interactionMode);
|
|
43
|
+
return x({
|
|
44
|
+
open: () => l.open,
|
|
45
|
+
root: () => v,
|
|
46
|
+
onClose: () => e.handleCloseRequest(),
|
|
47
|
+
lockBodyScroll: i().lockBodyScroll,
|
|
48
|
+
trapFocus: i().trapFocus,
|
|
49
|
+
closeOnEscape: i().closeOnEscape,
|
|
50
|
+
blockHotkeys: !0,
|
|
51
|
+
blockWheel: i().blockWheel,
|
|
52
|
+
blockTouchMove: i().blockTouchMove,
|
|
53
|
+
autoFocus: i().autoFocus,
|
|
54
|
+
restoreFocus: !0
|
|
55
|
+
}), o(s, {
|
|
56
|
+
get when() {
|
|
57
|
+
return l.open;
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return o(_.section, {
|
|
61
|
+
ref(t) {
|
|
62
|
+
var n = v;
|
|
63
|
+
typeof n == "function" ? n(t) : v = t;
|
|
64
|
+
},
|
|
65
|
+
class: "notes-overlay",
|
|
66
|
+
role: "dialog",
|
|
67
|
+
get "aria-modal"() {
|
|
68
|
+
return i().ariaModal;
|
|
69
|
+
},
|
|
70
|
+
"aria-label": "Notes overlay",
|
|
71
|
+
get "data-notes-interaction-mode"() {
|
|
72
|
+
return i().mode;
|
|
73
|
+
},
|
|
74
|
+
tabIndex: -1,
|
|
75
|
+
initial: {
|
|
76
|
+
opacity: 0
|
|
77
|
+
},
|
|
78
|
+
animate: {
|
|
79
|
+
opacity: 1
|
|
80
|
+
},
|
|
81
|
+
get transition() {
|
|
82
|
+
return {
|
|
83
|
+
duration: T.fast
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
get children() {
|
|
87
|
+
return [o(_.div, {
|
|
88
|
+
class: "notes-overlay__frame",
|
|
89
|
+
initial: {
|
|
90
|
+
opacity: 0,
|
|
91
|
+
y: 18,
|
|
92
|
+
scale: 0.986
|
|
93
|
+
},
|
|
94
|
+
animate: {
|
|
95
|
+
opacity: 1,
|
|
96
|
+
y: 0,
|
|
97
|
+
scale: 1
|
|
98
|
+
},
|
|
99
|
+
get transition() {
|
|
100
|
+
return {
|
|
101
|
+
duration: T.normal,
|
|
102
|
+
easing: O.easeOut
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
get children() {
|
|
106
|
+
return [(() => {
|
|
107
|
+
var t = z(), n = t.firstChild, r = n.firstChild, g = r.nextSibling, p = g.nextSibling, y = p.firstChild, d = p.nextSibling, w = d.firstChild, b = d.nextSibling, M = b.firstChild, N = n.nextSibling, h = N.firstChild;
|
|
108
|
+
return a(p, () => e.header.topicCount(), y), a(d, () => e.header.totalLiveNotes(), w), a(d, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), a(b, () => e.header.trashCount(), M), h.$$click = () => e.handleCloseRequest(), a(h, o(D, {
|
|
109
|
+
class: "w-4 h-4"
|
|
110
|
+
})), t;
|
|
111
|
+
})(), (() => {
|
|
112
|
+
var t = q(), n = t.firstChild;
|
|
113
|
+
return a(t, o(P, {
|
|
114
|
+
get topics() {
|
|
115
|
+
return e.rail.topics();
|
|
116
|
+
},
|
|
117
|
+
get activeTopicID() {
|
|
118
|
+
return e.rail.activeTopicID();
|
|
119
|
+
},
|
|
120
|
+
get draftTopicTitle() {
|
|
121
|
+
return e.rail.draftTopicTitle();
|
|
122
|
+
},
|
|
123
|
+
get renamingTopicID() {
|
|
124
|
+
return e.rail.renamingTopicID();
|
|
125
|
+
},
|
|
126
|
+
get renamingTopicTitle() {
|
|
127
|
+
return e.rail.renamingTopicTitle();
|
|
128
|
+
},
|
|
129
|
+
get getLiveNoteCount() {
|
|
130
|
+
return e.rail.getLiveNoteCount;
|
|
131
|
+
},
|
|
132
|
+
get onDraftTopicTitleChange() {
|
|
133
|
+
return e.rail.setDraftTopicTitle;
|
|
134
|
+
},
|
|
135
|
+
onSubmitTopic: () => {
|
|
136
|
+
e.rail.submitTopic();
|
|
137
|
+
},
|
|
138
|
+
get onSelectTopic() {
|
|
139
|
+
return e.rail.selectTopic;
|
|
140
|
+
},
|
|
141
|
+
get onStartRename() {
|
|
142
|
+
return e.rail.startTopicRename;
|
|
143
|
+
},
|
|
144
|
+
get onRenamingTopicTitleChange() {
|
|
145
|
+
return e.rail.setRenamingTopicTitle;
|
|
146
|
+
},
|
|
147
|
+
onSaveRename: () => {
|
|
148
|
+
e.rail.saveTopicRename();
|
|
149
|
+
},
|
|
150
|
+
get onCancelRename() {
|
|
151
|
+
return e.rail.cancelTopicRename;
|
|
152
|
+
},
|
|
153
|
+
onDeleteTopic: (r) => {
|
|
154
|
+
e.rail.deleteTopic(r);
|
|
155
|
+
}
|
|
156
|
+
}), n), a(t, o(I, {
|
|
157
|
+
get activeTopic() {
|
|
158
|
+
return e.board.activeTopic();
|
|
159
|
+
},
|
|
160
|
+
get activeTopicLabel() {
|
|
161
|
+
return e.board.activeTopicLabel();
|
|
162
|
+
},
|
|
163
|
+
get activeItems() {
|
|
164
|
+
return e.board.activeItems();
|
|
165
|
+
},
|
|
166
|
+
get activeTopicID() {
|
|
167
|
+
return e.board.activeTopicID();
|
|
168
|
+
},
|
|
169
|
+
get topics() {
|
|
170
|
+
return e.board.topics();
|
|
171
|
+
},
|
|
172
|
+
get topZIndex() {
|
|
173
|
+
return e.board.topZIndex();
|
|
174
|
+
},
|
|
175
|
+
get viewport() {
|
|
176
|
+
return e.board.viewport();
|
|
177
|
+
},
|
|
178
|
+
get boardScaleLabel() {
|
|
179
|
+
return e.board.boardScaleLabel();
|
|
180
|
+
},
|
|
181
|
+
get isMobile() {
|
|
182
|
+
return e.board.isMobile();
|
|
183
|
+
},
|
|
184
|
+
get overviewOpen() {
|
|
185
|
+
return e.board.overviewOpen();
|
|
186
|
+
},
|
|
187
|
+
get optimisticFrontNoteID() {
|
|
188
|
+
return e.board.optimisticFrontNoteID();
|
|
189
|
+
},
|
|
190
|
+
get copiedNoteID() {
|
|
191
|
+
return e.board.copiedNoteID();
|
|
192
|
+
},
|
|
193
|
+
get setCanvasFrameRef() {
|
|
194
|
+
return e.board.setCanvasFrameRef;
|
|
195
|
+
},
|
|
196
|
+
get onViewportCommit() {
|
|
197
|
+
return e.board.commitViewport;
|
|
198
|
+
},
|
|
199
|
+
get onCanvasContextMenu() {
|
|
200
|
+
return e.board.openCanvasContextMenu;
|
|
201
|
+
},
|
|
202
|
+
get onZoomOut() {
|
|
203
|
+
return e.board.zoomOut;
|
|
204
|
+
},
|
|
205
|
+
get onZoomIn() {
|
|
206
|
+
return e.board.zoomIn;
|
|
207
|
+
},
|
|
208
|
+
get onOpenOverview() {
|
|
209
|
+
return e.board.openOverview;
|
|
210
|
+
},
|
|
211
|
+
get onSelectTopic() {
|
|
212
|
+
return e.board.selectTopic;
|
|
213
|
+
},
|
|
214
|
+
onMobileCreateNote: () => {
|
|
215
|
+
e.board.mobileCreateNote();
|
|
216
|
+
},
|
|
217
|
+
onMobilePaste: () => {
|
|
218
|
+
e.board.mobilePaste();
|
|
219
|
+
},
|
|
220
|
+
onCopyNote: (r) => {
|
|
221
|
+
e.board.copyNote(r);
|
|
222
|
+
},
|
|
223
|
+
get onOpenNoteContextMenu() {
|
|
224
|
+
return e.board.openNoteContextMenu;
|
|
225
|
+
},
|
|
226
|
+
get onOpenEditor() {
|
|
227
|
+
return e.board.openEditor;
|
|
228
|
+
},
|
|
229
|
+
onMoveToTrash: (r) => {
|
|
230
|
+
e.board.moveToTrash(r);
|
|
231
|
+
},
|
|
232
|
+
get onStartOptimisticFront() {
|
|
233
|
+
return e.board.startOptimisticFront;
|
|
234
|
+
},
|
|
235
|
+
get onCommitFront() {
|
|
236
|
+
return e.board.commitFront;
|
|
237
|
+
},
|
|
238
|
+
get onCommitMove() {
|
|
239
|
+
return e.board.commitMove;
|
|
240
|
+
}
|
|
241
|
+
}), n), a(t, o(s, {
|
|
242
|
+
get when() {
|
|
243
|
+
return !e.board.isMobile();
|
|
244
|
+
},
|
|
245
|
+
get children() {
|
|
246
|
+
return o(C, {
|
|
247
|
+
mode: "desktop",
|
|
248
|
+
get items() {
|
|
249
|
+
return e.overview.items();
|
|
250
|
+
},
|
|
251
|
+
get boardScaleLabel() {
|
|
252
|
+
return e.board.boardScaleLabel();
|
|
253
|
+
},
|
|
254
|
+
get viewportStyle() {
|
|
255
|
+
return e.overview.viewportStyle();
|
|
256
|
+
},
|
|
257
|
+
get navigationState() {
|
|
258
|
+
return e.overview.navigationState();
|
|
259
|
+
},
|
|
260
|
+
get onPointerDown() {
|
|
261
|
+
return e.overview.beginNavigation;
|
|
262
|
+
},
|
|
263
|
+
get onZoomOut() {
|
|
264
|
+
return e.board.zoomOut;
|
|
265
|
+
},
|
|
266
|
+
get onZoomIn() {
|
|
267
|
+
return e.board.zoomIn;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}), n), a(n, o(s, {
|
|
272
|
+
get when() {
|
|
273
|
+
return !e.trash.open();
|
|
274
|
+
},
|
|
275
|
+
get children() {
|
|
276
|
+
var r = W(), g = r.firstChild;
|
|
277
|
+
return m(r, "click", e.trash.openDock, !0), a(g, o(E, {
|
|
278
|
+
class: "notes-trash__toggle-icon"
|
|
279
|
+
})), f(() => S(r, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), r;
|
|
280
|
+
}
|
|
281
|
+
})), f(() => n.classList.toggle("is-open", !!e.trash.open())), t;
|
|
282
|
+
})()];
|
|
283
|
+
}
|
|
284
|
+
}), o(s, {
|
|
285
|
+
get when() {
|
|
286
|
+
return $(() => !!e.board.isMobile())() && e.board.overviewOpen();
|
|
287
|
+
},
|
|
288
|
+
get children() {
|
|
289
|
+
return o(u, {
|
|
290
|
+
get children() {
|
|
291
|
+
return [(() => {
|
|
292
|
+
var t = V();
|
|
293
|
+
return m(t, "click", e.overview.close, !0), t;
|
|
294
|
+
})(), (() => {
|
|
295
|
+
var t = A();
|
|
296
|
+
return a(t, o(C, {
|
|
297
|
+
mode: "mobile",
|
|
298
|
+
get items() {
|
|
299
|
+
return e.overview.items();
|
|
300
|
+
},
|
|
301
|
+
get boardScaleLabel() {
|
|
302
|
+
return e.board.boardScaleLabel();
|
|
303
|
+
},
|
|
304
|
+
get viewportStyle() {
|
|
305
|
+
return e.overview.viewportStyle();
|
|
306
|
+
},
|
|
307
|
+
get navigationState() {
|
|
308
|
+
return e.overview.navigationState();
|
|
309
|
+
},
|
|
310
|
+
get onPointerDown() {
|
|
311
|
+
return e.overview.beginNavigation;
|
|
312
|
+
},
|
|
313
|
+
get onZoomOut() {
|
|
314
|
+
return e.board.zoomOut;
|
|
315
|
+
},
|
|
316
|
+
get onZoomIn() {
|
|
317
|
+
return e.board.zoomIn;
|
|
318
|
+
},
|
|
319
|
+
get onClose() {
|
|
320
|
+
return e.overview.close;
|
|
321
|
+
}
|
|
322
|
+
})), t;
|
|
323
|
+
})()];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}), o(u, {
|
|
328
|
+
get children() {
|
|
329
|
+
return o(B, {
|
|
330
|
+
get open() {
|
|
331
|
+
return e.trash.open();
|
|
332
|
+
},
|
|
333
|
+
get groups() {
|
|
334
|
+
return e.trash.groups();
|
|
335
|
+
},
|
|
336
|
+
get now() {
|
|
337
|
+
return e.trash.now();
|
|
338
|
+
},
|
|
339
|
+
get canDeleteNow() {
|
|
340
|
+
return e.trash.canDeleteNow;
|
|
341
|
+
},
|
|
342
|
+
get onClose() {
|
|
343
|
+
return e.trash.close;
|
|
344
|
+
},
|
|
345
|
+
get onBackdropContextMenu() {
|
|
346
|
+
return e.trash.backdropContextMenu;
|
|
347
|
+
},
|
|
348
|
+
onRestore: (t) => {
|
|
349
|
+
e.trash.restore(t);
|
|
350
|
+
},
|
|
351
|
+
onDeleteNow: (t) => {
|
|
352
|
+
e.trash.deleteNow(t);
|
|
353
|
+
},
|
|
354
|
+
onClearTopicTrash: (t) => {
|
|
355
|
+
e.trash.clearTopic(t);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}), o(s, {
|
|
360
|
+
get when() {
|
|
361
|
+
return e.contextMenu.state();
|
|
362
|
+
},
|
|
363
|
+
get children() {
|
|
364
|
+
return o(u, {
|
|
365
|
+
get children() {
|
|
366
|
+
return [(() => {
|
|
367
|
+
var t = H();
|
|
368
|
+
return m(t, "click", e.contextMenu.close, !0), t;
|
|
369
|
+
})(), o(F, {
|
|
370
|
+
get x() {
|
|
371
|
+
return e.contextMenu.position()?.left ?? 0;
|
|
372
|
+
},
|
|
373
|
+
get y() {
|
|
374
|
+
return e.contextMenu.position()?.top ?? 0;
|
|
375
|
+
},
|
|
376
|
+
get items() {
|
|
377
|
+
return e.contextMenu.items();
|
|
378
|
+
}
|
|
379
|
+
})];
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}), o(s, {
|
|
384
|
+
get when() {
|
|
385
|
+
return !!e.editor.note();
|
|
386
|
+
},
|
|
387
|
+
get children() {
|
|
388
|
+
return o(u, {
|
|
389
|
+
get children() {
|
|
390
|
+
return o(R, {
|
|
391
|
+
get note() {
|
|
392
|
+
return e.editor.note();
|
|
393
|
+
},
|
|
394
|
+
get draftBody() {
|
|
395
|
+
return e.editor.draftBody();
|
|
396
|
+
},
|
|
397
|
+
get draftColor() {
|
|
398
|
+
return e.editor.draftColor();
|
|
399
|
+
},
|
|
400
|
+
get onDraftBodyChange() {
|
|
401
|
+
return e.editor.setDraftBody;
|
|
402
|
+
},
|
|
403
|
+
get onDraftColorChange() {
|
|
404
|
+
return e.editor.setDraftColor;
|
|
405
|
+
},
|
|
406
|
+
get onClose() {
|
|
407
|
+
return e.editor.close;
|
|
408
|
+
},
|
|
409
|
+
onSave: () => {
|
|
410
|
+
e.editor.save();
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}), o(u, {
|
|
417
|
+
get children() {
|
|
418
|
+
return o(L, {
|
|
419
|
+
get open() {
|
|
420
|
+
return e.manualPaste.open();
|
|
421
|
+
},
|
|
422
|
+
get text() {
|
|
423
|
+
return e.manualPaste.text();
|
|
424
|
+
},
|
|
425
|
+
get onTextChange() {
|
|
426
|
+
return e.manualPaste.setText;
|
|
427
|
+
},
|
|
428
|
+
get onClose() {
|
|
429
|
+
return e.manualPaste.close;
|
|
430
|
+
},
|
|
431
|
+
onConfirm: () => {
|
|
432
|
+
e.manualPaste.confirm();
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
})];
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
k(["click"]);
|
|
443
|
+
export {
|
|
444
|
+
le as NotesOverlay
|
|
445
|
+
};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type NotesController } from './types';
|
|
3
|
-
export interface NotesOverlayProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
controller: NotesController;
|
|
7
|
-
}
|
|
8
|
-
export declare function NotesOverlay(props: NotesOverlayProps): JSX.Element;
|
|
1
|
+
export { NotesOverlay, type NotesOverlayProps } from './NotesOverlay';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import type { NotesOverviewNavigationState } from './notesOverlayHelpers';
|
|
3
|
+
export interface NotesOverviewItemView {
|
|
4
|
+
id: string;
|
|
5
|
+
className: string;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export interface NotesOverviewPanelProps {
|
|
12
|
+
mode: 'desktop' | 'mobile';
|
|
13
|
+
items: readonly NotesOverviewItemView[];
|
|
14
|
+
boardScaleLabel: string;
|
|
15
|
+
viewportStyle: JSX.CSSProperties;
|
|
16
|
+
navigationState: NotesOverviewNavigationState | null;
|
|
17
|
+
onPointerDown: JSX.EventHandler<HTMLDivElement, PointerEvent>;
|
|
18
|
+
onZoomOut: () => void;
|
|
19
|
+
onZoomIn: () => void;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function NotesOverviewPanel(props: NotesOverviewPanelProps): JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { insert as l, createComponent as r, effect as h, className as b, setStyleProperty as d, style as S, template as u, delegateEvents as y } from "solid-js/web";
|
|
2
|
+
import { For as C, Show as x } from "solid-js";
|
|
3
|
+
import { Minus as P, Plus as k, X as Z } from "../icons/index.js";
|
|
4
|
+
var z = /* @__PURE__ */ u('<div class=notes-overview__controls><div class=notes-overview__zoom-group><button type=button class=notes-overview__zoom-button aria-label="Zoom out"></button><button type=button class=notes-overview__zoom-button aria-label="Zoom in"></button></div><button type=button class=notes-overview__close aria-label="Close overview">'), N = /* @__PURE__ */ u("<div data-floe-canvas-interactive=true><div class=notes-overview__surface data-floe-canvas-interactive=true><div class=notes-overview__grid aria-hidden=true></div><div class=notes-overview__viewport></div><div class=notes-overview__hud aria-hidden=true><div class=notes-overview__scale>"), L = /* @__PURE__ */ u("<div>");
|
|
5
|
+
function F(i) {
|
|
6
|
+
return (() => {
|
|
7
|
+
var s = N(), v = s.firstChild, m = v.firstChild, c = m.nextSibling, g = c.nextSibling, f = g.firstChild;
|
|
8
|
+
return s.$$pointerdown = (e) => e.stopPropagation(), v.$$pointerdown = (e) => i.onPointerDown(e), l(v, r(C, {
|
|
9
|
+
get each() {
|
|
10
|
+
return i.items;
|
|
11
|
+
},
|
|
12
|
+
children: (e) => (() => {
|
|
13
|
+
var o = L();
|
|
14
|
+
return h((t) => {
|
|
15
|
+
var n = `notes-overview__note ${e.className}`, a = `${e.x}%`, _ = `${e.y}%`, w = `${e.width}%`, $ = `${e.height}%`;
|
|
16
|
+
return n !== t.e && b(o, t.e = n), a !== t.t && d(o, "left", t.t = a), _ !== t.a && d(o, "top", t.a = _), w !== t.o && d(o, "width", t.o = w), $ !== t.i && d(o, "height", t.i = $), t;
|
|
17
|
+
}, {
|
|
18
|
+
e: void 0,
|
|
19
|
+
t: void 0,
|
|
20
|
+
a: void 0,
|
|
21
|
+
o: void 0,
|
|
22
|
+
i: void 0
|
|
23
|
+
}), o;
|
|
24
|
+
})()
|
|
25
|
+
}), c), l(f, () => i.boardScaleLabel), l(v, r(x, {
|
|
26
|
+
get when() {
|
|
27
|
+
return i.mode === "mobile";
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
var e = z(), o = e.firstChild, t = o.firstChild, n = t.nextSibling, a = o.nextSibling;
|
|
31
|
+
return t.$$click = () => i.onZoomOut(), l(t, r(P, {
|
|
32
|
+
class: "w-3.5 h-3.5"
|
|
33
|
+
})), n.$$click = () => i.onZoomIn(), l(n, r(k, {
|
|
34
|
+
class: "w-3.5 h-3.5"
|
|
35
|
+
})), a.$$click = () => i.onClose?.(), l(a, r(Z, {
|
|
36
|
+
class: "w-4 h-4"
|
|
37
|
+
})), e;
|
|
38
|
+
}
|
|
39
|
+
}), null), h((e) => {
|
|
40
|
+
var o = `notes-overview notes-overview--${i.mode}`, t = i.navigationState !== null, n = i.viewportStyle;
|
|
41
|
+
return o !== e.e && b(s, e.e = o), t !== e.t && v.classList.toggle("is-navigating", e.t = t), e.a = S(c, n, e.a), e;
|
|
42
|
+
}, {
|
|
43
|
+
e: void 0,
|
|
44
|
+
t: void 0,
|
|
45
|
+
a: void 0
|
|
46
|
+
}), s;
|
|
47
|
+
})();
|
|
48
|
+
}
|
|
49
|
+
y(["pointerdown", "click"]);
|
|
50
|
+
export {
|
|
51
|
+
F as NotesOverviewPanel
|
|
52
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NotesTopic } from './types';
|
|
2
|
+
export interface NotesTopicRailProps {
|
|
3
|
+
topics: readonly NotesTopic[];
|
|
4
|
+
activeTopicID: string;
|
|
5
|
+
draftTopicTitle: string;
|
|
6
|
+
renamingTopicID: string | null;
|
|
7
|
+
renamingTopicTitle: string;
|
|
8
|
+
getLiveNoteCount: (topicID: string) => number;
|
|
9
|
+
onDraftTopicTitleChange: (value: string) => void;
|
|
10
|
+
onSubmitTopic: () => void;
|
|
11
|
+
onSelectTopic: (topicID: string) => void;
|
|
12
|
+
onStartRename: (topic: NotesTopic) => void;
|
|
13
|
+
onRenamingTopicTitleChange: (value: string) => void;
|
|
14
|
+
onSaveRename: () => void;
|
|
15
|
+
onCancelRename: () => void;
|
|
16
|
+
onDeleteTopic: (topic: NotesTopic) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function NotesTopicRail(props: NotesTopicRailProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { insert as n, createComponent as a, className as T, effect as I, setAttribute as y, template as v, delegateEvents as R } from "solid-js/web";
|
|
2
|
+
import { For as A, Show as L } from "solid-js";
|
|
3
|
+
import { Plus as N, Check as z, X as K, Pencil as F, Trash as X } from "../icons/index.js";
|
|
4
|
+
import { NotesAnimalIcon as j } from "./notesAppearance.js";
|
|
5
|
+
import { topicAccentClass as q } from "./notesOverlayHelpers.js";
|
|
6
|
+
import { Input as k } from "../ui/Input.js";
|
|
7
|
+
var B = /* @__PURE__ */ v('<aside class=notes-overlay__rail data-floe-canvas-interactive=true><section class=notes-overlay__rail-header><div class=notes-overlay__rail-heading>Topics</div><div class=notes-overlay__rail-total></div></section><form class="notes-topic-composer notes-overlay__topic-composer"data-floe-canvas-interactive=true><button type=submit class=notes-topic-composer__button aria-label="Add topic"></button></form><div class=notes-topic-list data-floe-canvas-interactive=true>'), G = /* @__PURE__ */ v('<form class=notes-topic-row__editor><button type=submit class=notes-topic-row__edit-button aria-label="Save topic name"></button><button type=button class=notes-topic-row__edit-button aria-label="Cancel topic edit">'), H = /* @__PURE__ */ v('<div role=button tabindex=0><div></div><div class=notes-topic-row__copy><div class=notes-topic-row__meta> live note</div></div><div class=notes-topic-row__tail><div class=notes-topic-row__count></div><button type=button class=notes-topic-row__edit></button><button type=button class="notes-topic-row__edit notes-topic-row__delete">'), J = /* @__PURE__ */ v("<div class=notes-topic-row__title-line><div class=notes-topic-row__title>");
|
|
8
|
+
function Y(e) {
|
|
9
|
+
return (() => {
|
|
10
|
+
var $ = B(), g = $.firstChild, S = g.firstChild, x = S.nextSibling, s = g.nextSibling, f = s.firstChild, D = s.nextSibling;
|
|
11
|
+
return n(x, () => e.topics.length), s.addEventListener("submit", (i) => {
|
|
12
|
+
i.preventDefault(), e.onSubmitTopic();
|
|
13
|
+
}), n(s, a(k, {
|
|
14
|
+
size: "sm",
|
|
15
|
+
get value() {
|
|
16
|
+
return e.draftTopicTitle;
|
|
17
|
+
},
|
|
18
|
+
onInput: (i) => e.onDraftTopicTitleChange(i.currentTarget.value),
|
|
19
|
+
placeholder: "Add topic"
|
|
20
|
+
}), f), n(f, a(N, {
|
|
21
|
+
class: "w-3.5 h-3.5"
|
|
22
|
+
})), n(D, a(A, {
|
|
23
|
+
get each() {
|
|
24
|
+
return e.topics;
|
|
25
|
+
},
|
|
26
|
+
children: (i) => {
|
|
27
|
+
const m = () => e.getLiveNoteCount(i.topic_id), h = q(i.icon_accent);
|
|
28
|
+
return (() => {
|
|
29
|
+
var c = H(), p = c.firstChild, b = p.nextSibling, d = b.firstChild, P = d.firstChild, E = b.nextSibling, w = E.firstChild, _ = w.nextSibling, u = _.nextSibling;
|
|
30
|
+
return c.$$keydown = (t) => {
|
|
31
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), e.onSelectTopic(i.topic_id));
|
|
32
|
+
}, c.$$click = () => e.onSelectTopic(i.topic_id), T(c, `notes-topic-row ${h}`), T(p, `notes-topic-mark ${h}`), n(p, a(j, {
|
|
33
|
+
get iconKey() {
|
|
34
|
+
return i.icon_key;
|
|
35
|
+
},
|
|
36
|
+
class: "notes-topic-mark__icon"
|
|
37
|
+
})), n(b, a(L, {
|
|
38
|
+
get when() {
|
|
39
|
+
return e.renamingTopicID === i.topic_id;
|
|
40
|
+
},
|
|
41
|
+
get fallback() {
|
|
42
|
+
return (() => {
|
|
43
|
+
var t = J(), l = t.firstChild;
|
|
44
|
+
return n(l, () => i.name), t;
|
|
45
|
+
})();
|
|
46
|
+
},
|
|
47
|
+
get children() {
|
|
48
|
+
var t = G(), l = t.firstChild, r = l.nextSibling;
|
|
49
|
+
return t.$$click = (o) => o.stopPropagation(), t.addEventListener("submit", (o) => {
|
|
50
|
+
o.preventDefault(), o.stopPropagation(), e.onSaveRename();
|
|
51
|
+
}), n(t, a(k, {
|
|
52
|
+
size: "sm",
|
|
53
|
+
get value() {
|
|
54
|
+
return e.renamingTopicTitle;
|
|
55
|
+
},
|
|
56
|
+
onInput: (o) => e.onRenamingTopicTitleChange(o.currentTarget.value),
|
|
57
|
+
onKeyDown: (o) => {
|
|
58
|
+
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), e.onCancelRename());
|
|
59
|
+
},
|
|
60
|
+
placeholder: "Topic name"
|
|
61
|
+
}), l), n(l, a(z, {
|
|
62
|
+
class: "w-3.5 h-3.5"
|
|
63
|
+
})), r.$$click = (o) => {
|
|
64
|
+
o.stopPropagation(), e.onCancelRename();
|
|
65
|
+
}, n(r, a(K, {
|
|
66
|
+
class: "w-3.5 h-3.5"
|
|
67
|
+
})), t;
|
|
68
|
+
}
|
|
69
|
+
}), d), n(d, m, P), n(d, () => m() === 1 ? "" : "s", null), n(w, m), _.$$click = (t) => {
|
|
70
|
+
t.stopPropagation(), e.onStartRename(i);
|
|
71
|
+
}, n(_, a(F, {
|
|
72
|
+
class: "w-3.5 h-3.5"
|
|
73
|
+
})), u.$$click = (t) => {
|
|
74
|
+
t.stopPropagation(), e.onDeleteTopic(i);
|
|
75
|
+
}, n(u, a(X, {
|
|
76
|
+
class: "w-3.5 h-3.5"
|
|
77
|
+
})), I((t) => {
|
|
78
|
+
var l = i.topic_id === e.activeTopicID, r = `Edit topic ${i.name}`, o = `Delete topic ${i.name}`, C = e.topics.length <= 1;
|
|
79
|
+
return l !== t.e && c.classList.toggle("is-active", t.e = l), r !== t.t && y(_, "aria-label", t.t = r), o !== t.a && y(u, "aria-label", t.a = o), C !== t.o && (u.disabled = t.o = C), t;
|
|
80
|
+
}, {
|
|
81
|
+
e: void 0,
|
|
82
|
+
t: void 0,
|
|
83
|
+
a: void 0,
|
|
84
|
+
o: void 0
|
|
85
|
+
}), c;
|
|
86
|
+
})();
|
|
87
|
+
}
|
|
88
|
+
})), $;
|
|
89
|
+
})();
|
|
90
|
+
}
|
|
91
|
+
R(["click", "keydown"]);
|
|
92
|
+
export {
|
|
93
|
+
Y as NotesTopicRail
|
|
94
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NotesTrashGroup } from './types';
|
|
2
|
+
export interface NotesTrashFlyoutProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
groups: readonly NotesTrashGroup[];
|
|
5
|
+
now: number;
|
|
6
|
+
canDeleteNow: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onBackdropContextMenu?: (event: MouseEvent) => void;
|
|
9
|
+
onRestore: (noteID: string) => void;
|
|
10
|
+
onDeleteNow: (noteID: string) => void;
|
|
11
|
+
onClearTopicTrash: (topicID: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function NotesTrashFlyout(props: NotesTrashFlyoutProps): import("solid-js").JSX.Element;
|