chore: Enhancement + New Feature (#185)

* wip

* wip page

* chore: style

* wip pages

* wip pages

* chore: toggle

* chore: link

* feat: topic search

* chore: page section

* refactor: apply tailwind class ordering

* fix: handle loggedIn user for guest route

* feat: folder & image schema

* chore: move utils to shared

* refactor: tailwind class ordering

* feat: img ext for editor

* refactor: remove qa

* fix: tanstack start

* fix: wrong import

* chore: use toast

* chore: schema
This commit is contained in:
Aslam
2024-10-18 21:18:20 +07:00
committed by GitHub
parent c93c634a77
commit a440828f8c
158 changed files with 2808 additions and 1064 deletions

View File

@@ -1,21 +1,13 @@
import { co, CoList, CoMap, Encoders } from "jazz-tools"
import { co, CoList } from "jazz-tools"
import { Topic } from "./master/topic"
import { BaseModel } from "./base"
/*
* Page, content that user can write to. Similar to Notion/Reflect page. It holds ProseMirror editor content + metadata.
* - slug: make it unique
* - Public Access, url should be learn-anything.xyz/@user/slug
* - if public, certain members (can do read/write access accordingly), personal (end to end encrypted, only accessed by user)
*/
export class PersonalPage extends CoMap {
export class PersonalPage extends BaseModel {
title = co.optional.string
slug = co.optional.string // is used only when `public: true` for sharing, `@user/page-slug`
slug = co.optional.string
public = co.boolean
content = co.optional.json()
topic = co.optional.ref(Topic)
createdAt = co.encoded(Encoders.Date)
updatedAt = co.encoded(Encoders.Date)
// backlinks = co.optional.ref() // other PersonalPages linking to this page TODO: add, think through how to do it well, efficiently
}
export class PersonalPageLists extends CoList.Of(co.ref(PersonalPage)) {}