@weave-apps/sdk 0.1.8 → 0.1.10

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 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/dist/index.d.ts CHANGED
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * Main exports for third-party app development
5
5
  */
6
- export { WeaveBaseApp, type WeaveAppInfo } from './WeaveBaseApp';
6
+ export { WeaveBaseApp, type WeaveAppInfo, type PendingOperation } from './WeaveBaseApp';
7
7
  export { WeaveDOMAPI, type ElementSnapshot, type InsertPosition } from './WeaveDOMAPI';
8
8
  export { default as weaveDOM } from './WeaveDOMAPI';
9
9
  export { WeaveAPIClient, type AIChatRequest, type AIChatResponse, type AppData, type CreateAppDataRequest, type UpdateAppDataRequest } from './WeaveAPIClient';
10
10
  export { default as weaveAPI } from './WeaveAPIClient';
11
+ export { WeaveBackgroundAPI } from './WeaveBackgroundAPI';
12
+ import './global';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -8,3 +8,6 @@ export { WeaveDOMAPI } from './WeaveDOMAPI';
8
8
  export { default as weaveDOM } from './WeaveDOMAPI';
9
9
  export { WeaveAPIClient } from './WeaveAPIClient';
10
10
  export { default as weaveAPI } from './WeaveAPIClient';
11
+ export { WeaveBackgroundAPI } from './WeaveBackgroundAPI';
12
+ // Import global.ts to ensure Window interface augmentation is included
13
+ import './global';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weave-apps/sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
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",