create-weave-frontend-app 0.23.1 → 0.24.1
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-Ci2zIGiV.js → create-app-CDTdFzrU.js} +6 -6
- package/dist/create-app-CDTdFzrU.js.map +1 -0
- package/dist/create-app.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
- package/template/+nextjs+azure-web-pubsub/app/globals.css +1 -1
- package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/color-token-tool.ts +34 -24
- package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/types.ts +3 -1
- package/template/+nextjs+azure-web-pubsub/components/nodes/color-token/color-token.ts +19 -18
- package/template/+nextjs+azure-web-pubsub/components/room-components/color-tokens-library/color-token.tsx +5 -5
- package/template/+nextjs+azure-web-pubsub/components/room-components/color-tokens-library/color-tokens-library.tsx +17 -17
- package/template/+nextjs+azure-web-pubsub/components/room-components/hooks/use-context-menu.tsx +381 -455
- package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/divider.tsx +10 -10
- package/template/+nextjs+azure-web-pubsub/components/room-components/overlay/tools-overlay.tsx +28 -10
- package/template/+nextjs+azure-web-pubsub/components/ui/reactbits/TextAnimations/ScrollVelocity/ScrollVelocity.tsx +9 -9
- package/template/+nextjs+azure-web-pubsub/components/ui/scroll-area.tsx +14 -14
- package/template/+nextjs+azure-web-pubsub/components/ui/tree-view.tsx +30 -30
- package/template/+nextjs+azure-web-pubsub/components/utils/users.ts +3 -3
- package/template/+nextjs+azure-web-pubsub/components.json +1 -1
- package/template/+nextjs+azure-web-pubsub/next.config.js +12 -0
- package/template/+nextjs+azure-web-pubsub/postcss.config.mjs +1 -1
- package/template/+nextjs+azure-web-pubsub/vitest.config.mts +5 -5
- package/template/+nextjs+websockets/app/globals.css +1 -1
- package/template/+nextjs+websockets/components/actions/color-token-tool/color-token-tool.ts +34 -24
- package/template/+nextjs+websockets/components/actions/color-token-tool/types.ts +3 -1
- package/template/+nextjs+websockets/components/nodes/color-token/color-token.ts +19 -18
- package/template/+nextjs+websockets/components/room-components/color-tokens-library/color-token.tsx +5 -5
- package/template/+nextjs+websockets/components/room-components/color-tokens-library/color-tokens-library.tsx +17 -17
- package/template/+nextjs+websockets/components/room-components/hooks/use-context-menu.tsx +381 -455
- package/template/+nextjs+websockets/components/room-components/overlay/divider.tsx +10 -10
- package/template/+nextjs+websockets/components/room-components/overlay/tools-overlay.tsx +28 -10
- package/template/+nextjs+websockets/components/ui/reactbits/TextAnimations/ScrollVelocity/ScrollVelocity.tsx +9 -9
- package/template/+nextjs+websockets/components/ui/scroll-area.tsx +14 -14
- package/template/+nextjs+websockets/components/ui/tree-view.tsx +30 -30
- package/template/+nextjs+websockets/components/utils/users.ts +3 -3
- package/template/+nextjs+websockets/components.json +1 -1
- package/template/+nextjs+websockets/next.config.js +12 -0
- package/template/+nextjs+websockets/postcss.config.mjs +1 -1
- package/template/+nextjs+websockets/vitest.config.mts +5 -5
- package/dist/create-app-Ci2zIGiV.js.map +0 -1
|
@@ -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.24.1",
|
|
80
|
+
"@inditextech/weave-sdk": "0.24.1",
|
|
81
|
+
"@inditextech/weave-store-websockets": "0.24.1",
|
|
82
|
+
"@inditextech/weave-store-azure-web-pubsub": "0.24.1",
|
|
83
|
+
"@inditextech/weave-react": "0.24.1"
|
|
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-CDTdFzrU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-app-CDTdFzrU.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.24.1\",\"@inditextech/weave-sdk\":\"0.24.1\",\"@inditextech/weave-store-websockets\":\"0.24.1\",\"@inditextech/weave-store-azure-web-pubsub\":\"0.24.1\",\"@inditextech/weave-react\":\"0.24.1\"}","{\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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,KAAI,QAAQ,aAAa,4BAA4B;EACnD,MAAM,iBAAe;GACnB,GAAG,KAAK,gBAAW,cAAc;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;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-CDTdFzrU.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-weave-frontend-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "Create a new frontend artifact for a site with Weave.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"build": "tsc --noEmit && tsdown",
|
|
26
26
|
"clean": "rimraf dist",
|
|
27
27
|
"dev": "tsdown --watch",
|
|
28
|
+
"format": "prettier --write ./src ./template",
|
|
28
29
|
"link": "npm link",
|
|
29
30
|
"lint:fix": "npm run lint -- --fix",
|
|
30
31
|
"lint": "eslint ./src",
|
package/template/+nextjs+azure-web-pubsub/components/actions/color-token-tool/color-token-tool.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from
|
|
2
|
-
import { Vector2d } from
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { Vector2d } from 'konva/lib/types';
|
|
3
3
|
import {
|
|
4
4
|
ColorTokenToolActionState,
|
|
5
5
|
ColorTokenToolActionTriggerParams,
|
|
6
|
-
} from
|
|
7
|
-
import { COLOR_TOKEN_TOOL_STATE } from
|
|
8
|
-
import { WeaveAction, WeaveNodesSelectionPlugin } from
|
|
9
|
-
import Konva from
|
|
10
|
-
import { ColorTokenNode } from
|
|
6
|
+
} from './types';
|
|
7
|
+
import { COLOR_TOKEN_TOOL_STATE } from './constants';
|
|
8
|
+
import { WeaveAction, WeaveNodesSelectionPlugin } from '@inditextech/weave-sdk';
|
|
9
|
+
import Konva from 'konva';
|
|
10
|
+
import { ColorTokenNode } from '@/components/nodes/color-token/color-token';
|
|
11
11
|
|
|
12
12
|
export class ColorTokenToolAction extends WeaveAction {
|
|
13
13
|
protected initialized: boolean = false;
|
|
@@ -29,12 +29,12 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getName(): string {
|
|
32
|
-
return
|
|
32
|
+
return 'colorTokenTool';
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
initProps() {
|
|
36
36
|
return {
|
|
37
|
-
colorToken:
|
|
37
|
+
colorToken: '#000000',
|
|
38
38
|
width: 300,
|
|
39
39
|
height: 300,
|
|
40
40
|
opacity: 1,
|
|
@@ -42,10 +42,13 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
onInit() {
|
|
45
|
-
this.instance.addEventListener(
|
|
45
|
+
this.instance.addEventListener('onStageDrop', (e) => {
|
|
46
46
|
if (window.colorTokenDragColor) {
|
|
47
|
-
this.instance.
|
|
47
|
+
this.instance.getStage().setPointersPositions(e);
|
|
48
|
+
const position = this.instance.getStage().getPointerPosition();
|
|
49
|
+
this.instance.triggerAction('colorTokenTool', {
|
|
48
50
|
color: window.colorTokenDragColor,
|
|
51
|
+
position,
|
|
49
52
|
});
|
|
50
53
|
window.colorTokenDragColor = undefined;
|
|
51
54
|
}
|
|
@@ -55,14 +58,14 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
55
58
|
private setupEvents() {
|
|
56
59
|
const stage = this.instance.getStage();
|
|
57
60
|
|
|
58
|
-
stage.container().addEventListener(
|
|
59
|
-
if (e.key ===
|
|
61
|
+
stage.container().addEventListener('keydown', (e) => {
|
|
62
|
+
if (e.key === 'Escape') {
|
|
60
63
|
this.cancelAction();
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
|
|
65
|
-
stage.on(
|
|
68
|
+
stage.on('click tap', (e) => {
|
|
66
69
|
e.evt.preventDefault();
|
|
67
70
|
|
|
68
71
|
if (this.state === COLOR_TOKEN_TOOL_STATE.IDLE) {
|
|
@@ -82,19 +85,26 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
82
85
|
this.state = state;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
private addColorToken() {
|
|
88
|
+
private addColorToken(position?: Vector2d) {
|
|
86
89
|
const stage = this.instance.getStage();
|
|
87
90
|
|
|
88
|
-
stage.container().style.cursor =
|
|
91
|
+
stage.container().style.cursor = 'crosshair';
|
|
92
|
+
stage.container().blur();
|
|
89
93
|
stage.container().focus();
|
|
90
94
|
|
|
95
|
+
if (position) {
|
|
96
|
+
this.handleAdding(position);
|
|
97
|
+
this.setState(COLOR_TOKEN_TOOL_STATE.IDLE);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
91
101
|
this.colorTokenId = null;
|
|
92
102
|
this.clickPoint = null;
|
|
93
103
|
this.setState(COLOR_TOKEN_TOOL_STATE.ADDING);
|
|
94
104
|
}
|
|
95
105
|
|
|
96
|
-
private handleAdding() {
|
|
97
|
-
const { mousePoint, container } = this.instance.getMousePointer();
|
|
106
|
+
private handleAdding(position?: Vector2d) {
|
|
107
|
+
const { mousePoint, container } = this.instance.getMousePointer(position);
|
|
98
108
|
|
|
99
109
|
this.clickPoint = mousePoint;
|
|
100
110
|
this.container = container;
|
|
@@ -102,7 +112,7 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
102
112
|
this.colorTokenId = uuidv4();
|
|
103
113
|
|
|
104
114
|
const nodeHandler =
|
|
105
|
-
this.instance.getNodeHandler<ColorTokenNode>(
|
|
115
|
+
this.instance.getNodeHandler<ColorTokenNode>('color-token');
|
|
106
116
|
|
|
107
117
|
const node = nodeHandler.create(this.colorTokenId, {
|
|
108
118
|
...this.props,
|
|
@@ -120,7 +130,7 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
120
130
|
params?: ColorTokenToolActionTriggerParams
|
|
121
131
|
) {
|
|
122
132
|
if (!this.instance) {
|
|
123
|
-
throw new Error(
|
|
133
|
+
throw new Error('Instance not defined');
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
if (!this.initialized) {
|
|
@@ -139,22 +149,22 @@ export class ColorTokenToolAction extends WeaveAction {
|
|
|
139
149
|
this.props.colorToken = params.color;
|
|
140
150
|
}
|
|
141
151
|
|
|
142
|
-
this.addColorToken();
|
|
152
|
+
this.addColorToken(params?.position ?? undefined);
|
|
143
153
|
}
|
|
144
154
|
|
|
145
155
|
cleanup() {
|
|
146
156
|
const stage = this.instance.getStage();
|
|
147
157
|
|
|
148
|
-
stage.container().style.cursor =
|
|
158
|
+
stage.container().style.cursor = 'default';
|
|
149
159
|
|
|
150
160
|
const selectionPlugin =
|
|
151
|
-
this.instance.getPlugin<WeaveNodesSelectionPlugin>(
|
|
161
|
+
this.instance.getPlugin<WeaveNodesSelectionPlugin>('nodesSelection');
|
|
152
162
|
if (selectionPlugin) {
|
|
153
163
|
const node = stage.findOne(`#${this.colorTokenId}`);
|
|
154
164
|
if (node) {
|
|
155
165
|
selectionPlugin.setSelectedNodes([node]);
|
|
156
166
|
}
|
|
157
|
-
this.instance.triggerAction(
|
|
167
|
+
this.instance.triggerAction('selectionTool');
|
|
158
168
|
}
|
|
159
169
|
|
|
160
170
|
this.colorTokenId = null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Vector2d } from 'konva/lib/types';
|
|
2
|
+
import { COLOR_TOKEN_TOOL_STATE } from './constants';
|
|
2
3
|
|
|
3
4
|
export type ColorTokenToolActionStateKeys = keyof typeof COLOR_TOKEN_TOOL_STATE;
|
|
4
5
|
export type ColorTokenToolActionState =
|
|
@@ -6,4 +7,5 @@ export type ColorTokenToolActionState =
|
|
|
6
7
|
|
|
7
8
|
export type ColorTokenToolActionTriggerParams = {
|
|
8
9
|
color?: string;
|
|
10
|
+
position?: Vector2d;
|
|
9
11
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { WeaveNode } from
|
|
1
|
+
import { WeaveNode } from '@inditextech/weave-sdk';
|
|
2
2
|
import {
|
|
3
3
|
WeaveElementAttributes,
|
|
4
4
|
WeaveElementInstance,
|
|
5
|
-
} from
|
|
6
|
-
import Konva from
|
|
7
|
-
import { Inter } from
|
|
5
|
+
} from '@inditextech/weave-types';
|
|
6
|
+
import Konva from 'konva';
|
|
7
|
+
import { Inter } from 'next/font/google';
|
|
8
8
|
|
|
9
|
-
export const COLOR_TOKEN_NODE_TYPE =
|
|
9
|
+
export const COLOR_TOKEN_NODE_TYPE = 'color-token';
|
|
10
10
|
|
|
11
11
|
const inter = Inter({
|
|
12
12
|
preload: true,
|
|
13
|
-
variable:
|
|
14
|
-
subsets: [
|
|
13
|
+
variable: '--inter',
|
|
14
|
+
subsets: ['latin'],
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export class ColorTokenNode extends WeaveNode {
|
|
@@ -20,7 +20,7 @@ export class ColorTokenNode extends WeaveNode {
|
|
|
20
20
|
onRender(props: WeaveElementAttributes) {
|
|
21
21
|
const { id } = props;
|
|
22
22
|
|
|
23
|
-
const colorTokenColor = props.colorToken ??
|
|
23
|
+
const colorTokenColor = props.colorToken ?? '#DEFFA0';
|
|
24
24
|
|
|
25
25
|
const colorTokenParams = {
|
|
26
26
|
...props,
|
|
@@ -31,21 +31,22 @@ export class ColorTokenNode extends WeaveNode {
|
|
|
31
31
|
...colorTokenParams,
|
|
32
32
|
width: colorTokenParams.width,
|
|
33
33
|
height: colorTokenParams.height,
|
|
34
|
-
name:
|
|
34
|
+
name: 'node',
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
this.setupDefaultNodeAugmentation(colorTokenNode);
|
|
38
|
+
|
|
37
39
|
const internalRect = new Konva.Rect({
|
|
38
40
|
groupId: id,
|
|
39
41
|
id: `${id}-colorToken`,
|
|
40
42
|
x: 0,
|
|
41
43
|
y: 0,
|
|
42
|
-
fill:
|
|
44
|
+
fill: '#FFFFFFFF',
|
|
43
45
|
width: colorTokenParams.width,
|
|
44
46
|
height: colorTokenParams.height,
|
|
45
|
-
|
|
46
|
-
stroke:
|
|
47
|
+
strokeScaleEnabled: true,
|
|
48
|
+
stroke: 'black',
|
|
47
49
|
strokeWidth: 2,
|
|
48
|
-
name: "node",
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
colorTokenNode.add(internalRect);
|
|
@@ -71,14 +72,14 @@ export class ColorTokenNode extends WeaveNode {
|
|
|
71
72
|
y: 260,
|
|
72
73
|
fontSize: 20,
|
|
73
74
|
fontFamily: inter.style.fontFamily,
|
|
74
|
-
fill:
|
|
75
|
+
fill: '#CCCCCCFF',
|
|
75
76
|
strokeEnabled: false,
|
|
76
|
-
stroke:
|
|
77
|
+
stroke: '#000000FF',
|
|
77
78
|
strokeWidth: 1,
|
|
78
79
|
text: `${colorTokenColor}`,
|
|
79
80
|
width: (colorTokenParams.width ?? 0) - 40,
|
|
80
81
|
height: 20,
|
|
81
|
-
align:
|
|
82
|
+
align: 'left',
|
|
82
83
|
listening: false,
|
|
83
84
|
draggable: false,
|
|
84
85
|
});
|
|
@@ -104,7 +105,7 @@ export class ColorTokenNode extends WeaveNode {
|
|
|
104
105
|
zIndex: nodeInstanceZIndex,
|
|
105
106
|
});
|
|
106
107
|
|
|
107
|
-
const colorTokenColor = colorToken ??
|
|
108
|
+
const colorTokenColor = colorToken ?? '#DEFFA0';
|
|
108
109
|
|
|
109
110
|
const colorTokenNode1 = colorTokenNode.findOne(`#${id}-colorToken-1`);
|
|
110
111
|
if (colorTokenNode1) {
|
|
@@ -114,7 +115,7 @@ export class ColorTokenNode extends WeaveNode {
|
|
|
114
115
|
}
|
|
115
116
|
const colorTokenCode = colorTokenNode.findOne(`#${id}-colorToken-code`);
|
|
116
117
|
if (colorTokenCode) {
|
|
117
|
-
colorTokenCode.setAttr(
|
|
118
|
+
colorTokenCode.setAttr('text', `${colorTokenColor}`);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import React from
|
|
4
|
-
import { colorIsLight } from
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { colorIsLight } from '@/lib/utils';
|
|
5
5
|
|
|
6
6
|
type ColorTokenProps = {
|
|
7
7
|
color: string;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const ColorToken = ({ color }: Readonly<ColorTokenProps>) => {
|
|
11
|
-
let forefrontColor =
|
|
11
|
+
let forefrontColor = '#ffffff';
|
|
12
12
|
if (colorIsLight(color)) {
|
|
13
|
-
forefrontColor =
|
|
13
|
+
forefrontColor = '#000000';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
return (
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import React from
|
|
4
|
-
import { useWeave } from
|
|
5
|
-
import { useCollaborationRoom } from
|
|
6
|
-
import { ColorToken } from
|
|
7
|
-
import { SIDEBAR_ELEMENTS } from
|
|
8
|
-
import { X } from
|
|
9
|
-
import { ScrollArea } from
|
|
10
|
-
import { SidebarSelector } from
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useWeave } from '@inditextech/weave-react';
|
|
5
|
+
import { useCollaborationRoom } from '@/store/store';
|
|
6
|
+
import { ColorToken } from './color-token';
|
|
7
|
+
import { SIDEBAR_ELEMENTS } from '@/lib/constants';
|
|
8
|
+
import { X } from 'lucide-react';
|
|
9
|
+
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
10
|
+
import { SidebarSelector } from '../sidebar-selector';
|
|
11
11
|
|
|
12
12
|
type ColorTokenElement = {
|
|
13
13
|
id: string;
|
|
@@ -26,14 +26,14 @@ export const ColorTokensLibrary = () => {
|
|
|
26
26
|
|
|
27
27
|
const commonColorTokens: ColorTokenElement[] = React.useMemo(() => {
|
|
28
28
|
return [
|
|
29
|
-
{ id:
|
|
30
|
-
{ id:
|
|
31
|
-
{ id:
|
|
32
|
-
{ id:
|
|
33
|
-
{ id:
|
|
34
|
-
{ id:
|
|
35
|
-
{ id:
|
|
36
|
-
{ id:
|
|
29
|
+
{ id: '1', color: '#28282D' },
|
|
30
|
+
{ id: '2', color: '#00656B' },
|
|
31
|
+
{ id: '3', color: '#D79D00' },
|
|
32
|
+
{ id: '4', color: '#3073B7' },
|
|
33
|
+
{ id: '5', color: '#953640' },
|
|
34
|
+
{ id: '6', color: '#C5AECF' },
|
|
35
|
+
{ id: '7', color: '#46295A' },
|
|
36
|
+
{ id: '8', color: '#79797C' },
|
|
37
37
|
];
|
|
38
38
|
}, []);
|
|
39
39
|
|