Edit page content with the Docwell editor
PageView now mounts @docwell/editor and autosaves the document through
GET/PUT /api/v1/pages/{id}/content. The server stores Tiptap JSON in
pages.content_json and derives content_text and word_count itself.
Saves are last-write-wins until the collab relay replaces them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a96c6ad3ce
commit
abf55a426b
13 files changed
+420
-9
No files matched your search
@@ -711,6 +711,46 @@ paths:
|
||||
"400": { $ref: "#/components/responses/Error" }
|
||||
"403": { $ref: "#/components/responses/Error" }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/pages/{id}/content:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
get:
|
||||
operationId: getPageContent
|
||||
tags: [pages]
|
||||
summary: The page's document as Tiptap JSON (null for a page that was never edited)
|
||||
security: [{ bearer: [] }]
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/PageContent" }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
put:
|
||||
operationId: savePageContent
|
||||
tags: [pages]
|
||||
summary: >-
|
||||
Replace the page's document (editor). Last write wins until the collab
|
||||
relay lands; the server derives the plain text and word count.
|
||||
security: [{ bearer: [] }]
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [content]
|
||||
properties:
|
||||
content: { type: object, additionalProperties: true, description: 'Tiptap JSON with type "doc"' }
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/PageContent" }
|
||||
"400": { $ref: "#/components/responses/Error" }
|
||||
"403": { $ref: "#/components/responses/Error" }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
/api/v1/pages/{id}/move:
|
||||
parameters:
|
||||
- { name: id, in: path, required: true, schema: { type: string } }
|
||||
@@ -936,6 +976,14 @@ components:
|
||||
inTrash: { type: boolean, description: The page or one of its ancestors is in the trash }
|
||||
ancestors: { type: array, items: { $ref: "#/components/schemas/PageRef" }, description: Root first }
|
||||
role: { $ref: "#/components/schemas/SpaceRole" }
|
||||
PageContent:
|
||||
type: object
|
||||
required: [content, updated]
|
||||
properties:
|
||||
content:
|
||||
oneOf: [{ type: object, additionalProperties: true }, { type: "null" }]
|
||||
description: Tiptap JSON with type "doc"; null for a page that was never edited
|
||||
updated: { type: string }
|
||||
TrashedPage:
|
||||
type: object
|
||||
required: [id, title, icon, deletedAt]
|
||||
|
||||
Reference in new issue
Block a user