mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 23:36:20 +00:00
feat(app): Flutter outliner with journals, page view and timeline
Logseq-like outliner (render/edit Markdown per block, Enter/Tab/Shift-Tab, backspace merge, arrow navigation, drag to reorder, collapse, [[ # (( autocomplete, TODO/DONE), journals feed with prev/next links, page view with linked references and related panel, virtualised CustomPainter timeline, Ctrl+K quick switcher, sidebar with recents, light/dark theme with bundled Inter, Noto Serif and Source Code Pro. Edits are optimistic and serialised to the core through one write queue. Cargokit builds synapse-ffi; its build tool is patched to use the library name (synapse_ffi) of hyphenated crates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c3d6636606
commit
df42d4010f
135 files changed
+17689
No files matched your search
@@ -0,0 +1,415 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// @generated by `flutter_rust_bridge`@ 2.13.0.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
import '../frb_generated.dart';
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
// These functions are ignored because they are not marked as `pub`: `new`
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `assert_fields_are_eq`, `assert_fields_are_eq`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `clone`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `eq`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`
|
||||
|
||||
class AssetDto {
|
||||
final String hash;
|
||||
final BigInt size;
|
||||
final String? mime;
|
||||
final String? originalName;
|
||||
|
||||
const AssetDto({
|
||||
required this.hash,
|
||||
required this.size,
|
||||
this.mime,
|
||||
this.originalName,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
hash.hashCode ^ size.hashCode ^ mime.hashCode ^ originalName.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is AssetDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
hash == other.hash &&
|
||||
size == other.size &&
|
||||
mime == other.mime &&
|
||||
originalName == other.originalName;
|
||||
}
|
||||
|
||||
/// Blocks of one page referencing the queried page.
|
||||
class BacklinkGroup {
|
||||
final String pageId;
|
||||
final String pageTitle;
|
||||
final bool isJournal;
|
||||
final List<BlockDto> blocks;
|
||||
|
||||
const BacklinkGroup({
|
||||
required this.pageId,
|
||||
required this.pageTitle,
|
||||
required this.isJournal,
|
||||
required this.blocks,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
pageId.hashCode ^
|
||||
pageTitle.hashCode ^
|
||||
isJournal.hashCode ^
|
||||
blocks.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is BacklinkGroup &&
|
||||
runtimeType == other.runtimeType &&
|
||||
pageId == other.pageId &&
|
||||
pageTitle == other.pageTitle &&
|
||||
isJournal == other.isJournal &&
|
||||
blocks == other.blocks;
|
||||
}
|
||||
|
||||
/// One row of the outline, in pre-order.
|
||||
class BlockDto {
|
||||
final String id;
|
||||
final String? parentId;
|
||||
final int depth;
|
||||
final String content;
|
||||
final bool collapsed;
|
||||
final bool hasChildren;
|
||||
|
||||
const BlockDto({
|
||||
required this.id,
|
||||
this.parentId,
|
||||
required this.depth,
|
||||
required this.content,
|
||||
required this.collapsed,
|
||||
required this.hasChildren,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
id.hashCode ^
|
||||
parentId.hashCode ^
|
||||
depth.hashCode ^
|
||||
content.hashCode ^
|
||||
collapsed.hashCode ^
|
||||
hasChildren.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is BlockDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
parentId == other.parentId &&
|
||||
depth == other.depth &&
|
||||
content == other.content &&
|
||||
collapsed == other.collapsed &&
|
||||
hasChildren == other.hasChildren;
|
||||
}
|
||||
|
||||
/// `((` autocomplete hit.
|
||||
class BlockHit {
|
||||
final String id;
|
||||
final String content;
|
||||
final String pageTitle;
|
||||
|
||||
const BlockHit({
|
||||
required this.id,
|
||||
required this.content,
|
||||
required this.pageTitle,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode ^ content.hashCode ^ pageTitle.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is BlockHit &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
content == other.content &&
|
||||
pageTitle == other.pageTitle;
|
||||
}
|
||||
|
||||
/// Target of a `((block ref))`.
|
||||
class BlockRefDto {
|
||||
final String id;
|
||||
final String content;
|
||||
final String pageId;
|
||||
final String pageTitle;
|
||||
|
||||
const BlockRefDto({
|
||||
required this.id,
|
||||
required this.content,
|
||||
required this.pageId,
|
||||
required this.pageTitle,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
id.hashCode ^ content.hashCode ^ pageId.hashCode ^ pageTitle.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is BlockRefDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
content == other.content &&
|
||||
pageId == other.pageId &&
|
||||
pageTitle == other.pageTitle;
|
||||
}
|
||||
|
||||
class EditDto {
|
||||
final String pageId;
|
||||
final int edits;
|
||||
|
||||
const EditDto({required this.pageId, required this.edits});
|
||||
|
||||
@override
|
||||
int get hashCode => pageId.hashCode ^ edits.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is EditDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
pageId == other.pageId &&
|
||||
edits == other.edits;
|
||||
}
|
||||
|
||||
class PageBrief {
|
||||
final String id;
|
||||
final String title;
|
||||
final bool isJournal;
|
||||
|
||||
const PageBrief({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.isJournal,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode ^ title.hashCode ^ isJournal.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is PageBrief &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
title == other.title &&
|
||||
isJournal == other.isJournal;
|
||||
}
|
||||
|
||||
/// Everything the page view needs in one call.
|
||||
class PageData {
|
||||
final PageDto page;
|
||||
final List<BlockDto> blocks;
|
||||
final List<String> aliases;
|
||||
|
||||
/// Previous/next existing journal (journal pages only).
|
||||
final String? prevJournal;
|
||||
final String? nextJournal;
|
||||
|
||||
const PageData({
|
||||
required this.page,
|
||||
required this.blocks,
|
||||
required this.aliases,
|
||||
this.prevJournal,
|
||||
this.nextJournal,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
page.hashCode ^
|
||||
blocks.hashCode ^
|
||||
aliases.hashCode ^
|
||||
prevJournal.hashCode ^
|
||||
nextJournal.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is PageData &&
|
||||
runtimeType == other.runtimeType &&
|
||||
page == other.page &&
|
||||
blocks == other.blocks &&
|
||||
aliases == other.aliases &&
|
||||
prevJournal == other.prevJournal &&
|
||||
nextJournal == other.nextJournal;
|
||||
}
|
||||
|
||||
/// Page header data.
|
||||
class PageDto {
|
||||
final String id;
|
||||
final String title;
|
||||
|
||||
/// Set for journal pages.
|
||||
final String? journalDate;
|
||||
|
||||
/// Journal day the page was born in.
|
||||
final String? originJournal;
|
||||
final PlatformInt64 createdAt;
|
||||
final PlatformInt64 updatedAt;
|
||||
|
||||
const PageDto({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.journalDate,
|
||||
this.originJournal,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
id.hashCode ^
|
||||
title.hashCode ^
|
||||
journalDate.hashCode ^
|
||||
originJournal.hashCode ^
|
||||
createdAt.hashCode ^
|
||||
updatedAt.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is PageDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
id == other.id &&
|
||||
title == other.title &&
|
||||
journalDate == other.journalDate &&
|
||||
originJournal == other.originJournal &&
|
||||
createdAt == other.createdAt &&
|
||||
updatedAt == other.updatedAt;
|
||||
}
|
||||
|
||||
class Place {
|
||||
final PlaceKind kind;
|
||||
final String? anchor;
|
||||
|
||||
const Place({required this.kind, this.anchor});
|
||||
|
||||
@override
|
||||
int get hashCode => kind.hashCode ^ anchor.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is Place &&
|
||||
runtimeType == other.runtimeType &&
|
||||
kind == other.kind &&
|
||||
anchor == other.anchor;
|
||||
}
|
||||
|
||||
/// Where a block goes, relative to `anchor`.
|
||||
enum PlaceKind {
|
||||
after,
|
||||
before,
|
||||
|
||||
/// Last child of `anchor`, or last root block when `anchor` is `None`.
|
||||
lastChildOf,
|
||||
|
||||
/// First child of `anchor`, or first root block when `anchor` is `None`.
|
||||
firstChildOf,
|
||||
}
|
||||
|
||||
class RelatedDto {
|
||||
final PageBrief page;
|
||||
final double score;
|
||||
|
||||
const RelatedDto({required this.page, required this.score});
|
||||
|
||||
@override
|
||||
int get hashCode => page.hashCode ^ score.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is RelatedDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
page == other.page &&
|
||||
score == other.score;
|
||||
}
|
||||
|
||||
class TimelineDayDto {
|
||||
final String date;
|
||||
final String? journalId;
|
||||
|
||||
/// Pages born on this day.
|
||||
final List<String> created;
|
||||
|
||||
/// Pages edited on this day.
|
||||
final List<EditDto> edited;
|
||||
|
||||
const TimelineDayDto({
|
||||
required this.date,
|
||||
this.journalId,
|
||||
required this.created,
|
||||
required this.edited,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
date.hashCode ^ journalId.hashCode ^ created.hashCode ^ edited.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is TimelineDayDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
date == other.date &&
|
||||
journalId == other.journalId &&
|
||||
created == other.created &&
|
||||
edited == other.edited;
|
||||
}
|
||||
|
||||
/// Timeline slice plus the titles of every page it mentions.
|
||||
class TimelineDto {
|
||||
final List<TimelineDayDto> days;
|
||||
final List<PageBrief> pages;
|
||||
|
||||
const TimelineDto({required this.days, required this.pages});
|
||||
|
||||
@override
|
||||
int get hashCode => days.hashCode ^ pages.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is TimelineDto &&
|
||||
runtimeType == other.runtimeType &&
|
||||
days == other.days &&
|
||||
pages == other.pages;
|
||||
}
|
||||
|
||||
/// Quick switcher / `[[` autocomplete hit.
|
||||
class TitleHit {
|
||||
final String pageId;
|
||||
|
||||
/// The matched title or alias.
|
||||
final String title;
|
||||
final bool isAlias;
|
||||
|
||||
const TitleHit({
|
||||
required this.pageId,
|
||||
required this.title,
|
||||
required this.isAlias,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode => pageId.hashCode ^ title.hashCode ^ isAlias.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is TitleHit &&
|
||||
runtimeType == other.runtimeType &&
|
||||
pageId == other.pageId &&
|
||||
title == other.title &&
|
||||
isAlias == other.isAlias;
|
||||
}
|
||||
Reference in new issue
Block a user