@tscircuit/fake-snippets 0.0.99 → 0.0.100

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.
@@ -186,6 +186,7 @@ export const EditPackageDetailsDialog = ({
186
186
  "packageFile",
187
187
  { package_release_id: packageReleaseId },
188
188
  ])
189
+ qc.invalidateQueries(["packageFiles", packageReleaseId])
189
190
  toast({
190
191
  title: "Package details updated",
191
192
  description: "Successfully updated package details",
@@ -376,7 +377,7 @@ export const EditPackageDetailsDialog = ({
376
377
  className="mt-2 rounded-md"
377
378
  onToggle={(e) => setDangerOpen(e.currentTarget.open)}
378
379
  >
379
- <summary className="cursor-pointer p-2 font-medium text-sm text-black list-none flex justify-between items-center">
380
+ <summary className="select-none cursor-pointer p-2 font-medium text-sm text-black list-none flex justify-between items-center">
380
381
  Danger Zone
381
382
  <ChevronDown
382
383
  className={`w-4 h-4 mr-1 transition-transform ${dangerOpen ? "rotate-180" : ""}`}
@@ -405,7 +406,7 @@ export const EditPackageDetailsDialog = ({
405
406
  </div>
406
407
 
407
408
  <DialogFooter className="mt-auto">
408
- <div className="lg:px-2 flex flex-col sm:flex-row justify-end gap-2">
409
+ <div className="lg:px-2 select-none flex flex-col sm:flex-row justify-end gap-2">
409
410
  <Button
410
411
  variant="outline"
411
412
  onClick={() => onOpenChange(false)}
@@ -172,7 +172,7 @@ export function CodeAndPreview({ pkg, projectUrl }: Props) {
172
172
 
173
173
  if (urlParams.package_id && (!pkg || isLoading)) {
174
174
  return (
175
- <div className="flex items-center justify-center h-[60vh]">
175
+ <div className="flex items-center justify-center h-[80vh]">
176
176
  <div className="flex flex-col items-center justify-center">
177
177
  <div className="text-lg text-gray-500 mb-4">Loading</div>
178
178
  <Loader2 className="w-16 h-16 animate-spin text-gray-400" />
@@ -205,7 +205,7 @@ export const CodeEditor = ({
205
205
  projectName: "my-project",
206
206
  typescript: tsModule,
207
207
  logger: console,
208
- fetcher: async (input: RequestInfo | URL, init?: RequestInit) => {
208
+ fetcher: (async (input: RequestInfo | URL, init?: RequestInit) => {
209
209
  const registryPrefixes = [
210
210
  "https://data.jsdelivr.com/v1/package/resolve/npm/@tsci/",
211
211
  "https://data.jsdelivr.com/v1/package/npm/@tsci/",
@@ -231,7 +231,7 @@ export const CodeEditor = ({
231
231
  )
232
232
  }
233
233
  return fetch(input, init)
234
- },
234
+ }) as typeof fetch,
235
235
  delegate: {
236
236
  started: () => {
237
237
  const manualEditsTypeDeclaration = `
@@ -17,7 +17,7 @@ export const useCreatePackageMutation = ({
17
17
  is_private,
18
18
  is_unlisted,
19
19
  }: {
20
- name: string
20
+ name?: string
21
21
  description?: string
22
22
  is_private?: boolean
23
23
  is_unlisted?: boolean
@@ -1,10 +1,7 @@
1
1
  import { useEffect, useMemo, useState, useCallback, useRef } from "react"
2
2
  import { isValidFileName } from "@/lib/utils/isValidFileName"
3
3
  import { PackageFile } from "@/types/package"
4
- import {
5
- DEFAULT_CODE,
6
- generateRandomPackageName,
7
- } from "@/lib/utils/package-utils"
4
+ import { DEFAULT_CODE } from "@/lib/utils/package-utils"
8
5
  import { Package } from "fake-snippets-api/lib/db/schema"
9
6
  import { usePackageFiles } from "./use-package-files"
10
7
  import { decodeUrlHashToText } from "@/lib/decodeUrlHashToText"
@@ -318,7 +315,6 @@ export function useFileManagement({
318
315
  }
319
316
 
320
317
  await createPackageMutation.mutateAsync({
321
- name: `${loggedInUser?.github_username}/${generateRandomPackageName()}`,
322
318
  is_private: isPrivate,
323
319
  })
324
320
  }
@@ -5,6 +5,3 @@ export default () => (
5
5
  </board>
6
6
  )
7
7
  `.trim()
8
-
9
- export const generateRandomPackageName = () =>
10
- `untitled-package-${Math.floor(Math.random() * 900) + 100}`