diff --git a/apps/wiki.json b/apps/wiki.json index ac880b4d..b0f63af5 100644 --- a/apps/wiki.json +++ b/apps/wiki.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "📝", - "previous": "&263ro6L8r7tRcrC7LjvY59gC72DlEM/nehd6s7S08sQ=.sha256" + "previous": "&0dFKAKThgExsyMQN99dOX7HP4UBhYYnuhYTILTCO5FI=.sha256" } \ No newline at end of file diff --git a/apps/wiki/tf-collections-app.js b/apps/wiki/tf-collections-app.js index c36e7d0d..04b24f8c 100644 --- a/apps/wiki/tf-collections-app.js +++ b/apps/wiki/tf-collections-app.js @@ -128,6 +128,61 @@ class TfCollectionsAppElement extends LitElement { this.read_wiki_docs(); } + async on_wiki_create(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki', + name: event.detail.name, + }); + } + + async on_wiki_rename(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki', + key: event.detail.id, + name: event.detail.name, + }); + } + + async on_wiki_tombstone(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki', + key: event.detail.id, + tombstone: { + date: new Date().valueOf(), + reason: 'tombstoned by user', + }, + }); + } + + async on_wiki_doc_create(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki-doc', + parent: this.wiki.id, + name: event.detail.name, + }); + } + + async on_wiki_doc_rename(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki-doc', + parent: this.wiki.id, + key: event.detail.id, + name: event.detail.name, + }); + } + + async on_wiki_doc_tombstone(event) { + await tfrpc.rpc.appendMessage(this.whoami, { + type: 'wiki-doc', + parent: this.wiki.id, + key: event.detail.id, + tombstone: { + date: new Date().valueOf(), + reason: 'tombstoned by user', + }, + }); + } + async on_wiki_doc_changed(event) { this.wiki_doc = event.detail.value; this.update_hash(); @@ -143,10 +198,16 @@ class TfCollectionsAppElement extends LitElement { ${keyed(this.wiki_doc?.id, html``)} ${this.wiki_doc && this.wiki_doc.parent === this.wiki?.id ? html`