@animaapp/anima-sdk-react 0.2.0 → 0.2.1
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/.turbo/turbo-build.log +5 -13
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4925 -4932
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/useAnimaCodegen.ts +1 -7
- package/src/utils.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animaapp/anima-sdk-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Anima's JavaScript utilities library",
|
|
6
6
|
"author": "Anima App, Inc.",
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
"vite-tsconfig-paths": "^5.1.4",
|
|
41
41
|
"vitest": "^3.0.5"
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
}
|
package/src/useAnimaCodegen.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type {
|
|
|
4
4
|
GetCodeParams,
|
|
5
5
|
StreamCodgenMessage,
|
|
6
6
|
} from "@animaapp/anima-sdk";
|
|
7
|
-
import { convertCodegenFilesToAnimaFiles } from "@animaapp/anima-sdk";
|
|
8
7
|
import { EventSource } from "eventsource";
|
|
9
8
|
import { useImmer } from "use-immer";
|
|
10
9
|
|
|
@@ -160,12 +159,7 @@ export const useAnimaCodegen = ({
|
|
|
160
159
|
event.data
|
|
161
160
|
) as StreamMessageByType<"generating_code">;
|
|
162
161
|
if (message.payload.status === "success") {
|
|
163
|
-
|
|
164
|
-
string,
|
|
165
|
-
{ code: string; type: "code" }
|
|
166
|
-
>;
|
|
167
|
-
|
|
168
|
-
result.files = convertCodegenFilesToAnimaFiles(codegenFiles);
|
|
162
|
+
result.files = message.payload.files;
|
|
169
163
|
}
|
|
170
164
|
|
|
171
165
|
updateStatus((draft) => {
|
package/src/utils.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
for (
|
|
2
|
+
let binary = "";
|
|
3
|
+
const bytes = new Uint8Array(buffer);
|
|
4
|
+
const len = bytes.byteLength;
|
|
5
|
+
for (let i = 0; i < len; i++) {
|
|
6
6
|
binary += String.fromCharCode(bytes[i]);
|
|
7
7
|
}
|
|
8
8
|
|