create-weave-frontend-app 0.25.0 → 0.26.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/dist/{create-app-Low4cR_h.js → create-app-DTdJAP42.js} +6 -6
- package/dist/{create-app-Low4cR_h.js.map → create-app-DTdJAP42.js.map} +1 -1
- package/dist/create-app.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/+nextjs+azure-web-pubsub/components/error/error.tsx +9 -20
- package/template/+nextjs+azure-web-pubsub/components/home/home.tsx +56 -23
- package/template/+nextjs+azure-web-pubsub/components/room/room.layout.tsx +46 -7
- package/template/+nextjs+azure-web-pubsub/components/room/room.tsx +30 -14
- package/template/+nextjs+azure-web-pubsub/components/room-components/connection-status.tsx +23 -18
- package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-get-azure-web-pubsub-provider.tsx +6 -46
- package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-key-down.ts +7 -2
- package/template/+nextjs+azure-web-pubsub/components/room-components/node-properties/crop-properties.tsx +102 -20
- package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/room-header.tsx +58 -3
- package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/tools-overlay.tsx +52 -2
- package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/zoom-toolbar.tsx +20 -2
- package/template/+nextjs+websockets/components/error/error.tsx +9 -20
- package/template/+nextjs+websockets/components/home/home.tsx +56 -23
- package/template/+nextjs+websockets/components/room/room.layout.tsx +46 -7
- package/template/+nextjs+websockets/components/room/room.tsx +52 -13
- package/template/+nextjs+websockets/components/room-components/connection-status.tsx +23 -7
- package/template/+nextjs+websockets/components/room-components/hooks/use-get-websockets-provider.ts +2 -43
- package/template/+nextjs+websockets/components/room-components/hooks/use-key-down.ts +7 -2
- package/template/+nextjs+websockets/components/room-components/node-properties/crop-properties.tsx +102 -20
- package/template/+nextjs+websockets/components/room-components/overlay/room-header.tsx +58 -3
- package/template/+nextjs+websockets/components/room-components/overlay/tools-overlay.tsx +52 -2
- package/template/+nextjs+websockets/components/room-components/overlay/zoom-toolbar.tsx +20 -2
|
@@ -76,11 +76,11 @@ function tryGitInit(root) {
|
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/versions.js
|
|
78
78
|
const versions = {
|
|
79
|
-
"@inditextech/weave-types": "0.
|
|
80
|
-
"@inditextech/weave-sdk": "0.
|
|
81
|
-
"@inditextech/weave-store-websockets": "0.
|
|
82
|
-
"@inditextech/weave-store-azure-web-pubsub": "0.
|
|
83
|
-
"@inditextech/weave-react": "0.
|
|
79
|
+
"@inditextech/weave-types": "0.26.0",
|
|
80
|
+
"@inditextech/weave-sdk": "0.26.0",
|
|
81
|
+
"@inditextech/weave-store-websockets": "0.26.0",
|
|
82
|
+
"@inditextech/weave-store-azure-web-pubsub": "0.26.0",
|
|
83
|
+
"@inditextech/weave-react": "0.26.0"
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
//#endregion
|
|
@@ -434,4 +434,4 @@ function pick(obj, keys) {
|
|
|
434
434
|
|
|
435
435
|
//#endregion
|
|
436
436
|
export { create, cwd, getPackageManager };
|
|
437
|
-
//# sourceMappingURL=create-app-
|
|
437
|
+
//# sourceMappingURL=create-app-DTdJAP42.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app-Low4cR_h.js","names":["cwd: string","root: string","manager: PackageManager","dest: string","options: Options","file: string","dest: string","projectName: string","from: string","to: string","rename: (s: string) => string","obj: T","keys: K[]","result: Partial<T>"],"sources":["../src/git.ts","../src/versions.js","../template/package.json","../src/auto-install.ts","../src/constants.ts","../src/create-app.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\nimport { rmSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/*\nInitialize a Git repo on the project.\n\nBased on https://github.com/vercel/next.js/blob/canary/packages/create-next-app/helpers/git.ts\n*/\n\nfunction isInGitRepository(cwd: string): boolean {\n try {\n execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isInMercurialRepository(cwd: string): boolean {\n try {\n execSync('hg --cwd . root', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isDefaultBranchSet(cwd: string): boolean {\n try {\n execSync('git config init.defaultBranch', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nexport function tryGitInit(root: string): boolean {\n let didInit = false;\n\n try {\n execSync('git --version', { stdio: 'ignore' });\n if (isInGitRepository(root) || isInMercurialRepository(root)) {\n return false;\n }\n\n execSync('git init', { stdio: 'ignore', cwd: root });\n didInit = true;\n\n if (!isDefaultBranchSet(root)) {\n execSync('git checkout -b main', { stdio: 'ignore', cwd: root });\n }\n\n execSync('git add -A', { stdio: 'ignore', cwd: root });\n execSync('git commit -m \"Initial commit from Create Fumadocs App\"', {\n stdio: 'ignore',\n cwd: root,\n });\n return true;\n } catch {\n if (didInit) {\n try {\n rmSync(join(root, '.git'), { recursive: true, force: true });\n } catch {\n // do nothing\n }\n }\n\n return false;\n }\n}\n","export const versions = {\"@inditextech/weave-types\":\"0.25.0\",\"@inditextech/weave-sdk\":\"0.25.0\",\"@inditextech/weave-store-websockets\":\"0.25.0\",\"@inditextech/weave-store-azure-web-pubsub\":\"0.25.0\",\"@inditextech/weave-react\":\"0.25.0\"}","{\n \"name\": \"example-versions\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"description\": \"Used to track dependency versions in create-*-app\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@hookform/resolvers\": \"^4.1.3\",\n \"@inditextech/weave-react\": \"0.0.0\",\n \"@inditextech/weave-sdk\": \"0.0.0\",\n \"@inditextech/weave-store-websockets\": \"0.0.0\",\n \"@inditextech/weave-store-azure-web-pubsub\": \"0.0.0\",\n \"@next/env\": \"^15.2.1\",\n \"@radix-ui/react-accordion\": \"^1.2.3\",\n \"@radix-ui/react-avatar\": \"^1.1.3\",\n \"@radix-ui/react-checkbox\": \"^1.1.4\",\n \"@radix-ui/react-dialog\": \"^1.1.6\",\n \"@radix-ui/react-dropdown-menu\": \"^2.1.6\",\n \"@radix-ui/react-label\": \"^2.1.2\",\n \"@radix-ui/react-popover\": \"^1.1.6\",\n \"@radix-ui/react-scroll-area\": \"^1.2.3\",\n \"@radix-ui/react-select\": \"^2.1.6\",\n \"@radix-ui/react-slider\": \"^1.2.3\",\n \"@radix-ui/react-slot\": \"^1.1.2\",\n \"@radix-ui/react-tabs\": \"^1.1.3\",\n \"@radix-ui/react-tooltip\": \"^1.1.8\",\n \"@react-three/fiber\": \"^8.18.0\",\n \"@react-three/postprocessing\": \"^2.19.1\",\n \"@tanstack/react-query\": \"^5.67.1\",\n \"boring-avatars\": \"^1.11.2\",\n \"change-case\": \"^5.4.4\",\n \"class-variance-authority\": \"^0.7.1\",\n \"clsx\": \"^2.1.1\",\n \"cmdk\": \"^1.0.0\",\n \"color\": \"^5.0.0\",\n \"framer-motion\": \"^11.18.2\",\n \"lodash\": \"^4.17.21\",\n \"motion\": \"^12.4.7\",\n \"next\": \"14.2.28\",\n \"next-themes\": \"^0.4.6\",\n \"ogl\": \"^1.0.11\",\n \"onnxruntime-web\": \"^1.21.0-dev.20250206-d981b153d3\",\n \"pdf-lib\": \"^1.17.1\",\n \"platform-detect\": \"^3.0.1\",\n \"postprocessing\": \"^6.37.1\",\n \"react\": \"18.2.0\",\n \"react-dom\": \"18.2.0\",\n \"react-hook-form\": \"^7.54.2\",\n \"react-number-format\": \"^5.4.3\",\n \"sharp\": \"^0.33.5\",\n \"sonner\": \"^2.0.3\",\n \"tailwind-merge\": \"^3.0.2\",\n \"tailwindcss-animate\": \"^1.0.7\",\n \"three\": \"^0.167.1\",\n \"uuid\": \"^11.1.0\",\n \"vaul\": \"^1.1.2\",\n \"zod\": \"^3.24.2\",\n \"zustand\": \"^5.0.3\"\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"^3\",\n \"@tailwindcss/postcss\": \"^4\",\n \"@testing-library/dom\": \"^10.4.0\",\n \"@testing-library/react\": \"^16.2.0\",\n \"@types/lodash\": \"^4.17.17\",\n \"@types/node\": \"^20\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"@vitest/coverage-v8\": \"^3.0.7\",\n \"eslint\": \"^8\",\n \"eslint-config-next\": \"14.2.24\",\n \"eslint-config-prettier\": \"^10.0.2\",\n \"jsdom\": \"^26.0.0\",\n \"lucide-react\": \"^0.477.0\",\n \"tailwindcss\": \"^4\",\n \"typescript\": \"^5\",\n \"vite-tsconfig-paths\": \"^5.1.4\",\n \"vitest\": \"^3.0.7\"\n }\n}\n","import { spawn } from 'cross-spawn';\n\nexport type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';\n\nexport function getPackageManager(): PackageManager {\n const userAgent = process.env.npm_config_user_agent ?? '';\n\n if (userAgent.startsWith('yarn')) {\n return 'yarn';\n }\n\n if (userAgent.startsWith('pnpm')) {\n return 'pnpm';\n }\n\n if (userAgent.startsWith('bun')) {\n return 'bun';\n }\n\n return 'npm';\n}\n\nexport function autoInstall(\n manager: PackageManager,\n dest: string\n): Promise<void> {\n return new Promise((res, reject) => {\n const installProcess = spawn(manager, ['install'], {\n stdio: 'ignore',\n env: {\n ...process.env,\n NODE_ENV: 'development',\n DISABLE_OPENCOLLECTIVE: '1',\n },\n cwd: dest,\n });\n\n installProcess.on('close', (code) => {\n if (code !== 0) {\n reject(new Error('Install failed'));\n } else {\n res();\n }\n });\n });\n}\n","import { fileURLToPath } from 'node:url';\n\nexport const sourceDir = fileURLToPath(new URL(`../`, import.meta.url).href);\nexport const cwd = process.cwd();\n","import path from 'node:path';\nimport fs from 'node:fs/promises';\nimport { tryGitInit } from '@/git';\nimport { versions as localVersions } from '@/versions';\nimport versionPkg from './../template/package.json';\nimport type { PackageManager } from './auto-install';\nimport { autoInstall } from './auto-install';\nimport { cwd, sourceDir } from './constants';\n\nexport type Template = '+nextjs+websockets' | '+nextjs+azure-web-pubsub';\n\nexport interface Options {\n outputDir: string;\n template: Template;\n packageManager: PackageManager;\n installDeps?: boolean;\n initializeGit?: boolean;\n log?: (message: string) => void;\n}\n\nexport async function create(options: Options): Promise<void> {\n const {\n installDeps = true,\n initializeGit = true,\n log = console.log,\n } = options;\n const projectName = path.basename(options.outputDir);\n const dest = path.resolve(cwd, options.outputDir);\n\n function defaultRename(file: string): string {\n file = file.replace('example.gitignore', '.gitignore');\n file = file.replace('example.env', '.env');\n\n return file;\n }\n\n await copy(\n path.join(sourceDir, `template/${options.template}`),\n dest,\n defaultRename\n );\n\n const packageJson = createPackageJson(projectName, options);\n await fs.writeFile(\n path.join(dest, 'package.json'),\n JSON.stringify(packageJson, null, 2)\n );\n\n const readMe = await getReadme(dest, projectName);\n await fs.writeFile(path.join(dest, 'README.md'), readMe);\n\n if (installDeps) {\n await autoInstall(options.packageManager, dest);\n log('Installed dependencies');\n }\n\n if (initializeGit && tryGitInit(dest)) {\n log('Initialized Git repository');\n }\n}\n\nasync function getReadme(dest: string, projectName: string): Promise<string> {\n const template = await fs\n .readFile(path.join(dest, 'README.md'))\n .then((res) => res.toString());\n\n return `# ${projectName}\\n\\n${template}`;\n}\n\nasync function copy(\n from: string,\n to: string,\n rename: (s: string) => string = (s) => s\n): Promise<void> {\n const stats = await fs.stat(from);\n\n if (stats.isDirectory()) {\n const files = await fs.readdir(from);\n\n await Promise.all(\n files.map((file) =>\n copy(path.join(from, file), rename(path.join(to, file)))\n )\n );\n } else {\n await fs.mkdir(path.dirname(to), { recursive: true });\n await fs.copyFile(from, to);\n }\n}\n\nfunction createPackageJson(projectName: string, options: Options): object {\n if (options.template === '+nextjs+azure-web-pubsub') {\n const dependencies = {\n ...pick(versionPkg.dependencies, [\n '@hookform/resolvers',\n '@next/env',\n '@radix-ui/react-accordion',\n '@radix-ui/react-avatar',\n '@radix-ui/react-checkbox',\n '@radix-ui/react-dialog',\n '@radix-ui/react-dropdown-menu',\n '@radix-ui/react-label',\n '@radix-ui/react-popover',\n '@radix-ui/react-scroll-area',\n '@radix-ui/react-select',\n '@radix-ui/react-slider',\n '@radix-ui/react-slot',\n '@radix-ui/react-tabs',\n '@radix-ui/react-tooltip',\n '@react-three/fiber',\n '@react-three/postprocessing',\n '@tanstack/react-query',\n 'boring-avatars',\n 'change-case',\n 'class-variance-authority',\n 'clsx',\n 'cmdk',\n 'color',\n 'framer-motion',\n 'lodash',\n 'motion',\n 'next',\n 'next-themes',\n 'ogl',\n 'onnxruntime-web',\n 'pdf-lib',\n 'platform-detect',\n 'postprocessing',\n 'react',\n 'react-dom',\n 'react-hook-form',\n 'react-number-format',\n 'sharp',\n 'sonner',\n 'tailwind-merge',\n 'tailwindcss-animate',\n 'three',\n 'uuid',\n 'vaul',\n 'zod',\n 'zustand',\n ]),\n ...pick(localVersions, [\n '@inditextech/weave-react',\n '@inditextech/weave-sdk',\n '@inditextech/weave-store-azure-web-pubsub',\n ]),\n };\n\n const devDependencies = {\n ...pick(versionPkg.devDependencies, [\n '@eslint/eslintrc',\n '@tailwindcss/postcss',\n '@testing-library/dom',\n '@testing-library/react',\n '@types/lodash',\n '@types/node',\n '@types/react',\n '@types/react-dom',\n '@vitejs/plugin-react',\n 'eslint',\n 'eslint-config-next',\n 'eslint-config-prettier',\n 'jsdom',\n 'lucide-react',\n 'tailwindcss',\n 'typescript',\n 'vite-tsconfig-paths',\n ]),\n };\n\n return {\n name: projectName,\n version: '0.0.0',\n private: true,\n scripts: {\n build: 'next build',\n dev: 'next dev --experimental-https',\n lint: 'next lint',\n start: 'next start',\n },\n dependencies: sortObjectKeys(dependencies),\n devDependencies: sortObjectKeys(devDependencies),\n };\n }\n\n const dependencies = {\n ...pick(versionPkg.dependencies, [\n '@hookform/resolvers',\n '@next/env',\n '@radix-ui/react-accordion',\n '@radix-ui/react-avatar',\n '@radix-ui/react-checkbox',\n '@radix-ui/react-dialog',\n '@radix-ui/react-dropdown-menu',\n '@radix-ui/react-label',\n '@radix-ui/react-popover',\n '@radix-ui/react-scroll-area',\n '@radix-ui/react-select',\n '@radix-ui/react-slider',\n '@radix-ui/react-slot',\n '@radix-ui/react-tabs',\n '@radix-ui/react-tooltip',\n '@react-three/fiber',\n '@react-three/postprocessing',\n '@tanstack/react-query',\n 'boring-avatars',\n 'change-case',\n 'class-variance-authority',\n 'clsx',\n 'cmdk',\n 'color',\n 'framer-motion',\n 'lodash',\n 'motion',\n 'next',\n 'next-themes',\n 'ogl',\n 'onnxruntime-web',\n 'pdf-lib',\n 'platform-detect',\n 'postprocessing',\n 'react',\n 'react-dom',\n 'react-hook-form',\n 'react-number-format',\n 'sharp',\n 'sonner',\n 'tailwind-merge',\n 'tailwindcss-animate',\n 'three',\n 'uuid',\n 'vaul',\n 'zod',\n 'zustand',\n ]),\n ...pick(localVersions, [\n '@inditextech/weave-react',\n '@inditextech/weave-sdk',\n '@inditextech/weave-store-websockets',\n ]),\n };\n\n const devDependencies = {\n ...pick(versionPkg.devDependencies, [\n '@eslint/eslintrc',\n '@tailwindcss/postcss',\n '@testing-library/dom',\n '@testing-library/react',\n '@types/lodash',\n '@types/node',\n '@types/react',\n '@types/react-dom',\n '@vitejs/plugin-react',\n 'eslint',\n 'eslint-config-next',\n 'eslint-config-prettier',\n 'jsdom',\n 'lucide-react',\n 'tailwindcss',\n 'typescript',\n 'vite-tsconfig-paths',\n ]),\n };\n\n return {\n name: projectName,\n version: '0.0.0',\n private: true,\n scripts: {\n build: 'next build',\n dev: 'next dev --experimental-https',\n lint: 'next lint',\n start: 'next start',\n },\n dependencies: sortObjectKeys(dependencies),\n devDependencies: sortObjectKeys(devDependencies),\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction sortObjectKeys<T extends Record<string, any>>(obj: T): T {\n const sortedEntries = Object.keys(obj)\n .sort()\n .map((key) => [key, obj[key]] as [keyof T, T[keyof T]]);\n\n return Object.fromEntries(sortedEntries) as T;\n}\n\nfunction pick<T extends object, K extends keyof T>(\n obj: T,\n keys: K[]\n): Pick<T, K> {\n const result: Partial<T> = {};\n\n for (const key of keys) {\n if (key in obj) {\n result[key] = obj[key];\n }\n }\n\n return result as Pick<T, K>;\n}\n"],"mappings":";;;;;;;;AAUA,SAAS,kBAAkBA,OAAsB;AAC/C,KAAI;AACF,WAAS,uCAAuC;GAAE,OAAO;GAAU;EAAK,EAAC;AACzE,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAS,wBAAwBA,OAAsB;AACrD,KAAI;AACF,WAAS,mBAAmB;GAAE,OAAO;GAAU;EAAK,EAAC;AACrD,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAS,mBAAmBA,OAAsB;AAChD,KAAI;AACF,WAAS,iCAAiC;GAAE,OAAO;GAAU;EAAK,EAAC;AACnE,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAgB,WAAWC,MAAuB;CAChD,IAAI,UAAU;AAEd,KAAI;AACF,WAAS,iBAAiB,EAAE,OAAO,SAAU,EAAC;AAC9C,MAAI,kBAAkB,KAAK,IAAI,wBAAwB,KAAK,CAC1D,QAAO;AAGT,WAAS,YAAY;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AACpD,YAAU;AAEV,OAAK,mBAAmB,KAAK,CAC3B,UAAS,wBAAwB;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AAGlE,WAAS,cAAc;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AACtD,WAAS,6DAA2D;GAClE,OAAO;GACP,KAAK;EACN,EAAC;AACF,SAAO;CACR,QAAO;AACN,MAAI,QACF,KAAI;AACF,UAAO,KAAK,MAAM,OAAO,EAAE;IAAE,WAAW;IAAM,OAAO;GAAM,EAAC;EAC7D,QAAO,CAEP;AAGH,SAAO;CACR;AACF;;;;ACtED,MAAa,WAAW;CAAC,4BAA2B;CAAS,0BAAyB;CAAS,uCAAsC;CAAS,6CAA4C;CAAS,4BAA2B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T,SAAS;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACD,cAAc,eAAe,eAAa;GAC1C,iBAAiB,eAAe,kBAAgB;EACjD;CACF;CAED,MAAM,iBAAe;EACnB,GAAG,KAAK,gBAAW,cAAc;GAC/B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;EACF,GAAG,KAAK,UAAe;GACrB;GACA;GACA;EACD,EAAC;CACH;CAED,MAAM,oBAAkB,EACtB,GAAG,KAAK,gBAAW,iBAAiB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,CACH;AAED,QAAO;EACL,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;GACP,OAAO;GACP,KAAK;GACL,MAAM;GACN,OAAO;EACR;EACD,cAAc,eAAe,eAAa;EAC1C,iBAAiB,eAAe,kBAAgB;CACjD;AACF;AAGD,SAAS,eAA8CO,KAAW;CAChE,MAAM,gBAAgB,OAAO,KAAK,IAAI,CACnC,MAAM,CACN,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAK,EAA0B;AAEzD,QAAO,OAAO,YAAY,cAAc;AACzC;AAED,SAAS,KACPA,KACAC,MACY;CACZ,MAAMC,SAAqB,CAAE;AAE7B,MAAK,MAAM,OAAO,KAChB,KAAI,OAAO,IACT,QAAO,OAAO,IAAI;AAItB,QAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"create-app-DTdJAP42.js","names":["cwd: string","root: string","manager: PackageManager","dest: string","options: Options","file: string","dest: string","projectName: string","from: string","to: string","rename: (s: string) => string","obj: T","keys: K[]","result: Partial<T>"],"sources":["../src/git.ts","../src/versions.js","../template/package.json","../src/auto-install.ts","../src/constants.ts","../src/create-app.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\nimport { rmSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/*\nInitialize a Git repo on the project.\n\nBased on https://github.com/vercel/next.js/blob/canary/packages/create-next-app/helpers/git.ts\n*/\n\nfunction isInGitRepository(cwd: string): boolean {\n try {\n execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isInMercurialRepository(cwd: string): boolean {\n try {\n execSync('hg --cwd . root', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isDefaultBranchSet(cwd: string): boolean {\n try {\n execSync('git config init.defaultBranch', { stdio: 'ignore', cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nexport function tryGitInit(root: string): boolean {\n let didInit = false;\n\n try {\n execSync('git --version', { stdio: 'ignore' });\n if (isInGitRepository(root) || isInMercurialRepository(root)) {\n return false;\n }\n\n execSync('git init', { stdio: 'ignore', cwd: root });\n didInit = true;\n\n if (!isDefaultBranchSet(root)) {\n execSync('git checkout -b main', { stdio: 'ignore', cwd: root });\n }\n\n execSync('git add -A', { stdio: 'ignore', cwd: root });\n execSync('git commit -m \"Initial commit from Create Fumadocs App\"', {\n stdio: 'ignore',\n cwd: root,\n });\n return true;\n } catch {\n if (didInit) {\n try {\n rmSync(join(root, '.git'), { recursive: true, force: true });\n } catch {\n // do nothing\n }\n }\n\n return false;\n }\n}\n","export const versions = {\"@inditextech/weave-types\":\"0.26.0\",\"@inditextech/weave-sdk\":\"0.26.0\",\"@inditextech/weave-store-websockets\":\"0.26.0\",\"@inditextech/weave-store-azure-web-pubsub\":\"0.26.0\",\"@inditextech/weave-react\":\"0.26.0\"}","{\n \"name\": \"example-versions\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"description\": \"Used to track dependency versions in create-*-app\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@hookform/resolvers\": \"^4.1.3\",\n \"@inditextech/weave-react\": \"0.0.0\",\n \"@inditextech/weave-sdk\": \"0.0.0\",\n \"@inditextech/weave-store-websockets\": \"0.0.0\",\n \"@inditextech/weave-store-azure-web-pubsub\": \"0.0.0\",\n \"@next/env\": \"^15.2.1\",\n \"@radix-ui/react-accordion\": \"^1.2.3\",\n \"@radix-ui/react-avatar\": \"^1.1.3\",\n \"@radix-ui/react-checkbox\": \"^1.1.4\",\n \"@radix-ui/react-dialog\": \"^1.1.6\",\n \"@radix-ui/react-dropdown-menu\": \"^2.1.6\",\n \"@radix-ui/react-label\": \"^2.1.2\",\n \"@radix-ui/react-popover\": \"^1.1.6\",\n \"@radix-ui/react-scroll-area\": \"^1.2.3\",\n \"@radix-ui/react-select\": \"^2.1.6\",\n \"@radix-ui/react-slider\": \"^1.2.3\",\n \"@radix-ui/react-slot\": \"^1.1.2\",\n \"@radix-ui/react-tabs\": \"^1.1.3\",\n \"@radix-ui/react-tooltip\": \"^1.1.8\",\n \"@react-three/fiber\": \"^8.18.0\",\n \"@react-three/postprocessing\": \"^2.19.1\",\n \"@tanstack/react-query\": \"^5.67.1\",\n \"boring-avatars\": \"^1.11.2\",\n \"change-case\": \"^5.4.4\",\n \"class-variance-authority\": \"^0.7.1\",\n \"clsx\": \"^2.1.1\",\n \"cmdk\": \"^1.0.0\",\n \"color\": \"^5.0.0\",\n \"framer-motion\": \"^11.18.2\",\n \"lodash\": \"^4.17.21\",\n \"motion\": \"^12.4.7\",\n \"next\": \"14.2.28\",\n \"next-themes\": \"^0.4.6\",\n \"ogl\": \"^1.0.11\",\n \"onnxruntime-web\": \"^1.21.0-dev.20250206-d981b153d3\",\n \"pdf-lib\": \"^1.17.1\",\n \"platform-detect\": \"^3.0.1\",\n \"postprocessing\": \"^6.37.1\",\n \"react\": \"18.2.0\",\n \"react-dom\": \"18.2.0\",\n \"react-hook-form\": \"^7.54.2\",\n \"react-number-format\": \"^5.4.3\",\n \"sharp\": \"^0.33.5\",\n \"sonner\": \"^2.0.3\",\n \"tailwind-merge\": \"^3.0.2\",\n \"tailwindcss-animate\": \"^1.0.7\",\n \"three\": \"^0.167.1\",\n \"uuid\": \"^11.1.0\",\n \"vaul\": \"^1.1.2\",\n \"zod\": \"^3.24.2\",\n \"zustand\": \"^5.0.3\"\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"^3\",\n \"@tailwindcss/postcss\": \"^4\",\n \"@testing-library/dom\": \"^10.4.0\",\n \"@testing-library/react\": \"^16.2.0\",\n \"@types/lodash\": \"^4.17.17\",\n \"@types/node\": \"^20\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"@vitest/coverage-v8\": \"^3.0.7\",\n \"eslint\": \"^8\",\n \"eslint-config-next\": \"14.2.24\",\n \"eslint-config-prettier\": \"^10.0.2\",\n \"jsdom\": \"^26.0.0\",\n \"lucide-react\": \"^0.477.0\",\n \"tailwindcss\": \"^4\",\n \"typescript\": \"^5\",\n \"vite-tsconfig-paths\": \"^5.1.4\",\n \"vitest\": \"^3.0.7\"\n }\n}\n","import { spawn } from 'cross-spawn';\n\nexport type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';\n\nexport function getPackageManager(): PackageManager {\n const userAgent = process.env.npm_config_user_agent ?? '';\n\n if (userAgent.startsWith('yarn')) {\n return 'yarn';\n }\n\n if (userAgent.startsWith('pnpm')) {\n return 'pnpm';\n }\n\n if (userAgent.startsWith('bun')) {\n return 'bun';\n }\n\n return 'npm';\n}\n\nexport function autoInstall(\n manager: PackageManager,\n dest: string\n): Promise<void> {\n return new Promise((res, reject) => {\n const installProcess = spawn(manager, ['install'], {\n stdio: 'ignore',\n env: {\n ...process.env,\n NODE_ENV: 'development',\n DISABLE_OPENCOLLECTIVE: '1',\n },\n cwd: dest,\n });\n\n installProcess.on('close', (code) => {\n if (code !== 0) {\n reject(new Error('Install failed'));\n } else {\n res();\n }\n });\n });\n}\n","import { fileURLToPath } from 'node:url';\n\nexport const sourceDir = fileURLToPath(new URL(`../`, import.meta.url).href);\nexport const cwd = process.cwd();\n","import path from 'node:path';\nimport fs from 'node:fs/promises';\nimport { tryGitInit } from '@/git';\nimport { versions as localVersions } from '@/versions';\nimport versionPkg from './../template/package.json';\nimport type { PackageManager } from './auto-install';\nimport { autoInstall } from './auto-install';\nimport { cwd, sourceDir } from './constants';\n\nexport type Template = '+nextjs+websockets' | '+nextjs+azure-web-pubsub';\n\nexport interface Options {\n outputDir: string;\n template: Template;\n packageManager: PackageManager;\n installDeps?: boolean;\n initializeGit?: boolean;\n log?: (message: string) => void;\n}\n\nexport async function create(options: Options): Promise<void> {\n const {\n installDeps = true,\n initializeGit = true,\n log = console.log,\n } = options;\n const projectName = path.basename(options.outputDir);\n const dest = path.resolve(cwd, options.outputDir);\n\n function defaultRename(file: string): string {\n file = file.replace('example.gitignore', '.gitignore');\n file = file.replace('example.env', '.env');\n\n return file;\n }\n\n await copy(\n path.join(sourceDir, `template/${options.template}`),\n dest,\n defaultRename\n );\n\n const packageJson = createPackageJson(projectName, options);\n await fs.writeFile(\n path.join(dest, 'package.json'),\n JSON.stringify(packageJson, null, 2)\n );\n\n const readMe = await getReadme(dest, projectName);\n await fs.writeFile(path.join(dest, 'README.md'), readMe);\n\n if (installDeps) {\n await autoInstall(options.packageManager, dest);\n log('Installed dependencies');\n }\n\n if (initializeGit && tryGitInit(dest)) {\n log('Initialized Git repository');\n }\n}\n\nasync function getReadme(dest: string, projectName: string): Promise<string> {\n const template = await fs\n .readFile(path.join(dest, 'README.md'))\n .then((res) => res.toString());\n\n return `# ${projectName}\\n\\n${template}`;\n}\n\nasync function copy(\n from: string,\n to: string,\n rename: (s: string) => string = (s) => s\n): Promise<void> {\n const stats = await fs.stat(from);\n\n if (stats.isDirectory()) {\n const files = await fs.readdir(from);\n\n await Promise.all(\n files.map((file) =>\n copy(path.join(from, file), rename(path.join(to, file)))\n )\n );\n } else {\n await fs.mkdir(path.dirname(to), { recursive: true });\n await fs.copyFile(from, to);\n }\n}\n\nfunction createPackageJson(projectName: string, options: Options): object {\n if (options.template === '+nextjs+azure-web-pubsub') {\n const dependencies = {\n ...pick(versionPkg.dependencies, [\n '@hookform/resolvers',\n '@next/env',\n '@radix-ui/react-accordion',\n '@radix-ui/react-avatar',\n '@radix-ui/react-checkbox',\n '@radix-ui/react-dialog',\n '@radix-ui/react-dropdown-menu',\n '@radix-ui/react-label',\n '@radix-ui/react-popover',\n '@radix-ui/react-scroll-area',\n '@radix-ui/react-select',\n '@radix-ui/react-slider',\n '@radix-ui/react-slot',\n '@radix-ui/react-tabs',\n '@radix-ui/react-tooltip',\n '@react-three/fiber',\n '@react-three/postprocessing',\n '@tanstack/react-query',\n 'boring-avatars',\n 'change-case',\n 'class-variance-authority',\n 'clsx',\n 'cmdk',\n 'color',\n 'framer-motion',\n 'lodash',\n 'motion',\n 'next',\n 'next-themes',\n 'ogl',\n 'onnxruntime-web',\n 'pdf-lib',\n 'platform-detect',\n 'postprocessing',\n 'react',\n 'react-dom',\n 'react-hook-form',\n 'react-number-format',\n 'sharp',\n 'sonner',\n 'tailwind-merge',\n 'tailwindcss-animate',\n 'three',\n 'uuid',\n 'vaul',\n 'zod',\n 'zustand',\n ]),\n ...pick(localVersions, [\n '@inditextech/weave-react',\n '@inditextech/weave-sdk',\n '@inditextech/weave-store-azure-web-pubsub',\n ]),\n };\n\n const devDependencies = {\n ...pick(versionPkg.devDependencies, [\n '@eslint/eslintrc',\n '@tailwindcss/postcss',\n '@testing-library/dom',\n '@testing-library/react',\n '@types/lodash',\n '@types/node',\n '@types/react',\n '@types/react-dom',\n '@vitejs/plugin-react',\n 'eslint',\n 'eslint-config-next',\n 'eslint-config-prettier',\n 'jsdom',\n 'lucide-react',\n 'tailwindcss',\n 'typescript',\n 'vite-tsconfig-paths',\n ]),\n };\n\n return {\n name: projectName,\n version: '0.0.0',\n private: true,\n scripts: {\n build: 'next build',\n dev: 'next dev --experimental-https',\n lint: 'next lint',\n start: 'next start',\n },\n dependencies: sortObjectKeys(dependencies),\n devDependencies: sortObjectKeys(devDependencies),\n };\n }\n\n const dependencies = {\n ...pick(versionPkg.dependencies, [\n '@hookform/resolvers',\n '@next/env',\n '@radix-ui/react-accordion',\n '@radix-ui/react-avatar',\n '@radix-ui/react-checkbox',\n '@radix-ui/react-dialog',\n '@radix-ui/react-dropdown-menu',\n '@radix-ui/react-label',\n '@radix-ui/react-popover',\n '@radix-ui/react-scroll-area',\n '@radix-ui/react-select',\n '@radix-ui/react-slider',\n '@radix-ui/react-slot',\n '@radix-ui/react-tabs',\n '@radix-ui/react-tooltip',\n '@react-three/fiber',\n '@react-three/postprocessing',\n '@tanstack/react-query',\n 'boring-avatars',\n 'change-case',\n 'class-variance-authority',\n 'clsx',\n 'cmdk',\n 'color',\n 'framer-motion',\n 'lodash',\n 'motion',\n 'next',\n 'next-themes',\n 'ogl',\n 'onnxruntime-web',\n 'pdf-lib',\n 'platform-detect',\n 'postprocessing',\n 'react',\n 'react-dom',\n 'react-hook-form',\n 'react-number-format',\n 'sharp',\n 'sonner',\n 'tailwind-merge',\n 'tailwindcss-animate',\n 'three',\n 'uuid',\n 'vaul',\n 'zod',\n 'zustand',\n ]),\n ...pick(localVersions, [\n '@inditextech/weave-react',\n '@inditextech/weave-sdk',\n '@inditextech/weave-store-websockets',\n ]),\n };\n\n const devDependencies = {\n ...pick(versionPkg.devDependencies, [\n '@eslint/eslintrc',\n '@tailwindcss/postcss',\n '@testing-library/dom',\n '@testing-library/react',\n '@types/lodash',\n '@types/node',\n '@types/react',\n '@types/react-dom',\n '@vitejs/plugin-react',\n 'eslint',\n 'eslint-config-next',\n 'eslint-config-prettier',\n 'jsdom',\n 'lucide-react',\n 'tailwindcss',\n 'typescript',\n 'vite-tsconfig-paths',\n ]),\n };\n\n return {\n name: projectName,\n version: '0.0.0',\n private: true,\n scripts: {\n build: 'next build',\n dev: 'next dev --experimental-https',\n lint: 'next lint',\n start: 'next start',\n },\n dependencies: sortObjectKeys(dependencies),\n devDependencies: sortObjectKeys(devDependencies),\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction sortObjectKeys<T extends Record<string, any>>(obj: T): T {\n const sortedEntries = Object.keys(obj)\n .sort()\n .map((key) => [key, obj[key]] as [keyof T, T[keyof T]]);\n\n return Object.fromEntries(sortedEntries) as T;\n}\n\nfunction pick<T extends object, K extends keyof T>(\n obj: T,\n keys: K[]\n): Pick<T, K> {\n const result: Partial<T> = {};\n\n for (const key of keys) {\n if (key in obj) {\n result[key] = obj[key];\n }\n }\n\n return result as Pick<T, K>;\n}\n"],"mappings":";;;;;;;;AAUA,SAAS,kBAAkBA,OAAsB;AAC/C,KAAI;AACF,WAAS,uCAAuC;GAAE,OAAO;GAAU;EAAK,EAAC;AACzE,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAS,wBAAwBA,OAAsB;AACrD,KAAI;AACF,WAAS,mBAAmB;GAAE,OAAO;GAAU;EAAK,EAAC;AACrD,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAS,mBAAmBA,OAAsB;AAChD,KAAI;AACF,WAAS,iCAAiC;GAAE,OAAO;GAAU;EAAK,EAAC;AACnE,SAAO;CACR,QAAO;AACN,SAAO;CACR;AACF;AAED,SAAgB,WAAWC,MAAuB;CAChD,IAAI,UAAU;AAEd,KAAI;AACF,WAAS,iBAAiB,EAAE,OAAO,SAAU,EAAC;AAC9C,MAAI,kBAAkB,KAAK,IAAI,wBAAwB,KAAK,CAC1D,QAAO;AAGT,WAAS,YAAY;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AACpD,YAAU;AAEV,OAAK,mBAAmB,KAAK,CAC3B,UAAS,wBAAwB;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AAGlE,WAAS,cAAc;GAAE,OAAO;GAAU,KAAK;EAAM,EAAC;AACtD,WAAS,6DAA2D;GAClE,OAAO;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A;IACA;GACD,EAAC;GACF,GAAG,KAAK,UAAe;IACrB;IACA;IACA;GACD,EAAC;EACH;EAED,MAAM,oBAAkB,EACtB,GAAG,KAAK,gBAAW,iBAAiB;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,CACH;AAED,SAAO;GACL,MAAM;GACN,SAAS;GACT,SAAS;GACT,SAAS;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,OAAO;GACR;GACD,cAAc,eAAe,eAAa;GAC1C,iBAAiB,eAAe,kBAAgB;EACjD;CACF;CAED,MAAM,iBAAe;EACnB,GAAG,KAAK,gBAAW,cAAc;GAC/B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;EACF,GAAG,KAAK,UAAe;GACrB;GACA;GACA;EACD,EAAC;CACH;CAED,MAAM,oBAAkB,EACtB,GAAG,KAAK,gBAAW,iBAAiB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,CACH;AAED,QAAO;EACL,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;GACP,OAAO;GACP,KAAK;GACL,MAAM;GACN,OAAO;EACR;EACD,cAAc,eAAe,eAAa;EAC1C,iBAAiB,eAAe,kBAAgB;CACjD;AACF;AAGD,SAAS,eAA8CO,KAAW;CAChE,MAAM,gBAAgB,OAAO,KAAK,IAAI,CACnC,MAAM,CACN,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAK,EAA0B;AAEzD,QAAO,OAAO,YAAY,cAAc;AACzC;AAED,SAAS,KACPA,KACAC,MACY;CACZ,MAAMC,SAAqB,CAAE;AAE7B,MAAK,MAAM,OAAO,KAChB,KAAI,OAAO,IACT,QAAO,OAAO,IAAI;AAItB,QAAO;AACR"}
|
package/dist/create-app.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { create, cwd, getPackageManager } from "./create-app-
|
|
2
|
+
import { create, cwd, getPackageManager } from "./create-app-DTdJAP42.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import { cancel, confirm, group, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
|
package/package.json
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
import { Logo } from '@/components/utils/logo';
|
|
14
14
|
import { useSearchParams } from 'next/navigation';
|
|
15
15
|
import { getError } from './errors';
|
|
16
|
-
import Dither from '../ui/reactbits/Backgrounds/Dither/Dither';
|
|
17
16
|
import { motion } from 'framer-motion';
|
|
18
17
|
|
|
19
18
|
export const Error = () => {
|
|
@@ -25,45 +24,32 @@ export const Error = () => {
|
|
|
25
24
|
|
|
26
25
|
return (
|
|
27
26
|
<div className="flex min-h-screen flex-col items-center justify-center bg-background relative gap-5">
|
|
28
|
-
<div className="absolute top-0 left-0 right-0 bottom-0">
|
|
29
|
-
<Dither
|
|
30
|
-
waveColor={[0.5, 0.5, 0.5]}
|
|
31
|
-
disableAnimation={false}
|
|
32
|
-
enableMouseInteraction={false}
|
|
33
|
-
mouseRadius={0.3}
|
|
34
|
-
colorNum={6}
|
|
35
|
-
pixelSize={1}
|
|
36
|
-
waveAmplitude={0.1}
|
|
37
|
-
waveFrequency={6}
|
|
38
|
-
waveSpeed={0.05}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
27
|
<motion.section
|
|
42
28
|
initial={{ opacity: 0, x: -20 }}
|
|
43
29
|
animate={{ opacity: 1, x: 0 }}
|
|
44
30
|
transition={{ duration: 0.5 }}
|
|
45
31
|
className="relative flex h-full w-full flex-col items-center justify-center"
|
|
46
32
|
>
|
|
47
|
-
<div className="max-w-[520px] w-full flex flex-col items-center justify-between gap-0">
|
|
33
|
+
<div className="max-w-[520px] w-full flex flex-col items-center justify-between gap-0 border border-[#c9c9c9]">
|
|
48
34
|
<div className="w-full flex justify-between items-center gap-2 md:left-8 md:top-8 bg-background p-8 py-6 rounded-xl">
|
|
49
|
-
<Logo />
|
|
35
|
+
<Logo kind="small" />
|
|
50
36
|
<motion.div
|
|
51
37
|
initial={{ opacity: 0, y: -20 }}
|
|
52
38
|
animate={{ opacity: 1, y: 0 }}
|
|
53
39
|
transition={{ duration: 0.5, delay: 0.2 }}
|
|
54
40
|
className="flex flex-col items-end justify-center"
|
|
55
41
|
>
|
|
56
|
-
<h1 className="text-3xl font-inter text-foreground uppercase">
|
|
42
|
+
<h1 className="text-3xl font-inter font-bold text-foreground uppercase">
|
|
57
43
|
WHITEBOARD
|
|
58
44
|
</h1>
|
|
59
|
-
<h2 className="text-2xl font-inter font-
|
|
45
|
+
<h2 className="text-2xl font-inter font-light text-muted-foreground uppercase">
|
|
60
46
|
SHOWCASE
|
|
61
47
|
</h2>
|
|
62
48
|
</motion.div>
|
|
63
49
|
</div>
|
|
64
50
|
</div>
|
|
65
51
|
</motion.section>
|
|
66
|
-
<div className="max-w-[520px] w-full flex flex-col items-center justify-between gap-0">
|
|
52
|
+
<div className="max-w-[520px] w-full flex flex-col items-center justify-between gap-0 border border-[#c9c9c9]">
|
|
67
53
|
<div className="w-full z-1 flex flex-col gap-2 items-center justify-center bg-transparent">
|
|
68
54
|
<Card className="w-full shadow-none border-0 py-8 gap-0">
|
|
69
55
|
<CardHeader className="flex flex-col items-center text-center gap-0">
|
|
@@ -82,7 +68,10 @@ export const Error = () => {
|
|
|
82
68
|
</CardContent>
|
|
83
69
|
|
|
84
70
|
<CardFooter className="flex flex-col">
|
|
85
|
-
<Button
|
|
71
|
+
<Button
|
|
72
|
+
asChild
|
|
73
|
+
className="uppercase cursor-pointer font-inter rounded-none"
|
|
74
|
+
>
|
|
86
75
|
<Link href={href}>{action}</Link>
|
|
87
76
|
</Button>
|
|
88
77
|
</CardFooter>
|
|
@@ -8,6 +8,9 @@ import LoginForm from '../home-components/login-form';
|
|
|
8
8
|
import { Button } from '../ui/button';
|
|
9
9
|
import { Github, Book } from 'lucide-react';
|
|
10
10
|
import { DOCUMENTATION_URL, GITHUB_URL } from '@/lib/constants';
|
|
11
|
+
import weavePackage from '../../node_modules/@inditextech/weave-sdk/package.json';
|
|
12
|
+
import weaveReactHelperPackage from '../../node_modules/@inditextech/weave-react/package.json';
|
|
13
|
+
import weaveStorePackage from '../../node_modules/@inditextech/weave-store-azure-web-pubsub/package.json';
|
|
11
14
|
|
|
12
15
|
export const Home = () => {
|
|
13
16
|
return (
|
|
@@ -39,29 +42,59 @@ export const Home = () => {
|
|
|
39
42
|
<div className="w-full flex flex-col gap-2 items-center justify-center bg-background p-[32px] border border-[#c9c9c9] mt-[32px]">
|
|
40
43
|
<LoginForm />
|
|
41
44
|
</div>
|
|
42
|
-
<div className="w-full flex gap-2 items-center justify-center bg-background p-8 py-2 mt-4 border border-[#c9c9c9]">
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
<div className="w-full flex flex-col gap-2 items-center justify-center bg-background p-8 py-2 mt-4 border border-[#c9c9c9]">
|
|
46
|
+
<div className="flex gap-2 justify-center-items-center">
|
|
47
|
+
<Button
|
|
48
|
+
variant="link"
|
|
49
|
+
onClick={() => {
|
|
50
|
+
window.open(GITHUB_URL, '_blank', 'noopener,noreferrer');
|
|
51
|
+
}}
|
|
52
|
+
className="cursor-pointer font-inter font-light"
|
|
53
|
+
>
|
|
54
|
+
<Github strokeWidth={1} /> GITHUB
|
|
55
|
+
</Button>
|
|
56
|
+
<Button
|
|
57
|
+
variant="link"
|
|
58
|
+
onClick={() => {
|
|
59
|
+
window.open(
|
|
60
|
+
DOCUMENTATION_URL,
|
|
61
|
+
'_blank',
|
|
62
|
+
'noopener,noreferrer'
|
|
63
|
+
);
|
|
64
|
+
}}
|
|
65
|
+
className="cursor-pointer font-inter font-light"
|
|
66
|
+
>
|
|
67
|
+
<Book strokeWidth={1} /> DOCUMENTATION
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div className="w-full flex flex-col gap-2 items-center justify-center bg-background p-8 py-2 mt-4 border border-[#c9c9c9]">
|
|
72
|
+
<div className="w-full grid grid-cols-[1fr_auto] gap-1 justify-center-items-center font-light text-[12px] py-3">
|
|
73
|
+
<div className="flex gap-1 justify-start items-center">
|
|
74
|
+
<code>@inditextech/weave-sdk</code>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="flex gap-1 justify-center items-center">
|
|
77
|
+
<code className="bg-[#e9e9e9] px-2 py-1">
|
|
78
|
+
v{weavePackage.version}
|
|
79
|
+
</code>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="flex gap-1 justify-start items-center">
|
|
82
|
+
<code>@inditextech/weave-react</code>
|
|
83
|
+
</div>
|
|
84
|
+
<div className="flex gap-1 justify-center items-center">
|
|
85
|
+
<code className="bg-[#e9e9e9] px-2 py-1">
|
|
86
|
+
v{weaveReactHelperPackage.version}
|
|
87
|
+
</code>
|
|
88
|
+
</div>
|
|
89
|
+
<div className="flex gap-1 justify-start items-center">
|
|
90
|
+
<code>@inditextech/weave-store-azure-web-pubsub</code>
|
|
91
|
+
</div>
|
|
92
|
+
<div className="flex gap-1 justify-center items-center">
|
|
93
|
+
<code className="bg-[#e9e9e9] px-2 py-1">
|
|
94
|
+
v{weaveStorePackage.version}
|
|
95
|
+
</code>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
65
98
|
</div>
|
|
66
99
|
</div>
|
|
67
100
|
</motion.section>
|
|
@@ -6,7 +6,10 @@ import { useCollaborationRoom } from '@/store/store';
|
|
|
6
6
|
import { RoomHeader } from '@/components/room-components/overlay/room-header';
|
|
7
7
|
import { ToolsOverlay } from '@/components/room-components/overlay/tools-overlay';
|
|
8
8
|
import { useWeave, useWeaveEvents } from '@inditextech/weave-react';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
WEAVE_INSTANCE_STATUS,
|
|
11
|
+
WEAVE_STORE_CONNECTION_STATUS,
|
|
12
|
+
} from '@inditextech/weave-types';
|
|
10
13
|
import { Logo } from '../utils/logo';
|
|
11
14
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
12
15
|
import { cn } from '@/lib/utils';
|
|
@@ -28,6 +31,7 @@ export const RoomLayout = () => {
|
|
|
28
31
|
const instance = useWeave((state) => state.instance);
|
|
29
32
|
const status = useWeave((state) => state.status);
|
|
30
33
|
const roomLoaded = useWeave((state) => state.room.loaded);
|
|
34
|
+
const weaveConnectionStatus = useWeave((state) => state.connection.status);
|
|
31
35
|
|
|
32
36
|
const sidebarLeftActive = useCollaborationRoom(
|
|
33
37
|
(state) => state.sidebar.left.active
|
|
@@ -111,11 +115,11 @@ export const RoomLayout = () => {
|
|
|
111
115
|
return (
|
|
112
116
|
<AnimatePresence>
|
|
113
117
|
<motion.div
|
|
114
|
-
animate={{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}}
|
|
118
|
+
// animate={{
|
|
119
|
+
// filter: !(status === WEAVE_INSTANCE_STATUS.RUNNING && roomLoaded)
|
|
120
|
+
// ? "blur(10px)"
|
|
121
|
+
// : "blur(0px)",
|
|
122
|
+
// }}
|
|
119
123
|
transition={{
|
|
120
124
|
duration: 0.5,
|
|
121
125
|
delay: !(status === WEAVE_INSTANCE_STATUS.RUNNING && roomLoaded)
|
|
@@ -139,6 +143,12 @@ export const RoomLayout = () => {
|
|
|
139
143
|
<FramesLibrary key={SIDEBAR_ELEMENTS.frames} />
|
|
140
144
|
<ColorTokensLibrary key={SIDEBAR_ELEMENTS.colorTokens} />
|
|
141
145
|
<ElementsTree key={SIDEBAR_ELEMENTS.nodesTree} />
|
|
146
|
+
{weaveConnectionStatus !==
|
|
147
|
+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED && (
|
|
148
|
+
<div className="absolute top-0 left-0 right-0 bottom-0">
|
|
149
|
+
<div className="w-full h-full bg-black/50 flex justify-center items-center pointer-events-none"></div>
|
|
150
|
+
</div>
|
|
151
|
+
)}
|
|
142
152
|
</AnimatePresence>
|
|
143
153
|
</section>
|
|
144
154
|
<section
|
|
@@ -158,8 +168,31 @@ export const RoomLayout = () => {
|
|
|
158
168
|
<div
|
|
159
169
|
id="weave"
|
|
160
170
|
tabIndex={0}
|
|
161
|
-
className=
|
|
171
|
+
className={cn('w-full h-full relative overflow-hidden', {
|
|
172
|
+
['pointer-events-none']:
|
|
173
|
+
weaveConnectionStatus !==
|
|
174
|
+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED ||
|
|
175
|
+
status !== WEAVE_INSTANCE_STATUS.RUNNING ||
|
|
176
|
+
!roomLoaded,
|
|
177
|
+
['pointer-events-auto']:
|
|
178
|
+
status === WEAVE_INSTANCE_STATUS.RUNNING && roomLoaded,
|
|
179
|
+
})}
|
|
162
180
|
></div>
|
|
181
|
+
{weaveConnectionStatus !==
|
|
182
|
+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED && (
|
|
183
|
+
<div className="absolute top-0 left-0 right-0 bottom-0">
|
|
184
|
+
<div className="w-full h-full bg-black/50 flex justify-center items-center pointer-events-none">
|
|
185
|
+
<div className="bg-white p-8 flex justify-center items-center flex-col gap-2">
|
|
186
|
+
<div className="text-2xl font-inter font-light uppercase">
|
|
187
|
+
CONNECTING
|
|
188
|
+
</div>
|
|
189
|
+
<div className="text-xl font-inter font-light text-muted-foreground">
|
|
190
|
+
Please wait...
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
)}
|
|
163
196
|
{status === WEAVE_INSTANCE_STATUS.RUNNING && roomLoaded && (
|
|
164
197
|
<>
|
|
165
198
|
<ContextMenuRender
|
|
@@ -219,6 +252,12 @@ export const RoomLayout = () => {
|
|
|
219
252
|
)}
|
|
220
253
|
>
|
|
221
254
|
<NodeProperties />
|
|
255
|
+
{weaveConnectionStatus !==
|
|
256
|
+
WEAVE_STORE_CONNECTION_STATUS.CONNECTED && (
|
|
257
|
+
<div className="absolute top-0 left-0 right-0 bottom-0">
|
|
258
|
+
<div className="w-full h-full bg-black/50 flex justify-center items-center pointer-events-none"></div>
|
|
259
|
+
</div>
|
|
260
|
+
)}
|
|
222
261
|
</section>
|
|
223
262
|
</motion.div>
|
|
224
263
|
</AnimatePresence>
|
|
@@ -10,17 +10,20 @@ import { useWeave, WeaveProvider } from '@inditextech/weave-react';
|
|
|
10
10
|
import { RoomLayout } from './room.layout';
|
|
11
11
|
import { RoomLoader } from '../room-components/room-loader/room-loader';
|
|
12
12
|
import { AnimatePresence } from 'framer-motion';
|
|
13
|
-
import
|
|
13
|
+
import useGetAzureWebPubSubProvider from '../room-components/hooks/use-get-azure-web-pubsub-provider';
|
|
14
14
|
import useHandleRouteParams from '../room-components/hooks/use-handle-route-params';
|
|
15
15
|
import { UploadFile } from '../room-components/upload-file';
|
|
16
16
|
import UserForm from '../room-components/user-form';
|
|
17
17
|
import { HelpDrawer } from '../room-components/help/help-drawer';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
const statusMap: any = {
|
|
21
|
+
[WEAVE_INSTANCE_STATUS.IDLE]: 'Idle',
|
|
22
|
+
[WEAVE_INSTANCE_STATUS.STARTING]: 'Starting Weave...',
|
|
23
|
+
[WEAVE_INSTANCE_STATUS.LOADING_FONTS]: 'Fetching fonts...',
|
|
24
|
+
[WEAVE_INSTANCE_STATUS.CONNECTING_TO_ROOM]: 'Connecting to room...',
|
|
25
|
+
[WEAVE_INSTANCE_STATUS.LOADING_ROOM]: 'Loading room...',
|
|
26
|
+
[WEAVE_INSTANCE_STATUS.RUNNING]: 'Running',
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export const Room = () => {
|
|
@@ -73,14 +76,11 @@ export const Room = () => {
|
|
|
73
76
|
if (status !== WEAVE_INSTANCE_STATUS.RUNNING) {
|
|
74
77
|
return statusMap[status];
|
|
75
78
|
}
|
|
76
|
-
if (status === WEAVE_INSTANCE_STATUS.RUNNING && !roomLoaded) {
|
|
77
|
-
return 'Fetching room content...';
|
|
78
|
-
}
|
|
79
79
|
|
|
80
80
|
return '';
|
|
81
81
|
}, [loadedParams, loadingFetchConnectionUrl, status, roomLoaded]);
|
|
82
82
|
|
|
83
|
-
const
|
|
83
|
+
const storeProvider = useGetAzureWebPubSubProvider({
|
|
84
84
|
loadedParams,
|
|
85
85
|
getUser,
|
|
86
86
|
});
|
|
@@ -96,13 +96,29 @@ export const Room = () => {
|
|
|
96
96
|
}
|
|
97
97
|
}, [instance, status, roomLoaded]);
|
|
98
98
|
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
if (status === WEAVE_INSTANCE_STATUS.CONNECTING_ERROR) {
|
|
101
|
+
router.push('/error?errorCode=room-failed-connection');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!room && !user && loadedParams) {
|
|
105
|
+
router.push('/error?errorCode=room-required-parameters');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (errorFetchConnectionUrl) {
|
|
109
|
+
router.push('/error?errorCode=room-failed-connection');
|
|
110
|
+
}
|
|
111
|
+
}, [router, room, user, status, loadedParams, errorFetchConnectionUrl]);
|
|
112
|
+
|
|
113
|
+
if (status === WEAVE_INSTANCE_STATUS.CONNECTING_ERROR) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
99
117
|
if (!room && !user && loadedParams) {
|
|
100
|
-
router.push('/error?errorCode=room-required-parameters');
|
|
101
118
|
return null;
|
|
102
119
|
}
|
|
103
120
|
|
|
104
121
|
if (errorFetchConnectionUrl) {
|
|
105
|
-
router.push('/error?errorCode=room-failed-connection');
|
|
106
122
|
return null;
|
|
107
123
|
}
|
|
108
124
|
|
|
@@ -142,11 +158,11 @@ export const Room = () => {
|
|
|
142
158
|
</>
|
|
143
159
|
)}
|
|
144
160
|
</AnimatePresence>
|
|
145
|
-
{loadedParams && room && user &&
|
|
161
|
+
{loadedParams && room && user && storeProvider && (
|
|
146
162
|
<WeaveProvider
|
|
147
163
|
containerId="weave"
|
|
148
164
|
getUser={getUser}
|
|
149
|
-
store={
|
|
165
|
+
store={storeProvider}
|
|
150
166
|
fonts={FONTS}
|
|
151
167
|
nodes={NODES}
|
|
152
168
|
actions={ACTIONS}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
//CloudCog,
|
|
7
|
-
CloudOff,
|
|
8
|
-
} from 'lucide-react';
|
|
9
|
-
import { WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS } from '@inditextech/weave-store-azure-web-pubsub/client';
|
|
4
|
+
import { Cloud, CloudCog, CloudOff } from 'lucide-react';
|
|
5
|
+
import { WEAVE_STORE_CONNECTION_STATUS } from '@inditextech/weave-types';
|
|
10
6
|
import { cn } from '@/lib/utils';
|
|
11
7
|
|
|
12
8
|
type ConnectionStatusProps = {
|
|
@@ -23,30 +19,39 @@ export const ConnectionStatus = ({
|
|
|
23
19
|
'bg-light-background-1 h-[20px] px-1 flex justify-center items-center',
|
|
24
20
|
{
|
|
25
21
|
['bg-[#C2F0E8] text-black']:
|
|
22
|
+
weaveConnectionStatus === WEAVE_STORE_CONNECTION_STATUS.CONNECTED,
|
|
23
|
+
['bg-[#FDD9B4] text-black']:
|
|
26
24
|
weaveConnectionStatus ===
|
|
27
|
-
|
|
28
|
-
// ["bg-sky-300 text-white"]:
|
|
29
|
-
// weaveConnectionStatus ===
|
|
30
|
-
// WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS.CONNECTING,
|
|
25
|
+
WEAVE_STORE_CONNECTION_STATUS.CONNECTING,
|
|
31
26
|
['bg-[#FDB4BB] text-white']:
|
|
32
27
|
weaveConnectionStatus ===
|
|
33
|
-
|
|
28
|
+
WEAVE_STORE_CONNECTION_STATUS.DISCONNECTED ||
|
|
29
|
+
weaveConnectionStatus === WEAVE_STORE_CONNECTION_STATUS.ERROR,
|
|
34
30
|
}
|
|
35
31
|
)}
|
|
36
32
|
>
|
|
37
|
-
{weaveConnectionStatus ===
|
|
38
|
-
WEAVE_STORE_AZURE_WEB_PUBSUB_CONNECTION_STATUS.CONNECTED && (
|
|
33
|
+
{weaveConnectionStatus === WEAVE_STORE_CONNECTION_STATUS.CONNECTED && (
|
|
39
34
|
<>
|
|
40
35
|
<Cloud size={18} strokeWidth={1} />
|
|
41
36
|
<span className="ml-1 font-inter text-xs uppercase">connected</span>
|
|
42
37
|
</>
|
|
43
38
|
)}
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
{weaveConnectionStatus === WEAVE_STORE_CONNECTION_STATUS.CONNECTING && (
|
|
40
|
+
<>
|
|
41
|
+
<CloudCog size={18} strokeWidth={1} />
|
|
42
|
+
<span className="ml-1 font-inter text-xs uppercase">
|
|
43
|
+
connecting
|
|
44
|
+
</span>
|
|
45
|
+
</>
|
|
46
|
+
)}
|
|
47
|
+
{weaveConnectionStatus === WEAVE_STORE_CONNECTION_STATUS.ERROR && (
|
|
48
|
+
<>
|
|
49
|
+
<CloudOff size={18} strokeWidth={1} />
|
|
50
|
+
<span className="ml-1 font-inter text-xs uppercase">error</span>
|
|
51
|
+
</>
|
|
52
|
+
)}
|
|
48
53
|
{weaveConnectionStatus ===
|
|
49
|
-
|
|
54
|
+
WEAVE_STORE_CONNECTION_STATUS.DISCONNECTED && (
|
|
50
55
|
<>
|
|
51
56
|
<CloudOff size={18} strokeWidth={1} />
|
|
52
57
|
<span className="ml-1 font-inter text-xs uppercase">
|