@surrealdb/ui 1.2.12 → 1.2.13
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/.claude/launch.json +17 -0
- package/.oxfmtrc.json +27 -0
- package/.oxlintrc.json +23 -0
- package/.zed/settings.json +34 -34
- package/AGENTS.md +21 -19
- package/README.md +15 -10
- package/dist/ui.css +1 -1
- package/dist/ui.d.ts +234 -1
- package/dist/ui.js +8217 -7329
- package/dist/ui.js.map +1 -1
- package/doc/code-style.md +264 -0
- package/doc/stacker-plan.md +219 -0
- package/package.json +119 -116
- package/res/_mixins.scss +15 -11
- package/tests/_setup/e2e-helpers.tsx +85 -85
- package/tests/_setup/portable-stories.ts +11 -10
- package/tests/e2e/MarkdownEditor/content-blocks.test.tsx +140 -139
- package/tests/e2e/MarkdownEditor/edits.test.tsx +101 -100
- package/tests/e2e/MarkdownEditor/heading-fold.test.tsx +35 -34
- package/tests/e2e/MarkdownEditor/hybrid-widgets.test.tsx +178 -177
- package/tests/e2e/MarkdownEditor/image-on-image.test.tsx +50 -49
- package/tests/e2e/MarkdownEditor/jsx-block-content.test.tsx +195 -194
- package/tests/e2e/MarkdownEditor/jsx-highlight.test.tsx +47 -46
- package/tests/e2e/MarkdownEditor/jsx-inline-badges.test.tsx +35 -34
- package/tests/e2e/MarkdownEditor/jsx-inline-click.test.tsx +39 -38
- package/tests/e2e/MarkdownEditor/jsx-selection.test.tsx +28 -27
- package/tests/e2e/MarkdownEditor/link-placeholder.test.tsx +49 -48
- package/tests/e2e/MarkdownEditor/media-align.test.tsx +40 -39
- package/tests/e2e/MarkdownEditor/media-edit.test.tsx +49 -48
- package/tests/e2e/MarkdownEditor/media-sizing.test.tsx +108 -107
- package/tests/e2e/MarkdownEditor/modes.test.tsx +79 -78
- package/tests/e2e/MarkdownEditor/onimage-parity.test.tsx +29 -28
- package/tests/e2e/MarkdownEditor/regressions.test.tsx +194 -193
- package/tests/e2e/MarkdownEditor/slash-commands.test.tsx +81 -80
- package/tests/e2e/MarkdownEditor/table-click.test.tsx +36 -35
- package/tests/e2e/MarkdownEditor/table-controls.test.tsx +44 -43
- package/tests/e2e/MarkdownEditor/table-format.test.tsx +28 -27
- package/tests/e2e/MarkdownEditor/undo-redo.test.tsx +22 -21
- package/tests/e2e/MarkdownViewer/parity.test.tsx +144 -143
- package/tests/e2e/MarkdownViewer/render.test.tsx +20 -19
- package/tests/e2e/Stacker/stacker.test.tsx +304 -0
- package/tests/unit/Editor/helpers.test.ts +26 -26
- package/tests/unit/MarkdownConformance/error-isolation.test.tsx +26 -25
- package/tests/unit/MarkdownConformance/indentation.test.tsx +20 -19
- package/tests/unit/MarkdownConformance/inline-code-fuzz.test.tsx +255 -0
- package/tests/unit/MarkdownConformance/jsx-attributes.test.tsx +39 -38
- package/tests/unit/MarkdownConformance/jsx-fuzz.test.tsx +122 -122
- package/tests/unit/MarkdownConformance/links.test.tsx +78 -54
- package/tests/unit/MarkdownConformance/render-helpers.tsx +60 -60
- package/tests/unit/MarkdownEditor/code-info.test.ts +58 -58
- package/tests/unit/MarkdownEditor/decorations.test.ts +423 -421
- package/tests/unit/MarkdownEditor/editor-ready.test.ts +22 -22
- package/tests/unit/MarkdownEditor/html-descriptors.test.ts +70 -70
- package/tests/unit/MarkdownEditor/indented-fence.test.ts +80 -80
- package/tests/unit/MarkdownEditor/jsx-attr-scan.test.ts +87 -87
- package/tests/unit/MarkdownEditor/jsx-block-widget.test.ts +51 -51
- package/tests/unit/MarkdownEditor/jsx-tag-grammar.test.ts +63 -63
- package/tests/unit/MarkdownEditor/list-indent.test.ts +67 -67
- package/tests/unit/MarkdownEditor/slash-commands.test.ts +150 -150
- package/tests/unit/MarkdownEditor/table-format.test.ts +67 -67
- package/tests/unit/MarkdownEditor/table.test.ts +96 -96
- package/tests/unit/MarkdownEditor/triggers.test.ts +167 -167
- package/tests/unit/MarkdownEditor/widget-store.test.ts +90 -90
- package/tests/unit/MarkdownViewer/callout.test.tsx +42 -42
- package/tests/unit/MarkdownViewer/code-highlight.test.tsx +41 -41
- package/tests/unit/MarkdownViewer/code-title.test.tsx +45 -45
- package/tests/unit/MarkdownViewer/features.test.tsx +129 -129
- package/tests/unit/MarkdownViewer/headings.test.tsx +28 -28
- package/tests/unit/MarkdownViewer/indented-jsx-children.test.tsx +53 -53
- package/tests/unit/MarkdownViewer/jsx-block-nesting.test.tsx +137 -137
- package/tests/unit/MarkdownViewer/jsx.test.tsx +188 -188
- package/tests/unit/MarkdownViewer/list-bullets.test.tsx +31 -31
- package/tests/unit/MarkdownViewer/list-code.test.tsx +45 -45
- package/tests/unit/MarkdownViewer/preserve-newlines.test.tsx +109 -109
- package/tests/unit/MarkdownViewer/read-time.test.ts +13 -13
- package/tests/unit/MarkdownViewer/renderers.test.tsx +75 -75
- package/tests/unit/MarkdownViewer/runnable.test.tsx +51 -51
- package/tests/unit/MarkdownViewer/ssr.test.tsx +56 -55
- package/tests/unit/MarkdownViewer/syntax-highlighting.test.tsx +43 -42
- package/tests/unit/MarkdownViewer/tabs-fenced-code.test.tsx +120 -120
- package/tests/unit/MarkdownViewer/tabs.test.tsx +83 -82
- package/tests/unit/Stacker/drag.test.ts +21 -0
- package/tests/unit/Stacker/helpers.test.ts +105 -0
- package/tests/unit/Stacker/reducer.test.ts +107 -0
- package/tools/duplicate-vector-mappings.json +141 -141
- package/tools/glass-export-overrides.json +6 -6
- package/tools/icon-parser.ts +41 -40
- package/tools/integration-gradient-exports.json +55 -55
- package/tools/picto-compare.ts +32 -32
- package/tools/picto-merge-urls.ts +19 -19
- package/tools/picto-sync.ts +543 -543
- package/tools/picto-verify-gradients.ts +50 -50
- package/tools/vector-export-nodes.json +975 -975
|
@@ -1,143 +1,143 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
2
|
+
{
|
|
3
|
+
"uiKitFileName": "Memory",
|
|
4
|
+
"symbolId": "25796:1314",
|
|
5
|
+
"exportNodeId": "21128:24795",
|
|
6
|
+
"figmaVectorName": "Memory_vector",
|
|
7
|
+
"figmaFrameName": "Memory"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"uiKitFileName": "Compute",
|
|
11
|
+
"symbolId": "29295:58314",
|
|
12
|
+
"exportNodeId": "29295:58314",
|
|
13
|
+
"figmaVectorName": "Memory_vector",
|
|
14
|
+
"figmaFrameName": "Memory",
|
|
15
|
+
"figmaLightNodeId": "29295:58316"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"uiKitFileName": "HealthChat",
|
|
19
|
+
"symbolId": "25796:1395",
|
|
20
|
+
"exportNodeId": "21128:25857",
|
|
21
|
+
"figmaVectorName": "Chatbot_vector",
|
|
22
|
+
"figmaFrameName": "Chatbot"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"uiKitFileName": "Binary",
|
|
26
|
+
"symbolId": "25796:1513",
|
|
27
|
+
"exportNodeId": "25796:1513",
|
|
28
|
+
"figmaVectorName": "Code blob (JSON)_vector",
|
|
29
|
+
"figmaFrameName": "Code blob (JSON)",
|
|
30
|
+
"figmaLightNodeId": "25796:2418"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"uiKitFileName": "Clock",
|
|
34
|
+
"symbolId": "25796:1318",
|
|
35
|
+
"exportNodeId": "25796:1318",
|
|
36
|
+
"figmaVectorName": "Flexible_vector",
|
|
37
|
+
"figmaFrameName": "Flexible",
|
|
38
|
+
"figmaLightNodeId": "25796:2536"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"uiKitFileName": "CommitQueue",
|
|
42
|
+
"symbolId": "25796:1323",
|
|
43
|
+
"exportNodeId": "25796:1323",
|
|
44
|
+
"figmaVectorName": "Hands On_vector",
|
|
45
|
+
"figmaFrameName": "Hands On",
|
|
46
|
+
"figmaLightNodeId": "25796:2600"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"uiKitFileName": "Expand",
|
|
50
|
+
"symbolId": "25796:1502",
|
|
51
|
+
"exportNodeId": "25796:1502",
|
|
52
|
+
"figmaVectorName": "Scale_vector",
|
|
53
|
+
"figmaFrameName": "Scale",
|
|
54
|
+
"figmaLightNodeId": "25796:2001"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"uiKitFileName": "Swatch",
|
|
58
|
+
"symbolId": "25796:1413",
|
|
59
|
+
"exportNodeId": "25796:1413",
|
|
60
|
+
"figmaVectorName": "Palette_vector",
|
|
61
|
+
"figmaFrameName": "Palette",
|
|
62
|
+
"figmaLightNodeId": "25796:3530"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"uiKitFileName": "File",
|
|
66
|
+
"symbolId": "25796:1511",
|
|
67
|
+
"exportNodeId": "21128:25051",
|
|
68
|
+
"figmaVectorName": "Document_vector",
|
|
69
|
+
"figmaFrameName": "Document",
|
|
70
|
+
"figmaLightNodeId": "25796:2030"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"uiKitFileName": "Document",
|
|
74
|
+
"symbolId": "25796:1375",
|
|
75
|
+
"exportNodeId": "25796:1375",
|
|
76
|
+
"figmaVectorName": "Document_vector",
|
|
77
|
+
"figmaFrameName": "Document",
|
|
78
|
+
"figmaLightNodeId": "25796:2030"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"uiKitFileName": "Learn",
|
|
82
|
+
"symbolId": "25796:1493",
|
|
83
|
+
"exportNodeId": "21128:25729",
|
|
84
|
+
"figmaVectorName": "Learn_vector",
|
|
85
|
+
"figmaFrameName": "Learn",
|
|
86
|
+
"figmaLightNodeId": "25796:2836"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"uiKitFileName": "Tutorials",
|
|
90
|
+
"symbolId": "25796:1397",
|
|
91
|
+
"exportNodeId": "21128:25910",
|
|
92
|
+
"figmaVectorName": "Chat Heart_vector",
|
|
93
|
+
"figmaFrameName": "tutorials",
|
|
94
|
+
"figmaLightNodeId": "25796:2725"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"uiKitFileName": "MediaFile",
|
|
98
|
+
"symbolId": "25796:1452",
|
|
99
|
+
"exportNodeId": "25796:1452",
|
|
100
|
+
"figmaVectorName": "Video file_vector",
|
|
101
|
+
"figmaFrameName": "Video file",
|
|
102
|
+
"figmaLightNodeId": "25796:2498"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"uiKitFileName": "MergeQueue",
|
|
106
|
+
"symbolId": "25796:1356",
|
|
107
|
+
"exportNodeId": "25796:1356",
|
|
108
|
+
"figmaVectorName": "Flexible_vector",
|
|
109
|
+
"figmaFrameName": "Merge queue",
|
|
110
|
+
"figmaLightNodeId": "25796:3507"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"uiKitFileName": "Monitoring",
|
|
114
|
+
"symbolId": "25796:1527",
|
|
115
|
+
"exportNodeId": "25796:1527",
|
|
116
|
+
"figmaVectorName": "_vector",
|
|
117
|
+
"figmaFrameName": "Monitoring",
|
|
118
|
+
"figmaLightNodeId": "25796:3056"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"uiKitFileName": "Sun",
|
|
122
|
+
"symbolId": "25796:1363",
|
|
123
|
+
"exportNodeId": "25796:1363",
|
|
124
|
+
"figmaVectorName": "Union_vector",
|
|
125
|
+
"figmaFrameName": "Sun",
|
|
126
|
+
"figmaLightNodeId": "25796:3526"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"uiKitFileName": "Timeline",
|
|
130
|
+
"symbolId": "25796:1365",
|
|
131
|
+
"exportNodeId": "25796:1365",
|
|
132
|
+
"figmaVectorName": "Bars_vector",
|
|
133
|
+
"figmaFrameName": "Bars"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"uiKitFileName": "HealthBubble",
|
|
137
|
+
"symbolId": "25796:1366",
|
|
138
|
+
"exportNodeId": "21128:26006",
|
|
139
|
+
"figmaVectorName": "Health Chat_vector",
|
|
140
|
+
"figmaFrameName": "Health Bubble",
|
|
141
|
+
"figmaLightNodeId": "25796:3522"
|
|
142
|
+
}
|
|
143
143
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
{
|
|
3
|
+
"uiKitFileName": "Cursor",
|
|
4
|
+
"exportNodeId": "25755:47884",
|
|
5
|
+
"figmaFrameName": "Cursor",
|
|
6
|
+
"figmaLightName": "Cursor_light"
|
|
7
|
+
}
|
|
8
8
|
]
|
package/tools/icon-parser.ts
CHANGED
|
@@ -2,19 +2,20 @@ import { execSync } from "node:child_process";
|
|
|
2
2
|
import { exists, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join, parse } from "node:path";
|
|
5
|
+
|
|
5
6
|
import { JSDOM } from "jsdom";
|
|
6
7
|
import { optimize } from "svgo";
|
|
7
8
|
|
|
8
9
|
if (!Bun.which("picosvg")) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
console.error(
|
|
11
|
+
"🚨 picosvg is not installed. Please install it: https://github.com/googlefonts/picosvg",
|
|
12
|
+
);
|
|
13
|
+
process.exit(1);
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
if (!(await exists("icons.zip"))) {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
console.error("🚨 icons.zip is not found. Please place it in the root of the project");
|
|
18
|
+
process.exit(2);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const iconsDir = await mkdtemp(join(tmpdir(), "icons-"));
|
|
@@ -22,9 +23,9 @@ const interDir = await mkdtemp(join(tmpdir(), "inter-"));
|
|
|
22
23
|
|
|
23
24
|
// Unzip the icons.zip file
|
|
24
25
|
try {
|
|
25
|
-
|
|
26
|
+
execSync(`unzip icons.zip -d "${iconsDir}"`);
|
|
26
27
|
} catch (error) {
|
|
27
|
-
|
|
28
|
+
console.error("Error unzipping icons.zip:", error.message);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
// Read all SVG files in the icons directory
|
|
@@ -34,38 +35,38 @@ let bundleCode = "// Generated by SurrealDB UI Kit. Do not modify manually.\n\n"
|
|
|
34
35
|
let pureCode = "// Generated by SurrealDB UI Kit. Do not modify manually.\n\n";
|
|
35
36
|
|
|
36
37
|
for (const file of files) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
38
|
+
const inputPath = join(iconsDir, file);
|
|
39
|
+
const outputPath = join(interDir, file);
|
|
40
|
+
execSync(`picosvg "${inputPath}" --output_file "${outputPath}"`);
|
|
41
|
+
|
|
42
|
+
const { name } = parse(file);
|
|
43
|
+
const svg = await readFile(outputPath, "utf8");
|
|
44
|
+
const optimized = optimize(svg, {
|
|
45
|
+
multipass: true,
|
|
46
|
+
plugins: [
|
|
47
|
+
{
|
|
48
|
+
name: "mergePaths",
|
|
49
|
+
params: {
|
|
50
|
+
force: true,
|
|
51
|
+
noSpaceAfterFlags: false,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}).data;
|
|
56
|
+
|
|
57
|
+
const dom = new JSDOM(optimized);
|
|
58
|
+
const paths = dom.window.document.querySelectorAll("path");
|
|
59
|
+
|
|
60
|
+
if (paths.length !== 1) {
|
|
61
|
+
throw new Error(`Icon ${name} has ${paths.length} paths, expected 1`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const iconPath = paths[0].getAttribute("d");
|
|
65
|
+
|
|
66
|
+
bundleCode += `export const icon${name}: string = "${iconPath}";\n`;
|
|
67
|
+
pureCode += `export { icon${name} as ${name} } from "./icons";\n`;
|
|
68
|
+
|
|
69
|
+
console.log(`🔄 Converted ${name}`);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
await writeFile("./src/constants/icons.ts", bundleCode);
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
2
|
+
{ "uiKitFileName": "Sidekick", "exportNodeId": "22777:30583", "figmaFrameName": "Sidekick" },
|
|
3
|
+
{ "uiKitFileName": "Development", "exportNodeId": "25796:1453", "figmaFrameName": "Settings" },
|
|
4
|
+
{
|
|
5
|
+
"uiKitFileName": "CloudNodes",
|
|
6
|
+
"exportNodeId": "25796:1426",
|
|
7
|
+
"figmaFrameName": "cloud nodes"
|
|
8
|
+
},
|
|
9
|
+
{ "uiKitFileName": "Bot", "exportNodeId": "25796:1428", "figmaFrameName": "Agent / Bot" },
|
|
10
|
+
{ "uiKitFileName": "Agno", "exportNodeId": "21128:26168", "figmaFrameName": "Agno" },
|
|
11
|
+
{ "uiKitFileName": "Claude", "exportNodeId": "21128:26209", "figmaFrameName": "Claude" },
|
|
12
|
+
{ "uiKitFileName": "GitHub", "exportNodeId": "21128:26223", "figmaFrameName": "GitHub" },
|
|
13
|
+
{ "uiKitFileName": "Medium", "exportNodeId": "21128:26218", "figmaFrameName": "Medium" },
|
|
14
|
+
{ "uiKitFileName": "LangChain", "exportNodeId": "21128:26198", "figmaFrameName": "LangChain" },
|
|
15
|
+
{ "uiKitFileName": "Reddit", "exportNodeId": "21128:26190", "figmaFrameName": "Reddit" },
|
|
16
|
+
{ "uiKitFileName": "X", "exportNodeId": "21128:26194", "figmaFrameName": "X" },
|
|
17
|
+
{ "uiKitFileName": "MCP", "exportNodeId": "24452:1002", "figmaFrameName": "MCP" },
|
|
18
|
+
{ "uiKitFileName": "RAG", "exportNodeId": "21128:26228", "figmaFrameName": "RAG" },
|
|
19
|
+
{ "uiKitFileName": "Windsurf", "exportNodeId": "21128:26240", "figmaFrameName": "Windsurf" },
|
|
20
|
+
{ "uiKitFileName": "Instagram", "exportNodeId": "21128:26248", "figmaFrameName": "Instagram" },
|
|
21
|
+
{ "uiKitFileName": "Discord", "exportNodeId": "21128:26252", "figmaFrameName": "Discord" },
|
|
22
|
+
{ "uiKitFileName": "Zapier", "exportNodeId": "21128:26256", "figmaFrameName": "Zapier" },
|
|
23
|
+
{ "uiKitFileName": "Python", "exportNodeId": "21128:26096", "figmaFrameName": "Python" },
|
|
24
|
+
{ "uiKitFileName": "Cline", "exportNodeId": "21128:26114", "figmaFrameName": "Cline" },
|
|
25
|
+
{ "uiKitFileName": "Dev", "exportNodeId": "21128:26118", "figmaFrameName": "Dev" },
|
|
26
|
+
{ "uiKitFileName": "Rust", "exportNodeId": "21128:24875", "figmaFrameName": "Rust" },
|
|
27
|
+
{ "uiKitFileName": "Threads", "exportNodeId": "21128:26146", "figmaFrameName": "Threads" },
|
|
28
|
+
{ "uiKitFileName": "Zed", "exportNodeId": "21128:26150", "figmaFrameName": "Zed" },
|
|
29
|
+
{
|
|
30
|
+
"uiKitFileName": "StackOverflow",
|
|
31
|
+
"exportNodeId": "21128:26164",
|
|
32
|
+
"figmaFrameName": "Stack Overflow"
|
|
33
|
+
},
|
|
34
|
+
{ "uiKitFileName": "LinkedIn", "exportNodeId": "21128:26270", "figmaFrameName": "LinkedIn" },
|
|
35
|
+
{ "uiKitFileName": "Youtube", "exportNodeId": "21128:26274", "figmaFrameName": "YouTube" },
|
|
36
|
+
{ "uiKitFileName": "N8n", "exportNodeId": "21128:26131", "figmaFrameName": "n8n" },
|
|
37
|
+
{ "uiKitFileName": "Wasm", "exportNodeId": "21128:26139", "figmaFrameName": "WebAssembly" },
|
|
38
|
+
{
|
|
39
|
+
"uiKitFileName": "VisualStudioCode",
|
|
40
|
+
"exportNodeId": "21128:26178",
|
|
41
|
+
"figmaFrameName": "Visual Studio Code"
|
|
42
|
+
},
|
|
43
|
+
{ "uiKitFileName": "PDF", "exportNodeId": "25796:1324", "figmaFrameName": "Document / PDF" },
|
|
44
|
+
{
|
|
45
|
+
"uiKitFileName": "Javascript",
|
|
46
|
+
"exportNodeId": "23768:22323",
|
|
47
|
+
"figmaFrameName": "Javascript"
|
|
48
|
+
},
|
|
49
|
+
{ "uiKitFileName": "OpenAI", "exportNodeId": "24452:982", "figmaFrameName": "OpenAI" },
|
|
50
|
+
{
|
|
51
|
+
"uiKitFileName": "SurrealMCP",
|
|
52
|
+
"exportNodeId": "24452:1007",
|
|
53
|
+
"figmaFrameName": "MCP"
|
|
54
|
+
},
|
|
55
|
+
{ "uiKitFileName": "SurrealML", "exportNodeId": "25433:6610", "figmaFrameName": "SurrealML" },
|
|
56
|
+
{ "uiKitFileName": "YUApp", "exportNodeId": "21128:24571", "figmaFrameName": "YU app" }
|
|
57
57
|
]
|
package/tools/picto-compare.ts
CHANGED
|
@@ -16,49 +16,49 @@ const PICTOS_DIR = join(import.meta.dir, "../src/assets/pictos");
|
|
|
16
16
|
const TMP = join(import.meta.dir, "../.picto-compare");
|
|
17
17
|
|
|
18
18
|
async function phash(path: string): Promise<string> {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return execSync(`magick "${path}" -colorspace Gray -resize 16x16! -depth 8 txt:-`, {
|
|
20
|
+
encoding: "utf8",
|
|
21
|
+
});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function hashDistance(a: string, b: string): number {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
const valsA = [...a.matchAll(/\\((\\d+),(\\d+)\\)\\s+#(\\w+)/g)].map((m) =>
|
|
26
|
+
Number.parseInt(m[3], 16),
|
|
27
|
+
);
|
|
28
|
+
const valsB = [...b.matchAll(/\\((\\d+),(\\d+)\\)\\s+#(\\w+)/g)].map((m) =>
|
|
29
|
+
Number.parseInt(m[3], 16),
|
|
30
|
+
);
|
|
31
|
+
let dist = 0;
|
|
32
|
+
for (let i = 0; i < Math.min(valsA.length, valsB.length); i++) {
|
|
33
|
+
dist += Math.abs(valsA[i] - valsB[i]);
|
|
34
|
+
}
|
|
35
|
+
return dist;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async function main() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const manifest: { fileName: string; url: string }[] = JSON.parse(
|
|
40
|
+
await readFile(process.argv[2], "utf8"),
|
|
41
|
+
);
|
|
42
|
+
await mkdir(TMP, { recursive: true });
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const results: { fileName: string; distance: number; matched: boolean }[] = [];
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
for (const { fileName, url } of manifest) {
|
|
47
|
+
const figmaPng = join(TMP, `${fileName}-figma.png`);
|
|
48
|
+
const res = await fetch(url);
|
|
49
|
+
await writeFile(figmaPng, await res.arrayBuffer());
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const repoWebp = join(PICTOS_DIR, `${fileName}.webp`);
|
|
52
|
+
const repoPng = join(TMP, `${fileName}-repo.png`);
|
|
53
|
+
execSync(`magick "${repoWebp}" "${repoPng}"`);
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
const dist = hashDistance(await phash(figmaPng), await phash(repoPng));
|
|
56
|
+
results.push({ fileName, distance: dist, matched: dist < 5000 });
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
const failed = results.filter((r) => !r.matched);
|
|
60
|
+
console.log(`Compared ${results.length}, mismatches: ${failed.length}`);
|
|
61
|
+
for (const f of failed) console.log(` ${f.fileName}: distance ${f.distance}`);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
main().catch(console.error);
|