diff --git a/.eslintrc.json b/.eslintrc.json index ed7acb9..0f570b2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,18 +1,26 @@ { + "root": true, + "env": { "browser": true, "es2021": true }, "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], "parser": "@typescript-eslint/parser", - "ignorePatterns": ["dist"], + "ignorePatterns": ["**/dist/*"], "parserOptions": { - "project": "./tsconfig.eslint.json" + "project": ["./tsconfig.eslint.json", "./apps/*/tsconfig.eslint.json", "./packages/*/tsconfig.eslint.json"] }, "plugins": ["@typescript-eslint"], "rules": { "@typescript-eslint/switch-exhaustiveness-check": "error", "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/no-non-null-assertion": "off" + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "varsIgnorePattern": "^h$" + } + ] } } diff --git a/.gitignore b/.gitignore index c7637b6..a8242dc 100644 --- a/.gitignore +++ b/.gitignore @@ -178,4 +178,7 @@ dist # End of https://www.toptal.com/developers/gitignore/api/node,macos -discord-html-transcripts-*.tgz \ No newline at end of file +discord-html-transcripts-*.tgz +# moon +.moon/cache +.moon/docker diff --git a/.moon/toolchain.yml b/.moon/toolchain.yml new file mode 100644 index 0000000..8f21446 --- /dev/null +++ b/.moon/toolchain.yml @@ -0,0 +1,69 @@ +# https://moonrepo.dev/docs/config/toolchain +$schema: 'https://moonrepo.dev/schemas/toolchain.json' + +# Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path. +# extends: './shared/toolchain.yml' + +# Configures Node.js within the toolchain. moon manages its own version of Node.js +# instead of relying on a version found on the host machine. This ensures deterministic +# and reproducible builds across any machine. +node: + # The version to use. Must be a semantic version that includes major, minor, and patch. + # We suggest using the latest active LTS version: https://nodejs.org/en/about/releases + version: '18.16.0' + + # The package manager to use when managing dependencies. + # Accepts "npm" (default), "pnpm", or "yarn". + packageManager: 'pnpm' + + # The version of the package manager (above) to use. + pnpm: + version: '8.6.0' + + # Add `node.version` as a constraint in the root `package.json` `engines`. + addEnginesConstraint: true + + # Dedupe dependencies after the lockfile has changed. + dedupeOnLockfileChange: true + + # Version format to use when syncing dependencies within the project's `package.json`. + # dependencyVersionFormat: 'workspace' + + # Infer and automatically create moon tasks from `package.json` scripts, per project. + # BEWARE: Tasks and scripts are not 1:1 in functionality, so please refer to the documentation. + inferTasksFromScripts: true + + # Sync a project's `dependsOn` as dependencies within the project's `package.json`. + syncProjectWorkspaceDependencies: true + + # Sync `node.version` to a 3rd-party version manager's config file. + # Accepts "nodenv" (.node-version), "nvm" (.nvmrc), or none. + # syncVersionManagerConfig: 'nvm' + +# Configures how moon integrates with TypeScript. +typescript: + # When `syncProjectReferences` is enabled and a dependent project reference + # *does not* have a `tsconfig.json`, automatically create one. + createMissingConfig: false + + # Name of `tsconfig.json` file in each project root. + projectConfigFileName: 'tsconfig.json' + + # Name of `tsconfig.json` file in the workspace root. + rootConfigFileName: 'tsconfig.json' + + # Name of the config file in the workspace root that defines shared compiler + # options for all project reference based config files. + # rootOptionsConfigFileName: 'tsconfig.options.json' + + # Update a project's `tsconfig.json` to route the `outDir` compiler option + # to moon's `.moon/cache` directory. + routeOutDirToCache: false + + # Sync a project's `dependsOn` as project references within the + # project's `tsconfig.json` and the workspace root `tsconfig.json`. + syncProjectReferences: false + + # Sync a project's project references as import aliases to the `paths` + # compiler option in each applicable project. + syncProjectReferencesToPaths: false diff --git a/.moon/workspace.yml b/.moon/workspace.yml new file mode 100644 index 0000000..68570e3 --- /dev/null +++ b/.moon/workspace.yml @@ -0,0 +1,16 @@ +# https://moonrepo.dev/docs/config/workspace +$schema: 'https://moonrepo.dev/schemas/workspace.json' + +# Require a specific version of moon while running commands, otherwise fail. +# versionConstraint: '>=1.0.0' + +# Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path. +# extends: './shared/workspace.yml' + +# REQUIRED: A map of all projects found within the workspace, or a list or file system globs. +# When using a map, each entry requires a unique project ID as the map key, and a file system +# path to the project folder as the map value. File paths are relative from the workspace root, +# and cannot reference projects located outside the workspace boundary. +projects: + - 'apps/*' + - 'packages/*' diff --git a/.vscode/settings.json b/.vscode/settings.json index 4203cbd..df8b1fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,7 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": true, "source.organizeImports": false - } + }, + + "eslint.workingDirectories": ["./packages/*", "./apps/*"] } diff --git a/package.json b/package.json index 780e7a2..a2cdaaa 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,24 @@ { "name": "discord-html-transcripts", - "version": "3.1.5", - "description": "A nicely formatted html transcript generator for discord.js.", - "main": "dist/index.js", - "homepage": "https://github.com/ItzDerock/discord-html-transcripts", - "types": "./dist/index.d.ts", + "version": "1.0.0", + "description": "", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc -p tsconfig.json", - "prepack": "npm run build", - "test:typescript": "ts-node ./tests/generate.ts", - "lint": "prettier --write --cache . && eslint --cache --fix .", - "typecheck": "tsc -p tsconfig.eslint.json" + "test": "echo \"Error: no test specified\" && exit 1" }, + "keywords": [], + "author": "Derock ", + "license": "Apache-2.0", "repository": { "type": "git", - "url": "git+https://github.com/ItzDerock/discord-html-transcripts.git" + "url": "git+https://github.com/ItzDerock/discord-html-transcripts" }, - "keywords": [ - "discord.js", - "discord.js-transcripts", - "discord.js-html-transcripts", - "html-transcripts", - "discord-html-transcripts", - "discord-transcripts" - ], - "author": "Derock ", - "license": "GNU GPLv3", - "files": [ - "dist/**/*.js", - "dist/**/*.d.ts", - "dist/**/*.js.map" - ], "devDependencies": { - "@types/node": "^18.11.18", "@types/react": "^18.0.27", - "@types/react-dom": "^18.0.10", - "@typescript-eslint/eslint-plugin": "^5.49.0", - "@typescript-eslint/parser": "^5.49.0", - "discord.js": "^14.12.0", - "dotenv": "^16.0.3", - "eslint": "^8.32.0", - "husky": "^8.0.3", - "prettier": "^2.8.3", - "pretty-quick": "^3.1.3", - "ts-node": "^10.9.1", - "typescript": "^5.1.6" - }, - "dependencies": { - "@derockdev/discord-components-core": "^3.5.3", - "@derockdev/discord-components-react": "^3.5.3", - "discord-markdown-parser": "~1.1.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "simple-markdown": "^0.7.3", - "twemoji": "^14.0.2", - "undici": "^5.21.0" + "eslint": "^8.47.0", + "vitest": "^0.34.1" }, - "peerDependencies": { - "discord.js": "^14.0.0 || ^15.0.0" + "packageManager": "pnpm@8.6.0", + "engines": { + "node": "18.16.0" } } diff --git a/packages/discord-components-core/.eslintrc.json b/packages/discord-components-core/.eslintrc.json new file mode 100644 index 0000000..cb435fb --- /dev/null +++ b/packages/discord-components-core/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "../../.eslintrc.json", + "settings": { + "react": { + "pragma": "h" + } + } +} diff --git a/packages/discord-components-core/.npmignore b/packages/discord-components-core/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/packages/discord-components-core/CHANGELOG.md b/packages/discord-components-core/CHANGELOG.md new file mode 100644 index 0000000..6e8c047 --- /dev/null +++ b/packages/discord-components-core/CHANGELOG.md @@ -0,0 +1,474 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.6.0](https://github.com/skyra-project/discord-components/compare/v3.5.0...v3.6.0) (2023-01-23) + +### Bug Fixes + +- update @stencil/core dependency ([df07642](https://github.com/skyra-project/discord-components/commit/df07642b48debf1ecbc05cceaeafd5cfed081c9a)) + +### Features + +- add pin icon to system messages ([#317](https://github.com/skyra-project/discord-components/issues/317)) ([b34d635](https://github.com/skyra-project/discord-components/commit/b34d6357e02467ad4843a64591897e6b5ea99b22)) + +# [3.5.0](https://github.com/skyra-project/discord-components/compare/v3.4.1...v3.5.0) (2022-12-27) + +### Bug Fixes + +- change to bunny font cdn and update font families ([10184ab](https://github.com/skyra-project/discord-components/commit/10184abd60de16977f9e88c595b93a44ac3521a4)), closes [#308](https://github.com/skyra-project/discord-components/issues/308) +- **deps:** update all non-major dependencies ([#283](https://github.com/skyra-project/discord-components/issues/283)) ([8c225c4](https://github.com/skyra-project/discord-components/commit/8c225c4630b68d58f87d71250cc3aa984e623458)) +- **deps:** update all non-major dependencies ([#290](https://github.com/skyra-project/discord-components/issues/290)) ([185ef07](https://github.com/skyra-project/discord-components/commit/185ef075f614d00e3e5a0f6be375f28bd6496721)) +- **deps:** update all non-major dependencies ([#296](https://github.com/skyra-project/discord-components/issues/296)) ([58a4aa2](https://github.com/skyra-project/discord-components/commit/58a4aa2794d9241d85a7a071a3c46a74d0a3460f)) +- **deps:** update all non-major dependencies ([#302](https://github.com/skyra-project/discord-components/issues/302)) ([7642c51](https://github.com/skyra-project/discord-components/commit/7642c51868c557c0b8145cf26a040e726204a875)) +- **deps:** update all non-major dependencies ([#305](https://github.com/skyra-project/discord-components/issues/305)) ([68ae3f6](https://github.com/skyra-project/discord-components/commit/68ae3f63dc61e06f449805e4829e2eaa30e11541)) +- resolved typo in `ChannelForum` ([#289](https://github.com/skyra-project/discord-components/issues/289)) ([c30908d](https://github.com/skyra-project/discord-components/commit/c30908d5395561e0b77cfebaad7822c98ef8b0fe)) + +### Features + +- mention for slash commands ([#288](https://github.com/skyra-project/discord-components/issues/288)) ([294d0b5](https://github.com/skyra-project/discord-components/commit/294d0b5c926a96f0759bff5dfd703432cf6791d8)) + +## [3.4.1](https://github.com/skyra-project/discord-components/compare/v3.4.0...v3.4.1) (2022-08-06) + +### Bug Fixes + +- **core:** enable `experimentalImportInjection` to ensure compatibility with Vite/NextJS builds ([053c8eb](https://github.com/skyra-project/discord-components/commit/053c8eb52ecf9cb763afd39441f11fdf81e76e21)) +- **deps:** update all non-major dependencies ([#271](https://github.com/skyra-project/discord-components/issues/271)) ([7896b9c](https://github.com/skyra-project/discord-components/commit/7896b9cfa081cbfa746bf9714db6cac31dfdc9bd)) + +# [3.4.0](https://github.com/skyra-project/discord-components/compare/v3.3.1...v3.4.0) (2022-05-10) + +### Features + +- add forum mention icon ([#244](https://github.com/skyra-project/discord-components/issues/244)) ([eea0ee7](https://github.com/skyra-project/discord-components/commit/eea0ee70698637054f2685ea03179ad9a126f451)) +- add OP tag to profiles (+ author info style fixes) ([#245](https://github.com/skyra-project/discord-components/issues/245)) ([9206d4f](https://github.com/skyra-project/discord-components/commit/9206d4f5e7cca47a3f1c6df4e2854519ff3dada0)) +- add role icons ([#243](https://github.com/skyra-project/discord-components/issues/243)) ([b2a4dd0](https://github.com/skyra-project/discord-components/commit/b2a4dd077a49bfa8a032e13eeea9c871c5c3ebd4)) + +## [3.3.1](https://github.com/skyra-project/discord-components/compare/v3.3.0...v3.3.1) (2022-04-25) + +### Bug Fixes + +- **core:** emit `[@vite-ignore](https://github.com/vite-ignore)` comments on dynamic imports ([ba84b9e](https://github.com/skyra-project/discord-components/commit/ba84b9ec4e8fe81ec452aba4c89b7b481b00ccaa)) +- **deps:** update all non-major dependencies ([#240](https://github.com/skyra-project/discord-components/issues/240)) ([e0e22fe](https://github.com/skyra-project/discord-components/commit/e0e22fe72158f1e9f92d61a5b04c58b7bf546de5)) + +# [3.3.0](https://github.com/skyra-project/discord-components/compare/v3.2.0...v3.3.0) (2022-04-06) + +### Features + +- add `discord-time` component ([#229](https://github.com/skyra-project/discord-components/issues/229)) ([cdf0810](https://github.com/skyra-project/discord-components/commit/cdf08108e9a54e11c75e050ff176a42715aceb49)) +- add ephemeral messages and highlight fixes ([#230](https://github.com/skyra-project/discord-components/issues/230)) ([c5fc8f3](https://github.com/skyra-project/discord-components/commit/c5fc8f39bdecc54ad9daca1eb69115c9402e9da3)) + +# [3.2.0](https://github.com/skyra-project/discord-components/compare/v3.1.1...v3.2.0) (2022-04-04) + +### Bug Fixes + +- **deps:** update all non-major dependencies ([#217](https://github.com/skyra-project/discord-components/issues/217)) ([3c391b6](https://github.com/skyra-project/discord-components/commit/3c391b68a28084ba514d9e5a8c3666fb7d456166)) +- **deps:** update all non-major dependencies ([#225](https://github.com/skyra-project/discord-components/issues/225)) ([87349f3](https://github.com/skyra-project/discord-components/commit/87349f3355c89c9c055ced1be7750f0251085132)) + +### Features + +- added multiple style specific components ([80ed132](https://github.com/skyra-project/discord-components/commit/80ed1326ea075cbe142cc8bc400d2f54a5bfaf30)), closes [#220](https://github.com/skyra-project/discord-components/issues/220) + +## [3.1.1](https://github.com/skyra-project/discord-components/compare/v3.1.0...v3.1.1) (2022-03-10) + +### Bug Fixes + +- bump `@stencil/core` dependency ([ecca4d8](https://github.com/skyra-project/discord-components/commit/ecca4d812ae371b57415c09fae7b5c8fa842700c)) +- **deps:** update all non-major dependencies ([#200](https://github.com/skyra-project/discord-components/issues/200)) ([c95dd81](https://github.com/skyra-project/discord-components/commit/c95dd81b03c042e695dd21db3c62c7137a4426f1)) +- **deps:** update all non-major dependencies ([#209](https://github.com/skyra-project/discord-components/issues/209)) ([2c0dd8a](https://github.com/skyra-project/discord-components/commit/2c0dd8a550ef78d23cf969597a3f08d7fb5c65ba)) +- match rebranded syles ([#216](https://github.com/skyra-project/discord-components/issues/216)) ([7ea32a9](https://github.com/skyra-project/discord-components/commit/7ea32a965557953416ad5f66ddbefed4a641c0fe)) + +# [3.1.0](https://github.com/skyra-project/discord-components/compare/v3.0.1...v3.1.0) (2022-01-12) + +### Features + +- **discord-embed-description:** add styles for nested HTML tags ([#195](https://github.com/skyra-project/discord-components/issues/195)) ([6ee7b9f](https://github.com/skyra-project/discord-components/commit/6ee7b9ffea10cfb0ed82a5771b88017060f04711)) + +## [3.0.1](https://github.com/skyra-project/discord-components/compare/v3.0.0...v3.0.1) (2022-01-08) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [3.0.0](https://github.com/skyra-project/discord-components/compare/v2.13.0...v3.0.0) (2022-01-08) + +### Bug Fixes + +- fixed embed description and footer disappearing when dynamically editing title ([bdec29c](https://github.com/skyra-project/discord-components/commit/bdec29c1999969a2ea0cf1198d3eb1986a80d674)) + +### BREAKING CHANGES + +- `discord-embed` no longer takes the properties `footer-image` and `timestamp`, they are moved to the `discord-embed-footer` component. +- The embed description now has to go into its own component, `discord-embed-description` + +```diff + +- Custom emojis in the embed description: ++ Custom emojis in the embed description: + +``` + +- The embed footer now has to go into its own component, `discord-embed-footer` + +```diff +- ++ +{ /* other embed components */ } +- Open source libraries to aid in the creation of Discord bots ++ ++ Open source libraries to aid in the creation of Discord bots ++ + +``` + +# [2.13.0](https://github.com/skyra-project/discord-components/compare/v2.12.1...v2.13.0) (2021-12-22) + +### Bug Fixes + +- **deps:** update all non-major dependencies ([#184](https://github.com/skyra-project/discord-components/issues/184)) ([792e791](https://github.com/skyra-project/discord-components/commit/792e791bba008eacea279b7802da506e9fb64a68)) + +### Features + +- **discord-invite:** localization support for invite title and button ([#183](https://github.com/skyra-project/discord-components/issues/183)) ([8fd541b](https://github.com/skyra-project/discord-components/commit/8fd541b60b8157aae26748b5400b647753594578)) + +## [2.12.1](https://github.com/skyra-project/discord-components/compare/v2.12.0...v2.12.1) (2021-12-06) + +### Bug Fixes + +- **deps:** update all non-major dependencies ([#177](https://github.com/skyra-project/discord-components/issues/177)) ([36a4c5d](https://github.com/skyra-project/discord-components/commit/36a4c5d871b08418ff96bcf471035bdb19f73598)) +- **discord-embed:** hide embed description when not provided ([f3f3302](https://github.com/skyra-project/discord-components/commit/f3f33029ca62f4517de8dfc3051855b36d8485db)), closes [#180](https://github.com/skyra-project/discord-components/issues/180) + +# [2.12.0](https://github.com/skyra-project/discord-components/compare/v2.11.6...v2.12.0) (2021-11-13) + +### Features + +- Add `discord-custom-emoji` component & custom emojis in embed titles ([#168](https://github.com/skyra-project/discord-components/issues/168)) ([61a808e](https://github.com/skyra-project/discord-components/commit/61a808e46f16d3ce9c7ea888e208cd1fcbe30e75)), closes [#163](https://github.com/skyra-project/discord-components/issues/163) + +## [2.11.6](https://github.com/skyra-project/discord-components/compare/v2.11.5...v2.11.6) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.11.4](https://github.com/skyra-project/discord-components/compare/v2.11.3...v2.11.4) (2021-11-08) + +### Bug Fixes + +- **docs:** update nextjs codesandbox link ([4d6382f](https://github.com/skyra-project/discord-components/commit/4d6382fe3538f85cd60ea8aa28e570023b536c98)) + +## [2.11.3](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.3...v2.11.3) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.11.3-alpha.3](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.2...v2.11.3-alpha.3) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.11.3-alpha.2](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.1...v2.11.3-alpha.2) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.11.3-alpha.1](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.0...v2.11.3-alpha.1) (2021-11-08) + +### Bug Fixes + +- debump required nodejs engine to 14.0.0 ([310f9bc](https://github.com/skyra-project/discord-components/commit/310f9bc6cdcafe6fd0d7267ffff70539b981b4be)) + +## [2.11.3-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.11.2...v2.11.3-alpha.0) (2021-11-08) + +### Bug Fixes + +- **deps:** update all non-major dependencies ([#158](https://github.com/skyra-project/discord-components/issues/158)) ([069255e](https://github.com/skyra-project/discord-components/commit/069255edf3b42b7549cb8a5382fc8f8899a95ac2)) +- **deps:** update all non-major dependencies ([#166](https://github.com/skyra-project/discord-components/issues/166)) ([8d22036](https://github.com/skyra-project/discord-components/commit/8d22036549cca3f7eb2518ac14deda46902f5d55)) + +## [2.11.2](https://github.com/skyra-project/discord-components/compare/v2.11.1...v2.11.2) (2021-10-03) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.11.1](https://github.com/skyra-project/discord-components/compare/v2.11.0...v2.11.1) (2021-10-03) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [2.11.0](https://github.com/skyra-project/discord-components/compare/v2.10.1-alpha.0...v2.11.0) (2021-10-02) + +### Features + +- Thread Accessories ([#150](https://github.com/skyra-project/discord-components/issues/150)) ([232f05d](https://github.com/skyra-project/discord-components/commit/232f05d915fef41486150e2db43589e9fc11c742)) +- Use channel icons in mentions ([#151](https://github.com/skyra-project/discord-components/issues/151)) ([b3fe40d](https://github.com/skyra-project/discord-components/commit/b3fe40dfbfce68df531e38908d28efacb21cc61b)) + +## [2.10.1-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.10.0...v2.10.1-alpha.0) (2021-09-21) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [2.10.0](https://github.com/skyra-project/discord-components/compare/v2.9.1...v2.10.0) (2021-09-12) + +### Features + +- add `discord-tenor-video` component ([#127](https://github.com/skyra-project/discord-components/issues/127)) ([c90dde0](https://github.com/skyra-project/discord-components/commit/c90dde02c23b8c9d25c676249518c60daeaf5d58)) + +## [2.9.1](https://github.com/skyra-project/discord-components/compare/v2.9.1-alpha.0...v2.9.1) (2021-09-12) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.9.1-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.9.0...v2.9.1-alpha.0) (2021-09-10) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [2.9.0](https://github.com/skyra-project/discord-components/compare/v2.8.1...v2.9.0) (2021-09-05) + +### Features + +- **discord-mention:** add new thread type ([#117](https://github.com/skyra-project/discord-components/issues/117)) ([3719679](https://github.com/skyra-project/discord-components/commit/371967908b60421a67fd72ad3ad5ec4adab932a2)) + +## [2.8.1](https://github.com/skyra-project/discord-components/compare/v2.8.0...v2.8.1) (2021-08-18) + +### Bug Fixes + +- **discord-command:** remove prepending slash in names ([#111](https://github.com/skyra-project/discord-components/issues/111)) ([c86a17e](https://github.com/skyra-project/discord-components/commit/c86a17ea3494fb050914bddbb385e375fea60876)) + +# [2.8.0](https://github.com/skyra-project/discord-components/compare/v2.7.1...v2.8.0) (2021-08-18) + +### Bug Fixes + +- use proper URLs for discord avatars ([#108](https://github.com/skyra-project/discord-components/issues/108)) ([446cdf4](https://github.com/skyra-project/discord-components/commit/446cdf4863d7e027cd2f08c6b9600e07491cfae2)) + +### Features + +- add component buttons ([#110](https://github.com/skyra-project/discord-components/issues/110)) ([50f78c5](https://github.com/skyra-project/discord-components/commit/50f78c5643277164e791261f8a8af76a8d893015)) + +## [2.7.1](https://github.com/skyra-project/discord-components/compare/v2.7.0...v2.7.1) (2021-08-07) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [2.7.0](https://github.com/skyra-project/discord-components/compare/v2.6.0...v2.7.0) (2021-08-07) + +### Features + +- add system messages ([#105](https://github.com/skyra-project/discord-components/issues/105)) ([53440f4](https://github.com/skyra-project/discord-components/commit/53440f44cbe30d7458cc9e38f30c7636483b4a7a)) + +# [2.6.0](https://github.com/skyra-project/discord-components/compare/v2.5.0...v2.6.0) (2021-08-05) + +### Bug Fixes + +- specify string union type for DiscordMention#type prop ([3b8204e](https://github.com/skyra-project/discord-components/commit/3b8204e11bdbe41b17bd2963f6afa11d6e903511)) + +### Features + +- add replies (+ style changes) ([#103](https://github.com/skyra-project/discord-components/issues/103)) ([065e452](https://github.com/skyra-project/discord-components/commit/065e452f9d0386dfd1b426793aca4c7f07c9c0ae)) + +# [2.5.0](https://github.com/skyra-project/discord-components/compare/v2.4.0...v2.5.0) (2021-08-04) + +### Features + +- add locked type for mentions ([#102](https://github.com/skyra-project/discord-components/issues/102)) ([e70a5bb](https://github.com/skyra-project/discord-components/commit/e70a5bb242ed695352e5088f6434574dd3614678)) + +# [2.4.0](https://github.com/skyra-project/discord-components/compare/v2.3.0...v2.4.0) (2021-07-25) + +### Features + +- add option to make reactions non-interactive ([b5f61b0](https://github.com/skyra-project/discord-components/commit/b5f61b07ffbd5d4e547b0e8324117ad582fc6295)) + +# [2.3.0](https://github.com/skyra-project/discord-components/compare/v2.2.0...v2.3.0) (2021-07-25) + +### Features + +- add click event handler to reactions ([7686af8](https://github.com/skyra-project/discord-components/commit/7686af8653233b234315e3932e4e38c13448a6b9)) +- add reactions ([#96](https://github.com/skyra-project/discord-components/issues/96)) ([3bb19a6](https://github.com/skyra-project/discord-components/commit/3bb19a69912b9666f922c36eabe6fb959b4fc495)) +- add voice type to mentions ([#97](https://github.com/skyra-project/discord-components/issues/97)) ([9b9fcb2](https://github.com/skyra-project/discord-components/commit/9b9fcb298933405e287ded6b3df27a7f4a60c3ff)) + +# [2.2.0](https://github.com/skyra-project/discord-components/compare/v2.1.1...v2.2.0) (2021-07-22) + +### Features + +- add invite and attachments container components ([#94](https://github.com/skyra-project/discord-components/issues/94)) ([3b782a0](https://github.com/skyra-project/discord-components/commit/3b782a0147a46ce8779bd7387786a07fdc94f5ac)) + +## [2.1.1](https://github.com/skyra-project/discord-components/compare/v2.1.0...v2.1.1) (2021-07-10) + +### Bug Fixes + +- **readme:** update urls and add nextJS demo ([551f9e7](https://github.com/skyra-project/discord-components/commit/551f9e763a48b0854450054404476e6d641a77d3)) + +# [2.1.0](https://github.com/skyra-project/discord-components/compare/v2.0.9...v2.1.0) (2021-06-26) + +### Features + +- add support for server crosspost webhook messages ([a02ec25](https://github.com/skyra-project/discord-components/commit/a02ec254f6804ea76282d081a674c838a87ef396)), closes [#88](https://github.com/skyra-project/discord-components/issues/88) + +## [2.0.9](https://github.com/skyra-project/discord-components/compare/v2.0.8...v2.0.9) (2021-06-21) + +### Bug Fixes + +- **css:** update to discord rebrand colors ([fe03134](https://github.com/skyra-project/discord-components/commit/fe031344284f0e1674813dfcbc9e43a33b1b78fd)) + +## [2.0.8](https://github.com/skyra-project/discord-components/compare/v2.0.7...v2.0.8) (2021-06-21) + +### Bug Fixes + +- **docs:** add live demo for "No Framework" ([b58242f](https://github.com/skyra-project/discord-components/commit/b58242f39b7f3d316616c844ed922aa0c4834034)) +- **docs:** remove default font from ToC ([82a1281](https://github.com/skyra-project/discord-components/commit/82a1281e84c51287ad01282d399c1be530d8ab2d)) + +## [2.0.7](https://github.com/skyra-project/discord-components/compare/v2.0.7-alpha.0...v2.0.7) (2021-05-20) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.0.7-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.0.6...v2.0.7-alpha.0) (2021-05-19) + +### Bug Fixes + +- **core:** specify exports for loader ([b94604f](https://github.com/skyra-project/discord-components/commit/b94604f374ef2944786469401d1505888f6ccc05)) + +## [2.0.6](https://github.com/skyra-project/discord-components/compare/v2.0.5...v2.0.6) (2021-05-19) + +### Bug Fixes + +- specify sideEffects and fix `es2015` and `es2017` file paths ([b759b3c](https://github.com/skyra-project/discord-components/commit/b759b3c4ca9e505b49592d4152f1b5ada4876cc5)) + +## [2.0.5](https://github.com/skyra-project/discord-components/compare/v2.0.4...v2.0.5) (2021-05-15) + +### Bug Fixes + +- **core:** update mention colours to match Discord May 2021 redesign ([a7c7a84](https://github.com/skyra-project/discord-components/commit/a7c7a847082738aeb2405340e79a738ade3563db)) + +## [2.0.4](https://github.com/skyra-project/discord-components/compare/v2.0.3...v2.0.4) (2021-05-15) + +### Bug Fixes + +- change links from discord-message-components to discord-components ([5a8e1e1](https://github.com/skyra-project/discord-components/commit/5a8e1e1e0b3a34020a91f0dae9464141195d8fab)) + +## [2.0.3](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.3...v2.0.3) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.0.3-alpha.3](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.2...v2.0.3-alpha.3) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.0.3-alpha.2](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.1...v2.0.3-alpha.2) (2021-05-15) + +### Bug Fixes + +- **react:** include polyfills again ([43ca559](https://github.com/skyra-project/discord-components/commit/43ca5590416559b92a32fb6e9cd1a53c357322a2)) + +## [2.0.3-alpha.1](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.0...v2.0.3-alpha.1) (2021-05-15) + +### Bug Fixes + +- fixed Avatar options ([2b97ca8](https://github.com/skyra-project/discord-components/commit/2b97ca80c89e64ad00ffb7f5660fbeed91bacf24)) +- fixed package bundling ([11d2627](https://github.com/skyra-project/discord-components/commit/11d2627bad707a1997e286a02b3004035dfdb306)) +- styling of components ([#72](https://github.com/skyra-project/discord-components/issues/72)) ([b440c2f](https://github.com/skyra-project/discord-components/commit/b440c2fd0b3c1411c0e96e68b0c599b1b95dfecd)) + +### Features + +- use whitney font as default font ([d7c9267](https://github.com/skyra-project/discord-components/commit/d7c9267a7680df5a3b8c7dbab5e14f673ada162b)) + +## [2.0.3-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.0.2...v2.0.3-alpha.0) (2021-03-20) + +### Bug Fixes + +- **core:** export options on top level ([d128f13](https://github.com/skyra-project/discord-components/commit/d128f13b69a22f134ef89a5fbdd4ad9db94006d0)) +- **core:** use proper lifecycle for embed ([e17ddb9](https://github.com/skyra-project/discord-components/commit/e17ddb9f413b380cb668a7d6a8554c5df31e05ff)) +- change lifecycle hooks to `componentWillRender` so props are recomputed on re-renders ([e19f9c3](https://github.com/skyra-project/discord-components/commit/e19f9c3345ee6e943b5d19e383bb4268d1cbc516)) +- fixed readmes and such ([bdb8846](https://github.com/skyra-project/discord-components/commit/bdb8846db2ded36567ef624ddddedf95f59e549b)) + +## [2.0.2](https://github.com/skyra-project/discord-components/compare/v2.0.1...v2.0.2) (2020-10-26) + +**Note:** Version bump only for package @skyra/discord-components-core + +## [2.0.1](https://github.com/skyra-project/discord-components/compare/v2.0.0...v2.0.1) (2020-10-07) + +### Bug Fixes + +- **core:** fixed date parsing for discord-embed ([515d243](https://github.com/skyra-project/discord-components/commit/515d243aa53b921dae523fb599bea9da4e419c07)) + +# [2.0.0](https://github.com/skyra-project/discord-components/compare/v1.3.0...v2.0.0) (2020-09-05) + +### Features + +- bumped stencil-core to v2 ([59ef71e](https://github.com/skyra-project/discord-components/commit/59ef71e48ac786edb35b7c52523206104796a9f0)), closes [/github.com/ionic-team/stencil/blob/master/CHANGELOG.md#-200-2020-08-31](https://github.com//github.com/ionic-team/stencil/blob/master/CHANGELOG.md/issues/-200-2020-08-31) [#12](https://github.com/skyra-project/discord-components/issues/12) + +### BREAKING CHANGES + +- IE11, Edge 16-18, Safari 10 and ES5 builds and support for them is fully removed + now. Also some files are exported under different names in core. For a full list see + +# [1.3.0](https://github.com/skyra-project/discord-components/compare/v1.2.2...v1.3.0) (2020-07-26) + +### Features + +- rename master branch to main ([0bc3666](https://github.com/skyra-project/discord-components/commit/0bc36663a83ab55df4ebb96fc9c69d6809008934)) + +## [1.2.2](https://github.com/skyra-project/discord-components/compare/v1.2.1...v1.2.2) (2020-07-13) + +### Bug Fixes + +- **core:** fixed layout of messages ([5def145](https://github.com/skyra-project/discord-components/commit/5def1450c0baae16eedd17fdec5e63f93b16f0f3)) + +## [1.2.1](https://github.com/skyra-project/discord-components/compare/v1.2.0...v1.2.1) (2020-07-08) + +### Bug Fixes + +- **attachments:** remove width/height modifier size ([4aea4bd](https://github.com/skyra-project/discord-components/commit/4aea4bdbb8aca01fae90a3a1f8aa5caa50df3ae6)) + +# [1.2.0](https://github.com/skyra-project/discord-components/compare/v1.1.4...v1.2.0) (2020-07-07) + +### Bug Fixes + +- update highlighted mention styling ([98e4827](https://github.com/skyra-project/discord-components/commit/98e4827f9829b6d0b8d30a78337a40e3d44c9fb5)) +- **embed-field:** set title to white to match Discord revert ([2e6007f](https://github.com/skyra-project/discord-components/commit/2e6007fb724edf389a63a534936d1ed528d1fd6c)) + +### Features + +- **core:** add discord-attachment component ([adef9b1](https://github.com/skyra-project/discord-components/commit/adef9b121c0ba7061374cbe389560706aa07c76a)) + +## [1.1.4](https://github.com/skyra-project/discord-components/compare/v1.1.3...v1.1.4) (2020-07-06) + +### Bug Fixes + +- **core:** fixed that lib didn't load when not defining window.\$discordMessage ([64293a6](https://github.com/skyra-project/discord-components/commit/64293a6f63ccf3c78f3c8086a0d13d8335d784e1)) + +## [1.1.3](https://github.com/skyra-project/discord-components/compare/v1.1.2...v1.1.3) (2020-07-06) + +### Bug Fixes + +- fixed the unpkg/jsdelivr builds ([d863049](https://github.com/skyra-project/discord-components/commit/d86304962a384f5e7a792fb67db826a389ba6aa5)) + +## [1.1.2](https://github.com/skyra-project/discord-components/compare/v1.1.1...v1.1.2) (2020-06-27) + +### Bug Fixes + +- bump package, regenerate react output ([07af3cc](https://github.com/skyra-project/discord-components/commit/07af3cc4e3ab3df728c4ed91341af2e7a5db3239)) + +## [1.1.1](https://github.com/skyra-project/discord-components/compare/v1.1.0...v1.1.1) (2020-06-06) + +### Bug Fixes + +- bump packages, fixing some stenciljs bugs ([2ac34a9](https://github.com/skyra-project/discord-components/commit/2ac34a9abca911e1abffc9671cb75cb24357335a)) + +# [1.1.0](https://github.com/skyra-project/discord-components/compare/v1.0.1...v1.1.0) (2020-05-19) + +### Bug Fixes + +- **core:** fixed parsing of global profile ([8b31278](https://github.com/skyra-project/discord-components/commit/8b3127857e4bdd0a835e27bd1412f9cbb619b31f)) + +### Features + +- **core:** allow 3-aside inline embed fields ([ec05f33](https://github.com/skyra-project/discord-components/commit/ec05f3372b8c7b590bf0c2d3526f53b3bd2aec98)), closes [#3](https://github.com/skyra-project/discord-components/issues/3) +- **embed:** embedding videos ([1678248](https://github.com/skyra-project/discord-components/commit/1678248ffe7413bb6e66437f03fed0d15b135e4e)), closes [#1](https://github.com/skyra-project/discord-components/issues/1) +- **embed:** provider option ([bf23e66](https://github.com/skyra-project/discord-components/commit/bf23e666555035b80625bccd00f49dfd622f80f9)), closes [#2](https://github.com/skyra-project/discord-components/issues/2) + +## [1.0.1](https://github.com/skyra-project/discord-components/compare/v1.0.0...v1.0.1) (2020-05-10) + +### Bug Fixes + +- **mention:** fixed discord mentions rendering type ([d94a092](https://github.com/skyra-project/discord-components/commit/d94a092f2e9b4c2cd6b4362e14105f7dfb54b6d9)) +- **message:** add hover background to match Discord ([d2c8f32](https://github.com/skyra-project/discord-components/commit/d2c8f32d5f73eb9d65ac091427628d6c705af6b2)) + +# [1.0.0](https://github.com/skyra-project/discord-components/compare/v1.0.0-alpha.1...v1.0.0) (2020-05-10) + +**Note:** Version bump only for package @skyra/discord-components-core + +# [1.0.0-alpha.1](https://github.com/skyra-project/discord-components/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2020-05-10) + +**Note:** Version bump only for package @skyra/discord-components-core + +# 1.0.0-alpha.0 (2020-05-10) + +### Features + +- create packages ([1ad5856](https://github.com/skyra-project/discord-components/commit/1ad58560916d3988e8dffc58ad97a52828ff5d35)) diff --git a/packages/discord-components-core/README.md b/packages/discord-components-core/README.md new file mode 100644 index 0000000..95899bb --- /dev/null +++ b/packages/discord-components-core/README.md @@ -0,0 +1,430 @@ +# `@derockdev/discord-components-core` +A fork of [@skyra/discord-components-core](https://github.com/skyra-project/discord-components) designed for use in [discord-html-transcripts](https://github.com/itzderock/discord-html-transcripts) + +## Changes +- Adds `` +- Adds `` +- Adds better support in `` + - Automatically updating based on timestamp and format option +- Adds better support in `` + - Adds support for generic attachments, videos, and audio + +## Original README: + +
+ +**Web components to easily build and display fake Discord messages on your webpages** + +[![License](https://img.shields.io/github/license/skyra-project/discord-components?logo=github&maxAge=3600&style=flat-square)](https://github.com/skyra-project/discord-components/blob/main/LICENSE.md) +[![Patreon](https://img.shields.io/badge/donate-patreon-F96854.svg?logo=patreon)](https://donate.skyra.pw/patreon) + +[![npm](https://img.shields.io/npm/v/@skyra/discord-components-core?color=crimson&logo=npm&style=flat-square&label=@skyra/discord-components-core)](https://www.npmjs.com/package/@skyra/discord-components-core) +[![npm](https://img.shields.io/npm/dt/@skyra/discord-components-core.svg?maxAge=3600&logo=npm)](https://www.npmjs.com/package/@skyra/discord-components-core) +[![npm](https://img.shields.io/bundlephobia/min/@skyra/discord-components-core?label=minified&logo=webpack&maxAge=3600)](https://bundlephobia.com/result?p=@skyra/discord-components-core) +[![Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d)](https://stenciljs.com) + +[![Support Server](https://discord.com/api/guilds/254360814063058944/embed.png?style=banner2)](https://join.skyra.pw) + +
+ +--- + +**_Table of Contents_** + +- [@skyra/discord-components-core](#skyradiscord-components-core) + - [Description](#description) + - [Features](#features) + - [Installation](#installation) + - [Usage](#usage) + - [Framework Integration](#framework-integration) + - [Angular](#angular) + - [Live Demo](#live-demo) + - [Sample code](#sample-code) + - [Including the Custom Element Schema](#including-the-custom-element-schema) + - [Calling defineCustomElements](#calling-definecustomelements) + - [Edge (Chakra Core) and IE11 polyfills](#edge-chakra-core-and-ie11-polyfills) + - [React](#react) + - [Live Demo (Create React App)](#live-demo-create-react-app) + - [Live Demo (NextJS)](#live-demo-nextjs) + - [Sample code](#sample-code-1) + - [Vue](#vue) + - [Live Demo](#live-demo-1) + - [Sample code](#sample-code-2) + - [No Framework](#no-framework) + - [Live Demo](#live-demo-2) + - [Sample Code](#sample-code) + - [Notes](#notes) + - [TypeScript module augments](#typescript-module-augments) + - [Avatar shortcuts](#avatar-shortcuts) + - [Profile shortcuts](#profile-shortcuts) + - [Theming](#theming) + - [Components notes](#components-notes) + - [discord-messages component](#discord-messages-component) + - [discord-mention component](#discord-mention-component) + - [DiscordEmbed component](#discordembed-component) + - [EmbedFields component](#embedfields-component) + - [EmbedField component](#embedfield-component) + - [Screenshots](#screenshots) + - [Dark Mode](#dark-mode) + - [Light Mode](#light-mode) + - [Contributors](#contributors) + +## Description + +Discord message components to easily build and display fake Discord messages on your webpage. + +**This is an adaptation of [wc-discord-message] from [Danktuary]** + +## Features + +- Design modelled after [Discord](https://discord.com/) itself +- Comfy and compact mode support +- Dark and light themes support +- Set the message author's username, avatar (use defaults or provide your own), role color, and "bot" tag status +- Display fake user, role, and channel mentions +- Complete embed support +- Simple syntax! + +## Installation + +```bash +yarn add @skyra/discord-components-core @skyra/discord-components-react +# or npm install @skyra/discord-components-core @skyra/discord-components-react +``` + +## Usage + +The syntax is kept fairly simple. Here's a basic example of a regular conversation: + +```html + + Hey guys, I'm new here! Glad to be able to join you all! + Hi, I'm new here too! + + Hey, User and Dawn. Welcome to our server! + + +``` + +## Framework Integration + +### Angular + +### Live Demo + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-angular-0xz0z) + +### Sample code + +#### Including the Custom Element Schema + +Including the `CUSTOM_ELEMENTS_SCHEMA` in the module allows the use of the web components in the HTML markup without the compiler producing errors. This code should be added into the `AppModule` and in every other modules that use your custom elements. Here is an example of adding it to `AppModule`: + +```ts +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { AppComponent } from './app.component'; + +@NgModule({ + declarations: [AppComponent], + imports: [BrowserModule], + providers: [], + bootstrap: [AppComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class AppModule {} +``` + +The `CUSTOM_ELEMENTS_SCHEMA` needs to be included in any module that uses custom elements. + +#### Calling defineCustomElements + +A component collection built with Stencil includes a main function that is used to load the components in the collection. That function is called `defineCustomElements()` and it needs to be called once during the bootstrapping of your application. One convenient place to do this is in `main.ts` as such: + +```ts +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { defineCustomElements } from '@skyra/discord-components-core/loader'; +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); + +// Loading @skyra/discord-components-core +defineCustomElements(); +``` + +##### Edge (Chakra Core) and IE11 polyfills + +If you want your custom elements to be able to work on older browsers, you should add the `applyPolyfills()` that surround the `defineCustomElements()` function. + +```ts +import { applyPolyfills, defineCustomElements } from '@skyra/discord-components-core/loader'; + +applyPolyfills().then(() => { + defineCustomElements(); +}); +``` + +### React + +#### Live Demo (Create React App) + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-create-react-app-64k90) + +#### Live Demo (NextJS) + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-nextjs-ovqfu) + +#### Sample code + +See [@skyra/discord-components-react](https://github.com/skyra-project/discord-components/tree/main/packages/react) + +### Vue + +#### Live Demo + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-vue-g1w48) + +#### Sample code + +In order to use the custom element library within the Vue app, the application must be modified to define the custom elements and to inform the Vue compiler which elements to ignore during compilation. This can all be done within the `main.js` file. For example: + +```tsx +import Vue from 'vue'; +import App from './App.vue'; +import { applyPolyfills, defineCustomElements } from '@skyra/discord-components-core/loader'; + +Vue.config.productionTip = false; +// Tell Vue to ignore all components defined in the @skyra/discord-components-core package. +Vue.config.ignoredElements = [/discord-\w*/]; + +// Bind the custom elements to the window object +applyPolyfills().then(() => { + defineCustomElements(); +}); + +new Vue({ + render: (h) => h(App) +}).$mount('#app'); +``` + +The components should then be available in any of the Vue templates + +```html + + + +``` + +### No Framework + +#### Live Demo + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-static-nhwkl) + +#### Sample Code + +If you're want to use the browser build, you can pull it in via unpkg. + +```html + +``` + +## Notes + +### TypeScript module augments + +This module uses a custom object on the browser `window` for configuration. In order to this you will need to include the following snippet in your source code when working in TypeScript: + +```ts +import type { DiscordMessageOptions } from '@skyra/discord-components-core/dist/types/options'; + +declare global { + interface Window { + $discordMessage: DiscordMessageOptions; + } +} +``` + +### Avatar shortcuts + +The current avatar shortcut strings available are "blue" (default), "gray", "green", "orange", and "red". These shortcuts map to the following image links: + +```json +{ + "blue": "https://cdn.discordapp.com/attachments/654503812593090602/665721745466195978/blue.png", + "gray": "https://cdn.discordapp.com/attachments/654503812593090602/665721746569166849/gray.png", + "green": "https://cdn.discordapp.com/attachments/654503812593090602/665721748431306753/green.png", + "orange": "https://cdn.discordapp.com/attachments/654503812593090602/665721750201434138/orange.png", + "red": "https://cdn.discordapp.com/attachments/654503812593090602/665721752277483540/red.png" +} +``` + +If you want to add to or override the shortcuts, you can set them via `window.$discordMessage.avatars`. + +```ts +window.$discordMessage = { + avatars: { + default: 'blue', + skyra: 'https://github.com/NM-EEA-Y.png', + djs: require('./assets/discord-avatar-djs.png') // You can use require syntax as well + } +}; +``` + +### Profile shortcuts + +Sometimes you'll want to use the same message data across multiple messages. You can do so by providing an object of profiles in `window.$discordMessage.profiles`. + +```ts +window.$discordMessage = { + profiles: { + skyra: { + author: 'Skyra', + avatar: 'https://github.com/NM-EEA-Y.png', + bot: true, + verified: true, + roleColor: '#1e88e5' + }, + favna: { + author: 'Favna', + avatar: 'https://github.com/favna.png', + roleColor: '#ff0000' + } + } +}; +``` + +And then in your React code: + +```tsx + + + Welcome to our server, Favna! + + Hey, glad to be here! + +``` + +### Theming + +Each of the components accepts the standard HTML properties for passing styling, such as `className` for passing CSS classes (JSS / CSS / SCSS etc.) or `style` to pass inline style. + +You can also pass your own custom HTML tags, for example set a `data-qa` to be able to navigate to the component in your unit tests / end-to-end tests + +### Components notes + +Below are notes for a few certain components. If you want to see what props each component has, check their readme.md file in [the respective folder]. + +#### discord-messages component + +This is a wrapper for any child `` component. It must be used in order for messages to display properly. + +#### discord-mention component + +If the default slot is left empty, the mention will be rendered as `'User'`, `'Role'`, or `'channel`', depending on the `type` prop given. + +#### DiscordEmbed component + +An embed that can be attached to the end of your messages. The default slot is used for the embed's description. The `footer` slot is used for the footer text. + +To ensure the embed gets displayed correctly inside your message, be sure to give it the proper `slot` attribute. + +```html + + Hi, I'm part of the normal message content. + Hi, I'm part of the embed message content. + +``` + +#### EmbedFields component + +A wrapper for any child `` components. Must be used in order for fields to display properly. To ensure the embed fields gets displayed correctly inside your embed, be sure to give it the proper `slot` attribute. + +```html + + + Hi, I'm part of the embed message content. + + + + + +``` + +#### EmbedField component + +At least 2 consecutive fields need to be marked as inline in order for them to actually display next to each other. The maximum amount of inline fields is 3, and drops to 2 if an embed thumbnail is used. + +```html + + + Hi, I'm part of the embed message content. + + Field content. + Field content. + + + +``` + +## Screenshots + +### Dark Mode + +**_A normal conversation_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/normal_conversation.png) + +**_Compact mode_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/compact_mode.png) + +**_With an embed_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/with_embed.png) + +### Light Mode + +**_A normal conversation_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/normal_conversation.png) + +**_Compact mode_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/compact_mode.png) + +**_With an embed_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/with_embed.png) + +## Contributors + +Please make sure to read the [Contributing Guide][contributing] before making a pull request. + +Thank you to all the people who already contributed to Skyra Project! + + + + + +[contributing]: https://github.com/skyra-project/.github/blob/main/.github/CONTRIBUTING.md +[wc-discord-message]: https://github.com/Danktuary/wc-discord-message +[danktuary]: https://github.com/Danktuary +[@stencil/react-output-target]: https://www.npmjs.com/package/@stencil/react-output-target +[the respective folder]: (https://github.com/skyra-project/discord-components/blob/main/packages/core/src/components/) diff --git a/packages/discord-components-core/package.json b/packages/discord-components-core/package.json new file mode 100644 index 0000000..6d6e99d --- /dev/null +++ b/packages/discord-components-core/package.json @@ -0,0 +1,87 @@ +{ + "name": "@derockdev/discord-components-core", + "version": "3.5.2", + "description": "Web components to easily build and display fake Discord messages on your webpages.", + "author": "@derock", + "license": "MIT", + "main": "dist/index.cjs.js", + "module": "dist/index.js", + "es2015": "dist/esm/index.js", + "es2017": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "unpkg": "dist/derockdev-discord-components-core/derockdev-discord-components-core.esm.js", + "collection:main": "dist/collection/index.js", + "collection": "dist/collection/collection-manifest.json", + "exports": { + ".": [ + { + "require": "./dist/index.cjs.js", + "import": "./dist/index.js" + }, + "./dist/index.cjs.js" + ], + "./loader": [ + { + "require": "./loader/index.cjs.js", + "import": "./loader/index.js" + }, + "./loader/index.cjs.js" + ] + }, + "sideEffects": [ + "./loader/index.js", + "./loader/index.cjs.js", + "./dist/derockdev-discord-components-core/p-*", + "**/*derockdev-discord-components-core*.js", + "./dist/esm/loader.js", + "./dist/esm/polyfills/*" + ], + "homepage": "https://github.com/itzderock/discord-components/tree/main/packages/core#readme", + "scripts": { + "build": "stencil build --docs && replace-in-file --configFile=scripts/replaceImportInPolyfills.cjs", + "start": "stencil build --dev --watch --serve", + "generate": "stencil generate" + }, + "dependencies": { + "@stencil/core": "^2.22.1", + "clsx": "^1.2.1", + "hex-to-rgba": "^2.0.1", + "highlight.js": "^11.6.0" + }, + "directories": { + "lib": "src" + }, + "files": [ + "dist/", + "loader/" + ], + "engines": { + "node": ">=v14.0.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/itzderock/discord-components.git" + }, + "bugs": { + "url": "https://github.com/itzderock/discord-components/issues" + }, + "keywords": [ + "skyra", + "typescript", + "ts", + "yarn", + "discord", + "bot", + "components", + "webcomponents", + "stencil" + ], + "devDependencies": { + "@sapphire/ts-config": "^3.3.4", + "replace-in-file": "^6.3.5", + "tslib": "^2.4.0" + } +} diff --git a/packages/discord-components-core/pnpm-lock.yaml b/packages/discord-components-core/pnpm-lock.yaml new file mode 100644 index 0000000..cc8cadd --- /dev/null +++ b/packages/discord-components-core/pnpm-lock.yaml @@ -0,0 +1,256 @@ +lockfileVersion: 5.4 + +specifiers: + '@sapphire/ts-config': ^3.3.4 + '@stencil/core': ^2.18.0 + clsx: ^1.2.1 + hex-to-rgba: ^2.0.1 + highlight.js: ^11.6.0 + replace-in-file: ^6.3.5 + tslib: ^2.4.0 + +dependencies: + '@stencil/core': 2.18.0 + clsx: 1.2.1 + hex-to-rgba: 2.0.1 + highlight.js: 11.6.0 + +devDependencies: + '@sapphire/ts-config': 3.3.4 + replace-in-file: 6.3.5 + tslib: 2.4.0 + +packages: + + /@sapphire/ts-config/3.3.4: + resolution: {integrity: sha512-mWEUxCXh3cHKI7C8HJ049exVTMNaq+A/lJEDfM5ENSQ/OOZHd5DdmXn2jrYqFWbTRCHa0Vp2FAmACWBwePsBtg==} + engines: {node: '>=v16.0.0', npm: '>=8.0.0'} + dependencies: + tslib: 2.4.0 + typescript: 4.8.3 + dev: true + + /@stencil/core/2.18.0: + resolution: {integrity: sha512-NLEY8Jq59smyiivBAxHKipsp9YkkW/K/Vm90zAyXQqukb12i2SFucWHJ1Ik7ropVlhmMVvigyxXgRfQ9quIqtg==} + engines: {node: '>=12.10.0', npm: '>=6.0.0'} + hasBin: true + dev: false + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clsx/1.2.1: + resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} + engines: {node: '>=6'} + dev: false + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /hex-to-rgba/2.0.1: + resolution: {integrity: sha512-5XqPJBpsEUMsseJUi2w2Hl7cHFFi3+OO10M2pzAvKB1zL6fc+koGMhmBqoDOCB4GemiRM/zvDMRIhVw6EkB8dQ==} + dev: false + + /highlight.js/11.6.0: + resolution: {integrity: sha512-ig1eqDzJaB0pqEvlPVIpSSyMaO92bH1N2rJpLMN/nX396wTpDA4Eq0uK+7I/2XG17pFaaKE0kjV/XPeGt7Evjw==} + engines: {node: '>=12.0.0'} + dev: false + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /replace-in-file/6.3.5: + resolution: {integrity: sha512-arB9d3ENdKva2fxRnSjwBEXfK1npgyci7ZZuwysgAp7ORjHSyxz6oqIjTEv8R0Ydl4Ll7uOAZXL4vbkhGIizCg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + chalk: 4.1.2 + glob: 7.2.3 + yargs: 17.5.1 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /tslib/2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: true + + /typescript/4.8.3: + resolution: {integrity: sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs/17.5.1: + resolution: {integrity: sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==} + engines: {node: '>=12'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true diff --git a/packages/discord-components-core/scripts/replaceImportInPolyfills.cjs b/packages/discord-components-core/scripts/replaceImportInPolyfills.cjs new file mode 100644 index 0000000..592096f --- /dev/null +++ b/packages/discord-components-core/scripts/replaceImportInPolyfills.cjs @@ -0,0 +1,14 @@ +// eslint-disable-next-line @typescript-eslint/unbound-method, @typescript-eslint/no-var-requires +const { resolve } = require('path'); + +module.exports = { + from: /import\(/g, + to: 'import(\n/* @vite-ignore */\n', + files: [ + resolve(__dirname, '../dist/esm/index*.js'), + resolve(__dirname, '../dist/esm/polyfills/index.js'), + resolve(__dirname, '../dist/esm/polyfills/system.js'), + resolve(__dirname, '../dist/derockdev-discord-components-core/p*.js') + ], + quiet: true +}; diff --git a/packages/discord-components-core/src/Fragment.tsx b/packages/discord-components-core/src/Fragment.tsx new file mode 100644 index 0000000..3824b96 --- /dev/null +++ b/packages/discord-components-core/src/Fragment.tsx @@ -0,0 +1,5 @@ +import type { VNode } from '@stencil/core'; + +export default function Fragment(_props: T, children: VNode[]) { + return [...children]; +} diff --git a/packages/discord-components-core/src/components.d.ts b/packages/discord-components-core/src/components.d.ts new file mode 100644 index 0000000..a6377f6 --- /dev/null +++ b/packages/discord-components-core/src/components.d.ts @@ -0,0 +1,1324 @@ +/* eslint-disable */ +/* tslint:disable */ +/** + * This is an autogenerated file created by the Stencil compiler. + * It contains typing information for all components that exist in this project. + */ +import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; +import { DiscordTimestamp } from "./util"; +export namespace Components { + interface DiscordActionRow { + } + interface DiscordAttachment { + /** + * The alt text to show in case the image was unable to load + * @default 'discord attachment' + */ + "alt"?: string | undefined; + /** + * The height of the image in pixels + */ + "height"?: number; + /** + * The size of the file. + */ + "size": string; + /** + * The type of file the attachment is. 'image' | 'video' | 'audio' | 'file' + */ + "type": 'image' | 'video' | 'audio' | 'file'; + /** + * The URL for the image attachment + * @important Should be a valid image URL, i.e. matching the regex `/\.(bmp|jpe?g|png|gif|webp|tiff)$/i` + */ + "url": string; + /** + * The width of the image in pixels + */ + "width"?: number; + } + interface DiscordAttachments { + } + interface DiscordBold { + } + interface DiscordButton { + /** + * Whether to show the button as disabled. + */ + "disabled": boolean; + /** + * The emoji URL to use in the button. + */ + "emoji": string; + /** + * The name of the emoji used in the button. + */ + "emojiName": string; + /** + * The type of button this is, this will change the color of the button. Valid values: `primary`, `secondary`, `success`, `destructive`. + */ + "type": 'primary' | 'secondary' | 'success' | 'destructive'; + /** + * The URL for the button. Setting this will force the button type to be `secondary`. + */ + "url": string; + } + interface DiscordCodeBlock { + /** + * The code to display. + */ + "code": string; + /** + * The language of the code block. + */ + "language"?: string; + } + interface DiscordCommand { + /** + * The message author's username. + * @default 'User' + */ + "author": string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar": string; + /** + * The name of the command invoked. + */ + "command": string; + /** + * The id of the profile data to use. + */ + "profile": string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor": string; + } + interface DiscordCustomEmoji { + /** + * Determines whether or not the emoji is used in an embed, or a message. If it is used in an embed, the sizing is adjusted accordingly. + */ + "embedEmoji": boolean; + /** + * The emoji size + */ + "largeEmoji": boolean; + /** + * The name of the emoji + */ + "name": string; + /** + * The emoji URL to use in the message. + */ + "url": string; + } + interface DiscordEmbed { + /** + * The author's avatar URL. + */ + "authorImage": string; + /** + * The author's name. + */ + "authorName": string; + /** + * The URL to open when you click on the author's name. + */ + "authorUrl": string; + /** + * The color to use for the embed's left border. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "color": string; + /** + * The embed title. + */ + "embedTitle": string; + /** + * The embed image to use (displayed at the bottom). + */ + "image": string; + /** + * The provider to show above the embed, for example for YouTube videos it will show "YouTube" at the top of the embed (above the author) + * @example YouTube + */ + "provider": string; + /** + * The thumbnail image to use. + */ + "thumbnail": string; + /** + * The URL to open when you click on the embed title. + */ + "url": string; + /** + * The embed video to use (displayed at the bottom, same slot as the image). + * @important YouTube videos will not be playable on your projects, this is due to YouTube using DASH to play their videos rather than providing the raw media stream (in a container such as mp4 or ogg). Links to regular MP4 files (such as on a CDN) however will autoplay! + * @note Video takes priority over image. + * @remark Providing both a video and an image will ensure the image is shown to users with browsers that do not support HTML5 video playback. + * @example https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg + */ + "video": string; + } + interface DiscordEmbedDescription { + } + interface DiscordEmbedField { + /** + * The field's title. + */ + "fieldTitle": string; + /** + * Whether this field should be displayed inline or not. + */ + "inline": boolean; + /** + * The index of this inline field + * @remark This defines the position of this inline field. 1 is left, 2 is middle and 3 is right. + * @oneof [1, 2, 3] + * @default 1 + */ + "inlineIndex": number; + } + interface DiscordEmbedFields { + } + interface DiscordEmbedFooter { + /** + * The image to use next to the footer text. + */ + "footerImage": string; + /** + * The timestamp to use for the message date. When supplying a string, the format must be `01/31/2000`. + */ + "timestamp"?: DiscordTimestamp; + } + interface DiscordHeader { + /** + * The name of the channel + */ + "channel": string; + /** + * The guild name + */ + "guild": string; + /** + * The icon to display. + */ + "icon"?: string; + } + interface DiscordInlineCode { + } + interface DiscordInvite { + /** + * The server icon to display for the invite. + */ + "icon": string | undefined; + /** + * Invitation embed title. + * @default "You've been invited to join a server" + */ + "inviteTitle": string; + /** + * The join button. + * @default 'Join' + */ + "joinBtn": string; + /** + * The number of members on the server. + * @default 0 + */ + "members": number; + /** + * The server's name. + * @default 'Discord Server' + */ + "name": string; + /** + * The number of members online on the server. + * @default 0 + */ + "online": number; + /** + * Whether the server is partnered. Only works if `verified` is `false` or `undefined`. + */ + "partnered": boolean; + /** + * The URL to open when you click on the join button. + */ + "url": string; + /** + * Whether the server is verified. Only works if `partnered` is `false` or `undefined`. + */ + "verified": boolean; + } + interface DiscordItalic { + } + interface DiscordMention { + /** + * The color to use for this mention. Only works for role mentions and must be in hex format. + */ + "color": string; + /** + * Whether this entire message block should be highlighted (to emulate the "logged in user" being pinged). + */ + "highlight": boolean; + /** + * The type of mention this should be. This will prepend the proper prefix character. Valid values: `user`, `channel`, `role`, `voice`, `locked`, `thread`, `forum`, and `slash`. + */ + "type": 'user' | 'channel' | 'role' | 'voice' | 'locked' | 'thread' | 'forum' | 'slash'; + } + interface DiscordMessage { + /** + * The message author's username. + * @default 'User' + */ + "author": string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar": string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot": boolean; + /** + * Whether the message has been edited or not. + */ + "edited": boolean; + /** + * Whether to make this message ephemeral. + */ + "ephemeral": boolean; + /** + * Whether to highlight this message. + */ + "highlight": boolean; + /** + * Whether the author is the original poster. + */ + "op": boolean; + /** + * The id of the profile data to use. + */ + "profile": string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor": string; + /** + * The message author's role icon URL. + */ + "roleIcon": string; + /** + * The name of the role to use as alternative image text. + */ + "roleName": string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server": boolean; + /** + * The timestamp to use for the message date. + */ + "timestamp": DiscordTimestamp; + /** + * Whether to use 24-hour format for the timestamp. + */ + "twentyFour": boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified": boolean; + } + interface DiscordMessages { + /** + * Whether to use compact mode or not. + */ + "compactMode": boolean; + /** + * Whether to use light theme or not. + */ + "lightTheme": boolean; + /** + * Whether to exclude the background or not. + */ + "noBackground": boolean; + } + interface DiscordQuote { + } + interface DiscordReaction { + /** + * The number of people who reacted. + * @default 1 + */ + "count": number; + /** + * The reaction emoji image URL. + */ + "emoji": string; + /** + * Whether the reaction should be reactive. + * @remark When the reaction is interactive left clicking it will add 1 to the counter. Whereas when holding the Shift key and left clicking it will decrease the counter. The counter cannot go below 1. + * @default false + */ + "interactive": boolean; + /** + * The name of the emoji to use as alternative image text. + * @default ':emoji' + */ + "name": string; + /** + * Whether the reaction should show as reacted by the user. + * @default false + */ + "reacted": boolean; + } + interface DiscordReactions { + } + interface DiscordReply { + /** + * Whether the referenced message contains attachments. + */ + "attachment": boolean; + /** + * The message author's username. + * @default 'User' + */ + "author": string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar": string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot": boolean; + /** + * Whether the referenced message is from a response of a slash command. + */ + "command": boolean; + /** + * Whether the message has been edited or not. + */ + "edited": boolean; + /** + * Whether this reply pings the original message sender, prepending an "@" on the author's username. + */ + "mentions": boolean; + /** + * Whether the author is the original poster. + */ + "op": boolean; + /** + * The id of the profile data to use. + */ + "profile": string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor": string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server": boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified": boolean; + } + interface DiscordSpoiler { + } + interface DiscordSystemMessage { + /** + * Whether this message is to show channel name changes, used to match Discord's style. + */ + "channelName": boolean; + /** + * The timestamp to use for the message date. + */ + "timestamp": DiscordTimestamp; + /** + * The type of system message this is, this will change the icon shown. Valid values: `join`, `leave`, `call`, `missed-call`, `boost`, `edit`, `thread`, `pin`, `alert`, and `error`. + */ + "type": 'join' | 'leave' | 'call' | 'missed-call' | 'boost' | 'edit' | 'thread' | 'pin' | 'alert' | 'error'; + } + interface DiscordTenorVideo { + /** + * The height of the video in pixels + */ + "height": number; + /** + * The URL for the video + */ + "url": string; + /** + * The width of the video in pixels + */ + "width": number; + } + interface DiscordThread { + /** + * The the text within the call to action text. (i.e. 'See Thread' or 'x Messages') + */ + "cta": string; + /** + * The name of the thread. + */ + "name": string; + } + interface DiscordThreadMessage { + /** + * The message author's username. + * @default 'User' + */ + "author": string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar": string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot": boolean; + /** + * Whether the message has been edited or not. + */ + "edited": boolean; + /** + * The id of the profile data to use. + */ + "profile": string; + /** + * The relative timestamp of the message. + */ + "relativeTimestamp": string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor": string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server": boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified": boolean; + } + interface DiscordTime { + /** + * The format for the time. + */ + "format": 't' | 'T' | 'f' | 'F' | 'd' | 'D' | 'R'; + /** + * The time to display. + */ + "timestamp": number; + } + interface DiscordUnderlined { + } +} +declare global { + interface HTMLDiscordActionRowElement extends Components.DiscordActionRow, HTMLStencilElement { + } + var HTMLDiscordActionRowElement: { + prototype: HTMLDiscordActionRowElement; + new (): HTMLDiscordActionRowElement; + }; + interface HTMLDiscordAttachmentElement extends Components.DiscordAttachment, HTMLStencilElement { + } + var HTMLDiscordAttachmentElement: { + prototype: HTMLDiscordAttachmentElement; + new (): HTMLDiscordAttachmentElement; + }; + interface HTMLDiscordAttachmentsElement extends Components.DiscordAttachments, HTMLStencilElement { + } + var HTMLDiscordAttachmentsElement: { + prototype: HTMLDiscordAttachmentsElement; + new (): HTMLDiscordAttachmentsElement; + }; + interface HTMLDiscordBoldElement extends Components.DiscordBold, HTMLStencilElement { + } + var HTMLDiscordBoldElement: { + prototype: HTMLDiscordBoldElement; + new (): HTMLDiscordBoldElement; + }; + interface HTMLDiscordButtonElement extends Components.DiscordButton, HTMLStencilElement { + } + var HTMLDiscordButtonElement: { + prototype: HTMLDiscordButtonElement; + new (): HTMLDiscordButtonElement; + }; + interface HTMLDiscordCodeBlockElement extends Components.DiscordCodeBlock, HTMLStencilElement { + } + var HTMLDiscordCodeBlockElement: { + prototype: HTMLDiscordCodeBlockElement; + new (): HTMLDiscordCodeBlockElement; + }; + interface HTMLDiscordCommandElement extends Components.DiscordCommand, HTMLStencilElement { + } + var HTMLDiscordCommandElement: { + prototype: HTMLDiscordCommandElement; + new (): HTMLDiscordCommandElement; + }; + interface HTMLDiscordCustomEmojiElement extends Components.DiscordCustomEmoji, HTMLStencilElement { + } + var HTMLDiscordCustomEmojiElement: { + prototype: HTMLDiscordCustomEmojiElement; + new (): HTMLDiscordCustomEmojiElement; + }; + interface HTMLDiscordEmbedElement extends Components.DiscordEmbed, HTMLStencilElement { + } + var HTMLDiscordEmbedElement: { + prototype: HTMLDiscordEmbedElement; + new (): HTMLDiscordEmbedElement; + }; + interface HTMLDiscordEmbedDescriptionElement extends Components.DiscordEmbedDescription, HTMLStencilElement { + } + var HTMLDiscordEmbedDescriptionElement: { + prototype: HTMLDiscordEmbedDescriptionElement; + new (): HTMLDiscordEmbedDescriptionElement; + }; + interface HTMLDiscordEmbedFieldElement extends Components.DiscordEmbedField, HTMLStencilElement { + } + var HTMLDiscordEmbedFieldElement: { + prototype: HTMLDiscordEmbedFieldElement; + new (): HTMLDiscordEmbedFieldElement; + }; + interface HTMLDiscordEmbedFieldsElement extends Components.DiscordEmbedFields, HTMLStencilElement { + } + var HTMLDiscordEmbedFieldsElement: { + prototype: HTMLDiscordEmbedFieldsElement; + new (): HTMLDiscordEmbedFieldsElement; + }; + interface HTMLDiscordEmbedFooterElement extends Components.DiscordEmbedFooter, HTMLStencilElement { + } + var HTMLDiscordEmbedFooterElement: { + prototype: HTMLDiscordEmbedFooterElement; + new (): HTMLDiscordEmbedFooterElement; + }; + interface HTMLDiscordHeaderElement extends Components.DiscordHeader, HTMLStencilElement { + } + var HTMLDiscordHeaderElement: { + prototype: HTMLDiscordHeaderElement; + new (): HTMLDiscordHeaderElement; + }; + interface HTMLDiscordInlineCodeElement extends Components.DiscordInlineCode, HTMLStencilElement { + } + var HTMLDiscordInlineCodeElement: { + prototype: HTMLDiscordInlineCodeElement; + new (): HTMLDiscordInlineCodeElement; + }; + interface HTMLDiscordInviteElement extends Components.DiscordInvite, HTMLStencilElement { + } + var HTMLDiscordInviteElement: { + prototype: HTMLDiscordInviteElement; + new (): HTMLDiscordInviteElement; + }; + interface HTMLDiscordItalicElement extends Components.DiscordItalic, HTMLStencilElement { + } + var HTMLDiscordItalicElement: { + prototype: HTMLDiscordItalicElement; + new (): HTMLDiscordItalicElement; + }; + interface HTMLDiscordMentionElement extends Components.DiscordMention, HTMLStencilElement { + } + var HTMLDiscordMentionElement: { + prototype: HTMLDiscordMentionElement; + new (): HTMLDiscordMentionElement; + }; + interface HTMLDiscordMessageElement extends Components.DiscordMessage, HTMLStencilElement { + } + var HTMLDiscordMessageElement: { + prototype: HTMLDiscordMessageElement; + new (): HTMLDiscordMessageElement; + }; + interface HTMLDiscordMessagesElement extends Components.DiscordMessages, HTMLStencilElement { + } + var HTMLDiscordMessagesElement: { + prototype: HTMLDiscordMessagesElement; + new (): HTMLDiscordMessagesElement; + }; + interface HTMLDiscordQuoteElement extends Components.DiscordQuote, HTMLStencilElement { + } + var HTMLDiscordQuoteElement: { + prototype: HTMLDiscordQuoteElement; + new (): HTMLDiscordQuoteElement; + }; + interface HTMLDiscordReactionElement extends Components.DiscordReaction, HTMLStencilElement { + } + var HTMLDiscordReactionElement: { + prototype: HTMLDiscordReactionElement; + new (): HTMLDiscordReactionElement; + }; + interface HTMLDiscordReactionsElement extends Components.DiscordReactions, HTMLStencilElement { + } + var HTMLDiscordReactionsElement: { + prototype: HTMLDiscordReactionsElement; + new (): HTMLDiscordReactionsElement; + }; + interface HTMLDiscordReplyElement extends Components.DiscordReply, HTMLStencilElement { + } + var HTMLDiscordReplyElement: { + prototype: HTMLDiscordReplyElement; + new (): HTMLDiscordReplyElement; + }; + interface HTMLDiscordSpoilerElement extends Components.DiscordSpoiler, HTMLStencilElement { + } + var HTMLDiscordSpoilerElement: { + prototype: HTMLDiscordSpoilerElement; + new (): HTMLDiscordSpoilerElement; + }; + interface HTMLDiscordSystemMessageElement extends Components.DiscordSystemMessage, HTMLStencilElement { + } + var HTMLDiscordSystemMessageElement: { + prototype: HTMLDiscordSystemMessageElement; + new (): HTMLDiscordSystemMessageElement; + }; + interface HTMLDiscordTenorVideoElement extends Components.DiscordTenorVideo, HTMLStencilElement { + } + var HTMLDiscordTenorVideoElement: { + prototype: HTMLDiscordTenorVideoElement; + new (): HTMLDiscordTenorVideoElement; + }; + interface HTMLDiscordThreadElement extends Components.DiscordThread, HTMLStencilElement { + } + var HTMLDiscordThreadElement: { + prototype: HTMLDiscordThreadElement; + new (): HTMLDiscordThreadElement; + }; + interface HTMLDiscordThreadMessageElement extends Components.DiscordThreadMessage, HTMLStencilElement { + } + var HTMLDiscordThreadMessageElement: { + prototype: HTMLDiscordThreadMessageElement; + new (): HTMLDiscordThreadMessageElement; + }; + interface HTMLDiscordTimeElement extends Components.DiscordTime, HTMLStencilElement { + } + var HTMLDiscordTimeElement: { + prototype: HTMLDiscordTimeElement; + new (): HTMLDiscordTimeElement; + }; + interface HTMLDiscordUnderlinedElement extends Components.DiscordUnderlined, HTMLStencilElement { + } + var HTMLDiscordUnderlinedElement: { + prototype: HTMLDiscordUnderlinedElement; + new (): HTMLDiscordUnderlinedElement; + }; + interface HTMLElementTagNameMap { + "discord-action-row": HTMLDiscordActionRowElement; + "discord-attachment": HTMLDiscordAttachmentElement; + "discord-attachments": HTMLDiscordAttachmentsElement; + "discord-bold": HTMLDiscordBoldElement; + "discord-button": HTMLDiscordButtonElement; + "discord-code-block": HTMLDiscordCodeBlockElement; + "discord-command": HTMLDiscordCommandElement; + "discord-custom-emoji": HTMLDiscordCustomEmojiElement; + "discord-embed": HTMLDiscordEmbedElement; + "discord-embed-description": HTMLDiscordEmbedDescriptionElement; + "discord-embed-field": HTMLDiscordEmbedFieldElement; + "discord-embed-fields": HTMLDiscordEmbedFieldsElement; + "discord-embed-footer": HTMLDiscordEmbedFooterElement; + "discord-header": HTMLDiscordHeaderElement; + "discord-inline-code": HTMLDiscordInlineCodeElement; + "discord-invite": HTMLDiscordInviteElement; + "discord-italic": HTMLDiscordItalicElement; + "discord-mention": HTMLDiscordMentionElement; + "discord-message": HTMLDiscordMessageElement; + "discord-messages": HTMLDiscordMessagesElement; + "discord-quote": HTMLDiscordQuoteElement; + "discord-reaction": HTMLDiscordReactionElement; + "discord-reactions": HTMLDiscordReactionsElement; + "discord-reply": HTMLDiscordReplyElement; + "discord-spoiler": HTMLDiscordSpoilerElement; + "discord-system-message": HTMLDiscordSystemMessageElement; + "discord-tenor-video": HTMLDiscordTenorVideoElement; + "discord-thread": HTMLDiscordThreadElement; + "discord-thread-message": HTMLDiscordThreadMessageElement; + "discord-time": HTMLDiscordTimeElement; + "discord-underlined": HTMLDiscordUnderlinedElement; + } +} +declare namespace LocalJSX { + interface DiscordActionRow { + } + interface DiscordAttachment { + /** + * The alt text to show in case the image was unable to load + * @default 'discord attachment' + */ + "alt"?: string | undefined; + /** + * The height of the image in pixels + */ + "height"?: number; + /** + * The size of the file. + */ + "size"?: string; + /** + * The type of file the attachment is. 'image' | 'video' | 'audio' | 'file' + */ + "type"?: 'image' | 'video' | 'audio' | 'file'; + /** + * The URL for the image attachment + * @important Should be a valid image URL, i.e. matching the regex `/\.(bmp|jpe?g|png|gif|webp|tiff)$/i` + */ + "url"?: string; + /** + * The width of the image in pixels + */ + "width"?: number; + } + interface DiscordAttachments { + } + interface DiscordBold { + } + interface DiscordButton { + /** + * Whether to show the button as disabled. + */ + "disabled"?: boolean; + /** + * The emoji URL to use in the button. + */ + "emoji"?: string; + /** + * The name of the emoji used in the button. + */ + "emojiName"?: string; + /** + * The type of button this is, this will change the color of the button. Valid values: `primary`, `secondary`, `success`, `destructive`. + */ + "type"?: 'primary' | 'secondary' | 'success' | 'destructive'; + /** + * The URL for the button. Setting this will force the button type to be `secondary`. + */ + "url"?: string; + } + interface DiscordCodeBlock { + /** + * The code to display. + */ + "code"?: string; + /** + * The language of the code block. + */ + "language"?: string; + } + interface DiscordCommand { + /** + * The message author's username. + * @default 'User' + */ + "author"?: string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar"?: string; + /** + * The name of the command invoked. + */ + "command"?: string; + /** + * The id of the profile data to use. + */ + "profile"?: string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor"?: string; + } + interface DiscordCustomEmoji { + /** + * Determines whether or not the emoji is used in an embed, or a message. If it is used in an embed, the sizing is adjusted accordingly. + */ + "embedEmoji"?: boolean; + /** + * The emoji size + */ + "largeEmoji"?: boolean; + /** + * The name of the emoji + */ + "name"?: string; + /** + * The emoji URL to use in the message. + */ + "url"?: string; + } + interface DiscordEmbed { + /** + * The author's avatar URL. + */ + "authorImage"?: string; + /** + * The author's name. + */ + "authorName"?: string; + /** + * The URL to open when you click on the author's name. + */ + "authorUrl"?: string; + /** + * The color to use for the embed's left border. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "color"?: string; + /** + * The embed title. + */ + "embedTitle"?: string; + /** + * The embed image to use (displayed at the bottom). + */ + "image"?: string; + /** + * The provider to show above the embed, for example for YouTube videos it will show "YouTube" at the top of the embed (above the author) + * @example YouTube + */ + "provider"?: string; + /** + * The thumbnail image to use. + */ + "thumbnail"?: string; + /** + * The URL to open when you click on the embed title. + */ + "url"?: string; + /** + * The embed video to use (displayed at the bottom, same slot as the image). + * @important YouTube videos will not be playable on your projects, this is due to YouTube using DASH to play their videos rather than providing the raw media stream (in a container such as mp4 or ogg). Links to regular MP4 files (such as on a CDN) however will autoplay! + * @note Video takes priority over image. + * @remark Providing both a video and an image will ensure the image is shown to users with browsers that do not support HTML5 video playback. + * @example https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg + */ + "video"?: string; + } + interface DiscordEmbedDescription { + } + interface DiscordEmbedField { + /** + * The field's title. + */ + "fieldTitle": string; + /** + * Whether this field should be displayed inline or not. + */ + "inline"?: boolean; + /** + * The index of this inline field + * @remark This defines the position of this inline field. 1 is left, 2 is middle and 3 is right. + * @oneof [1, 2, 3] + * @default 1 + */ + "inlineIndex"?: number; + } + interface DiscordEmbedFields { + } + interface DiscordEmbedFooter { + /** + * The image to use next to the footer text. + */ + "footerImage"?: string; + /** + * The timestamp to use for the message date. When supplying a string, the format must be `01/31/2000`. + */ + "timestamp"?: DiscordTimestamp; + } + interface DiscordHeader { + /** + * The name of the channel + */ + "channel"?: string; + /** + * The guild name + */ + "guild"?: string; + /** + * The icon to display. + */ + "icon"?: string; + } + interface DiscordInlineCode { + } + interface DiscordInvite { + /** + * The server icon to display for the invite. + */ + "icon"?: string | undefined; + /** + * Invitation embed title. + * @default "You've been invited to join a server" + */ + "inviteTitle"?: string; + /** + * The join button. + * @default 'Join' + */ + "joinBtn"?: string; + /** + * The number of members on the server. + * @default 0 + */ + "members"?: number; + /** + * The server's name. + * @default 'Discord Server' + */ + "name"?: string; + /** + * The number of members online on the server. + * @default 0 + */ + "online"?: number; + /** + * Whether the server is partnered. Only works if `verified` is `false` or `undefined`. + */ + "partnered"?: boolean; + /** + * The URL to open when you click on the join button. + */ + "url"?: string; + /** + * Whether the server is verified. Only works if `partnered` is `false` or `undefined`. + */ + "verified"?: boolean; + } + interface DiscordItalic { + } + interface DiscordMention { + /** + * The color to use for this mention. Only works for role mentions and must be in hex format. + */ + "color"?: string; + /** + * Whether this entire message block should be highlighted (to emulate the "logged in user" being pinged). + */ + "highlight"?: boolean; + /** + * The type of mention this should be. This will prepend the proper prefix character. Valid values: `user`, `channel`, `role`, `voice`, `locked`, `thread`, `forum`, and `slash`. + */ + "type"?: 'user' | 'channel' | 'role' | 'voice' | 'locked' | 'thread' | 'forum' | 'slash'; + } + interface DiscordMessage { + /** + * The message author's username. + * @default 'User' + */ + "author"?: string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar"?: string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot"?: boolean; + /** + * Whether the message has been edited or not. + */ + "edited"?: boolean; + /** + * Whether to make this message ephemeral. + */ + "ephemeral"?: boolean; + /** + * Whether to highlight this message. + */ + "highlight"?: boolean; + /** + * Whether the author is the original poster. + */ + "op"?: boolean; + /** + * The id of the profile data to use. + */ + "profile"?: string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor"?: string; + /** + * The message author's role icon URL. + */ + "roleIcon"?: string; + /** + * The name of the role to use as alternative image text. + */ + "roleName"?: string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server"?: boolean; + /** + * The timestamp to use for the message date. + */ + "timestamp"?: DiscordTimestamp; + /** + * Whether to use 24-hour format for the timestamp. + */ + "twentyFour"?: boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified"?: boolean; + } + interface DiscordMessages { + /** + * Whether to use compact mode or not. + */ + "compactMode"?: boolean; + /** + * Whether to use light theme or not. + */ + "lightTheme"?: boolean; + /** + * Whether to exclude the background or not. + */ + "noBackground"?: boolean; + } + interface DiscordQuote { + } + interface DiscordReaction { + /** + * The number of people who reacted. + * @default 1 + */ + "count"?: number; + /** + * The reaction emoji image URL. + */ + "emoji"?: string; + /** + * Whether the reaction should be reactive. + * @remark When the reaction is interactive left clicking it will add 1 to the counter. Whereas when holding the Shift key and left clicking it will decrease the counter. The counter cannot go below 1. + * @default false + */ + "interactive"?: boolean; + /** + * The name of the emoji to use as alternative image text. + * @default ':emoji' + */ + "name"?: string; + /** + * Whether the reaction should show as reacted by the user. + * @default false + */ + "reacted"?: boolean; + } + interface DiscordReactions { + } + interface DiscordReply { + /** + * Whether the referenced message contains attachments. + */ + "attachment"?: boolean; + /** + * The message author's username. + * @default 'User' + */ + "author"?: string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar"?: string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot"?: boolean; + /** + * Whether the referenced message is from a response of a slash command. + */ + "command"?: boolean; + /** + * Whether the message has been edited or not. + */ + "edited"?: boolean; + /** + * Whether this reply pings the original message sender, prepending an "@" on the author's username. + */ + "mentions"?: boolean; + /** + * Whether the author is the original poster. + */ + "op"?: boolean; + /** + * The id of the profile data to use. + */ + "profile"?: string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor"?: string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server"?: boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified"?: boolean; + } + interface DiscordSpoiler { + } + interface DiscordSystemMessage { + /** + * Whether this message is to show channel name changes, used to match Discord's style. + */ + "channelName"?: boolean; + /** + * The timestamp to use for the message date. + */ + "timestamp"?: DiscordTimestamp; + /** + * The type of system message this is, this will change the icon shown. Valid values: `join`, `leave`, `call`, `missed-call`, `boost`, `edit`, `thread`, `pin`, `alert`, and `error`. + */ + "type"?: 'join' | 'leave' | 'call' | 'missed-call' | 'boost' | 'edit' | 'thread' | 'pin' | 'alert' | 'error'; + } + interface DiscordTenorVideo { + /** + * The height of the video in pixels + */ + "height"?: number; + /** + * The URL for the video + */ + "url"?: string; + /** + * The width of the video in pixels + */ + "width"?: number; + } + interface DiscordThread { + /** + * The the text within the call to action text. (i.e. 'See Thread' or 'x Messages') + */ + "cta"?: string; + /** + * The name of the thread. + */ + "name"?: string; + } + interface DiscordThreadMessage { + /** + * The message author's username. + * @default 'User' + */ + "author"?: string; + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + "avatar"?: string; + /** + * Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. + */ + "bot"?: boolean; + /** + * Whether the message has been edited or not. + */ + "edited"?: boolean; + /** + * The id of the profile data to use. + */ + "profile"?: string; + /** + * The relative timestamp of the message. + */ + "relativeTimestamp"?: string; + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + "roleColor"?: string; + /** + * Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. + */ + "server"?: boolean; + /** + * Whether the bot is verified or not. Only works if `bot` is `true` + */ + "verified"?: boolean; + } + interface DiscordTime { + /** + * The format for the time. + */ + "format"?: 't' | 'T' | 'f' | 'F' | 'd' | 'D' | 'R'; + /** + * The time to display. + */ + "timestamp"?: number; + } + interface DiscordUnderlined { + } + interface IntrinsicElements { + "discord-action-row": DiscordActionRow; + "discord-attachment": DiscordAttachment; + "discord-attachments": DiscordAttachments; + "discord-bold": DiscordBold; + "discord-button": DiscordButton; + "discord-code-block": DiscordCodeBlock; + "discord-command": DiscordCommand; + "discord-custom-emoji": DiscordCustomEmoji; + "discord-embed": DiscordEmbed; + "discord-embed-description": DiscordEmbedDescription; + "discord-embed-field": DiscordEmbedField; + "discord-embed-fields": DiscordEmbedFields; + "discord-embed-footer": DiscordEmbedFooter; + "discord-header": DiscordHeader; + "discord-inline-code": DiscordInlineCode; + "discord-invite": DiscordInvite; + "discord-italic": DiscordItalic; + "discord-mention": DiscordMention; + "discord-message": DiscordMessage; + "discord-messages": DiscordMessages; + "discord-quote": DiscordQuote; + "discord-reaction": DiscordReaction; + "discord-reactions": DiscordReactions; + "discord-reply": DiscordReply; + "discord-spoiler": DiscordSpoiler; + "discord-system-message": DiscordSystemMessage; + "discord-tenor-video": DiscordTenorVideo; + "discord-thread": DiscordThread; + "discord-thread-message": DiscordThreadMessage; + "discord-time": DiscordTime; + "discord-underlined": DiscordUnderlined; + } +} +export { LocalJSX as JSX }; +declare module "@stencil/core" { + export namespace JSX { + interface IntrinsicElements { + "discord-action-row": LocalJSX.DiscordActionRow & JSXBase.HTMLAttributes; + "discord-attachment": LocalJSX.DiscordAttachment & JSXBase.HTMLAttributes; + "discord-attachments": LocalJSX.DiscordAttachments & JSXBase.HTMLAttributes; + "discord-bold": LocalJSX.DiscordBold & JSXBase.HTMLAttributes; + "discord-button": LocalJSX.DiscordButton & JSXBase.HTMLAttributes; + "discord-code-block": LocalJSX.DiscordCodeBlock & JSXBase.HTMLAttributes; + "discord-command": LocalJSX.DiscordCommand & JSXBase.HTMLAttributes; + "discord-custom-emoji": LocalJSX.DiscordCustomEmoji & JSXBase.HTMLAttributes; + "discord-embed": LocalJSX.DiscordEmbed & JSXBase.HTMLAttributes; + "discord-embed-description": LocalJSX.DiscordEmbedDescription & JSXBase.HTMLAttributes; + "discord-embed-field": LocalJSX.DiscordEmbedField & JSXBase.HTMLAttributes; + "discord-embed-fields": LocalJSX.DiscordEmbedFields & JSXBase.HTMLAttributes; + "discord-embed-footer": LocalJSX.DiscordEmbedFooter & JSXBase.HTMLAttributes; + "discord-header": LocalJSX.DiscordHeader & JSXBase.HTMLAttributes; + "discord-inline-code": LocalJSX.DiscordInlineCode & JSXBase.HTMLAttributes; + "discord-invite": LocalJSX.DiscordInvite & JSXBase.HTMLAttributes; + "discord-italic": LocalJSX.DiscordItalic & JSXBase.HTMLAttributes; + "discord-mention": LocalJSX.DiscordMention & JSXBase.HTMLAttributes; + "discord-message": LocalJSX.DiscordMessage & JSXBase.HTMLAttributes; + "discord-messages": LocalJSX.DiscordMessages & JSXBase.HTMLAttributes; + "discord-quote": LocalJSX.DiscordQuote & JSXBase.HTMLAttributes; + "discord-reaction": LocalJSX.DiscordReaction & JSXBase.HTMLAttributes; + "discord-reactions": LocalJSX.DiscordReactions & JSXBase.HTMLAttributes; + "discord-reply": LocalJSX.DiscordReply & JSXBase.HTMLAttributes; + "discord-spoiler": LocalJSX.DiscordSpoiler & JSXBase.HTMLAttributes; + "discord-system-message": LocalJSX.DiscordSystemMessage & JSXBase.HTMLAttributes; + "discord-tenor-video": LocalJSX.DiscordTenorVideo & JSXBase.HTMLAttributes; + "discord-thread": LocalJSX.DiscordThread & JSXBase.HTMLAttributes; + "discord-thread-message": LocalJSX.DiscordThreadMessage & JSXBase.HTMLAttributes; + "discord-time": LocalJSX.DiscordTime & JSXBase.HTMLAttributes; + "discord-underlined": LocalJSX.DiscordUnderlined & JSXBase.HTMLAttributes; + } + } +} diff --git a/packages/discord-components-core/src/components/author-info/author-info.css b/packages/discord-components-core/src/components/author-info/author-info.css new file mode 100644 index 0000000..ab57339 --- /dev/null +++ b/packages/discord-components-core/src/components/author-info/author-info.css @@ -0,0 +1,76 @@ +.discord-message .discord-author-info { + display: inline-flex; + align-items: center; + font-size: 16px; + margin-right: 0.25rem; +} + +.discord-compact-mode .discord-message .discord-author-info { + margin-right: 0; +} + +.discord-message .discord-author-info .discord-author-username { + color: #fff; + font-size: 1em; + font-weight: 500; +} + +.discord-light-theme .discord-message .discord-author-info .discord-author-username { + color: #23262a; +} + +.discord-message .discord-author-info .discord-application-tag { + background-color: #5865f2; + color: #fff; + font-size: 0.625em; + margin-left: 4px; + border-radius: 3px; + line-height: 100%; + text-transform: uppercase; + /* Use flex layout to ensure both verified icon and "BOT" text are aligned to center */ + display: flex; + align-items: center; + /* Styling taken through Inspect Element on Discord client for Windows */ + height: 0.9375rem; + padding: 0 0.275rem; + margin-top: 0.075em; + border-radius: 0.1875rem; +} + +.discord-message .discord-author-info .discord-application-tag.discord-application-tag-op { + background-color: #c9cdfb; + color: #4752c4; + border-radius: 0.4rem; +} + +.discord-message .discord-author-info .discord-application-tag-verified { + display: inline-block; + width: 0.9375rem; + height: 0.9375rem; + margin-left: -0.25rem; +} + +.discord-message .discord-author-info .discord-author-role-icon { + margin-left: 0.25rem; + vertical-align: top; + height: calc(1rem + 4px); + width: calc(1rem + 4px); +} + +.discord-compact-mode .discord-message .discord-author-info .discord-author-username { + margin-left: 8px; + margin-right: 4px; +} + +.discord-compact-mode .discord-message .discord-author-info .discord-application-tag { + margin-left: 0; + margin-left: 5px; + margin-right: 5px; + padding-left: 10px; + padding-right: 4px; +} + +.discord-compact-mode .discord-message .discord-author-info .discord-application-tag-verified { + margin-right: 0.7em; + margin-left: -0.7em; +} diff --git a/packages/discord-components-core/src/components/author-info/author-info.tsx b/packages/discord-components-core/src/components/author-info/author-info.tsx new file mode 100644 index 0000000..de3a48a --- /dev/null +++ b/packages/discord-components-core/src/components/author-info/author-info.tsx @@ -0,0 +1,75 @@ +import type { FunctionalComponent} from '@stencil/core'; +import { h } from '@stencil/core'; +import Fragment from '../../Fragment'; +import VerifiedTick from '../svgs/verified-tick'; + +interface AuthorInfoProps { + /** + * The name of the author + */ + author: string; + /** + * Whether this author is a bot. Only works if `server` is `false` or `undefined`. + */ + bot: boolean; + /** + * Whether this author is a `server` crosspost webhook. Only works if `bot` is `false` or `undefined`. + */ + server: boolean; + /** + * Whether this author is the original poster. + */ + op: boolean; + /** + * The colour of the author, which comes from their highest role + */ + roleColor: string; + /** + * The role icon of the author, which comes from their highest role + */ + roleIcon: string; + /** + * The role name of the author, which comes from their highest role + */ + roleName: string; + /** + * Whether this bot is verified by Discord. Only works if `bot` is `true` + */ + verified: boolean; + /** + * Whether to reverse the order of the author info for compact mode. + */ + compact: boolean; +} + +export const AuthorInfo: FunctionalComponent = ({ author, bot, server, op, roleColor, roleIcon, roleName, verified, compact }) => ( + + {!compact && ( + + + {author} + + {roleIcon && {roleName}} + + )} + { + + {/* If bot is true then we need to render a Bot tag */} + {bot && !server && ( + + {/* If verified is true then a verified checkmark should be prefixed */} + {verified && } + Bot + + )} + {server && !bot && Server} + {op && OP} + + } + {compact && ( + + {author} + + )} + +); diff --git a/packages/discord-components-core/src/components/discord-action-row/discord-action-row.css b/packages/discord-components-core/src/components/discord-action-row/discord-action-row.css new file mode 100644 index 0000000..8f335d0 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-action-row/discord-action-row.css @@ -0,0 +1,4 @@ +.discord-action-row { + display: flex; + flex-wrap: nowrap; +} diff --git a/packages/discord-components-core/src/components/discord-action-row/discord-action-row.tsx b/packages/discord-components-core/src/components/discord-action-row/discord-action-row.tsx new file mode 100644 index 0000000..30f3e0d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-action-row/discord-action-row.tsx @@ -0,0 +1,16 @@ +import type { ComponentInterface } from '@stencil/core'; +import { Component, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-action-row', + styleUrl: 'discord-action-row.css', +}) +export class DiscordActionRow implements ComponentInterface { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-action-row/readme.md b/packages/discord-components-core/src/components/discord-action-row/readme.md new file mode 100644 index 0000000..aef194f --- /dev/null +++ b/packages/discord-components-core/src/components/discord-action-row/readme.md @@ -0,0 +1,7 @@ +# discord-action-row + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-attachment/discord-attachment.css b/packages/discord-components-core/src/components/discord-attachment/discord-attachment.css new file mode 100644 index 0000000..74a5961 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachment/discord-attachment.css @@ -0,0 +1,86 @@ +.discord-attachment { + color: #dcddde; + display: flex; + font-size: 13px; + line-height: 150%; + margin-bottom: 8px; + margin-top: 8px; +} + +.discord-attachment .discord-image-wrapper { + display: block; + position: relative; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + overflow: hidden; + border-radius: 3px; +} + +.discord-attachment .discord-image-wrapper img, +.discord-attachment .discord-image-wrapper video { + max-width: 400px; + width: 100%; + height: auto; +} + +.discord-attachment-generic { + display: flex; + width: auto; + max-width: 520px; + height: 40px; + padding: 10px; + background-color: #2f3136; + border: 1px solid #292b2f; + border-radius: 3px; + overflow: hidden; +} + +.discord-attachment-generic-icon { + float: left; + height: 100%; + width: auto; +} + +.discord-attachment-generic-icon > svg { + width: 30px; + height: 100%; + margin-right: 10px; +} + +.discord-attachment-generic-inner { + flex-grow: 1; + width: fit-content; + height: 100%; +} + +.discord-attachment-generic-size { + color: #72767d; + font-size: 12px; + align-items: flex-start; + line-height: 100%; +} + +.discord-attachment-generic-name { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: fit-content; +} + +.discord-attachment-generic-download { + float: right; + height: 100%; + margin-left: 5px; + margin-right: 5px; +} + +.discord-attachment-generic-download > a > svg { + height: 100%; + color: rgb(185, 187, 190); +} + +.discord-attachment-generic-download > a > svg:hover { + color: rgb(220, 221, 222); +} diff --git a/packages/discord-components-core/src/components/discord-attachment/discord-attachment.tsx b/packages/discord-components-core/src/components/discord-attachment/discord-attachment.tsx new file mode 100644 index 0000000..790cd19 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachment/discord-attachment.tsx @@ -0,0 +1,131 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; + +enum DiscordAttachmentType { + IMAGE = 'image', + VIDEO = 'video', + AUDIO = 'audio', + FILE = 'file' +} + +@Component({ + tag: 'discord-attachment', + styleUrl: 'discord-attachment.css' +}) +export class DiscordAttachment implements ComponentInterface { + /** + * The DiscordEmbed element. + */ + @Element() + public el: HTMLElement; + + /** + * The URL for the image attachment + * @important Should be a valid image URL, i.e. matching the regex `/\.(bmp|jpe?g|png|gif|webp|tiff)$/i` + */ + @Prop() + public url: string; + + /** + * The type of file the attachment is. + * 'image' | 'video' | 'audio' | 'file' + */ + @Prop() + public type: 'image' | 'video' | 'audio' | 'file'; + + /** + * The size of the file. + */ + @Prop() + public size: string; + + /** + * The height of the image in pixels + */ + @Prop() + public height?: number; + + /** + * The width of the image in pixels + */ + @Prop() + public width?: number; + + /** + * The alt text to show in case the image was unable to load + * @default 'discord attachment' + */ + @Prop() + public alt? = 'discord attachment'; + + public render() { + switch (this.type) { + case DiscordAttachmentType.IMAGE: + return ( + +
+ {this.alt} +
+
+ ); + + case DiscordAttachmentType.VIDEO: + return ( + +
+
+
+ ); + + case DiscordAttachmentType.AUDIO: + return ( + + + ); + + case DiscordAttachmentType.FILE: + default: + return ( + +
+ + + + +
+ +
+ + +
{this.size}
+
+ + +
+ ); + } + } +} diff --git a/packages/discord-components-core/src/components/discord-attachment/readme.md b/packages/discord-components-core/src/components/discord-attachment/readme.md new file mode 100644 index 0000000..bded40a --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachment/readme.md @@ -0,0 +1,18 @@ +# discord-attachment + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------- | --------- | --------------------------------------------------------------------------- | ----------------------------------------- | ---------------------- | +| `alt` | `alt` | The alt text to show in case the image was unable to load | `string \| undefined` | `'discord attachment'` | +| `height` | `height` | The height of the image in pixels | `number \| undefined` | `undefined` | +| `size` | `size` | The size of the file. | `string` | `undefined` | +| `type` | `type` | The type of file the attachment is. 'image' \| 'video' \| 'audio' \| 'file' | `"audio" \| "file" \| "image" \| "video"` | `undefined` | +| `url` | `url` | The URL for the image attachment | `string` | `undefined` | +| `width` | `width` | The width of the image in pixels | `number \| undefined` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-attachments/discord-attachments.css b/packages/discord-components-core/src/components/discord-attachments/discord-attachments.css new file mode 100644 index 0000000..d749e0b --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachments/discord-attachments.css @@ -0,0 +1,17 @@ +.discord-message .discord-attachments { + display: grid; + grid-auto-flow: row; + grid-row-gap: 0.25rem; + text-indent: 0; + min-height: 0; + min-width: 0; + padding-top: 0.125rem; + padding-bottom: 0.125rem; + position: relative; +} + +.discord-message .discord-attachments > * { + justify-self: start; + -ms-flex-item-align: start; + align-self: start; +} diff --git a/packages/discord-components-core/src/components/discord-attachments/discord-attachments.tsx b/packages/discord-components-core/src/components/discord-attachments/discord-attachments.tsx new file mode 100644 index 0000000..18a616d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachments/discord-attachments.tsx @@ -0,0 +1,16 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-attachments', + styleUrl: 'discord-attachments.css' +}) +export class DiscordAttachments implements ComponentInterface { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-attachments/readme.md b/packages/discord-components-core/src/components/discord-attachments/readme.md new file mode 100644 index 0000000..58e9cb1 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-attachments/readme.md @@ -0,0 +1,7 @@ +# discord-attachments + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-bold/discord-bold.tsx b/packages/discord-components-core/src/components/discord-bold/discord-bold.tsx new file mode 100644 index 0000000..e87988b --- /dev/null +++ b/packages/discord-components-core/src/components/discord-bold/discord-bold.tsx @@ -0,0 +1,14 @@ +import { Component, h } from '@stencil/core'; + +@Component({ + tag: 'discord-bold' +}) +export class DiscordBold { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-bold/readme.md b/packages/discord-components-core/src/components/discord-bold/readme.md new file mode 100644 index 0000000..910b9fb --- /dev/null +++ b/packages/discord-components-core/src/components/discord-bold/readme.md @@ -0,0 +1,7 @@ +# discord-bold + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-button/discord-button.css b/packages/discord-components-core/src/components/discord-button/discord-button.css new file mode 100644 index 0000000..8d6e9d6 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-button/discord-button.css @@ -0,0 +1,72 @@ +.discord-button { + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + margin: 4px 8px 4px 0; + padding: 2px 16px; + width: auto; + height: 32px; + min-width: 60px; + min-height: 32px; + -webkit-transition: background-color 0.17s ease, color 0.17s ease; + transition: background-color 0.17s ease, color 0.17s ease; + border-radius: 3px; + font-size: 14px; + font-weight: 500; + line-height: 16px; + text-decoration: none !important; +} + +.discord-button.discord-button-success { + color: #fff; + background-color: #3ba55d; +} + +.discord-button.discord-button-success.discord-button-hoverable:hover { + background-color: #2d7d46; +} + +.discord-button.discord-button-destructive { + color: #fff; + background-color: #ed4245; +} + +.discord-button.discord-button-destructive.discord-button-hoverable:hover { + background-color: #c03537; +} + +.discord-button.discord-button-primary { + color: #fff; + background-color: #5865f2; +} + +.discord-button.discord-button-primary.discord-button-hoverable:hover { + background-color: #4752c4; +} + +.discord-button.discord-button-secondary { + color: #fff; + background-color: #4f545c; +} + +.discord-button.discord-button-secondary.discord-button-hoverable:hover { + background-color: #5d6269; +} + +.discord-button.discord-button-disabled { + cursor: not-allowed; + opacity: 0.5; +} + +.discord-button .discord-button-launch { + margin-left: 8px; +} + +.discord-button .discord-button-emoji { + margin-right: 4px; + object-fit: contain; + width: 1.375em; + height: 1.375em; + vertical-align: bottom; +} diff --git a/packages/discord-components-core/src/components/discord-button/discord-button.tsx b/packages/discord-components-core/src/components/discord-button/discord-button.tsx new file mode 100644 index 0000000..ad55863 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-button/discord-button.tsx @@ -0,0 +1,82 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import Fragment from '../../Fragment'; +import LaunchIcon from '../svgs/launch-icon'; + +@Component({ + tag: 'discord-button', + styleUrl: 'discord-button.css' +}) +export class DiscordButton implements ComponentInterface { + /** + * The DiscordButton element. + */ + @Element() + public el: HTMLElement; + + /** + * The emoji URL to use in the button. + */ + @Prop() + public emoji: string; + + /** + * The name of the emoji used in the button. + */ + @Prop() + public emojiName = 'emoji'; + + /** + * The URL for the button. Setting this will force the button type to be `secondary`. + */ + @Prop() + public url: string; + + /** + * Whether to show the button as disabled. + */ + @Prop() + public disabled = false; + + /** + * The type of button this is, this will change the color of the button. + * Valid values: `primary`, `secondary`, `success`, `destructive`. + */ + @Prop() + public type: 'primary' | 'secondary' | 'success' | 'destructive' = 'secondary'; + + @Watch('type') + public handleType(value: string) { + if (typeof value !== 'string') { + throw new TypeError('DiscordButton `type` prop must be a string.'); + } else if (!['primary', 'secondary', 'success', 'destructive'].includes(value)) { + throw new RangeError("DiscordButton `type` prop must be one of: 'primary', 'secondary', 'success', 'destructive'"); + } + } + + public render() { + const parent: HTMLDiscordActionRowElement = this.el.parentElement as HTMLDiscordActionRowElement; + + if (parent.tagName.toLowerCase() !== 'discord-action-row') { + throw new Error('All components must be direct children of .'); + } + + const content = ( + + {this.emoji && {this.emojiName}} + + + + {this.url && } + + ); + + return this.url && !this.disabled ? ( + + {content} + + ) : ( + {content} + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-button/readme.md b/packages/discord-components-core/src/components/discord-button/readme.md new file mode 100644 index 0000000..97048a0 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-button/readme.md @@ -0,0 +1,17 @@ +# discord-button + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------- | +| `disabled` | `disabled` | Whether to show the button as disabled. | `boolean` | `false` | +| `emoji` | `emoji` | The emoji URL to use in the button. | `string` | `undefined` | +| `emojiName` | `emoji-name` | The name of the emoji used in the button. | `string` | `'emoji'` | +| `type` | `type` | The type of button this is, this will change the color of the button. Valid values: `primary`, `secondary`, `success`, `destructive`. | `"destructive" \| "primary" \| "secondary" \| "success"` | `'secondary'` | +| `url` | `url` | The URL for the button. Setting this will force the button type to be `secondary`. | `string` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-code-block/discord-code-block.css b/packages/discord-components-core/src/components/discord-code-block/discord-code-block.css new file mode 100644 index 0000000..a492d71 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-code-block/discord-code-block.css @@ -0,0 +1,39 @@ +/* .discord-message .discord-message-body .discord-spoiler */ + +.discord-code-block-pre { + background-color: #2f3136; + font-family: 'Consolas', 'Courier New', Courier, monospace; + margin-top: 0.25rem; + white-space: pre-wrap; +} + +.discord-code-block-pre--multiline { + display: block; + margin-bottom: 0.5rem; + margin-top: 0.25em; + padding: 0.5em; + border: 1px solid #202225; + border-radius: 4px; + color: #b9bbbe; + font-size: 0.875rem; +} + +.discord-code-block-pre--multiline.hljs { + background-color: #2f3136; + color: #b9bbbe; +} + +.discord-embed .discord-code-block-pre { + background-color: #202225; +} + +.discord-embed .discord-code-block-pre .hljs { + background-color: #202225; +} + +code.hljs { + padding: unset !important; +} + +/* I dont know what theme discord uses, but i thought this was close enough */ +@import '~highlight.js/styles/base16/helios.css'; diff --git a/packages/discord-components-core/src/components/discord-code-block/discord-code-block.tsx b/packages/discord-components-core/src/components/discord-code-block/discord-code-block.tsx new file mode 100644 index 0000000..5895820 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-code-block/discord-code-block.tsx @@ -0,0 +1,32 @@ +import type { ComponentInterface } from '@stencil/core'; +import { Component, Host, h, Prop } from '@stencil/core'; +import hljs from 'highlight.js'; + +@Component({ + tag: 'discord-code-block', + styleUrl: 'discord-code-block.css' +}) +export class DiscordCodeBlock implements ComponentInterface { + /** + * The language of the code block. + */ + @Prop() + public language?: string; + + /** + * The code to display. + */ + @Prop() + public code: string; + + public render() { + // check if hljs has the language + const language = this.language ? (hljs.getLanguage(this.language) ? this.language : 'plaintext') : 'plaintext'; + + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-code-block/readme.md b/packages/discord-components-core/src/components/discord-code-block/readme.md new file mode 100644 index 0000000..82e0d14 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-code-block/readme.md @@ -0,0 +1,14 @@ +# discord-channel-header + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ---------- | ---------- | ------------------------------- | --------------------- | ----------- | +| `code` | `code` | The code to display. | `string` | `undefined` | +| `language` | `language` | The language of the code block. | `string \| undefined` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-command/discord-command.css b/packages/discord-components-core/src/components/discord-command/discord-command.css new file mode 100644 index 0000000..036ba2a --- /dev/null +++ b/packages/discord-components-core/src/components/discord-command/discord-command.css @@ -0,0 +1,15 @@ +.discord-replied-message.discord-executed-command .discord-command-name { + color: #00aff4; + font-weight: 500; +} + +.discord-replied-message.discord-executed-command .discord-command-name:hover { + color: #00aff4; + text-decoration: underline; +} + +.discord-replied-message.discord-executed-command .discord-replied-message-username { + margin-right: 0; +} + +@import '../discord-reply/discord-reply.css'; diff --git a/packages/discord-components-core/src/components/discord-command/discord-command.tsx b/packages/discord-components-core/src/components/discord-command/discord-command.tsx new file mode 100644 index 0000000..b8a98af --- /dev/null +++ b/packages/discord-components-core/src/components/discord-command/discord-command.tsx @@ -0,0 +1,81 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; +import type { Profile} from '../../options'; +import { avatars, profiles } from '../../options'; +import CommandIcon from '../svgs/command-icon'; + +@Component({ + tag: 'discord-command', + styleUrl: 'discord-command.css' +}) +export class DiscordCommand implements ComponentInterface { + /** + * The DiscordCommand element. + */ + @Element() + public el: HTMLElement; + + /** + * The id of the profile data to use. + */ + @Prop() + public profile: string; + + /** + * The message author's username. + * @default 'User' + */ + @Prop() + public author = 'User'; + + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + @Prop() + public avatar: string; + + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + @Prop() + public roleColor: string; + + /** + * The name of the command invoked. + */ + @Prop() + public command: string; + + public render() { + const parent: HTMLDiscordMessageElement = this.el.parentElement as HTMLDiscordMessageElement; + + if (parent.tagName.toLowerCase() !== 'discord-message') { + throw new Error('All components must be direct children of .'); + } + + const resolveAvatar = (avatar: string): string => avatars[avatar] ?? avatar ?? avatars.default; + + const defaultData: Profile = { author: this.author, bot: false, verified: false, server: false, roleColor: this.roleColor }; + const profileData: Profile = Reflect.get(profiles, this.profile) ?? {}; + const profile: Profile = { ...defaultData, ...profileData, ...{ avatar: resolveAvatar(profileData.avatar ?? this.avatar) } }; + + const messageParent: HTMLDiscordMessagesElement = parent.parentElement as HTMLDiscordMessagesElement; + + return ( + + {messageParent.compactMode ? ( +
+ +
+ ) : ( + {profile.author} + )} + + {profile.author} + + {' used '} +
{this.command}
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-command/readme.md b/packages/discord-components-core/src/components/discord-command/readme.md new file mode 100644 index 0000000..458b9d9 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-command/readme.md @@ -0,0 +1,17 @@ +# discord-command + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ----------- | +| `author` | `author` | The message author's username. | `string` | `'User'` | +| `avatar` | `avatar` | The message author's avatar. Can be an avatar shortcut, relative path, or external link. | `string` | `undefined` | +| `command` | `command` | The name of the command invoked. | `string` | `undefined` | +| `profile` | `profile` | The id of the profile data to use. | `string` | `undefined` | +| `roleColor` | `role-color` | The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). | `string` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.css b/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.css new file mode 100644 index 0000000..1ec8eee --- /dev/null +++ b/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.css @@ -0,0 +1,27 @@ +.discord-custom-emoji { + display: inline-block; + cursor: pointer; + vertical-align: bottom; +} + +.discord-custom-emoji .discord-custom-emoji-image { + object-fit: contain; + width: 1.375rem; + height: 1.375rem; + vertical-align: bottom; +} + +.discord-custom-emoji .discord-custom-emoji-image-large { + width: 2.8em; + height: 2.8em; +} + +.discord-embed-custom-emoji { + display: inline-block; +} + +.discord-embed-custom-emoji .discord-embed-custom-emoji-image { + width: 18px; + height: 18px; + vertical-align: bottom; +} diff --git a/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.tsx b/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.tsx new file mode 100644 index 0000000..ff21897 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-custom-emoji/discord-custom-emoji.tsx @@ -0,0 +1,67 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Prop } from '@stencil/core'; +import { getGlobalEmojiUrl } from '../../util'; + +@Component({ + tag: 'discord-custom-emoji', + styleUrl: 'discord-custom-emoji.css' +}) +export class DiscordCustomEmoji implements ComponentInterface { + /** + * The DiscordReaction element. + */ + @Element() + public el: HTMLElement; + + /** + * The name of the emoji + */ + @Prop() + public name: string; + + /** + * The emoji URL to use in the message. + */ + @Prop({ mutable: true }) + public url: string; + + /** + * Determines whether or not the emoji is used in an embed, or a message. + * If it is used in an embed, the sizing is adjusted accordingly. + */ + @Prop({ mutable: true }) + public embedEmoji: boolean; + + /** + * The emoji size + */ + @Prop() + public largeEmoji = false; + + public componentWillRender() { + if (!this.url && Boolean(this.name)) { + const emojiFromGlobal = getGlobalEmojiUrl(this.name); + + if (emojiFromGlobal) { + this.url ??= emojiFromGlobal.url ?? ''; + this.embedEmoji ??= emojiFromGlobal.embedEmoji ?? false; + } + } + } + + public render() { + const name = `:${this.name}:`; + const emojiClassName = this.embedEmoji ? 'discord-embed-custom-emoji' : 'discord-custom-emoji'; + let emojiImageClassName = this.embedEmoji ? 'discord-embed-custom-emoji-image' : 'discord-custom-emoji-image'; + + if (this.largeEmoji) { + emojiImageClassName += ' discord-custom-emoji-image-large'; + } + + return ( + + {name} + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-custom-emoji/readme.md b/packages/discord-components-core/src/components/discord-custom-emoji/readme.md new file mode 100644 index 0000000..ec29730 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-custom-emoji/readme.md @@ -0,0 +1,16 @@ +# discord-custom-emoji + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------- | +| `embedEmoji` | `embed-emoji` | Determines whether or not the emoji is used in an embed, or a message. If it is used in an embed, the sizing is adjusted accordingly. | `boolean` | `undefined` | +| `largeEmoji` | `large-emoji` | The emoji size | `boolean` | `false` | +| `name` | `name` | The name of the emoji | `string` | `undefined` | +| `url` | `url` | The emoji URL to use in the message. | `string` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.css b/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.css new file mode 100644 index 0000000..248bd85 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.css @@ -0,0 +1,67 @@ +.discord-embed .discord-embed-description { + font-size: 0.875rem; + font-weight: 400; + grid-column: 1/1; + line-height: 1.125rem; + margin-top: 8px; + min-width: 0; + white-space: pre-line; +} + +.discord-embed .discord-embed-description pre { + margin: 0; + margin-top: 6px; +} + +.discord-embed .discord-embed-description img.emoji { + width: 22px; + height: 22px; +} + +.discord-embed .discord-embed-description blockquote { + position: relative; + padding: 0 8px 0 12px; + margin: 0; +} + +.discord-embed .discord-embed-description blockquote::before { + content: ''; + display: block; + position: absolute; + left: 0; + height: 100%; + width: 4px; + border-radius: 4px; + background-color: #4f545c; +} + +.discord-light-theme .discord-embed-description blockquote::before { + background-color: #c7ccd1; +} + +.discord-embed .discord-embed-description .spoiler { + background-color: #202225; + color: transparent; + cursor: pointer; +} + +.discord-light-theme .discord-embed .discord-embed-description .spoiler { + background-color: #b9bbbe; +} + +.discord-embed .discord-embed-description .spoiler:hover { + background-color: rgba(32, 34, 37, 0.8); +} + +.discord-light-theme .discord-embed .discord-embed-description .spoiler:hover { + background-color: rgba(185, 187, 190, 0.8); +} + +.discord-embed .discord-embed-description .spoiler:active { + color: inherit; + background-color: hsla(0, 0%, 100%, 0.1); +} + +.discord-light-theme .discord-embed .discord-embed-description .spoiler:active { + background-color: rgba(0, 0, 0, 0.1); +} diff --git a/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.tsx b/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.tsx new file mode 100644 index 0000000..508c04d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-description/discord-embed-description.tsx @@ -0,0 +1,28 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-embed-description', + styleUrl: 'discord-embed-description.css' +}) +export class DiscordEmbedDescription implements ComponentInterface { + /** + * The DiscordEmbedDescription element. + */ + @Element() + public el: HTMLElement; + + public render() { + const parent: HTMLDiscordMessagesElement = this.el.parentElement as HTMLDiscordMessagesElement; + + if (parent.tagName.toLowerCase() !== 'div') { + throw new Error('All components must be direct children of .'); + } + + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-embed-description/readme.md b/packages/discord-components-core/src/components/discord-embed-description/readme.md new file mode 100644 index 0000000..f7e754c --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-description/readme.md @@ -0,0 +1,7 @@ +# discord-embed-description + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.css b/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.css new file mode 100644 index 0000000..63669bd --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.css @@ -0,0 +1,38 @@ +.discord-embed .discord-embed-field { + font-size: 0.875rem; + line-height: 1.125rem; + min-width: 0; + font-weight: 400; + grid-column: 1/13; +} + +.discord-embed .discord-embed-field .discord-field-title { + color: #ffffff; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.125rem; + min-width: 0; + margin-bottom: 2px; +} + +.discord-embed .discord-embed-field.discord-inline-field { + flex-grow: 1; + flex-basis: auto; + min-width: 150px; +} + +.discord-light-theme .discord-embed .discord-embed-field .discord-field-title { + color: #747f8d; +} + +.discord-embed-inline-field-3 { + grid-column: 9/13 !important; +} + +.discord-embed-inline-field-2 { + grid-column: 5/9 !important; +} + +.discord-embed-inline-field-1 { + grid-column: 1/5 !important; +} diff --git a/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.tsx b/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.tsx new file mode 100644 index 0000000..398cb98 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-field/discord-embed-field.tsx @@ -0,0 +1,98 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import clsx from 'clsx'; +import type { Emoji } from '../../options'; +import { getGlobalEmojiUrl } from '../../util'; + +@Component({ + tag: 'discord-embed-field', + styleUrl: 'discord-embed-field.css' +}) +export class DiscordEmbedField implements ComponentInterface { + /** + * The DiscordEmbedField element + */ + @Element() + public el: HTMLElement; + + /** + * The field's title. + */ + @Prop() + public fieldTitle!: string; + + /** + * Whether this field should be displayed inline or not. + */ + @Prop() + public inline = false; + + /** + * The index of this inline field + * @remark This defines the position of this inline field. 1 is left, 2 is middle and 3 is right. + * @oneof [1, 2, 3] + * @default 1 + */ + @Prop() + public inlineIndex = 1; + + private validInlineIndices = new Set([1, 2, 3]); + + @Watch('inlineIndex') + public checkInlineIndex(value: DiscordEmbedField['inlineIndex']) { + if (!this.validInlineIndices.has(Number(value))) throw new RangeError('DiscordEmbedField `inlineIndex` prop must be one of: 1, 2, or 3'); + } + + public componentWillRender() { + this.checkInlineIndex(this.inlineIndex); + } + + public render() { + const parent: HTMLDiscordEmbedFieldElement = this.el.parentElement as HTMLDiscordEmbedFieldElement; + + if (parent.tagName.toLowerCase() !== 'discord-embed-fields') { + throw new SyntaxError('All components must be direct children of .'); + } + + const emojiParsedEmbedFieldTitle = this.parseTitle(this.fieldTitle); + + return ( + + {emojiParsedEmbedFieldTitle &&
{[...emojiParsedEmbedFieldTitle]}
} + +
+ ); + } + + private parseTitle(title?: string) { + if (!title) return null; + + const words = title.split(' '); + + return words.map((word: string, idx: number) => { + const emoji = getGlobalEmojiUrl(word) ?? ({} as Emoji); + let el = ''; + if (emoji.name) { + el = ( + + {emoji.name} +   + + ); + } else { + el = idx < words.length - 1 ? `${word} ` : word; + } + return el; + }); + } +} diff --git a/packages/discord-components-core/src/components/discord-embed-field/readme.md b/packages/discord-components-core/src/components/discord-embed-field/readme.md new file mode 100644 index 0000000..f91f2e7 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-field/readme.md @@ -0,0 +1,15 @@ +# discord-embed-field + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------------- | -------------- | ----------------------------------------------------- | --------- | ----------- | +| `fieldTitle` _(required)_ | `field-title` | The field's title. | `string` | `undefined` | +| `inline` | `inline` | Whether this field should be displayed inline or not. | `boolean` | `false` | +| `inlineIndex` | `inline-index` | The index of this inline field | `number` | `1` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.css b/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.css new file mode 100644 index 0000000..a6307cc --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.css @@ -0,0 +1,6 @@ +.discord-embed .discord-embed-fields { + display: grid; + grid-column: 1/1; + margin-top: 8px; + grid-gap: 8px; +} diff --git a/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.tsx b/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.tsx new file mode 100644 index 0000000..6f6f144 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-fields/discord-embed-fields.tsx @@ -0,0 +1,16 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-embed-fields', + styleUrl: 'discord-embed-fields.css' +}) +export class DiscordEmbedFields implements ComponentInterface { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-embed-fields/readme.md b/packages/discord-components-core/src/components/discord-embed-fields/readme.md new file mode 100644 index 0000000..e858a7b --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-fields/readme.md @@ -0,0 +1,7 @@ +# discord-embed-fields + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.css b/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.css new file mode 100644 index 0000000..83a564f --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.css @@ -0,0 +1,31 @@ +.discord-embed-footer { + -webkit-box-align: center; + align-items: center; + color: #dcddde; + display: flex; + font-size: 12px; + line-height: 16px; + font-weight: 500; + grid-column: 1/3; + grid-row: auto/auto; + margin-top: 8px; +} + +.discord-embed-footer .discord-footer-image { + border-radius: 50%; + flex-shrink: 0; + height: 20px; + margin-right: 8px; + width: 20px; +} + +.discord-embed-footer .discord-footer-separator { + color: #dcddde; + font-weight: 500; + display: inline-block; + margin: 0 4px; +} + +.discord-light-theme .discord-embed-footer .discord-footer-separator { + color: #e4e4e4; +} diff --git a/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.tsx b/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.tsx new file mode 100644 index 0000000..7b3f8d8 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-footer/discord-embed-footer.tsx @@ -0,0 +1,58 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import Fragment from '../../Fragment'; +import type { DiscordTimestamp} from '../../util'; +import { handleTimestamp } from '../../util'; + +@Component({ + tag: 'discord-embed-footer', + styleUrl: 'discord-embed-footer.css' +}) +export class DiscordEmbedFooter implements ComponentInterface { + /** + * The DiscordEmbedFooter element. + */ + @Element() + public el: HTMLElement; + + /** + * The image to use next to the footer text. + */ + @Prop() + public footerImage: string; + + /** + * The timestamp to use for the message date. When supplying a string, the format must be `01/31/2000`. + */ + @Prop({ mutable: true, reflect: true }) + public timestamp?: DiscordTimestamp; + + @Watch('timestamp') + public updateTimestamp(value?: DiscordTimestamp): string | null { + if (!value || isNaN(new Date(value).getTime())) return null; + return handleTimestamp(new Date(value)); + } + + public componentWillRender() { + this.timestamp = this.updateTimestamp(this.timestamp); + } + + public render() { + const parent: HTMLDiscordMessagesElement = this.el.parentElement as HTMLDiscordMessagesElement; + + if (parent.tagName.toLowerCase() !== 'div') { + throw new Error('All components must be direct children of .'); + } + + return ( + + {this.footerImage ? : ''} + + + {this.timestamp ? : ''} + {this.timestamp ? {this.timestamp} : ''} + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-embed-footer/readme.md b/packages/discord-components-core/src/components/discord-embed-footer/readme.md new file mode 100644 index 0000000..638cd28 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed-footer/readme.md @@ -0,0 +1,14 @@ +# discord-embed-footer + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | -------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------- | ----------- | +| `footerImage` | `footer-image` | The image to use next to the footer text. | `string` | `undefined` | +| `timestamp` | `timestamp` | The timestamp to use for the message date. When supplying a string, the format must be `01/31/2000`. | `Date \| null \| string \| undefined` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-embed/discord-embed.css b/packages/discord-components-core/src/components/discord-embed/discord-embed.css new file mode 100644 index 0000000..1bae025 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed/discord-embed.css @@ -0,0 +1,185 @@ +.discord-embed { + color: #dcddde; + display: flex; + font-size: 13px; + line-height: 150%; + margin-bottom: 2px; + margin-top: 2px; +} + +.discord-light-theme .discord-embed { + color: #2e3338; +} + +.discord-embed .discord-left-border { + background-color: #202225; + border-radius: 4px 0 0 4px; + flex-shrink: 0; + width: 4px; +} + +.discord-light-theme .discord-embed .discord-left-border { + background-color: #e3e5e8; +} + +.discord-embed .discord-embed-root { + display: grid; + grid-auto-flow: row; + grid-row-gap: 0.25rem; + min-height: 0; + min-width: 0; + text-indent: 0; +} + +.discord-embed .discord-embed-wrapper { + background-color: #2f3136; + max-width: 520px; + border: 1px solid rgba(46, 48, 54, 0.6); + border-radius: 0 4px 4px 0; + justify-self: start; + align-self: start; + display: grid; + box-sizing: border-box; +} + +.discord-light-theme .discord-embed .discord-embed-wrapper { + background-color: rgba(249, 249, 249, 0.3); + border-color: rgba(205, 205, 205, 0.3); +} + +.discord-embed .discord-embed-wrapper .discord-embed-grid { + display: inline-grid; + grid-template-columns: auto -webkit-min-content; + grid-template-columns: auto min-content; + grid-template-columns: auto; + grid-template-rows: auto; + padding: 0.5rem 1rem 1rem 0.75rem; +} + +.discord-embed .discord-embed-thumbnail { + border-radius: 4px; + flex-shrink: 0; + grid-column: 2/2; + grid-row: 1/8; + justify-self: end; + margin-left: 16px; + margin-top: 8px; + max-height: 80px; + max-width: 80px; + object-fit: contain; + object-position: top center; +} + +.discord-embed .discord-embed-author { + -webkit-box-align: center; + align-items: center; + color: #fff; + font-size: 14px; + display: flex; + font-weight: 600; + grid-column: 1 / 1; + margin-top: 8px; + min-width: 0; +} + +.discord-light-theme .discord-embed .discord-embed-author { + color: #4f545c; +} + +.discord-embed .discord-embed-author a { + color: #fff; + font-weight: 600; +} + +.discord-light-theme .discord-embed .discord-embed-author a { + color: #4f545c; +} + +.discord-embed .discord-embed-author .discord-author-image { + border-radius: 50%; + height: 24px; + margin-right: 8px; + width: 24px; +} + +.discord-embed .discord-embed-provider { + font-size: 0.75rem; + line-height: 1rem; + font-weight: 400; + grid-column: 1/1; + margin-top: 8px; + unicode-bidi: plaintext; + text-align: left; +} + +.discord-light-theme .discord-embed .discord-embed-provider { + color: #4f545c; +} + +.discord-embed .discord-embed-title { + -webkit-box-align: center; + align-items: center; + color: #fff; + display: inline-block; + font-size: 1rem; + font-weight: 600; + grid-column: 1 / 1; + margin-top: 8px; + min-width: 0; +} + +.discord-embed .discord-embed-title a { + color: #00aff4; + font-weight: 600; +} + +.discord-embed .discord-embed-image { + border-radius: 4px; + max-width: 100%; +} + +.discord-embed .discord-embed-media { + border-radius: 4px; + contain: paint; + display: block; + grid-column: 1/1; + margin-top: 16px; +} + +.discord-embed .discord-embed-media.discord-embed-media-video { + height: 225px; +} + +.discord-embed .discord-embed.media .discord-embed-image { + overflow: hidden; + position: relative; + user-select: text; +} + +.discord-embed .discord-embed-media .discord-embed-video { + -webkit-box-align: center; + -webkit-box-pack: center; + align-items: center; + border-radius: 0; + cursor: pointer; + display: flex; + height: 100%; + justify-content: center; + max-height: 100%; + width: 100%; + + width: 400px; + height: 225px; + left: 0px; + top: 0px; +} + +.discord-embed-custom-emoji { + display: inline-block; +} + +.discord-embed-custom-emoji .discord-embed-custom-emoji-image { + width: 18px; + height: 18px; + vertical-align: bottom; +} diff --git a/packages/discord-components-core/src/components/discord-embed/discord-embed.tsx b/packages/discord-components-core/src/components/discord-embed/discord-embed.tsx new file mode 100644 index 0000000..82b1737 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed/discord-embed.tsx @@ -0,0 +1,195 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Prop, State } from '@stencil/core'; +import clsx from 'clsx'; +import Fragment from '../../Fragment'; +import type { Emoji } from '../../options'; +import { getGlobalEmojiUrl } from '../../util'; + +@Component({ + tag: 'discord-embed', + styleUrl: 'discord-embed.css' +}) +export class DiscordEmbed implements ComponentInterface { + /** + * The DiscordEmbed element. + */ + @Element() + public el: HTMLElement; + + /** + * The color to use for the embed's left border. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + @Prop() + public color: string; + + /** + * The author's name. + */ + @Prop() + public authorName: string; + + /** + * The author's avatar URL. + */ + @Prop() + public authorImage: string; + + /** + * The URL to open when you click on the author's name. + */ + @Prop() + public authorUrl: string; + + /** + * The embed title. + */ + @Prop() + public embedTitle: string; + + /** + * The URL to open when you click on the embed title. + */ + @Prop() + public url: string; + + /** + * The thumbnail image to use. + */ + @Prop() + public thumbnail: string; + + /** + * The embed image to use (displayed at the bottom). + */ + @Prop() + public image: string; + + /** + * The embed video to use (displayed at the bottom, same slot as the image). + * @important YouTube videos will not be playable on your projects, this is due to YouTube using DASH to play their videos rather + * than providing the raw media stream (in a container such as mp4 or ogg). Links to regular MP4 files (such as on a CDN) however + * will autoplay! + * @note Video takes priority over image. + * @remark Providing both a video and an image will ensure the image is shown to users with browsers + * that do not support HTML5 video playback. + * @example https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg + */ + @Prop() + public video: string; + + /** + * The provider to show above the embed, for example for YouTube videos it will show "YouTube" at the top of the embed (above the author) + * @example YouTube + */ + @Prop() + public provider: string; + + private hasPerformedRerenderChecks: 'dirty' | 'pristine' = 'pristine'; + + @State() + private hasProvidedDescriptionSlot = true; + + public componentDidRender() { + if (this.hasPerformedRerenderChecks === 'pristine') { + try { + const discordEmbedDescriptionChild = this.el.querySelector('.discord-embed-description'); + this.hasProvidedDescriptionSlot = Boolean(discordEmbedDescriptionChild?.innerHTML.trim()); + } finally { + this.hasPerformedRerenderChecks = 'dirty'; + } + } + } + + public render() { + const emojiParsedAuthorName = this.parseTitle(this.authorName); + const emojiParsedEmbedTitle = this.parseTitle(this.embedTitle); + + return ( +
+
+
+
+
+ {this.provider && ( +
+ {this.provider} +
+ )} + {emojiParsedAuthorName && ( +
+ {this.authorImage ? : ''} + {this.authorUrl ? ( + + {...emojiParsedAuthorName} + + ) : ( + {...emojiParsedAuthorName} + )} +
+ )} + {emojiParsedEmbedTitle && ( +
+ {this.url ? ( + + {...emojiParsedEmbedTitle} + + ) : ( + {...emojiParsedEmbedTitle} + )} +
+ )} + + {this.hasProvidedDescriptionSlot && } + + + {this.image || this.video ? ( +
+ {this.renderMedia()} +
+ ) : null} + + {this.thumbnail ? : ''} + +
+
+
+
+ ); + } + + private renderMedia() { + if (this.video) { + return ( + + ); + } else if (this.image) { + return Discord embed media; + } + + return null; + } + + private parseTitle(title?: string) { + if (!title) return null; + + const words = title.split(' '); + + return words.map((word: string, idx: number) => { + const emoji = getGlobalEmojiUrl(word) ?? ({} as Emoji); + let el = ''; + if (emoji.name) { + el = ( + + {emoji.name} +   + + ); + } else { + el = idx < words.length - 1 ? `${word} ` : word; + } + return el; + }); + } +} diff --git a/packages/discord-components-core/src/components/discord-embed/readme.md b/packages/discord-components-core/src/components/discord-embed/readme.md new file mode 100644 index 0000000..daa6a8a --- /dev/null +++ b/packages/discord-components-core/src/components/discord-embed/readme.md @@ -0,0 +1,22 @@ +# discord-embed + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------- | +| `authorImage` | `author-image` | The author's avatar URL. | `string` | `undefined` | +| `authorName` | `author-name` | The author's name. | `string` | `undefined` | +| `authorUrl` | `author-url` | The URL to open when you click on the author's name. | `string` | `undefined` | +| `color` | `color` | The color to use for the embed's left border. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). | `string` | `undefined` | +| `embedTitle` | `embed-title` | The embed title. | `string` | `undefined` | +| `image` | `image` | The embed image to use (displayed at the bottom). | `string` | `undefined` | +| `provider` | `provider` | The provider to show above the embed, for example for YouTube videos it will show "YouTube" at the top of the embed (above the author) | `string` | `undefined` | +| `thumbnail` | `thumbnail` | The thumbnail image to use. | `string` | `undefined` | +| `url` | `url` | The URL to open when you click on the embed title. | `string` | `undefined` | +| `video` | `video` | The embed video to use (displayed at the bottom, same slot as the image). | `string` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-header/discord-header.css b/packages/discord-components-core/src/components/discord-header/discord-header.css new file mode 100644 index 0000000..e383a53 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-header/discord-header.css @@ -0,0 +1,40 @@ +.discord-header { + display: flex; + flex-direction: row; + max-height: 5rem; + padding: 0.5rem; + gap: 0.5rem; + border-bottom: 1px solid rgba(79, 84, 92, 0.48); +} + +.discord-header-icon { + float: left; + width: 5rem; +} + +.discord-header-icon > div { + background-color: rgb(79, 84, 92); + border-radius: 50%; + width: 5rem; + height: 5rem; + text-align: center; + align-items: center; + justify-content: center; + display: flex; + font-size: xx-large; +} + +.discord-header-icon > img { + border-radius: 50%; + width: auto; + height: 100%; +} + +.discord-header-text { + flex-grow: 1; +} + +.discord-header-text-guild { + font-size: 1.5rem; + font-weight: bold; +} diff --git a/packages/discord-components-core/src/components/discord-header/discord-header.tsx b/packages/discord-components-core/src/components/discord-header/discord-header.tsx new file mode 100644 index 0000000..24fcd4b --- /dev/null +++ b/packages/discord-components-core/src/components/discord-header/discord-header.tsx @@ -0,0 +1,55 @@ +import type { ComponentInterface } from '@stencil/core'; +import { Component, Host, h, Prop } from '@stencil/core'; + +@Component({ + tag: 'discord-header', + styleUrl: 'discord-header.css' +}) +export class DiscordHeader implements ComponentInterface { + /** + * The guild name + */ + @Prop() + public guild: string; + + /** + * The name of the channel + */ + @Prop() + public channel: string; + + /** + * The icon to display. + */ + @Prop() + public icon?: string; + + public render() { + return ( + +
+ { + // if no guild icon, create one using the first letter of the guild name + this.icon ? ( + guild icon + ) : ( +
+ + {(() => { + const split = this.guild.split(' '); + return split.length > 1 ? split[0][0] + split[1][0] : split[0][0]; + })()} + +
+ ) + } +
+
+
{this.guild}
+
#{this.channel}
+ +
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-header/readme.md b/packages/discord-components-core/src/components/discord-header/readme.md new file mode 100644 index 0000000..f03677e --- /dev/null +++ b/packages/discord-components-core/src/components/discord-header/readme.md @@ -0,0 +1,15 @@ +# discord-code-block + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| --------- | --------- | ----------------------- | --------------------- | ----------- | +| `channel` | `channel` | The name of the channel | `string` | `undefined` | +| `guild` | `guild` | The guild name | `string` | `undefined` | +| `icon` | `icon` | The icon to display. | `string \| undefined` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-inline-code/discord-inline-code.tsx b/packages/discord-components-core/src/components/discord-inline-code/discord-inline-code.tsx new file mode 100644 index 0000000..922e132 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-inline-code/discord-inline-code.tsx @@ -0,0 +1,14 @@ +import { Component, h } from '@stencil/core'; + +@Component({ + tag: 'discord-inline-code' +}) +export class DiscordInlineCode { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-inline-code/readme.md b/packages/discord-components-core/src/components/discord-inline-code/readme.md new file mode 100644 index 0000000..c06da72 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-inline-code/readme.md @@ -0,0 +1,7 @@ +# discord-inline-code + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-invite/discord-invite.css b/packages/discord-components-core/src/components/discord-invite/discord-invite.css new file mode 100644 index 0000000..a3cacdb --- /dev/null +++ b/packages/discord-components-core/src/components/discord-invite/discord-invite.css @@ -0,0 +1,180 @@ +.discord-invite { + background-color: #2f3136; + border-radius: 4px; + padding: 16px; + width: 432px; +} + +.discord-light-theme .discord-invite { + background-color: #f2f3f5; +} + +.discord-invite .discord-invite-header { + font-weight: 700; + font-size: 12px; + line-height: 16px; + margin-bottom: 12px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-transform: uppercase; + color: #b9bbbe; +} + +.discord-light-theme .discord-invite .discord-invite-header { + color: #4f5660; +} + +.discord-invite .discord-invite-root { + display: flex; + flex-flow: row nowrap; +} + +.discord-invite .discord-invite-icon { + background-color: #36393f; + border-radius: 15px; + margin-right: 16px; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: 50px; + height: 50px; +} + +.discord-light-theme .discord-invite .discord-invite-icon { + background-color: #fff; +} + +.discord-invite .discord-invite-info { + font-family: Whitney, 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, 'system-ui', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + display: flex; + flex: 1 1 auto; + flex-direction: column; + flex-wrap: nowrap; + align-items: stretch; + justify-content: center; +} + +.discord-invite .discord-invite-title { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + margin-bottom: 2px; + color: white; + font-size: 16px; + line-height: 20px; + font-weight: 700; + display: flex; + flex-direction: row; +} + +.discord-light-theme .discord-invite .discord-invite-title { + color: #060607; +} + +.discord-invite .discord-invite-name { + flex: 1 1 auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.discord-invite .discord-invite-counts { + display: flex; + align-items: center; + font-size: 14px; + font-weight: 600; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + color: #b9bbbe; + line-height: 16px; +} + +.discord-invite .discord-invite-status { + display: block; + margin-right: 4px; + width: 8px; + height: 8px; + border-radius: 50%; + background-color: #747f8d; +} + +.discord-invite .discord-invite-status-online { + background-color: #3ba55d; +} + +.discord-invite .discord-invite-count { + -webkit-box-flex: 0; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + margin-right: 8px; + color: #b9bbbe; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.discord-invite .discord-invite-join { + display: flex; + justify-content: center; + align-items: center; + height: 40px; + padding: 0 20px; + align-self: center; + margin-left: 10px; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + line-height: 20px; + border-radius: 3px; + font-size: 14px; + font-weight: 600; + color: white !important; + background-color: #3ba55d; + -webkit-transition: background-color 0.17s ease; + transition: background-color 0.17s ease; +} + +.discord-invite .discord-invite-join:hover { + background-color: #2d7d46; + text-decoration: none; +} + +.discord-invite .discord-invite-badge { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + margin-right: 8px; + width: 16px; + height: 16px; + align-self: center; + position: relative; +} + +.discord-invite .discord-invite-badge-verified { + color: #3ba55d; +} + +.discord-invite .discord-invite-badge-partnered { + color: #5865f2; +} + +.discord-invite .discord-invite-badge-container { + position: absolute; + top: -0.05px; + left: 0.05px; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + pointer-events: none; + color: white; +} + +.discord-light-theme .discord-invite .discord-invite-counts, +.discord-light-theme .discord-invite .discord-invite-count { + color: #4f5660; +} diff --git a/packages/discord-components-core/src/components/discord-invite/discord-invite.tsx b/packages/discord-components-core/src/components/discord-invite/discord-invite.tsx new file mode 100644 index 0000000..b24bb77 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-invite/discord-invite.tsx @@ -0,0 +1,115 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Prop } from '@stencil/core'; +import { defaultDiscordAvatars } from '../../options'; +import GuildBadge from '../svgs/guild-badge'; +import PartnerBadgeOverlay from '../svgs/partner-badge-overlay'; +import VerifiedBadgeOverlay from '../svgs/verified-badge-overlay'; + +@Component({ + tag: 'discord-invite', + styleUrl: 'discord-invite.css' +}) +export class DiscordInvite implements ComponentInterface { + /** + * The DiscordInvite element. + */ + @Element() + public el: HTMLElement; + + /** + * The server icon to display for the invite. + */ + @Prop() + public icon = defaultDiscordAvatars.blue; + + /** + * The server's name. + * @default 'Discord Server' + */ + @Prop() + public name = 'Discord Server'; + + /** + * The URL to open when you click on the join button. + */ + @Prop() + public url: string; + + /** + * The number of members online on the server. + * @default 0 + */ + @Prop() + public online = 0; + + /** + * The number of members on the server. + * @default 0 + */ + @Prop() + public members = 0; + + /** + * Whether the server is verified. + * Only works if `partnered` is `false` or `undefined`. + */ + @Prop() + public verified = false; + + /** + * Whether the server is partnered. + * Only works if `verified` is `false` or `undefined`. + */ + @Prop() + public partnered = false; + + /** + * Invitation embed title. + * @default "You've been invited to join a server" + */ + @Prop() + public inviteTitle = "You've been invited to join a server"; + + /** + * The join button. + * @default 'Join' + */ + @Prop() + public joinBtn = 'Join'; + + public render() { + return ( +
+
{this.inviteTitle}
+
+ {this.name} +
+
+ {((this.verified && !this.partnered) || (!this.verified && this.partnered)) && ( +
+ +
+ {this.partnered ? : } +
+
+ )} + {this.name} +
+
+ + {this.online.toLocaleString()} Online + + {this.members.toLocaleString()} Members +
+
+ + {this.joinBtn} + +
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-invite/readme.md b/packages/discord-components-core/src/components/discord-invite/readme.md new file mode 100644 index 0000000..8b99cfd --- /dev/null +++ b/packages/discord-components-core/src/components/discord-invite/readme.md @@ -0,0 +1,21 @@ +# discord-invite + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | -------------- | ------------------------------------------------------------------------------------ | --------------------- | ---------------------------------------- | +| `icon` | `icon` | The server icon to display for the invite. | `string \| undefined` | `defaultDiscordAvatars.blue` | +| `inviteTitle` | `invite-title` | Invitation embed title. | `string` | `"You've been invited to join a server"` | +| `joinBtn` | `join-btn` | The join button. | `string` | `'Join'` | +| `members` | `members` | The number of members on the server. | `number` | `0` | +| `name` | `name` | The server's name. | `string` | `'Discord Server'` | +| `online` | `online` | The number of members online on the server. | `number` | `0` | +| `partnered` | `partnered` | Whether the server is partnered. Only works if `verified` is `false` or `undefined`. | `boolean` | `false` | +| `url` | `url` | The URL to open when you click on the join button. | `string` | `undefined` | +| `verified` | `verified` | Whether the server is verified. Only works if `partnered` is `false` or `undefined`. | `boolean` | `false` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-italic/discord-italic.tsx b/packages/discord-components-core/src/components/discord-italic/discord-italic.tsx new file mode 100644 index 0000000..e203ab3 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-italic/discord-italic.tsx @@ -0,0 +1,14 @@ +import { Component, h } from '@stencil/core'; + +@Component({ + tag: 'discord-italic' +}) +export class DiscordItalic { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-italic/readme.md b/packages/discord-components-core/src/components/discord-italic/readme.md new file mode 100644 index 0000000..83b1a8c --- /dev/null +++ b/packages/discord-components-core/src/components/discord-italic/readme.md @@ -0,0 +1,7 @@ +# discord-italic + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-mention/discord-mention.css b/packages/discord-components-core/src/components/discord-mention/discord-mention.css new file mode 100644 index 0000000..1652708 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-mention/discord-mention.css @@ -0,0 +1,49 @@ +.discord-message .discord-mention { + color: #e3e7f8; + background-color: hsla(235, 85.6%, 64.7%, 0.3); + font-weight: 500; + padding: 0 2px; + border-radius: 3px; + unicode-bidi: -moz-plaintext; + unicode-bidi: plaintext; + -webkit-transition: background-color 50ms ease-out, color 50ms ease-out; + transition: background-color 50ms ease-out, color 50ms ease-out; + cursor: pointer; +} + +.discord-message .discord-mention:hover { + color: #fff; + background-color: hsl(235, 85.6%, 64.7%); +} + +.discord-message .discord-mention.discord-channel-mention { + padding-left: 1.2rem !important; + position: relative; +} + +.discord-message .discord-mention.discord-voice-mention, +.discord-message .discord-mention.discord-locked-mention, +.discord-message .discord-mention.discord-thread-mention, +.discord-message .discord-mention.discord-forum-mention { + padding-left: 1.25rem !important; + position: relative; +} + +.discord-light-theme .discord-message .discord-mention { + color: #687dc6; + background-color: hsla(235, 85.6%, 64.7%, 0.15); +} + +.discord-light-theme .discord-message .discord-mention:hover { + color: #ffffff; + background-color: hsl(235, 85.6%, 64.7%); +} + +.discord-message .discord-mention .discord-mention-icon { + width: 1rem; + height: 1rem; + object-fit: contain; + position: absolute; + left: 0.125rem; + top: 0.125rem; +} diff --git a/packages/discord-components-core/src/components/discord-mention/discord-mention.tsx b/packages/discord-components-core/src/components/discord-mention/discord-mention.tsx new file mode 100644 index 0000000..bfef18a --- /dev/null +++ b/packages/discord-components-core/src/components/discord-mention/discord-mention.tsx @@ -0,0 +1,119 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import hexToRgba from 'hex-to-rgba'; +import ChannelForum from '../svgs/channel-forum'; +import ChannelIcon from '../svgs/channel-icon'; +import ChannelThread from '../svgs/channel-thread'; +import LockedVoiceChannel from '../svgs/locked-voice-channel'; +import VoiceChannel from '../svgs/voice-channel'; + +@Component({ + tag: 'discord-mention', + styleUrl: 'discord-mention.css' +}) +export class DiscordMention implements ComponentInterface { + /** + * The DiscordMention element + */ + @Element() + public el: HTMLElement; + + /** + * Whether this entire message block should be highlighted (to emulate the "logged in user" being pinged). + */ + @Prop() + public highlight = false; + + /** + * The color to use for this mention. Only works for role mentions and must be in hex format. + */ + @Prop() + public color: string; + + /** + * The type of mention this should be. This will prepend the proper prefix character. + * Valid values: `user`, `channel`, `role`, `voice`, `locked`, `thread`, `forum`, and `slash`. + */ + @Prop() + public type: 'user' | 'channel' | 'role' | 'voice' | 'locked' | 'thread' | 'forum' | 'slash' = 'user'; + + @Watch('type') + public handleType(value: string) { + if (typeof value !== 'string') { + throw new TypeError('DiscordMention `type` prop must be a string.'); + } else if (!['user', 'channel', 'role', 'voice', 'locked', 'thread', 'forum', 'slash'].includes(value)) { + throw new RangeError( + "DiscordMention `type` prop must be one of: 'user', 'channel', 'role', 'voice', 'locked', 'thread', 'forum', 'slash'" + ); + } + } + + public componentWillRender() { + this.handleType(this.type); + } + + public componentDidLoad() { + if (this.color && this.type === 'role') { + this.el.addEventListener('mouseover', this.setHoverColor.bind(this)); + this.el.addEventListener('mouseout', this.resetHoverColor.bind(this)); + } + } + + public disconnectedCallback() { + if (this.color && this.type === 'role') { + this.el.removeEventListener('mouseover', this.setHoverColor.bind(this)); + this.el.removeEventListener('mouseout', this.resetHoverColor.bind(this)); + } + } + + public setHoverColor() { + this.el.style.backgroundColor = hexToRgba(this.color, 0.3); + } + + public resetHoverColor() { + this.el.style.backgroundColor = hexToRgba(this.color, 0.1); + } + + public render() { + const { color, type }: { color?: string; type?: string } = this; + + const colorStyle: { + color?: string; + 'background-color'?: string; + } = !color || type !== 'role' ? {} : { color, 'background-color': hexToRgba(color, 0.1) }; + + let mentionPrepend = ''; + + switch (this.type) { + case 'channel': + mentionPrepend = ; + break; + case 'user': + case 'role': + mentionPrepend = '@'; + break; + case 'voice': + mentionPrepend = ; + break; + case 'locked': + mentionPrepend = ; + break; + case 'thread': + mentionPrepend = ; + break; + case 'forum': + mentionPrepend = ; + break; + case 'slash': + mentionPrepend = '/'; + break; + } + + return ( + + {mentionPrepend} + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-mention/readme.md b/packages/discord-components-core/src/components/discord-mention/readme.md new file mode 100644 index 0000000..bd40810 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-mention/readme.md @@ -0,0 +1,15 @@ +# discord-mention + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ----------- | +| `color` | `color` | The color to use for this mention. Only works for role mentions and must be in hex format. | `string` | `undefined` | +| `highlight` | `highlight` | Whether this entire message block should be highlighted (to emulate the "logged in user" being pinged). | `boolean` | `false` | +| `type` | `type` | The type of mention this should be. This will prepend the proper prefix character. Valid values: `user`, `channel`, `role`, `voice`, `locked`, `thread`, `forum`, and `slash`. | `"channel" \| "forum" \| "locked" \| "role" \| "slash" \| "thread" \| "user" \| "voice"` | `'user'` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-message/discord-message.css b/packages/discord-components-core/src/components/discord-message/discord-message.css new file mode 100644 index 0000000..0d988de --- /dev/null +++ b/packages/discord-components-core/src/components/discord-message/discord-message.css @@ -0,0 +1,290 @@ +.discord-message { + color: #dcddde; + display: flex; + flex-direction: column; + font-size: 0.9em; + font-family: Whitney, 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, 'system-ui', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + padding: 0px 1em; + + position: relative; + word-wrap: break-word; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: 0; + min-height: 1.375rem; + padding-right: 48px !important; + margin-top: 1.0625rem; +} + +.discord-message .discord-message-inner { + display: flex; + position: relative; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; +} + +.discord-message.discord-highlight-mention, +.discord-message.discord-highlight-ephemeral { + padding-right: 5px; + position: relative; +} + +.discord-message.discord-highlight-mention::before, +.discord-message.discord-highlight-ephemeral::before { + content: ''; + position: absolute; + display: block; + top: 0; + left: 0; + bottom: 0; + pointer-events: none; + width: 2px; +} + +.discord-message.discord-highlight-mention { + background-color: rgba(250, 166, 26, 0.1); +} + +.discord-light-theme .discord-message.discord-highlight-mention { + background-color: rgba(250, 166, 26, 0.1); +} + +.discord-message.discord-highlight-mention:hover { + background-color: rgba(250, 166, 26, 0.08); +} + +.discord-light-theme .discord-message.discord-highlight-mention:hover { + background-color: rgba(250, 166, 26, 0.2); +} + +.discord-message.discord-highlight-mention::before { + background-color: #faa61a; +} + +.discord-message.discord-highlight-ephemeral { + background-color: rgba(88, 101, 242, 0.05); +} + +.discord-light-theme .discord-message.discord-highlight-ephemeral { + background-color: rgba(250, 166, 26, 0.1); +} + +.discord-message.discord-highlight-ephemeral:hover { + background-color: rgba(88, 101, 242, 0.1); +} + +.discord-message.discord-highlight-ephemeral::before { + background-color: #5865f2; +} + +.discord-light-theme .discord-message { + color: #2e3338; + border-color: #eceeef; +} + +.discord-message a { + color: #00aff4; + font-weight: normal; + text-decoration: none; +} + +.discord-message a:hover { + text-decoration: underline; +} + +.discord-light-theme .discord-message a { + color: #00b0f4; +} + +.discord-message a:hover { + text-decoration: underline; +} + +.discord-message .discord-author-avatar { + margin-right: 16px; + margin-top: 5px; + min-width: 40px; + z-index: 1; +} + +.discord-message .discord-author-avatar img { + width: 40px; + height: 40px; + border-radius: 50%; +} + +.discord-message .discord-message-timestamp { + color: #72767d; + font-size: 12px; + margin-left: 3px; +} + +.discord-light-theme .discord-message .discord-message-timestamp { + color: #747f8d; +} + +.discord-message .discord-message-edited { + color: #72767d; + font-size: 10px; +} + +.discord-light-theme .discord-message .discord-message-edited { + color: #99aab5; +} + +.discord-message .discord-message-content { + width: 100%; + line-height: 160%; + font-weight: normal; + padding-top: 2px; +} + +.discord-message .discord-message-body { + font-size: 1rem; + font-weight: 400; + word-break: break-word; + position: relative; +} + +.discord-message .discord-message-body strong { + font-weight: 700; +} + +.discord-message .discord-message-body em { + font-style: italic; +} + +.discord-message .discord-message-body u { + text-decoration-color: rgb(220, 221, 222); + text-decoration-line: underline; + text-decoration-style: solid; + text-decoration-thickness: auto; +} + +.discord-message .discord-message-body pre { + border: 1px solid #202225; + border-radius: 4px; +} + +.discord-message .discord-message-body code { + background: #2f3136; + white-space: break-spaces; + font-family: Consolas, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, + Liberation Mono, Nimbus Mono L, Monaco, Courier New, Courier, monospace; +} + +.discord-light-theme .discord-message .discord-message-timestamp, +.discord-compact-mode .discord-message:hover .discord-message-timestamp, +.discord-compact-mode.discord-light-theme .discord-message:hover .discord-message-timestamp { + color: #99aab5; +} + +.discord-compact-mode.discord-light-theme .discord-message .discord-message-timestamp { + color: #d1d9de; +} + +.discord-compact-mode .discord-message .discord-message-timestamp { + display: inline-block; + width: 3.1rem; + text-align: right; + font-size: 0.6875rem; + line-height: 1.375rem; + margin-right: 0.25rem; + margin-left: 0; + text-indent: 0; +} + +.discord-compact-mode .discord-message { + margin-top: unset; +} + +.discord-compact-mode .discord-message .discord-message-body { + line-height: 1.375rem; + padding-left: 10px; + text-indent: -6px; +} + +.discord-compact-mode .discord-message .discord-message-compact-indent { + padding-left: 10px; +} + +.discord-message:first-child { + margin-top: 0.5rem; +} + +.discord-message:last-child { + margin-bottom: 0.5rem; + border-bottom-width: 0; +} + +.discord-message .discord-message-markup { + font-size: 1rem; + line-height: 1.375rem; + word-wrap: break-word; + user-select: text; + font-weight: 400; +} + +.discord-compact-mode .discord-author-avatar { + display: none; +} + +.discord-message:hover { + background-color: rgba(4, 4, 5, 0.07); +} + +.discord-light-theme .discord-message:hover { + background-color: rgba(6, 6, 7, 0.02); +} + +.discord-message.discord-message-has-thread:after { + width: 2rem; + left: 2.2rem; + top: 1.75rem; + border-left: 2px solid #4f545c; + border-bottom: 2px solid #4f545c; + border-bottom-left-radius: 8px; + bottom: 29px; + content: ''; + position: absolute; +} + +.discord-light-theme .discord-message.discord-message-has-thread:after { + border-color: #747f8d; +} + +.discord-message-ephemeral { + color: #72767d; + margin-top: 4px; + font-size: 12px; + font-weight: 400; + color: #72767d; +} + +.discord-light-theme .discord-message-ephemeral { + color: #747f8d; +} + +.discord-message-ephemeral .discord-message-ephemeral-link { + color: #00aff4; + font-weight: 500; + cursor: pointer; +} + +.discord-message-ephemeral .discord-message-ephemeral-link:hover { + text-decoration: underline; +} + +.discord-message-ephemeral .discord-message-ephemeral-icon { + margin-right: 4px; + vertical-align: text-bottom; +} + +@import '../author-info/author-info.css'; diff --git a/packages/discord-components-core/src/components/discord-message/discord-message.tsx b/packages/discord-components-core/src/components/discord-message/discord-message.tsx new file mode 100644 index 0000000..2da1c24 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-message/discord-message.tsx @@ -0,0 +1,228 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import clsx from 'clsx'; +import Fragment from '../../Fragment'; +import type { Profile} from '../../options'; +import { avatars, profiles } from '../../options'; +import type { DiscordTimestamp} from '../../util'; +import { handleTimestamp } from '../../util'; +import { AuthorInfo } from '../author-info/author-info'; +import Ephemeral from '../svgs/ephemeral'; + +@Component({ + tag: 'discord-message', + styleUrl: 'discord-message.css' +}) +export class DiscordMessage implements ComponentInterface { + /** + * The DiscordMessage element. + */ + @Element() + public el: HTMLElement; + + /** + * The id of the profile data to use. + */ + @Prop() + public profile: string; + + /** + * The message author's username. + * @default 'User' + */ + @Prop() + public author = 'User'; + + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + @Prop() + public avatar: string; + + /** + * Whether the message author is a bot or not. + * Only works if `server` is `false` or `undefined`. + */ + @Prop() + public bot = false; + + /** + * Whether the message author is a server crosspost webhook or not. + * Only works if `bot` is `false` or `undefined`. + */ + @Prop() + public server = false; + + /** + * Whether the bot is verified or not. + * Only works if `bot` is `true` + */ + @Prop() + public verified = false; + + /** + * Whether the author is the original poster. + */ + @Prop() + public op = false; + + /** + * Whether the message has been edited or not. + */ + @Prop() + public edited = false; + + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + @Prop() + public roleColor: string; + + /** + * The message author's role icon URL. + */ + @Prop() + public roleIcon: string; + + /** + * The name of the role to use as alternative image text. + */ + @Prop() + public roleName: string; + + /** + * Whether to highlight this message. + */ + @Prop() + public highlight = false; + + /** + * Whether to make this message ephemeral. + */ + @Prop() + public ephemeral = false; + + /** + * The timestamp to use for the message date. + */ + @Prop({ mutable: true, reflect: true }) + public timestamp: DiscordTimestamp = new Date(); + + /** + * Whether to use 24-hour format for the timestamp. + */ + @Prop() + public twentyFour = false; + + @Watch('timestamp') + public updateTimestamp(value: DiscordTimestamp): string | null { + return handleTimestamp(value, this.twentyFour); + } + + public componentWillRender() { + this.timestamp = handleTimestamp(this.timestamp, this.twentyFour); + } + + public render() { + const parent: HTMLDiscordMessagesElement = this.el.parentElement as HTMLDiscordMessagesElement; + + if (parent.tagName.toLowerCase() !== 'discord-messages') { + throw new Error('All components must be direct children of .'); + } + + const resolveAvatar = (avatar: string): string => avatars[avatar] ?? avatar ?? avatars.default; + + const defaultData: Profile = { + author: this.author, + bot: this.bot, + verified: this.verified, + server: this.server, + op: this.op, + roleColor: this.roleColor, + roleIcon: this.roleIcon, + roleName: this.roleName + }; + const profileData: Profile = Reflect.get(profiles, this.profile) ?? {}; + const profile: Profile = { ...defaultData, ...profileData, ...{ avatar: resolveAvatar(profileData.avatar ?? this.avatar) } }; + + const highlightMention: boolean = + // @ts-expect-error ts doesn't understand this + Array.from(this.el.children).some((child: HTMLDiscordMentionElement): boolean => { + return child.tagName.toLowerCase() === 'discord-mention' && child.highlight && ['user', 'role'].includes(child.type); + }) || this.highlight; + + const hasThread: boolean = + // @ts-expect-error ts doesn't understand this + Array.from(this.el.children).some((child: HTMLDiscordThreadElement): boolean => { + return child.tagName.toLowerCase() === 'discord-thread'; + }); + + return ( + + +
+ {parent.compactMode && {this.timestamp}} +
+ {profile.author} +
+
+ {!parent.compactMode && ( + + + {this.timestamp} + + )} +
+ {parent.compactMode && ( + + )} + + + + {this.edited ? (edited) : ''} +
+
+ + + + + + {this.ephemeral && ( +
+ + Only you can see this • Dismiss message +
+ )} +
+
+
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-message/readme.md b/packages/discord-components-core/src/components/discord-message/readme.md new file mode 100644 index 0000000..5c4e3dc --- /dev/null +++ b/packages/discord-components-core/src/components/discord-message/readme.md @@ -0,0 +1,27 @@ +# discord-message + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------ | +| `author` | `author` | The message author's username. | `string` | `'User'` | +| `avatar` | `avatar` | The message author's avatar. Can be an avatar shortcut, relative path, or external link. | `string` | `undefined` | +| `bot` | `bot` | Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. | `boolean` | `false` | +| `edited` | `edited` | Whether the message has been edited or not. | `boolean` | `false` | +| `ephemeral` | `ephemeral` | Whether to make this message ephemeral. | `boolean` | `false` | +| `highlight` | `highlight` | Whether to highlight this message. | `boolean` | `false` | +| `op` | `op` | Whether the author is the original poster. | `boolean` | `false` | +| `profile` | `profile` | The id of the profile data to use. | `string` | `undefined` | +| `roleColor` | `role-color` | The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). | `string` | `undefined` | +| `roleIcon` | `role-icon` | The message author's role icon URL. | `string` | `undefined` | +| `roleName` | `role-name` | The name of the role to use as alternative image text. | `string` | `undefined` | +| `server` | `server` | Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. | `boolean` | `false` | +| `timestamp` | `timestamp` | The timestamp to use for the message date. | `Date \| null \| string` | `new Date()` | +| `twentyFour` | `twenty-four` | Whether to use 24-hour format for the timestamp. | `boolean` | `false` | +| `verified` | `verified` | Whether the bot is verified or not. Only works if `bot` is `true` | `boolean` | `false` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-messages/discord-messages.css b/packages/discord-components-core/src/components/discord-messages/discord-messages.css new file mode 100644 index 0000000..570c86d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-messages/discord-messages.css @@ -0,0 +1,48 @@ +@import url('https://fonts.bunny.net/css?family=roboto:400,500,700'); + +/* New Whitney fonts to match rebrading */ +@font-face { + font-family: 'Whitney'; + src: url('https://cdn.jsdelivr.net/gh/ItzDerock/discord-components@master/assets/fonts/Book.woff') format('woff'); + font-weight: 400; + font-display: swap; +} +@font-face { + font-family: 'Whitney'; + src: url('https://cdn.jsdelivr.net/gh/ItzDerock/discord-components@master/assets/fonts/Medium.woff') format('woff'); + font-weight: 500; + font-display: swap; +} +@font-face { + font-family: 'Whitney'; + src: url('https://cdn.jsdelivr.net/gh/ItzDerock/discord-components@master/assets/fonts/Semibold.woff') format('woff'); + font-weight: 600; + font-display: swap; +} +@font-face { + font-family: 'Whitney'; + src: url('https://cdn.jsdelivr.net/gh/ItzDerock/discord-components@master/assets/fonts/Bold.woff') format('woff'); + font-weight: 700; + font-display: swap; +} + +.discord-messages { + color: #fff; + background-color: #36393e; + display: block; + font-size: 16px; + font-family: Whitney, 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, 'system-ui', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + line-height: 170%; + border: 1px solid rgba(255, 255, 255, 0.05); +} + +.discord-messages.discord-light-theme { + color: #747f8d; + background-color: #fff; + border-color: #dedede; +} + +.discord-messages.discord-no-background { + background-color: unset; +} diff --git a/packages/discord-components-core/src/components/discord-messages/discord-messages.tsx b/packages/discord-components-core/src/components/discord-messages/discord-messages.tsx new file mode 100644 index 0000000..614acfc --- /dev/null +++ b/packages/discord-components-core/src/components/discord-messages/discord-messages.tsx @@ -0,0 +1,59 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, h, Host, Prop } from '@stencil/core'; +import clsx from 'clsx'; +import { defaultBackground, defaultMode, defaultTheme } from '../../options'; + +@Component({ + tag: 'discord-messages', + styleUrl: 'discord-messages.css' +}) +export class DiscordMessages implements ComponentInterface { + /** + * Whether to use light theme or not. + */ + @Prop({ mutable: true, reflect: true }) + public lightTheme: boolean; + + /** + * Whether to exclude the background or not. + */ + @Prop({ mutable: true, reflect: true }) + public noBackground: boolean; + + /** + * Whether to use compact mode or not. + */ + @Prop({ mutable: true, reflect: true }) + public compactMode: boolean; + + public componentWillRender() { + if (this.lightTheme || (defaultTheme === 'light' && this.lightTheme)) { + this.lightTheme = true; + } + + if (this.compactMode || (defaultMode === 'compact' && this.compactMode)) { + this.compactMode = true; + } + + if (this.noBackground || (defaultBackground === 'none' && this.noBackground)) { + this.noBackground = true; + } + } + + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-messages/readme.md b/packages/discord-components-core/src/components/discord-messages/readme.md new file mode 100644 index 0000000..a3aa240 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-messages/readme.md @@ -0,0 +1,15 @@ +# discord-messages + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------------- | --------------- | ----------------------------------------- | --------- | ----------- | +| `compactMode` | `compact-mode` | Whether to use compact mode or not. | `boolean` | `undefined` | +| `lightTheme` | `light-theme` | Whether to use light theme or not. | `boolean` | `undefined` | +| `noBackground` | `no-background` | Whether to exclude the background or not. | `boolean` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-quote/discord-quote.css b/packages/discord-components-core/src/components/discord-quote/discord-quote.css new file mode 100644 index 0000000..8380217 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-quote/discord-quote.css @@ -0,0 +1,22 @@ +.discord-message .discord-message-body .discord-quote-container { + display: flex; +} + +.discord-message .discord-message-body .discord-quote-container > .discord-quote-divider { + background-color: #4f545c; + border-radius: 4px; + font-size: 0.9em; + font-style: normal; + font-weight: 400; + margin: 0; + padding: 0; + width: 4px; +} + +.discord-message .discord-message-body blockquote { + margin-block-end: unset; + margin-block-start: unset; + margin-inline-end: unset; + margin-inline-start: unset; + padding: 0 8px 0 12px; +} diff --git a/packages/discord-components-core/src/components/discord-quote/discord-quote.tsx b/packages/discord-components-core/src/components/discord-quote/discord-quote.tsx new file mode 100644 index 0000000..93c3a79 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-quote/discord-quote.tsx @@ -0,0 +1,18 @@ +import { Component, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-quote', + styleUrl: 'discord-quote.css' +}) +export class DiscordQuote { + public render() { + return ( + +
+
+ +
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-quote/readme.md b/packages/discord-components-core/src/components/discord-quote/readme.md new file mode 100644 index 0000000..acc9e82 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-quote/readme.md @@ -0,0 +1,7 @@ +# discord-quote + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-reaction/discord-reaction.css b/packages/discord-components-core/src/components/discord-reaction/discord-reaction.css new file mode 100644 index 0000000..d455ac3 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reaction/discord-reaction.css @@ -0,0 +1,71 @@ +.discord-reaction { + border-radius: 0.5rem; + cursor: pointer; + flex-shrink: 0; + margin-right: 0.25rem; + margin-bottom: 0.25rem; + user-select: none; + transition: none 0.1s ease; + transition-property: background-color, border-color; + background-color: #2f3136; + border: 1px solid transparent; +} + +.discord-light-theme .discord-reaction { + background-color: #f2f3f5; +} + +.discord-reaction:hover { + background-color: #36393f; + border-color: #fff2; +} + +.discord-light-theme .discord-reaction:not(.discord-reaction-reacted):hover { + background-color: white; + border-color: #0003; +} + +.discord-reaction.discord-reaction-reacted { + background-color: rgba(88, 101, 242, 0.15); + border-color: #5865f2; +} + +.discord-light-theme .discord-reaction.discord-reaction-reacted { + background-color: #e7e9fd; +} + +.discord-reaction .discord-reaction-inner { + display: flex; + align-items: center; + padding: 0.125rem 0.375rem; +} + +.discord-reaction img { + width: 1rem; + height: 1rem; + margin: 0.125rem 0; + min-width: auto; + min-height: auto; + object-fit: contain; + vertical-align: bottom; +} + +.discord-reaction .discord-reaction-count { + font-size: 0.875rem; + font-weight: 500; + margin-left: 0.375rem; + text-align: center; + color: #b9bbbe; +} + +.discord-light-theme .discord-reaction .discord-reaction-count { + color: #4f5660; +} + +.discord-reaction.discord-reaction-reacted .discord-reaction-count { + color: #dee0fc; +} + +.discord-light-theme .discord-reaction.discord-reaction-reacted .discord-reaction-count { + color: #5865f2; +} diff --git a/packages/discord-components-core/src/components/discord-reaction/discord-reaction.tsx b/packages/discord-components-core/src/components/discord-reaction/discord-reaction.tsx new file mode 100644 index 0000000..67f1431 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reaction/discord-reaction.tsx @@ -0,0 +1,77 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Prop } from '@stencil/core'; +import clsx from 'clsx'; + +@Component({ + tag: 'discord-reaction', + styleUrl: 'discord-reaction.css' +}) +export class DiscordReaction implements ComponentInterface { + /** + * The DiscordReaction element. + */ + @Element() + public el: HTMLElement; + + /** + * The reaction emoji image URL. + */ + @Prop() + public emoji: string; + + /** + * The name of the emoji to use as alternative image text. + * @default ':emoji' + */ + @Prop() + public name = ':emoji:'; + + /** + * The number of people who reacted. + * @default 1 + */ + @Prop({ mutable: true }) + public count = 1; + + /** + * Whether the reaction should show as reacted by the user. + * @default false + */ + @Prop() + public reacted = false; + + /** + * Whether the reaction should be reactive. + * @remark When the reaction is interactive left clicking it will add 1 to the counter. + * Whereas when holding the Shift key and left clicking it will decrease the counter. + * The counter cannot go below 1. + * @default false + */ + @Prop() + public interactive = false; + + public render() { + return ( +
+
+ {this.name} + {this.count} +
+
+ ); + } + + private handleReactionClick(event: MouseEvent) { + if (this.interactive) { + if (event.shiftKey) { + this.count--; + } else { + this.count++; + } + + if (this.count <= 0) { + this.count = 1; + } + } + } +} diff --git a/packages/discord-components-core/src/components/discord-reaction/readme.md b/packages/discord-components-core/src/components/discord-reaction/readme.md new file mode 100644 index 0000000..bb4cdd3 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reaction/readme.md @@ -0,0 +1,17 @@ +# discord-reaction + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | ------------- | -------------------------------------------------------- | --------- | ----------- | +| `count` | `count` | The number of people who reacted. | `number` | `1` | +| `emoji` | `emoji` | The reaction emoji image URL. | `string` | `undefined` | +| `interactive` | `interactive` | Whether the reaction should be reactive. | `boolean` | `false` | +| `name` | `name` | The name of the emoji to use as alternative image text. | `string` | `':emoji:'` | +| `reacted` | `reacted` | Whether the reaction should show as reacted by the user. | `boolean` | `false` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-reactions/discord-reactions.css b/packages/discord-components-core/src/components/discord-reactions/discord-reactions.css new file mode 100644 index 0000000..266b977 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reactions/discord-reactions.css @@ -0,0 +1,9 @@ +.discord-message .discord-reactions, +.discord-system-message .discord-reactions { + display: flex; + -webkit-box-flex: 1; + -ms-flex: 1 0 auto; + flex: 1 0 auto; + align-items: center; + flex-wrap: wrap; +} diff --git a/packages/discord-components-core/src/components/discord-reactions/discord-reactions.tsx b/packages/discord-components-core/src/components/discord-reactions/discord-reactions.tsx new file mode 100644 index 0000000..aab855f --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reactions/discord-reactions.tsx @@ -0,0 +1,16 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, h, Host } from '@stencil/core'; + +@Component({ + tag: 'discord-reactions', + styleUrl: 'discord-reactions.css' +}) +export class DiscordReactions implements ComponentInterface { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-reactions/readme.md b/packages/discord-components-core/src/components/discord-reactions/readme.md new file mode 100644 index 0000000..68f088e --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reactions/readme.md @@ -0,0 +1,7 @@ +# discord-reactions + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-reply/discord-reply.css b/packages/discord-components-core/src/components/discord-reply/discord-reply.css new file mode 100644 index 0000000..70a0b7f --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reply/discord-reply.css @@ -0,0 +1,146 @@ +.discord-replied-message { + color: #b9bbbe; + display: flex; + font-size: 0.875rem; + font-family: Whitney, 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, 'system-ui', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + + padding-top: 2px; + margin-left: 56px; + margin-bottom: 4px; + align-items: center; + line-height: 1.125rem; + position: relative; + white-space: pre; + user-select: none; +} + +.discord-light-theme .discord-replied-message { + color: #4f5660; +} + +.discord-compact-mode .discord-replied-message { + margin-left: 62px; + margin-bottom: 0; +} + +.discord-replied-message:before { + content: ''; + display: block; + position: absolute; + top: 50%; + right: 100%; + bottom: 0; + left: -36px; + margin-right: 4px; + margin-top: -1px; + margin-left: -1px; + margin-bottom: -2px; + border-left: 2px solid #4f545c; + border-bottom: 0 solid #4f545c; + border-right: 0 solid #4f545c; + border-top: 2px solid #4f545c; + border-top-left-radius: 6px; +} + +.discord-light-theme .discord-replied-message:before { + border-color: #747f8d; +} + +.discord-replied-message .discord-replied-message-avatar, +.discord-replied-message .discord-reply-badge { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: 16px; + height: 16px; + border-radius: 50%; + user-select: none; + margin-right: 0.25rem; +} + +.discord-replied-message .discord-reply-badge { + display: flex; + align-items: center; + justify-content: center; + color: #b9bbbe; + background: #202225; +} + +.discord-light-theme .discord-replied-message .discord-reply-badge { + color: #4f5660; + background: #e3e5e8; +} + +.discord-replied-message .discord-application-tag { + background-color: hsl(235, 85.6%, 64.7%); + color: #fff; + font-size: 0.625rem; + margin-right: 0.25rem; + line-height: 100%; + text-transform: uppercase; + /* Use flex layout to ensure both verified icon and "BOT" text are aligned to center */ + display: flex; + align-items: center; + /* Styling taken through Inspect Element on Discord client for Windows */ + height: 0.9375rem; + padding: 0 0.275rem; + margin-top: 0.075em; + border-radius: 0.1875rem; +} + +.discord-replied-message .discord-application-tag .discord-application-tag-verified { + width: 0.9375rem; + height: 0.9375rem; + margin-left: -0.1rem; +} + +.discord-replied-message .discord-application-tag.discord-application-tag-op { + background-color: #c9cdfb; + color: #4752c4; + border-radius: 0.4rem; +} + +.discord-replied-message .discord-replied-message-username { + flex-shrink: 0; + font-size: inherit; + line-height: inherit; + margin-right: 0.25rem; + opacity: 0.64; + font-weight: 500; + color: #fff; +} + +.discord-replied-message .discord-replied-message-content { + color: inherit; + font-size: inherit; + line-height: inherit; + white-space: pre; + text-overflow: ellipsis; + user-select: none; + cursor: pointer; + overflow-x: hidden; +} + +.discord-replied-message .discord-replied-message-content:hover { + color: #fff; +} + +.discord-light-theme .discord-replied-message .discord-replied-message-content:hover { + color: #000; +} + +.discord-replied-message .discord-replied-message-content .discord-message-edited { + margin-left: 0.25rem; +} + +.discord-replied-message .discord-replied-message-content-icon { + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: 20px; + height: 20px; + margin-left: 4px; +} + +@import '../author-info/author-info.css'; diff --git a/packages/discord-components-core/src/components/discord-reply/discord-reply.tsx b/packages/discord-components-core/src/components/discord-reply/discord-reply.tsx new file mode 100644 index 0000000..a537a48 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reply/discord-reply.tsx @@ -0,0 +1,157 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; +import Fragment from '../../Fragment'; +import type { Profile} from '../../options'; +import { avatars, profiles } from '../../options'; +import AttachmentReply from '../svgs/attachment-reply'; +import CommandReply from '../svgs/command-reply'; +import ReplyIcon from '../svgs/reply-icon'; +import VerifiedTick from '../svgs/verified-tick'; + +@Component({ + tag: 'discord-reply', + styleUrl: 'discord-reply.css' +}) +export class DiscordReply implements ComponentInterface { + /** + * The DiscordReply element. + */ + @Element() + public el: HTMLElement; + + /** + * The id of the profile data to use. + */ + @Prop() + public profile: string; + + /** + * The message author's username. + * @default 'User' + */ + @Prop() + public author = 'User'; + + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + @Prop() + public avatar: string; + + /** + * Whether the message author is a bot or not. + * Only works if `server` is `false` or `undefined`. + */ + @Prop() + public bot = false; + + /** + * Whether the message author is a server crosspost webhook or not. + * Only works if `bot` is `false` or `undefined`. + */ + @Prop() + public server = false; + + /** + * Whether the author is the original poster. + */ + @Prop() + public op = false; + + /** + * Whether the bot is verified or not. + * Only works if `bot` is `true` + */ + @Prop() + public verified = false; + + /** + * Whether the message has been edited or not. + */ + @Prop() + public edited = false; + + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + @Prop() + public roleColor: string; + + /** + * Whether the referenced message is from a response of a slash command. + */ + @Prop() + public command = false; + + /** + * Whether the referenced message contains attachments. + */ + @Prop() + public attachment = false; + + /** + * Whether this reply pings the original message sender, prepending an "@" on the author's username. + */ + @Prop() + public mentions = false; + + public render() { + const parent: HTMLDiscordMessageElement = this.el.parentElement as HTMLDiscordMessageElement; + + if (parent.tagName.toLowerCase() !== 'discord-message') { + throw new Error('All components must be direct children of .'); + } + + const resolveAvatar = (avatar: string): string => avatars[avatar] ?? avatar ?? avatars.default; + + const defaultData: Profile = { + author: this.author, + bot: this.bot, + verified: this.verified, + op: this.op, + server: this.server, + roleColor: this.roleColor + }; + const profileData: Profile = Reflect.get(profiles, this.profile) ?? {}; + const profile: Profile = { ...defaultData, ...profileData, ...{ avatar: resolveAvatar(profileData.avatar ?? this.avatar) } }; + + const messageParent: HTMLDiscordMessagesElement = parent.parentElement as HTMLDiscordMessagesElement; + + return ( + + {messageParent.compactMode ? ( +
+ +
+ ) : ( + {profile.author} + )} + { + + {profile.bot && !profile.server && ( + + {profile.verified && } + Bot + + )} + {profile.server && !profile.bot && Server} + {profile.op && OP} + + } + + {this.mentions && '@'} + {profile.author} + +
+ + {this.edited ? (edited) : ''} +
+ {this.command ? ( + + ) : ( + this.attachment && + )} +
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-reply/readme.md b/packages/discord-components-core/src/components/discord-reply/readme.md new file mode 100644 index 0000000..cfd61d1 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-reply/readme.md @@ -0,0 +1,24 @@ +# discord-reply + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------- | --------- | ----------- | +| `attachment` | `attachment` | Whether the referenced message contains attachments. | `boolean` | `false` | +| `author` | `author` | The message author's username. | `string` | `'User'` | +| `avatar` | `avatar` | The message author's avatar. Can be an avatar shortcut, relative path, or external link. | `string` | `undefined` | +| `bot` | `bot` | Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. | `boolean` | `false` | +| `command` | `command` | Whether the referenced message is from a response of a slash command. | `boolean` | `false` | +| `edited` | `edited` | Whether the message has been edited or not. | `boolean` | `false` | +| `mentions` | `mentions` | Whether this reply pings the original message sender, prepending an "@" on the author's username. | `boolean` | `false` | +| `op` | `op` | Whether the author is the original poster. | `boolean` | `false` | +| `profile` | `profile` | The id of the profile data to use. | `string` | `undefined` | +| `roleColor` | `role-color` | The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). | `string` | `undefined` | +| `server` | `server` | Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. | `boolean` | `false` | +| `verified` | `verified` | Whether the bot is verified or not. Only works if `bot` is `true` | `boolean` | `false` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.css b/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.css new file mode 100644 index 0000000..6e60713 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.css @@ -0,0 +1,26 @@ +.discord-message .discord-message-body .discord-spoiler { + background-color: #202225; + color: transparent; + cursor: pointer; +} + +.discord-light-theme .discord-message .discord-message-body .discord-spoiler { + background-color: #b9bbbe; +} + +.discord-message .discord-message-body .discord-spoiler:hover { + background-color: rgba(32, 34, 37, 0.8); +} + +.discord-light-theme .discord-message .discord-message-body .discord-spoiler:hover { + background-color: rgba(185, 187, 190, 0.8); +} + +.discord-message .discord-message-body .discord-spoiler--revealed { + color: inherit; + background-color: hsla(0, 0%, 100%, 0.1); +} + +.discord-light-theme .discord-message .discord-message-body .discord-spoiler--revealed { + background-color: rgba(0, 0, 0, 0.1); +} diff --git a/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.tsx b/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.tsx new file mode 100644 index 0000000..e23a9ab --- /dev/null +++ b/packages/discord-components-core/src/components/discord-spoiler/discord-spoiler.tsx @@ -0,0 +1,22 @@ +import { Component, h, Host, Listen, State } from '@stencil/core'; + +@Component({ + tag: 'discord-spoiler', + styleUrl: 'discord-spoiler.css' +}) +export class DiscordSpoiler { + @State() private isRevealed = false; + + @Listen('click') + public reveal() { + this.isRevealed = true; + } + + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-spoiler/readme.md b/packages/discord-components-core/src/components/discord-spoiler/readme.md new file mode 100644 index 0000000..b0d2bbd --- /dev/null +++ b/packages/discord-components-core/src/components/discord-spoiler/readme.md @@ -0,0 +1,7 @@ +# discord-spoiler + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-system-message/discord-system-message.css b/packages/discord-components-core/src/components/discord-system-message/discord-system-message.css new file mode 100644 index 0000000..417547d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-system-message/discord-system-message.css @@ -0,0 +1,140 @@ +.discord-system-message { + color: #8e9297; + display: flex; + font-weight: 400; + font-size: 1rem; + font-family: Whitney, 'Source Sans Pro', ui-sans-serif, system-ui, -apple-system, 'system-ui', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + padding: 0px 1em; + + position: relative; + word-wrap: break-word; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + -webkit-box-flex: 0; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + padding-right: 0; + min-height: 1.375rem; + padding-right: 48px !important; + margin-top: 1.0625rem; +} + +.discord-light-theme .discord-system-message { + color: #2e3338; + border-color: #eceeef; +} + +.discord-system-message.discord-channel-name-change { + color: #fff; +} + +.discord-light-theme .discord-system-message.discord-channel-name-change { + color: #060607; +} + +.discord-system-message.discord-boost-system-message svg { + color: #ff73fa; +} + +.discord-system-message.discord-alert-system-message svg { + color: #faa81a; +} + +.discord-system-message.discord-error-system-message svg { + color: #faa81a; +} + +.discord-system-message:first-child { + margin-top: 0.5rem; +} + +.discord-system-message:last-child { + margin-bottom: 0.5rem; + border-bottom-width: 0; +} + +.discord-system-message .discord-message-icon { + margin-right: 16px; + margin-top: 5px; + min-width: 40px; + display: flex; + align-items: flex-start; + justify-content: center; +} + +.discord-system-message .discord-message-icon svg { + width: 16px; + height: 16px; +} + +.discord-system-message .discord-message-timestamp { + color: #72767d; + font-size: 12px; + margin-left: 3px; +} + +.discord-light-theme .discord-system-message .discord-message-timestamp { + color: #747f8d; +} + +.discord-system-message .discord-message-system-edited { + color: #72767d; + font-size: 10px; +} + +.discord-light-theme .discord-system-message .discord-message-edited { + color: #99aab5; +} + +.discord-system-message .discord-message-content { + width: 100%; + line-height: 160%; + font-weight: normal; + padding-top: 2px; + display: flex; + flex-direction: column; +} + +.discord-system-message .discord-message-content i { + font-style: normal; + cursor: pointer; + color: white; + font-weight: 500; +} + +.discord-light-theme .discord-system-message .discord-message-content i { + color: #060607; +} + +.discord-system-message .discord-message-content i:hover { + text-decoration: underline; +} + +.discord-system-message:hover { + background-color: rgba(4, 4, 5, 0.07); +} + +.discord-light-theme .discord-system-message:hover { + background-color: rgba(6, 6, 7, 0.02); +} + +.discord-system-message.discord-system-message-has-thread:after { + width: 2rem; + left: 2.2rem; + top: 1.75rem; + border-left: 2px solid #4f545c; + border-bottom: 2px solid #4f545c; + border-bottom-left-radius: 8px; + bottom: 29px; + content: ''; + position: absolute; +} + +.discord-light-theme .discord-system-message.discord-system-message-has-thread:after { + border-color: #747f8d; +} + +@import '../author-info/author-info.css'; diff --git a/packages/discord-components-core/src/components/discord-system-message/discord-system-message.tsx b/packages/discord-components-core/src/components/discord-system-message/discord-system-message.tsx new file mode 100644 index 0000000..155a1ab --- /dev/null +++ b/packages/discord-components-core/src/components/discord-system-message/discord-system-message.tsx @@ -0,0 +1,134 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop, Watch } from '@stencil/core'; +import clsx from 'clsx'; +import type { DiscordTimestamp} from '../../util'; +import { handleTimestamp } from '../../util'; +import Boost from '../svgs/boost'; +import DMCall from '../svgs/dm-call'; +import DMEdit from '../svgs/dm-edit'; +import DMMissedCall from '../svgs/dm-missed-call'; +import Pin from '../svgs/pin'; +import SystemAlert from '../svgs/system-alert'; +import SystemError from '../svgs/system-error'; +import Thread from '../svgs/thread'; +import UserJoin from '../svgs/user-join'; +import UserLeave from '../svgs/user-leave'; + +@Component({ + tag: 'discord-system-message', + styleUrl: 'discord-system-message.css' +}) +export class DiscordSystemMessage implements ComponentInterface { + /** + * The DiscordSystemMessage element. + */ + @Element() + public el: HTMLElement; + + /** + * The timestamp to use for the message date. + */ + @Prop({ mutable: true, reflect: true }) + public timestamp: DiscordTimestamp = new Date(); + + /** + * The type of system message this is, this will change the icon shown. + * Valid values: `join`, `leave`, `call`, `missed-call`, `boost`, `edit`, `thread`, `pin`, `alert`, and `error`. + */ + @Prop() + public type: 'join' | 'leave' | 'call' | 'missed-call' | 'boost' | 'edit' | 'thread' | 'pin' | 'alert' | 'error' = 'join'; + + /** + * Whether this message is to show channel name changes, used to match Discord's style. + */ + @Prop() + public channelName = false; + + @Watch('type') + public handleType(value: string) { + if (typeof value !== 'string') { + throw new TypeError('DiscordSystemMessage `type` prop must be a string.'); + } else if (!['join', 'leave', 'call', 'missed-call', 'boost', 'edit', 'thread', 'pin', 'alert', 'error'].includes(value)) { + throw new RangeError( + "DiscordSystemMessage `type` prop must be one of: 'join', 'leave', 'call', 'missed-call', 'boost', 'edit', 'pin', 'thread' 'alert', 'error'" + ); + } + } + + @Watch('timestamp') + public updateTimestamp(value: DiscordTimestamp): string | null { + return handleTimestamp(value); + } + + public componentWillRender() { + this.timestamp = handleTimestamp(this.timestamp); + } + + public render() { + const parent: HTMLDiscordMessagesElement = this.el.parentElement as HTMLDiscordMessagesElement; + + if (parent.tagName.toLowerCase() !== 'discord-messages') { + throw new Error('All components must be direct children of .'); + } + + let icon = ''; + + switch (this.type) { + case 'join': + icon = ; + break; + case 'leave': + icon = ; + break; + case 'call': + icon = ; + break; + case 'missed-call': + icon = ; + break; + case 'edit': + icon = ; + break; + case 'boost': + icon = ; + break; + case 'thread': + icon = ; + break; + case 'alert': + icon = ; + break; + case 'error': + icon = ; + break; + case 'pin': + icon = ; + break; + } + + const hasThread: boolean = + // @ts-expect-error ts doesn't understand this + Array.from(this.el.children).some((child: HTMLDiscordThreadElement): boolean => { + return child.tagName.toLowerCase() === 'discord-thread'; + }); + + return ( + +
{icon}
+
+ + + {this.timestamp} + + + +
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-system-message/readme.md b/packages/discord-components-core/src/components/discord-system-message/readme.md new file mode 100644 index 0000000..33902ca --- /dev/null +++ b/packages/discord-components-core/src/components/discord-system-message/readme.md @@ -0,0 +1,15 @@ +# discord-system-message + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------ | +| `channelName` | `channel-name` | Whether this message is to show channel name changes, used to match Discord's style. | `boolean` | `false` | +| `timestamp` | `timestamp` | The timestamp to use for the message date. | `Date \| null \| string` | `new Date()` | +| `type` | `type` | The type of system message this is, this will change the icon shown. Valid values: `join`, `leave`, `call`, `missed-call`, `boost`, `edit`, `thread`, `pin`, `alert`, and `error`. | `"alert" \| "boost" \| "call" \| "edit" \| "error" \| "join" \| "leave" \| "missed-call" \| "pin" \| "thread"` | `'join'` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.css b/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.css new file mode 100644 index 0000000..92e2fa4 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.css @@ -0,0 +1,34 @@ +.discord-tenor-video { + color: #dcddde; + display: flex; + font-size: 13px; + line-height: 150%; + margin-bottom: 8px; + margin-top: 8px; +} + +.discord-tenor-video .discord-tenor-video-wrapper { + display: block; + position: relative; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + overflow: hidden; + border-radius: 4px; +} + +.discord-tenor-video .discord-tenor-video-wrapper video { + -webkit-box-align: center; + -webkit-box-pack: center; + align-items: center; + border-radius: 0; + cursor: pointer; + display: flex; + height: 100%; + justify-content: center; + max-height: 100%; + width: 100%; + left: 0px; + top: 0px; +} diff --git a/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.tsx b/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.tsx new file mode 100644 index 0000000..6457b1a --- /dev/null +++ b/packages/discord-components-core/src/components/discord-tenor-video/discord-tenor-video.tsx @@ -0,0 +1,42 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; + +@Component({ + tag: 'discord-tenor-video', + styleUrl: 'discord-tenor-video.css' +}) +export class DiscordTenorVideo implements ComponentInterface { + /** + * The DiscordTenorVideo element. + */ + @Element() + public el: HTMLElement; + + /** + * The URL for the video + */ + @Prop() + public url: string; + + /** + * The height of the video in pixels + */ + @Prop() + public height: number; + + /** + * The width of the video in pixels + */ + @Prop() + public width: number; + + public render() { + return ( + +
+ +
+
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-tenor-video/readme.md b/packages/discord-components-core/src/components/discord-tenor-video/readme.md new file mode 100644 index 0000000..ac3e7b5 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-tenor-video/readme.md @@ -0,0 +1,15 @@ +# discord-attachment + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------- | --------- | --------------------------------- | -------- | ----------- | +| `height` | `height` | The height of the video in pixels | `number` | `undefined` | +| `url` | `url` | The URL for the video | `string` | `undefined` | +| `width` | `width` | The width of the video in pixels | `number` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.css b/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.css new file mode 100644 index 0000000..7b82430 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.css @@ -0,0 +1,81 @@ +.discord-thread-message { + height: 18px; + min-width: 0; + display: flex; + align-items: center; + font-size: 0.875rem; + line-height: 1.125rem; +} + +.discord-thread-message .discord-thread-message-avatar { + margin-right: 8px; + flex: 0 0 auto; + width: 16px; + height: 16px; + border-radius: 50%; + user-select: none; +} + +.discord-thread-message .discord-thread-message-username { + flex-shrink: 0; + font-size: inherit; + line-height: inherit; + margin-right: 0.25rem; + opacity: 0.64; + color: white; + display: inline; + vertical-align: baseline; + position: relative; + overflow: hidden; +} + +.discord-light-theme .discord-thread-message .discord-thread-message-username { + color: #060607; +} + +.discord-thread-message .discord-application-tag { + background-color: #5865f2; + color: #fff; + font-size: 0.65em; + margin-right: 5px; + border-radius: 3px; + line-height: 100%; + text-transform: uppercase; + display: flex; + align-items: center; + height: 0.9375rem; + padding: 0 0.275rem; + margin-top: 0.075em; + border-radius: 0.1875rem; +} + +.discord-thread-message .discord-application-tag-verified { + display: inline-block; + width: 0.9375rem; + height: 0.9375rem; + margin-left: -0.25rem; +} + +.discord-thread-message .discord-thread-message-content { + display: flex; + align-items: baseline; +} + +.discord-thread-message .discord-message-edited { + color: #72767d; + font-size: 10px; + margin-left: 5px; +} + +.discord-thread-message .discord-thread-message-timestamp { + color: #72767d; + flex-shrink: 0; + margin-left: 8px; + font-size: 0.875rem; + line-height: 1.125rem; +} + +.discord-light-theme .discord-thread-message .discord-thread-message-timestamp, +.discord-light-theme .discord-thread-message .discord-message-edited { + color: #747f8d; +} diff --git a/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.tsx b/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.tsx new file mode 100644 index 0000000..4937fd1 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread-message/discord-thread-message.tsx @@ -0,0 +1,107 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; +import Fragment from '../../Fragment'; +import type { Profile} from '../../options'; +import { avatars, profiles } from '../../options'; +import VerifiedTick from '../svgs/verified-tick'; + +@Component({ + tag: 'discord-thread-message', + styleUrl: 'discord-thread-message.css' +}) +export class DiscordThreadMessage implements ComponentInterface { + /** + * The DiscordThreadMessage element. + */ + @Element() + public el: HTMLElement; + + /** + * The id of the profile data to use. + */ + @Prop() + public profile: string; + + /** + * The message author's username. + * @default 'User' + */ + @Prop() + public author = 'User'; + + /** + * The message author's avatar. Can be an avatar shortcut, relative path, or external link. + */ + @Prop() + public avatar: string; + + /** + * Whether the message author is a bot or not. + * Only works if `server` is `false` or `undefined`. + */ + @Prop() + public bot = false; + + /** + * Whether the message author is a server crosspost webhook or not. + * Only works if `bot` is `false` or `undefined`. + */ + @Prop() + public server = false; + + /** + * Whether the bot is verified or not. + * Only works if `bot` is `true` + */ + @Prop() + public verified = false; + + /** + * Whether the message has been edited or not. + */ + @Prop() + public edited = false; + + /** + * The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). + */ + @Prop() + public roleColor: string; + + /** + * The relative timestamp of the message. + */ + @Prop() + public relativeTimestamp = '1m ago'; + + public render() { + const resolveAvatar = (avatar: string): string => avatars[avatar] ?? avatar ?? avatars.default; + + const defaultData: Profile = { author: this.author, bot: this.bot, verified: this.verified, server: this.server, roleColor: this.roleColor }; + const profileData: Profile = Reflect.get(profiles, this.profile) ?? {}; + const profile: Profile = { ...defaultData, ...profileData, ...{ avatar: resolveAvatar(profileData.avatar ?? this.avatar) } }; + + return ( + + {profile.author} + + {profile.bot && !profile.server && ( + + {profile.verified && } + Bot + + )} + {profile.server && !profile.bot && Server} + + + {profile.author} + +
+ + {this.edited ? (edited) : ''} +
+ {this.relativeTimestamp} +
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-thread-message/readme.md b/packages/discord-components-core/src/components/discord-thread-message/readme.md new file mode 100644 index 0000000..c7a0063 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread-message/readme.md @@ -0,0 +1,21 @@ +# discord-thread-message + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------- | ----------- | +| `author` | `author` | The message author's username. | `string` | `'User'` | +| `avatar` | `avatar` | The message author's avatar. Can be an avatar shortcut, relative path, or external link. | `string` | `undefined` | +| `bot` | `bot` | Whether the message author is a bot or not. Only works if `server` is `false` or `undefined`. | `boolean` | `false` | +| `edited` | `edited` | Whether the message has been edited or not. | `boolean` | `false` | +| `profile` | `profile` | The id of the profile data to use. | `string` | `undefined` | +| `relativeTimestamp` | `relative-timestamp` | The relative timestamp of the message. | `string` | `'1m ago'` | +| `roleColor` | `role-color` | The message author's primary role color. Can be any [CSS color value](https://www.w3schools.com/cssref/css_colors_legal.asp). | `string` | `undefined` | +| `server` | `server` | Whether the message author is a server crosspost webhook or not. Only works if `bot` is `false` or `undefined`. | `boolean` | `false` | +| `verified` | `verified` | Whether the bot is verified or not. Only works if `bot` is `true` | `boolean` | `false` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-thread/discord-thread.css b/packages/discord-components-core/src/components/discord-thread/discord-thread.css new file mode 100644 index 0000000..cf99f81 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread/discord-thread.css @@ -0,0 +1,61 @@ +.discord-thread { + background-color: #2f3136; + border-radius: 4px; + cursor: pointer; + margin-top: 8px; + max-width: 480px; + min-width: 0; + padding: 8px; + display: inline-flex; + width: fit-content; + flex-direction: column; +} + +.discord-light-theme .discord-thread { + background-color: #f2f3f5; +} + +.discord-thread .discord-thread-top { + display: flex; +} + +.discord-thread .discord-thread-bottom { + font-size: 0.875rem; + line-height: 1.125rem; + align-items: center; + color: #b9bbbe; + display: flex; + margin-top: 2px; + white-space: nowrap; +} + +.discord-light-theme .discord-thread-bottom { + color: #4f5660; +} + +.discord-thread .discord-thread-name { + font-size: 0.875rem; + font-weight: 600; + line-height: 1.125rem; + color: white; + margin-right: 8px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.discord-light-theme .discord-thread-name { + color: #060607; +} + +.discord-thread .discord-thread-cta { + color: #00aff4; + flex-shrink: 0; + font-size: 0.875rem; + font-weight: 600; + line-height: 1.125rem; +} + +.discord-thread:hover .discord-thread-cta { + text-decoration: underline; +} diff --git a/packages/discord-components-core/src/components/discord-thread/discord-thread.tsx b/packages/discord-components-core/src/components/discord-thread/discord-thread.tsx new file mode 100644 index 0000000..d8db391 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread/discord-thread.tsx @@ -0,0 +1,42 @@ +import type { ComponentInterface} from '@stencil/core'; +import { Component, Element, h, Host, Prop } from '@stencil/core'; + +@Component({ + tag: 'discord-thread', + styleUrl: 'discord-thread.css' +}) +export class DiscordThread implements ComponentInterface { + /** + * The DiscordThread element. + */ + @Element() + public el: HTMLElement; + + /** + * The name of the thread. + */ + @Prop() + public name = 'Thread'; + + /** + * The the text within the call to action text. (i.e. 'See Thread' or 'x Messages') + */ + @Prop() + public cta = 'See Thread'; + + public render() { + return ( + +
+ {this.name} + +
+ + + +
+ ); + } +} diff --git a/packages/discord-components-core/src/components/discord-thread/readme.md b/packages/discord-components-core/src/components/discord-thread/readme.md new file mode 100644 index 0000000..d1e6f69 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-thread/readme.md @@ -0,0 +1,14 @@ +# discord-thread + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------- | --------- | -------------------------------------------------------------------------------- | -------- | -------------- | +| `cta` | `cta` | The the text within the call to action text. (i.e. 'See Thread' or 'x Messages') | `string` | `'See Thread'` | +| `name` | `name` | The name of the thread. | `string` | `'Thread'` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-time/discord-time.css b/packages/discord-components-core/src/components/discord-time/discord-time.css new file mode 100644 index 0000000..f5d2ab2 --- /dev/null +++ b/packages/discord-components-core/src/components/discord-time/discord-time.css @@ -0,0 +1,5 @@ +.discord-time { + background-color: #ffffff0f; + border-radius: 3px; + padding: 0 2px; +} diff --git a/packages/discord-components-core/src/components/discord-time/discord-time.tsx b/packages/discord-components-core/src/components/discord-time/discord-time.tsx new file mode 100644 index 0000000..0ca809b --- /dev/null +++ b/packages/discord-components-core/src/components/discord-time/discord-time.tsx @@ -0,0 +1,97 @@ +import { Component, h, Host, Prop, State } from '@stencil/core'; + +const DATE_TYPE_FORMATS = { + t: { timeStyle: 'short' }, + T: { timeStyle: 'medium' }, + d: { dateStyle: 'short' }, + D: { dateStyle: 'long' }, + f: { dateStyle: 'long', timeStyle: 'short' }, + F: { dateStyle: 'full', timeStyle: 'short' }, + R: { style: 'long', numeric: 'auto' } +} as const; + +// max: [unit, per unit] +const RELATIVE_DATE_CONVERSION = { + 60000: ['second', 1000], + 3600000: ['minute', 60000], + 86400000: ['hour', 3600000], + 604800000: ['day', 86400000], + 2419200000: ['week', 604800000], + 29030400000: ['month', 2419200000], + 290304000000: ['year', 29030400000] +} as const; + +@Component({ + tag: 'discord-time', + styleUrl: 'discord-time.css' +}) +export class DiscordTime { + /** + * The time to display. + */ + @Prop() + public timestamp: number; + + /** + * The format for the time. + */ + @Prop() + public format: 't' | 'T' | 'f' | 'F' | 'd' | 'D' | 'R' = 't'; + + // Private variables + @State() private time = ''; + private updateInterval: number | undefined; + + public render() { + return {this.time}; + } + + // Lifecycle methods + public connectedCallback() { + this.update(); + } + + public disconnectedCallback() { + window.clearInterval(this.updateInterval); + } + + /** + * Generates a string for the time. + */ + private update() { + const date = new Date(this.timestamp); + + if (this.format === 'R') { + const [formatted, interval] = getRelativeDate(date); + this.time = formatted; + + // Update the time according to the interval + if (this.updateInterval) window.clearInterval(this.updateInterval); + if (interval > -1) this.updateInterval = window.setInterval(() => this.update(), interval); + } else { + this.time = date.toLocaleString(undefined, DATE_TYPE_FORMATS[this.format]); + } + } +} + +// [formatted, updateInterval] +function getRelativeDate(date: Date): [string, number] { + const difference = Date.now() - date.getTime(); + const diffAbsolute = Math.abs(difference); + + const ending = difference < 0 ? 'from now' : 'ago'; + + if (diffAbsolute < 5000) { + return ['Just now', 1000]; + } + + for (const [time, [unit, per]] of Object.entries(RELATIVE_DATE_CONVERSION)) { + if (diffAbsolute < Number(time)) { + const amount = Math.round(diffAbsolute / per); + + return [`${amount} ${unit}${amount === 1 ? '' : 's'} ${ending}`, unit === 'second' ? 1000 : 60 * 1000]; + } + } + + return [`${Math.floor(diffAbsolute / 290304000000)} years ${ending}`, -1]; +} diff --git a/packages/discord-components-core/src/components/discord-time/readme.md b/packages/discord-components-core/src/components/discord-time/readme.md new file mode 100644 index 0000000..29a72fd --- /dev/null +++ b/packages/discord-components-core/src/components/discord-time/readme.md @@ -0,0 +1,14 @@ +# discord-time + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------- | ----------- | ------------------------ | ----------------------------------------------- | ----------- | +| `format` | `format` | The format for the time. | `"D" \| "F" \| "R" \| "T" \| "d" \| "f" \| "t"` | `'t'` | +| `timestamp` | `timestamp` | The time to display. | `number` | `undefined` | + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/discord-underlined/discord-underlined.tsx b/packages/discord-components-core/src/components/discord-underlined/discord-underlined.tsx new file mode 100644 index 0000000..421db7d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-underlined/discord-underlined.tsx @@ -0,0 +1,14 @@ +import { Component, h } from '@stencil/core'; + +@Component({ + tag: 'discord-underlined' +}) +export class DiscordUnderlined { + public render() { + return ( + + + + ); + } +} diff --git a/packages/discord-components-core/src/components/discord-underlined/readme.md b/packages/discord-components-core/src/components/discord-underlined/readme.md new file mode 100644 index 0000000..833322d --- /dev/null +++ b/packages/discord-components-core/src/components/discord-underlined/readme.md @@ -0,0 +1,7 @@ +# discord-underlined + + + +--- + +_Built with [StencilJS](https://stenciljs.com/)_ diff --git a/packages/discord-components-core/src/components/svgs/attachment-reply.tsx b/packages/discord-components-core/src/components/svgs/attachment-reply.tsx new file mode 100644 index 0000000..b73aeec --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/attachment-reply.tsx @@ -0,0 +1,12 @@ +import { h } from '@stencil/core'; + +export default function AttachmentReply(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/boost.tsx b/packages/discord-components-core/src/components/svgs/boost.tsx new file mode 100644 index 0000000..a1f70de --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/boost.tsx @@ -0,0 +1,10 @@ +import { h } from '@stencil/core'; + +export default function Boost(props: T) { + return ( + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/channel-forum.tsx b/packages/discord-components-core/src/components/svgs/channel-forum.tsx new file mode 100644 index 0000000..0c69893 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/channel-forum.tsx @@ -0,0 +1,14 @@ +import { h } from '@stencil/core'; + +export default function ChannelForum(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/channel-icon.tsx b/packages/discord-components-core/src/components/svgs/channel-icon.tsx new file mode 100644 index 0000000..5705aa9 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/channel-icon.tsx @@ -0,0 +1,14 @@ +import { h } from '@stencil/core'; + +export default function ChannelIcon(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/channel-thread.tsx b/packages/discord-components-core/src/components/svgs/channel-thread.tsx new file mode 100644 index 0000000..ac31b46 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/channel-thread.tsx @@ -0,0 +1,16 @@ +import { h } from '@stencil/core'; + +export default function ChannelThread(props: T) { + return ( + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/command-icon.tsx b/packages/discord-components-core/src/components/svgs/command-icon.tsx new file mode 100644 index 0000000..12413e1 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/command-icon.tsx @@ -0,0 +1,9 @@ +import { h } from '@stencil/core'; + +export default function CommandIcon(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/command-reply.tsx b/packages/discord-components-core/src/components/svgs/command-reply.tsx new file mode 100644 index 0000000..6f12486 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/command-reply.tsx @@ -0,0 +1,14 @@ +import { h } from '@stencil/core'; + +export default function CommandReply(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/dm-call.tsx b/packages/discord-components-core/src/components/svgs/dm-call.tsx new file mode 100644 index 0000000..9f9ed3f --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/dm-call.tsx @@ -0,0 +1,13 @@ +import { h } from '@stencil/core'; + +export default function DMCall(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/dm-edit.tsx b/packages/discord-components-core/src/components/svgs/dm-edit.tsx new file mode 100644 index 0000000..d99a0b9 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/dm-edit.tsx @@ -0,0 +1,15 @@ +import { h } from '@stencil/core'; + +export default function DMEdit(props: T) { + return ( + + + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/dm-missed-call.tsx b/packages/discord-components-core/src/components/svgs/dm-missed-call.tsx new file mode 100644 index 0000000..475aa0c --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/dm-missed-call.tsx @@ -0,0 +1,15 @@ +import { h } from '@stencil/core'; + +export default function DMMissedCall(props: T) { + return ( + + + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/ephemeral.tsx b/packages/discord-components-core/src/components/svgs/ephemeral.tsx new file mode 100644 index 0000000..2b54331 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/ephemeral.tsx @@ -0,0 +1,16 @@ +import { h } from '@stencil/core'; + +export default function Ephemeral(props: T) { + return ( + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/guild-badge.tsx b/packages/discord-components-core/src/components/svgs/guild-badge.tsx new file mode 100644 index 0000000..4065b59 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/guild-badge.tsx @@ -0,0 +1,13 @@ +import { h } from '@stencil/core'; + +export default function GuildBadge(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/launch-icon.tsx b/packages/discord-components-core/src/components/svgs/launch-icon.tsx new file mode 100644 index 0000000..6fc6679 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/launch-icon.tsx @@ -0,0 +1,13 @@ +import { h } from '@stencil/core'; + +export default function LaunchIcon(props: T) { + return ( + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/locked-voice-channel.tsx b/packages/discord-components-core/src/components/svgs/locked-voice-channel.tsx new file mode 100644 index 0000000..328f759 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/locked-voice-channel.tsx @@ -0,0 +1,13 @@ +import { h } from '@stencil/core'; + +export default function LockedVoiceChannel(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/partner-badge-overlay.tsx b/packages/discord-components-core/src/components/svgs/partner-badge-overlay.tsx new file mode 100644 index 0000000..b15db43 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/partner-badge-overlay.tsx @@ -0,0 +1,16 @@ +import { h } from '@stencil/core'; + +const PartnerBadgeOverlay = () => ( + + + + +); + +export default PartnerBadgeOverlay; diff --git a/packages/discord-components-core/src/components/svgs/pin.tsx b/packages/discord-components-core/src/components/svgs/pin.tsx new file mode 100644 index 0000000..ffd1e6a --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/pin.tsx @@ -0,0 +1,12 @@ +import { h } from '@stencil/core'; + +export default function Pin(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/reply-icon.tsx b/packages/discord-components-core/src/components/svgs/reply-icon.tsx new file mode 100644 index 0000000..83e3dfe --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/reply-icon.tsx @@ -0,0 +1,12 @@ +import { h } from '@stencil/core'; + +export default function ReplyIcon(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/system-alert.tsx b/packages/discord-components-core/src/components/svgs/system-alert.tsx new file mode 100644 index 0000000..2b373a2 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/system-alert.tsx @@ -0,0 +1,14 @@ +import { h } from '@stencil/core'; + +export default function SystemAlert(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/system-error.tsx b/packages/discord-components-core/src/components/svgs/system-error.tsx new file mode 100644 index 0000000..d965c27 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/system-error.tsx @@ -0,0 +1,13 @@ +import { h } from '@stencil/core'; + +export default function SystemError(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/thread.tsx b/packages/discord-components-core/src/components/svgs/thread.tsx new file mode 100644 index 0000000..f0fc901 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/thread.tsx @@ -0,0 +1,16 @@ +import { h } from '@stencil/core'; + +export default function Thread(props: T) { + return ( + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/user-join.tsx b/packages/discord-components-core/src/components/svgs/user-join.tsx new file mode 100644 index 0000000..2ef2f75 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/user-join.tsx @@ -0,0 +1,12 @@ +import { h } from '@stencil/core'; + +export default function UserJoin(props: T) { + return ( + + + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/user-leave.tsx b/packages/discord-components-core/src/components/svgs/user-leave.tsx new file mode 100644 index 0000000..5ee706a --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/user-leave.tsx @@ -0,0 +1,12 @@ +import { h } from '@stencil/core'; + +export default function UserLeave(props: T) { + return ( + + + + + + + ); +} diff --git a/packages/discord-components-core/src/components/svgs/verified-badge-overlay.tsx b/packages/discord-components-core/src/components/svgs/verified-badge-overlay.tsx new file mode 100644 index 0000000..8a3c953 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/verified-badge-overlay.tsx @@ -0,0 +1,9 @@ +import { h } from '@stencil/core'; + +const VerifiedBadgeOverlay = () => ( + + + +); + +export default VerifiedBadgeOverlay; diff --git a/packages/discord-components-core/src/components/svgs/verified-tick.tsx b/packages/discord-components-core/src/components/svgs/verified-tick.tsx new file mode 100644 index 0000000..e402871 --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/verified-tick.tsx @@ -0,0 +1,9 @@ +import { h } from '@stencil/core'; + +const VerifiedTick = () => ( + + + +); + +export default VerifiedTick; diff --git a/packages/discord-components-core/src/components/svgs/voice-channel.tsx b/packages/discord-components-core/src/components/svgs/voice-channel.tsx new file mode 100644 index 0000000..ecd6abc --- /dev/null +++ b/packages/discord-components-core/src/components/svgs/voice-channel.tsx @@ -0,0 +1,15 @@ +import { h } from '@stencil/core'; + +export default function VoiceChannel(props: T) { + return ( + + + + ); +} diff --git a/packages/discord-components-core/src/index.html b/packages/discord-components-core/src/index.html new file mode 100644 index 0000000..0d47f85 --- /dev/null +++ b/packages/discord-components-core/src/index.html @@ -0,0 +1,597 @@ + + + + + + Discord Components Core + + + + + + +
+
+

@skyra/discord-components-core

+ [Github] +
+
+

A normal conversation

+ + + test + + channel topic markdown will go here + Hey guys, I'm new here! Glad to be able to join you all! + + Hi, I'm new here too! + + + + Hey, Alyx Vargas and Dawn. Welcome to our server!
Be + sure to read through the rules. You can ping + Support + if you need help. +
+ Hello everyone! How's it going? + + Thank you + Maximillian Osborn! + + + I'm doing well, Willard Walton. What about yourself? + + s!8ball How am I doing today? + + Yes. + + + + + + asdf + + + + + + + + + + +
+

Light mode

+ + Look at me I'm a beautiful butterfly + Fluttering in the sunlight 🌞 + +

Compact mode

+ + Look at me I'm a beautiful butterfly + Fluttering in the moonlight 🌝 + Waiting for the day when + Compact mode would be turned on + Oh here it is! + +

Markdown Styling

+ + + I am bold text! + + + I am italic text! + + + + I am bold italic text! + + + + I am underlined text! + + + I am inline-code text! + + + I am spoiler text! + + + I am quoted text! + + +

No Background mode

+ + This message blends perfectly with your own background + No Background mode is turned on here + +

Mentions

+ + + Hey, Alyx Vargas and Dawn. Welcome to our server! Be + sure to read through the rules. You can ping + Support + if you need help. Feel free to join + General + and talk with us and post thoughts in feedback. + + + Hey there + Maximillian Osborn, thanks! I will! + + + Also, make sure to run profile to create your server profile! + + +

Custom Discord Emojis

+ + + Hey these are some custom emojis: + + + + Custom emojis in the embed description: + + + + Custom emojis in the field content + + + + + +

Server Invites

+ + + discord.gg/djs
+ discord.gg/code
+ discord.gg/6gakFR2 + + + + + +
+
+

Image Attachments with small images

+ + + That's a very small logo image! + + + +

Image Attachments with large images

+ + + Hey guys, check out this awesome, cute, and totally amazing dragon! + + + +

System Messages

+ + + Welcome, Snazzah. We hope you brought pizza. + + + + + + Snazzah has added Discord Developers #discord-api-announcements to this channel. Its most important updates will + show up here. + + Favna just boosted the server! + + Favna started a thread: Skyra Suggestion Thread. See all threads. + + + + Snazzah added Favna to the group. + Favna started a call that lasted an hour. + Snazzah changed the channel icon. + + Snazzah changed the channel name: A humble Group DM + + You missed a call from Favna that lasted a minute. + Favna left the group. + +

Threads

+ + + Favna started a thread: Skyra Suggestion Thread. See all threads. + + Pong! + + + + Let's make a thread! + There are no messages in this thread yet. + + +

Reactions

+ + + React to this message! + + + + + + + +

Replies

+ + + What do you think about this image? + Looks nice! + + + Looks nice! + I agree! + + +

Replies in Compact Mode

+ + + What do you think about this image? + Looks nice! + + + Looks nice! + I agree! + + +

Commands

+ + + + Pong! + + + Pong! + Took 100ms. + + +

Commands in Compact Mode

+ + + + Pong! + + + Pong! + Took 100ms. + + +

Components

+ + + Here are some components! + + + Primary Button + Secondary Button + Green Button + Red Button + Link + + + Primary Button + Secondary Button + Green Button + Red Button + Link + + + + +

Verified Discord bots

+ + Wow I just got verified! + +

Full embed example

+ + + + + Sapphire is a next-gen object-oriented + Discord.js + bot framework.

Sapphire is a community driven framework that aims to give you all the features you need to + make your Discord bot.

With a history of many other Discord bot frameworks (both for NodeJS and other + languages) to inspire Sapphire, it has become the ultimate modern experience of writing your code. +
+ + 1 year ago + yarn add @sapphire/framework + +
    +
  • +
    + +
    +
    Advanced plugin support
    +
  • +
  • +
    + +
    +
    Supports both CommonJS and ESM
    +
  • +
  • +
    + +
    +
    Completely modular and extendable
    +
  • +
  • +
    + +
    +
    Designed with first class TypeScript support in mind
    +
  • +
  • +
    + +
    +
    Includes optional utilities that you can use in any project
    +
  • +
+
+
+ + Open source libraries to aid in the creation of Discord bots + +
+
+
+

Embed description built-in styling example

+ + + + + You can use several HTML tags to get discord-like styling in your embed description: +
    +
  • <code>content</code> for content
  • +
  • <code class="multiline">content</code> for content
  • +
  • + <pre>content</pre> for +
    content
    +
  • +
  • <img class="emoji" /> for
  • +
  • + <blockquote>content</blockquote> for +
    content
    +
  • +
  • <span class="spoiler">content</span> for content
  • +
+ + +
+
+
+
+

Server crosspost messages

+ + + Hey peeps! +
+
+ We have a redesigned website over at + https://discord.js.org/ +
+ Check it out if you want or not +
+
+ You're most likely using a cached version of the old website because of our service worker, so make sure to clear your cache + and any cookies/service workers you have. For some of you nothing needs to be done, for others a so called "hard-refresh" will + do the trick too. +
+
+ Bugs and improvement requests go into our + site-discussion + channel (you have to be in the server for this) +
+
+

Embedded video

+ + + + + + +

Embed fields

+ + + + + + Some value here. Some value here. Some value here. + + + Some value here. Some value here. Some value here. + + + Some value here. Some value here. Some value here. + + + + + +

A tenor-gif in video format

+ + + + + +

Inline fields

+ + + + + Some value here + Some value here + Some value here + + + + +

Inline fields with a thumbnail

+ + + + + Some value here + Some value here + Some value here + + + + +
+
+ + diff --git a/packages/discord-components-core/src/index.ts b/packages/discord-components-core/src/index.ts new file mode 100644 index 0000000..b566ca1 --- /dev/null +++ b/packages/discord-components-core/src/index.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './options'; diff --git a/packages/discord-components-core/src/options.ts b/packages/discord-components-core/src/options.ts new file mode 100644 index 0000000..e35c0e0 --- /dev/null +++ b/packages/discord-components-core/src/options.ts @@ -0,0 +1,65 @@ +export interface Avatars { + default: 'blue' | 'gray' | 'green' | 'orange' | 'red'; + blue?: string; + gray?: string; + green?: string; + orange?: string; + red?: string; + [key: string]: string | undefined; +} + +export interface Profile { + author?: string; + avatar?: string; + bot?: boolean; + verified?: boolean; + server?: boolean; + op?: boolean; + roleColor?: string; + roleIcon?: string; + roleName?: string; +} + +export interface DiscordMessageOptions { + avatars?: Avatars; + profiles?: { [key: string]: Profile }; + emojis?: { [key: string]: Emoji }; + defaultTheme?: string; + defaultMode?: string; + defaultBackground?: 'discord' | 'none'; +} + +export const defaultDiscordAvatars: Omit = { + blue: 'https://cdn.discordapp.com/embed/avatars/0.png', + gray: 'https://cdn.discordapp.com/embed/avatars/1.png', + green: 'https://cdn.discordapp.com/embed/avatars/2.png', + orange: 'https://cdn.discordapp.com/embed/avatars/3.png', + red: 'https://cdn.discordapp.com/embed/avatars/4.png', + pink: 'https://cdn.discordapp.com/embed/avatars/5.png' +}; + +export interface Emoji { + name?: string; + url?: string; + embedEmoji?: boolean; +} + +const globalAvatars: Avatars = window.$discordMessage?.avatars ?? ({} as Avatars); + +export const avatars: Avatars = Object.assign(defaultDiscordAvatars, globalAvatars, { + default: defaultDiscordAvatars[globalAvatars.default] ?? globalAvatars.default ?? defaultDiscordAvatars.blue +}); + +export const profiles: { [key: string]: Profile } = window.$discordMessage?.profiles ?? {}; + +export const defaultTheme: string = window.$discordMessage?.defaultTheme === 'light' ? 'light' : 'dark'; + +export const defaultMode: string = window.$discordMessage?.defaultMode === 'compact' ? 'compact' : 'cozy'; + +export const defaultBackground: string = window.$discordMessage?.defaultBackground === 'none' ? 'none' : 'discord'; + +declare global { + interface Window { + $discordMessage: DiscordMessageOptions; + } +} diff --git a/packages/discord-components-core/src/util.ts b/packages/discord-components-core/src/util.ts new file mode 100644 index 0000000..425b017 --- /dev/null +++ b/packages/discord-components-core/src/util.ts @@ -0,0 +1,22 @@ +import type { Emoji } from './options'; + +export type DiscordTimestamp = Date | string | null; + +export const handleTimestamp = (value: DiscordTimestamp, hour24 = false): string | null => { + if (!(value instanceof Date) && typeof value !== 'string') { + throw new TypeError('Timestamp prop must be a Date object or a string.'); + } + + return new Date(value) + .toLocaleDateString(undefined, { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + hour12: !hour24 + }) + .replace(',', ''); +}; + +export const getGlobalEmojiUrl = (emojiName: string): Emoji | undefined => window.$discordMessage?.emojis?.[emojiName]; diff --git a/packages/discord-components-core/static/aichansmile.png b/packages/discord-components-core/static/aichansmile.png new file mode 100644 index 0000000..7ec613d Binary files /dev/null and b/packages/discord-components-core/static/aichansmile.png differ diff --git a/packages/discord-components-core/static/avafive.png b/packages/discord-components-core/static/avafive.png new file mode 100644 index 0000000..e7aeabc Binary files /dev/null and b/packages/discord-components-core/static/avafive.png differ diff --git a/packages/discord-components-core/static/avafour.png b/packages/discord-components-core/static/avafour.png new file mode 100644 index 0000000..6e28d6d Binary files /dev/null and b/packages/discord-components-core/static/avafour.png differ diff --git a/packages/discord-components-core/static/avaone.png b/packages/discord-components-core/static/avaone.png new file mode 100644 index 0000000..6cf3cf4 Binary files /dev/null and b/packages/discord-components-core/static/avaone.png differ diff --git a/packages/discord-components-core/static/avathree.png b/packages/discord-components-core/static/avathree.png new file mode 100644 index 0000000..6de5e7b Binary files /dev/null and b/packages/discord-components-core/static/avathree.png differ diff --git a/packages/discord-components-core/static/avatwo.png b/packages/discord-components-core/static/avatwo.png new file mode 100644 index 0000000..32b8005 Binary files /dev/null and b/packages/discord-components-core/static/avatwo.png differ diff --git a/packages/discord-components-core/static/blobparty.gif b/packages/discord-components-core/static/blobparty.gif new file mode 100644 index 0000000..d737af2 Binary files /dev/null and b/packages/discord-components-core/static/blobparty.gif differ diff --git a/packages/discord-components-core/static/booster.png b/packages/discord-components-core/static/booster.png new file mode 100644 index 0000000..b130f76 Binary files /dev/null and b/packages/discord-components-core/static/booster.png differ diff --git a/packages/discord-components-core/static/diamond.png b/packages/discord-components-core/static/diamond.png new file mode 100644 index 0000000..85f79d9 Binary files /dev/null and b/packages/discord-components-core/static/diamond.png differ diff --git a/packages/discord-components-core/static/discordjs.png b/packages/discord-components-core/static/discordjs.png new file mode 100644 index 0000000..c7fb751 Binary files /dev/null and b/packages/discord-components-core/static/discordjs.png differ diff --git a/packages/discord-components-core/static/dragonite.png b/packages/discord-components-core/static/dragonite.png new file mode 100644 index 0000000..8f0059b Binary files /dev/null and b/packages/discord-components-core/static/dragonite.png differ diff --git a/packages/discord-components-core/static/eyes.svg b/packages/discord-components-core/static/eyes.svg new file mode 100644 index 0000000..46a268f --- /dev/null +++ b/packages/discord-components-core/static/eyes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/discord-components-core/static/pikawow.png b/packages/discord-components-core/static/pikawow.png new file mode 100644 index 0000000..eb1e33b Binary files /dev/null and b/packages/discord-components-core/static/pikawow.png differ diff --git a/packages/discord-components-core/static/sapphire.png b/packages/discord-components-core/static/sapphire.png new file mode 100644 index 0000000..548cddf Binary files /dev/null and b/packages/discord-components-core/static/sapphire.png differ diff --git a/packages/discord-components-core/static/skyra.png b/packages/discord-components-core/static/skyra.png new file mode 100644 index 0000000..5c4223d Binary files /dev/null and b/packages/discord-components-core/static/skyra.png differ diff --git a/packages/discord-components-core/static/skyralounge.gif b/packages/discord-components-core/static/skyralounge.gif new file mode 100644 index 0000000..b3cfd1d Binary files /dev/null and b/packages/discord-components-core/static/skyralounge.gif differ diff --git a/packages/discord-components-core/static/stencil.png b/packages/discord-components-core/static/stencil.png new file mode 100644 index 0000000..feb5d04 Binary files /dev/null and b/packages/discord-components-core/static/stencil.png differ diff --git a/packages/discord-components-core/static/tcd.png b/packages/discord-components-core/static/tcd.png new file mode 100644 index 0000000..b4b5815 Binary files /dev/null and b/packages/discord-components-core/static/tcd.png differ diff --git a/packages/discord-components-core/static/thumbsup.svg b/packages/discord-components-core/static/thumbsup.svg new file mode 100644 index 0000000..595672d --- /dev/null +++ b/packages/discord-components-core/static/thumbsup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/discord-components-core/stencil.config.ts b/packages/discord-components-core/stencil.config.ts new file mode 100644 index 0000000..da7855f --- /dev/null +++ b/packages/discord-components-core/stencil.config.ts @@ -0,0 +1,31 @@ +import type { Config } from '@stencil/core'; +import { reactOutputTarget } from '@stencil/react-output-target'; + +export const config: Config = { + namespace: 'derockdev-discord-components-core', + extras: { + experimentalImportInjection: true + }, + outputTargets: [ + reactOutputTarget({ + componentCorePackage: '@derockdev/discord-components-core', + proxiesFile: '../react/src/index.ts', + includeDefineCustomElements: true, + includePolyfills: false + }), + { + type: 'dist', + empty: true, + esmLoaderPath: '../loader' + }, + { + type: 'docs-readme', + strict: true + }, + { + type: 'www', + serviceWorker: null, + copy: [{ src: '../static', dest: 'static/' }] + } + ] +}; diff --git a/packages/discord-components-core/tsconfig.eslint.json b/packages/discord-components-core/tsconfig.eslint.json new file mode 100644 index 0000000..a02f192 --- /dev/null +++ b/packages/discord-components-core/tsconfig.eslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.eslint.json", + "compilerOptions": { + "jsxFactory": "h" + }, + "include": ["src"] +} diff --git a/packages/discord-components-core/tsconfig.json b/packages/discord-components-core/tsconfig.json new file mode 100644 index 0000000..ed87376 --- /dev/null +++ b/packages/discord-components-core/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "jsxFactory": "h", + "experimentalDecorators": true + }, + "include": ["src"] +} diff --git a/packages/discord-components-react/.eslintignore b/packages/discord-components-react/.eslintignore new file mode 100644 index 0000000..9c8ce89 --- /dev/null +++ b/packages/discord-components-react/.eslintignore @@ -0,0 +1 @@ +./**/* \ No newline at end of file diff --git a/packages/discord-components-react/.eslintrc.json b/packages/discord-components-react/.eslintrc.json new file mode 100644 index 0000000..a3e71e4 --- /dev/null +++ b/packages/discord-components-react/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "extends": ["../../.eslintrc.json"], + "overrides": [ + { + "files": ["./**/*.ts", "./**/*.tsx"], + "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-unused-vars": "off" + } + } + ] +} diff --git a/packages/discord-components-react/CHANGELOG.md b/packages/discord-components-react/CHANGELOG.md new file mode 100644 index 0000000..1b85c27 --- /dev/null +++ b/packages/discord-components-react/CHANGELOG.md @@ -0,0 +1,386 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.6.0](https://github.com/skyra-project/discord-components/compare/v3.5.0...v3.6.0) (2023-01-23) + +### Bug Fixes + +- update @stencil/core dependency ([df07642](https://github.com/skyra-project/discord-components/commit/df07642b48debf1ecbc05cceaeafd5cfed081c9a)) + +# [3.5.0](https://github.com/skyra-project/discord-components/compare/v3.4.1...v3.5.0) (2022-12-27) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [3.4.1](https://github.com/skyra-project/discord-components/compare/v3.4.0...v3.4.1) (2022-08-06) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [3.4.0](https://github.com/skyra-project/discord-components/compare/v3.3.1...v3.4.0) (2022-05-10) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [3.3.1](https://github.com/skyra-project/discord-components/compare/v3.3.0...v3.3.1) (2022-04-25) + +### Bug Fixes + +- **core:** emit `[@vite-ignore](https://github.com/vite-ignore)` comments on dynamic imports ([ba84b9e](https://github.com/skyra-project/discord-components/commit/ba84b9ec4e8fe81ec452aba4c89b7b481b00ccaa)) +- **deps:** update all non-major dependencies ([#240](https://github.com/skyra-project/discord-components/issues/240)) ([e0e22fe](https://github.com/skyra-project/discord-components/commit/e0e22fe72158f1e9f92d61a5b04c58b7bf546de5)) + +# [3.3.0](https://github.com/skyra-project/discord-components/compare/v3.2.0...v3.3.0) (2022-04-06) + +### Features + +- add `discord-time` component ([#229](https://github.com/skyra-project/discord-components/issues/229)) ([cdf0810](https://github.com/skyra-project/discord-components/commit/cdf08108e9a54e11c75e050ff176a42715aceb49)) + +# [3.2.0](https://github.com/skyra-project/discord-components/compare/v3.1.1...v3.2.0) (2022-04-04) + +### Features + +- add new components to react bundle ([3055336](https://github.com/skyra-project/discord-components/commit/3055336043d0e80c106f13ca05377759383ec36a)) + +## [3.1.1](https://github.com/skyra-project/discord-components/compare/v3.1.0...v3.1.1) (2022-03-10) + +### Bug Fixes + +- rebuild react code ([e1d3766](https://github.com/skyra-project/discord-components/commit/e1d3766a1179ea70d41920ccf34786b27e96b6a7)) + +# [3.1.0](https://github.com/skyra-project/discord-components/compare/v3.0.1...v3.1.0) (2022-01-12) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [3.0.1](https://github.com/skyra-project/discord-components/compare/v3.0.0...v3.0.1) (2022-01-08) + +### Bug Fixes + +- **react:** use createElement named import for better compatibility with Vite ([1d770da](https://github.com/skyra-project/discord-components/commit/1d770daa291ce9222428d228ed7a7f8f9fad6ee8)) + +# [3.0.0](https://github.com/skyra-project/discord-components/compare/v2.13.0...v3.0.0) (2022-01-08) + +### Bug Fixes + +- fixed embed description and footer disappearing when dynamically editing title ([bdec29c](https://github.com/skyra-project/discord-components/commit/bdec29c1999969a2ea0cf1198d3eb1986a80d674)) + +### BREAKING CHANGES + +- `discord-embed` no longer takes the properties `footer-image` and `timestamp`, they are moved to the `discord-embed-footer` component. +- The embed description now has to go into its own component, `discord-embed-description` + +```diff + +- Custom emojis in the embed description: ++ Custom emojis in the embed description: + +``` + +- The embed footer now has to go into its own component, `discord-embed-footer` + +```diff +- ++ +{ /* other embed components */ } +- Open source libraries to aid in the creation of Discord bots ++ ++ Open source libraries to aid in the creation of Discord bots ++ + +``` + +# [2.13.0](https://github.com/skyra-project/discord-components/compare/v2.12.1...v2.13.0) (2021-12-22) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.12.1](https://github.com/skyra-project/discord-components/compare/v2.12.0...v2.12.1) (2021-12-06) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.12.0](https://github.com/skyra-project/discord-components/compare/v2.11.6...v2.12.0) (2021-11-13) + +### Features + +- Add `discord-custom-emoji` component & custom emojis in embed titles ([#168](https://github.com/skyra-project/discord-components/issues/168)) ([61a808e](https://github.com/skyra-project/discord-components/commit/61a808e46f16d3ce9c7ea888e208cd1fcbe30e75)), closes [#163](https://github.com/skyra-project/discord-components/issues/163) + +## [2.11.6](https://github.com/skyra-project/discord-components/compare/v2.11.5...v2.11.6) (2021-11-08) + +### Bug Fixes + +- **react:** fix ESM loading ([8a43f53](https://github.com/skyra-project/discord-components/commit/8a43f5367b48d086bdd46c52d393547bc6209170)) + +## [2.11.5](https://github.com/skyra-project/discord-components/compare/v2.11.4...v2.11.5) (2021-11-08) + +### Bug Fixes + +- **react:** only output ESM bundle ([cf9da04](https://github.com/skyra-project/discord-components/commit/cf9da04318fc5013f8637f01bd4c733b617ad074)) + +## [2.11.4](https://github.com/skyra-project/discord-components/compare/v2.11.3...v2.11.4) (2021-11-08) + +### Bug Fixes + +- **docs:** update nextjs codesandbox link ([4d6382f](https://github.com/skyra-project/discord-components/commit/4d6382fe3538f85cd60ea8aa28e570023b536c98)) + +## [2.11.3](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.3...v2.11.3) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.11.3-alpha.3](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.2...v2.11.3-alpha.3) (2021-11-08) + +### Bug Fixes + +- **react:** add dependency on tslib ([cc0b85e](https://github.com/skyra-project/discord-components/commit/cc0b85e23434611302bc1494aa2a76273912f6d1)) + +## [2.11.3-alpha.2](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.1...v2.11.3-alpha.2) (2021-11-08) + +### Bug Fixes + +- **react:** no longer use esbuild for bundling ([d03ed4d](https://github.com/skyra-project/discord-components/commit/d03ed4d170493380d724d24268b195c1f4e4d71d)) + +## [2.11.3-alpha.1](https://github.com/skyra-project/discord-components/compare/v2.11.3-alpha.0...v2.11.3-alpha.1) (2021-11-08) + +### Bug Fixes + +- debump required nodejs engine to 14.0.0 ([310f9bc](https://github.com/skyra-project/discord-components/commit/310f9bc6cdcafe6fd0d7267ffff70539b981b4be)) + +## [2.11.3-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.11.2...v2.11.3-alpha.0) (2021-11-08) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.11.2](https://github.com/skyra-project/discord-components/compare/v2.11.1...v2.11.2) (2021-10-03) + +### Bug Fixes + +- re-fix react bundle. The output file _has_ to be mjs for this to all work ([946652b](https://github.com/skyra-project/discord-components/commit/946652bb6166e1cf06c681e3fb410ef92975914b)) + +### Reverts + +- Revert "fix(react): fixed output targets" ([129f14f](https://github.com/skyra-project/discord-components/commit/129f14f8aa2f335a7b37f2d2f068ea87623fce49)) + +## [2.11.1](https://github.com/skyra-project/discord-components/compare/v2.11.0...v2.11.1) (2021-10-03) + +### Bug Fixes + +- **react:** fixed output targets ([ba9faf1](https://github.com/skyra-project/discord-components/commit/ba9faf1ba0c04e89eba3e15341879cbc7dd65369)) + +# [2.11.0](https://github.com/skyra-project/discord-components/compare/v2.10.1-alpha.0...v2.11.0) (2021-10-02) + +### Features + +- Thread Accessories ([#150](https://github.com/skyra-project/discord-components/issues/150)) ([232f05d](https://github.com/skyra-project/discord-components/commit/232f05d915fef41486150e2db43589e9fc11c742)) + +## [2.10.1-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.10.0...v2.10.1-alpha.0) (2021-09-21) + +### Bug Fixes + +- output react bundle as `.js` to fix a Webpack issue, not loading named imports of `.mjs` files ([bc166f6](https://github.com/skyra-project/discord-components/commit/bc166f6c80b1b0b491144c179bf1a1cc30b6d1b5)) + +# [2.10.0](https://github.com/skyra-project/discord-components/compare/v2.9.1...v2.10.0) (2021-09-12) + +### Features + +- add `discord-tenor-video` component ([#127](https://github.com/skyra-project/discord-components/issues/127)) ([c90dde0](https://github.com/skyra-project/discord-components/commit/c90dde02c23b8c9d25c676249518c60daeaf5d58)) + +## [2.9.1](https://github.com/skyra-project/discord-components/compare/v2.9.1-alpha.0...v2.9.1) (2021-09-12) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.9.1-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.9.0...v2.9.1-alpha.0) (2021-09-10) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.9.0](https://github.com/skyra-project/discord-components/compare/v2.8.1...v2.9.0) (2021-09-05) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.8.1](https://github.com/skyra-project/discord-components/compare/v2.8.0...v2.8.1) (2021-08-18) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.8.0](https://github.com/skyra-project/discord-components/compare/v2.7.1...v2.8.0) (2021-08-18) + +### Features + +- add component buttons ([#110](https://github.com/skyra-project/discord-components/issues/110)) ([50f78c5](https://github.com/skyra-project/discord-components/commit/50f78c5643277164e791261f8a8af76a8d893015)) + +## [2.7.1](https://github.com/skyra-project/discord-components/compare/v2.7.0...v2.7.1) (2021-08-07) + +### Bug Fixes + +- **react:** minify build output ([932aaf8](https://github.com/skyra-project/discord-components/commit/932aaf875afb493c818487fd07f8c642e3935a02)) + +# [2.7.0](https://github.com/skyra-project/discord-components/compare/v2.6.0...v2.7.0) (2021-08-07) + +### Features + +- add system messages ([#105](https://github.com/skyra-project/discord-components/issues/105)) ([53440f4](https://github.com/skyra-project/discord-components/commit/53440f44cbe30d7458cc9e38f30c7636483b4a7a)) + +# [2.6.0](https://github.com/skyra-project/discord-components/compare/v2.5.0...v2.6.0) (2021-08-05) + +### Features + +- add replies (+ style changes) ([#103](https://github.com/skyra-project/discord-components/issues/103)) ([065e452](https://github.com/skyra-project/discord-components/commit/065e452f9d0386dfd1b426793aca4c7f07c9c0ae)) + +# [2.5.0](https://github.com/skyra-project/discord-components/compare/v2.4.0...v2.5.0) (2021-08-04) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.4.0](https://github.com/skyra-project/discord-components/compare/v2.3.0...v2.4.0) (2021-07-25) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.3.0](https://github.com/skyra-project/discord-components/compare/v2.2.0...v2.3.0) (2021-07-25) + +### Features + +- add reactions ([#96](https://github.com/skyra-project/discord-components/issues/96)) ([3bb19a6](https://github.com/skyra-project/discord-components/commit/3bb19a69912b9666f922c36eabe6fb959b4fc495)) + +# [2.2.0](https://github.com/skyra-project/discord-components/compare/v2.1.1...v2.2.0) (2021-07-22) + +### Features + +- add invite and attachments container components ([#94](https://github.com/skyra-project/discord-components/issues/94)) ([3b782a0](https://github.com/skyra-project/discord-components/commit/3b782a0147a46ce8779bd7387786a07fdc94f5ac)) + +## [2.1.1](https://github.com/skyra-project/discord-components/compare/v2.1.0...v2.1.1) (2021-07-10) + +### Bug Fixes + +- **readme:** update urls and add nextJS demo ([551f9e7](https://github.com/skyra-project/discord-components/commit/551f9e763a48b0854450054404476e6d641a77d3)) + +# [2.1.0](https://github.com/skyra-project/discord-components/compare/v2.0.9...v2.1.0) (2021-06-26) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.9](https://github.com/skyra-project/discord-components/compare/v2.0.8...v2.0.9) (2021-06-21) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.8](https://github.com/skyra-project/discord-components/compare/v2.0.7...v2.0.8) (2021-06-21) + +### Bug Fixes + +- **docs:** remove default font from ToC ([82a1281](https://github.com/skyra-project/discord-components/commit/82a1281e84c51287ad01282d399c1be530d8ab2d)) + +## [2.0.6](https://github.com/skyra-project/discord-components/compare/v2.0.5...v2.0.6) (2021-05-19) + +### Bug Fixes + +- specify sideEffects and fix `es2015` and `es2017` file paths ([b759b3c](https://github.com/skyra-project/discord-components/commit/b759b3c4ca9e505b49592d4152f1b5ada4876cc5)) + +## [2.0.5](https://github.com/skyra-project/discord-components/compare/v2.0.4...v2.0.5) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.4](https://github.com/skyra-project/discord-components/compare/v2.0.3...v2.0.4) (2021-05-15) + +### Bug Fixes + +- change links from discord-message-components to discord-components ([5a8e1e1](https://github.com/skyra-project/discord-components/commit/5a8e1e1e0b3a34020a91f0dae9464141195d8fab)) + +## [2.0.3](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.3...v2.0.3) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.3-alpha.3](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.2...v2.0.3-alpha.3) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.3-alpha.2](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.1...v2.0.3-alpha.2) (2021-05-15) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [2.0.3-alpha.1](https://github.com/skyra-project/discord-components/compare/v2.0.3-alpha.0...v2.0.3-alpha.1) (2021-05-15) + +### Bug Fixes + +- fixed package bundling ([11d2627](https://github.com/skyra-project/discord-components/commit/11d2627bad707a1997e286a02b3004035dfdb306)) + +### Features + +- use whitney font as default font ([d7c9267](https://github.com/skyra-project/discord-components/commit/d7c9267a7680df5a3b8c7dbab5e14f673ada162b)) + +## [2.0.3-alpha.0](https://github.com/skyra-project/discord-components/compare/v2.0.2...v2.0.3-alpha.0) (2021-03-20) + +### Bug Fixes + +- **react:** move core from peer to regular dependencies ([8d1e3ff](https://github.com/skyra-project/discord-components/commit/8d1e3ff85a519b27f5590d9f01e98111de7695ae)) +- fixed readmes and such ([bdb8846](https://github.com/skyra-project/discord-components/commit/bdb8846db2ded36567ef624ddddedf95f59e549b)) + +## [2.0.2](https://github.com/skyra-project/discord-components/compare/v2.0.1...v2.0.2) (2020-10-26) + +### Bug Fixes + +- **react:** allow peer dependency of React 17 and Core 2 ([ae5fb27](https://github.com/skyra-project/discord-components/commit/ae5fb278643f68714bc646697e97269686517eb3)) + +## [2.0.1](https://github.com/skyra-project/discord-components/compare/v2.0.0...v2.0.1) (2020-10-07) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [2.0.0](https://github.com/skyra-project/discord-components/compare/v1.3.0...v2.0.0) (2020-09-05) + +### Features + +- bumped stencil-core to v2 ([59ef71e](https://github.com/skyra-project/discord-components/commit/59ef71e48ac786edb35b7c52523206104796a9f0)), closes [/github.com/ionic-team/stencil/blob/master/CHANGELOG.md#-200-2020-08-31](https://github.com//github.com/ionic-team/stencil/blob/master/CHANGELOG.md/issues/-200-2020-08-31) [#12](https://github.com/skyra-project/discord-components/issues/12) + +### BREAKING CHANGES + +- IE11, Edge 16-18, Safari 10 and ES5 builds and support for them is fully removed + now. Also some files are exported under different names in core. For a full list see + +# [1.3.0](https://github.com/skyra-project/discord-components/compare/v1.2.2...v1.3.0) (2020-07-26) + +### Features + +- rename master branch to main ([0bc3666](https://github.com/skyra-project/discord-components/commit/0bc36663a83ab55df4ebb96fc9c69d6809008934)) + +## [1.2.2](https://github.com/skyra-project/discord-components/compare/v1.2.1...v1.2.2) (2020-07-13) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [1.2.1](https://github.com/skyra-project/discord-components/compare/v1.2.0...v1.2.1) (2020-07-08) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [1.2.0](https://github.com/skyra-project/discord-components/compare/v1.1.4...v1.2.0) (2020-07-07) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [1.1.4](https://github.com/skyra-project/discord-components/compare/v1.1.3...v1.1.4) (2020-07-06) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [1.1.3](https://github.com/skyra-project/discord-components/compare/v1.1.2...v1.1.3) (2020-07-06) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [1.1.2](https://github.com/skyra-project/discord-components/compare/v1.1.1...v1.1.2) (2020-06-27) + +### Bug Fixes + +- bump package, regenerate react output ([07af3cc](https://github.com/skyra-project/discord-components/commit/07af3cc4e3ab3df728c4ed91341af2e7a5db3239)) + +## [1.1.1](https://github.com/skyra-project/discord-components/compare/v1.1.0...v1.1.1) (2020-06-06) + +### Bug Fixes + +- bump packages, fixing some stenciljs bugs ([2ac34a9](https://github.com/skyra-project/discord-components/commit/2ac34a9abca911e1abffc9671cb75cb24357335a)) + +# [1.1.0](https://github.com/skyra-project/discord-components/compare/v1.0.1...v1.1.0) (2020-05-19) + +**Note:** Version bump only for package @skyra/discord-components-react + +## [1.0.1](https://github.com/skyra-project/discord-components/compare/v1.0.0...v1.0.1) (2020-05-10) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [1.0.0](https://github.com/skyra-project/discord-components/compare/v1.0.0-alpha.1...v1.0.0) (2020-05-10) + +**Note:** Version bump only for package @skyra/discord-components-react + +# [1.0.0-alpha.1](https://github.com/skyra-project/discord-components/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2020-05-10) + +**Note:** Version bump only for package @skyra/discord-components-react + +# 1.0.0-alpha.0 (2020-05-10) + +### Features + +- create packages ([1ad5856](https://github.com/skyra-project/discord-components/commit/1ad58560916d3988e8dffc58ad97a52828ff5d35)) diff --git a/packages/discord-components-react/README.md b/packages/discord-components-react/README.md new file mode 100644 index 0000000..c0c5d99 --- /dev/null +++ b/packages/discord-components-react/README.md @@ -0,0 +1,291 @@ +# `@derockdev/discord-components-react` +A fork of [@skyra/discord-components-react](https://github.com/skyra-project/discord-components) designed for use in [discord-html-transcripts](https://github.com/itzderock/discord-html-transcripts) + +## Changes +- Adds all the new components in `@derockdev/discord-components-core` + +## Original README + +
+ +# @skyra/discord-components-react + +**React bindings for [@skyra/discord-components-core](https://github.com/skyra-project/discord-components/tree/main/packages/core)** + +[![License](https://img.shields.io/github/license/skyra-project/discord-components?logo=github&maxAge=3600&style=flat-square)](https://github.com/skyra-project/discord-components/blob/main/LICENSE.md) +[![Patreon](https://img.shields.io/badge/donate-patreon-F96854.svg?logo=patreon)](https://donate.skyra.pw/patreon) + +[![npm](https://img.shields.io/npm/v/@skyra/discord-components-react?color=crimson&logo=npm&style=flat-square&label=@skyra/discord-components-react)](https://www.npmjs.com/package/@skyra/discord-components-react) +[![npm](https://img.shields.io/npm/dt/@skyra/discord-components-react.svg?maxAge=3600&logo=npm)](https://www.npmjs.com/package/@skyra/discord-components-react) +[![npm](https://img.shields.io/bundlephobia/min/@skyra/discord-components-react?label=minified&logo=webpack&maxAge=3600)](https://bundlephobia.com/result?p=@skyra/discord-components-react) +[![Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d)](https://stenciljs.com) + +[![Support Server](https://discord.com/api/guilds/254360814063058944/embed.png?style=banner2)](https://join.skyra.pw) + +
+ +--- + +**_Table of Contents_** + +- [@skyra/discord-components-react](#skyradiscord-components-react) + - [Description](#description) + - [Features](#features) + - [Installation](#installation) + - [Usage](#usage) + - [Live Demo (Create React App)](#live-demo-create-react-app) + - [Live Demo (NextJS)](#live-demo-nextjs) + * [Sample code](#sample-code) + - [Notes](#notes) + - [TypeScript module augments](#typescript-module-augments) + - [Avatar shortcuts](#avatar-shortcuts) + - [Profile shortcuts](#profile-shortcuts) + - [Theming](#theming) + - [Components notes](#components-notes) + - [DiscordMessages component](#discordmessages-component) + - [DiscordMention component](#discordmention-component) + - [DiscordEmbed component](#discordembed-component) + - [EmbedFields component](#embedfields-component) + - [EmbedField component](#embedfield-component) + - [Screenshots](#screenshots) + - [Dark Mode](#dark-mode) + - [Light Mode](#light-mode) + - [Contributors](#contributors) + +## Description + +Discord message components to easily build and display fake Discord messages on your webpage. + +**This is an adaptation of [wc-discord-message] from [Danktuary]** + +## Features + +- Design modelled after [Discord](https://discord.com/) itself +- Comfy and compact mode support +- Dark and light themes support +- Set the message author's username, avatar (use defaults or provide your own), role color, and "bot" tag status +- Display fake user, role, and channel mentions +- Complete embed support +- Simple syntax! + +## Installation + +```bash +yarn add @skyra/discord-components-core @skyra/discord-components-react +# or npm install @skyra/discord-components-core @skyra/discord-components-react +``` + +## Usage + +#### Live Demo (Create React App) + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-create-react-app-64k90) + +#### Live Demo (NextJS) + +[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/discord-components-nextjs-ovqfu) + +### Sample code + +The syntax is kept fairly simple. Here's a basic example of a regular conversation: + +```tsx + + Hey guys, I'm new here! Glad to be able to join you all! + + Hi, I'm new here too! + + + Hey, User and Dawn. Welcome to our server! + + +``` + +## Notes + +### TypeScript module augments + +This module uses a custom object on the browser `window` for configuration. In order to this you will need to include the following snippet in your source code when working in TypeScript: + +```ts +import type { DiscordMessageOptions } from '@skyra/discord-components-core/dist/types/options'; + +declare global { + interface Window { + $discordMessage: DiscordMessageOptions; + } +} +``` + +### Avatar shortcuts + +The current avatar shortcut strings available are "blue" (default), "gray", "green", "orange", and "red". These shortcuts map to the following image links: + +```json +{ + "blue": "https://cdn.discordapp.com/attachments/654503812593090602/665721745466195978/blue.png", + "gray": "https://cdn.discordapp.com/attachments/654503812593090602/665721746569166849/gray.png", + "green": "https://cdn.discordapp.com/attachments/654503812593090602/665721748431306753/green.png", + "orange": "https://cdn.discordapp.com/attachments/654503812593090602/665721750201434138/orange.png", + "red": "https://cdn.discordapp.com/attachments/654503812593090602/665721752277483540/red.png" +} +``` + +If you want to add to or override the shortcuts, you can set them via `window.$discordMessage.avatars`. + +```ts +window.$discordMessage = { + avatars: { + default: 'blue', + skyra: 'https://github.com/NM-EEA-Y.png', + djs: require('./assets/discord-avatar-djs.png') // You can use require syntax as well + } +}; +``` + +### Profile shortcuts + +Sometimes you'll want to use the same message data across multiple messages. You can do so by providing an object of profiles in `window.$discordMessage.profiles`. + +```ts +window.$discordMessage = { + profiles: { + skyra: { + author: 'Skyra', + avatar: 'https://github.com/NM-EEA-Y.png', + bot: true, + verified: true, + roleColor: '#1e88e5' + }, + favna: { + author: 'Favna', + avatar: 'https://github.com/favna.png', + roleColor: '#ff0000' + } + } +}; +``` + +And then in your React code: + +```tsx + + + Welcome to our server, Favna! + + Hey, glad to be here! + +``` + +### Theming + +Each of the components accepts the standard HTML properties for passing styling, such as `className` for passing CSS classes (JSS / CSS / SCSS etc.) or `style` to pass inline style. + +You can also pass your own custom HTML tags, for example set a `data-qa` to be able to navigate to the component in your unit tests / end-to-end tests + +### Components notes + +Below are notes for a few certain components. If you want to see what props each component has, check their readme.md file in [the respective folder]. + +#### DiscordMessages component + +This is a wrapper for any child `` component. It must be used in order for messages to display properly. + +#### DiscordMention component + +If the default slot is left empty, the mention will be rendered as `'User'`, `'Role'`, or `'channel`', depending on the `type` prop given. + +#### DiscordEmbed component + +An embed that can be attached to the end of your messages. The default slot is used for the embed's description. The `footer` slot is used for the footer text. + +To ensure the embed gets displayed correctly inside your message, be sure to give it the proper `slot` attribute. + +```tsx + + Hi, I'm part of the normal message content. + + Hi, I'm part of the embed message content. + + +``` + +#### EmbedFields component + +A wrapper for any child `` components. Must be used in order for fields to display properly. To ensure the embed fields gets displayed correctly inside your embed, be sure to give it the proper `slot` attribute. + +```tsx + + + Hi, I'm part of the embed message content. + + + + + +``` + +#### EmbedField component + +At least 2 consecutive fields need to be marked as inline in order for them to actually display next to each other. The maximum amount of inline fields is 3, and drops to 2 if an embed thumbnail is used. + +```tsx + + + Hi, I'm part of the embed message content. + + + Field content. + + + Field content. + + + + +``` + +## Screenshots + +### Dark Mode + +**_A normal conversation_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/normal_conversation.png) + +**_Compact mode_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/compact_mode.png) + +**_With an embed_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/dark_mode/with_embed.png) + +### Light Mode + +**_A normal conversation_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/normal_conversation.png) + +**_Compact mode_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/compact_mode.png) + +**_With an embed_** + +![](https://raw.githubusercontent.com/skyra-project/discord-components/main/assets/light_mode/with_embed.png) + +## Contributors + +Please make sure to read the [Contributing Guide][contributing] before making a pull request. + +Thank you to all the people who already contributed to Skyra Project! + + + + + +[contributing]: https://github.com/skyra-project/.github/blob/main/.github/CONTRIBUTING.md +[wc-discord-message]: https://github.com/Danktuary/wc-discord-message +[danktuary]: https://github.com/Danktuary +[the respective folder]: (https://github.com/skyra-project/discord-components/blob/main/packages/core/src/components/) diff --git a/packages/discord-components-react/package.json b/packages/discord-components-react/package.json new file mode 100644 index 0000000..e481948 --- /dev/null +++ b/packages/discord-components-react/package.json @@ -0,0 +1,67 @@ +{ + "name": "@derockdev/discord-components-react", + "version": "3.5.2", + "description": "React bindings for @derockdev/discord-components-core", + "author": "@derockdev", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.mjs", + "typings": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "sideEffects": [ + "./dist/index.mjs", + "./dist/index.js" + ], + "homepage": "https://github.com/itzderock/discord-components/tree/main/packages/react#readme", + "scripts": { + "clean": "node scripts/clean.mjs", + "build": "pnpm clean && tsc && gen-esm-wrapper dist/index.js dist/index.mjs && replace-in-file --configFile=scripts/replaceDefaultMod.cjs" + }, + "dependencies": { + "@derockdev/discord-components-core": "^3.5.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "react": "16.8.x || 17.x || 18.x", + "react-dom": "16.8.x || 17.x || 18.x" + }, + "directories": { + "lib": "src" + }, + "files": [ + "dist", + "!dist/*.tsbuildinfo" + ], + "engines": { + "node": ">=v14.0.0" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/skyra-project/discord-components.git" + }, + "bugs": { + "url": "https://github.com/skyra-project/discord-components/issues" + }, + "keywords": [ + "skyra", + "typescript", + "ts", + "yarn", + "discord", + "bot", + "components", + "webcomponents", + "stencil", + "react" + ], + "devDependencies": { + "gen-esm-wrapper": "^1.1.3", + "replace-in-file": "^6.3.5" + } +} diff --git a/packages/discord-components-react/pnpm-lock.yaml b/packages/discord-components-react/pnpm-lock.yaml new file mode 100644 index 0000000..7a219b2 --- /dev/null +++ b/packages/discord-components-react/pnpm-lock.yaml @@ -0,0 +1,247 @@ +lockfileVersion: 5.4 + +specifiers: + '@derockdev/discord-components-core': ^3.4.1 + gen-esm-wrapper: ^1.1.3 + replace-in-file: ^6.3.5 + tslib: ^2.4.0 + +dependencies: + '@derockdev/discord-components-core': link:../core + tslib: 2.4.0 + +devDependencies: + gen-esm-wrapper: 1.1.3 + replace-in-file: 6.3.5 + +packages: + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /assert/1.5.0: + resolution: {integrity: sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==} + dependencies: + object-assign: 4.1.1 + util: 0.10.3 + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /gen-esm-wrapper/1.1.3: + resolution: {integrity: sha512-LNHZ+QpaCW/0VhABIbXn45V+P8kFvjjwuue9hbV23eOjuFVz6c0FE3z1XpLX9pSjLW7UmtCkXo5F9vhZWVs8oQ==} + hasBin: true + dependencies: + is-valid-identifier: 2.0.2 + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.1 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.1: + resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-valid-identifier/2.0.2: + resolution: {integrity: sha512-mpS5EGqXOwzXtKAg6I44jIAqeBfntFLxpAth1rrKbxtKyI6LPktyDYpHBI+tHlduhhX/SF26mFXmxQu995QVqg==} + dependencies: + assert: 1.5.0 + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /replace-in-file/6.3.5: + resolution: {integrity: sha512-arB9d3ENdKva2fxRnSjwBEXfK1npgyci7ZZuwysgAp7ORjHSyxz6oqIjTEv8R0Ydl4Ll7uOAZXL4vbkhGIizCg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + chalk: 4.1.2 + glob: 7.2.3 + yargs: 17.5.1 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /tslib/2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: false + + /util/0.10.3: + resolution: {integrity: sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==} + dependencies: + inherits: 2.0.1 + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs/17.5.1: + resolution: {integrity: sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==} + engines: {node: '>=12'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true diff --git a/packages/discord-components-react/scripts/clean.mjs b/packages/discord-components-react/scripts/clean.mjs new file mode 100644 index 0000000..cd5a100 --- /dev/null +++ b/packages/discord-components-react/scripts/clean.mjs @@ -0,0 +1,9 @@ +import { rm } from 'node:fs/promises'; + +const distFolder = new URL('../dist', import.meta.url); + +const options = { recursive: true, force: true }; + +await Promise.all([ + rm(distFolder, options) // +]); diff --git a/packages/discord-components-react/scripts/replaceDefaultMod.cjs b/packages/discord-components-react/scripts/replaceDefaultMod.cjs new file mode 100644 index 0000000..34f3fcb --- /dev/null +++ b/packages/discord-components-react/scripts/replaceDefaultMod.cjs @@ -0,0 +1,9 @@ +// eslint-disable-next-line @typescript-eslint/unbound-method, @typescript-eslint/no-var-requires +const { resolve } = require('path'); + +module.exports = { + from: 'export default mod;\n', + to: '', + files: [resolve(__dirname, '../dist/index.mjs')], + quiet: true +}; diff --git a/packages/discord-components-react/src/index.ts b/packages/discord-components-react/src/index.ts new file mode 100644 index 0000000..9bb67d7 --- /dev/null +++ b/packages/discord-components-react/src/index.ts @@ -0,0 +1,47 @@ +/* eslint-disable */ +/* tslint:disable */ +/* auto-generated react proxies */ +import { createReactComponent } from './react-component-lib'; + +import type { JSX } from '@derockdev/discord-components-core'; + +import { defineCustomElements } from '@derockdev/discord-components-core/loader'; + +defineCustomElements(); +export const DiscordActionRow = /*@__PURE__*/ createReactComponent('discord-action-row'); +export const DiscordAttachment = /*@__PURE__*/ createReactComponent('discord-attachment'); +export const DiscordAttachments = /*@__PURE__*/ createReactComponent('discord-attachments'); +export const DiscordBold = /*@__PURE__*/ createReactComponent('discord-bold'); +export const DiscordButton = /*@__PURE__*/ createReactComponent('discord-button'); +export const DiscordCodeBlock = /*@__PURE__*/ createReactComponent('discord-code-block'); +export const DiscordCommand = /*@__PURE__*/ createReactComponent('discord-command'); +export const DiscordCustomEmoji = /*@__PURE__*/ createReactComponent('discord-custom-emoji'); +export const DiscordEmbed = /*@__PURE__*/ createReactComponent('discord-embed'); +export const DiscordEmbedDescription = /*@__PURE__*/ createReactComponent( + 'discord-embed-description' +); +export const DiscordEmbedField = /*@__PURE__*/ createReactComponent('discord-embed-field'); +export const DiscordEmbedFields = /*@__PURE__*/ createReactComponent('discord-embed-fields'); +export const DiscordEmbedFooter = /*@__PURE__*/ createReactComponent('discord-embed-footer'); +export const DiscordHeader = /*@__PURE__*/ createReactComponent('discord-header'); +export const DiscordInlineCode = /*@__PURE__*/ createReactComponent('discord-inline-code'); +export const DiscordInvite = /*@__PURE__*/ createReactComponent('discord-invite'); +export const DiscordItalic = /*@__PURE__*/ createReactComponent('discord-italic'); +export const DiscordMention = /*@__PURE__*/ createReactComponent('discord-mention'); +export const DiscordMessage = /*@__PURE__*/ createReactComponent('discord-message'); +export const DiscordMessages = /*@__PURE__*/ createReactComponent('discord-messages'); +export const DiscordQuote = /*@__PURE__*/ createReactComponent('discord-quote'); +export const DiscordReaction = /*@__PURE__*/ createReactComponent('discord-reaction'); +export const DiscordReactions = /*@__PURE__*/ createReactComponent('discord-reactions'); +export const DiscordReply = /*@__PURE__*/ createReactComponent('discord-reply'); +export const DiscordSpoiler = /*@__PURE__*/ createReactComponent('discord-spoiler'); +export const DiscordSystemMessage = /*@__PURE__*/ createReactComponent( + 'discord-system-message' +); +export const DiscordTenorVideo = /*@__PURE__*/ createReactComponent('discord-tenor-video'); +export const DiscordThread = /*@__PURE__*/ createReactComponent('discord-thread'); +export const DiscordThreadMessage = /*@__PURE__*/ createReactComponent( + 'discord-thread-message' +); +export const DiscordTime = /*@__PURE__*/ createReactComponent('discord-time'); +export const DiscordUnderlined = /*@__PURE__*/ createReactComponent('discord-underlined'); diff --git a/packages/discord-components-react/src/react-component-lib/createComponent.tsx b/packages/discord-components-react/src/react-component-lib/createComponent.tsx new file mode 100644 index 0000000..d81e4f5 --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/createComponent.tsx @@ -0,0 +1,98 @@ +import React, { createElement } from 'react'; + +import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils'; + +export interface HTMLStencilElement extends HTMLElement { + componentOnReady(): Promise; +} + +interface StencilReactInternalProps extends React.HTMLAttributes { + forwardedRef: React.RefObject; + ref?: React.Ref; +} + +export const createReactComponent = ( + tagName: string, + ReactComponentContext?: React.Context, + manipulatePropsFunction?: (originalProps: StencilReactInternalProps, propsToPass: any) => ExpandedPropsTypes, + defineCustomElement?: () => void +) => { + if (defineCustomElement !== undefined) { + defineCustomElement(); + } + + const displayName = dashToPascalCase(tagName); + const ReactComponent = class extends React.Component> { + componentEl!: ElementType; + + setComponentElRef = (element: ElementType) => { + this.componentEl = element; + }; + + constructor(props: StencilReactInternalProps) { + super(props); + } + + componentDidMount() { + this.componentDidUpdate(this.props); + } + + componentDidUpdate(prevProps: StencilReactInternalProps) { + attachProps(this.componentEl, this.props, prevProps); + } + + render() { + const { children, forwardedRef, style, className, ref, ...cProps } = this.props; + + let propsToPass = Object.keys(cProps).reduce((acc: any, name) => { + const value = (cProps as any)[name]; + + if (name.startsWith('on') && name[2] === name[2].toUpperCase()) { + const eventName = name.substring(2).toLowerCase(); + if (typeof document !== 'undefined' && isCoveredByReact(eventName)) { + acc[name] = value; + } + } else { + // we should only render strings, booleans, and numbers as attrs in html. + // objects, functions, arrays etc get synced via properties on mount. + const type = typeof value; + + if (type === 'string' || type === 'boolean' || type === 'number') { + acc[camelToDashCase(name)] = value; + } + } + return acc; + }, {}); + + if (manipulatePropsFunction) { + propsToPass = manipulatePropsFunction(this.props, propsToPass); + } + + const newProps: Omit, 'forwardedRef'> = { + ...propsToPass, + ref: mergeRefs(forwardedRef, this.setComponentElRef), + style + }; + + /** + * We use createElement here instead of + * React.createElement to work around a + * bug in Vite (https://github.com/vitejs/vite/issues/6104). + * React.createElement causes all elements to be rendered + * as instead of the actual Web Component. + */ + return createElement(tagName, newProps, children); + } + + static get displayName() { + return displayName; + } + }; + + // If context was passed to createReactComponent then conditionally add it to the Component Class + if (ReactComponentContext) { + ReactComponent.contextType = ReactComponentContext; + } + + return createForwardRef(ReactComponent, displayName); +}; diff --git a/packages/discord-components-react/src/react-component-lib/createOverlayComponent.tsx b/packages/discord-components-react/src/react-component-lib/createOverlayComponent.tsx new file mode 100644 index 0000000..56eacb0 --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/createOverlayComponent.tsx @@ -0,0 +1,143 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +import type { OverlayEventDetail } from './interfaces'; +import type { StencilReactForwardedRef} from './utils'; +import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils'; + +interface OverlayElement extends HTMLElement { + present: () => Promise; + dismiss: (data?: any, role?: string | undefined) => Promise; +} + +export interface ReactOverlayProps { + children?: React.ReactNode; + isOpen: boolean; + onDidDismiss?: (event: CustomEvent) => void; + onDidPresent?: (event: CustomEvent) => void; + onWillDismiss?: (event: CustomEvent) => void; + onWillPresent?: (event: CustomEvent) => void; +} + +export const createOverlayComponent = ( + tagName: string, + controller: { create: (options: any) => Promise }, + customElement?: any +) => { + defineCustomElement(tagName, customElement); + + const displayName = dashToPascalCase(tagName); + const didDismissEventName = `on${displayName}DidDismiss`; + const didPresentEventName = `on${displayName}DidPresent`; + const willDismissEventName = `on${displayName}WillDismiss`; + const willPresentEventName = `on${displayName}WillPresent`; + + type Props = OverlayComponent & + ReactOverlayProps & { + forwardedRef?: StencilReactForwardedRef; + }; + + let isDismissing = false; + + class Overlay extends React.Component { + overlay?: OverlayType; + el!: HTMLDivElement; + + constructor(props: Props) { + super(props); + if (typeof document !== 'undefined') { + this.el = document.createElement('div'); + } + this.handleDismiss = this.handleDismiss.bind(this); + } + + static get displayName() { + return displayName; + } + + componentDidMount() { + if (this.props.isOpen) { + this.present(); + } + } + + componentWillUnmount() { + if (this.overlay) { + this.overlay.dismiss(); + } + } + + handleDismiss(event: CustomEvent>) { + if (this.props.onDidDismiss) { + this.props.onDidDismiss(event); + } + setRef(this.props.forwardedRef, null); + } + + shouldComponentUpdate(nextProps: Props) { + // Check if the overlay component is about to dismiss + if (this.overlay && nextProps.isOpen !== this.props.isOpen && !nextProps.isOpen) { + isDismissing = true; + } + + return true; + } + + async componentDidUpdate(prevProps: Props) { + if (this.overlay) { + attachProps(this.overlay, this.props, prevProps); + } + + if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) { + this.present(prevProps); + } + if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) { + await this.overlay.dismiss(); + isDismissing = false; + + /** + * Now that the overlay is dismissed + * we need to render again so that any + * inner components will be unmounted + */ + this.forceUpdate(); + } + } + + async present(prevProps?: Props) { + const { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, ...cProps } = this.props; + const elementProps = { + ...cProps, + ref: this.props.forwardedRef, + [didDismissEventName]: this.handleDismiss, + [didPresentEventName]: (e: CustomEvent) => this.props.onDidPresent && this.props.onDidPresent(e), + [willDismissEventName]: (e: CustomEvent) => this.props.onWillDismiss && this.props.onWillDismiss(e), + [willPresentEventName]: (e: CustomEvent) => this.props.onWillPresent && this.props.onWillPresent(e) + }; + + this.overlay = await controller.create({ + ...elementProps, + component: this.el, + componentProps: {} + }); + + setRef(this.props.forwardedRef, this.overlay); + attachProps(this.overlay, elementProps, prevProps); + + await this.overlay.present(); + } + + render() { + /** + * Continue to render the component even when + * overlay is dismissing otherwise component + * will be hidden before animation is done. + */ + return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el); + } + } + + return React.forwardRef((props, ref) => { + return ; + }); +}; diff --git a/packages/discord-components-react/src/react-component-lib/index.ts b/packages/discord-components-react/src/react-component-lib/index.ts new file mode 100644 index 0000000..85e81ad --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/index.ts @@ -0,0 +1,2 @@ +export { createReactComponent } from './createComponent'; +export { createOverlayComponent } from './createOverlayComponent'; diff --git a/packages/discord-components-react/src/react-component-lib/interfaces.ts b/packages/discord-components-react/src/react-component-lib/interfaces.ts new file mode 100644 index 0000000..0e7986a --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/interfaces.ts @@ -0,0 +1,34 @@ +// General types important to applications using stencil built components +export interface EventEmitter { + emit: (data?: T) => CustomEvent; +} + +export interface StyleReactProps { + class?: string; + className?: string; + style?: { [key: string]: any }; +} + +export interface OverlayEventDetail { + data?: T; + role?: string; +} + +export interface OverlayInterface { + el: HTMLElement; + animated: boolean; + keyboardClose: boolean; + overlayIndex: number; + presented: boolean; + + enterAnimation?: any; + leaveAnimation?: any; + + didPresent: EventEmitter; + willPresent: EventEmitter; + willDismiss: EventEmitter; + didDismiss: EventEmitter; + + present(): Promise; + dismiss(data?: any, role?: string): Promise; +} diff --git a/packages/discord-components-react/src/react-component-lib/utils/attachProps.ts b/packages/discord-components-react/src/react-component-lib/utils/attachProps.ts new file mode 100644 index 0000000..94a1574 --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/utils/attachProps.ts @@ -0,0 +1,106 @@ +import { camelToDashCase } from './case'; + +export const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => { + // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first + if (node instanceof Element) { + // add any classes in className to the class list + const className = getClassName(node.classList, newProps, oldProps); + if (className !== '') { + node.className = className; + } + + Object.keys(newProps).forEach((name) => { + if (name === 'children' || name === 'style' || name === 'ref' || name === 'class' || name === 'className' || name === 'forwardedRef') { + return; + } + if (name.startsWith('on') && name[2] === name[2].toUpperCase()) { + const eventName = name.substring(2); + const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1); + + if (!isCoveredByReact(eventNameLc)) { + syncEvent(node, eventNameLc, newProps[name]); + } + } else { + (node as any)[name] = newProps[name]; + const propType = typeof newProps[name]; + if (propType === 'string') { + node.setAttribute(camelToDashCase(name), newProps[name]); + } + } + }); + } +}; + +export const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => { + const newClassProp: string = newProps.className || newProps.class; + const oldClassProp: string = oldProps.className || oldProps.class; + // map the classes to Maps for performance + const currentClasses = arrayToMap(classList); + const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []); + const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []); + const finalClassNames: string[] = []; + // loop through each of the current classes on the component + // to see if it should be a part of the classNames added + currentClasses.forEach((currentClass) => { + if (incomingPropClasses.has(currentClass)) { + // add it as its already included in classnames coming in from newProps + finalClassNames.push(currentClass); + incomingPropClasses.delete(currentClass); + } else if (!oldPropClasses.has(currentClass)) { + // add it as it has NOT been removed by user + finalClassNames.push(currentClass); + } + }); + incomingPropClasses.forEach((s) => finalClassNames.push(s)); + return finalClassNames.join(' '); +}; + +/** + * Checks if an event is supported in the current execution environment. + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +export const isCoveredByReact = (eventNameSuffix: string) => { + if (typeof document === 'undefined') { + return true; + } + const eventName = 'on' + eventNameSuffix; + let isSupported = eventName in document; + + if (!isSupported) { + const element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof (element as any)[eventName] === 'function'; + } + + return isSupported; +}; + +export const syncEvent = ( + node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } }, + eventName: string, + newEventHandler?: (e: Event) => any +) => { + const eventStore = node.__events || (node.__events = {}); + const oldEventHandler = eventStore[eventName]; + + // Remove old listener so they don't double up. + if (oldEventHandler) { + node.removeEventListener(eventName, oldEventHandler); + } + + // Bind new listener. + node.addEventListener( + eventName, + (eventStore[eventName] = function handler(e: Event) { + if (newEventHandler) { + newEventHandler.call(this, e); + } + }) + ); +}; + +const arrayToMap = (arr: string[] | DOMTokenList) => { + const map = new Map(); + (arr as string[]).forEach((s: string) => map.set(s, s)); + return map; +}; diff --git a/packages/discord-components-react/src/react-component-lib/utils/case.ts b/packages/discord-components-react/src/react-component-lib/utils/case.ts new file mode 100644 index 0000000..3db4d21 --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/utils/case.ts @@ -0,0 +1,7 @@ +export const dashToPascalCase = (str: string) => + str + .toLowerCase() + .split('-') + .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)) + .join(''); +export const camelToDashCase = (str: string) => str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`); diff --git a/packages/discord-components-react/src/react-component-lib/utils/dev.ts b/packages/discord-components-react/src/react-component-lib/utils/dev.ts new file mode 100644 index 0000000..4f271a3 --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/utils/dev.ts @@ -0,0 +1,14 @@ +export const isDevMode = () => { + return process && process.env && process.env.NODE_ENV === 'development'; +}; + +const warnings: { [key: string]: boolean } = {}; + +export const deprecationWarning = (key: string, message: string) => { + if (isDevMode()) { + if (!warnings[key]) { + console.warn(message); + warnings[key] = true; + } + } +}; diff --git a/packages/discord-components-react/src/react-component-lib/utils/index.tsx b/packages/discord-components-react/src/react-component-lib/utils/index.tsx new file mode 100644 index 0000000..d7ac53b --- /dev/null +++ b/packages/discord-components-react/src/react-component-lib/utils/index.tsx @@ -0,0 +1,43 @@ +import React from 'react'; + +import type { StyleReactProps } from '../interfaces'; + +export type StencilReactExternalProps = PropType & Omit, 'style'> & StyleReactProps; + +// This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17 +export type StencilReactForwardedRef = ((instance: T | null) => void) | React.MutableRefObject | null; + +export const setRef = (ref: StencilReactForwardedRef | React.Ref | undefined, value: any) => { + if (typeof ref === 'function') { + ref(value); + } else if (ref != null) { + // Cast as a MutableRef so we can assign current + (ref as React.MutableRefObject).current = value; + } +}; + +export const mergeRefs = (...refs: (StencilReactForwardedRef | React.Ref | undefined)[]): React.RefCallback => { + return (value: any) => { + refs.forEach((ref) => { + setRef(ref, value); + }); + }; +}; + +export const createForwardRef = (ReactComponent: any, displayName: string) => { + const forwardRef = (props: StencilReactExternalProps, ref: StencilReactForwardedRef) => { + return ; + }; + forwardRef.displayName = displayName; + + return React.forwardRef(forwardRef); +}; + +export const defineCustomElement = (tagName: string, customElement: any) => { + if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) { + customElements.define(tagName, customElement); + } +}; + +export * from './attachProps'; +export * from './case'; diff --git a/packages/discord-components-react/tsconfig.json b/packages/discord-components-react/tsconfig.json new file mode 100644 index 0000000..43d5844 --- /dev/null +++ b/packages/discord-components-react/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "module": "CommonJS", + "tsBuildInfoFile": "dist/.tsbuildinfo", + "importsNotUsedAsValues": "remove", + "declarationMap": true + }, + "include": ["src"] +} diff --git a/README.md b/packages/discord-html-transcripts/README.md similarity index 100% rename from README.md rename to packages/discord-html-transcripts/README.md diff --git a/package-lock.json b/packages/discord-html-transcripts/package-lock.json similarity index 100% rename from package-lock.json rename to packages/discord-html-transcripts/package-lock.json diff --git a/packages/discord-html-transcripts/package.json b/packages/discord-html-transcripts/package.json new file mode 100644 index 0000000..780e7a2 --- /dev/null +++ b/packages/discord-html-transcripts/package.json @@ -0,0 +1,63 @@ +{ + "name": "discord-html-transcripts", + "version": "3.1.5", + "description": "A nicely formatted html transcript generator for discord.js.", + "main": "dist/index.js", + "homepage": "https://github.com/ItzDerock/discord-html-transcripts", + "types": "./dist/index.d.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc -p tsconfig.json", + "prepack": "npm run build", + "test:typescript": "ts-node ./tests/generate.ts", + "lint": "prettier --write --cache . && eslint --cache --fix .", + "typecheck": "tsc -p tsconfig.eslint.json" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ItzDerock/discord-html-transcripts.git" + }, + "keywords": [ + "discord.js", + "discord.js-transcripts", + "discord.js-html-transcripts", + "html-transcripts", + "discord-html-transcripts", + "discord-transcripts" + ], + "author": "Derock ", + "license": "GNU GPLv3", + "files": [ + "dist/**/*.js", + "dist/**/*.d.ts", + "dist/**/*.js.map" + ], + "devDependencies": { + "@types/node": "^18.11.18", + "@types/react": "^18.0.27", + "@types/react-dom": "^18.0.10", + "@typescript-eslint/eslint-plugin": "^5.49.0", + "@typescript-eslint/parser": "^5.49.0", + "discord.js": "^14.12.0", + "dotenv": "^16.0.3", + "eslint": "^8.32.0", + "husky": "^8.0.3", + "prettier": "^2.8.3", + "pretty-quick": "^3.1.3", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + }, + "dependencies": { + "@derockdev/discord-components-core": "^3.5.3", + "@derockdev/discord-components-react": "^3.5.3", + "discord-markdown-parser": "~1.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "simple-markdown": "^0.7.3", + "twemoji": "^14.0.2", + "undici": "^5.21.0" + }, + "peerDependencies": { + "discord.js": "^14.0.0 || ^15.0.0" + } +} diff --git a/src/generator/index.tsx b/packages/discord-html-transcripts/src/generator/index.tsx similarity index 100% rename from src/generator/index.tsx rename to packages/discord-html-transcripts/src/generator/index.tsx diff --git a/src/generator/renderers/attachment.tsx b/packages/discord-html-transcripts/src/generator/renderers/attachment.tsx similarity index 100% rename from src/generator/renderers/attachment.tsx rename to packages/discord-html-transcripts/src/generator/renderers/attachment.tsx diff --git a/src/generator/renderers/components.tsx b/packages/discord-html-transcripts/src/generator/renderers/components.tsx similarity index 100% rename from src/generator/renderers/components.tsx rename to packages/discord-html-transcripts/src/generator/renderers/components.tsx diff --git a/src/generator/renderers/content.tsx b/packages/discord-html-transcripts/src/generator/renderers/content.tsx similarity index 100% rename from src/generator/renderers/content.tsx rename to packages/discord-html-transcripts/src/generator/renderers/content.tsx diff --git a/src/generator/renderers/embed.tsx b/packages/discord-html-transcripts/src/generator/renderers/embed.tsx similarity index 100% rename from src/generator/renderers/embed.tsx rename to packages/discord-html-transcripts/src/generator/renderers/embed.tsx diff --git a/src/generator/renderers/message.tsx b/packages/discord-html-transcripts/src/generator/renderers/message.tsx similarity index 100% rename from src/generator/renderers/message.tsx rename to packages/discord-html-transcripts/src/generator/renderers/message.tsx diff --git a/src/generator/renderers/reply.tsx b/packages/discord-html-transcripts/src/generator/renderers/reply.tsx similarity index 100% rename from src/generator/renderers/reply.tsx rename to packages/discord-html-transcripts/src/generator/renderers/reply.tsx diff --git a/src/generator/renderers/systemMessage.tsx b/packages/discord-html-transcripts/src/generator/renderers/systemMessage.tsx similarity index 100% rename from src/generator/renderers/systemMessage.tsx rename to packages/discord-html-transcripts/src/generator/renderers/systemMessage.tsx diff --git a/src/index.ts b/packages/discord-html-transcripts/src/index.ts similarity index 100% rename from src/index.ts rename to packages/discord-html-transcripts/src/index.ts diff --git a/src/static/client.ts b/packages/discord-html-transcripts/src/static/client.ts similarity index 100% rename from src/static/client.ts rename to packages/discord-html-transcripts/src/static/client.ts diff --git a/src/types.ts b/packages/discord-html-transcripts/src/types.ts similarity index 100% rename from src/types.ts rename to packages/discord-html-transcripts/src/types.ts diff --git a/src/utils/buildProfiles.ts b/packages/discord-html-transcripts/src/utils/buildProfiles.ts similarity index 100% rename from src/utils/buildProfiles.ts rename to packages/discord-html-transcripts/src/utils/buildProfiles.ts diff --git a/src/utils/embeds.ts b/packages/discord-html-transcripts/src/utils/embeds.ts similarity index 100% rename from src/utils/embeds.ts rename to packages/discord-html-transcripts/src/utils/embeds.ts diff --git a/src/utils/extend.ts b/packages/discord-html-transcripts/src/utils/extend.ts similarity index 100% rename from src/utils/extend.ts rename to packages/discord-html-transcripts/src/utils/extend.ts diff --git a/src/utils/types.d.ts b/packages/discord-html-transcripts/src/utils/types.d.ts similarity index 100% rename from src/utils/types.d.ts rename to packages/discord-html-transcripts/src/utils/types.d.ts diff --git a/src/utils/utils.ts b/packages/discord-html-transcripts/src/utils/utils.ts similarity index 100% rename from src/utils/utils.ts rename to packages/discord-html-transcripts/src/utils/utils.ts diff --git a/tests/README.md b/packages/discord-html-transcripts/tests/README.md similarity index 100% rename from tests/README.md rename to packages/discord-html-transcripts/tests/README.md diff --git a/tests/generate.ts b/packages/discord-html-transcripts/tests/generate.ts similarity index 100% rename from tests/generate.ts rename to packages/discord-html-transcripts/tests/generate.ts diff --git a/packages/discord-html-transcripts/tsconfig.json b/packages/discord-html-transcripts/tsconfig.json new file mode 100644 index 0000000..52d43ea --- /dev/null +++ b/packages/discord-html-transcripts/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"] +} diff --git a/packages/discord-markdown-parser/.github/workflows/CI.yml b/packages/discord-markdown-parser/.github/workflows/CI.yml new file mode 100644 index 0000000..c4e41b9 --- /dev/null +++ b/packages/discord-markdown-parser/.github/workflows/CI.yml @@ -0,0 +1,25 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + +jobs: + Tests: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout Project + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + - name: Use Node.js v16 + uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + with: + node-version: 16 + + - name: Install Dependencies + run: npm install + + - name: Run Tests + run: npm test diff --git a/packages/discord-markdown-parser/.gitignore b/packages/discord-markdown-parser/.gitignore new file mode 100644 index 0000000..80ae2f1 --- /dev/null +++ b/packages/discord-markdown-parser/.gitignore @@ -0,0 +1,178 @@ +build/ + +# Created by https://www.toptal.com/developers/gitignore/api/node,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +# End of https://www.toptal.com/developers/gitignore/api/node,macos diff --git a/packages/discord-markdown-parser/.prettierrc.json b/packages/discord-markdown-parser/.prettierrc.json new file mode 100644 index 0000000..ff118b6 --- /dev/null +++ b/packages/discord-markdown-parser/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "printWidth": 120, + "useTabs": false, + "quoteProps": "as-needed", + "trailingComma": "es5", + "endOfLine": "lf", + "singleQuote": true +} diff --git a/packages/discord-markdown-parser/.vscode/settings.json b/packages/discord-markdown-parser/.vscode/settings.json new file mode 100644 index 0000000..0a77011 --- /dev/null +++ b/packages/discord-markdown-parser/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.tabSize": 2 +} \ No newline at end of file diff --git a/packages/discord-markdown-parser/LICENSE b/packages/discord-markdown-parser/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/packages/discord-markdown-parser/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/packages/discord-markdown-parser/README.md b/packages/discord-markdown-parser/README.md new file mode 100644 index 0000000..91fd483 --- /dev/null +++ b/packages/discord-markdown-parser/README.md @@ -0,0 +1,70 @@ +# `discord-markdown-parser` + +[![Discord](https://img.shields.io/discord/555474311637499955?label=discord)](https://discord.gg/rf5qN7C) +[![npm](https://img.shields.io/npm/dw/discord-markdown-parser)](http://npmjs.org/package/discord-markdown-parser) +![GitHub package.json version](https://img.shields.io/github/package-json/v/ItzDerock/discord-markdown-parser) +![GitHub Repo stars](https://img.shields.io/github/stars/ItzDerock/discord-markdown-parser?style=social) + +A node.js markdown implementation based on the [simple-markdown](https://github.com/Khan/simple-markdown) library, which is the same technology [discord use](https://discord.com/blog/how-discord-renders-rich-messages-on-the-android-app). + +Designed to be used for [discord-html-transcripts](https://github.com/ItzDerock/discord-html-transcripts) + +`discord-markdown-parser` will parse any given string into an [AST tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree) and supports: + +- links +- block quotes +- inline quotes +- code blocks +- inline code +- italics (em) +- spoilers +- timestamps +- bold +- strikethrough +- underline +- channel mentions +- user mentions +- role mentions +- @everyone +- @here +- emojis +- & more + +## Usage + +```js +import { parse } from 'discord-markdown-parser'; +// or const { parse } = require('discord-markdown-parser'); + +// input is a string +const input = 'test **markdown** with `cool` *stuff*'; + +// specify what type of markdown this is +// this can be 'normal' or 'extended' (default = normal) +// extended should be used if the input is from a webhook message or embed description. +const type = 'normal'; + +// will return an AST tree +const parsed = parse(input, type); +``` + +## Extending + +```js +// you can import the default rules using +import { rules } from 'discord-markdown-parser'; + +// and you can add your own rules +const newRules = { + ...rules, + customRule: { + ... + } // see simple-markdown documentation for details +}; + +// import simpleMarkdown +import SimpleMarkdown from 'simple-markdown'; + +// and create the parser +const parser = SimpleMarkdown.parserFor(newRules); +``` diff --git a/packages/discord-markdown-parser/package-lock.json b/packages/discord-markdown-parser/package-lock.json new file mode 100644 index 0000000..eaec7fe --- /dev/null +++ b/packages/discord-markdown-parser/package-lock.json @@ -0,0 +1,2832 @@ +{ + "name": "discord-markdown-parser", + "version": "1.1.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "discord-markdown-parser", + "version": "1.1.0", + "license": "GNU GPLv3", + "dependencies": { + "simple-markdown": "^0.7.3" + }, + "devDependencies": { + "@types/node": "^18.7.13", + "@vitest/coverage-c8": "^0.23.4", + "colorette": "^2.0.19", + "prettier": "^2.7.1", + "ts-node": "^10.9.1", + "typescript": "^4.8.2", + "vitest": "^0.23.4" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.9.tgz", + "integrity": "sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.9.tgz", + "integrity": "sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "node_modules/@types/chai": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", + "integrity": "sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==", + "dev": true + }, + "node_modules/@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.7.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", + "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", + "dev": true + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "node_modules/@types/react": { + "version": "18.0.21", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.21.tgz", + "integrity": "sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, + "node_modules/@vitest/coverage-c8": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.23.4.tgz", + "integrity": "sha512-jmD00a5DQH9gu9K+YdvVhcMuv2CzHvU4gCnySS40Ec5hKlXtlCzRfNHl00VnhfuBeaQUmaQYe60BLT413HyDdg==", + "dev": true, + "dependencies": { + "c8": "^7.12.0", + "vitest": "0.23.4" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/c8": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", + "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.1.4", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.9.tgz", + "integrity": "sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.9", + "@esbuild/linux-loong64": "0.15.9", + "esbuild-android-64": "0.15.9", + "esbuild-android-arm64": "0.15.9", + "esbuild-darwin-64": "0.15.9", + "esbuild-darwin-arm64": "0.15.9", + "esbuild-freebsd-64": "0.15.9", + "esbuild-freebsd-arm64": "0.15.9", + "esbuild-linux-32": "0.15.9", + "esbuild-linux-64": "0.15.9", + "esbuild-linux-arm": "0.15.9", + "esbuild-linux-arm64": "0.15.9", + "esbuild-linux-mips64le": "0.15.9", + "esbuild-linux-ppc64le": "0.15.9", + "esbuild-linux-riscv64": "0.15.9", + "esbuild-linux-s390x": "0.15.9", + "esbuild-netbsd-64": "0.15.9", + "esbuild-openbsd-64": "0.15.9", + "esbuild-sunos-64": "0.15.9", + "esbuild-windows-32": "0.15.9", + "esbuild-windows-64": "0.15.9", + "esbuild-windows-arm64": "0.15.9" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.9.tgz", + "integrity": "sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.9.tgz", + "integrity": "sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.9.tgz", + "integrity": "sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.9.tgz", + "integrity": "sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.9.tgz", + "integrity": "sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.9.tgz", + "integrity": "sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.9.tgz", + "integrity": "sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.9.tgz", + "integrity": "sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.9.tgz", + "integrity": "sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.9.tgz", + "integrity": "sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.9.tgz", + "integrity": "sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.9.tgz", + "integrity": "sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.9.tgz", + "integrity": "sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.9.tgz", + "integrity": "sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.9.tgz", + "integrity": "sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.9.tgz", + "integrity": "sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.9.tgz", + "integrity": "sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.9.tgz", + "integrity": "sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.9.tgz", + "integrity": "sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.9.tgz", + "integrity": "sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.0" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/postcss": { + "version": "8.4.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", + "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "2.78.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz", + "integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/simple-markdown": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/simple-markdown/-/simple-markdown-0.7.3.tgz", + "integrity": "sha512-uGXIc13NGpqfPeFJIt/7SHHxd6HekEJYtsdoCM06mEBPL9fQH/pSD7LRM6PZ7CKchpSvxKL4tvwMamqAaNDAyg==", + "dependencies": { + "@types/react": ">=16.0.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-literal": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz", + "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinybench": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.1.5.tgz", + "integrity": "sha512-ak+PZZEuH3mw6CCFOgf5S90YH0MARnZNhxjhjguAmoJimEMAJuNip/rJRd6/wyylHItomVpKTzZk9zrhTrQCoQ==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/typescript": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", + "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/vite": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.1.3.tgz", + "integrity": "sha512-/3XWiktaopByM5bd8dqvHxRt5EEgRikevnnrpND0gRfNkrMrPaGGexhtLCzv15RcCMtV2CLw+BPas8YFeSG0KA==", + "dev": true, + "dependencies": { + "esbuild": "^0.15.6", + "postcss": "^8.4.16", + "resolve": "^1.22.1", + "rollup": "~2.78.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "less": "*", + "sass": "*", + "stylus": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.23.4.tgz", + "integrity": "sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.3", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "strip-literal": "^0.4.1", + "tinybench": "^2.1.5", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^2.9.12 || ^3.0.0-0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.16.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@esbuild/android-arm": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.9.tgz", + "integrity": "sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.9.tgz", + "integrity": "sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==", + "dev": true, + "optional": true + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "@types/chai": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", + "integrity": "sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==", + "dev": true + }, + "@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "requires": { + "@types/chai": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/node": { + "version": "18.7.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", + "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", + "dev": true + }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "@types/react": { + "version": "18.0.21", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.21.tgz", + "integrity": "sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, + "@vitest/coverage-c8": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/@vitest/coverage-c8/-/coverage-c8-0.23.4.tgz", + "integrity": "sha512-jmD00a5DQH9gu9K+YdvVhcMuv2CzHvU4gCnySS40Ec5hKlXtlCzRfNHl00VnhfuBeaQUmaQYe60BLT413HyDdg==", + "dev": true, + "requires": { + "c8": "^7.12.0", + "vitest": "0.23.4" + } + }, + "acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "c8": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", + "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.1.4", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9" + } + }, + "chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "esbuild": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.9.tgz", + "integrity": "sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.9", + "@esbuild/linux-loong64": "0.15.9", + "esbuild-android-64": "0.15.9", + "esbuild-android-arm64": "0.15.9", + "esbuild-darwin-64": "0.15.9", + "esbuild-darwin-arm64": "0.15.9", + "esbuild-freebsd-64": "0.15.9", + "esbuild-freebsd-arm64": "0.15.9", + "esbuild-linux-32": "0.15.9", + "esbuild-linux-64": "0.15.9", + "esbuild-linux-arm": "0.15.9", + "esbuild-linux-arm64": "0.15.9", + "esbuild-linux-mips64le": "0.15.9", + "esbuild-linux-ppc64le": "0.15.9", + "esbuild-linux-riscv64": "0.15.9", + "esbuild-linux-s390x": "0.15.9", + "esbuild-netbsd-64": "0.15.9", + "esbuild-openbsd-64": "0.15.9", + "esbuild-sunos-64": "0.15.9", + "esbuild-windows-32": "0.15.9", + "esbuild-windows-64": "0.15.9", + "esbuild-windows-arm64": "0.15.9" + } + }, + "esbuild-android-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.9.tgz", + "integrity": "sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.9.tgz", + "integrity": "sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.9.tgz", + "integrity": "sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.9.tgz", + "integrity": "sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.9.tgz", + "integrity": "sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.9.tgz", + "integrity": "sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.9.tgz", + "integrity": "sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.9.tgz", + "integrity": "sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.9.tgz", + "integrity": "sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.9.tgz", + "integrity": "sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.9.tgz", + "integrity": "sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.9.tgz", + "integrity": "sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.9.tgz", + "integrity": "sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.9.tgz", + "integrity": "sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.9.tgz", + "integrity": "sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.9.tgz", + "integrity": "sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.9.tgz", + "integrity": "sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.9.tgz", + "integrity": "sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.9.tgz", + "integrity": "sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.9.tgz", + "integrity": "sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==", + "dev": true, + "optional": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-core-module": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-reports": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", + "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "postcss": { + "version": "8.4.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", + "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", + "dev": true, + "requires": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "2.78.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz", + "integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "simple-markdown": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/simple-markdown/-/simple-markdown-0.7.3.tgz", + "integrity": "sha512-uGXIc13NGpqfPeFJIt/7SHHxd6HekEJYtsdoCM06mEBPL9fQH/pSD7LRM6PZ7CKchpSvxKL4tvwMamqAaNDAyg==", + "requires": { + "@types/react": ">=16.0.0" + } + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-literal": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-0.4.2.tgz", + "integrity": "sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==", + "dev": true, + "requires": { + "acorn": "^8.8.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "tinybench": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.1.5.tgz", + "integrity": "sha512-ak+PZZEuH3mw6CCFOgf5S90YH0MARnZNhxjhjguAmoJimEMAJuNip/rJRd6/wyylHItomVpKTzZk9zrhTrQCoQ==", + "dev": true + }, + "tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==", + "dev": true + }, + "tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==", + "dev": true + }, + "ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typescript": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "dev": true + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "v8-to-istanbul": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", + "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, + "vite": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.1.3.tgz", + "integrity": "sha512-/3XWiktaopByM5bd8dqvHxRt5EEgRikevnnrpND0gRfNkrMrPaGGexhtLCzv15RcCMtV2CLw+BPas8YFeSG0KA==", + "dev": true, + "requires": { + "esbuild": "^0.15.6", + "fsevents": "~2.3.2", + "postcss": "^8.4.16", + "resolve": "^1.22.1", + "rollup": "~2.78.0" + } + }, + "vitest": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.23.4.tgz", + "integrity": "sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==", + "dev": true, + "requires": { + "@types/chai": "^4.3.3", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "strip-literal": "^0.4.1", + "tinybench": "^2.1.5", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^2.9.12 || ^3.0.0-0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/packages/discord-markdown-parser/package.json b/packages/discord-markdown-parser/package.json new file mode 100644 index 0000000..a999ce8 --- /dev/null +++ b/packages/discord-markdown-parser/package.json @@ -0,0 +1,45 @@ +{ + "name": "discord-markdown-parser", + "version": "1.1.0", + "description": "Parse discord-style markdown into an abstract syntax tree.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "homepage": "https://github.com/ItzDerock/discord-markdown-parser", + "repository": { + "type": "git", + "url": "git+https://github.com/ItzDerock/discord-markdown-parser" + }, + "scripts": { + "build": "tsc -b src", + "format": "prettier --write --cache \"{src,scripts}/**/*.{mjs,ts,js}\"", + "test": "vitest run", + "release": "npm run build && npm pack", + "update-twemoji": "node scripts/twemoji-regex-updater.mjs" + }, + "keywords": [ + "discord", + "markdown", + "parser", + "discord-markdown-parser", + "discord-markdown", + "simple-markdown", + "discord-parser" + ], + "author": "Derock ", + "license": "GNU GPLv3", + "devDependencies": { + "@types/node": "^18.7.13", + "@vitest/coverage-c8": "^0.23.4", + "colorette": "^2.0.19", + "prettier": "^2.7.1", + "ts-node": "^10.9.1", + "typescript": "^4.8.2", + "vitest": "^0.23.4" + }, + "dependencies": { + "simple-markdown": "^0.7.3" + }, + "files": [ + "dist" + ] +} diff --git a/packages/discord-markdown-parser/pnpm-lock.yaml b/packages/discord-markdown-parser/pnpm-lock.yaml new file mode 100644 index 0000000..7e1274a --- /dev/null +++ b/packages/discord-markdown-parser/pnpm-lock.yaml @@ -0,0 +1,1043 @@ +lockfileVersion: 5.4 + +specifiers: + '@types/node': ^18.7.13 + '@vitest/coverage-c8': ^0.23.4 + colorette: ^2.0.19 + prettier: ^2.7.1 + simple-markdown: ^0.7.3 + ts-node: ^10.9.1 + typescript: ^4.8.2 + vitest: ^0.23.4 + +dependencies: + simple-markdown: 0.7.3 + +devDependencies: + '@types/node': 18.7.13 + '@vitest/coverage-c8': 0.23.4 + colorette: 2.0.19 + prettier: 2.7.1 + ts-node: 10.9.1_hwinnrf7y5nyyzygpj45jmvjia + typescript: 4.8.2 + vitest: 0.23.4 + +packages: + + /@bcoe/v8-coverage/0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + + /@cspotcode/source-map-support/0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@esbuild/android-arm/0.15.9: + resolution: {integrity: sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.15.9: + resolution: {integrity: sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@istanbuljs/schema/0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/trace-mapping/0.3.15: + resolution: {integrity: sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@jridgewell/trace-mapping/0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@tsconfig/node10/1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12/1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14/1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16/1.0.3: + resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} + dev: true + + /@types/chai-subset/1.3.3: + resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} + dependencies: + '@types/chai': 4.3.3 + dev: true + + /@types/chai/4.3.3: + resolution: {integrity: sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==} + dev: true + + /@types/istanbul-lib-coverage/2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + + /@types/node/18.7.13: + resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} + dev: true + + /@types/prop-types/15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: false + + /@types/react/18.0.17: + resolution: {integrity: sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.0 + dev: false + + /@types/scheduler/0.16.2: + resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + dev: false + + /@vitest/coverage-c8/0.23.4: + resolution: {integrity: sha512-jmD00a5DQH9gu9K+YdvVhcMuv2CzHvU4gCnySS40Ec5hKlXtlCzRfNHl00VnhfuBeaQUmaQYe60BLT413HyDdg==} + dependencies: + c8: 7.12.0 + vitest: 0.23.4 + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@vitest/browser' + - '@vitest/ui' + - happy-dom + - jsdom + - less + - sass + - stylus + - supports-color + - terser + dev: true + + /acorn-walk/8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn/8.8.0: + resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /arg/4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /assertion-error/1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /c8/7.12.0: + resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} + engines: {node: '>=10.12.0'} + hasBin: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.0 + istanbul-reports: 3.1.5 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.0.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + dev: true + + /chai/4.3.6: + resolution: {integrity: sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.2 + deep-eql: 3.0.1 + get-func-name: 2.0.0 + loupe: 2.3.4 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + + /check-error/1.0.2: + resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} + dev: true + + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /colorette/2.0.19: + resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /convert-source-map/1.8.0: + resolution: {integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /create-require/1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /csstype/3.1.0: + resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} + dev: false + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /deep-eql/3.0.1: + resolution: {integrity: sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==} + engines: {node: '>=0.12'} + dependencies: + type-detect: 4.0.8 + dev: true + + /diff/4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /esbuild-android-64/0.15.9: + resolution: {integrity: sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.15.9: + resolution: {integrity: sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.15.9: + resolution: {integrity: sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.15.9: + resolution: {integrity: sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.15.9: + resolution: {integrity: sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.15.9: + resolution: {integrity: sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.15.9: + resolution: {integrity: sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.15.9: + resolution: {integrity: sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.15.9: + resolution: {integrity: sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.15.9: + resolution: {integrity: sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.15.9: + resolution: {integrity: sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.15.9: + resolution: {integrity: sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.15.9: + resolution: {integrity: sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.15.9: + resolution: {integrity: sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.15.9: + resolution: {integrity: sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.15.9: + resolution: {integrity: sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.15.9: + resolution: {integrity: sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.15.9: + resolution: {integrity: sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.15.9: + resolution: {integrity: sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.15.9: + resolution: {integrity: sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.15.9: + resolution: {integrity: sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.9 + '@esbuild/linux-loong64': 0.15.9 + esbuild-android-64: 0.15.9 + esbuild-android-arm64: 0.15.9 + esbuild-darwin-64: 0.15.9 + esbuild-darwin-arm64: 0.15.9 + esbuild-freebsd-64: 0.15.9 + esbuild-freebsd-arm64: 0.15.9 + esbuild-linux-32: 0.15.9 + esbuild-linux-64: 0.15.9 + esbuild-linux-arm: 0.15.9 + esbuild-linux-arm64: 0.15.9 + esbuild-linux-mips64le: 0.15.9 + esbuild-linux-ppc64le: 0.15.9 + esbuild-linux-riscv64: 0.15.9 + esbuild-linux-s390x: 0.15.9 + esbuild-netbsd-64: 0.15.9 + esbuild-openbsd-64: 0.15.9 + esbuild-sunos-64: 0.15.9 + esbuild-windows-32: 0.15.9 + esbuild-windows-64: 0.15.9 + esbuild-windows-arm64: 0.15.9 + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /foreground-child/2.0.0: + resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} + engines: {node: '>=8.0.0'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 3.0.7 + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents/2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-func-name/2.0.0: + resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /html-escaper/2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /is-core-module/2.10.0: + resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} + dependencies: + has: 1.0.3 + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /istanbul-lib-coverage/3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-report/3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-reports/3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + + /local-pkg/0.4.2: + resolution: {integrity: sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==} + engines: {node: '>=14'} + dev: true + + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /loupe/2.3.4: + resolution: {integrity: sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==} + dependencies: + get-func-name: 2.0.0 + dev: true + + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /make-error/1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /pathval/1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + dev: true + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /postcss/8.4.16: + resolution: {integrity: sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + + /prettier/2.7.1: + resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.10.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rollup/2.78.1: + resolution: {integrity: sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /simple-markdown/0.7.3: + resolution: {integrity: sha512-uGXIc13NGpqfPeFJIt/7SHHxd6HekEJYtsdoCM06mEBPL9fQH/pSD7LRM6PZ7CKchpSvxKL4tvwMamqAaNDAyg==} + dependencies: + '@types/react': 18.0.17 + dev: false + + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-literal/0.4.2: + resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} + dependencies: + acorn: 8.8.0 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /test-exclude/6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + + /tinybench/2.1.5: + resolution: {integrity: sha512-ak+PZZEuH3mw6CCFOgf5S90YH0MARnZNhxjhjguAmoJimEMAJuNip/rJRd6/wyylHItomVpKTzZk9zrhTrQCoQ==} + dev: true + + /tinypool/0.3.0: + resolution: {integrity: sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==} + engines: {node: '>=14.0.0'} + dev: true + + /tinyspy/1.0.2: + resolution: {integrity: sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==} + engines: {node: '>=14.0.0'} + dev: true + + /ts-node/10.9.1_hwinnrf7y5nyyzygpj45jmvjia: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.7.13 + acorn: 8.8.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.8.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /type-detect/4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /typescript/4.8.2: + resolution: {integrity: sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /v8-compile-cache-lib/3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /v8-to-istanbul/9.0.1: + resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.15 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.8.0 + dev: true + + /vite/3.1.3: + resolution: {integrity: sha512-/3XWiktaopByM5bd8dqvHxRt5EEgRikevnnrpND0gRfNkrMrPaGGexhtLCzv15RcCMtV2CLw+BPas8YFeSG0KA==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + less: '*' + sass: '*' + stylus: '*' + terser: ^5.4.0 + peerDependenciesMeta: + less: + optional: true + sass: + optional: true + stylus: + optional: true + terser: + optional: true + dependencies: + esbuild: 0.15.9 + postcss: 8.4.16 + resolve: 1.22.1 + rollup: 2.78.1 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vitest/0.23.4: + resolution: {integrity: sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==} + engines: {node: '>=v14.16.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@types/chai': 4.3.3 + '@types/chai-subset': 1.3.3 + '@types/node': 18.7.13 + chai: 4.3.6 + debug: 4.3.4 + local-pkg: 0.4.2 + strip-literal: 0.4.2 + tinybench: 2.1.5 + tinypool: 0.3.0 + tinyspy: 1.0.2 + vite: 3.1.3 + transitivePeerDependencies: + - less + - sass + - stylus + - supports-color + - terser + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yargs-parser/20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs/16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + + /yn/3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/packages/discord-markdown-parser/scripts/sha-tracker.json b/packages/discord-markdown-parser/scripts/sha-tracker.json new file mode 100644 index 0000000..69a88e3 --- /dev/null +++ b/packages/discord-markdown-parser/scripts/sha-tracker.json @@ -0,0 +1 @@ +{} diff --git a/packages/discord-markdown-parser/scripts/twemoji-regex-updater.mjs b/packages/discord-markdown-parser/scripts/twemoji-regex-updater.mjs new file mode 100644 index 0000000..e776cbc --- /dev/null +++ b/packages/discord-markdown-parser/scripts/twemoji-regex-updater.mjs @@ -0,0 +1,67 @@ +import { green, yellow } from 'colorette'; +import { rm, writeFile } from 'node:fs/promises'; +import { URL } from 'node:url'; + +async function importFileFromWeb({ url, temporaryFileName }) { + const body = await fetch(url).then((response) => response.text()); + + const temporaryOutputFile = new URL(temporaryFileName, import.meta.url); + + await writeFile(temporaryOutputFile, body); + const loadedModule = await import(temporaryOutputFile); + + await rm(temporaryOutputFile); + + return loadedModule; +} + +const filePrefix = [ + '/**', + ' * Regex that can capture a Twemoji (Twitter Emoji)', + ' * @raw {@linkplain https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js See official source code}', + ' */', + 'export const TwemojiRegex =', + '\t', +].join('\n'); +const fileSuffix = [';', ''].join('\n'); + +const shaTrackerFileUrl = new URL('sha-tracker.json', import.meta.url); +const twemojiRegexFileUrl = new URL('../src/utils/twemojiRegex.ts', import.meta.url); +const oneMonthAgo = Date.now() - 1000 * 60 * 60 * 24 * 30; +const timestamp = new Date(oneMonthAgo).toISOString(); + +const url = new URL('https://api.github.com/repos/twitter/twemoji-parser/commits'); +url.searchParams.append('path', 'src/lib/regex.js'); +url.searchParams.append('since', timestamp); + +const [commits, { default: ciData }] = await Promise.all([ + fetch(url).then((res) => res.json()), // + import(shaTrackerFileUrl, { assert: { type: 'json' } }), // +]); + +const data = { sha: commits.length ? commits[0].sha : null, length: commits.length }; + +if (data.sha === null || data.sha === ciData.twemojiRegexLastSha) { + console.info(yellow('Fetched data but no new commit was available')); + + process.exit(0); +} + +const { default: regexFromWeb } = await importFileFromWeb({ + url: 'https://raw.githubusercontent.com/twitter/twemoji-parser/master/src/lib/regex.js', + temporaryFileName: 'regex.mjs', +}); + +const nonGlobalRegex = new RegExp(`^(${regexFromWeb.source})`, ''); + +const writePromises = [ + // + writeFile(twemojiRegexFileUrl, `${filePrefix}${nonGlobalRegex}${fileSuffix}`), +]; + +if (data.sha) + writePromises.push(writeFile(shaTrackerFileUrl, JSON.stringify({ ...ciData, twemojiRegexLastSha: data.sha }))); + +await Promise.all(writePromises); + +console.log(green(`Successfully wrote updated Twemoji Regex to file; Latest SHA ${data.sha}`)); diff --git a/packages/discord-markdown-parser/src/index.ts b/packages/discord-markdown-parser/src/index.ts new file mode 100644 index 0000000..c2f2767 --- /dev/null +++ b/packages/discord-markdown-parser/src/index.ts @@ -0,0 +1,72 @@ +import SimpleMarkdown from 'simple-markdown'; + +// import all the rules +import { everyone } from './rules/discord/everyone'; +import { twemoji } from './rules/discord/twemoji'; +import { channel } from './rules/discord/channel'; +import { timestamp } from './rules/discord/time'; +import { blockQuote } from './rules/blockQuote'; +import { strikethrough } from './rules/strike'; +import { codeBlock } from './rules/codeBlock'; +import { emoji } from './rules/discord/emoji'; +import { role } from './rules/discord/role'; +import { autolink } from './rules/autolink'; +import { here } from './rules/discord/here'; +import { emoticon } from './rules/emoticon'; +import { user } from './rules/discord/user'; +import { spoiler } from './rules/spoiler'; +import { text } from './rules/text'; +import { url } from './rules/url'; +import { em } from './rules/em'; +import { br } from './rules/br'; + +// rules normal users can use +export const rules = { + blockQuote, + codeBlock, + newline: SimpleMarkdown.defaultRules.newline, + escape: SimpleMarkdown.defaultRules.escape, + autolink, + url, + em, + strong: SimpleMarkdown.defaultRules.strong, + underline: SimpleMarkdown.defaultRules.u, + strikethrough, + inlineCode: SimpleMarkdown.defaultRules.inlineCode, + text, + emoticon, + br, + spoiler, + + // discord specific + user, + channel, + role, + emoji, + everyone, + here, + twemoji, + timestamp, +}; + +// for use in webhooks, embeds, etc +export const rulesExtended = { + ...rules, + link: SimpleMarkdown.defaultRules.link, +}; + +// build the parser +const parser = SimpleMarkdown.parserFor(rules); +const parserExtended = SimpleMarkdown.parserFor(rulesExtended); + +// parse function +export function parse(input: string, type: 'normal' | 'extended' = 'normal') { + if (type === 'normal') return parser(input, { inline: true }); + else return parserExtended(input, { inline: true }); +} + +export default parse; + +// some types +export type RuleTypes = keyof typeof rules; +export type RuleTypesExtended = keyof typeof rulesExtended; diff --git a/packages/discord-markdown-parser/src/rules/autolink.ts b/packages/discord-markdown-parser/src/rules/autolink.ts new file mode 100644 index 0000000..9e697c0 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/autolink.ts @@ -0,0 +1,19 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; + +export const autolink = extend( + { + parse: (capture) => { + return { + content: [ + { + type: 'text', + content: capture[1], + }, + ], + target: capture[1], + }; + }, + }, + SimpleMarkdown.defaultRules.autolink +); diff --git a/packages/discord-markdown-parser/src/rules/blockQuote.ts b/packages/discord-markdown-parser/src/rules/blockQuote.ts new file mode 100644 index 0000000..4ac82d5 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/blockQuote.ts @@ -0,0 +1,24 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; +import { BlockQuoteRegex } from '../utils/regex'; + +export const blockQuote: SimpleMarkdown.ParserRule = extend( + { + match: function (source, state, prevSource) { + return !/^$|\n *$/.test(prevSource) || state.inQuote ? null : BlockQuoteRegex.exec(source); + }, + + parse: function (capture, parse, state) { + const all = capture[0]; + const isBlock = Boolean(/^ *>>> ?/.exec(all)); + const removeSyntaxRegex = isBlock ? /^ *>>> ?/ : /^ *> ?/gm; + const content = all.replace(removeSyntaxRegex, ''); + + return { + content: parse(content, Object.assign({}, state, { inQuote: true })), + type: 'blockQuote', + }; + }, + }, + SimpleMarkdown.defaultRules.blockQuote +); diff --git a/packages/discord-markdown-parser/src/rules/br.ts b/packages/discord-markdown-parser/src/rules/br.ts new file mode 100644 index 0000000..f53acb1 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/br.ts @@ -0,0 +1,9 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; + +export const br = extend( + { + match: SimpleMarkdown.anyScopeRegex(/^\n/), + }, + SimpleMarkdown.defaultRules.br +); diff --git a/packages/discord-markdown-parser/src/rules/codeBlock.ts b/packages/discord-markdown-parser/src/rules/codeBlock.ts new file mode 100644 index 0000000..fc4fcd7 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/codeBlock.ts @@ -0,0 +1,18 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; +import { CodeBlockRegex } from '../utils/regex'; + +export const codeBlock = extend( + { + match: SimpleMarkdown.inlineRegex(CodeBlockRegex), + + parse: function (capture, _parse, state) { + return { + lang: (capture[2] || '').trim(), + content: capture[3] || '', + inQuote: state.inQuote || false, + }; + }, + }, + SimpleMarkdown.defaultRules.codeBlock +); diff --git a/packages/discord-markdown-parser/src/rules/discord/channel.ts b/packages/discord-markdown-parser/src/rules/discord/channel.ts new file mode 100644 index 0000000..95f310b --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/channel.ts @@ -0,0 +1,12 @@ +import SimpleMarkdown from 'simple-markdown'; +import { ChannelMentionRegex } from '../../utils/regex'; + +export const channel: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => ChannelMentionRegex.exec(source), + parse: function (capture) { + return { + id: capture[1], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/emoji.ts b/packages/discord-markdown-parser/src/rules/discord/emoji.ts new file mode 100644 index 0000000..7706643 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/emoji.ts @@ -0,0 +1,14 @@ +import SimpleMarkdown from 'simple-markdown'; +import { EmojiRegex } from '../../utils/regex'; + +export const emoji: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => EmojiRegex.exec(source), + parse: function (capture) { + return { + animated: capture[1] === 'a', + name: capture[2], + id: capture[3], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/everyone.ts b/packages/discord-markdown-parser/src/rules/discord/everyone.ts new file mode 100644 index 0000000..340fddd --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/everyone.ts @@ -0,0 +1,10 @@ +import SimpleMarkdown from 'simple-markdown'; +import { EveryoneRegex } from '../../utils/regex'; + +export const everyone: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => EveryoneRegex.exec(source), + parse: function () { + return {}; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/here.ts b/packages/discord-markdown-parser/src/rules/discord/here.ts new file mode 100644 index 0000000..dd7dd1f --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/here.ts @@ -0,0 +1,10 @@ +import SimpleMarkdown from 'simple-markdown'; +import { HereRegex } from '../../utils/regex'; + +export const here: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => HereRegex.exec(source), + parse: function () { + return {}; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/role.ts b/packages/discord-markdown-parser/src/rules/discord/role.ts new file mode 100644 index 0000000..ea3c052 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/role.ts @@ -0,0 +1,12 @@ +import SimpleMarkdown from 'simple-markdown'; +import { RoleMentionRegex } from '../../utils/regex'; + +export const role: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => RoleMentionRegex.exec(source), + parse: function (capture) { + return { + id: capture[1], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/time.ts b/packages/discord-markdown-parser/src/rules/discord/time.ts new file mode 100644 index 0000000..53dc3f0 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/time.ts @@ -0,0 +1,13 @@ +import SimpleMarkdown from 'simple-markdown'; +import { TimestampRegex } from '../../utils/regex'; + +export const timestamp: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => TimestampRegex.exec(source), + parse: function (capture) { + return { + timestamp: capture[1], + format: capture[2], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/twemoji.ts b/packages/discord-markdown-parser/src/rules/discord/twemoji.ts new file mode 100644 index 0000000..8d772e7 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/twemoji.ts @@ -0,0 +1,12 @@ +import SimpleMarkdown from 'simple-markdown'; +import { TwemojiRegex } from '../../utils/twemojiRegex'; + +export const twemoji: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => TwemojiRegex.exec(source), + parse: function (capture) { + return { + name: capture[0], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/discord/user.ts b/packages/discord-markdown-parser/src/rules/discord/user.ts new file mode 100644 index 0000000..346dc9c --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/discord/user.ts @@ -0,0 +1,13 @@ +import SimpleMarkdown from 'simple-markdown'; +import { UserMentionRegex } from '../../utils/regex'; + +export const user: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.strong.order, + match: (source) => UserMentionRegex.exec(source), + parse: function (capture) { + return { + id: capture[1], + type: 'user', + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/em.ts b/packages/discord-markdown-parser/src/rules/em.ts new file mode 100644 index 0000000..21e6355 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/em.ts @@ -0,0 +1,17 @@ +import { extend } from '../utils/extend'; +import SimpleMarkdown from 'simple-markdown'; + +export const em = extend( + { + parse: function (capture, parse, state) { + const parsed = SimpleMarkdown.defaultRules.em.parse( + capture, + parse, + Object.assign({}, state, { inEmphasis: true }) + ); + + return state.inEmphasis ? parsed.content : parsed; + }, + }, + SimpleMarkdown.defaultRules.em +); diff --git a/packages/discord-markdown-parser/src/rules/emoticon.ts b/packages/discord-markdown-parser/src/rules/emoticon.ts new file mode 100644 index 0000000..5481278 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/emoticon.ts @@ -0,0 +1,13 @@ +import SimpleMarkdown from 'simple-markdown'; +import { EmoticonRegex } from '../utils/regex'; + +export const emoticon: SimpleMarkdown.ParserRule = { + order: SimpleMarkdown.defaultRules.text.order, + match: (source) => EmoticonRegex.exec(source), + parse: function (capture) { + return { + type: 'text', + content: capture[1], + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/inlineCode.ts b/packages/discord-markdown-parser/src/rules/inlineCode.ts new file mode 100644 index 0000000..33ba57e --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/inlineCode.ts @@ -0,0 +1,9 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; + +export const inlineCode = extend( + { + match: (source) => SimpleMarkdown.defaultRules.inlineCode.match.regex!.exec(source), + }, + SimpleMarkdown.defaultRules.inlineCode +); diff --git a/packages/discord-markdown-parser/src/rules/spoiler.ts b/packages/discord-markdown-parser/src/rules/spoiler.ts new file mode 100644 index 0000000..b8b04f6 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/spoiler.ts @@ -0,0 +1,12 @@ +import type SimpleMarkdown from 'simple-markdown'; +import { SpoilerRegex } from '../utils/regex'; + +export const spoiler: SimpleMarkdown.ParserRule = { + order: 0, + match: (source) => SpoilerRegex.exec(source), + parse: function (capture, parse, state) { + return { + content: parse(capture[1], state), + }; + }, +}; diff --git a/packages/discord-markdown-parser/src/rules/strike.ts b/packages/discord-markdown-parser/src/rules/strike.ts new file mode 100644 index 0000000..68397b9 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/strike.ts @@ -0,0 +1,10 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; +import { StrikeThroughRegex } from '../utils/regex'; + +export const strikethrough = extend( + { + match: SimpleMarkdown.inlineRegex(StrikeThroughRegex), + }, + SimpleMarkdown.defaultRules.del +); diff --git a/packages/discord-markdown-parser/src/rules/text.ts b/packages/discord-markdown-parser/src/rules/text.ts new file mode 100644 index 0000000..64eb35d --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/text.ts @@ -0,0 +1,10 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; +import { TextRegex } from '../utils/regex'; + +export const text = extend( + { + match: (source) => TextRegex.exec(source), + }, + SimpleMarkdown.defaultRules.text +); diff --git a/packages/discord-markdown-parser/src/rules/url.ts b/packages/discord-markdown-parser/src/rules/url.ts new file mode 100644 index 0000000..4122db6 --- /dev/null +++ b/packages/discord-markdown-parser/src/rules/url.ts @@ -0,0 +1,19 @@ +import SimpleMarkdown from 'simple-markdown'; +import { extend } from '../utils/extend'; + +export const url = extend( + { + parse: (capture) => { + return { + content: [ + { + type: 'text', + content: capture[1], + }, + ], + target: capture[1], + }; + }, + }, + SimpleMarkdown.defaultRules.url +); diff --git a/packages/discord-markdown-parser/src/tsconfig.json b/packages/discord-markdown-parser/src/tsconfig.json new file mode 100644 index 0000000..ab6cbff --- /dev/null +++ b/packages/discord-markdown-parser/src/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["."] +} diff --git a/packages/discord-markdown-parser/src/utils/extend.ts b/packages/discord-markdown-parser/src/utils/extend.ts new file mode 100644 index 0000000..96a9414 --- /dev/null +++ b/packages/discord-markdown-parser/src/utils/extend.ts @@ -0,0 +1,5 @@ +import type { ParserRule } from 'simple-markdown'; + +export const extend = (additionalRules: Partial, defaultRule: ParserRule): ParserRule => { + return Object.assign({}, defaultRule, additionalRules); +}; diff --git a/packages/discord-markdown-parser/src/utils/regex.ts b/packages/discord-markdown-parser/src/utils/regex.ts new file mode 100644 index 0000000..865c757 --- /dev/null +++ b/packages/discord-markdown-parser/src/utils/regex.ts @@ -0,0 +1,25 @@ +export const ChannelMentionRegex = /^<#(\d{17,20})>/; + +export const EmojiRegex = /^<(a)?:(\w{2,32}):(\d{17,21})>/; + +export const RoleMentionRegex = /^<@&(\d{17,20})>/; + +export const UserMentionRegex = /^<@!?(\d{17,20})>/; + +export const EveryoneRegex = /^@everyone/; + +export const HereRegex = /^@here/; + +export const BlockQuoteRegex = /^( *>>> ([\s\S]*))|^( *> [^\n]*(\n *> [^\n]*)*\n?)/; + +export const CodeBlockRegex = /^```(([a-z0-9-]+?)\n+)?\n*([^]+?)\n*```/i; + +export const EmoticonRegex = /^(¯\\_\(ツ\)_\/¯)/; + +export const SpoilerRegex = /^\|\|([\s\S]+?)\|\|/; + +export const StrikeThroughRegex = /^~~([\s\S]+?)~~(?!_)/; + +export const TextRegex = /^[\s\S]+?(?=[^0-9A-Za-z\s]|\n\n|\n|\w+:\S|$)/; + +export const TimestampRegex = /^/; diff --git a/packages/discord-markdown-parser/src/utils/twemojiRegex.ts b/packages/discord-markdown-parser/src/utils/twemojiRegex.ts new file mode 100644 index 0000000..0ec0bb1 --- /dev/null +++ b/packages/discord-markdown-parser/src/utils/twemojiRegex.ts @@ -0,0 +1,6 @@ +/** + * Regex that can capture a Twemoji (Twitter Emoji) + * @raw {@linkplain https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js See official source code} + */ +export const TwemojiRegex = + /^((?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f)/; diff --git a/packages/discord-markdown-parser/tests/parse.test.ts b/packages/discord-markdown-parser/tests/parse.test.ts new file mode 100644 index 0000000..37275f3 --- /dev/null +++ b/packages/discord-markdown-parser/tests/parse.test.ts @@ -0,0 +1,339 @@ +import { parse } from '../src'; +// TODO: figure out why ts isn't happy with using globals. +// https://vitest.dev/config/#globals +import { describe, test, expect } from 'vitest'; + +describe('Parse', () => { + test('GIVEN a normal string THEN parse is as a string', () => { + expect(parse('Hello world!')).toEqual([ + { + type: 'text', + content: 'Hello world', + }, + { + type: 'text', + content: '!', + }, + ]); + }); + + test('GIVEN a string with a twemoji THEN parse the twemoji', () => { + expect(parse('Hello world! 👀')).toEqual([ + { + type: 'text', + content: 'Hello world', + }, + { + type: 'text', + content: '! ', + }, + { + type: 'twemoji', + name: '👀', + }, + ]); + }); + + test('GIVEN a string with a emoji THEN parse the emoji', () => { + expect(parse('Hello 🦄 <:configuration:933601260559544330> ')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'twemoji', + name: '🦄', + }, + { + type: 'text', + content: ' ', + }, + { + type: 'emoji', + animated: false, + name: 'configuration', + id: '933601260559544330', + }, + { + type: 'text', + content: ' ', + }, + ]); + }); + + test('GIVEN a string with a user THEN parse the user', () => { + expect(parse('Hello <@!123456789123456780> ')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'user', + id: '123456789123456780', + }, + { + type: 'text', + content: ' ', + }, + ]); + }); + + test('GIVEN a string with a timestamp THEN parse the timestamp', () => { + expect(parse('Hello it is currently ')).toEqual([ + { + type: 'text', + content: 'Hello it is currently ', + }, + { + type: 'timestamp', + timestamp: '1664298780', + format: 'R', + }, + ]); + }); + + test('GIVEN a string with a role THEN parse the role', () => { + expect(parse('Hello <@&123456789123456780>')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'role', + id: '123456789123456780', + }, + ]); + }); + + test('GIVEN a string with a channel THEN parse the channel', () => { + expect(parse('See <#123456789123456780>')).toEqual([ + { + type: 'text', + content: 'See ', + }, + { + type: 'channel', + id: '123456789123456780', + }, + ]); + }); + + test('GIVEN a string with a link THEN parse the link', () => { + expect(parse('See https://google.com')).toEqual([ + { + type: 'text', + content: 'See ', + }, + { + type: 'url', + target: 'https://google.com', + content: [ + { + type: 'text', + content: 'https://google.com', + }, + ], + }, + ]); + }); + + test('GIVEN a string with a masked link without extended md support THEN do not parse as masked link', () => { + expect(parse('See [google](https://google.com)')).toEqual([ + { + type: 'text', + content: 'See ', + }, + { + type: 'text', + content: '[google', + }, + { + type: 'text', + content: ']', + }, + { + type: 'text', + content: '(', + }, + { + type: 'url', + target: 'https://google.com', + content: [ + { + type: 'text', + content: 'https://google.com', + }, + ], + }, + { + type: 'text', + content: ')', + }, + ]); + }); + + test('GIVEN a string with a masked link with extended md support THEN parse as masked link', () => { + expect(parse('See [google](https://google.com)', 'extended')).toEqual([ + { + type: 'text', + content: 'See ', + }, + { + type: 'link', + title: undefined, + target: 'https://google.com', + content: [ + { + type: 'text', + content: 'google', + }, + ], + }, + ]); + }); + + test('GIVEN a string with an autolink THEN parse the autolink', () => { + expect(parse('See ')).toEqual([ + { + type: 'text', + content: 'See ', + }, + { + type: 'autolink', + target: 'https://google.com', + content: [ + { + type: 'text', + content: 'https://google.com', + }, + ], + }, + ]); + }); + + test('GIVEN a string with a blockquote THEN parse the blockquote', () => { + expect(parse('> Hello world!')).toEqual([ + { + type: 'blockQuote', + content: [ + { + type: 'text', + content: 'Hello world', + }, + { + type: 'text', + content: '!', + }, + ], + }, + ]); + }); + + test('GIVEN a string with a multiline blockquote THEN parse the multiline blockquote', () => { + expect(parse('>>> Hello world!\nLine 2')).toEqual([ + { + type: 'blockQuote', + content: [ + { + type: 'text', + content: 'Hello world', + }, + { + type: 'text', + content: '!', + }, + { + type: 'br', + }, + { + type: 'text', + content: 'Line 2', + }, + ], + }, + ]); + }); + + test('GIVEN a string with a codeblock THEN parse the codeblock', () => { + expect(parse('```js\nconst a = 1;\n```')).toEqual([ + { + type: 'codeBlock', + lang: 'js', + inQuote: false, + content: 'const a = 1;', + }, + ]); + }); + + test('GIVEN a string with em THEN parse the em', () => { + expect(parse('*Hello world!*')).toEqual([ + { + type: 'em', + content: [ + { + type: 'text', + content: 'Hello world', + }, + { + type: 'text', + content: '!', + }, + ], + }, + ]); + }); + + test('GIVEN a string with a spoiler THEN parse the spoiler', () => { + expect(parse('Hello ||world||')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'spoiler', + content: [ + { + type: 'text', + content: 'world', + }, + ], + }, + ]); + }); + + test('GIVEN a @everyone mention THEN parse the @everyone mention', () => { + expect(parse('Hello @everyone')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'everyone', + }, + ]); + }); + + test('GIVEN a @here mention THEN parse the @here mention', () => { + expect(parse('Hello @here')).toEqual([ + { + type: 'text', + content: 'Hello ', + }, + { + type: 'here', + }, + ]); + }); + + // i have no idea why this is a thing + // src/rules/emoticon.ts + // but ig ill have to add a test for it + test('GIVEN string with ¯\\_(ツ)_/¯ THEN parse the ¯\\_(ツ)_/¯', () => { + expect(parse('¯\\_(ツ)_/¯')).toEqual([ + { + type: 'text', + content: '¯\\_(ツ)_/¯', + }, + ]); + }); +}); diff --git a/packages/discord-markdown-parser/tests/tsconfig.json b/packages/discord-markdown-parser/tests/tsconfig.json new file mode 100644 index 0000000..e2d27a7 --- /dev/null +++ b/packages/discord-markdown-parser/tests/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "types": ["vitest/globals"] + } +} diff --git a/packages/discord-markdown-parser/tsconfig.json b/packages/discord-markdown-parser/tsconfig.json new file mode 100644 index 0000000..c8e5dcf --- /dev/null +++ b/packages/discord-markdown-parser/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["vitest/globals"], + "outDir": "dist" + }, + "include": ["src"] +} diff --git a/packages/discord-markdown-parser/vitest.config.ts b/packages/discord-markdown-parser/vitest.config.ts new file mode 100644 index 0000000..47b9f1b --- /dev/null +++ b/packages/discord-markdown-parser/vitest.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + coverage: { + enabled: true, + reporter: ['text', 'lcov', 'clover'], + provider: 'c8', + }, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33baef0..514ee37 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,75 +4,173 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - '@derockdev/discord-components-core': - specifier: ^3.5.3 - version: 3.5.3 - '@derockdev/discord-components-react': - specifier: ^3.5.3 - version: 3.5.3(react-dom@18.2.0)(react@18.2.0) - discord-markdown-parser: - specifier: ~1.1.0 - version: 1.1.0 - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) - simple-markdown: - specifier: ^0.7.3 - version: 0.7.3 - twemoji: - specifier: ^14.0.2 - version: 14.0.2 - undici: - specifier: ^5.21.0 - version: 5.21.0 - -devDependencies: - '@types/node': - specifier: ^18.11.18 - version: 18.11.18 - '@types/react': - specifier: ^18.0.27 - version: 18.0.27 - '@types/react-dom': - specifier: ^18.0.10 - version: 18.0.10 - '@typescript-eslint/eslint-plugin': - specifier: ^5.49.0 - version: 5.49.0(@typescript-eslint/parser@5.49.0)(eslint@8.32.0)(typescript@5.1.6) - '@typescript-eslint/parser': - specifier: ^5.49.0 - version: 5.49.0(eslint@8.32.0)(typescript@5.1.6) - discord.js: - specifier: ^14.12.0 - version: 14.12.0 - dotenv: - specifier: ^16.0.3 - version: 16.0.3 - eslint: - specifier: ^8.32.0 - version: 8.32.0 - husky: - specifier: ^8.0.3 - version: 8.0.3 - prettier: - specifier: ^2.8.3 - version: 2.8.3 - pretty-quick: - specifier: ^3.1.3 - version: 3.1.3(prettier@2.8.3) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@18.11.18)(typescript@5.1.6) - typescript: - specifier: ^5.1.6 - version: 5.1.6 +importers: + + .: + devDependencies: + '@types/react': + specifier: ^18.0.27 + version: 18.0.27 + eslint: + specifier: ^8.47.0 + version: 8.47.0 + vitest: + specifier: ^0.34.1 + version: 0.34.1 + + packages/discord-components-core: + dependencies: + '@stencil/core': + specifier: ^2.22.1 + version: 2.22.2 + clsx: + specifier: ^1.2.1 + version: 1.2.1 + hex-to-rgba: + specifier: ^2.0.1 + version: 2.0.1 + highlight.js: + specifier: ^11.6.0 + version: 11.7.0 + devDependencies: + '@sapphire/ts-config': + specifier: ^3.3.4 + version: 3.3.4 + replace-in-file: + specifier: ^6.3.5 + version: 6.3.5 + tslib: + specifier: ^2.4.0 + version: 2.4.1 + + packages/discord-components-react: + dependencies: + '@derockdev/discord-components-core': + specifier: ^3.5.1 + version: 3.5.3 + react: + specifier: 16.8.x || 17.x || 18.x + version: 18.2.0 + react-dom: + specifier: 16.8.x || 17.x || 18.x + version: 18.2.0(react@18.2.0) + tslib: + specifier: ^2.4.0 + version: 2.4.1 + devDependencies: + gen-esm-wrapper: + specifier: ^1.1.3 + version: 1.1.3 + replace-in-file: + specifier: ^6.3.5 + version: 6.3.5 + + packages/discord-html-transcripts: + dependencies: + '@derockdev/discord-components-core': + specifier: ^3.5.3 + version: 3.5.3 + '@derockdev/discord-components-react': + specifier: ^3.5.3 + version: 3.5.3(react-dom@18.2.0)(react@18.2.0) + discord-markdown-parser: + specifier: ~1.1.0 + version: link:../discord-markdown-parser + react: + specifier: ^18.2.0 + version: 18.2.0 + react-dom: + specifier: ^18.2.0 + version: 18.2.0(react@18.2.0) + simple-markdown: + specifier: ^0.7.3 + version: 0.7.3 + twemoji: + specifier: ^14.0.2 + version: 14.0.2 + undici: + specifier: ^5.21.0 + version: 5.21.0 + devDependencies: + '@types/node': + specifier: ^18.11.18 + version: 18.11.18 + '@types/react': + specifier: ^18.0.27 + version: 18.0.27 + '@types/react-dom': + specifier: ^18.0.10 + version: 18.0.10 + '@typescript-eslint/eslint-plugin': + specifier: ^5.49.0 + version: 5.49.0(@typescript-eslint/parser@5.49.0)(eslint@8.32.0)(typescript@5.1.6) + '@typescript-eslint/parser': + specifier: ^5.49.0 + version: 5.49.0(eslint@8.32.0)(typescript@5.1.6) + discord.js: + specifier: ^14.12.0 + version: 14.12.0 + dotenv: + specifier: ^16.0.3 + version: 16.0.3 + eslint: + specifier: ^8.32.0 + version: 8.32.0 + husky: + specifier: ^8.0.3 + version: 8.0.3 + prettier: + specifier: ^2.8.3 + version: 2.8.3 + pretty-quick: + specifier: ^3.1.3 + version: 3.1.3(prettier@2.8.3) + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@18.11.18)(typescript@5.1.6) + typescript: + specifier: ^5.1.6 + version: 5.1.6 + + packages/discord-markdown-parser: + dependencies: + simple-markdown: + specifier: ^0.7.3 + version: 0.7.3 + devDependencies: + '@types/node': + specifier: ^18.7.13 + version: 18.11.18 + '@vitest/coverage-c8': + specifier: ^0.23.4 + version: 0.23.4 + colorette: + specifier: ^2.0.19 + version: 2.0.19 + prettier: + specifier: ^2.7.1 + version: 2.8.3 + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@18.11.18)(typescript@4.8.2) + typescript: + specifier: ^4.8.2 + version: 4.8.2 + vitest: + specifier: ^0.23.4 + version: 0.23.4 packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + + /@bcoe/v8-coverage@0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -100,7 +198,7 @@ packages: '@derockdev/discord-components-core': 3.5.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - tslib: 2.4.1 + tslib: 2.6.1 dev: false /@discordjs/builders@1.6.4: @@ -166,6 +264,39 @@ packages: - utf-8-validate dev: true + /@esbuild/android-arm@0.15.18: + resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.15.18: + resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@eslint-community/eslint-utils@4.4.0(eslint@8.47.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.47.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.6.2: + resolution: {integrity: sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + /@eslint/eslintrc@1.4.1: resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -183,6 +314,39 @@ packages: - supports-color dev: true + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.19.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.47.0: + resolution: {integrity: sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@humanwhocodes/config-array@0.11.10: + resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + /@humanwhocodes/config-array@0.11.8: resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} engines: {node: '>=10.10.0'} @@ -203,20 +367,39 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@istanbuljs/schema@0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jest/schemas@29.6.0: + resolution: {integrity: sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.19: + resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@jridgewell/trace-mapping@0.3.9: resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@nodelib/fs.scandir@2.1.5: @@ -258,6 +441,18 @@ packages: engines: {node: '>=v14.0.0', npm: '>=7.0.0'} dev: true + /@sapphire/ts-config@3.3.4: + resolution: {integrity: sha512-mWEUxCXh3cHKI7C8HJ049exVTMNaq+A/lJEDfM5ENSQ/OOZHd5DdmXn2jrYqFWbTRCHa0Vp2FAmACWBwePsBtg==} + engines: {node: '>=v16.0.0', npm: '>=8.0.0'} + dependencies: + tslib: 2.6.1 + typescript: 4.8.2 + dev: true + + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + /@stencil/core@2.22.2: resolution: {integrity: sha512-r+vbxsGNcBaV1VDOYW25lv4QfXTlNoIb5GpUX7rZ+cr59yqYCZC5tlV+IzX6YgHKW62ulCc9M3RYtTfHtNbNNw==} engines: {node: '>=12.10.0', npm: '>=6.0.0'} @@ -280,6 +475,20 @@ packages: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true + /@types/chai-subset@1.3.3: + resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} + dependencies: + '@types/chai': 4.3.5 + dev: true + + /@types/chai@4.3.5: + resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} + dev: true + + /@types/istanbul-lib-coverage@2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + /@types/json-schema@7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true @@ -341,7 +550,7 @@ packages: ignore: 5.2.4 natural-compare-lite: 1.4.0 regexpp: 3.2.0 - semver: 7.3.8 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: @@ -415,7 +624,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.3.8 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: @@ -436,7 +645,7 @@ packages: eslint: 8.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@8.32.0) - semver: 7.3.8 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript @@ -450,17 +659,75 @@ packages: eslint-visitor-keys: 3.3.0 dev: true + /@vitest/coverage-c8@0.23.4: + resolution: {integrity: sha512-jmD00a5DQH9gu9K+YdvVhcMuv2CzHvU4gCnySS40Ec5hKlXtlCzRfNHl00VnhfuBeaQUmaQYe60BLT413HyDdg==} + deprecated: v8 coverage is moved to @vitest/coverage-v8 package + dependencies: + c8: 7.14.0 + vitest: 0.23.4 + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@vitest/browser' + - '@vitest/ui' + - happy-dom + - jsdom + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /@vitest/expect@0.34.1: + resolution: {integrity: sha512-q2CD8+XIsQ+tHwypnoCk8Mnv5e6afLFvinVGCq3/BOT4kQdVQmY6rRfyKkwcg635lbliLPqbunXZr+L1ssUWiQ==} + dependencies: + '@vitest/spy': 0.34.1 + '@vitest/utils': 0.34.1 + chai: 4.3.7 + dev: true + + /@vitest/runner@0.34.1: + resolution: {integrity: sha512-YfQMpYzDsYB7yqgmlxZ06NI4LurHWfrH7Wy3Pvf/z/vwUSgq1zLAb1lWcItCzQG+NVox+VvzlKQrYEXb47645g==} + dependencies: + '@vitest/utils': 0.34.1 + p-limit: 4.0.0 + pathe: 1.1.1 + dev: true + + /@vitest/snapshot@0.34.1: + resolution: {integrity: sha512-0O9LfLU0114OqdF8lENlrLsnn024Tb1CsS9UwG0YMWY2oGTQfPtkW+B/7ieyv0X9R2Oijhi3caB1xgGgEgclSQ==} + dependencies: + magic-string: 0.30.2 + pathe: 1.1.1 + pretty-format: 29.6.2 + dev: true + + /@vitest/spy@0.34.1: + resolution: {integrity: sha512-UT4WcI3EAPUNO8n6y9QoEqynGGEPmmRxC+cLzneFFXpmacivjHZsNbiKD88KUScv5DCHVDgdBsLD7O7s1enFcQ==} + dependencies: + tinyspy: 2.1.1 + dev: true + + /@vitest/utils@0.34.1: + resolution: {integrity: sha512-/ql9dsFi4iuEbiNcjNHQWXBum7aL8pyhxvfnD9gNtbjR9fUKAjxhj4AA3yfLXg6gJpMGGecvtF8Au2G9y3q47Q==} + dependencies: + diff-sequences: 29.4.3 + loupe: 2.3.6 + pretty-format: 29.6.2 + dev: true + /@vladfrangu/async_event_emitter@2.2.2: resolution: {integrity: sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true /acorn-walk@8.2.0: @@ -468,8 +735,8 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -495,6 +762,11 @@ packages: color-convert: 2.0.1 dev: true + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true @@ -518,6 +790,17 @@ packages: engines: {node: '>=8'} dev: true + /assert@1.5.0: + resolution: {integrity: sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==} + dependencies: + object-assign: 4.1.1 + util: 0.10.3 + dev: true + + /assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + dev: true + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true @@ -542,11 +825,48 @@ packages: dependencies: streamsearch: 1.1.0 + /c8@7.14.0: + resolution: {integrity: sha512-i04rtkkcNcCf7zsQcSv/T9EbUn4RXQ6mropeMcjFOsQXQ0iGLAr/xT6TImQg4+U9hmNpN9XdvPkjUL1IzbgxJw==} + engines: {node: '>=10.12.0'} + hasBin: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.1 + istanbul-reports: 3.1.6 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.1.0 + yargs: 16.2.0 + yargs-parser: 20.2.9 + dev: true + + /cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} dev: true + /chai@4.3.7: + resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.2 + deep-eql: 4.1.3 + get-func-name: 2.0.0 + loupe: 2.3.6 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + /chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} @@ -563,6 +883,27 @@ packages: supports-color: 7.2.0 dev: true + /check-error@1.0.2: + resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} + dev: true + + /cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + /clsx@1.2.1: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} @@ -579,8 +920,16 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /colorette@2.0.19: + resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} + dev: true + /concat-map@0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /convert-source-map@1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true /create-require@1.1.1: @@ -611,10 +960,22 @@ packages: ms: 2.1.2 dev: true + /deep-eql@4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + engines: {node: '>=6'} + dependencies: + type-detect: 4.0.8 + dev: true + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true + /diff-sequences@29.4.3: + resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -631,12 +992,6 @@ packages: resolution: {integrity: sha512-tdmdH98t3zgjQF6zwOHl0OB/PCBiE4aVsNTuN7m0PfU2jOLx3lNoU6xTeFALntUtlIxN80GTr9RPQR4t7msjSg==} dev: true - /discord-markdown-parser@1.1.0: - resolution: {integrity: sha512-o2+iFgt5qer6UYY5hVTPGq2mGzleKRGYKcvymg67FdKg4AMJ061KbebKunCERWKjx79dmNHMDnGV2F0DRGCNkw==} - dependencies: - simple-markdown: 0.7.3 - dev: false - /discord.js@14.12.0: resolution: {integrity: sha512-rvqwvcu73p8QCsy90klZ6n8HLfaN9SCCKyGGrgVIHcJ3ywUzr1hU67Zm/0c7h2PR45ySZqSHV8x2mIfJ1+n/OA==} engines: {node: '>=16.9.0'} @@ -672,12 +1027,231 @@ packages: engines: {node: '>=12'} dev: true + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: once: 1.4.0 dev: true + /esbuild-android-64@0.15.18: + resolution: {integrity: sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64@0.15.18: + resolution: {integrity: sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64@0.15.18: + resolution: {integrity: sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64@0.15.18: + resolution: {integrity: sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64@0.15.18: + resolution: {integrity: sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64@0.15.18: + resolution: {integrity: sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32@0.15.18: + resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64@0.15.18: + resolution: {integrity: sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64@0.15.18: + resolution: {integrity: sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm@0.15.18: + resolution: {integrity: sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le@0.15.18: + resolution: {integrity: sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le@0.15.18: + resolution: {integrity: sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64@0.15.18: + resolution: {integrity: sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x@0.15.18: + resolution: {integrity: sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64@0.15.18: + resolution: {integrity: sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64@0.15.18: + resolution: {integrity: sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64@0.15.18: + resolution: {integrity: sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32@0.15.18: + resolution: {integrity: sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64@0.15.18: + resolution: {integrity: sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64@0.15.18: + resolution: {integrity: sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild@0.15.18: + resolution: {integrity: sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.18 + '@esbuild/linux-loong64': 0.15.18 + esbuild-android-64: 0.15.18 + esbuild-android-arm64: 0.15.18 + esbuild-darwin-64: 0.15.18 + esbuild-darwin-arm64: 0.15.18 + esbuild-freebsd-64: 0.15.18 + esbuild-freebsd-arm64: 0.15.18 + esbuild-linux-32: 0.15.18 + esbuild-linux-64: 0.15.18 + esbuild-linux-arm: 0.15.18 + esbuild-linux-arm64: 0.15.18 + esbuild-linux-mips64le: 0.15.18 + esbuild-linux-ppc64le: 0.15.18 + esbuild-linux-riscv64: 0.15.18 + esbuild-linux-s390x: 0.15.18 + esbuild-netbsd-64: 0.15.18 + esbuild-openbsd-64: 0.15.18 + esbuild-sunos-64: 0.15.18 + esbuild-windows-32: 0.15.18 + esbuild-windows-64: 0.15.18 + esbuild-windows-arm64: 0.15.18 + dev: true + + /escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -699,6 +1273,14 @@ packages: estraverse: 5.3.0 dev: true + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + /eslint-utils@3.0.0(eslint@8.32.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} @@ -719,6 +1301,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /eslint@8.32.0: resolution: {integrity: sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -767,30 +1354,92 @@ packages: - supports-color dev: true - /espree@9.4.1: - resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==} + /eslint@8.47.0: + resolution: {integrity: sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.3.0 - dev: true - - /esquery@1.4.0: - resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@4.3.0: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) + '@eslint-community/regexpp': 4.6.2 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.47.0 + '@humanwhocodes/config-array': 0.11.10 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.19.0 + graphemer: 1.4.0 + ignore: 5.2.4 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.4.1: + resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.3.0 + dev: true + + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 + dev: true + + /esquery@1.4.0: + resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} engines: {node: '>=4.0'} dev: true @@ -891,6 +1540,14 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true + /foreground-child@2.0.0: + resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} + engines: {node: '>=8.0.0'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 3.0.7 + dev: true + /fs-extra@8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} @@ -904,6 +1561,34 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true + /fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /gen-esm-wrapper@1.1.3: + resolution: {integrity: sha512-LNHZ+QpaCW/0VhABIbXn45V+P8kFvjjwuue9hbV23eOjuFVz6c0FE3z1XpLX9pSjLW7UmtCkXo5F9vhZWVs8oQ==} + hasBin: true + dependencies: + is-valid-identifier: 2.0.2 + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-func-name@2.0.0: + resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} + dev: true + /get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -964,11 +1649,22 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: true + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + /hex-to-rgba@2.0.1: resolution: {integrity: sha512-5XqPJBpsEUMsseJUi2w2Hl7cHFFi3+OO10M2pzAvKB1zL6fc+koGMhmBqoDOCB4GemiRM/zvDMRIhVw6EkB8dQ==} dev: false @@ -978,6 +1674,10 @@ packages: engines: {node: '>=12.0.0'} dev: false + /html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + /human-signals@1.1.1: resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} engines: {node: '>=8.12.0'} @@ -1014,15 +1714,30 @@ packages: wrappy: 1.0.2 dev: true + /inherits@2.0.1: + resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} + dev: true + /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} dev: true + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1045,10 +1760,38 @@ packages: engines: {node: '>=8'} dev: true + /is-valid-identifier@2.0.2: + resolution: {integrity: sha512-mpS5EGqXOwzXtKAg6I44jIAqeBfntFLxpAth1rrKbxtKyI6LPktyDYpHBI+tHlduhhX/SF26mFXmxQu995QVqg==} + dependencies: + assert: 1.5.0 + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true + /istanbul-lib-coverage@3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 4.0.0 + supports-color: 7.2.0 + dev: true + + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + dev: true + /js-sdsl@4.3.0: resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==} dev: true @@ -1072,6 +1815,10 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true + /jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + dev: true + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -1094,6 +1841,11 @@ packages: type-check: 0.4.0 dev: true + /local-pkg@0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + engines: {node: '>=14'} + dev: true + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -1127,6 +1879,12 @@ packages: js-tokens: 4.0.0 dev: false + /loupe@2.3.6: + resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + dependencies: + get-func-name: 2.0.0 + dev: true + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -1138,6 +1896,20 @@ packages: resolution: {integrity: sha512-bpRmwbRHqongRhA+mXzbLWjVy7ylqmfMBYaQkSs6pac0z6hBTvsgrH0r4FBYd/UYVJBmS6Rp/O+oCCQVLzKV1g==} dev: true + /magic-string@0.30.2: + resolution: {integrity: sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + dependencies: + semver: 7.5.4 + dev: true + /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true @@ -1170,6 +1942,15 @@ packages: brace-expansion: 1.1.11 dev: true + /mlly@1.4.0: + resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==} + dependencies: + acorn: 8.10.0 + pathe: 1.1.1 + pkg-types: 1.0.3 + ufo: 1.2.0 + dev: true + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -1190,6 +1971,12 @@ packages: minimatch: 3.1.2 dev: true + /nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: true @@ -1205,6 +1992,11 @@ packages: path-key: 3.1.1 dev: true + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -1230,6 +2022,18 @@ packages: word-wrap: 1.2.3 dev: true + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -1244,6 +2048,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -1285,16 +2096,49 @@ packages: engines: {node: '>=8'} dev: true + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} dev: true + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + dev: true + + /pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + dev: true + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} dev: true + /pkg-types@1.0.3: + resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} + dependencies: + jsonc-parser: 3.2.0 + mlly: 1.4.0 + pathe: 1.1.1 + dev: true + + /postcss@8.4.27: + resolution: {integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1306,6 +2150,15 @@ packages: hasBin: true dev: true + /pretty-format@29.6.2: + resolution: {integrity: sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.0 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /pretty-quick@3.1.3(prettier@2.8.3): resolution: {integrity: sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==} engines: {node: '>=10.13'} @@ -1348,6 +2201,10 @@ packages: scheduler: 0.23.0 dev: false + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} @@ -1360,11 +2217,35 @@ packages: engines: {node: '>=8'} dev: true + /replace-in-file@6.3.5: + resolution: {integrity: sha512-arB9d3ENdKva2fxRnSjwBEXfK1npgyci7ZZuwysgAp7ORjHSyxz6oqIjTEv8R0Ydl4Ll7uOAZXL4vbkhGIizCg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + chalk: 4.1.2 + glob: 7.2.3 + yargs: 17.7.2 + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} dev: true + /resolve@1.22.4: + resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -1377,6 +2258,14 @@ packages: glob: 7.2.3 dev: true + /rollup@2.79.1: + resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -1389,8 +2278,8 @@ packages: loose-envify: 1.4.0 dev: false - /semver@7.3.8: - resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -1409,6 +2298,10 @@ packages: engines: {node: '>=8'} dev: true + /siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + dev: true + /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true @@ -1424,10 +2317,32 @@ packages: engines: {node: '>=8'} dev: true + /source-map-js@1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + + /stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + dev: true + + /std-env@3.3.3: + resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} + dev: true + /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -1445,6 +2360,18 @@ packages: engines: {node: '>=8'} dev: true + /strip-literal@0.4.2: + resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} + dependencies: + acorn: 8.10.0 + dev: true + + /strip-literal@1.3.0: + resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} + dependencies: + acorn: 8.10.0 + dev: true + /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1452,10 +2379,48 @@ packages: has-flag: 4.0.0 dev: true + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true + /tinybench@2.5.0: + resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} + dev: true + + /tinypool@0.3.1: + resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} + engines: {node: '>=14.0.0'} + dev: true + + /tinypool@0.7.0: + resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + engines: {node: '>=14.0.0'} + dev: true + + /tinyspy@1.1.1: + resolution: {integrity: sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==} + engines: {node: '>=14.0.0'} + dev: true + + /tinyspy@2.1.1: + resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==} + engines: {node: '>=14.0.0'} + dev: true + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -1467,6 +2432,37 @@ packages: resolution: {integrity: sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==} dev: true + /ts-node@10.9.1(@types/node@18.11.18)(typescript@4.8.2): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.11.18 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.8.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /ts-node@10.9.1(@types/node@18.11.18)(typescript@5.1.6): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -1487,7 +2483,7 @@ packages: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 '@types/node': 18.11.18 - acorn: 8.8.2 + acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 @@ -1504,11 +2500,9 @@ packages: /tslib@2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} - dev: false /tslib@2.6.1: resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} - dev: true /tsutils@3.21.0(typescript@5.1.6): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -1540,17 +2534,32 @@ packages: prelude-ls: 1.2.1 dev: true + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} dev: true + /typescript@4.8.2: + resolution: {integrity: sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true dev: true + /ufo@1.2.0: + resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==} + dev: true + /undici@5.21.0: resolution: {integrity: sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==} engines: {node: '>=12.18'} @@ -1576,10 +2585,186 @@ packages: punycode: 2.3.0 dev: true + /util@0.10.3: + resolution: {integrity: sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==} + dependencies: + inherits: 2.0.1 + dev: true + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true + /v8-to-istanbul@9.1.0: + resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.19 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + + /vite-node@0.34.1(@types/node@18.11.18): + resolution: {integrity: sha512-odAZAL9xFMuAg8aWd7nSPT+hU8u2r9gU3LRm9QKjxBEF2rRdWpMuqkrkjvyVQEdNFiBctqr2Gg4uJYizm5Le6w==} + engines: {node: '>=v14.18.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.4.0 + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 3.2.7(@types/node@18.11.18) + transitivePeerDependencies: + - '@types/node' + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vite@3.2.7(@types/node@18.11.18): + resolution: {integrity: sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.11.18 + esbuild: 0.15.18 + postcss: 8.4.27 + resolve: 1.22.4 + rollup: 2.79.1 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vitest@0.23.4: + resolution: {integrity: sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==} + engines: {node: '>=v14.16.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 18.11.18 + chai: 4.3.7 + debug: 4.3.4 + local-pkg: 0.4.3 + strip-literal: 0.4.2 + tinybench: 2.5.0 + tinypool: 0.3.1 + tinyspy: 1.1.1 + vite: 3.2.7(@types/node@18.11.18) + transitivePeerDependencies: + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vitest@0.34.1: + resolution: {integrity: sha512-G1PzuBEq9A75XSU88yO5G4vPT20UovbC/2osB2KEuV/FisSIIsw7m5y2xMdB7RsAGHAfg2lPmp2qKr3KWliVlQ==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 18.11.18 + '@vitest/expect': 0.34.1 + '@vitest/runner': 0.34.1 + '@vitest/snapshot': 0.34.1 + '@vitest/spy': 0.34.1 + '@vitest/utils': 0.34.1 + acorn: 8.10.0 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + debug: 4.3.4 + local-pkg: 0.4.3 + magic-string: 0.30.2 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.3.3 + strip-literal: 1.3.0 + tinybench: 2.5.0 + tinypool: 0.7.0 + vite: 3.2.7(@types/node@18.11.18) + vite-node: 0.34.1(@types/node@18.11.18) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -1588,11 +2773,29 @@ packages: isexe: 2.0.0 dev: true + /why-is-node-running@2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + dev: true + /word-wrap@1.2.3: resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} engines: {node: '>=0.10.0'} dev: true + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true @@ -1610,10 +2813,51 @@ packages: optional: true dev: true + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -1623,3 +2867,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /yocto-queue@1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..4e708bd --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - 'packages/*' + - 'apps/*' diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index e5b1fc3..1735f11 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -4,5 +4,18 @@ "noEmit": true, "skipLibCheck": true }, - "include": ["src", "tests", "tsup.config.ts"] + "include": [ + "**/*.ts", + "**/*.tsx", + "**/*.js", + "**/*.mjs", + "**/*.jsx", + "**/*.test.ts", + "**/*.test.js", + "**/*.test.mjs", + "**/*.spec.ts", + "**/*.spec.js", + "**/*.spec.mjs" + ], + "exclude": [] } diff --git a/tsconfig.json b/tsconfig.json index 4163a05..1fff1c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "es2017", - "lib": ["dom", "dom.iterable", "esnext"], + "target": "es2021", + "lib": ["esnext"], "strict": true, "forceConsistentCasingInFileNames": true, "esModuleInterop": true, @@ -25,7 +25,5 @@ "incremental": true, "declaration": true, "skipLibCheck": true - }, - "include": ["src"], - "exclude": ["node_modules"] + } }