create-qpq-app 0.1.5
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/README.md +33 -0
- package/lib/commonjs/bin/createQpqApp.d.ts +2 -0
- package/lib/commonjs/bin/createQpqApp.js +9 -0
- package/lib/commonjs/bin/createQpqApp.js.map +1 -0
- package/lib/commonjs/cli/runCreateQpqApp.d.ts +1 -0
- package/lib/commonjs/cli/runCreateQpqApp.js +75 -0
- package/lib/commonjs/cli/runCreateQpqApp.js.map +1 -0
- package/lib/commonjs/index.d.ts +3 -0
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lib/args.d.ts +2 -0
- package/lib/commonjs/lib/args.js +21 -0
- package/lib/commonjs/lib/args.js.map +1 -0
- package/lib/commonjs/lib/files.d.ts +5 -0
- package/lib/commonjs/lib/files.js +65 -0
- package/lib/commonjs/lib/files.js.map +1 -0
- package/lib/commonjs/lib/packageRoot.d.ts +2 -0
- package/lib/commonjs/lib/packageRoot.js +26 -0
- package/lib/commonjs/lib/packageRoot.js.map +1 -0
- package/lib/commonjs/lib/prompts.d.ts +1 -0
- package/lib/commonjs/lib/prompts.js +53 -0
- package/lib/commonjs/lib/prompts.js.map +1 -0
- package/lib/commonjs/lib/runCommand.d.ts +4 -0
- package/lib/commonjs/lib/runCommand.js +24 -0
- package/lib/commonjs/lib/runCommand.js.map +1 -0
- package/lib/commonjs/steps/001_preflight.d.ts +2 -0
- package/lib/commonjs/steps/001_preflight.js +36 -0
- package/lib/commonjs/steps/001_preflight.js.map +1 -0
- package/lib/commonjs/steps/002_copyTemplate.d.ts +2 -0
- package/lib/commonjs/steps/002_copyTemplate.js +29 -0
- package/lib/commonjs/steps/002_copyTemplate.js.map +1 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.d.ts +2 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.js +32 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.js.map +1 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.d.ts +2 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.js +26 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.js.map +1 -0
- package/lib/commonjs/steps/005_applyAppIdentity.d.ts +2 -0
- package/lib/commonjs/steps/005_applyAppIdentity.js +51 -0
- package/lib/commonjs/steps/005_applyAppIdentity.js.map +1 -0
- package/lib/commonjs/steps/006_applyDomain.d.ts +2 -0
- package/lib/commonjs/steps/006_applyDomain.js +31 -0
- package/lib/commonjs/steps/006_applyDomain.js.map +1 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.d.ts +2 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.js +37 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.js.map +1 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.d.ts +2 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.js +24 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.js.map +1 -0
- package/lib/commonjs/steps/009_restoreGitignore.d.ts +2 -0
- package/lib/commonjs/steps/009_restoreGitignore.js +31 -0
- package/lib/commonjs/steps/009_restoreGitignore.js.map +1 -0
- package/lib/commonjs/steps/010_gitInit.d.ts +2 -0
- package/lib/commonjs/steps/010_gitInit.js +30 -0
- package/lib/commonjs/steps/010_gitInit.js.map +1 -0
- package/lib/commonjs/steps/011_npmInstall.d.ts +2 -0
- package/lib/commonjs/steps/011_npmInstall.js +21 -0
- package/lib/commonjs/steps/011_npmInstall.js.map +1 -0
- package/lib/commonjs/steps/012_buildWorkspaces.d.ts +2 -0
- package/lib/commonjs/steps/012_buildWorkspaces.js +24 -0
- package/lib/commonjs/steps/012_buildWorkspaces.js.map +1 -0
- package/lib/commonjs/steps/013_printNextSteps.d.ts +2 -0
- package/lib/commonjs/steps/013_printNextSteps.js +33 -0
- package/lib/commonjs/steps/013_printNextSteps.js.map +1 -0
- package/lib/commonjs/steps/index.d.ts +16 -0
- package/lib/commonjs/steps/index.js +48 -0
- package/lib/commonjs/steps/index.js.map +1 -0
- package/lib/commonjs/types.d.ts +22 -0
- package/lib/commonjs/types.js +9 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/esm/bin/createQpqApp.d.ts +2 -0
- package/lib/esm/bin/createQpqApp.js +7 -0
- package/lib/esm/bin/createQpqApp.js.map +1 -0
- package/lib/esm/cli/runCreateQpqApp.d.ts +1 -0
- package/lib/esm/cli/runCreateQpqApp.js +57 -0
- package/lib/esm/cli/runCreateQpqApp.js.map +1 -0
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/lib/args.d.ts +2 -0
- package/lib/esm/lib/args.js +16 -0
- package/lib/esm/lib/args.js.map +1 -0
- package/lib/esm/lib/files.d.ts +5 -0
- package/lib/esm/lib/files.js +54 -0
- package/lib/esm/lib/files.js.map +1 -0
- package/lib/esm/lib/packageRoot.d.ts +2 -0
- package/lib/esm/lib/packageRoot.js +18 -0
- package/lib/esm/lib/packageRoot.js.map +1 -0
- package/lib/esm/lib/prompts.d.ts +1 -0
- package/lib/esm/lib/prompts.js +7 -0
- package/lib/esm/lib/prompts.js.map +1 -0
- package/lib/esm/lib/runCommand.d.ts +4 -0
- package/lib/esm/lib/runCommand.js +19 -0
- package/lib/esm/lib/runCommand.js.map +1 -0
- package/lib/esm/steps/001_preflight.d.ts +2 -0
- package/lib/esm/steps/001_preflight.js +21 -0
- package/lib/esm/steps/001_preflight.js.map +1 -0
- package/lib/esm/steps/002_copyTemplate.d.ts +2 -0
- package/lib/esm/steps/002_copyTemplate.js +14 -0
- package/lib/esm/steps/002_copyTemplate.js.map +1 -0
- package/lib/esm/steps/003_deleteDocusaurus.d.ts +2 -0
- package/lib/esm/steps/003_deleteDocusaurus.js +16 -0
- package/lib/esm/steps/003_deleteDocusaurus.js.map +1 -0
- package/lib/esm/steps/004_deleteQpqjsApp.d.ts +2 -0
- package/lib/esm/steps/004_deleteQpqjsApp.js +11 -0
- package/lib/esm/steps/004_deleteQpqjsApp.js.map +1 -0
- package/lib/esm/steps/005_applyAppIdentity.d.ts +2 -0
- package/lib/esm/steps/005_applyAppIdentity.js +36 -0
- package/lib/esm/steps/005_applyAppIdentity.js.map +1 -0
- package/lib/esm/steps/006_applyDomain.d.ts +2 -0
- package/lib/esm/steps/006_applyDomain.js +16 -0
- package/lib/esm/steps/006_applyDomain.js.map +1 -0
- package/lib/esm/steps/007_pinRegistryVersions.d.ts +2 -0
- package/lib/esm/steps/007_pinRegistryVersions.js +22 -0
- package/lib/esm/steps/007_pinRegistryVersions.js.map +1 -0
- package/lib/esm/steps/008_transpileToJavaScript.d.ts +2 -0
- package/lib/esm/steps/008_transpileToJavaScript.js +12 -0
- package/lib/esm/steps/008_transpileToJavaScript.js.map +1 -0
- package/lib/esm/steps/009_restoreGitignore.d.ts +2 -0
- package/lib/esm/steps/009_restoreGitignore.js +16 -0
- package/lib/esm/steps/009_restoreGitignore.js.map +1 -0
- package/lib/esm/steps/010_gitInit.d.ts +2 -0
- package/lib/esm/steps/010_gitInit.js +18 -0
- package/lib/esm/steps/010_gitInit.js.map +1 -0
- package/lib/esm/steps/011_npmInstall.d.ts +2 -0
- package/lib/esm/steps/011_npmInstall.js +9 -0
- package/lib/esm/steps/011_npmInstall.js.map +1 -0
- package/lib/esm/steps/012_buildWorkspaces.d.ts +2 -0
- package/lib/esm/steps/012_buildWorkspaces.js +12 -0
- package/lib/esm/steps/012_buildWorkspaces.js.map +1 -0
- package/lib/esm/steps/013_printNextSteps.d.ts +2 -0
- package/lib/esm/steps/013_printNextSteps.js +21 -0
- package/lib/esm/steps/013_printNextSteps.js.map +1 -0
- package/lib/esm/steps/index.d.ts +16 -0
- package/lib/esm/steps/index.js +33 -0
- package/lib/esm/steps/index.js.map +1 -0
- package/lib/esm/types.d.ts +22 -0
- package/lib/esm/types.js +6 -0
- package/lib/esm/types.js.map +1 -0
- package/package.json +57 -0
- package/template/.nvmrc +1 -0
- package/template/.prettierignore +4 -0
- package/template/.prettierrc +4 -0
- package/template/.vscode/extensions.json +3 -0
- package/template/.vscode/settings.json +14 -0
- package/template/README.md +150 -0
- package/template/apps/qpqjs/account.qpq.ts +39 -0
- package/template/apps/qpqjs/bootstrap.qpq.ts +36 -0
- package/template/apps/qpqjs/deploy.config.json +24 -0
- package/template/apps/qpqjs/packages/config/package.json +22 -0
- package/template/apps/qpqjs/packages/config/src/index.ts +2 -0
- package/template/apps/qpqjs/packages/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/packages/constants/package.json +22 -0
- package/template/apps/qpqjs/packages/constants/src/QpqjsServiceEnum.ts +11 -0
- package/template/apps/qpqjs/packages/constants/src/domain.ts +1 -0
- package/template/apps/qpqjs/packages/constants/src/index.ts +3 -0
- package/template/apps/qpqjs/packages/constants/src/userDirectory.ts +3 -0
- package/template/apps/qpqjs/packages/constants/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/constants/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/packages/service-utils/package.json +24 -0
- package/template/apps/qpqjs/packages/service-utils/src/defineQpqjsService.ts +148 -0
- package/template/apps/qpqjs/packages/service-utils/src/index.ts +1 -0
- package/template/apps/qpqjs/packages/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/config/package.json +22 -0
- package/template/apps/qpqjs/services/admin/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/models/package.json +22 -0
- package/template/apps/qpqjs/services/admin/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/service/package.json +9 -0
- package/template/apps/qpqjs/services/admin/service/src/infrastructure.ts +15 -0
- package/template/apps/qpqjs/services/admin/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/admin/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/admin/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/admin/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/admin/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/views/package.json +8 -0
- package/template/apps/qpqjs/services/admin/views/src/app/app.tsx +39 -0
- package/template/apps/qpqjs/services/admin/views/src/assets/.gitkeep +0 -0
- package/template/apps/qpqjs/services/admin/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/AdminGrid.tsx +80 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/styles.ts +41 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/types/AdminGridProps.ts +6 -0
- package/template/apps/qpqjs/services/admin/views/src/components/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/favicon.ico +0 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/logic/getBaseUrlFromAdminWebHost.ts +7 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/types/AdminNetworkRequestPayload.ts +10 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/useAdminNetworkRequest.ts +18 -0
- package/template/apps/qpqjs/services/admin/views/src/index.html +23 -0
- package/template/apps/qpqjs/services/admin/views/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/admin/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/admin/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/admin/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/config/package.json +22 -0
- package/template/apps/qpqjs/services/design/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/models/package.json +22 -0
- package/template/apps/qpqjs/services/design/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/service/package.json +9 -0
- package/template/apps/qpqjs/services/design/service/src/infrastructure.ts +15 -0
- package/template/apps/qpqjs/services/design/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/design/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/design/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/design/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/design/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/views/package.json +8 -0
- package/template/apps/qpqjs/services/design/views/src/app.tsx +7 -0
- package/template/apps/qpqjs/services/design/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/LandingPage.tsx +20 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/CodeWindow.tsx +77 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Features.tsx +83 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Footer.tsx +45 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Hero.tsx +60 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/InstallChip.tsx +27 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/NavBar.tsx +72 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Packages.tsx +63 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Pipeline.tsx +58 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/TronGrid.tsx +587 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/YieldLoop.tsx +361 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/landing.css +1170 -0
- package/template/apps/qpqjs/services/design/views/src/components/WelcomeScreen/WelcomeScreen.tsx +85 -0
- package/template/apps/qpqjs/services/design/views/src/index.html +12 -0
- package/template/apps/qpqjs/services/design/views/src/index.ts +1 -0
- package/template/apps/qpqjs/services/design/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/design/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/design/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/design/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/design/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/config/package.json +22 -0
- package/template/apps/qpqjs/services/shell/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/models/package.json +22 -0
- package/template/apps/qpqjs/services/shell/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/service/package.json +9 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/health/health.ts +21 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/health/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/service/src/infrastructure.ts +91 -0
- package/template/apps/qpqjs/services/shell/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/shell/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/shell/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/shell/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/shell/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/views/package.json +8 -0
- package/template/apps/qpqjs/services/shell/views/src/app.tsx +6 -0
- package/template/apps/qpqjs/services/shell/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/shell/views/src/index.html +25 -0
- package/template/apps/qpqjs/services/shell/views/src/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/shell/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/shell/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/shell/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/shell/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/tsconfig.federated.json +13 -0
- package/template/apps/todo/deploy.config.json +12 -0
- package/template/apps/todo/packages/config/package.json +22 -0
- package/template/apps/todo/packages/config/src/index.ts +2 -0
- package/template/apps/todo/packages/config/tsconfig.json +18 -0
- package/template/apps/todo/packages/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/packages/constants/package.json +22 -0
- package/template/apps/todo/packages/constants/src/TodoServiceEnum.ts +12 -0
- package/template/apps/todo/packages/constants/src/domain.ts +1 -0
- package/template/apps/todo/packages/constants/src/index.ts +3 -0
- package/template/apps/todo/packages/constants/src/userDirectory.ts +3 -0
- package/template/apps/todo/packages/constants/tsconfig.json +18 -0
- package/template/apps/todo/packages/constants/tsconfig.lib.json +19 -0
- package/template/apps/todo/packages/service-utils/package.json +24 -0
- package/template/apps/todo/packages/service-utils/src/defineTodoService.ts +128 -0
- package/template/apps/todo/packages/service-utils/src/index.ts +1 -0
- package/template/apps/todo/packages/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/packages/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/config/package.json +22 -0
- package/template/apps/todo/services/admin/config/src/index.ts +2 -0
- package/template/apps/todo/services/admin/config/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/models/package.json +22 -0
- package/template/apps/todo/services/admin/models/src/index.ts +2 -0
- package/template/apps/todo/services/admin/models/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/service/package.json +9 -0
- package/template/apps/todo/services/admin/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/admin/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/admin/service/tsconfig.json +8 -0
- package/template/apps/todo/services/admin/service-utils/package.json +22 -0
- package/template/apps/todo/services/admin/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/admin/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/shared-logic/package.json +22 -0
- package/template/apps/todo/services/admin/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/admin/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/views/package.json +8 -0
- package/template/apps/todo/services/admin/views/src/app/app.tsx +39 -0
- package/template/apps/todo/services/admin/views/src/assets/.gitkeep +0 -0
- package/template/apps/todo/services/admin/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/AdminGrid.tsx +80 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/styles.ts +41 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/types/AdminGridProps.ts +6 -0
- package/template/apps/todo/services/admin/views/src/components/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/favicon.ico +0 -0
- package/template/apps/todo/services/admin/views/src/hooks/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/logic/getBaseUrlFromAdminWebHost.ts +7 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/types/AdminNetworkRequestPayload.ts +10 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/useAdminNetworkRequest.ts +18 -0
- package/template/apps/todo/services/admin/views/src/index.html +23 -0
- package/template/apps/todo/services/admin/views/src/index.ts +2 -0
- package/template/apps/todo/services/admin/views/src/main.ts +1 -0
- package/template/apps/todo/services/admin/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/admin/views/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-logic/package.json +22 -0
- package/template/apps/todo/services/admin/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/admin/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/x-models/package.json +22 -0
- package/template/apps/todo/services/admin/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/admin/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/config/package.json +22 -0
- package/template/apps/todo/services/auth/config/src/index.ts +2 -0
- package/template/apps/todo/services/auth/config/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/models/package.json +22 -0
- package/template/apps/todo/services/auth/models/src/index.ts +2 -0
- package/template/apps/todo/services/auth/models/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/service/package.json +9 -0
- package/template/apps/todo/services/auth/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/auth/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/auth/service/tsconfig.json +8 -0
- package/template/apps/todo/services/auth/service-utils/package.json +22 -0
- package/template/apps/todo/services/auth/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/auth/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/shared-logic/package.json +22 -0
- package/template/apps/todo/services/auth/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/auth/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/x-logic/package.json +22 -0
- package/template/apps/todo/services/auth/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/auth/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/x-models/package.json +22 -0
- package/template/apps/todo/services/auth/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/auth/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/config/package.json +22 -0
- package/template/apps/todo/services/design/config/src/index.ts +2 -0
- package/template/apps/todo/services/design/config/tsconfig.json +18 -0
- package/template/apps/todo/services/design/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/models/package.json +22 -0
- package/template/apps/todo/services/design/models/src/index.ts +2 -0
- package/template/apps/todo/services/design/models/tsconfig.json +18 -0
- package/template/apps/todo/services/design/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/service/package.json +9 -0
- package/template/apps/todo/services/design/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/design/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/design/service/tsconfig.json +8 -0
- package/template/apps/todo/services/design/service-utils/package.json +22 -0
- package/template/apps/todo/services/design/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/design/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/design/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/shared-logic/package.json +22 -0
- package/template/apps/todo/services/design/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/design/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/design/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/views/package.json +8 -0
- package/template/apps/todo/services/design/views/src/app.tsx +7 -0
- package/template/apps/todo/services/design/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/design/views/src/components/WelcomeScreen/WelcomeScreen.tsx +85 -0
- package/template/apps/todo/services/design/views/src/index.html +12 -0
- package/template/apps/todo/services/design/views/src/index.ts +1 -0
- package/template/apps/todo/services/design/views/src/main.ts +1 -0
- package/template/apps/todo/services/design/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/design/views/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-logic/package.json +22 -0
- package/template/apps/todo/services/design/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/design/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/x-models/package.json +22 -0
- package/template/apps/todo/services/design/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/design/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/config/package.json +22 -0
- package/template/apps/todo/services/shell/config/src/index.ts +2 -0
- package/template/apps/todo/services/shell/config/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/models/package.json +22 -0
- package/template/apps/todo/services/shell/models/src/index.ts +2 -0
- package/template/apps/todo/services/shell/models/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/service/package.json +9 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/health/health.ts +21 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/health/index.ts +1 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/index.ts +1 -0
- package/template/apps/todo/services/shell/service/src/infrastructure.ts +75 -0
- package/template/apps/todo/services/shell/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/shell/service/tsconfig.json +8 -0
- package/template/apps/todo/services/shell/service-utils/package.json +22 -0
- package/template/apps/todo/services/shell/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/shell/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/shared-logic/package.json +22 -0
- package/template/apps/todo/services/shell/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/shell/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/views/package.json +8 -0
- package/template/apps/todo/services/shell/views/src/app.tsx +6 -0
- package/template/apps/todo/services/shell/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/shell/views/src/index.html +19 -0
- package/template/apps/todo/services/shell/views/src/index.ts +1 -0
- package/template/apps/todo/services/shell/views/src/main.ts +1 -0
- package/template/apps/todo/services/shell/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/shell/views/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-logic/package.json +22 -0
- package/template/apps/todo/services/shell/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/shell/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/x-models/package.json +22 -0
- package/template/apps/todo/services/shell/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/shell/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/config/package.json +22 -0
- package/template/apps/todo/services/todo/config/src/index.ts +2 -0
- package/template/apps/todo/services/todo/config/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/models/package.json +22 -0
- package/template/apps/todo/services/todo/models/src/index.ts +2 -0
- package/template/apps/todo/services/todo/models/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/service/package.json +9 -0
- package/template/apps/todo/services/todo/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/todo/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/todo/service/tsconfig.json +8 -0
- package/template/apps/todo/services/todo/service-utils/package.json +22 -0
- package/template/apps/todo/services/todo/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/todo/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/shared-logic/package.json +22 -0
- package/template/apps/todo/services/todo/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/todo/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/views/package.json +8 -0
- package/template/apps/todo/services/todo/views/src/app.tsx +7 -0
- package/template/apps/todo/services/todo/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/todo/views/src/components/TodoList/TodoList.tsx +132 -0
- package/template/apps/todo/services/todo/views/src/index.html +11 -0
- package/template/apps/todo/services/todo/views/src/index.ts +1 -0
- package/template/apps/todo/services/todo/views/src/main.ts +1 -0
- package/template/apps/todo/services/todo/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/todo/views/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-logic/package.json +22 -0
- package/template/apps/todo/services/todo/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/todo/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/x-models/package.json +22 -0
- package/template/apps/todo/services/todo/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/todo/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/tsconfig.federated.json +13 -0
- package/template/docusaurus/DOCUMENTATION_CHECKLIST.md +499 -0
- package/template/docusaurus/README.md +41 -0
- package/template/docusaurus/blog/2019-05-28-first-blog-post.md +12 -0
- package/template/docusaurus/blog/2019-05-29-long-blog-post.md +44 -0
- package/template/docusaurus/blog/2021-08-01-mdx-blog-post.mdx +24 -0
- package/template/docusaurus/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/template/docusaurus/blog/2021-08-26-welcome/index.md +29 -0
- package/template/docusaurus/blog/authors.yml +25 -0
- package/template/docusaurus/blog/tags.yml +19 -0
- package/template/docusaurus/docs/actions/core/_category_.json +8 -0
- package/template/docusaurus/docs/actions/core/ai/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt-stream.md +96 -0
- package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt.md +121 -0
- package/template/docusaurus/docs/actions/core/array/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/array/ask-array-some.md +54 -0
- package/template/docusaurus/docs/actions/core/array/ask-filter.md +54 -0
- package/template/docusaurus/docs/actions/core/array/ask-flat-map-parallel-batch.md +68 -0
- package/template/docusaurus/docs/actions/core/array/ask-flat-map.md +56 -0
- package/template/docusaurus/docs/actions/core/array/ask-map-parallel-batch.md +67 -0
- package/template/docusaurus/docs/actions/core/array/ask-map-parallel.md +57 -0
- package/template/docusaurus/docs/actions/core/array/ask-map.md +58 -0
- package/template/docusaurus/docs/actions/core/array/ask-reduce.md +57 -0
- package/template/docusaurus/docs/actions/core/binary-data/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/binary-data/ask-create-text-qpq-binary-data.md +86 -0
- package/template/docusaurus/docs/actions/core/claude-ai/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/claude-ai/ask-claude-ai-messages-api.md +70 -0
- package/template/docusaurus/docs/actions/core/config/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-application-info.md +42 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-global.md +52 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-parameter.md +52 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-parameters.md +49 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-secret.md +54 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-list-parameters.md +46 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-set-parameter.md +51 -0
- package/template/docusaurus/docs/actions/core/config/ask-get-application-version.md +39 -0
- package/template/docusaurus/docs/actions/core/context/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/context/ask-context-provide-value.md +78 -0
- package/template/docusaurus/docs/actions/core/context/ask-context-read.md +96 -0
- package/template/docusaurus/docs/actions/core/date/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/date/ask-date-now.md +50 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-current-epoch-ms.md +45 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-current-epoch.md +45 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-epoch-start-time.md +40 -0
- package/template/docusaurus/docs/actions/core/date/ask-seconds-elapsed-from.md +52 -0
- package/template/docusaurus/docs/actions/core/date/date-time-math.md +112 -0
- package/template/docusaurus/docs/actions/core/error/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/error/ask-throw-error.md +115 -0
- package/template/docusaurus/docs/actions/core/event/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/event/ask-process-event.md +77 -0
- package/template/docusaurus/docs/actions/core/event-bus/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/event-bus/ask-event-bus-send-messages.md +104 -0
- package/template/docusaurus/docs/actions/core/file/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-delete.md +69 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-exists.md +68 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-secure-url.md +75 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-upload-secure-url.md +91 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-is-cold-storage.md +72 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-list-directory.md +97 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-binary-contents.md +78 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-object-json.md +72 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-text-contents.md +69 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-stream-open.md +102 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-binary-contents.md +98 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-object-json.md +83 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-text-contents.md +69 -0
- package/template/docusaurus/docs/actions/core/graph-database/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/graph-database/ask-graph-database-execute-open-cypher-query.md +164 -0
- package/template/docusaurus/docs/actions/core/graph-database/ask-graph-database-internal-field-names.md +64 -0
- package/template/docusaurus/docs/actions/core/guid/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/guid/ask-new-guid.md +45 -0
- package/template/docusaurus/docs/actions/core/guid/ask-new-sortable-guid.md +49 -0
- package/template/docusaurus/docs/actions/core/inline-function/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/inline-function/ask-inline-function-execute.md +66 -0
- package/template/docusaurus/docs/actions/core/json/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/json/ask-decode-json.md +76 -0
- package/template/docusaurus/docs/actions/core/key-value-store/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-delete.md +57 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get-all.md +60 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get.md +73 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query-all.md +58 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query-single.md +62 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query.md +129 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan-all.md +56 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan.md +71 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update-partial-properties.md +75 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update.md +106 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert-with-retry.md +65 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert.md +71 -0
- package/template/docusaurus/docs/actions/core/log/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-create.md +64 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-disable-event-history.md +53 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-template-literal.md +55 -0
- package/template/docusaurus/docs/actions/core/math/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/math/ask-random-number.md +46 -0
- package/template/docusaurus/docs/actions/core/metric/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/metric/ask-metric-put.md +67 -0
- package/template/docusaurus/docs/actions/core/network/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/network/ask-network-request.md +95 -0
- package/template/docusaurus/docs/actions/core/platform/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/platform/ask-delay.md +48 -0
- package/template/docusaurus/docs/actions/core/queue/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/queue/ask-queue-send-messages.md +89 -0
- package/template/docusaurus/docs/actions/core/state/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/state/ask-reduce-state.md +160 -0
- package/template/docusaurus/docs/actions/core/state/ask-state-dispatch.md +87 -0
- package/template/docusaurus/docs/actions/core/state/ask-state-read.md +45 -0
- package/template/docusaurus/docs/actions/core/stream/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-close.md +56 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-map.md +73 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-process.md +57 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-read.md +140 -0
- package/template/docusaurus/docs/actions/core/system/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/system/ask-batch.md +55 -0
- package/template/docusaurus/docs/actions/core/system/ask-catch.md +85 -0
- package/template/docusaurus/docs/actions/core/system/ask-execute-if.md +51 -0
- package/template/docusaurus/docs/actions/core/system/ask-execute-story.md +56 -0
- package/template/docusaurus/docs/actions/core/system/ask-get-runtime-correlation.md +46 -0
- package/template/docusaurus/docs/actions/core/system/ask-override-actions.md +76 -0
- package/template/docusaurus/docs/actions/core/system/ask-parallel-deprecated.md +55 -0
- package/template/docusaurus/docs/actions/core/system/ask-retry.md +72 -0
- package/template/docusaurus/docs/actions/core/system/ask-run-parallel.md +62 -0
- package/template/docusaurus/docs/actions/core/user-directory/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-associate-software-token.md +73 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-authenticate-user.md +124 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-change-password.md +55 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-confirm-email-verification.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-confirm-forgot-password.md +58 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-create-user.md +72 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-decode-access-token.md +73 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-forgot-password.md +66 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-user-attributes-by-user-id.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-user-attributes.md +78 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-users-by-attribute.md +59 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-users.md +71 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-read-access-token.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-refresh-token.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-request-email-verification.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-respond-to-auth-challenge.md +124 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-access-token.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-password.md +55 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-user-attributes.md +60 -0
- package/template/docusaurus/docs/actions/features/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-append-server-event.md +65 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-create.md +112 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-append.md +97 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-list.md +116 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-write.md +50 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-generate-asset-upload-url.md +127 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-by-code.md +97 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-by-id.md +121 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-draft.md +109 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-list.md +53 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-provide-store.md +160 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-resolve-actor.md +107 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-soft-delete.md +69 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/active-chat-state.md +153 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-attachments-validate.md +63 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-history-load.md +95 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-list.md +91 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-requests.md +93 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-context-read.md +84 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-load-chats.md +37 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-new-chat.md +43 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-process-send.md +70 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-select-chat.md +42 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-send-message.md +52 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-service-request.md +53 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/chat-list-state.md +179 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/streaming-and-status-state.md +168 -0
- package/template/docusaurus/docs/actions/features/validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/validation/ask-validate-model-or-throw-error.md +73 -0
- package/template/docusaurus/docs/actions/webserver/_category_.json +8 -0
- package/template/docusaurus/docs/actions/webserver/admin/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log-metadata-children.md +62 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log-metadata.md +67 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log.md +84 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-logs.md +96 -0
- package/template/docusaurus/docs/actions/webserver/api-key-validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/api-key-validation/ask-api-key-validation-validate.md +63 -0
- package/template/docusaurus/docs/actions/webserver/dns/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/dns/ask-dns-list.md +37 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-put-generic-data-resource.md +48 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-scan-generic-data-resource.md +49 -0
- package/template/docusaurus/docs/actions/webserver/open-api-spec/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/open-api-spec/ask-get-open-api-spec.md +43 -0
- package/template/docusaurus/docs/actions/webserver/route-auth-validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/route-auth-validation/ask-route-auth-validation-decode.md +65 -0
- package/template/docusaurus/docs/actions/webserver/service/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/service/ask-service-request.md +69 -0
- package/template/docusaurus/docs/actions/webserver/service-function/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/service-function/ask-service-function-execute.md +58 -0
- package/template/docusaurus/docs/actions/webserver/web-entry/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/web-entry/ask-web-entry-invalidate-cache.md +53 -0
- package/template/docusaurus/docs/actions/webserver/websocket/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/websocket/ask-websocket-send-message.md +71 -0
- package/template/docusaurus/docs/actions/xstate/_category_.json +1 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-create.md +60 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-get-state.md +65 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-get.md +57 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-send-event.md +69 -0
- package/template/docusaurus/docs/api/index.md +17 -0
- package/template/docusaurus/docs/architecture-overview.md +690 -0
- package/template/docusaurus/docs/config/config-aws/_category_.json +1 -0
- package/template/docusaurus/docs/config/config-aws/account-budget.md +117 -0
- package/template/docusaurus/docs/config/config-aws/account-cloud-trail.md +75 -0
- package/template/docusaurus/docs/config/config-aws/account-security-services.md +91 -0
- package/template/docusaurus/docs/config/config-aws/aws-alarm.md +142 -0
- package/template/docusaurus/docs/config/config-aws/aws-data-store-removal-policy.md +68 -0
- package/template/docusaurus/docs/config/config-aws/aws-dyanmo-override-for-kvs.md +70 -0
- package/template/docusaurus/docs/config/config-aws/aws-kms-key.md +100 -0
- package/template/docusaurus/docs/config/config-aws/aws-service-account-info.md +114 -0
- package/template/docusaurus/docs/config/config-aws/aws-service-dashboard.md +61 -0
- package/template/docusaurus/docs/config/config-aws/aws-virtual-network-settings.md +88 -0
- package/template/docusaurus/docs/config/config-aws/bootstrap-aws-organization.md +80 -0
- package/template/docusaurus/docs/config/config-aws/bootstrap-waf.md +106 -0
- package/template/docusaurus/docs/config/config-aws/domain-certificate.md +69 -0
- package/template/docusaurus/docs/config/config-aws/event-bus-quick-subscription.md +84 -0
- package/template/docusaurus/docs/config/config-aws/waf-protection.md +45 -0
- package/template/docusaurus/docs/config/core/_category_.json +8 -0
- package/template/docusaurus/docs/config/core/action-processors.md +65 -0
- package/template/docusaurus/docs/config/core/ai.md +80 -0
- package/template/docusaurus/docs/config/core/api-build-path.md +40 -0
- package/template/docusaurus/docs/config/core/application-module.md +58 -0
- package/template/docusaurus/docs/config/core/application-name.md +66 -0
- package/template/docusaurus/docs/config/core/application-version.md +58 -0
- package/template/docusaurus/docs/config/core/claude-ai.md +52 -0
- package/template/docusaurus/docs/config/core/config-value.md +38 -0
- package/template/docusaurus/docs/config/core/deploy-event.md +94 -0
- package/template/docusaurus/docs/config/core/environment-settings.md +67 -0
- package/template/docusaurus/docs/config/core/event-bus.md +88 -0
- package/template/docusaurus/docs/config/core/federated-module-store.md +61 -0
- package/template/docusaurus/docs/config/core/global.md +43 -0
- package/template/docusaurus/docs/config/core/graph-database.md +72 -0
- package/template/docusaurus/docs/config/core/inline-function.md +61 -0
- package/template/docusaurus/docs/config/core/javascript-runtime.md +79 -0
- package/template/docusaurus/docs/config/core/key-value-store.md +135 -0
- package/template/docusaurus/docs/config/core/module-name.md +46 -0
- package/template/docusaurus/docs/config/core/notify-error.md +97 -0
- package/template/docusaurus/docs/config/core/parameter.md +53 -0
- package/template/docusaurus/docs/config/core/promise-mode.md +39 -0
- package/template/docusaurus/docs/config/core/queue.md +112 -0
- package/template/docusaurus/docs/config/core/recurring-schedule.md +117 -0
- package/template/docusaurus/docs/config/core/secret.md +51 -0
- package/template/docusaurus/docs/config/core/service-settings.md +49 -0
- package/template/docusaurus/docs/config/core/storage-drive.md +142 -0
- package/template/docusaurus/docs/config/core/user-directory.md +189 -0
- package/template/docusaurus/docs/config/core/virtual-network.md +60 -0
- package/template/docusaurus/docs/config/features/_category_.json +1 -0
- package/template/docusaurus/docs/config/features/admin-session-event-doc.md +47 -0
- package/template/docusaurus/docs/config/features/admin-settings.md +106 -0
- package/template/docusaurus/docs/config/features/admin-user-directory.md +57 -0
- package/template/docusaurus/docs/config/features/event-doc-ai.md +104 -0
- package/template/docusaurus/docs/config/features/event-doc-routes.md +100 -0
- package/template/docusaurus/docs/config/features/event-doc-summary.md +59 -0
- package/template/docusaurus/docs/config/features/event-doc.md +75 -0
- package/template/docusaurus/docs/config/features/versioned-route.md +85 -0
- package/template/docusaurus/docs/config/neo4j/_category_.json +1 -0
- package/template/docusaurus/docs/config/neo4j/graph-database-neo4j.md +122 -0
- package/template/docusaurus/docs/config/webserver/_category_.json +8 -0
- package/template/docusaurus/docs/config/webserver/api-key.md +87 -0
- package/template/docusaurus/docs/config/webserver/api.md +75 -0
- package/template/docusaurus/docs/config/webserver/auth-system.md +110 -0
- package/template/docusaurus/docs/config/webserver/cache.md +94 -0
- package/template/docusaurus/docs/config/webserver/certificate.md +64 -0
- package/template/docusaurus/docs/config/webserver/default-route-options.md +77 -0
- package/template/docusaurus/docs/config/webserver/dns.md +57 -0
- package/template/docusaurus/docs/config/webserver/domain-proxy.md +109 -0
- package/template/docusaurus/docs/config/webserver/file-upload-settings.md +63 -0
- package/template/docusaurus/docs/config/webserver/migration.md +83 -0
- package/template/docusaurus/docs/config/webserver/open-api.md +36 -0
- package/template/docusaurus/docs/config/webserver/route.md +109 -0
- package/template/docusaurus/docs/config/webserver/seed.md +61 -0
- package/template/docusaurus/docs/config/webserver/seo.md +72 -0
- package/template/docusaurus/docs/config/webserver/service-function.md +69 -0
- package/template/docusaurus/docs/config/webserver/state-dispatch-over-websockets.md +42 -0
- package/template/docusaurus/docs/config/webserver/storage-drive-cors-settings.md +73 -0
- package/template/docusaurus/docs/config/webserver/subdomain-redirect.md +80 -0
- package/template/docusaurus/docs/config/webserver/web-entry.md +150 -0
- package/template/docusaurus/docs/config/webserver/web-socket-queue.md +88 -0
- package/template/docusaurus/docs/config/webserver/websocket.md +110 -0
- package/template/docusaurus/docs/config/xstate/_category_.json +1 -0
- package/template/docusaurus/docs/config/xstate/state-machine.md +201 -0
- package/template/docusaurus/docs/core-concepts.md +23 -0
- package/template/docusaurus/docs/getting-started.md +806 -0
- package/template/docusaurus/docs/index.md +211 -0
- package/template/docusaurus/docs/intro.md +47 -0
- package/template/docusaurus/docs/tutorial-basics/_category_.json +8 -0
- package/template/docusaurus/docs/tutorial-basics/congratulations.md +23 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-blog-post.md +34 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-document.md +57 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-page.md +43 -0
- package/template/docusaurus/docs/tutorial-basics/deploy-your-site.md +31 -0
- package/template/docusaurus/docs/tutorial-basics/markdown-features.mdx +152 -0
- package/template/docusaurus/docs/tutorial-extras/_category_.json +7 -0
- package/template/docusaurus/docs/tutorial-extras/img/docsVersionDropdown.png +0 -0
- package/template/docusaurus/docs/tutorial-extras/img/localeDropdown.png +0 -0
- package/template/docusaurus/docs/tutorial-extras/manage-docs-versions.md +55 -0
- package/template/docusaurus/docs/tutorial-extras/translate-your-site.md +88 -0
- package/template/docusaurus/docs/use-cases.md +455 -0
- package/template/docusaurus/docusaurus.config.ts +181 -0
- package/template/docusaurus/gitignore +20 -0
- package/template/docusaurus/package.json +49 -0
- package/template/docusaurus/sidebars.ts +27 -0
- package/template/docusaurus/src/components/HomepageFeatures/index.tsx +72 -0
- package/template/docusaurus/src/components/HomepageFeatures/styles.module.css +11 -0
- package/template/docusaurus/src/css/custom.css +423 -0
- package/template/docusaurus/src/pages/index.module.css +23 -0
- package/template/docusaurus/static/.nojekyll +0 -0
- package/template/docusaurus/static/img/docusaurus-social-card.jpg +0 -0
- package/template/docusaurus/static/img/docusaurus.png +0 -0
- package/template/docusaurus/static/img/favicon.ico +0 -0
- package/template/docusaurus/static/img/favicon.svg +4 -0
- package/template/docusaurus/static/img/logo.svg +1 -0
- package/template/docusaurus/static/img/qpq-logo.svg +4 -0
- package/template/docusaurus/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/template/docusaurus/static/img/undraw_docusaurus_react.svg +170 -0
- package/template/docusaurus/static/img/undraw_docusaurus_tree.svg +40 -0
- package/template/docusaurus/tsconfig.json +8 -0
- package/template/eslint.config.mjs +3 -0
- package/template/gitignore +116 -0
- package/template/package.json +126 -0
- package/template/tsconfig.base.json +23 -0
- package/template/tsconfig.json +16 -0
- package/template/types/assets.d.ts +3 -0
package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/TronGrid.tsx
ADDED
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Animated hero backdrop: a faint grid lattice with glowing "light cycle"
|
|
6
|
+
* trails that travel along the grid lines, turning at intersections.
|
|
7
|
+
*
|
|
8
|
+
* Two stacked canvases: a grid layer and a trail layer that is fully cleared
|
|
9
|
+
* and redrawn every frame from each snake's recorded polyline — alpha falls
|
|
10
|
+
* off with distance from the head, so tails end cleanly and nothing
|
|
11
|
+
* accumulates on screen.
|
|
12
|
+
*
|
|
13
|
+
* The grid is a gently rippling surface: two slow ambient swells plus small
|
|
14
|
+
* rings sown by the cursor displace everything drawn on it (lines, dots,
|
|
15
|
+
* cycles, sparks) through one shared field, giving the flat lattice a quiet
|
|
16
|
+
* 3D undulation. Under prefers-reduced-motion the grid renders flat and
|
|
17
|
+
* static exactly as it used to.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const CELL = 44;
|
|
21
|
+
|
|
22
|
+
enum Heading {
|
|
23
|
+
right = 0,
|
|
24
|
+
down = 1,
|
|
25
|
+
left = 2,
|
|
26
|
+
up = 3,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const DX = [1, 0, -1, 0];
|
|
30
|
+
const DY = [0, 1, 0, -1];
|
|
31
|
+
|
|
32
|
+
interface Tone {
|
|
33
|
+
rgb: string; // "r, g, b" for building rgba() stops
|
|
34
|
+
weight: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const TONES: Tone[] = [
|
|
38
|
+
{ rgb: '141, 246, 255', weight: 6 },
|
|
39
|
+
{ rgb: '169, 200, 255', weight: 3 },
|
|
40
|
+
{ rgb: '255, 208, 163', weight: 1 },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
interface Point {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface Snake {
|
|
49
|
+
heading: Heading;
|
|
50
|
+
speed: number;
|
|
51
|
+
distToNode: number;
|
|
52
|
+
tone: Tone;
|
|
53
|
+
lineWidth: number;
|
|
54
|
+
comet: boolean;
|
|
55
|
+
trailLength: number;
|
|
56
|
+
/** Polyline vertices, oldest first; the last element is the moving head. */
|
|
57
|
+
trail: Point[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface Spark {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
age: number;
|
|
64
|
+
tone: Tone;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const SPARK_LIFE = 0.45;
|
|
68
|
+
|
|
69
|
+
function pickTone(): Tone {
|
|
70
|
+
const total = TONES.reduce((sum, tone) => sum + tone.weight, 0);
|
|
71
|
+
let roll = Math.random() * total;
|
|
72
|
+
for (const tone of TONES) {
|
|
73
|
+
roll -= tone.weight;
|
|
74
|
+
if (roll <= 0) return tone;
|
|
75
|
+
}
|
|
76
|
+
return TONES[0];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function spawnSnake(width: number, height: number, comet: boolean): Snake {
|
|
80
|
+
const cols = Math.max(1, Math.floor(width / CELL));
|
|
81
|
+
const rows = Math.max(1, Math.floor(height / CELL));
|
|
82
|
+
const x = Math.round(Math.random() * cols) * CELL;
|
|
83
|
+
const y = Math.round(Math.random() * rows) * CELL;
|
|
84
|
+
const speed = comet ? 420 + Math.random() * 160 : 90 + Math.random() * 150;
|
|
85
|
+
return {
|
|
86
|
+
heading: Math.floor(Math.random() * 4) as Heading,
|
|
87
|
+
speed,
|
|
88
|
+
distToNode: CELL,
|
|
89
|
+
tone: comet ? TONES[0] : pickTone(),
|
|
90
|
+
lineWidth: comet ? 1.2 : 1.7,
|
|
91
|
+
comet,
|
|
92
|
+
trailLength: Math.min(420, Math.max(150, speed * 0.9)),
|
|
93
|
+
trail: [
|
|
94
|
+
{ x, y },
|
|
95
|
+
{ x, y },
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function turnLeftOrRight(heading: Heading): Heading {
|
|
101
|
+
return ((heading + (Math.random() < 0.5 ? 1 : 3)) % 4) as Heading;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Keep a snake pointed somewhere that stays on the board and off blocked ground. */
|
|
105
|
+
function steerInside(
|
|
106
|
+
snake: Snake,
|
|
107
|
+
head: Point,
|
|
108
|
+
width: number,
|
|
109
|
+
height: number,
|
|
110
|
+
blocked: (x: number, y: number) => boolean
|
|
111
|
+
): boolean {
|
|
112
|
+
for (let attempts = 0; attempts < 4; attempts += 1) {
|
|
113
|
+
const nextX = head.x + DX[snake.heading] * CELL;
|
|
114
|
+
const nextY = head.y + DY[snake.heading] * CELL;
|
|
115
|
+
const margin = CELL * 1.5;
|
|
116
|
+
if (
|
|
117
|
+
nextX >= -margin &&
|
|
118
|
+
nextX <= width + margin &&
|
|
119
|
+
nextY >= -margin &&
|
|
120
|
+
nextY <= height + margin &&
|
|
121
|
+
!blocked(nextX, nextY)
|
|
122
|
+
) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
snake.heading = turnLeftOrRight(snake.heading);
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Drop vertices beyond the trail length, sliding the tail vertex smoothly. */
|
|
131
|
+
function trimTrail(snake: Snake): void {
|
|
132
|
+
const { trail } = snake;
|
|
133
|
+
let remaining = snake.trailLength;
|
|
134
|
+
for (let i = trail.length - 1; i > 0; i -= 1) {
|
|
135
|
+
const a = trail[i];
|
|
136
|
+
const b = trail[i - 1];
|
|
137
|
+
const segment = Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
|
|
138
|
+
if (segment >= remaining) {
|
|
139
|
+
const t = remaining / segment;
|
|
140
|
+
b.x = a.x + (b.x - a.x) * t;
|
|
141
|
+
b.y = a.y + (b.y - a.y) * t;
|
|
142
|
+
trail.splice(0, i - 1);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
remaining -= segment;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface Displacement {
|
|
150
|
+
dx: number;
|
|
151
|
+
dy: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* When a `displace` sampler is given, grid lines are drawn as polylines bent
|
|
156
|
+
* by it — the subtle 3D ripple. Without one (reduced motion, initial paint)
|
|
157
|
+
* the grid renders crisp and flat exactly as before.
|
|
158
|
+
*/
|
|
159
|
+
function drawGrid(
|
|
160
|
+
ctx: CanvasRenderingContext2D,
|
|
161
|
+
width: number,
|
|
162
|
+
height: number,
|
|
163
|
+
displace?: (x: number, y: number, out: Displacement) => void
|
|
164
|
+
): void {
|
|
165
|
+
ctx.clearRect(0, 0, width, height);
|
|
166
|
+
|
|
167
|
+
const out: Displacement = { dx: 0, dy: 0 };
|
|
168
|
+
const step = CELL / 2;
|
|
169
|
+
|
|
170
|
+
for (let x = 0; x <= width + CELL; x += CELL) {
|
|
171
|
+
const major = Math.round(x / CELL) % 5 === 0;
|
|
172
|
+
ctx.strokeStyle = major
|
|
173
|
+
? 'rgba(125, 211, 252, 0.12)'
|
|
174
|
+
: 'rgba(125, 211, 252, 0.065)';
|
|
175
|
+
ctx.lineWidth = 1;
|
|
176
|
+
ctx.beginPath();
|
|
177
|
+
if (displace) {
|
|
178
|
+
for (let y = 0; y <= height + step; y += step) {
|
|
179
|
+
displace(x, y, out);
|
|
180
|
+
if (y === 0) ctx.moveTo(x + out.dx, y + out.dy);
|
|
181
|
+
else ctx.lineTo(x + out.dx, y + out.dy);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
ctx.moveTo(x + 0.5, 0);
|
|
185
|
+
ctx.lineTo(x + 0.5, height);
|
|
186
|
+
}
|
|
187
|
+
ctx.stroke();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
for (let y = 0; y <= height + CELL; y += CELL) {
|
|
191
|
+
const major = Math.round(y / CELL) % 5 === 0;
|
|
192
|
+
ctx.strokeStyle = major
|
|
193
|
+
? 'rgba(125, 211, 252, 0.12)'
|
|
194
|
+
: 'rgba(125, 211, 252, 0.065)';
|
|
195
|
+
ctx.lineWidth = 1;
|
|
196
|
+
ctx.beginPath();
|
|
197
|
+
if (displace) {
|
|
198
|
+
for (let x = 0; x <= width + step; x += step) {
|
|
199
|
+
displace(x, y, out);
|
|
200
|
+
if (x === 0) ctx.moveTo(x + out.dx, y + out.dy);
|
|
201
|
+
else ctx.lineTo(x + out.dx, y + out.dy);
|
|
202
|
+
}
|
|
203
|
+
} else {
|
|
204
|
+
ctx.moveTo(0, y + 0.5);
|
|
205
|
+
ctx.lineTo(width, y + 0.5);
|
|
206
|
+
}
|
|
207
|
+
ctx.stroke();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
ctx.fillStyle = 'rgba(148, 210, 255, 0.16)';
|
|
211
|
+
for (let x = 0; x <= width + CELL; x += CELL) {
|
|
212
|
+
for (let y = 0; y <= height + CELL; y += CELL) {
|
|
213
|
+
if (displace) {
|
|
214
|
+
displace(x, y, out);
|
|
215
|
+
ctx.fillRect(x + out.dx - 0.5, y + out.dy - 0.5, 1.5, 1.5);
|
|
216
|
+
} else {
|
|
217
|
+
ctx.fillRect(x - 0.5, y - 0.5, 1.5, 1.5);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
interface TronGridProps {
|
|
224
|
+
/** Elements the light cycles must route around instead of passing behind. */
|
|
225
|
+
avoidRefs?: RefObject<HTMLElement | null>[];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function TronGrid({ avoidRefs }: TronGridProps = {}) {
|
|
229
|
+
const gridRef = useRef<HTMLCanvasElement>(null);
|
|
230
|
+
const trailRef = useRef<HTMLCanvasElement>(null);
|
|
231
|
+
const wrapRef = useRef<HTMLDivElement>(null);
|
|
232
|
+
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
const gridCanvas = gridRef.current;
|
|
235
|
+
const trailCanvas = trailRef.current;
|
|
236
|
+
const wrap = wrapRef.current;
|
|
237
|
+
if (!gridCanvas || !trailCanvas || !wrap) return;
|
|
238
|
+
|
|
239
|
+
const gridCtx = gridCanvas.getContext('2d');
|
|
240
|
+
const trailCtx = trailCanvas.getContext('2d');
|
|
241
|
+
if (!gridCtx || !trailCtx) return;
|
|
242
|
+
|
|
243
|
+
const reducedMotion = window.matchMedia(
|
|
244
|
+
'(prefers-reduced-motion: reduce)'
|
|
245
|
+
).matches;
|
|
246
|
+
|
|
247
|
+
let width = 0;
|
|
248
|
+
let height = 0;
|
|
249
|
+
let snakes: Snake[] = [];
|
|
250
|
+
let sparks: Spark[] = [];
|
|
251
|
+
let rafId = 0;
|
|
252
|
+
let lastTime = 0;
|
|
253
|
+
let inView = true;
|
|
254
|
+
let avoids: { x0: number; y0: number; x1: number; y1: number }[] = [];
|
|
255
|
+
|
|
256
|
+
// ------------------------------------------------------------- ripple
|
|
257
|
+
// The grid behaves like a taut surface: two broad, slow ambient swells
|
|
258
|
+
// plus small expanding rings that the cursor sows. Everything drawn on
|
|
259
|
+
// the grid (lines, dots, light cycles, sparks) samples the same field,
|
|
260
|
+
// so the whole scene undulates together.
|
|
261
|
+
interface Ripple {
|
|
262
|
+
x: number;
|
|
263
|
+
y: number;
|
|
264
|
+
born: number; // seconds, same clock as tSec
|
|
265
|
+
}
|
|
266
|
+
let ripples: Ripple[] = [];
|
|
267
|
+
let tSec = 0;
|
|
268
|
+
let docLeft = 0;
|
|
269
|
+
let docTop = 0;
|
|
270
|
+
let lastSowAt = 0;
|
|
271
|
+
let lastSowX = 0;
|
|
272
|
+
let lastSowY = 0;
|
|
273
|
+
|
|
274
|
+
const heightAt = (x: number, y: number, t: number): number => {
|
|
275
|
+
let h =
|
|
276
|
+
2.6 * Math.sin(x * 0.008 + y * 0.011 + t * 0.7) +
|
|
277
|
+
1.8 * Math.sin(x * 0.013 - y * 0.007 - t * 0.52);
|
|
278
|
+
for (const ripple of ripples) {
|
|
279
|
+
const age = t - ripple.born;
|
|
280
|
+
const dist = Math.hypot(x - ripple.x, y - ripple.y);
|
|
281
|
+
const ring = dist - age * 230;
|
|
282
|
+
h +=
|
|
283
|
+
5 *
|
|
284
|
+
Math.exp(-(ring * ring) / 9800) *
|
|
285
|
+
Math.exp(-age * 1.4) *
|
|
286
|
+
Math.min(age * 4, 1);
|
|
287
|
+
}
|
|
288
|
+
return h;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const displaceAt = (x: number, y: number, out: Displacement): void => {
|
|
292
|
+
out.dy = heightAt(x, y, tSec);
|
|
293
|
+
// a decorrelated sample of the same field for the lateral component,
|
|
294
|
+
// so vertical lines bend too instead of sliding along themselves
|
|
295
|
+
out.dx = 0.6 * heightAt(x + 157, y + 211, tSec * 1.13 + 5);
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
const onPointerMove = (event: PointerEvent) => {
|
|
299
|
+
if (!rafId) return;
|
|
300
|
+
if (event.pointerType && event.pointerType !== 'mouse') return;
|
|
301
|
+
const x = event.clientX - docLeft;
|
|
302
|
+
const y = event.clientY - (docTop - window.scrollY);
|
|
303
|
+
if (x < -CELL || x > width + CELL || y < -CELL || y > height + CELL)
|
|
304
|
+
return;
|
|
305
|
+
const now = performance.now();
|
|
306
|
+
if (now - lastSowAt < 150 || Math.hypot(x - lastSowX, y - lastSowY) < 32)
|
|
307
|
+
return;
|
|
308
|
+
ripples.push({ x, y, born: now / 1000 });
|
|
309
|
+
if (ripples.length > 6) ripples.shift();
|
|
310
|
+
lastSowAt = now;
|
|
311
|
+
lastSowX = x;
|
|
312
|
+
lastSowY = y;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const blockedAt = (x: number, y: number) => {
|
|
316
|
+
for (const avoid of avoids) {
|
|
317
|
+
if (x > avoid.x0 && x < avoid.x1 && y > avoid.y0 && y < avoid.y1)
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
return false;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const spawnClear = (comet: boolean): Snake => {
|
|
324
|
+
for (let tries = 0; tries < 24; tries += 1) {
|
|
325
|
+
const snake = spawnSnake(width, height, comet);
|
|
326
|
+
if (!blockedAt(snake.trail[0].x, snake.trail[0].y)) return snake;
|
|
327
|
+
}
|
|
328
|
+
return spawnSnake(width, height, comet);
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const resize = () => {
|
|
332
|
+
const rect = wrap.getBoundingClientRect();
|
|
333
|
+
width = rect.width;
|
|
334
|
+
height = rect.height;
|
|
335
|
+
docLeft = rect.left;
|
|
336
|
+
docTop = rect.top + window.scrollY;
|
|
337
|
+
|
|
338
|
+
avoids = [];
|
|
339
|
+
const pad = CELL * 0.5;
|
|
340
|
+
for (const ref of avoidRefs ?? []) {
|
|
341
|
+
const avoidEl = ref.current;
|
|
342
|
+
if (!avoidEl) continue;
|
|
343
|
+
const r = avoidEl.getBoundingClientRect();
|
|
344
|
+
avoids.push({
|
|
345
|
+
x0: r.left - rect.left - pad,
|
|
346
|
+
y0: r.top - rect.top - pad,
|
|
347
|
+
x1: r.right - rect.left + pad,
|
|
348
|
+
y1: r.bottom - rect.top + pad,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
352
|
+
|
|
353
|
+
for (const canvas of [gridCanvas, trailCanvas]) {
|
|
354
|
+
canvas.width = Math.round(width * dpr);
|
|
355
|
+
canvas.height = Math.round(height * dpr);
|
|
356
|
+
canvas.style.width = `${width}px`;
|
|
357
|
+
canvas.style.height = `${height}px`;
|
|
358
|
+
}
|
|
359
|
+
gridCtx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
360
|
+
trailCtx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
361
|
+
|
|
362
|
+
drawGrid(gridCtx, width, height);
|
|
363
|
+
|
|
364
|
+
const target = Math.min(
|
|
365
|
+
13,
|
|
366
|
+
Math.max(6, Math.round((width * height) / 130000))
|
|
367
|
+
);
|
|
368
|
+
snakes = Array.from({ length: target }, (_, index) =>
|
|
369
|
+
spawnClear(index < 2)
|
|
370
|
+
);
|
|
371
|
+
sparks = [];
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const stepSnake = (snake: Snake, dt: number) => {
|
|
375
|
+
let remaining = snake.speed * dt;
|
|
376
|
+
while (remaining > 0) {
|
|
377
|
+
const head = snake.trail[snake.trail.length - 1];
|
|
378
|
+
const step = Math.min(remaining, snake.distToNode);
|
|
379
|
+
head.x += DX[snake.heading] * step;
|
|
380
|
+
head.y += DY[snake.heading] * step;
|
|
381
|
+
snake.distToNode -= step;
|
|
382
|
+
remaining -= step;
|
|
383
|
+
|
|
384
|
+
if (snake.distToNode <= 0.001) {
|
|
385
|
+
snake.distToNode = CELL;
|
|
386
|
+
const headingBefore = snake.heading;
|
|
387
|
+
const turnChance = snake.comet ? 0.2 : 0.42;
|
|
388
|
+
if (Math.random() < turnChance) {
|
|
389
|
+
snake.heading = turnLeftOrRight(snake.heading);
|
|
390
|
+
}
|
|
391
|
+
const clear = steerInside(snake, head, width, height, blockedAt);
|
|
392
|
+
// any heading change needs a corner vertex, or the next segment draws diagonally
|
|
393
|
+
if (snake.heading !== headingBefore) {
|
|
394
|
+
snake.trail.push({ x: head.x, y: head.y });
|
|
395
|
+
sparks.push({ x: head.x, y: head.y, age: 0, tone: snake.tone });
|
|
396
|
+
}
|
|
397
|
+
// boxed in (or caught inside a newly-measured avoid zone): derez and respawn
|
|
398
|
+
if (!clear || blockedAt(head.x, head.y)) {
|
|
399
|
+
Object.assign(snake, spawnClear(snake.comet));
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
if (!snake.comet && Math.random() < 0.012) {
|
|
403
|
+
Object.assign(snake, spawnClear(false));
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
trimTrail(snake);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// the cycles live in flat grid coordinates; only their RENDERED positions
|
|
412
|
+
// ride the rippling surface, so their routing logic is untouched
|
|
413
|
+
const dispA: Displacement = { dx: 0, dy: 0 };
|
|
414
|
+
const dispB: Displacement = { dx: 0, dy: 0 };
|
|
415
|
+
|
|
416
|
+
const drawSnake = (snake: Snake) => {
|
|
417
|
+
const { trail, tone } = snake;
|
|
418
|
+
const maxAlpha = snake.comet ? 0.95 : 0.8;
|
|
419
|
+
let cumulative = 0;
|
|
420
|
+
|
|
421
|
+
for (let i = trail.length - 1; i > 0; i -= 1) {
|
|
422
|
+
const near = trail[i];
|
|
423
|
+
const far = trail[i - 1];
|
|
424
|
+
const segment = Math.abs(near.x - far.x) + Math.abs(near.y - far.y);
|
|
425
|
+
if (segment < 0.01) continue;
|
|
426
|
+
|
|
427
|
+
displaceAt(near.x, near.y, dispA);
|
|
428
|
+
displaceAt(far.x, far.y, dispB);
|
|
429
|
+
const nearX = near.x + dispA.dx;
|
|
430
|
+
const nearY = near.y + dispA.dy;
|
|
431
|
+
const farX = far.x + dispB.dx;
|
|
432
|
+
const farY = far.y + dispB.dy;
|
|
433
|
+
|
|
434
|
+
const alphaNear =
|
|
435
|
+
maxAlpha * Math.max(0, 1 - cumulative / snake.trailLength);
|
|
436
|
+
const alphaFar =
|
|
437
|
+
maxAlpha *
|
|
438
|
+
Math.max(0, 1 - (cumulative + segment) / snake.trailLength);
|
|
439
|
+
const gradient = trailCtx.createLinearGradient(
|
|
440
|
+
nearX,
|
|
441
|
+
nearY,
|
|
442
|
+
farX,
|
|
443
|
+
farY
|
|
444
|
+
);
|
|
445
|
+
gradient.addColorStop(0, `rgba(${tone.rgb}, ${alphaNear})`);
|
|
446
|
+
gradient.addColorStop(1, `rgba(${tone.rgb}, ${alphaFar})`);
|
|
447
|
+
|
|
448
|
+
// halo pass then core pass — glow that fades with the trail
|
|
449
|
+
trailCtx.strokeStyle = gradient;
|
|
450
|
+
trailCtx.lineCap = 'round';
|
|
451
|
+
trailCtx.globalAlpha = 0.28;
|
|
452
|
+
trailCtx.lineWidth = snake.lineWidth + 4.5;
|
|
453
|
+
trailCtx.beginPath();
|
|
454
|
+
trailCtx.moveTo(nearX, nearY);
|
|
455
|
+
trailCtx.lineTo(farX, farY);
|
|
456
|
+
trailCtx.stroke();
|
|
457
|
+
|
|
458
|
+
trailCtx.globalAlpha = 1;
|
|
459
|
+
trailCtx.lineWidth = snake.lineWidth;
|
|
460
|
+
trailCtx.beginPath();
|
|
461
|
+
trailCtx.moveTo(nearX, nearY);
|
|
462
|
+
trailCtx.lineTo(farX, farY);
|
|
463
|
+
trailCtx.stroke();
|
|
464
|
+
|
|
465
|
+
cumulative += segment;
|
|
466
|
+
if (cumulative >= snake.trailLength) break;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const head = trail[trail.length - 1];
|
|
470
|
+
displaceAt(head.x, head.y, dispA);
|
|
471
|
+
trailCtx.fillStyle = '#eaffff';
|
|
472
|
+
trailCtx.shadowColor = `rgba(${tone.rgb}, 0.9)`;
|
|
473
|
+
trailCtx.shadowBlur = 12;
|
|
474
|
+
trailCtx.beginPath();
|
|
475
|
+
trailCtx.arc(
|
|
476
|
+
head.x + dispA.dx,
|
|
477
|
+
head.y + dispA.dy,
|
|
478
|
+
snake.comet ? 1.4 : 1.8,
|
|
479
|
+
0,
|
|
480
|
+
Math.PI * 2
|
|
481
|
+
);
|
|
482
|
+
trailCtx.fill();
|
|
483
|
+
trailCtx.shadowBlur = 0;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
const drawSparks = (dt: number) => {
|
|
487
|
+
sparks = sparks.filter((spark) => (spark.age += dt) < SPARK_LIFE);
|
|
488
|
+
for (const spark of sparks) {
|
|
489
|
+
const fade = 1 - spark.age / SPARK_LIFE;
|
|
490
|
+
displaceAt(spark.x, spark.y, dispA);
|
|
491
|
+
trailCtx.fillStyle = `rgba(${spark.tone.rgb}, ${0.85 * fade})`;
|
|
492
|
+
trailCtx.beginPath();
|
|
493
|
+
trailCtx.arc(
|
|
494
|
+
spark.x + dispA.dx,
|
|
495
|
+
spark.y + dispA.dy,
|
|
496
|
+
1.6 + spark.age * 6,
|
|
497
|
+
0,
|
|
498
|
+
Math.PI * 2
|
|
499
|
+
);
|
|
500
|
+
trailCtx.fill();
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
const frame = (time: number) => {
|
|
505
|
+
rafId = requestAnimationFrame(frame);
|
|
506
|
+
const dt = Math.min((time - lastTime) / 1000, 0.05);
|
|
507
|
+
lastTime = time;
|
|
508
|
+
if (dt <= 0) return;
|
|
509
|
+
|
|
510
|
+
tSec = time / 1000;
|
|
511
|
+
for (let i = ripples.length - 1; i >= 0; i -= 1) {
|
|
512
|
+
if (tSec - ripples[i].born > 2.4) ripples.splice(i, 1);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
drawGrid(gridCtx, width, height, displaceAt);
|
|
516
|
+
trailCtx.clearRect(0, 0, width, height);
|
|
517
|
+
|
|
518
|
+
for (const snake of snakes) {
|
|
519
|
+
stepSnake(snake, dt);
|
|
520
|
+
drawSnake(snake);
|
|
521
|
+
}
|
|
522
|
+
drawSparks(dt);
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
const start = () => {
|
|
526
|
+
if (rafId || reducedMotion || document.hidden || !inView) return;
|
|
527
|
+
lastTime = performance.now();
|
|
528
|
+
rafId = requestAnimationFrame(frame);
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
const stop = () => {
|
|
532
|
+
cancelAnimationFrame(rafId);
|
|
533
|
+
rafId = 0;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
const onVisibility = () => (document.hidden ? stop() : start());
|
|
537
|
+
|
|
538
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
539
|
+
resize();
|
|
540
|
+
});
|
|
541
|
+
resizeObserver.observe(wrap);
|
|
542
|
+
const avoidEls: HTMLElement[] = [];
|
|
543
|
+
for (const ref of avoidRefs ?? []) {
|
|
544
|
+
if (ref.current) avoidEls.push(ref.current);
|
|
545
|
+
}
|
|
546
|
+
for (const el of avoidEls) {
|
|
547
|
+
resizeObserver.observe(el);
|
|
548
|
+
// entrance animations translate these blocks; re-measure the avoid
|
|
549
|
+
// rects once they settle or they'd stay offset by the initial shift
|
|
550
|
+
el.addEventListener('animationend', resize);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const intersectionObserver = new IntersectionObserver(
|
|
554
|
+
([entry]) => {
|
|
555
|
+
inView = entry.isIntersecting;
|
|
556
|
+
if (inView) start();
|
|
557
|
+
else stop();
|
|
558
|
+
},
|
|
559
|
+
{ threshold: 0 }
|
|
560
|
+
);
|
|
561
|
+
intersectionObserver.observe(wrap);
|
|
562
|
+
|
|
563
|
+
document.addEventListener('visibilitychange', onVisibility);
|
|
564
|
+
if (!reducedMotion)
|
|
565
|
+
window.addEventListener('pointermove', onPointerMove, { passive: true });
|
|
566
|
+
|
|
567
|
+
resize();
|
|
568
|
+
start();
|
|
569
|
+
|
|
570
|
+
return () => {
|
|
571
|
+
stop();
|
|
572
|
+
resizeObserver.disconnect();
|
|
573
|
+
intersectionObserver.disconnect();
|
|
574
|
+
document.removeEventListener('visibilitychange', onVisibility);
|
|
575
|
+
window.removeEventListener('pointermove', onPointerMove);
|
|
576
|
+
for (const el of avoidEls) el.removeEventListener('animationend', resize);
|
|
577
|
+
};
|
|
578
|
+
}, []);
|
|
579
|
+
|
|
580
|
+
return (
|
|
581
|
+
<div ref={wrapRef} aria-hidden="true" className="tron-grid">
|
|
582
|
+
<canvas ref={gridRef} />
|
|
583
|
+
<canvas ref={trailRef} />
|
|
584
|
+
<div className="tron-grid__vignette" />
|
|
585
|
+
</div>
|
|
586
|
+
);
|
|
587
|
+
}
|