@hosty-sdk/app 0.39.0 → 0.42.0
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 +4 -2
- package/dist/decisions-server.d.ts +6 -0
- package/dist/decisions-server.js +21 -0
- package/dist/decisions.d.ts +140 -0
- package/dist/decisions.js +53 -0
- package/dist/feedback-capture.d.ts +5 -1
- package/dist/feedback-capture.js +41 -2
- package/dist/feedback-channel.d.ts +91 -0
- package/dist/feedback-channel.js +187 -0
- package/dist/feedback-client.d.ts +8 -0
- package/dist/feedback-client.js +26 -0
- package/dist/feedback-draft.d.ts +1 -5
- package/dist/feedback-draft.js +0 -31
- package/dist/feedback-react.d.ts +6 -2
- package/dist/feedback-react.js +235 -357
- package/dist/feedback-rpc.d.ts +7 -0
- package/dist/feedback-rpc.js +42 -0
- package/dist/feedback-workspace.d.ts +13 -0
- package/dist/feedback-workspace.js +28 -0
- package/dist/sdk-chrome.d.ts +1 -1
- package/dist/sdk-chrome.js +4 -0
- package/dist/tasks.d.ts +4 -0
- package/dist/tasks.js +2 -0
- package/dist/ui-embedded.d.ts +10 -0
- package/dist/ui-embedded.js +61 -0
- package/dist/ui-frame.js +1 -0
- package/dist/ui-host.d.ts +15 -2
- package/dist/ui-host.js +128 -27
- package/dist/ui-navigation-react.js +9 -4
- package/dist/ui-react.d.ts +5 -1
- package/dist/ui-react.js +59 -15
- package/dist/ui-server.d.ts +2 -0
- package/dist/ui-server.js +28 -3
- package/dist/ui-standalone-context.d.ts +8 -0
- package/dist/ui-standalone-context.js +3 -0
- package/dist/ui-standalone-preferences.d.ts +17 -0
- package/dist/ui-standalone-preferences.js +77 -0
- package/dist/ui-standalone-react.d.ts +24 -0
- package/dist/ui-standalone-react.js +47 -0
- package/dist/ui-transport.js +1 -1
- package/dist/ui-types.d.ts +5 -0
- package/dist/ui-workspaces.d.ts +7 -0
- package/dist/ui-workspaces.js +1 -1
- package/dist/ui.d.ts +1 -0
- package/package.json +13 -1
- package/dist/feedback-audio.d.ts +0 -3
- package/dist/feedback-audio.js +0 -40
- package/dist/feedback-speech.d.ts +0 -6
- package/dist/feedback-speech.js +0 -119
package/dist/feedback-draft.js
CHANGED
|
@@ -32,31 +32,6 @@ export async function readDraft(key) {
|
|
|
32
32
|
db.close();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
/** Read-check-write is one transaction: an older tab cannot overwrite a newer draft. */
|
|
36
|
-
export async function saveDraft(draft, expectedRevision, expectedRequestId) {
|
|
37
|
-
const db = await open();
|
|
38
|
-
try {
|
|
39
|
-
await new Promise((resolve, reject) => {
|
|
40
|
-
const tx = db.transaction("drafts", "readwrite");
|
|
41
|
-
const store = tx.objectStore("drafts");
|
|
42
|
-
const read = store.get(draft.key);
|
|
43
|
-
let conflict = false;
|
|
44
|
-
read.onsuccess = () => {
|
|
45
|
-
if ((read.result?.revision ?? 0) !== expectedRevision || (read.result?.requestId ?? null) !== expectedRequestId) {
|
|
46
|
-
conflict = true;
|
|
47
|
-
tx.abort();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
store.put(draft);
|
|
51
|
-
};
|
|
52
|
-
tx.oncomplete = () => resolve();
|
|
53
|
-
tx.onabort = tx.onerror = () => reject(conflict ? new Error("This draft changed in another tab. Reload to restore its latest saved version.") : tx.error ?? new Error("Draft could not be saved locally."));
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
db.close();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
35
|
export async function deleteDraft(key, requestId, expectedRevision) {
|
|
61
36
|
const db = await open();
|
|
62
37
|
try {
|
|
@@ -83,12 +58,6 @@ export async function deleteDraft(key, requestId, expectedRevision) {
|
|
|
83
58
|
db.close();
|
|
84
59
|
}
|
|
85
60
|
}
|
|
86
|
-
export function blankDraft(key) {
|
|
87
|
-
return { key, revision: 0, requestId: crypto.randomUUID(), comment: "", annotations: [], submitting: false };
|
|
88
|
-
}
|
|
89
|
-
export function makeNote(target) {
|
|
90
|
-
return { id: crypto.randomUUID(), text: "", route: location.pathname, capturedAt: new Date().toISOString(), target };
|
|
91
|
-
}
|
|
92
61
|
export async function submission(draft) {
|
|
93
62
|
const [coreId, appId, installation, userId] = JSON.parse(draft.key);
|
|
94
63
|
return { scope: { coreId: coreId, appId: appId, installation: installation, userId: userId }, requestId: draft.requestId, comment: draft.comment, annotations: await Promise.all(draft.annotations.map(async (note) => {
|
package/dist/feedback-react.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { UiHost } from './ui-host.js';
|
|
2
|
+
import type { EmbeddedUiClient } from './ui-embedded.js';
|
|
3
|
+
/** Selection and source-authenticated intake only. The tool application owns all form UI/storage. */
|
|
4
|
+
export declare function FeedbackCapture({ active, uiPath, client }: {
|
|
2
5
|
active: boolean;
|
|
3
6
|
uiPath?: string;
|
|
4
|
-
|
|
7
|
+
client?: UiHost | EmbeddedUiClient | null;
|
|
8
|
+
}): import("react").ReactPortal | null;
|