@inkami/blx 0.17.3 → 0.17.4
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/blx.js +1156 -1079
- package/dist/blx.js.map +1 -1
- package/dist/caret/custom-caret.d.ts +20 -8
- package/dist/crdt/automerge-sync.d.ts +2 -0
- package/dist/editor.d.ts +12 -1
- package/dist/util/icons.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +22 -26
|
@@ -3,28 +3,40 @@ export declare class CustomCaret {
|
|
|
3
3
|
private _container;
|
|
4
4
|
private _x;
|
|
5
5
|
private _y;
|
|
6
|
-
private _currentBlock;
|
|
7
|
-
private _suppressNextSnap;
|
|
8
|
-
private _instantNextMove;
|
|
9
6
|
private _enabled;
|
|
7
|
+
private _caretEnabled;
|
|
8
|
+
private _focused;
|
|
10
9
|
private _activeTimer;
|
|
11
|
-
private
|
|
12
|
-
private _destroyed;
|
|
10
|
+
private _clipElement;
|
|
13
11
|
private _bound_onSelectionChange;
|
|
14
12
|
private _bound_onKeyDown;
|
|
15
13
|
private _bound_onScroll;
|
|
16
14
|
private _bound_onResize;
|
|
15
|
+
private _bound_onFocusIn;
|
|
16
|
+
private _bound_onFocusOut;
|
|
17
17
|
private _resizeObserver;
|
|
18
18
|
constructor(container: HTMLElement);
|
|
19
|
+
/** No-op, kept for API compatibility with editor.ts split/merge calls. */
|
|
20
|
+
suppressAnimation(): void;
|
|
21
|
+
recalculate(): void;
|
|
19
22
|
hide(): void;
|
|
20
23
|
setEnabled(enabled: boolean): void;
|
|
24
|
+
setCaretEnabled(enabled: boolean): void;
|
|
25
|
+
/** @deprecated Use setClipElement instead */
|
|
26
|
+
setClipInset(_inset: {
|
|
27
|
+
top?: number;
|
|
28
|
+
bottom?: number;
|
|
29
|
+
}): void;
|
|
30
|
+
/** Set an element whose visible bounds clip the caret (e.g. the scroll host). */
|
|
31
|
+
setClipElement(el: HTMLElement | null): void;
|
|
21
32
|
destroy(): void;
|
|
33
|
+
private _onFocusIn;
|
|
34
|
+
private _onFocusOut;
|
|
22
35
|
private _onSelectionChange;
|
|
23
36
|
private _onKeyDown;
|
|
24
37
|
private _onScroll;
|
|
25
38
|
private _onResize;
|
|
26
39
|
private _update;
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
private _animateSnap;
|
|
40
|
+
/** Instant-place the caret at the given viewport coordinates. */
|
|
41
|
+
private _placeTo;
|
|
30
42
|
}
|
|
@@ -63,6 +63,8 @@ export declare class AutomergeSync {
|
|
|
63
63
|
private _replaceAllBlocks;
|
|
64
64
|
private _bus;
|
|
65
65
|
private _unsubs;
|
|
66
|
+
/** Called after remote changes have been applied to the editor */
|
|
67
|
+
onRemoteApplied?: () => void;
|
|
66
68
|
constructor(editorApi: {
|
|
67
69
|
getBlocks: () => ReadonlyArray<Block>;
|
|
68
70
|
getBlock: (id: string) => Block | undefined;
|
package/dist/editor.d.ts
CHANGED
|
@@ -663,6 +663,15 @@ export declare class Editor {
|
|
|
663
663
|
private exitVisualBlockToNormal;
|
|
664
664
|
/** Set editor mode and update CSS classes on root */
|
|
665
665
|
private setMode;
|
|
666
|
+
/** Hide/show the caret. Used by host app when overlays/dialogs are shown. */
|
|
667
|
+
setCaretEnabled(enabled: boolean): void;
|
|
668
|
+
/** @deprecated Use setCaretClipElement instead */
|
|
669
|
+
setCaretClipInset(_inset: {
|
|
670
|
+
top?: number;
|
|
671
|
+
bottom?: number;
|
|
672
|
+
}): void;
|
|
673
|
+
/** Set an element whose visible bounds clip the caret (e.g. the scroll host). */
|
|
674
|
+
setCaretClipElement(el: HTMLElement | null): void;
|
|
666
675
|
/** @internal Whether the editor is in block selection mode (normal or visual block) */
|
|
667
676
|
get isBlockSelecting(): boolean;
|
|
668
677
|
/** @internal Get the current editor mode */
|
|
@@ -701,7 +710,9 @@ export declare class Editor {
|
|
|
701
710
|
anchor?: string;
|
|
702
711
|
fromCompletion?: boolean;
|
|
703
712
|
} | null): void;
|
|
704
|
-
/**
|
|
713
|
+
/** Set a date with a specific role on a block. Convenience alias for setBlockAgenda. */
|
|
714
|
+
setBlockDateRole(blockId: string, role: "due" | "scheduled" | "event", date: string | null): void;
|
|
715
|
+
/** @deprecated Use `setBlockDateRole` or `setBlockAgenda` instead. */
|
|
705
716
|
setBlockAgendaDate(blockId: string, agendaDate: string | null): void;
|
|
706
717
|
/** @deprecated Use `setBlockAgenda(blockId, role, null)` instead. */
|
|
707
718
|
removeBlockAgendaDate(blockId: string): void;
|
package/dist/util/icons.d.ts
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* el.innerHTML = iconHtml(X, 14);
|
|
7
7
|
*/
|
|
8
8
|
import type { IconNode } from "lucide";
|
|
9
|
-
export { Check, ChevronDown, CircleCheckBig, ChevronsLeft, ChevronsRight, Clipboard, ClipboardPaste, ClockFading, ClockPlus, Code, Copy, GripVertical, Heading1, Heading2, Heading3, Heading4, History, Image, Link, List, ListChecks, ListOrdered, Pause, Pencil, Pilcrow, Play, Plus, Repeat2, Scissors, Sparkles, TextQuote, Trash2, Ban, X, } from "lucide";
|
|
9
|
+
export { Calendar1, CalendarDays, CalendarFold, Check, ChevronDown, CircleCheckBig, ChevronsLeft, ChevronsRight, Clipboard, ClipboardPaste, ClockFading, ClockPlus, Code, Copy, GripVertical, Heading1, Heading2, Heading3, Heading4, History, Image, Link, List, ListChecks, ListOrdered, Pause, Pencil, Pilcrow, Play, Plus, Repeat2, Scissors, Sparkles, TextQuote, Trash2, Ban, X, } from "lucide";
|
|
10
10
|
/**
|
|
11
11
|
* Return an HTML string for a lucide icon (for innerHTML contexts).
|
|
12
12
|
*/
|
|
13
13
|
export declare function iconHtml(def: IconNode, size?: number, attrs?: Record<string, string>): string;
|
|
14
|
+
/** Return a role icon <span> element for an agenda badge/label. */
|
|
15
|
+
export declare function createAgendaRoleIcon(role: string): HTMLSpanElement | null;
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -655,6 +655,27 @@
|
|
|
655
655
|
transition: color 0.15s ease, background 0.15s ease;
|
|
656
656
|
}
|
|
657
657
|
|
|
658
|
+
/* ── Role icon (due / scheduled / event) ─────────────────────── */
|
|
659
|
+
|
|
660
|
+
.blx-agenda-role-icon {
|
|
661
|
+
display: inline-flex;
|
|
662
|
+
align-items: center;
|
|
663
|
+
opacity: 0.55;
|
|
664
|
+
flex-shrink: 0;
|
|
665
|
+
line-height: 0;
|
|
666
|
+
margin-right: 2px;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.blx-agenda-role-icon svg {
|
|
670
|
+
width: 1em;
|
|
671
|
+
height: 1em;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.blx-agenda-badge:hover .blx-agenda-role-icon,
|
|
675
|
+
.blx-agenda-label:hover .blx-agenda-role-icon {
|
|
676
|
+
opacity: 0.8;
|
|
677
|
+
}
|
|
678
|
+
|
|
658
679
|
/* ── Recurrence indicator ────────────────────────────────────── */
|
|
659
680
|
|
|
660
681
|
.blx-agenda-recurrence {
|
|
@@ -4206,47 +4227,22 @@ mark.blx-search-highlight {
|
|
|
4206
4227
|
border-radius: 1px;
|
|
4207
4228
|
background: var(--blx-caret-color, var(--blx-accent));
|
|
4208
4229
|
pointer-events: none;
|
|
4209
|
-
transform-origin: bottom center;
|
|
4210
4230
|
z-index: var(--blx-caret-z-index, 20);
|
|
4211
4231
|
|
|
4212
|
-
/* Smooth motion for nearby moves */
|
|
4213
|
-
transition:
|
|
4214
|
-
top 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94),
|
|
4215
|
-
left 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94),
|
|
4216
|
-
height 0.08s ease,
|
|
4217
|
-
opacity 0.05s ease;
|
|
4218
|
-
|
|
4219
4232
|
/* Blink (default state) */
|
|
4220
4233
|
animation: blx-caret-blink 1.1s ease-in-out infinite;
|
|
4221
4234
|
}
|
|
4222
4235
|
|
|
4223
|
-
/* While user is actively typing/moving — blink paused, caret solid
|
|
4236
|
+
/* While user is actively typing/moving — blink paused, caret solid */
|
|
4224
4237
|
.blx-caret--active {
|
|
4225
4238
|
animation: none;
|
|
4226
4239
|
opacity: 1;
|
|
4227
|
-
transition: none;
|
|
4228
|
-
}
|
|
4229
|
-
|
|
4230
|
-
/* Snap: disable transition for this frame */
|
|
4231
|
-
.blx-caret--no-transition {
|
|
4232
|
-
transition: none;
|
|
4233
|
-
}
|
|
4234
|
-
|
|
4235
|
-
/* Motion trail for cross-block jumps — caret slides from old to new position */
|
|
4236
|
-
.blx-caret--trailing {
|
|
4237
|
-
transition:
|
|
4238
|
-
transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
|
|
4239
|
-
opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1),
|
|
4240
|
-
mask-image 0.15s cubic-bezier(0.16, 1, 0.3, 1),
|
|
4241
|
-
-webkit-mask-image 0.15s cubic-bezier(0.16, 1, 0.3, 1);
|
|
4242
|
-
animation: none;
|
|
4243
4240
|
}
|
|
4244
4241
|
|
|
4245
4242
|
/* Hidden state — !important needed to beat CSS animation cascade */
|
|
4246
4243
|
.blx-caret--hidden {
|
|
4247
4244
|
opacity: 0 !important;
|
|
4248
4245
|
animation: none !important;
|
|
4249
|
-
transition: none !important;
|
|
4250
4246
|
}
|
|
4251
4247
|
|
|
4252
4248
|
/* ── Mermaid Diagram Block ─────────────────────────────────────── */
|