@weave-apps/sdk 0.1.8 → 0.1.9
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/README.md +56 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,6 +17,62 @@ Official SDK for building third-party applications for the Weave Platform.
|
|
|
17
17
|
- ✅ **AI Integration** - Leverage AI for smart form filling
|
|
18
18
|
- ✅ **Data Persistence** - Store app data with the Weave API
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
22
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
23
|
+
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
|
24
|
+
|
|
25
|
+
- [Quick Start](#quick-start)
|
|
26
|
+
- [1. Initialize a New App](#1-initialize-a-new-app)
|
|
27
|
+
- [2. Develop Your App](#2-develop-your-app)
|
|
28
|
+
- [3. Build Your App](#3-build-your-app)
|
|
29
|
+
- [4. Upload to Weave](#4-upload-to-weave)
|
|
30
|
+
- [API Reference](#api-reference)
|
|
31
|
+
- [WeaveBaseApp](#weavebaseapp)
|
|
32
|
+
- [Constructor](#constructor)
|
|
33
|
+
- [Settings & State](#settings--state)
|
|
34
|
+
- [Methods to Implement](#methods-to-implement)
|
|
35
|
+
- [`render(): void | Promise<void>`](#render-void--promisevoid)
|
|
36
|
+
- [`setupEventListeners(): void` (Optional)](#setupeventlisteners-void-optional)
|
|
37
|
+
- [`onBackgroundService(): void` (Optional)](#onbackgroundservice-void-optional)
|
|
38
|
+
- [`onUrlChange(newUrl: string): void` (Optional)](#onurlchangenewurl-string-void-optional)
|
|
39
|
+
- [`cleanup(): void` (Optional)](#cleanup-void-optional)
|
|
40
|
+
- [Helper Methods](#helper-methods)
|
|
41
|
+
- [`renderHTML(html: string): void`](#renderhtmlhtml-string-void)
|
|
42
|
+
- [`setState(updates: object): void`](#setstateupdates-object-void)
|
|
43
|
+
- [`this.background` (Property)](#thisbackground-property)
|
|
44
|
+
- [`query<T>(selector: string): T | null`](#querytselector-string-t--null)
|
|
45
|
+
- [`queryAll<T>(selector: string): NodeListOf<T>`](#queryalltselector-string-nodelistoft)
|
|
46
|
+
- [WeaveDOMAPI](#weavedomapi)
|
|
47
|
+
- [URL & Navigation](#url--navigation)
|
|
48
|
+
- [Read Operations](#read-operations)
|
|
49
|
+
- [Write Operations](#write-operations)
|
|
50
|
+
- [DOM Injection](#dom-injection)
|
|
51
|
+
- [Event Listeners](#event-listeners)
|
|
52
|
+
- [WeaveAPIClient](#weaveapiclient)
|
|
53
|
+
- [App Data Management](#app-data-management)
|
|
54
|
+
- [AI Integration](#ai-integration)
|
|
55
|
+
- [Utilities](#utilities)
|
|
56
|
+
- [Advanced Topics](#advanced-topics)
|
|
57
|
+
- [State Persistence (Survive Page Reloads)](#state-persistence-survive-page-reloads)
|
|
58
|
+
- [Auto-Persist (Recommended)](#auto-persist-recommended)
|
|
59
|
+
- [Multi-Page Flows (Pending Operations)](#multi-page-flows-pending-operations)
|
|
60
|
+
- [State TTL](#state-ttl)
|
|
61
|
+
- [Settings & Configuration](#settings--configuration)
|
|
62
|
+
- [Error Handling](#error-handling)
|
|
63
|
+
- [Performance Tips](#performance-tips)
|
|
64
|
+
- [Build Process](#build-process)
|
|
65
|
+
- [Security](#security)
|
|
66
|
+
- [Project Structure](#project-structure)
|
|
67
|
+
- [Troubleshooting](#troubleshooting)
|
|
68
|
+
- ["TypeScript not found in SDK"](#typescript-not-found-in-sdk)
|
|
69
|
+
- [Form not filling](#form-not-filling)
|
|
70
|
+
- [Button not injecting](#button-not-injecting)
|
|
71
|
+
- [State not persisting across page reloads](#state-not-persisting-across-page-reloads)
|
|
72
|
+
- [State not persisting long-term](#state-not-persisting-long-term)
|
|
73
|
+
|
|
74
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
75
|
+
|
|
20
76
|
## Quick Start
|
|
21
77
|
|
|
22
78
|
### 1. Initialize a New App
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weave-apps/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "SDK for building Weave Micro Apps",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"copy-sdk": "node scripts/copy-sdk-files.js",
|
|
18
|
-
"prebuild": "npm run copy-sdk",
|
|
18
|
+
"prebuild": "npm run copy-sdk && npx doctoc README.md",
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"dev": "tsc --watch",
|
|
21
21
|
"prepare": "npm run build",
|