@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
|
@@ -16,71 +16,71 @@ const PICTOS_DIR = join(import.meta.dir, "../src/assets/pictos");
|
|
|
16
16
|
const fingerprintCache = new Map<string, number[]>();
|
|
17
17
|
|
|
18
18
|
function alphaFingerprint(fileName: string): number[] {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const cached = fingerprintCache.get(fileName);
|
|
20
|
+
if (cached) return cached;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const path = join(PICTOS_DIR, fileName);
|
|
23
|
+
const out = execSync(`magick "${path}" -alpha extract -resize 64x64! -threshold 10% txt:-`, {
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
});
|
|
26
|
+
const fp = [...out.matchAll(/#([0-9A-Fa-f]+)/g)].map((m) => Number.parseInt(m[1], 16));
|
|
27
|
+
fingerprintCache.set(fileName, fp);
|
|
28
|
+
return fp;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function distance(a: number[], b: number[]): number {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
let dist = 0;
|
|
33
|
+
for (let i = 0; i < Math.min(a.length, b.length); i++) {
|
|
34
|
+
dist += Math.abs(a[i] - b[i]);
|
|
35
|
+
}
|
|
36
|
+
return dist;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
async function main() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const thresholdArg = process.argv.indexOf("--threshold");
|
|
41
|
+
const thresholdMultiplier =
|
|
42
|
+
thresholdArg >= 0 ? Number.parseFloat(process.argv[thresholdArg + 1]) : 3;
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const glassNames = (await readdir(PICTOS_DIR))
|
|
45
|
+
.filter((f) => f.endsWith(".webp") && !f.endsWith("Gradient.webp"))
|
|
46
|
+
.map((f) => f.replace(/\.webp$/, ""));
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const scores: { name: string; distance: number }[] = [];
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
for (const name of glassNames) {
|
|
51
|
+
const gradientFile = `${name}Gradient.webp`;
|
|
52
|
+
try {
|
|
53
|
+
alphaFingerprint(`${name}.webp`);
|
|
54
|
+
alphaFingerprint(gradientFile);
|
|
55
|
+
} catch {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
scores.push({
|
|
59
|
+
name,
|
|
60
|
+
distance: distance(alphaFingerprint(`${name}.webp`), alphaFingerprint(gradientFile)),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
scores.sort((a, b) => b.distance - a.distance);
|
|
65
|
+
const distances = scores.map((s) => s.distance);
|
|
66
|
+
const median = distances[Math.floor(distances.length / 2)] ?? 0;
|
|
67
|
+
const cutoff = median * thresholdMultiplier;
|
|
68
|
+
const outliers = scores.filter((s) => s.distance > cutoff);
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
console.log(`Compared ${scores.length} glass/gradient pairs`);
|
|
71
|
+
console.log(`Median silhouette distance: ${median.toFixed(0)}`);
|
|
72
|
+
console.log(`Flagging ${outliers.length} outliers (>${thresholdMultiplier}x median):\n`);
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
for (const outlier of outliers) {
|
|
75
|
+
console.log(
|
|
76
|
+
` ${outlier.name}: ${outlier.distance.toFixed(0)} (${(outlier.distance / median).toFixed(1)}x)`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
if (outliers.length > 0) process.exit(1);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
main().catch((err) => {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
console.error(err);
|
|
85
|
+
process.exit(1);
|
|
86
86
|
});
|