@tscircuit/fake-snippets 0.0.118 → 0.0.120
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/bun-tests/fake-snippets-api/routes/bug_reports/create.test.ts +37 -0
- package/bun-tests/fake-snippets-api/routes/bug_reports/upload_file.test.ts +89 -0
- package/bun-tests/fake-snippets-api/routes/packages/get.test.ts +3 -0
- package/bun.lock +2 -2
- package/dist/bundle.js +778 -508
- package/dist/index.d.ts +161 -6
- package/dist/index.js +102 -3
- package/dist/schema.d.ts +225 -7
- package/dist/schema.js +38 -3
- package/fake-snippets-api/lib/db/db-client.ts +98 -0
- package/fake-snippets-api/lib/db/schema.ts +37 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package-release.ts +6 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package.ts +9 -0
- package/fake-snippets-api/routes/api/bug_reports/create.ts +43 -0
- package/fake-snippets-api/routes/api/bug_reports/upload_file.ts +113 -0
- package/package.json +2 -2
- package/src/components/Header.tsx +16 -0
- package/src/components/PackageCard.tsx +7 -4
- package/src/components/PackageSearchResults.tsx +1 -7
- package/src/components/SearchComponent.tsx +64 -53
- package/src/components/TrendingPackagesCarousel.tsx +16 -23
- package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +3 -2
- package/src/components/ViewPackagePage/components/preview-image-squares.tsx +6 -3
- package/src/hooks/use-preview-images.ts +22 -17
- package/src/hooks/useUpdatePackageFilesMutation.ts +8 -0
- package/src/lib/utils/getPackagePreviewImageUrl.ts +15 -0
- package/src/pages/dashboard.tsx +0 -1
- package/src/pages/editor.tsx +12 -9
- package/src/pages/organization-profile.tsx +0 -1
- package/src/pages/package-editor.tsx +13 -9
- package/src/pages/user-profile.tsx +0 -1
package/src/pages/editor.tsx
CHANGED
|
@@ -8,6 +8,11 @@ export const EditorPage = () => {
|
|
|
8
8
|
const { packageInfo: pkg, error } = useCurrentPackageInfo()
|
|
9
9
|
|
|
10
10
|
const projectUrl = pkg ? `https://tscircuit.com/${pkg.name}` : undefined
|
|
11
|
+
const previewImageUrl =
|
|
12
|
+
pkg?.latest_pcb_preview_image_url ??
|
|
13
|
+
pkg?.latest_sch_preview_image_url ??
|
|
14
|
+
pkg?.latest_cad_preview_image_url ??
|
|
15
|
+
undefined
|
|
11
16
|
|
|
12
17
|
return (
|
|
13
18
|
<div className="overflow-x-hidden">
|
|
@@ -21,15 +26,13 @@ export const EditorPage = () => {
|
|
|
21
26
|
property="og:title"
|
|
22
27
|
content={`${pkg.unscoped_name} - tscircuit`}
|
|
23
28
|
/>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
content={`https://api.tscircuit.com/packages/images/${pkg.owner_github_username}/${pkg.unscoped_name}/pcb.png?fs_sha=${pkg.latest_package_release_fs_sha}`}
|
|
32
|
-
/>
|
|
29
|
+
{previewImageUrl && (
|
|
30
|
+
<>
|
|
31
|
+
<meta property="og:image" content={previewImageUrl} />
|
|
32
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
33
|
+
<meta name="twitter:image" content={previewImageUrl} />
|
|
34
|
+
</>
|
|
35
|
+
)}
|
|
33
36
|
</>
|
|
34
37
|
)}
|
|
35
38
|
</Helmet>
|
|
@@ -12,6 +12,12 @@ export const EditorPage = () => {
|
|
|
12
12
|
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
+
const previewImageUrl =
|
|
16
|
+
pkg?.latest_pcb_preview_image_url ??
|
|
17
|
+
pkg?.latest_sch_preview_image_url ??
|
|
18
|
+
pkg?.latest_cad_preview_image_url ??
|
|
19
|
+
undefined
|
|
20
|
+
|
|
15
21
|
return (
|
|
16
22
|
<div className="flex flex-col h-screen overflow-x-hidden">
|
|
17
23
|
<Helmet>
|
|
@@ -22,15 +28,13 @@ export const EditorPage = () => {
|
|
|
22
28
|
property="og:title"
|
|
23
29
|
content={`${pkg.unscoped_name} - tscircuit`}
|
|
24
30
|
/>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
content={`https://api.tscircuit.com/packages/images/${pkg.owner_github_username}/${pkg.unscoped_name}/pcb.png?fs_sha=${pkg.latest_package_release_fs_sha}`}
|
|
33
|
-
/>
|
|
31
|
+
{previewImageUrl && (
|
|
32
|
+
<>
|
|
33
|
+
<meta property="og:image" content={previewImageUrl} />
|
|
34
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
35
|
+
<meta name="twitter:image" content={previewImageUrl} />
|
|
36
|
+
</>
|
|
37
|
+
)}
|
|
34
38
|
</>
|
|
35
39
|
)}
|
|
36
40
|
</Helmet>
|