tsquare 0.9.1 → 0.10.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/browser/THIRD_PARTY_LICENSES.txt +1033 -0
- package/dist/browser/index.js +23495 -0
- package/dist/chunks/{chunk-W3OU5IS6.js → chunk-EY7YIRMK.js} +5 -3
- package/dist/chunks/{chunk-GTWUMF6W.js → chunk-QWQT7224.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/deflate.d.ts +2 -0
- package/dist/fonts.d.ts +1 -0
- package/dist/index.js +7 -5
- package/dist/playground/index.js +2 -2
- package/package.json +4 -2
|
@@ -2327,8 +2327,6 @@ function scanLine(line, from) {
|
|
|
2327
2327
|
}
|
|
2328
2328
|
|
|
2329
2329
|
// src/render.ts
|
|
2330
|
-
import { readFile } from "node:fs/promises";
|
|
2331
|
-
import { createRequire } from "node:module";
|
|
2332
2330
|
import { renderToSvg } from "@json-render/image/render";
|
|
2333
2331
|
|
|
2334
2332
|
// src/anchors.tsx
|
|
@@ -2663,7 +2661,9 @@ function flowLayer(spec, flows, screens, gap, palette, size) {
|
|
|
2663
2661
|
] }, "__flows");
|
|
2664
2662
|
}
|
|
2665
2663
|
|
|
2666
|
-
// src/
|
|
2664
|
+
// src/fonts.ts
|
|
2665
|
+
import { readFile } from "node:fs/promises";
|
|
2666
|
+
import { createRequire } from "node:module";
|
|
2667
2667
|
var fontFile = (name) => createRequire(import.meta.url).resolve(`@fontsource/inter/files/${name}`);
|
|
2668
2668
|
var fontCache = null;
|
|
2669
2669
|
function loadFonts() {
|
|
@@ -2676,6 +2676,8 @@ function loadFonts() {
|
|
|
2676
2676
|
]);
|
|
2677
2677
|
return fontCache;
|
|
2678
2678
|
}
|
|
2679
|
+
|
|
2680
|
+
// src/render.ts
|
|
2679
2681
|
var SpecError = class extends Error {
|
|
2680
2682
|
constructor(issues) {
|
|
2681
2683
|
super(`Invalid wireframe spec:
|
package/dist/cli.js
CHANGED
package/dist/fonts.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadFonts(): Promise<any[]>;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
languageData
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-QWQT7224.js";
|
|
4
4
|
import {
|
|
5
5
|
DEVICES,
|
|
6
6
|
RENAMED_PROPS,
|
|
@@ -24,10 +24,12 @@ import {
|
|
|
24
24
|
upgradeSpec,
|
|
25
25
|
upgradeWireframe,
|
|
26
26
|
wireframePrompt
|
|
27
|
-
} from "./chunks/chunk-
|
|
27
|
+
} from "./chunks/chunk-EY7YIRMK.js";
|
|
28
28
|
|
|
29
|
-
// src/
|
|
29
|
+
// src/deflate.ts
|
|
30
30
|
import { deflateRawSync, inflateRawSync } from "node:zlib";
|
|
31
|
+
var deflateToBase64url = (text2) => deflateRawSync(Buffer.from(text2, "utf8"), { level: 9 }).toString("base64url");
|
|
32
|
+
var inflateFromBase64url = (data, maxOutputLength) => inflateRawSync(Buffer.from(data, "base64url"), { maxOutputLength }).toString("utf8");
|
|
31
33
|
|
|
32
34
|
// src/link-prefix.ts
|
|
33
35
|
var LINK_PREFIX = "y";
|
|
@@ -37,12 +39,12 @@ var isLinkData = (data) => data.startsWith(LINK_PREFIX) || data.startsWith(LEGAC
|
|
|
37
39
|
// src/share.ts
|
|
38
40
|
var MAX_SHARED_TEXT = 64e3;
|
|
39
41
|
function encodeWireframe(text2) {
|
|
40
|
-
return LINK_PREFIX +
|
|
42
|
+
return LINK_PREFIX + deflateToBase64url(text2);
|
|
41
43
|
}
|
|
42
44
|
function decodeWireframe(data) {
|
|
43
45
|
const prefix = data.slice(0, 1);
|
|
44
46
|
if (!isLinkData(data)) throw new Error(`unknown encoding "${prefix}" (expected a "${LINK_PREFIX}" or "${LEGACY_LINK_PREFIX}" prefix)`);
|
|
45
|
-
const text2 =
|
|
47
|
+
const text2 = inflateFromBase64url(data.slice(1), MAX_SHARED_TEXT);
|
|
46
48
|
return upgradeWireframe(text2, { fromLink: prefix === LEGACY_LINK_PREFIX });
|
|
47
49
|
}
|
|
48
50
|
|
package/dist/playground/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
languageData
|
|
3
|
-
} from "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-QWQT7224.js";
|
|
4
4
|
import {
|
|
5
5
|
boardLayout,
|
|
6
6
|
compileWireframe,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
renderWireframePng,
|
|
10
10
|
renderWireframeSvg,
|
|
11
11
|
wireframePrompt
|
|
12
|
-
} from "../chunks/chunk-
|
|
12
|
+
} from "../chunks/chunk-EY7YIRMK.js";
|
|
13
13
|
|
|
14
14
|
// src/playground/index.ts
|
|
15
15
|
import { createServer } from "node:http";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsquare",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Wireframes in plain text: easy for LLMs to write, fast to render as SVG or PNG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wireframe",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
|
+
"browser": "./dist/browser/index.js",
|
|
29
30
|
"import": "./dist/index.js",
|
|
30
31
|
"default": "./dist/index.js"
|
|
31
32
|
},
|
|
@@ -82,6 +83,7 @@
|
|
|
82
83
|
"@types/react": "^19.3.0",
|
|
83
84
|
"lucide": "1.48.0",
|
|
84
85
|
"react": "^19.3.0",
|
|
86
|
+
"satori": "0.19.3",
|
|
85
87
|
"simple-icons": "16.34.0",
|
|
86
88
|
"zod": "^4.6.5"
|
|
87
89
|
},
|
|
@@ -101,5 +103,5 @@
|
|
|
101
103
|
"tsx": "^4.23.15",
|
|
102
104
|
"typescript": "^7.0.2"
|
|
103
105
|
},
|
|
104
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "68241c5d827553785d78cf6cc8fd014266deafb0"
|
|
105
107
|
}
|