From 37458c916fc5db7a6bc0417aefdb326acdfadf74 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Sun, 23 Jul 2023 16:59:42 +0000 Subject: [PATCH 01/17] Remove old translations --- docs/pt-br/guide/asset-handling.md | 100 ----------- docs/pt-br/guide/css-theme.md | 98 ----------- docs/pt-br/guide/faqs.md | 47 ----- docs/pt-br/guide/installation.md | 33 ---- docs/pt-br/guide/javascript-plugin.md | 66 ------- docs/pt-br/guide/lcu-request.md | 146 ---------------- docs/pt-br/guide/migration-from-v0-6.md | 149 ---------------- docs/pt-br/guide/module-system.md | 219 ------------------------ docs/pt-br/guide/npm-compatibility.md | 41 ----- docs/pt-br/guide/welcome.md | 45 ----- docs/pt-br/index.md | 42 ----- docs/pt-br/runtime-api/auth-callback.md | 47 ----- docs/pt-br/runtime-api/data-store.md | 64 ------- docs/pt-br/runtime-api/effect.md | 103 ----------- docs/pt-br/runtime-api/index.md | 93 ---------- docs/vi/guide/asset-handling.md | 99 ----------- docs/vi/guide/css-theme.md | 97 ----------- docs/vi/guide/faqs.md | 47 ----- docs/vi/guide/installation.md | 33 ---- docs/vi/guide/javascript-plugin.md | 64 ------- docs/vi/guide/lcu-request.md | 146 ---------------- docs/vi/guide/migration-from-v0-6.md | 149 ---------------- docs/vi/guide/module-system.md | 216 ----------------------- docs/vi/guide/npm-compatibility.md | 39 ----- docs/vi/guide/welcome.md | 53 ------ docs/vi/index.md | 42 ----- docs/vi/runtime-api/auth-callback.md | 44 ----- docs/vi/runtime-api/data-store.md | 59 ------- docs/vi/runtime-api/effect.md | 99 ----------- docs/vi/runtime-api/index.md | 92 ---------- 30 files changed, 2572 deletions(-) delete mode 100644 docs/pt-br/guide/asset-handling.md delete mode 100644 docs/pt-br/guide/css-theme.md delete mode 100644 docs/pt-br/guide/faqs.md delete mode 100644 docs/pt-br/guide/installation.md delete mode 100644 docs/pt-br/guide/javascript-plugin.md delete mode 100644 docs/pt-br/guide/lcu-request.md delete mode 100644 docs/pt-br/guide/migration-from-v0-6.md delete mode 100644 docs/pt-br/guide/module-system.md delete mode 100644 docs/pt-br/guide/npm-compatibility.md delete mode 100644 docs/pt-br/guide/welcome.md delete mode 100644 docs/pt-br/index.md delete mode 100644 docs/pt-br/runtime-api/auth-callback.md delete mode 100644 docs/pt-br/runtime-api/data-store.md delete mode 100644 docs/pt-br/runtime-api/effect.md delete mode 100644 docs/pt-br/runtime-api/index.md delete mode 100644 docs/vi/guide/asset-handling.md delete mode 100644 docs/vi/guide/css-theme.md delete mode 100644 docs/vi/guide/faqs.md delete mode 100644 docs/vi/guide/installation.md delete mode 100644 docs/vi/guide/javascript-plugin.md delete mode 100644 docs/vi/guide/lcu-request.md delete mode 100644 docs/vi/guide/migration-from-v0-6.md delete mode 100644 docs/vi/guide/module-system.md delete mode 100644 docs/vi/guide/npm-compatibility.md delete mode 100644 docs/vi/guide/welcome.md delete mode 100644 docs/vi/index.md delete mode 100644 docs/vi/runtime-api/auth-callback.md delete mode 100644 docs/vi/runtime-api/data-store.md delete mode 100644 docs/vi/runtime-api/effect.md delete mode 100644 docs/vi/runtime-api/index.md diff --git a/docs/pt-br/guide/asset-handling.md b/docs/pt-br/guide/asset-handling.md deleted file mode 100644 index f0cf245..0000000 --- a/docs/pt-br/guide/asset-handling.md +++ /dev/null @@ -1,100 +0,0 @@ -# Asset Handling - -Assets can be other resources such as fonts, images, media, etc. that you use -from your plugin to load custom content. - -## Local assets - -### Plugin assets - -Each plugin should have its own assets folder to store assets. - -For example, with the plugin structure below: - -``` -plugins/ - |__your-plugin/ - |__assets/ <- assets - |__background.png - |... - |__index.js <- entry - |__theme.css <- theme -``` - -If your plugin folder name is unique and will not change in the future, you can -use this link to access the `background.png` directly: - -``` -//plugins/your-plugin/assets/background.png -``` - -We recommend that you use the module system instead. - -::: code-group - -```js [index.js] -import background from './assets/background.png' - -// usage -const img = document.getElementById('some-img') -img.src = background -``` - -```css [theme.css] -/* note that you should -import this theme.css from your index.js */ - -.some-div { - background-image: url('./assets/background.png'); -} -``` - -::: - -### Common assets - -Since v0.5, we have provided access to local assets via the `//assets/` domain. - -Example: - -``` -loader/ - |__assets/ - |__your-image.png - |__your-background.mp4 - |... - |__plugins/ - |... -``` - -```html - - -``` - -## Remote assets - -### GitHub file hosting - -If you prefer to host your assets on GitHub, you should use the **RawGitHack** -CDN to avoid access restrictions. It also supports GitLab and Bitbucket. - -Try it now: https://raw.githack.com/ - -![](/guide/rawgithack.png) - -### Imgur image hosting - -Imgur is a great free image hosting service. You can upload your images to the -Imgur site and retrieve the link. - -Try it now: https://imgur.com/ - -## Optimizing your resources - -You should reduce the asset size to optimize your plugin load time. - -- JavaScript and CSS code should be minified for production -- For SVGs, you can use https://github.com/svg/svgo -- With images, you should convert them to **webp** format -- With video, you can try to convert to **webm** format diff --git a/docs/pt-br/guide/css-theme.md b/docs/pt-br/guide/css-theme.md deleted file mode 100644 index df05153..0000000 --- a/docs/pt-br/guide/css-theme.md +++ /dev/null @@ -1,98 +0,0 @@ -# CSS Theme - -A plugin is considered a **theme** if it aims to to change the default style of -the League Client, rather than creating helpers for the Client. - -## Creating a theme - -From your plugin entry, use `import` to add it: - -```javascript -import './theme.css' -``` - -This line will append a link tag to body pointing to `theme.css` next to your -`index.js` . - -``` -your-plugin/ - |__index.js <- plugin entry - |__theme.css <- your theme -``` - -### Changing the default font - -The following will import a custom font from -[Google Fonts](https://fonts.google.com/) and override the default font using -the `:root` selector and CSS variables. - -```css -/* theme.css */ -@import url('https://fonts.googleapis.com/css2?family=Shantell+Sans&display=swap'); - -:root { - /* override default League font */ - --font-display: 'Shantell Sans', sans-serif !important; - --font-body: 'Shantell Sans', sans-serif !important; -} -``` - -Note that some selectors may no be applied due to the priority, you can force -them on top of the rules with the `!important` suffix. - -To get more CSS variables used by the Client, you should inpsect them using the -Chrome DevTools. Try hitting the `Ctrl Shift I` key to open it. - -## CSS module - -When you **import** the theme, your theme becomes a module. Now you can use the -relative path of `url()` to import assets. - -```css -/* theme.css */ -.some-div { - background-image: url(./assets/background.png); -} - -.another-div { - background-image: url(./assets/some-image.jpg); -} -``` - -The corresponding plugin structure: - -``` -your-plugin/ - |__assets/ - |__background.png - |__some-image.jpg - |__theme.css -``` - -## Remote theme - -Using remote theme keeps your theme up to date. - -The following will inject a stylesheet link tag pointing to your theme from -https://example.com/theme.css - -```javascript -// index.js -function addCssLink(url) { - const link = document.createElement('link') - link.href = url - link.type = 'text/css' - link.rel = 'stylesheet' - document.head.appendChild(link) -} - -window.addEventListener('load', () => { - addCssLink('https://example.com/theme.css') -}) -``` - -::: info - -Your server should respond with MIME type `text/css` . - -::: diff --git a/docs/pt-br/guide/faqs.md b/docs/pt-br/guide/faqs.md deleted file mode 100644 index 51d4ed8..0000000 --- a/docs/pt-br/guide/faqs.md +++ /dev/null @@ -1,47 +0,0 @@ -# FAQs - -

- -

- -## Can I get banned? - -Pengu Loader is totally safe to use. - -## Does it affect the game? - -No. - -## Regions support? - -Pengu Loader works for all regions, including Tencent server. - -## MacOS support? - -Coming soon. - -## Reloading the Client causes high memory usage? - -The League Client is designed for single loading only. If you reload it using -the Ctrl+Shift+R key or via Chrome DevTools, the Client will reload its -interface. But there will be mostly old resources, that may cause memory leaks. - -## RunDLL error? - -Your antivirus ate/blocked the Loader's core DLL. - -## Missing runtime? - -Try installing the -[VC++ 2015-2019](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) -runtime. - -## LeagueClientUx.exe - System Error? - -Make sure you have been deactivated the Loader before removing it. - -## The Client looks like Discord glass themes? - -Check out the [Acrylical theme](https://github.com/PrincessAkira/league-launcher-theme/tree/main/Acrylical), or some similar themes. - -For theme developers, you should use the [Effect API](../runtime-api/effect) in your theme. \ No newline at end of file diff --git a/docs/pt-br/guide/installation.md b/docs/pt-br/guide/installation.md deleted file mode 100644 index 1f5b96e..0000000 --- a/docs/pt-br/guide/installation.md +++ /dev/null @@ -1,33 +0,0 @@ -# Instalação - -Siga os passos abaixos para instalar: - -1. Baixe a - [ultima versão](https://github.com/PenguLoader/PenguLoader/releases) - - - Existem dois modelos, o modelo setup EXE e o modelo portatil ZIP - - Com o modelo ZIP, você deve extrair isso para um local fixo - -2. Execute o **Pengu Loader** -3. Clique em **ACTIVATE** -4. Abre seu **League Client** e aproveite - -

- -

- -## Resolução de Problemas - -- Windows 7 não foi testado, mas precisa do .Net Framework 4.5+ instalado para ser executado -- Para uma versão limpa do Windows 8.1/10, você deve instalar - [VC++ 2015-2019](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) - runtime -- Não coloque quaisquer arquivo da ferramente dentro das pastas 'League of Legends' & 'Riot Client' -- Antes de remover a o modelo portatil, você precisa primeiramente desativar - -## Usando os plugins - -Você pode baixar alguns plugins em nosso servidor do [Discord](https://chat.pengu.lol), entre agora. Cada plugin pode ter sua propria instrução de instalação. - -Se você preferir, você pode criar seu proprio plugin, cheque o tutorial em -[JavaScript Plugin](./javascript-plugin). diff --git a/docs/pt-br/guide/javascript-plugin.md b/docs/pt-br/guide/javascript-plugin.md deleted file mode 100644 index 427c557..0000000 --- a/docs/pt-br/guide/javascript-plugin.md +++ /dev/null @@ -1,66 +0,0 @@ -# JavaScript Plugin - -Plugin development requires basic knowledge of -[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), and -[CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) if you want to make a -theme. It's pretty easy if you're already familiar with web programming. - -## Creating a plugin - -Suppose your new plugin name is `your-plugin`. - -First, you need to create a new folder called `your-plugin` in the **plugins** -folder (inside the Pengu Loader root folder). - -``` -root/ - |__plugins/ - |__@default/ <- the default plugin - |... - |__your-plugin/ <- your new plugin - |__index.js <- plugin entry -``` - -Then create a new file called `index.js` in your plugin folder. This index is an -entry point for your plugin which will be executed when the League Client is -ready. Now you can open it in any editor and start coding. - -::: tip - -We recommend that you use modern JavaScript editors such as -[Visual Studio Code](https://code.visualstudio.com/) to develop your plugins, as -it supports intellisense, linter and code auto-completion. - -::: - -Next, just add this line to the index and save it. - -```js -console.log('Hello, League Client!') -``` - -::: info - -All your code/text files should be saved in UTF-8 encoding (no BOM). If not, -your plugin won't work as expected. - -::: - -Then launch your League Client, and when the Client is ready, try pressing -`Ctrl Shift I` key to open **Chrome DevTools**. Navigate to the **Console** tab -in the DevTools and scroll to the top, you will see the output message. - -``` -Hello, League Client! -``` - -## What's next? - -🎉 Congratulations! You have completed the beginner tutorial. Follow the next -pages to get more power out of your plugins. - -- [Module System](./module-system) - Learn more about module system -- [CSS Theme](./css-theme) - Build your theme with CSS -- [Assets Handling](./asset-handling) - Add custom content to your plugins -- [LCU Request](./lcu-request) - Some guides helps you to work with LCU -- [Runtime API](../runtime-api/) - Useful built-in APIs to use in your plugins \ No newline at end of file diff --git a/docs/pt-br/guide/lcu-request.md b/docs/pt-br/guide/lcu-request.md deleted file mode 100644 index fde88b8..0000000 --- a/docs/pt-br/guide/lcu-request.md +++ /dev/null @@ -1,146 +0,0 @@ -# LCU Request - -## Making API request - -Just use `fetch` to make LCU requests: - -```js -function acceptMatchFound() { - fetch('/lol-matchmaking/v1/ready-check/accept', { - method: 'POST', - }) -} -``` - -Note that `fetch` returns a Promise for async context, you should wrap it inside -an async function. - -```js -async function getSummonerName() { - const res = await fetch('/lol-summoner/v1/current-summoner') - const data = await res.json() - return data['displayName'] -} -``` - -With LCDS (RTMP) calls, you can use `URLSearchParams` and `JSON.strigify` to -construct call parameters. - -```js -async function quitLobby() { // dont know why people call it 'dodge' - const params = new URLSearchParams({ - destination: 'lcdsServiceProxy', - method: 'call', - args: JSON.stringify(['', 'teambuilder-draft', 'quitV2', '']), - }) - const url = '/lol-login/v1/session/invoke?' + params.toString() - await fetch(url, { method: 'POST' }) -} -``` - -::: details Up-to-date LCU API docs - -https://lcu.kebs.dev. - -::: - -## LCU WebSocket - -When the WebSocket is ready, this link tag will appear: - -```html - -``` - -Getting its URI with a simple query. - -```js -document.querySelector('link[rel="riot:plugins:websocket"]').href -``` - -Here is an example that subscribes to all API calls: - -```js -function subscribe() { - const uri = document.querySelector('link[rel="riot:plugins:websocket"]').href - const socket = new WebSocket(uri, 'wamp') - - socket.onopen = () => socket.send(JSON.stringify([5, 'OnJsonApiEvent'])) - socket.onmessage = async (message) => { - const data = JSON.parse(message.data) - console.log(data) - // @todo process data - } -} - -window.addEventListener('load', () => { - subscribe() -}) -``` - -Listening a single API call, e.g `/lol-gameflow/v1/gameflow-phase`. - -```js -const TARGET_API = '/lol-gameflow/v1/gameflow-phase' -const TARGET_EVENT = TARGET_API.replace(/\//g, '_') -// OnJsonApiEvent_lol-gameflow_v1_gameflow-phase - -socket.send(JSON.stringify([5, 'OnJsonApiEvent' + TARGET_EVENT])) -``` - -Send `6` to unsubscribe from a specific API call, or `OnJsonApiEvent` for all. - -```js -socket.send(JSON.stringify([6, ''])) -``` - -## Unauthenticated issue - -In some cases that the Ux loads faster than the LCU server, many API that -require authentication will result in wrong value. You need to wait for this to -be done before you start plugin initialization. - -```js -const delay = (t) => new Promise((r) => setTimeout(r, t)) - -async function init() { - while (!await getSummonerName()) { - await delay(500) - } - - // continue -} - -window.addEventListener('load', init) -``` - -::: tip - -You can do it with the WebSocket way. - -::: - -## RiotClient API - -We provided a `riotclient` domain which helps you to make request to RiotClient -API. - -``` -//riotclient/ -https://riotclient/ -``` - -For example: - -```js -function getAuthStatus() { - return fetch('//riotclient/app-command/v1/auth/status') - .then((res) => res.json()) -} -``` - -::: details Up-to-date RiotClient API docs - -https://riotclient.nomi.dev - -::: diff --git a/docs/pt-br/guide/migration-from-v0-6.md b/docs/pt-br/guide/migration-from-v0-6.md deleted file mode 100644 index ed5bcfd..0000000 --- a/docs/pt-br/guide/migration-from-v0-6.md +++ /dev/null @@ -1,149 +0,0 @@ -# Migration from v0.6 - -## New plugin project structure - - - -Since v0.5, we have introduced the `//assets/` domain which supports access to -resources from the **assets** folder. And now, this folder is only used for -large-common-unique resources. So every plugin will have its assets and you can -access them via `//plugins/`. - -Since v1.0, the top-level `js` is not executed as a plugin entry point. Stop -putting your plugin JS files directly into the **plugins** folder. You need to -create a new folder for your plugin. - -``` -plugins/ - |__your-plugin/ - |__assets/ - |... <- resources - |__index.js <- plugin entry - |... <- other utils -``` - -## Removed CommonJS - - - -In v1.0, we have been removed CommonJS support and switched to ES module. This -means all scripts from v0.6 that use `require` and `module.exports` will not -work in the new version. - -Please refer to the migration guide below. - -### Update your `require()`: - -```js -// before -const utils = require('./utils') - -// after -import utils from './utils' -``` - -```js -// before -const { hello } = require('./greeting') - -// after -import { hello } from './greeting' -``` - -> Read more at -> [MDN import statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). -> Please note that you no need to add the `.js` extension to import path. - -### Also update your `module.exports`: - -```js -// before -module.exports = { - greet: () => 'Hello', -} - -// after -export default { - greet: () => 'Hello', -} -``` - -```js -// before -module.exports = to_export - -// after -export default to_export -``` - -Just `exports.`: - -```js -// before -exports.data = some_value - -// after -export let data = some_value -// or with const if data is immutable -export const data = some_value -``` - -This also works with named functions: - -```js -// before -exports.todo = function () { ... } -exports.todoAsync = async function () { ... } - -// after -export function todo() { ... } -export async function todoAsync() { ... } -``` - -> Read more at -> [MDN export statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export). - -### Dynamic import - -`import` statement does not allow you to use it in non-top-level, in functions -or some scopes, likes `require()` does. - -```js -// before -function load() { - const utils = require('./utils') -} -``` - -Do it with async context: - -```js -// after -async function load() { - const utils = await import('./utils') -} -``` - -Or with Promise's `.then` callback: - -```js -// after -function load() { - import('./utils').then((module) => { - const utils = module.default - // ... - }) -} -``` - -In this case above, `import` becomes an async function like. You can also add a -`.catch` chain to catch module errors. - -> Read more at -> [MDN import() operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import). -> Please note that you no need to add the `.js` extension to import path. - -### JSON and CSS modules - -You should refer to the [Module System](./module-system) to handle -importing them. diff --git a/docs/pt-br/guide/module-system.md b/docs/pt-br/guide/module-system.md deleted file mode 100644 index 6f2e88a..0000000 --- a/docs/pt-br/guide/module-system.md +++ /dev/null @@ -1,219 +0,0 @@ -# Module System - -Plugin module system is actually the -[JavaScript module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) -(also known as ES module). - -## JS module - -As you know, the plugin entry is a single `index.js` file, using multiple files -makes your code easier to manage. - -The following will have two files, `index.js` and `utils.js.` The **index** will -acquire the **utils** and print out the retrieved value. - -``` -your-plugin/ - |__index.js - |__utils.js -``` - -::: code-group - -```js [index.js] -// import utils.js using the import statement -import utils from './utils' - -console.log(utils.greeting) // -> hello -``` - -```ts [utils.js] -// export a simple object -export default { - gretting: 'Hello' -} -``` - -::: - -### `import` - -> Read more at -> [MDN import statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). -> Please note that you no need to add the `.js` extension to import path. - -### `export` - -> Read more at -> [MDN export statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export). - -### Dynamic import - -The `import` statement is designed to be used in top-level of code. So you -cannot use it inside functions or some scopes. Dynamic import allows you to load -your modules dynamically, even inside a function or scope. - -```js -async function load() { - const mod = await import('./mod') - // do something -} -``` - -> Read more at -> [MDN import() operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import). -> Please note that you no need to add the `.js` extension to import path. - -### CDN import - -For example, importing **axios** from [**Skypack**](https://skypack.dev). - -```js -import axios from 'https://cdn.skypack.dev/axios' - -async function testRequest() { - const res = await axios.get('https://...') - console.log(res.data) -} -``` - -::: info - -Some libraries are designed only for NodeJS, they cannot be imported into the -plugins. - -::: - -::: tip Recommended CDNs - -- [Skypack](https://www.skypack.dev/) -- [ESM>CDN](https://esm.sh/) -- [jsDelivr ESM](https://esm.run) -- [UNPKG](https://unpkg.com/) - -::: - -Using dynamic import will be useful when the CDN connection is slow. - -```js -import('https://cdn.skypack.dev/axios') - .then(async (mod) => { - const axios = mod.default - // make a request - }) - .catch((err) => { - // handle error - }) -``` - -## CSS module - -```js -import './theme.css' -``` - -This line will inject a `link` tag into `body` to load your `theme.css`. It's -equivalent to the legacy way: - -```js -const link = document.createElement('link') -link.rel = 'stylesheet' -link.href = '//plugins/your-plugin/theme.css' -document.body.appendChild(link) -``` - -In your CSS module, you can import plugin assets using relative path: - -```css -.some-div { - background-image: url(./assets/image.png); - /* resolve to //plugins/your-plugin/assets/image.png */ -} -``` - -## JSON module - -Assuming your `config.json` like this: - -```json -{ - "enabled": true -} -``` - -Let's import it: - -```js -import config from './config.json' -console.log(config.enabled) // true -``` - -You can also change its value, but no change to the JSON file. - -```js -config.enabled = false -// in other modules that require it -console.log(config.enabled) // false -``` - -## Importing assets - -For updating HTML elements from JS, you can use `import` to get the asset path -without knowing its full path. - -``` -your-plugin/ - |__assets/ - |__background.jpg - |__index.js - -background URL: //plugins/your-plugin/assets/background.jpg -``` - -Here is the example code: - -```js -import background from './assets/background.jpg' - -function changeBackground() { - const div = document.querySelector('some-div') - div.style.backgroundImage = `url(${background})` - // or with 's src attribute - myImg.src = background -} -``` - -You can log the `background` to see its value: - -```js -console.log(background) -``` - -With the structure above, you got -`//plugins/your-plugin/assets/my-background.jpg`. - -::: info - -Note that asset import supports common image, font and media file types. Other -unsupported types won't work; you'll need to add the `?url` suffix in the next -section to get their path. - -::: - -## Explicit import - -You can specific a suffix value as query param to the import URL. - -```js -import content from './my-data.txt?raw' -// read the file as string - -import path from './some-resource?url' -// get path to the asset -``` - -:::info - -With `?raw`, your file should be saved in UTF-8 encoding. - -::: diff --git a/docs/pt-br/guide/npm-compatibility.md b/docs/pt-br/guide/npm-compatibility.md deleted file mode 100644 index 174c9b3..0000000 --- a/docs/pt-br/guide/npm-compatibility.md +++ /dev/null @@ -1,41 +0,0 @@ -# Npm Compatibility - -## Using NodeJS project - -We strongly recommend that you to use NodeJS project to build your plugins. - -With TypeScript or other languages that require transpilation, you need a build -tool to build them, Webpack, Rollup or Vite is the best choice. - -You can also use any front-end library to build custom UI, e.g. React, Preact, -Vue, Svelte, SolidJS, etc. With front-end tooling, its hot-reload/HMR will help -you to do faster. - -::: info - -Note that npm packages those are designed to run only in NodeJS cannot be used -to build plugins. - -::: - -::: tip - -With the build tool, the output of your bundled assets may have incorrect paths. -Please refer to the [Asset Handling](./asset-handling) to make correct -them. - -::: - -## Example plugins - -### Webpack 📦 - -- [douugdev/league-a-better-client](https://github.com/douugdev/league-a-better-client) - - A LCU utilities with HMR + ⚛ Preact + SASS + TypeScript - -### Vite ⚡ - -- [Pengu vite-theme](https://github.com/PenguLoader/PenguLoader/blob/main/plugins/vite-theme) - - A simple theme with HMR + SASS + TypeScript -- [Pengu @default](https://github.com/PenguLoader/PenguLoader/blob/main/plugins/@default) - - The default plugin with HMR + SolidJS + SASS + TypeScript diff --git a/docs/pt-br/guide/welcome.md b/docs/pt-br/guide/welcome.md deleted file mode 100644 index 799686c..0000000 --- a/docs/pt-br/guide/welcome.md +++ /dev/null @@ -1,45 +0,0 @@ -# Bem Vindo - -## O que é o Pengu Loader? - -

- -

- -**Pengu Loader** (anteriormente **League Loader**) é um **Executor de Plugins** (Plugin Loader) criado especificamente pro **Client do League Of Legends**. - -Com o Pengu Loader, você consegue executar plugins **JavaScript** dentro do Client como se fosse uma dependendencia, podendo ajudar você a customizar tudo, -executa seu conteúdo personalizado, adiciona novas funcionalidades, e melhora a sua experiência global. -Também lhe permite construir um Client mais inteligente que se adapte as suas preferências. - -Principais características: - -- Customize seu League Client com [Plugins Javascript](./javascript-plugin) -- Personalize ou Adicione Temas ao seu League Client -- Suporte para funcionalidades modernas de JavaScript -- Suporte para o Chrome DevTools e DevTool Remoto -- Mais fácil de trabalhar com LCU API - -::: tip Fact - -Pengu Loader faz parte da nossa missão de "Programação para Jogadores". - -::: - -## Why JavaScript? - -

- -

- -**JavaScript** é uma linguagem de programação versátil e poderosa que é amplamente utilizada no desenvolvimento web. Ela se tornou o padrão de facto para scripts do lado do cliente na web, permitindo que desenvolvedores criem páginas da web interativas e dinâmicas. - -A principal vantagem do JavaScript é sua compatibilidade com o League Client UX, que é na verdade um navegador da web Chromium embutido. Isso significa que plugins JavaScript podem ser facilmente integrados ao cliente e executados perfeitamente ao lado do código do cliente existente. Além disso, os usuários podem aproveitar todo o poder do Chrome DevTools para depurar e modificar seus plugins. - -No caso do Pengu Loader, JavaScript fornece uma plataforma ideal para personalizar o Cliente do League of Legends. Ao usar plugins JavaScript, os usuários podem adicionar novas funcionalidades, mudar a aparência e sentir do cliente e até mesmo integrar tecnologias baseadas na web na interface do cliente. Como o JavaScript é uma linguagem amplamente utilizada com uma grande comunidade de desenvolvedores, existem muitas ferramentas e bibliotecas existentes que podem ser aproveitadas para melhorar a funcionalidade do Pengu Loader. - -## Nossa comunidade - -- [Servidor do Discord](https://chat.pengu.lol/) -- [Repositorio do Github](https://github.com/PenguLoader/PenguLoader) -- [Github Org](https://github.com/PenguLoader) diff --git a/docs/pt-br/index.md b/docs/pt-br/index.md deleted file mode 100644 index e6d8a05..0000000 --- a/docs/pt-br/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -layout: home - -title: Pengu Loader -titleTemplate: Pengu Loader - -hero: - name: Pengu Loader - # text: Pengu Loader - tagline: Destrave o poder da customização em seu Client do League Of Legends - image: - src: /Pengu_Featherknight_144.jpg - alt: VitePress - actions: - - theme: brand - text: Comece por aqui - link: ./guide/welcome - - theme: alt - text: Entre em nosso Discord - link: https://chat.pengu.lol - - theme: alt - text: Veja no GitHub - link: https://github.com/PenguLoader/PenguLoader - -features: - - icon: - src: /features/javascript.png - title: Movido a JavaScript - details: Construa um Client mais inteligente com JavaScript. É otimo poder usar a sua tecnologia de front-end favorita. - - icon: - src: /features/theme.png - title: Totalmente Customizavel - details: Customize toda interface do seu Client para seu gosto e torne ele unico. - - icon: - src: /features/league-of-legends.png - title: Dentro do League - details: Criado para funcionar perfeitamente dentro do Client, ajudando você a ter acesso aos endpoints LCU com facilidade e sem restrições. - - icon: - src: /features/chrome-dev.png - title: Chrome DevTools - details: Inspecione e edite tudo no seu Client como se estivesse em um navegador. ---- diff --git a/docs/pt-br/runtime-api/auth-callback.md b/docs/pt-br/runtime-api/auth-callback.md deleted file mode 100644 index 797501c..0000000 --- a/docs/pt-br/runtime-api/auth-callback.md +++ /dev/null @@ -1,47 +0,0 @@ -# `AuthCallback` - -This namespace helps you to create a callback URL and read its response from an -auth flow. - -## `AuthCallback.createURL()` - -Create a unique callback URL that can be used for auth callback/redirect from -external web browsers. - -## `AuthCallback.readResponse(url, timeout?)` - -This function wait for response from a given callback URL. It returns a -`Promise` for async context, contains string if success or null when timeout. - -Parameters: - -- `url` - Callback URL created by `AuthCallback.createURL()`. -- `timeout` - Optional timeout in milliseconds, default is 180s. - -Callback URL supports **GET** request only, the response of this function could -be search params fullfilled by auth flow. - -Example: - -```js -async function requestUserAuth() { - const callbackURL = AuthCallback.createURL() - const requestAuth = 'https://.../?redirect_uri=' + - encodeURIComponent(callbackURL) - // Open in web browser - window.open(callbackURL) - - const response = await AuthCallback.readResponse(callbackURL) - if (response === null) { - console.log('timeout/fail') - } else { - console.log(response) - } - - // Should show UX to get back focus - fetch('/riotclient/ux-show', { method: 'POST' }) -} -``` - -See [spotify-gateway](https://github.com/LeagueLoader/spotify-gateway) example -to learn more. diff --git a/docs/pt-br/runtime-api/data-store.md b/docs/pt-br/runtime-api/data-store.md deleted file mode 100644 index 6bec586..0000000 --- a/docs/pt-br/runtime-api/data-store.md +++ /dev/null @@ -1,64 +0,0 @@ -# `DataStore` - -League Client does not store user data on disk, similar to incognito mode in web -browsers. This namespace helps you to store user data on disk. - -## `DataStore.set(key, value)` - -Call this function to store your data with a given key. - -- `key` (required) Keys should be string or number. -- `value` (required) Value may be string, number, boolean, null or collection - like array and object. Actually, it will be stored as JSON format, so any - value like function and runtime object are ignored. - -Example: - -```js -let my_num = 10 -let my_str = 'hello' -DataStore.set('my_num', my_num) -DataStore.set('my_str', my_str) -``` - -::: tip - -Unique keys You should use unique names for keys, do not use common names, e.g -`access_token`, `is_logged`, etc. Other plugins can override your data, you can -add prefix to your keys. - -::: - -## `DataStore.get(key)` - -Retrieve your stored data with a given key. If the key does not exist, it will -return `undefined`. - -Example: - -```js -console.log(DataStore.get('my_str')) -console.log(DataStore.get('key-does-not-exist')) // undefined -``` - -## `DataStore.has(key)` - -This function returns a boolean indicating whether data with the specified key -exists or not. - -```js -console.log(DataStore.has('my_num')) -console.log(DataStore.has('key-does-not-exist')) -``` - -## `DataStore.remove(key)` - -This function removes the specified data from storage by key, returns true if -the existing key-value pair has been removed. - -Example: - -```js -DataStore.remove('some-key') -DataStore.has('some-key') // -> false -``` diff --git a/docs/pt-br/runtime-api/effect.md b/docs/pt-br/runtime-api/effect.md deleted file mode 100644 index 2532559..0000000 --- a/docs/pt-br/runtime-api/effect.md +++ /dev/null @@ -1,103 +0,0 @@ -# `Effect` - -This namespace supports changing window effects.
- -Available effects: `mica`, `acrylic`, `unified` and `blurbehind`. - -![](https://user-images.githubusercontent.com/38210249/216951830-b3bb3ce3-7a5f-4e60-8a67-33d0bce799cf.png) - -## `Effect.current` - -A read-only property that returns the currently applied effect or `undefined` if -no effect has been applied. - -Example: - -```js -// prints applied effect -console.log(Effect.current) -``` - -## `Effect.apply(name, options?)` - -A function that takes the name of the desired effect name and an optional -object.
It returns a boolean indicating whether the effect was successfully -applied or not. - -- `name` [required] These effect names above to be applied, in string. - -- `options` [optional] Additional options for the effect, `acrylic`, `unified` - and `blurbehind` could have tint color, but `mica` will ignore this options. - -This function returns `false` if the effect could not be applied, see the -[System compatibility](#system-compatibility) below. - -Example: - -```js -// enable acrylic on Windows 10 -Effect.apply('acrylic') - -// with a tint color -Effect.apply('unified', { color: '#4446' }) - -// mica on windows 11, no options needed -Effect.apply('mica') -``` - -::: info - -Tint colors must be in CSS hex color format, e.g. #RGB, #RGBA, #RRGGBB, -#RRGGBBAA. - -::: - -![](https://user-images.githubusercontent.com/38210249/216951865-bb9c6676-58ec-4c81-ad96-67e94e91ac22.png) - -### System compatibility - - - -- On Windows 7, only the `blurbehind` is supported. -- On Windows 10, requires build 1703 or higher to use `acrylic`. -- `mica` and `unified` are only supported on Windows 11, but `unified` can be - enabled on Windows 10 without different from `acrylic`. - -::: warning - -On Windows 10 build **1903** (19H1) and higher, enabling `acrylic/mica/unified` with -**Transparency effects** (in Personalize -> Color settings) will cause lag when -moving the Client window. - -::: - -## `Effect.clear()` - -A function that clears any currently applied effect, then the Client background -will be black.
Using `Effect.current` after clearing will give you -`undefined`. - -Example: - -```js -// just clear applied effect, even if nothing applied -Effect.clear() -``` - -## `Effect.on(event, callback)` - -Add a listener which will be triggered when effect changed. - -```js -Effect.on('apply', ({ old, name, options }) => { - // do something -}) - -Effect.on('clear', () => { - // do something -}) -``` - -## `Effect.off(event, callback)` - -Remove your added listener. diff --git a/docs/pt-br/runtime-api/index.md b/docs/pt-br/runtime-api/index.md deleted file mode 100644 index 9ebfa54..0000000 --- a/docs/pt-br/runtime-api/index.md +++ /dev/null @@ -1,93 +0,0 @@ -# Rntime API - -These APIs are designed to use inside League Client with Pengu Loader plugin -runtime. - -## `window.openDevTools()` - - - -Call this function to open the built-in Chrome DevTools window. - -Example: - -```js -window.openDevTools() -``` - -## `window.openAssetsFolder()` - - - -Call this function to open the assets folder in new File Explorer window. - -Example: - -```js -window.openAssetsFolder() -``` - -## `window.openPluginsFolder()` - - - -Call this function to open the plugins folder in new File Explorer window. - -Example: - -```js -window.openPluginsFolder() -``` - -## `window.__llver` - - - -This property returns the current version of Pengu Loader. - -Example: - -```js -console.log(window.__llver) // e.g 0.6.0 -console.log('You are using Pengu Loader v' + window.__llver) -``` - -## TypeScript declaration - -```ts -namespace globalThis { - function openAssetsFolder(): void - function openPluginsFolder(): void - function openDevTools(remote?: boolean): void - var __llver: string - - namespace AuthCallback { - function createURL(): string - function readResponse(url: string, timeout: number): Promise - } - - namespace DataStore { - function has(key: string): boolean - function get(key: string): any - function set(key: string, value: any): void - function remove(key: string): boolean - } - - namespace Effect { - type EffectName = 'mica' | 'acrylic' | 'unified' | 'blurbehind' - const current: EffectName | null - function apply(name: EffectName): boolean - function apply( - name: Exclude, - options: { color: string }, - ): boolean - function clear(): void - function on( - event: 'apply', - listener: (name: string, options?: object) => any, - ): void - function on(event: 'clear', listener: () => any): void - function off(event: 'apply' | 'clear', listener: () => any): void - } -} -``` diff --git a/docs/vi/guide/asset-handling.md b/docs/vi/guide/asset-handling.md deleted file mode 100644 index 01f0fbb..0000000 --- a/docs/vi/guide/asset-handling.md +++ /dev/null @@ -1,99 +0,0 @@ -# Xử lí asset - -Asset có thể là các tài nguyên khác nhau như phông chữ, hình ảnh, file phương tiện, v.v. mà bạn sử dụng -từ plugin của bạn để tải nội dung tùy chỉnh. - -## Local assets - -### Plugin assets - -Mỗi plugin nên có thư mục nội dung riêng để lưu assets. - -Ví dụ với cấu trúc plugin bên dưới: - -``` -plugins/ - |__your-plugin/ - |__assets/ <- assets - |__background.png - |... - |__index.js <- entry - |__theme.css <- theme -``` - -Nếu tên thư mục plugin của bạn cố định và sẽ không thay đổi trong tương lai, bạn có thể -sử dụng liên kết này để truy xuất trực tiếp `background.png`: - -``` -//plugins/your-plugin/assets/background.png -``` - -Chúng tôi khuyên bạn nên sử dụng hệ thống mô-đun để thay thế. - -::: code-group - -```js [index.js] -import background from './assets/background.png' - -// cách sử dụng -const img = document.getElementById('some-img') -img.src = background -``` - -```css [theme.css] -/* lưu ý rằng bạn nên -import theme.css này từ index.js của bạn */ - -.some-div { - background-image: url('./assets/background.png'); -} -``` - -::: - -### Common assets - -Kể từ phiên bản 0.5, chúng tôi đã cung cấp quyền truy cập vào local assets thông qua miền `//assets/`. - -Ví dụ: - -``` -loader/ - |__assets/ - |__your-image.png - |__your-background.mp4 - |... - |__plugins/ - |... -``` - -```html - - -``` - -## Remote assets - -### GitHub file hosting - -Nếu bạn muốn lưu trữ assets của mình trên GitHub, bạn nên sử dụng CDN RawGitHack để tránh bị hạn chế quyền truy cập. Nó cũng hỗ trợ GitLab và Bitbucket. - -Thử ngay: https://raw.githack.com/ - -![](/guide/rawgithack.png) - -### Imgur image hosting - -Imgur là một dịch vụ lưu trữ hình ảnh miễn phí tuyệt vời. Bạn có thể tải hình ảnh của mình lên -Trang web Imgur và lấy liên kết. - -Thử ngay: https://imgur.com/ - -## Tối ưu hóa tài nguyên của bạn - -Bạn nên giảm kích thước asset để tối ưu hóa thời gian tải plugin của mình. - -- Code JavaScript và CSS nên được minified cho production -- Đối với SVG, bạn có thể sử dụng https://github.com/svg/svgo -- Với hình ảnh, bạn nên convert sang định dạng **webp** -- Với video, bạn có thể thử convert sang định dạng **webm** diff --git a/docs/vi/guide/css-theme.md b/docs/vi/guide/css-theme.md deleted file mode 100644 index a180a82..0000000 --- a/docs/vi/guide/css-theme.md +++ /dev/null @@ -1,97 +0,0 @@ -# CSS Theme - -Một Plugin được coi là **theme** nếu nó nhằm mục đích thay đổi giao diện mặc định của -Client Liên Minh, thay vì tạo thêm tính năng giúp cho Client. - -## Tạo một theme - -Từ mục plugin của bạn, sử dụng `import` để thêm nó: - -```javascript -import './theme.css' -``` - -Dòng này sẽ thêm một thẻ link vào body trỏ đến `theme.css` bên cạnh -`index.js` . - -``` -your-plugin/ - |__index.js <- plugin entry - |__theme.css <- theme của bạn -``` - -### Thay đổi phông chữ mặc định - -Đoạn css dưới đây sẽ nhập một phông chữ tùy chỉnh từ -[Google Fonts](https://fonts.google.com/) và ghi đè phông chữ mặc định bằng cách sử dụng -selector `:root` và các biến CSS. - -```css -/* theme.css */ -@import url('https://fonts.googleapis.com/css2?family=Shantell+Sans&display=swap'); - -:root { - /* override default League font */ - --font-display: 'Shantell Sans', sans-serif !important; - --font-body: 'Shantell Sans', sans-serif !important; -} -``` - -Lưu ý rằng một số selector có thể không được áp dụng do mức độ ưu tiên, bạn có thể buộc -chúng bằng cách thêm hậu tố `!important` ở đầu các quy tắc. - -Để có thêm các biến CSS được sử dụng bởi Client, bạn nên kiểm tra chúng bằng Chrome DevTools. Hãy thử nhấn phím Ctrl Shift I để mở nó. - -## Mô-đun CSS - -Khi bạn **import** theme, theme của bạn sẽ trở thành một mô-đun. Bây giờ bạn có thể sử dụng -đường dẫn `url()` để import assets. - -```css -/* theme.css */ -.some-div { - background-image: url(./assets/background.png); -} - -.another-div { - background-image: url(./assets/some-image.jpg); -} -``` - -Cấu trúc plugin tương ứng: - -``` -your-plugin/ - |__assets/ - |__background.png - |__some-image.jpg - |__theme.css -``` - -## Theme từ xa - -Việc sử dụng theme từ xa sẽ giúp theme của bạn luôn được cập nhật. - -Đoạn code dưới đây sẽ chèn thẻ link stylesheet trỏ đến theme của bạn từ -https://example.com/theme.css - -```javascript -// index.js -function addCssLink(url) { - const link = document.createElement('link') - link.href = url - link.type = 'text/css' - link.rel = 'stylesheet' - document.head.appendChild(link) -} - -window.addEventListener('load', () => { - addCssLink('https://example.com/theme.css') -}) -``` - -::: info - -Máy chủ của bạn nên trả về response với kiểu MIME `text/css` . - -::: diff --git a/docs/vi/guide/faqs.md b/docs/vi/guide/faqs.md deleted file mode 100644 index 01cb485..0000000 --- a/docs/vi/guide/faqs.md +++ /dev/null @@ -1,47 +0,0 @@ -# Các câu hỏi thường gặp - -

- -

- -## Tôi có bị ban acc nếu sử dụng không? - -Pengu Loader hoàn toàn an toàn để sử dụng. - -## Nó có ảnh hưởng đến game không? - -Không. - -## Khu vực hỗ trợ? - -Pengu Loader hoạt động cho tất cả các khu vực, bao gồm cả máy chủ Tencent. - -## Hỗ trợ MacOS? - -Sẽ có. - -## Khởi động lại Client gây ngốn RAM? - -League Client được thiết kế để chỉ khởi động một lần. Nếu bạn khởi động lại nó bằng cách sử dụng -phím Ctrl+Shift+R hoặc thông qua Chrome DevTools, Client sẽ tải lại -giao diện. Nhưng nó cũng sẽ tải lại hầu hết các tài nguyên cũ nên sẽ gây ngốn RAM. - -## Lỗi RunDLL? - -Phần mềm chống vi-rút của bạn đã chặn file DLL lõi của Pengu Loader ಥ_ಥ. - -## Thiếu runtime? - -Hãy thử cài đặt -[VC++ 2015-2019](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) -runtime. - -## LeagueClientUx.exe - System Error? - -Đảm bảo rằng bạn đã deactivate Pengu Loader trước khi gỡ cài đặt nó. - -## Client trong suốt giống như theme Discord? - -Hãy xem [Acrylical theme](https://github.com/PrincessAkira/league-launcher-theme/tree/main/Acrylical) hoặc một số theme tương tự. - -Đối với các nhà phát triển theme, bạn nên sử dụng [Effect API](/vi/runtime-api/effect) trong theme của mình. \ No newline at end of file diff --git a/docs/vi/guide/installation.md b/docs/vi/guide/installation.md deleted file mode 100644 index 59475e2..0000000 --- a/docs/vi/guide/installation.md +++ /dev/null @@ -1,33 +0,0 @@ -# Cài đặt - -Làm theo các bước dưới đây để cài đặt: - -1. Tải về - [bản phát hành mới nhất](https://github.com/PenguLoader/PenguLoader/releases) - - - Có 2 phiên bản là bản setup EXE và bản ăn sẵn (portable) ZIP - - Với bản ZIP, bạn nên giải nén vào một nơi cố định - -2. Mở **Pengu Loader** -3. Nhấp **ACTIVATE** -4. Mở **Liên Minh Huyền Thoại** và tận hưởng - -

- -

- -## Cách khắc phục 1 vài lỗi thường gặp - -- Windows 7 chưa được thử nghiệm, nhưng yêu cầu cài đặt .Net Framework 4.5 trở lên để chạy -- Đối với Windows 8.1/10, bạn nên cài đặt - [VC++ 2015-2019](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) - runtime -- Không để bất kì file nào của tool vào thư mục 'League of Legends' hoặc 'Riot Client' -- Trước khi gỡ cài đặt phiên bản portable, bạn phải deactivate nó - -## Sử dụng plugin - -Bạn có thể xem thêm nhiều plugin trên [Discord](https://chat.pengu.lol) server, hãy tham gia ngay. Mỗi plugin sẽ có hướng dẫn cài đặt riêng. - -Nếu bạn muốn tạo plugin của riêng mình, hãy đọc -[JavaScript Plugin](./javascript-plugin). diff --git a/docs/vi/guide/javascript-plugin.md b/docs/vi/guide/javascript-plugin.md deleted file mode 100644 index e2bc0bb..0000000 --- a/docs/vi/guide/javascript-plugin.md +++ /dev/null @@ -1,64 +0,0 @@ -# JavaScript Plugin - -Phát triển plugin yêu cầu kiến thức cơ bản về -[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) và -[CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) nếu bạn muốn tự tạo một -theme. Nó khá dễ dàng nếu bạn đã quen với lập trình web. - -## Tạo một plugin - -Giả sử tên plugin mới của bạn là `your-plugin`. - -Trước tiên, bạn cần tạo một thư mục mới có tên `your-plugin` trong thư mục **plugins** -(bên trong thư mục gốc của Pengu Loader). - -``` -root/ - |__plugins/ - |__@default/ <- plugin mặc định - |... - |__your-plugin/ <- plugin mới của bạn - |__index.js <- các mục của plugin -``` - -Sau đó, tạo một tệp mới có tên `index.js` trong thư mục plugin của bạn. File index này là nơi bắt đầu cho plugin của bạn, sẽ được thực thi khi Client Liên Minh được -mở lên. Bây giờ bạn có thể mở nó trong bất kỳ trình chỉnh sửa văn bản nào và bắt đầu code. - -::: tip - -Chúng tôi khuyên bạn nên sử dụng các trình soạn thảo JavaScript hiện đại như -[Visual Studio Code](https://code.visualstudio.com/) để phát triển plugin của bạn, bởi vì -nó hỗ trợ intellisense, linter và tự động complete code. - -::: - -Tiếp theo, chỉ cần thêm dòng này vào file index và lưu nó. - -```js -console.log('Hello, League Client!') -``` - -::: info - -Tất cả các file code/văn bản của bạn phải được lưu ở dạng mã hóa UTF-8 (không BOM). Nếu không, -plugin của bạn sẽ không hoạt động như mong đợi. - -::: - -Sau đó bật Client Liên minh của bạn lên và khi Client đã sẵn sàng, hãy thử nhấn -Phím `Ctrl Shift I` để mở **Chrome DevTools**. Điều hướng đến tab **Console** -trong DevTools và kéo lên trên cùng, bạn sẽ thấy thông báo đầu ra. - -``` -Hello, League Client! -``` - -## Tiếp theo là? - -🎉 Chúc mừng! Bạn đã hoàn thành phần hướng dẫn dành cho người mới bắt đầu. Hãy đọc tiếp các trang tiếp theo để buff thêm sức mạnh cho các plugin của bạn. - -- [Module System](./module-system) - Tìm hiểu thêm về hệ thống mô-đun -- [CSS Theme](./css-theme) - Tạo 1 theme của bạn bằng CSS -- [Assets Handling](./asset-handling) - Thêm nội dung tùy chỉnh vào plugin của bạn -- [LCU Request](./lcu-request) - Một số hướng dẫn giúp bạn làm việc với LCU -- [Runtime API](/runtime-api/) - Các API tích hợp hữu ích để sử dụng trong plugin của bạn \ No newline at end of file diff --git a/docs/vi/guide/lcu-request.md b/docs/vi/guide/lcu-request.md deleted file mode 100644 index 2a9fdb8..0000000 --- a/docs/vi/guide/lcu-request.md +++ /dev/null @@ -1,146 +0,0 @@ -# LCU Request - -## Tạo API request - -Sử dụng `fetch` để thực hiện các request tới LCU: - -```js -function acceptMatchFound() { - fetch('/lol-matchmaking/v1/ready-check/accept', { - method: 'POST', - }) -} -``` - -Lưu ý rằng `fetch` trả về một Promise cho async context, bạn nên bọc nó bên trong -một async function. - -```js -async function getSummonerName() { - const res = await fetch('/lol-summoner/v1/current-summoner') - const data = await res.json() - return data['displayName'] -} -``` - -Với lệnh gọi LCDS (RTMP), bạn có thể sử dụng `URLSearchParams` và `JSON.stringify` để -xây dựng tham số gọi. - -```js -async function quitLobby() { // k hiểu tại sao người ta hay gọi là 'né' - const params = new URLSearchParams({ - destination: 'lcdsServiceProxy', - method: 'call', - args: JSON.stringify(['', 'teambuilder-draft', 'quitV2', '']), - }) - const url = '/lol-login/v1/session/invoke?' + params.toString() - await fetch(url, { method: 'POST' }) -} -``` - -::: details Tài liệu API LCU mới nhất - -https://lcu.kebs.dev. - -::: - -## LCU WebSocket - -Khi WebSocket đã sẵn sàng, thẻ link này sẽ xuất hiện: - -```html - -``` - -Lấy URI của nó bằng một truy vấn đơn giản. - -```js -document.querySelector('link[rel="riot:plugins:websocket"]').href -``` - -Dưới đây là một ví dụ subscribe tất cả các lệnh gọi API: - -```js -function subscribe() { - const uri = document.querySelector('link[rel="riot:plugins:websocket"]').href - const socket = new WebSocket(uri, 'wamp') - - socket.onopen = () => socket.send(JSON.stringify([5, 'OnJsonApiEvent'])) - socket.onmessage = async (message) => { - const data = JSON.parse(message.data) - console.log(data) - // @todo process data - } -} - -window.addEventListener('load', () => { - subscribe() -}) -``` - -Nghe một lệnh gọi API, ví dụ: `/lol-gameflow/v1/gameflow-phase`. - -```js -const TARGET_API = '/lol-gameflow/v1/gameflow-phase' -const TARGET_EVENT = TARGET_API.replace(/\//g, '_') -// OnJsonApiEvent_lol-gameflow_v1_gameflow-phase - -socket.send(JSON.stringify([5, 'OnJsonApiEvent' + TARGET_EVENT])) -``` - -Gửi `6` để hủy subscribe một lệnh gọi API cụ thể hoặc `OnJsonApiEvent` cho tất cả. - -```js -socket.send(JSON.stringify([6, ''])) -``` - -## Lỗi Unauthenticated - -Trong một số trường hợp Ux tải nhanh hơn máy chủ LCU, nhiều API -yêu cầu authenticate sẽ dẫn đến giá trị sai. Bạn cần đợi cho đến khi -nó được thực hiện trước khi bạn initialize plugin. - -```js -const delay = (t) => new Promise((r) => setTimeout(r, t)) - -async function init() { - while (!await getSummonerName()) { - await delay(500) - } - - // continue -} - -window.addEventListener('load', init) -``` - -::: tip - -Bạn có thể làm điều đó bằng WebSocket. - -::: - -## RiotClient API - -Chúng tôi đã cung cấp miền `riotclient` để giúp bạn gửi request tới RiotClient -API. - -``` -//riotclient/ -https://riotclient/ -``` - -Ví dụ: - -```js -function getAuthStatus() { - return fetch('//riotclient/app-command/v1/auth/status') - .then((res) => res.json()) -} -``` - -::: details Tài liệu RiotClient API mới nhất - -https://riotclient.nomi.dev - -::: diff --git a/docs/vi/guide/migration-from-v0-6.md b/docs/vi/guide/migration-from-v0-6.md deleted file mode 100644 index 07f325b..0000000 --- a/docs/vi/guide/migration-from-v0-6.md +++ /dev/null @@ -1,149 +0,0 @@ -# Migrate từ phiên bản v0.6 - -## Cấu trúc project plugin mới - - - -Kể từ phiên bản 0.5, chúng tôi đã giới thiệu miền `//assets/` hỗ trợ truy cập vào -tài nguyên từ thư mục **assets**. Và bây giờ, thư mục này chỉ được sử dụng cho -tài nguyên lớn, chung hoặc độc nhất. Vì vậy, mọi plugin sẽ có assets của nó và bạn có thể -truy cập chúng qua `//plugins/`. - -Kể từ phiên bản 1.0, top-level `js` không được thực thi dưới dạng plugin entry point. Ngừng việc -đặt các tệp JS plugin của bạn trực tiếp vào thư mục **plugins**. Bạn cần phải -tạo một thư mục mới cho plugin của bạn. - -``` -plugins/ - |__your-plugin/ - |__assets/ - |... <- tài nguyên - |__index.js <- plugin entry - |... <- các utils -``` - -## Xóa CommonJS - - - -Trong v1.0, chúng tôi đã loại bỏ hỗ trợ CommonJS và chuyển sang mô-đun ES. Cái này -có nghĩa là tất cả các tập lệnh từ v0.6 sử dụng `require` và `module.exports` sẽ không -hoạt động trong phiên bản mới. - -Vui lòng tham khảo hướng dẫn migrate bên dưới. - -### Cập nhật hàm `require()` của bạn: - -```js -// trước -const utils = require('./utils') - -// sau -import utils from './utils' -``` - -```js -// trước -const { hello } = require('./greeting') - -// sau -import { hello } from './greeting' -``` - -> Đọc thêm tại -> [MDN import statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). -> Hãy chú ý rằng bạn không cần thêm đuôi `.js` vào đường dẫn import. - -### Đồng thời cập nhật `module.exports` của bạn: - -```js -// trước -module.exports = { - greet: () => 'Hello', -} - -// sau -export default { - greet: () => 'Hello', -} -``` - -```js -// trước -module.exports = to_export - -// sau -export default to_export -``` - -Chỉ việc `exports.`: - -```js -// trước -exports.data = some_value - -// sau -export let data = some_value -// hoặc với const nếu dữ liệu là bất biến -export const data = some_value -``` - -Điều này cũng hoạt động với các hàm được đặt tên: - -```js -// trước -exports.todo = function () { ... } -exports.todoAsync = async function () { ... } - -// sau -export function todo() { ... } -export async function todoAsync() { ... } -``` - -> Đọc thêm tại -> [MDN export statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export). - -### Import động - -Câu lệnh `import` không cho phép bạn sử dụng nó ở mức non-top-level, trong các hàm -hoặc một số scope, chẳng hạn như `require()`. - -```js -// trước -function load() { - const utils = require('./utils') -} -``` - -Làm nó với async context: - -```js -// sau -async function load() { - const utils = await import('./utils') -} -``` - -Hoặc với `.then` của Promise callback: - -```js -// sau -function load() { - import('./utils').then((module) => { - const utils = module.default - // ... - }) -} -``` - -Trong trường hợp ở trên, `import` trở thành một async function. Bạn cũng có thể thêm một -chuỗi `.catch` để bắt lỗi mô-đun. - -> Đọc thêm tại -> [MDN import() operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import). -> Hãy chú ý rằng bạn không cần thêm đuôi `.js` vào đường dẫn import. - -### Mô-đun JSON và CSS - -Bạn nên tham khảo [Hệ thống mô-đun](/vi/guide/module-system) để xử lý -việc import chúng. diff --git a/docs/vi/guide/module-system.md b/docs/vi/guide/module-system.md deleted file mode 100644 index 7abec37..0000000 --- a/docs/vi/guide/module-system.md +++ /dev/null @@ -1,216 +0,0 @@ -# Hệ thống mô-đun - -Hệ thống mô-đun của plugin thực sự là các -[Mô-đun JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) -(còn được gọi là mô-đun ES). - -## Mô-đun JS - -Như bạn đã biết, mục plugin là một tệp `index.js` duy nhất, sử dụng nhiều tệp -làm cho code của bạn dễ quản lý hơn. - -Sau đây sẽ có hai tệp, `index.js` và `utils.js.` **index** sẽ -lấy **utils** và in ra giá trị đã truy xuất. - -``` -your-plugin/ - |__index.js - |__utils.js -``` - -::: code-group - -```js [index.js] -// nhập utils.js bằng câu lệnh nhập -import utils from './utils' - -console.log(utils.greeting) // -> hello -``` - -```ts [utils.js] -// xuất một đối tượng đơn giản -export default { - gretting: 'Hello' -} -``` - -::: - -### `import` - -> Đọc thêm tại -> [MDN import statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import). -> Hãy chú ý rằng bạn không cần thêm đuôi `.js` vào đường dẫn import - -### `export` - -> Đọc thêm tại -> [MDN export statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export). - -### Import động - -Câu lệnh `import` được thiết kế để sử dụng ở bậc cao nhất của code. Vì vậy, bạn -không thể sử dụng nó bên trong các function hoặc một số phạm vi (scope). Import động cho phép bạn load -các mô-đun của bạn một cách linh hoạt, ngay cả bên trong một function hoặc scope. - -```js -async function load() { - const mod = await import('./mod') - // do something -} -``` - -> Đọc thêm tại -> [MDN import() operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import). -> Hãy chú ý rằng bạn không cần thêm đuôi `.js` vào đường dẫn import - -### Import CDN - -Ví dụ, import **axios** của [**Skypack**](https://skypack.dev). - -```js -import axios from 'https://cdn.skypack.dev/axios' - -async function testRequest() { - const res = await axios.get('https://...') - console.log(res.data) -} -``` - -::: info - -Một số thư viện được thiết kế chỉ dành riêng cho NodeJS, chúng không thể được import vào -plugin. - -::: - -::: tip Các CDN mình đề xuất - -- [Skypack](https://www.skypack.dev/) -- [ESM>CDN](https://esm.sh/) -- [jsDelivr ESM](https://esm.run) -- [UNPKG](https://unpkg.com/) - -::: - -Sử dụng import động sẽ hữu ích khi kết nối CDN chậm. - -```js -import('https://cdn.skypack.dev/axios') - .then(async (mod) => { - const axios = mod.default - // tạo một request - }) - .catch((err) => { - // xử lí lỗi - }) -``` - -## Mô-đun CSS - -```js -import './theme.css' -``` - -Dòng này sẽ đưa thẻ `link` vào `body` để load `theme.css` của bạn. Nó tương tự như cách sau: - -```js -const link = document.createElement('link') -link.rel = 'stylesheet' -link.href = '//plugins/your-plugin/theme.css' -document.body.appendChild(link) -``` - -Trong mô-đun CSS của mình, bạn có thể import tài nguyên plugin bằng đường dẫn: - -```css -.some-div { - background-image: url(./assets/image.png); - /* nó sẽ hiểu là //plugins/your-plugin/assets/image.png */ -} -``` - -## Mô-đun JSON - -Giả sử `config.json` của bạn như thế này: - -```json -{ - "enabled": true -} -``` - -Hãy import nó: - -```js -import config from './config.json' -console.log(config.enabled) // true -``` - -Bạn cũng có thể thay đổi giá trị của nó, nhưng nó sẽ không thay đổi trong file JSON. - -```js -config.enabled = false -// trong các mô-đun khác require nó -console.log(config.enabled) // false -``` - -## Import assets - -Để cập nhật các phần tử HTML từ JS, bạn có thể sử dụng `import` để lấy đường dẫn asset -mà không cần biết đường dẫn đầy đủ của nó. - -``` -your-plugin/ - |__assets/ - |__background.jpg - |__index.js - -background URL: //plugins/your-plugin/assets/background.jpg -``` - -Đây là code ví dụ: - -```js -import background from './assets/background.jpg' - -function changeBackground() { - const div = document.querySelector('some-div') - div.style.backgroundImage = `url(${background})` - // or with 's src attribute - myImg.src = background -} -``` - -Bạn có thể console.log `background` để xem giá trị của nó: - -```js -console.log(background) -``` - -Với cấu trúc trên, bạn có -`//plugins/your-plugin/assets/my-background.jpg`. - -::: info - -Lưu ý rằng tính năng import asset hỗ trợ các loại tệp hình ảnh, phông chữ và các file phương tiện phổ biến. Các loại không được hỗ trợ khác sẽ không hoạt động; bạn sẽ cần thêm hậu tố `?url` bên cạnh để có được đường dẫn của nó. - -::: - -## Explicit import - -Bạn có thể chỉ định một giá trị hậu tố làm thông số truy vấn cho URL import. - -```js -import content from './my-data.txt?raw' -// đọc tệp dưới dạng string - -import path from './some-resource?url' -// lấy đường dẫn tới asset -``` - -:::info - -Với `?raw`, tệp của bạn nên được lưu dưới dạng mã hóa UTF-8. - -::: diff --git a/docs/vi/guide/npm-compatibility.md b/docs/vi/guide/npm-compatibility.md deleted file mode 100644 index d7cff13..0000000 --- a/docs/vi/guide/npm-compatibility.md +++ /dev/null @@ -1,39 +0,0 @@ -# Khả năng tương thích với NPM - -## Sử dụng các project NodeJS - -Chúng tôi thực sự khuyên bạn nên sử dụng các project NodeJS để xây dựng plugin của mình. - -Với TypeScript hoặc các ngôn ngữ khác yêu cầu transpile, bạn cần có công cụ để xây dựng chúng, Webpack, Rollup hoặc Vite là lựa chọn tốt nhất. - -Bạn cũng có thể sử dụng bất kỳ thư viện front-end nào để xây dựng UI tùy chỉnh, ví dụ: React, Preact, -Vue, Svelte, SolidJS, v.v. Với công cụ front-end, hot-reload/HMR của nó sẽ giúp -bạn làm việc nhanh hơn. - -::: info - -Lưu ý rằng không thể sử dụng các package npm được thiết kế để chỉ chạy trong NodeJS -để xây dựng plugin. - -::: - -::: tip - -Với các công cụ hỗ trợ, sau khi gói lại assets của bạn có thể sẽ bị sai đường dẫn. -Vui lòng tham khảo [Xử lí asset](/vi/guide/asset-handling) để sửa chúng. - -::: - -## Các plugin tham khảo - -### Webpack 📦 - -- [douugdev/league-a-better-client](https://github.com/douugdev/league-a-better-client) - - Một tiện ích LCU với HMR + ⚛ Preact + SASS + TypeScript - -### Vite ⚡ - -- [Pengu vite-theme](https://github.com/PenguLoader/PenguLoader/blob/main/plugins/vite-theme) - - Một theme đơn giản với HMR + SASS + TypeScript -- [Pengu @default](https://github.com/PenguLoader/PenguLoader/blob/main/plugins/@default) - - Plugin mặc định với HMR + SolidJS + SASS + TypeScript diff --git a/docs/vi/guide/welcome.md b/docs/vi/guide/welcome.md deleted file mode 100644 index 9185c4f..0000000 --- a/docs/vi/guide/welcome.md +++ /dev/null @@ -1,53 +0,0 @@ -# Chào mừng - -## Pengu Loader là gì? - -

- -

- -**Pengu Loader** (trước đây là **League Loader**) là một **plugin loader** được thiết kế -dành riêng cho **client Liên Minh Huyền Thoại**. - -Với Pengu Loader, bạn có thể tải các plug-in **JavaScript** vào Client dưới dạng -các thư viện, có thể giúp bạn cá nhân hóa giao diện của Client, -thêm nội dung tùy chỉnh của bạn, thêm các tính năng mới và cải thiện trải nghiệm tổng thể của bạn. -Nó cũng cho phép bạn xây dựng một Client thông minh hơn phù hợp với nhu cầu của bạn và -sở thích. - -Các tính năng chính: - -- Tùy chỉnh League Client bằng plugin -- Thiết kế / cá nhân hóa Client của bạn -- Hỗ trợ các tính năng JavaScript hiện đại -- Hỗ trợ DevTools tích hợp và từ xa -- Dễ dàng làm việc hơn với LCU API - -::: tip Fact - -Pengu Loader là một phần trong sứ mệnh "Lập trình cho game thủ" của chúng tôi. - -::: - -## Tại sao lại là JavaScript? - -

- -

- -**JavaScript** là một ngôn ngữ lập trình linh hoạt và mạnh mẽ được sử dụng rộng rãi -được sử dụng trong phát triển web. Nó đã trở thành tiêu chuẩn thực tế cho client-side scripting trên web, cho phép các nhà phát triển tạo các trang web động và tĩnh. - -Ưu điểm chính của JavaScript là khả năng tương thích với UX của League Client, -thứ thực sự là một trình duyệt web Chromium được nhúng. Điều này có nghĩa là -các JavaScript plugin có thể dễ dàng tích hợp vào Client và chạy song song cùng với -Client hiện tại. Ngoài ra, người dùng có thể tận dụng toàn bộ sức mạnh của -Chrome DevTools để gỡ lỗi và sửa đổi plugin của họ. - -Đối với trường hợp của Pengu Loader, JavaScript cung cấp một nền tảng lý tưởng để tùy chỉnh Client Liên Minh Huyền Thoại. Bằng cách sử dụng các plugin JavaScript, người dùng có thể thêm chức năng mới, thay đổi giao diện của Client và thậm chí tích hợp các công nghệ web vào giao diện Client. Vì JavaScript là ngôn ngữ được sử dụng rộng rãi với cộng đồng lớn các nhà phát triển nên có nhiều công cụ và thư viện hiện có có thể được tận dụng để nâng cao chức năng của Pengu Loader. - -## Cộng đồng của chúng tôi - -- [Server Discord](https://chat.pengu.lol/) -- [GitHub repository](https://github.com/PenguLoader/PenguLoader) -- [GitHub organization](https://github.com/PenguLoader) diff --git a/docs/vi/index.md b/docs/vi/index.md deleted file mode 100644 index 5db86d2..0000000 --- a/docs/vi/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -layout: home - -title: Pengu Loader -titleTemplate: Pengu Loader - -hero: - name: Pengu Loader - # text: Pengu Loader - tagline: Giải phóng sức mạnh của Client LMHT - image: - src: /Pengu_Featherknight_144.jpg - alt: PenguLoader - actions: - - theme: brand - text: Bắt đầu ngay - link: /vi/guide/welcome - - theme: alt - text: Discord - link: https://chat.pengu.lol - - theme: alt - text: Mã nguồn - link: https://github.com/PenguLoader/PenguLoader - -features: - - icon: - src: /features/javascript.png - title: Hỗ trợ JavaScript - details: Xây dựng một Client thông minh hơn với JavaScript. Thật tuyệt khi có thể dùng cả công nghệ front-end yêu thích của bạn. - - icon: - src: /features/theme.png - title: Cá nhân hóa giao diện và trải nghiệm - details: Tùy biến giao diện Client theo ý thích của bạn và biến nó thành độc nhất. - - icon: - src: /features/league-of-legends.png - title: Khám phá bên trong Client - details: Được thiết kế để hoạt động trơn tru bên trong Client, giúp bạn truy cập vào LCU không giới hạn. - - icon: - src: /features/chrome-dev.png - title: Chrome DevTools - details: Chỉnh sửa mọi thứ trên Client như cách mà bạn làm với trình duyệt web. ---- diff --git a/docs/vi/runtime-api/auth-callback.md b/docs/vi/runtime-api/auth-callback.md deleted file mode 100644 index e2b006b..0000000 --- a/docs/vi/runtime-api/auth-callback.md +++ /dev/null @@ -1,44 +0,0 @@ -# `AuthCallback` - -Namespace này giúp bạn tạo một callback URL và đọc response của nó từ auth flow. - -## `AuthCallback.createURL()` - -Tạo một callback URL độc nhất có thể được sử dụng để callback/redirect auth từ -trình duyệt web bên ngoài. - -## `AuthCallback.readResponse(url, timeout?)` - -Hàm này sẽ đợi response từ một callback URL đã cho. Nó trả về một -`Promise` cho async context, gồm string nếu success hoặc null nếu timeout. - -Tham số: - -- `url` - Callback URL được tạo bởi `AuthCallback.createURL()`. -- `timeout` - Thời gian chờ tùy chọn tính bằng mili giây, mặc định là 180 giây. - -Callback URL chỉ hỗ trợ **GET** request, response của function này có thể là tham số tìm kiếm được thực hiện bởi auth flow. - -Ví dụ: - -```js -async function requestUserAuth() { - const callbackURL = AuthCallback.createURL() - const requestAuth = 'https://.../?redirect_uri=' + - encodeURIComponent(callbackURL) - // Mở trong trình duyệt - window.open(callbackURL) - - const response = await AuthCallback.readResponse(callbackURL) - if (response === null) { - console.log('timeout/fail') - } else { - console.log(response) - } - - // sẽ show UX để focus - fetch('/riotclient/ux-show', { method: 'POST' }) -} -``` - -Tham khảo ví dụ [spotify-gateway](https://github.com/LeagueLoader/spotify-gateway) để xem thêm. diff --git a/docs/vi/runtime-api/data-store.md b/docs/vi/runtime-api/data-store.md deleted file mode 100644 index 1cb7b4a..0000000 --- a/docs/vi/runtime-api/data-store.md +++ /dev/null @@ -1,59 +0,0 @@ -# `DataStore` - -League Client không lưu trữ dữ liệu người dùng trên ổ cứng, tương tự như chế độ ẩn danh trên trình duyệt web. Namespace này giúp bạn lưu dữ liệu người dùng trên ổ cứng. - -## `DataStore.set(key, value)` - -Gọi hàm này để lưu trữ dữ liệu của bạn với một key đã cho. - -- `key` (bắt buộc) Các key phải là chuỗi hoặc số. -- `value` (bắt buộc) Giá trị có thể là chuỗi, số, boolean, null hoặc gồm nhiều giá trị như mảng và đối tượng. Trên thực tế, nó sẽ được lưu trữ dưới dạng định dạng JSON, vì vậy bất kỳ giá trị như hàm và runtime object bị bỏ qua. - -Ví dụ: - -```js -let my_num = 10 -let my_str = 'hello' -DataStore.set('my_num', my_num) -DataStore.set('my_str', my_str) -``` - -::: tip - -Bạn nên sử dụng một tên riêng biệt cho key, đừng sử dụng các tên phổ thông, ví dụ -`access_token`, `is_logged`, v.v. Các plugin khác có thể sẽ ghi đè dữ liệu của bạn, bạn cũng có thể thêm tiền tố cho key của mình. - -::: - -## `DataStore.get(key)` - -Truy xuất dữ liệu được lưu trữ của bạn bằng một key đã cho. Nếu key không tồn tại, nó sẽ trả về `undefined`. - -Ví dụ: - -```js -console.log(DataStore.get('my_str')) -console.log(DataStore.get('key-does-not-exist')) // undefined -``` - -## `DataStore.has(key)` - -Hàm này trả về một giá trị boolean cho biết liệu dữ liệu có key được chỉ định -có tồn tại hay không. - -```js -console.log(DataStore.has('my_num')) -console.log(DataStore.has('key-does-not-exist')) -``` - -## `DataStore.remove(key)` - -Hàm này xóa dữ liệu đã chỉ định khỏi bộ nhớ theo key, trả về true nếu -cặp key-value hiện tại đã bị xóa. - -Ví dụ: - -```js -DataStore.remove('some-key') -DataStore.has('some-key') // -> false -``` diff --git a/docs/vi/runtime-api/effect.md b/docs/vi/runtime-api/effect.md deleted file mode 100644 index 1a86f26..0000000 --- a/docs/vi/runtime-api/effect.md +++ /dev/null @@ -1,99 +0,0 @@ -# `Effect` - -Namespace này hỗ trợ thay đổi hiệu ứng cửa sổ.
- -Các hiệu ứng có sẵn: `mica`, `acrylic`, `unified` và `blurbehind`. - -![](https://user-images.githubusercontent.com/38210249/216951830-b3bb3ce3-7a5f-4e60-8a67-33d0bce799cf.png) - -## `Effect.current` - -Một thuộc tính read-only trả về hiệu ứng hiện tại đang được xác định hoặc trả về `undefined` nếu không có hiệu ứng nào đang được áp dụng. - -Vĩ dụ: - -```js -// in ra màn hình hiệu ứng đang được áp dụng -console.log(Effect.current) -``` - -## `Effect.apply(name, options?)` - -Một hàm lấy tên của một hiệu ứng mong muốn và một tùy chọn.
Nó trả về một giá trị boolean cho biết liệu hiệu ứng có được áp dụng thành công hay không. - -- `name` [bắt buộc] Tên các hiệu ứng bên trên để áp dụng, dưới dạng chuỗi. - -- `options` [bắt buộc] Tùy chọn thêm cho hiệu ứng, `acrylic`, `unified` - và `blurbehind` có thể có thêm một tông màu, riêng `mica` sẽ không có tùy chọn này. - -Hàm này trả về `false` nếu không thể áp dụng hiệu ứng, hãy xem -[Khả năng tương thích hệ thống](#system-compatibility) bên dưới. - -Ví dụ: - -```js -// bật acrylic trên Windows 10 -Effect.apply('acrylic') - -// với một tông màu -Effect.apply('unified', { color: '#4446' }) - -// mica trên windows 11, không có tùy chọn thêm -Effect.apply('mica') -``` - -::: info - -Màu phải ở định dạng CSS hex color, ví dụ. #RGB, #RGBA, #RRGGBB, -#RRGGBBAA. - -::: - -![](https://user-images.githubusercontent.com/38210249/216951865-bb9c6676-58ec-4c81-ad96-67e94e91ac22.png) - -### Khả năng tương thích hệ thống - - - -- Trên Windows 7, chỉ hỗ trợ `blurbehind`. -- Trên Windows 10, yêu cầu bản 1703 trở lên để sử dụng `acrylic`. -- `mica` và `unified` chỉ được hỗ trợ trên Windows 11, nhưng `unified` thì có thể - được kích hoạt trên Windows 10 nhưng sẽ không khác gì so với `acrylic`. - -::: warning - -Trên Windows 10 bản **1903** (19H1) trở lên, áp dụng `acrylic/mica/unified` với -**Transparency effects** (trong Personalize -> Color settings) sẽ bị lag khi -di chuyển cửa sổ Client. - -::: - -## `Effect.clear()` - -Một hàm sẽ xóa toàn bộ hiệu ứng đang được áp dụng, sau đó nền Client sẽ thành màu đen.
Sử dụng `Effect.current` sau khi xóa sẽ trả về -`undefined`. - -Ví dụ: - -```js -// chỉ cần xóa hiệu ứng được áp dụng, kể cả khi không áp dụng hiệu ứng gì -Effect.clear() -``` - -## `Effect.on(event, callback)` - -Thêm một listener sẽ được kích hoạt khi hiệu ứng được thay đổi. - -```js -Effect.on('apply', ({ old, name, options }) => { - // do something -}) - -Effect.on('clear', () => { - // do something -}) -``` - -## `Effect.off(event, callback)` - -Xóa listener đã thêm của bạn. diff --git a/docs/vi/runtime-api/index.md b/docs/vi/runtime-api/index.md deleted file mode 100644 index 6a265fb..0000000 --- a/docs/vi/runtime-api/index.md +++ /dev/null @@ -1,92 +0,0 @@ -# Runtime API - -Các API này được thiết kế để sử dụng bên trong League Client với plugin Pengu Loader. - -## `window.openDevTools()` - - - -Gọi hàm này để mở cửa sổ Chrome DevTools. - -Ví dụ: - -```js -window.openDevTools() -``` - -## `window.openAssetsFolder()` - - - -Gọi hàm này để mở thư mục assets trong một cửa sổ File Explorer mới. - -Ví dụ: - -```js -window.openAssetsFolder() -``` - -## `window.openPluginsFolder()` - - - -Gọi hàm này để mở thư mục plugins trong một cửa sổ File Explorer mới. - -Ví dụ: - -```js -window.openPluginsFolder() -``` - -## `window.__llver` - - - -Thuộc tính này trả về phiên bản hiện tại của Pengu Loader. - -Ví dụ: - -```js -console.log(window.__llver) // e.g 0.6.0 -console.log('Bạn đang sử dụng Pengu Loader phiên bản ' + window.__llver) -``` - -## Khai báo TypeScript - -```ts -namespace globalThis { - function openAssetsFolder(): void - function openPluginsFolder(): void - function openDevTools(remote?: boolean): void - var __llver: string - - namespace AuthCallback { - function createURL(): string - function readResponse(url: string, timeout: number): Promise - } - - namespace DataStore { - function has(key: string): boolean - function get(key: string): any - function set(key: string, value: any): void - function remove(key: string): boolean - } - - namespace Effect { - type EffectName = 'mica' | 'acrylic' | 'unified' | 'blurbehind' - const current: EffectName | null - function apply(name: EffectName): boolean - function apply( - name: Exclude, - options: { color: string }, - ): boolean - function clear(): void - function on( - event: 'apply', - listener: (name: string, options?: object) => any, - ): void - function on(event: 'clear', listener: () => any): void - function off(event: 'apply' | 'clear', listener: () => any): void - } -} -``` From 18e42638c76d70ce679481db019ff2489a8ee925 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Sun, 23 Jul 2023 20:09:53 +0000 Subject: [PATCH 02/17] Upgrade vitepress, update api docs --- .vitepress/config.ts | 159 +------ .vitepress/theme/index.ts | 29 +- .vitepress/theme/{custom.css => style.css} | 69 ++- docs/guide/lcu-request.md | 10 +- docs/runtime-api/auth-callback.md | 16 +- docs/runtime-api/data-store.md | 35 +- docs/runtime-api/effect.md | 73 +-- docs/runtime-api/index.md | 78 ++-- docs/runtime-api/pengu.md | 39 ++ package.json | 12 +- pnpm-lock.yaml | 514 +++++++++++++-------- 11 files changed, 567 insertions(+), 467 deletions(-) rename .vitepress/theme/{custom.css => style.css} (52%) create mode 100644 docs/runtime-api/pengu.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index df3ffbb..396bb35 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -1,22 +1,23 @@ -import { defineConfig } from 'vitepress'; -import { resolve } from 'node:path'; -import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'; -import pkg from '../package.json'; +import { defineConfig } from 'vitepress' +import { join } from 'node:path' +import pkg from '../package.json' +// https://vitepress.dev/reference/site-config export default defineConfig({ - srcDir: './docs', - vite: { - publicDir: resolve(__dirname, '../public'), - }, - lang: 'en', - title: 'Pengu Loader', - description: 'Unleash the power of Customization from your League of Legends Client.', - appearance: 'dark', + title: "Pengu Loader", + description: "Unleash the power of Customization from your League of Legends Client.", + lang: 'en', + // appearance: 'dark', lastUpdated: true, cleanUrls: true, + srcDir: './docs', + vite: { + publicDir: join(__dirname, '../public') + }, + head: [ ['meta', { name: 'theme-color', content: '#1e1e20' }], ['link', { rel: 'icon', href: '/PenguLoader.png', type: 'image/png' }], @@ -34,16 +35,8 @@ export default defineConfig({ ['meta', { name: 'twitter:image', content: 'https://pengu.lol/banner.jpg' }], ], - markdown: { - headers: { - level: [0, 0] - }, - config: (md) => { - md.use(tabsMarkdownPlugin); - } - }, - themeConfig: { + // https://vitepress.dev/reference/default-theme-config logo: '/PenguLoader.png', nav: nav(), @@ -64,8 +57,8 @@ export default defineConfig({ ], sidebar: { - '/guide/': sidebarGuide(), - '/runtime-api/': sidebarGuide(), + '/guide/': sidebar(), + '/runtime-api/': sidebar(), }, footer: { @@ -73,36 +66,7 @@ export default defineConfig({ copyright: `Copyright © 2023-present Pengu Loader` }, }, - - locales: { - root: { - label: 'English', - lang: 'en', - }, - // 'vi': { - // label: 'Tiếng Việt', - // lang: 'vi', - // link: '/vi/', - // themeConfig: { - // sidebar: { - // '/vi/guide/': sidebarGuideVi(), - // '/vi/runtime-api/': sidebarGuideVi(), - // } - // } - // }, - // 'pt-br': { - // label: 'Português (BR)', - // lang: 'pt-br', - // link: '/pt-br/', - // themeConfig: { - // sidebar: { - // '/pt-br/guide/': sidebarGuideBR(), - // '/pt-br/runtime-api/': sidebarGuideBR(), - // } - // } - // }, - } -}); +}) function nav() { return [ @@ -123,7 +87,7 @@ function nav() { ] } -function sidebarGuide() { +function sidebar() { return [ { text: 'Getting Started', @@ -151,6 +115,7 @@ function sidebarGuide() { collapsed: false, items: [ { text: 'Overview', link: '/runtime-api/' }, + { text: '[Pengu]', link: '/runtime-api/pengu' }, { text: '[AuthCallback]', link: '/runtime-api/auth-callback' }, { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, @@ -164,90 +129,4 @@ function sidebarGuide() { ] } ] -} - -function sidebarGuideVi() { - return [ - { - text: 'Bắt đầu', - collapsed: false, - items: [ - { text: 'Chào mừng', link: '/vi/guide/welcome' }, - { text: 'Cài đặt', link: '/vi/guide/installation' }, - { text: 'FAQs', link: '/vi/guide/faqs' }, - ] - }, - { - text: 'Plugins', - collapsed: false, - items: [ - { text: 'Plugin JavaScript', link: '/vi/guide/javascript-plugin' }, - { text: 'Hệ Thống Mô-đun', link: '/vi/guide/module-system' }, - { text: 'Theme CSS', link: '/vi/guide/css-theme' }, - { text: 'Xử lí Asset', link: '/vi/guide/asset-handling' }, - { text: 'LCU Request', link: '/vi/guide/lcu-request' }, - { text: 'Tương Thích Với NPM', link: '/vi/guide/npm-compatibility' }, - ] - }, - { - text: 'Runtime API', - collapsed: false, - items: [ - { text: 'Tổng Quan', link: '/vi/runtime-api/' }, - { text: '[AuthCallback]', link: '/vi/runtime-api/auth-callback' }, - { text: '[DataStore]', link: '/vi/runtime-api/data-store' }, - { text: '[Effect]', link: '/vi/runtime-api/effect' }, - ] - }, - { - text: 'Migrations', - collapsed: false, - items: [ - { text: 'Migrate từ phiên bản v0.6', link: '/vi/guide/migration-from-v0-6' }, - ] - } - ] -} - -function sidebarGuideBR() { - return [ - { - text: "Começando", - collapsed: false, - items: [ - { text: "Bem Vindo", link: "/pt-br/guide/welcome" }, - { text: "Instalação", link: "/pt-br/guide/installation" }, - { text: "FAQs", link: "/pt-br/guide/faqs" }, - ], - }, - { - text: "Plugins", - collapsed: false, - items: [ - { text: "JavaScript Plugin", link: "/pt-br/guide/javascript-plugin" }, - { text: "Module System", link: "/pt-br/guide/module-system" }, - { text: "CSS Theme", link: "/pt-br/guide/css-theme" }, - { text: "Asset Handling", link: "/pt-br/guide/asset-handling" }, - { text: "LCU Request", link: "/pt-br/guide/lcu-request" }, - { text: "Npm Compatibility", link: "/pt-br/guide/npm-compatibility" }, - ], - }, - { - text: "Runtime API", - collapsed: false, - items: [ - { text: "Overview", link: "/pt-br/runtime-api/" }, - { text: "[AuthCallback]", link: "/pt-br/runtime-api/auth-callback" }, - { text: "[DataStore]", link: "/pt-br/runtime-api/data-store" }, - { text: "[Effect]", link: "/pt-br/runtime-api/effect" }, - ], - }, - { - text: "Migrations", - collapsed: false, - items: [ - { text: "Migration from v0.6", link: "/pt-br/guide/migration-from-v0-6" }, - ], - }, - ] } \ No newline at end of file diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 191157b..bdd506d 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -1,17 +1,16 @@ -import DefaultTheme from 'vitepress/theme'; -import { vitepressGoogleAnalytics } from './analytics'; -import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'; -import vitepressNprogress from 'vitepress-plugin-nprogress'; -import 'vitepress-plugin-nprogress/lib/css/index.css'; -import './custom.css'; +// https://vitepress.dev/guide/custom-theme +import { h } from 'vue' +import Theme from 'vitepress/theme' +import './style.css' -const theme: typeof DefaultTheme = { - ...DefaultTheme, - enhanceApp: (ctx) => { - vitepressNprogress(ctx); - vitepressGoogleAnalytics('G-KX1BWHTJ9S'); - enhanceAppWithTabs(ctx.app); +export default { + extends: Theme, + Layout: () => { + return h(Theme.Layout, null, { + // https://vitepress.dev/guide/extending-default-theme#layout-slots + }) + }, + enhanceApp({ app, router, siteData }) { + // ... } -}; - -export default theme; \ No newline at end of file +} diff --git a/.vitepress/theme/custom.css b/.vitepress/theme/style.css similarity index 52% rename from .vitepress/theme/custom.css rename to .vitepress/theme/style.css index 7382b44..f02fdfa 100644 --- a/.vitepress/theme/custom.css +++ b/.vitepress/theme/style.css @@ -1,4 +1,13 @@ -:root { +/** + * Customize default theme styling by overriding CSS variables: + * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css + */ + +/** + * Colors + * -------------------------------------------------------------------------- */ + + :root { --vp-c-brand: #646cff; --vp-c-brand-light: #747bff; --vp-c-brand-lighter: #9499ff; @@ -7,6 +16,14 @@ --vp-c-brand-darker: #454ce1; --vp-c-brand-dimm: rgba(100, 108, 255, 0.08); + scroll-behavior: smooth; +} + +/** + * Component: Button + * -------------------------------------------------------------------------- */ + +:root { --vp-button-brand-border: var(--vp-c-brand-light); --vp-button-brand-text: var(--vp-c-white); --vp-button-brand-bg: var(--vp-c-brand); @@ -16,17 +33,53 @@ --vp-button-brand-active-border: var(--vp-c-brand-light); --vp-button-brand-active-text: var(--vp-c-white); --vp-button-brand-active-bg: var(--vp-button-brand-bg); +} + +/** + * Component: Home + * -------------------------------------------------------------------------- */ +:root { --vp-home-hero-name-color: transparent; --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe, #41d1ff); --vp-home-hero-image-background-image: linear-gradient(156deg, #378adf60 30%, #bb5ff560); --vp-home-hero-image-filter: blur(66px); +} - scroll-behavior: smooth; +@media (min-width: 640px) { + :root { + --vp-home-hero-image-filter: blur(56px); + } } -.VPHero .VPImage { - border-radius: .8rem; +@media (min-width: 960px) { + :root { + --vp-home-hero-image-filter: blur(72px); + } +} + +/** + * Component: Custom Block + * -------------------------------------------------------------------------- */ + +:root { + --vp-custom-block-tip-border: var(--vp-c-brand); + --vp-custom-block-tip-text: var(--vp-c-brand-darker); + --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); +} + +.dark { + --vp-custom-block-tip-border: var(--vp-c-brand); + --vp-custom-block-tip-text: var(--vp-c-brand-lightest); + --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); +} + +/** + * Others + * -------------------------------------------------------------------------- */ + + .VPHero .VPImage { + border-radius: 1rem; } .VPFeature .VPImage { @@ -53,6 +106,14 @@ min-width: 180px !important; } +/** + * Component: Algolia + * -------------------------------------------------------------------------- */ + +.DocSearch { + --docsearch-primary-color: var(--vp-c-brand) !important; +} + .DocSearch.DocSearch-Button { background: var(--docsearch-searchbox-focus-background); box-shadow: var(--docsearch-searchbox-shadow); diff --git a/docs/guide/lcu-request.md b/docs/guide/lcu-request.md index fde88b8..25300c0 100644 --- a/docs/guide/lcu-request.md +++ b/docs/guide/lcu-request.md @@ -38,9 +38,10 @@ async function quitLobby() { // dont know why people call it 'dodge' } ``` -::: details Up-to-date LCU API docs +::: details LCU API docs -https://lcu.kebs.dev. +- https://lcu.kebs.dev +- http://www.mingweisamuel.com/lcu-schema/tool/#/ ::: @@ -139,8 +140,9 @@ function getAuthStatus() { } ``` -::: details Up-to-date RiotClient API docs +::: details RiotClient API docs -https://riotclient.nomi.dev +- https://riotclient.kebs.dev +- https://riotclient.nomi.dev ::: diff --git a/docs/runtime-api/auth-callback.md b/docs/runtime-api/auth-callback.md index 797501c..4f06c99 100644 --- a/docs/runtime-api/auth-callback.md +++ b/docs/runtime-api/auth-callback.md @@ -1,14 +1,24 @@ -# `AuthCallback` +# ~~AuthCallback~~ + + This namespace helps you to create a callback URL and read its response from an auth flow. -## `AuthCallback.createURL()` +## ~~AuthCallback.createURL~~ + + + + Create a unique callback URL that can be used for auth callback/redirect from external web browsers. -## `AuthCallback.readResponse(url, timeout?)` +## ~~AuthCallback.readResponse~~ + + + + This function wait for response from a given callback URL. It returns a `Promise` for async context, contains string if success or null when timeout. diff --git a/docs/runtime-api/data-store.md b/docs/runtime-api/data-store.md index b4fc7a8..c87b15d 100644 --- a/docs/runtime-api/data-store.md +++ b/docs/runtime-api/data-store.md @@ -1,17 +1,25 @@ -# `DataStore` +# DataStore namespace League Client does not store user data on disk, similar to incognito mode in web browsers. This namespace helps you to store user data on disk. -## `DataStore.set(key, value)` +## DataStore.set(key, value) + + + Call this function to store your data with a given key. +Parameters: + - `key` (required) Keys should be string or number. - `value` (required) Value may be string, number, boolean, null or collection like array and object. Actually, it will be stored as JSON format, so any value like function and runtime object are ignored. +Returns: +- A boolean value that indicates your key is valid and the data is stored successfully. + Example: ```js @@ -21,15 +29,18 @@ DataStore.set('my_num', my_num) DataStore.set('my_str', my_str) ``` -::: tip +::: tip Unique keys -Unique keys You should use unique names for keys, do not use common names, e.g +You should use unique names for keys, do not use common names, e.g `access_token`, `is_logged`, etc. Other plugins can override your data, you can add prefix to your keys. ::: -## `DataStore.get(key)` +## DataStore.get(key, fallback?) + + + Retrieve your stored data with a given key. If the key does not exist, it will return `undefined`. @@ -46,11 +57,14 @@ console.log(DataStore.get('key-does-not-exist')) Since **v1.0.5**, you can set fallback value for non-existent keys. ```js -console.log(DataStore.get('key-does-not-exist'), 1000) +console.log(DataStore.get('key-does-not-exist', 1000)) // 1000 ``` -## `DataStore.has(key)` +## DataStore.has(key) + + + This function returns a boolean indicating whether data with the specified key exists or not. @@ -60,7 +74,10 @@ console.log(DataStore.has('my_num')) console.log(DataStore.has('key-does-not-exist')) ``` -## `DataStore.remove(key)` +## DataStore.remove(key) + + + This function removes the specified data from storage by key, returns true if the existing key-value pair has been removed. @@ -70,4 +87,4 @@ Example: ```js DataStore.remove('some-key') DataStore.has('some-key') // -> false -``` +``` \ No newline at end of file diff --git a/docs/runtime-api/effect.md b/docs/runtime-api/effect.md index 2532559..5997dd5 100644 --- a/docs/runtime-api/effect.md +++ b/docs/runtime-api/effect.md @@ -1,29 +1,39 @@ -# `Effect` +# Effect -This namespace supports changing window effects.
+This namespace supports changing window transparency effect. -Available effects: `mica`, `acrylic`, `unified` and `blurbehind`. +
![](https://user-images.githubusercontent.com/38210249/216951830-b3bb3ce3-7a5f-4e60-8a67-33d0bce799cf.png) -## `Effect.current` +## Effect.current + + + -A read-only property that returns the currently applied effect or `undefined` if +A read-only property that returns the currently applied effect or `null` if no effect has been applied. +Available effects: `mica`, `acrylic`, `unified` and `blurbehind`. + Example: ```js -// prints applied effect console.log(Effect.current) +// mica ``` -## `Effect.apply(name, options?)` +## Effect.apply(name, options?) + + + A function that takes the name of the desired effect name and an optional object.
It returns a boolean indicating whether the effect was successfully applied or not. +Parameters: + - `name` [required] These effect names above to be applied, in string. - `options` [optional] Additional options for the effect, `acrylic`, `unified` @@ -50,11 +60,29 @@ Effect.apply('mica') Tint colors must be in CSS hex color format, e.g. #RGB, #RGBA, #RRGGBB, #RRGGBBAA. +To see transparency effect correctly, you should remove all lowest backgrounds. + ::: ![](https://user-images.githubusercontent.com/38210249/216951865-bb9c6676-58ec-4c81-ad96-67e94e91ac22.png) -### System compatibility +## Effect.clear() + + + + +A function that clears any currently applied effect, then the Client background +will be black.
Using `Effect.current` after clearing will give you +`undefined`. + +Example: + +```js +// just clear applied effect, even if nothing applied +Effect.clear() +``` + +## System compatibility @@ -71,33 +99,12 @@ moving the Client window. ::: -## `Effect.clear()` - -A function that clears any currently applied effect, then the Client background -will be black.
Using `Effect.current` after clearing will give you -`undefined`. - -Example: - -```js -// just clear applied effect, even if nothing applied -Effect.clear() -``` - -## `Effect.on(event, callback)` +## Listening for changes Add a listener which will be triggered when effect changed. ```js -Effect.on('apply', ({ old, name, options }) => { - // do something +window.addEventListener('effect-changed', (event) => { + console.log(event.detail) }) - -Effect.on('clear', () => { - // do something -}) -``` - -## `Effect.off(event, callback)` - -Remove your added listener. +``` \ No newline at end of file diff --git a/docs/runtime-api/index.md b/docs/runtime-api/index.md index 095c993..117b3a6 100644 --- a/docs/runtime-api/index.md +++ b/docs/runtime-api/index.md @@ -3,8 +3,9 @@ These APIs are designed to use inside League Client with Pengu Loader plugin runtime. -## `window.openDevTools()` +## window.openDevTools(remote?) + Call this function to open the built-in Chrome DevTools window. @@ -12,12 +13,14 @@ Call this function to open the built-in Chrome DevTools window. Example: ```js -window.openDevTools() +window.openDevTools() // built-in DevTools +window.openDevTools(true) // remote DevTools ``` -## `window.openAssetsFolder()` +## window.openAssetsFolder() - + + Call this function to open the assets folder in new File Explorer window. @@ -27,8 +30,9 @@ Example: window.openAssetsFolder() ``` -## `window.openPluginsFolder()` +## window.openPluginsFolder() + Call this function to open the plugins folder in new File Explorer window. @@ -39,8 +43,9 @@ Example: window.openPluginsFolder() ``` -## `window.reloadClient()` +## window.reloadClient() + Call this function to reload the Client and ignore caching. @@ -51,8 +56,9 @@ Example: window.reloadClient() ``` -## `window.restartClient()` +## window.restartClient() + Call this function to restart the Client (entire the UX processes). @@ -63,8 +69,9 @@ Example: window.restartClient() ``` -## `window.getScriptPath()` +## window.getScriptPath() + Call this function get the current script path. @@ -76,57 +83,24 @@ Example: window.getScriptPath() ``` -## `window.__llver` +## window.__llver + + This property returns the current version of Pengu Loader. Example: ```js -console.log(window.__llver) // e.g 0.6.0 -console.log('You are using Pengu Loader v' + window.__llver) +console.log(window.__llver) // 0.6.0 +console.log(`You are using Pengu Loader v${window.__llver}`) ``` -## TypeScript declaration - -```ts -namespace globalThis { - function openAssetsFolder(): void - function openPluginsFolder(): void - function openDevTools(remote?: boolean): void - function reloadClient(): void - function restartClient(): void - var __llver: string - - namespace AuthCallback { - function createURL(): string - function readResponse(url: string, timeout: number): Promise - } - - namespace DataStore { - function has(key: string): boolean - function get(key: string, fallback: any): any - function set(key: string, value: any): boolean - function remove(key: string): boolean - } - - namespace Effect { - type EffectName = 'mica' | 'acrylic' | 'unified' | 'blurbehind' - const current: EffectName | null - function apply(name: EffectName): boolean - function apply( - name: Exclude, - options: { color: string }, - ): boolean - function clear(): void - function on( - event: 'apply', - listener: (name: string, options?: object) => any, - ): void - function on(event: 'clear', listener: () => any): void - function off(event: 'apply' | 'clear', listener: () => any): void - } -} -``` +::: tip + +Since v1.0.6, this property has been deprecated. +Please use `Pengu.version` instead. + +::: \ No newline at end of file diff --git a/docs/runtime-api/pengu.md b/docs/runtime-api/pengu.md new file mode 100644 index 0000000..65ce64f --- /dev/null +++ b/docs/runtime-api/pengu.md @@ -0,0 +1,39 @@ +# Pengu namespace + +This namespace provides information about current Pengu version and its settings. + +## Pengu.version + + + + +A read-only property that returns the current version of Pengu Loader. + +```js +console.log(Pengu.version) +// 1.0.6 +``` + +## Pengu.superPotato + + + + +A boolean value that indicates the **Super Low Spec Mode** is enabled or not. + +```js +console.log(Pengu.superPotato) +// true +``` + +## Pengu.plugins + + + + +An array of plugin entries. + +```js +console.log(Pengu.plugins) +// [ '@default/index.js', 'your-plugin/index.js' ] +``` \ No newline at end of file diff --git a/package.json b/package.json index 6efd057..9822119 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { - "name": "@penguloader/docs", + "name": "pengu-docs", "version": "1.0.6", "description": "Pengu Loader docs", "license": "MIT", - "main": "index.js", "type": "module", "scripts": { "dev": "vitepress dev", @@ -12,16 +11,17 @@ }, "devDependencies": { "@types/node": "^18.14.6", - "vitepress": "1.0.0-alpha.60", + "vitepress": "^1.0.0-beta.6", "vitepress-plugin-nprogress": "^0.0.4", "vitepress-plugin-tabs": "^0.2.0", - "vue": "^3.2.47" + "vue": "^3.3.4" }, "pnpm": { "peerDependencyRules": { "ignoreMissing": [ - "@algolia/client-search" + "@algolia/client-search", + "search-insights" ] } } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffa8fc7..53150d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -9,28 +9,47 @@ devDependencies: specifier: ^18.14.6 version: 18.14.6 vitepress: - specifier: 1.0.0-alpha.60 - version: 1.0.0-alpha.60(@types/node@18.14.6) + specifier: ^1.0.0-beta.6 + version: 1.0.0-beta.6(@types/node@18.14.6) vitepress-plugin-nprogress: specifier: ^0.0.4 version: 0.0.4 vitepress-plugin-tabs: specifier: ^0.2.0 - version: 0.2.0(vitepress@1.0.0-alpha.60)(vue@3.2.47) + version: 0.2.0(vitepress@1.0.0-beta.6)(vue@3.3.4) vue: - specifier: ^3.2.47 - version: 3.2.47 + specifier: ^3.3.4 + version: 3.3.4 packages: - /@algolia/autocomplete-core@1.7.4: - resolution: {integrity: sha512-daoLpQ3ps/VTMRZDEBfU8ixXd+amZcNJ4QSP3IERGyzqnL5Ch8uSRFt/4G8pUvW9c3o6GA4vtVv4I4lmnkdXyg==} + /@algolia/autocomplete-core@1.9.3(algoliasearch@4.17.0): + resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: - '@algolia/autocomplete-shared': 1.7.4 + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(algoliasearch@4.17.0) + '@algolia/autocomplete-shared': 1.9.3(algoliasearch@4.17.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + - search-insights + dev: true + + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(algoliasearch@4.17.0): + resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} + peerDependencies: + search-insights: '>= 1 < 3' + peerDependenciesMeta: + search-insights: + optional: true + dependencies: + '@algolia/autocomplete-shared': 1.9.3(algoliasearch@4.17.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch dev: true - /@algolia/autocomplete-preset-algolia@1.7.4(algoliasearch@4.17.0): - resolution: {integrity: sha512-s37hrvLEIfcmKY8VU9LsAXgm2yfmkdHT3DnA3SgHaY93yjZ2qL57wzb5QweVkYuEBZkT2PIREvRoLXC2sxTbpQ==} + /@algolia/autocomplete-preset-algolia@1.9.3(algoliasearch@4.17.0): + resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' @@ -38,12 +57,20 @@ packages: '@algolia/client-search': optional: true dependencies: - '@algolia/autocomplete-shared': 1.7.4 + '@algolia/autocomplete-shared': 1.9.3(algoliasearch@4.17.0) algoliasearch: 4.17.0 dev: true - /@algolia/autocomplete-shared@1.7.4: - resolution: {integrity: sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==} + /@algolia/autocomplete-shared@1.9.3(algoliasearch@4.17.0): + resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + peerDependenciesMeta: + '@algolia/client-search': + optional: true + dependencies: + algoliasearch: 4.17.0 dev: true /@algolia/cache-browser-local-storage@4.17.0: @@ -163,24 +190,25 @@ packages: to-fast-properties: 2.0.0 dev: true - /@docsearch/css@3.3.3: - resolution: {integrity: sha512-6SCwI7P8ao+se1TUsdZ7B4XzL+gqeQZnBc+2EONZlcVa0dVrk0NjETxozFKgMv0eEGH8QzP1fkN+A1rH61l4eg==} + /@docsearch/css@3.5.1: + resolution: {integrity: sha512-2Pu9HDg/uP/IT10rbQ+4OrTQuxIWdKVUEdcw9/w7kZJv9NeHS6skJx1xuRiFyoGKwAzcHXnLp7csE99sj+O1YA==} dev: true - /@docsearch/js@3.3.3: - resolution: {integrity: sha512-2xAv2GFuHzzmG0SSZgf8wHX0qZX8n9Y1ZirKUk5Wrdc+vH9CL837x2hZIUdwcPZI9caBA+/CzxsS68O4waYjUQ==} + /@docsearch/js@3.5.1: + resolution: {integrity: sha512-EXi8de5njxgP6TV3N9ytnGRLG9zmBNTEZjR4VzwPcpPLbZxxTLG2gaFyJyKiFVQxHW/DPlMrDJA3qoRRGEkgZw==} dependencies: - '@docsearch/react': 3.3.3 + '@docsearch/react': 3.5.1 preact: 10.13.2 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' - react - react-dom + - search-insights dev: true - /@docsearch/react@3.3.3: - resolution: {integrity: sha512-pLa0cxnl+G0FuIDuYlW+EBK6Rw2jwLw9B1RHIeS4N4s2VhsfJ/wzeCi3CWcs5yVfxLd5ZK50t//TMA5e79YT7Q==} + /@docsearch/react@3.5.1: + resolution: {integrity: sha512-t5mEODdLzZq4PTFAm/dvqcvZFdPDMdfPE5rJS5SC8OUq9mPzxEy6b+9THIqNM9P0ocCb4UC5jqBrxKclnuIbzQ==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' @@ -193,16 +221,17 @@ packages: react-dom: optional: true dependencies: - '@algolia/autocomplete-core': 1.7.4 - '@algolia/autocomplete-preset-algolia': 1.7.4(algoliasearch@4.17.0) - '@docsearch/css': 3.3.3 + '@algolia/autocomplete-core': 1.9.3(algoliasearch@4.17.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(algoliasearch@4.17.0) + '@docsearch/css': 3.5.1 algoliasearch: 4.17.0 transitivePeerDependencies: - '@algolia/client-search' + - search-insights dev: true - /@esbuild/android-arm64@0.17.19: - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} + /@esbuild/android-arm64@0.18.16: + resolution: {integrity: sha512-wsCqSPqLz+6Ov+OM4EthU43DyYVVyfn15S4j1bJzylDpc1r1jZFFfJQNfDuT8SlgwuqpmpJXK4uPlHGw6ve7eA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -210,8 +239,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.19: - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} + /@esbuild/android-arm@0.18.16: + resolution: {integrity: sha512-gCHjjQmA8L0soklKbLKA6pgsLk1byULuHe94lkZDzcO3/Ta+bbeewJioEn1Fr7kgy9NWNFy/C+MrBwC6I/WCug==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -219,8 +248,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.19: - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} + /@esbuild/android-x64@0.18.16: + resolution: {integrity: sha512-ldsTXolyA3eTQ1//4DS+E15xl0H/3DTRJaRL0/0PgkqDsI0fV/FlOtD+h0u/AUJr+eOTlZv4aC9gvfppo3C4sw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -228,8 +257,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.19: - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} + /@esbuild/darwin-arm64@0.18.16: + resolution: {integrity: sha512-aBxruWCII+OtluORR/KvisEw0ALuw/qDQWvkoosA+c/ngC/Kwk0lLaZ+B++LLS481/VdydB2u6tYpWxUfnLAIw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -237,8 +266,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.19: - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} + /@esbuild/darwin-x64@0.18.16: + resolution: {integrity: sha512-6w4Dbue280+rp3LnkgmriS1icOUZDyPuZo/9VsuMUTns7SYEiOaJ7Ca1cbhu9KVObAWfmdjUl4gwy9TIgiO5eA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -246,8 +275,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.19: - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} + /@esbuild/freebsd-arm64@0.18.16: + resolution: {integrity: sha512-x35fCebhe9s979DGKbVAwXUOcTmCIE32AIqB9CB1GralMIvxdnMLAw5CnID17ipEw9/3MvDsusj/cspYt2ZLNQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -255,8 +284,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.19: - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} + /@esbuild/freebsd-x64@0.18.16: + resolution: {integrity: sha512-YM98f+PeNXF3GbxIJlUsj+McUWG1irguBHkszCIwfr3BXtXZsXo0vqybjUDFfu9a8Wr7uUD/YSmHib+EeGAFlg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -264,8 +293,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.19: - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} + /@esbuild/linux-arm64@0.18.16: + resolution: {integrity: sha512-XIqhNUxJiuy+zsR77+H5Z2f7s4YRlriSJKtvx99nJuG5ATuJPjmZ9n0ANgnGlPCpXGSReFpgcJ7O3SMtzIFeiQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -273,8 +302,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.19: - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} + /@esbuild/linux-arm@0.18.16: + resolution: {integrity: sha512-b5ABb+5Ha2C9JkeZXV+b+OruR1tJ33ePmv9ZwMeETSEKlmu/WJ45XTTG+l6a2KDsQtJJ66qo/hbSGBtk0XVLHw==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -282,8 +311,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.19: - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} + /@esbuild/linux-ia32@0.18.16: + resolution: {integrity: sha512-no+pfEpwnRvIyH+txbBAWtjxPU9grslmTBfsmDndj7bnBmr55rOo/PfQmRfz7Qg9isswt1FP5hBbWb23fRWnow==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -291,8 +320,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.19: - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} + /@esbuild/linux-loong64@0.18.16: + resolution: {integrity: sha512-Zbnczs9ZXjmo0oZSS0zbNlJbcwKXa/fcNhYQjahDs4Xg18UumpXG/lwM2lcSvHS3mTrRyCYZvJbmzYc4laRI1g==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -300,8 +329,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.19: - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} + /@esbuild/linux-mips64el@0.18.16: + resolution: {integrity: sha512-YMF7hih1HVR/hQVa/ot4UVffc5ZlrzEb3k2ip0nZr1w6fnYypll9td2qcoMLvd3o8j3y6EbJM3MyIcXIVzXvQQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -309,8 +338,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.19: - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} + /@esbuild/linux-ppc64@0.18.16: + resolution: {integrity: sha512-Wkz++LZ29lDwUyTSEnzDaaP5OveOgTU69q9IyIw9WqLRxM4BjTBjz9un4G6TOvehWpf/J3gYVFN96TjGHrbcNQ==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -318,8 +347,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.19: - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} + /@esbuild/linux-riscv64@0.18.16: + resolution: {integrity: sha512-LFMKZ30tk78/mUv1ygvIP+568bwf4oN6reG/uczXnz6SvFn4e2QUFpUpZY9iSJT6Qpgstrhef/nMykIXZtZWGQ==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -327,8 +356,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.19: - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} + /@esbuild/linux-s390x@0.18.16: + resolution: {integrity: sha512-3ZC0BgyYHYKfZo3AV2/66TD/I9tlSBaW7eWTEIkrQQKfJIifKMMttXl9FrAg+UT0SGYsCRLI35Gwdmm96vlOjg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -336,8 +365,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.19: - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} + /@esbuild/linux-x64@0.18.16: + resolution: {integrity: sha512-xu86B3647DihHJHv/wx3NCz2Dg1gjQ8bbf9cVYZzWKY+gsvxYmn/lnVlqDRazObc3UMwoHpUhNYaZset4X8IPA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -345,8 +374,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.19: - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} + /@esbuild/netbsd-x64@0.18.16: + resolution: {integrity: sha512-uVAgpimx9Ffw3xowtg/7qQPwHFx94yCje+DoBx+LNm2ePDpQXHrzE+Sb0Si2VBObYz+LcRps15cq+95YM7gkUw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -354,8 +383,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.19: - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} + /@esbuild/openbsd-x64@0.18.16: + resolution: {integrity: sha512-6OjCQM9wf7z8/MBi6BOWaTL2AS/SZudsZtBziXMtNI8r/U41AxS9x7jn0ATOwVy08OotwkPqGRMkpPR2wcTJXA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -363,8 +392,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.19: - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} + /@esbuild/sunos-x64@0.18.16: + resolution: {integrity: sha512-ZoNkruFYJp9d1LbUYCh8awgQDvB9uOMZqlQ+gGEZR7v6C+N6u7vPr86c+Chih8niBR81Q/bHOSKGBK3brJyvkQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -372,8 +401,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.19: - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} + /@esbuild/win32-arm64@0.18.16: + resolution: {integrity: sha512-+j4anzQ9hrs+iqO+/wa8UE6TVkKua1pXUb0XWFOx0FiAj6R9INJ+WE//1/Xo6FG1vB5EpH3ko+XcgwiDXTxcdw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -381,8 +410,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.19: - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} + /@esbuild/win32-ia32@0.18.16: + resolution: {integrity: sha512-5PFPmq3sSKTp9cT9dzvI67WNfRZGvEVctcZa1KGjDDu4n3H8k59Inbk0du1fz0KrAbKKNpJbdFXQMDUz7BG4rQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -390,8 +419,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.19: - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} + /@esbuild/win32-x64@0.18.16: + resolution: {integrity: sha512-sCIVrrtcWN5Ua7jYXNG1xD199IalrbfV2+0k/2Zf2OyV2FtnQnMgdzgpRAbi4AWlKJj1jkX+M+fEGPQj6BQB4w==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -399,132 +428,186 @@ packages: dev: true optional: true + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + /@types/node@18.14.6: resolution: {integrity: sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==} dev: true - /@types/web-bluetooth@0.0.16: - resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + /@types/web-bluetooth@0.0.17: + resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} dev: true - /@vitejs/plugin-vue@4.2.3(vite@4.3.8)(vue@3.2.47): + /@vitejs/plugin-vue@4.2.3(vite@4.4.6)(vue@3.3.4): resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.3.8(@types/node@18.14.6) - vue: 3.2.47 + vite: 4.4.6(@types/node@18.14.6) + vue: 3.3.4 dev: true - /@vue/compiler-core@3.2.47: - resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==} + /@vue/compiler-core@3.3.4: + resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} dependencies: '@babel/parser': 7.21.4 - '@vue/shared': 3.2.47 + '@vue/shared': 3.3.4 estree-walker: 2.0.2 - source-map: 0.6.1 + source-map-js: 1.0.2 dev: true - /@vue/compiler-dom@3.2.47: - resolution: {integrity: sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==} + /@vue/compiler-dom@3.3.4: + resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} dependencies: - '@vue/compiler-core': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 dev: true - /@vue/compiler-sfc@3.2.47: - resolution: {integrity: sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==} + /@vue/compiler-sfc@3.3.4: + resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} dependencies: '@babel/parser': 7.21.4 - '@vue/compiler-core': 3.2.47 - '@vue/compiler-dom': 3.2.47 - '@vue/compiler-ssr': 3.2.47 - '@vue/reactivity-transform': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/compiler-core': 3.3.4 + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-ssr': 3.3.4 + '@vue/reactivity-transform': 3.3.4 + '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.25.9 - postcss: 8.4.23 - source-map: 0.6.1 + magic-string: 0.30.1 + postcss: 8.4.27 + source-map-js: 1.0.2 dev: true - /@vue/compiler-ssr@3.2.47: - resolution: {integrity: sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==} + /@vue/compiler-ssr@3.3.4: + resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} dependencies: - '@vue/compiler-dom': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/compiler-dom': 3.3.4 + '@vue/shared': 3.3.4 dev: true /@vue/devtools-api@6.5.0: resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} dev: true - /@vue/reactivity-transform@3.2.47: - resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==} + /@vue/reactivity-transform@3.3.4: + resolution: {integrity: sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==} dependencies: '@babel/parser': 7.21.4 - '@vue/compiler-core': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.25.9 + magic-string: 0.30.1 dev: true - /@vue/reactivity@3.2.47: - resolution: {integrity: sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==} + /@vue/reactivity@3.3.4: + resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} dependencies: - '@vue/shared': 3.2.47 + '@vue/shared': 3.3.4 dev: true - /@vue/runtime-core@3.2.47: - resolution: {integrity: sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==} + /@vue/runtime-core@3.3.4: + resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} dependencies: - '@vue/reactivity': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/reactivity': 3.3.4 + '@vue/shared': 3.3.4 dev: true - /@vue/runtime-dom@3.2.47: - resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==} + /@vue/runtime-dom@3.3.4: + resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} dependencies: - '@vue/runtime-core': 3.2.47 - '@vue/shared': 3.2.47 - csstype: 2.6.21 + '@vue/runtime-core': 3.3.4 + '@vue/shared': 3.3.4 + csstype: 3.1.2 dev: true - /@vue/server-renderer@3.2.47(vue@3.2.47): - resolution: {integrity: sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==} + /@vue/server-renderer@3.3.4(vue@3.3.4): + resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} peerDependencies: - vue: 3.2.47 + vue: 3.3.4 dependencies: - '@vue/compiler-ssr': 3.2.47 - '@vue/shared': 3.2.47 - vue: 3.2.47 + '@vue/compiler-ssr': 3.3.4 + '@vue/shared': 3.3.4 + vue: 3.3.4 + dev: true + + /@vue/shared@3.3.4: + resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} dev: true - /@vue/shared@3.2.47: - resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} + /@vueuse/core@10.2.1(vue@3.3.4): + resolution: {integrity: sha512-c441bfMbkAwTNwVRHQ0zdYZNETK//P84rC01aP2Uy/aRFCiie9NE/k9KdIXbno0eDYP5NPUuWv0aA/I4Unr/7w==} + dependencies: + '@types/web-bluetooth': 0.0.17 + '@vueuse/metadata': 10.2.1 + '@vueuse/shared': 10.2.1(vue@3.3.4) + vue-demi: 0.14.5(vue@3.3.4) + transitivePeerDependencies: + - '@vue/composition-api' + - vue dev: true - /@vueuse/core@9.13.0(vue@3.2.47): - resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} + /@vueuse/integrations@10.2.1(focus-trap@7.5.2)(vue@3.3.4): + resolution: {integrity: sha512-FDP5lni+z9FjHE9H3xuvwSjoRV9U8jmDvJpmHPCBjUgPGYRynwb60eHWXCFJXLUtb4gSIHy0e+iaEbrKdalCkQ==} + peerDependencies: + async-validator: '*' + axios: '*' + change-case: '*' + drauu: '*' + focus-trap: '*' + fuse.js: '*' + idb-keyval: '*' + jwt-decode: '*' + nprogress: '*' + qrcode: '*' + sortablejs: '*' + universal-cookie: '*' + peerDependenciesMeta: + async-validator: + optional: true + axios: + optional: true + change-case: + optional: true + drauu: + optional: true + focus-trap: + optional: true + fuse.js: + optional: true + idb-keyval: + optional: true + jwt-decode: + optional: true + nprogress: + optional: true + qrcode: + optional: true + sortablejs: + optional: true + universal-cookie: + optional: true dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(vue@3.2.47) - vue-demi: 0.14.0(vue@3.2.47) + '@vueuse/core': 10.2.1(vue@3.3.4) + '@vueuse/shared': 10.2.1(vue@3.3.4) + focus-trap: 7.5.2 + vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@9.13.0: - resolution: {integrity: sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==} + /@vueuse/metadata@10.2.1: + resolution: {integrity: sha512-3Gt68mY/i6bQvFqx7cuGBzrCCQu17OBaGWS5JdwISpMsHnMKKjC2FeB5OAfMcCQ0oINfADP3i9A4PPRo0peHdQ==} dev: true - /@vueuse/shared@9.13.0(vue@3.2.47): - resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} + /@vueuse/shared@10.2.1(vue@3.3.4): + resolution: {integrity: sha512-QWHq2bSuGptkcxx4f4M/fBYC3Y8d3M2UYyLsyzoPgEoVzJURQ0oJeWXu79OiLlBb8gTKkqe4mO85T/sf39mmiw==} dependencies: - vue-demi: 0.14.0(vue@3.2.47) + vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -557,44 +640,50 @@ packages: resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} dev: true - /csstype@2.6.21: - resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} + /csstype@3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true - /esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} + /esbuild@0.18.16: + resolution: {integrity: sha512-1xLsOXrDqwdHxyXb/x/SOyg59jpf/SH7YMvU5RNSU7z3TInaASNJWNFJ6iRvLvLETZMasF3d1DdZLg7sgRimRQ==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 + '@esbuild/android-arm': 0.18.16 + '@esbuild/android-arm64': 0.18.16 + '@esbuild/android-x64': 0.18.16 + '@esbuild/darwin-arm64': 0.18.16 + '@esbuild/darwin-x64': 0.18.16 + '@esbuild/freebsd-arm64': 0.18.16 + '@esbuild/freebsd-x64': 0.18.16 + '@esbuild/linux-arm': 0.18.16 + '@esbuild/linux-arm64': 0.18.16 + '@esbuild/linux-ia32': 0.18.16 + '@esbuild/linux-loong64': 0.18.16 + '@esbuild/linux-mips64el': 0.18.16 + '@esbuild/linux-ppc64': 0.18.16 + '@esbuild/linux-riscv64': 0.18.16 + '@esbuild/linux-s390x': 0.18.16 + '@esbuild/linux-x64': 0.18.16 + '@esbuild/netbsd-x64': 0.18.16 + '@esbuild/openbsd-x64': 0.18.16 + '@esbuild/sunos-x64': 0.18.16 + '@esbuild/win32-arm64': 0.18.16 + '@esbuild/win32-ia32': 0.18.16 + '@esbuild/win32-x64': 0.18.16 dev: true /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true + /focus-trap@7.5.2: + resolution: {integrity: sha512-p6vGNNWLDGwJCiEjkSK6oERj/hEyI9ITsSwIUICBoKLlWiTWXJRfQibCwcoi50rTZdbi87qDtUlMCmQwsGSgPw==} + dependencies: + tabbable: 6.2.0 + dev: true + /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -607,10 +696,19 @@ packages: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true - /magic-string@0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} + /magic-string@0.30.1: + resolution: {integrity: sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==} + engines: {node: '>=12'} dependencies: - sourcemap-codec: 1.4.8 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /mark.js@8.11.1: + resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + dev: true + + /minisearch@6.1.0: + resolution: {integrity: sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==} dev: true /nanoid@3.3.6: @@ -627,8 +725,8 @@ packages: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.27: + resolution: {integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -640,16 +738,16 @@ packages: resolution: {integrity: sha512-q44QFLhOhty2Bd0Y46fnYW0gD/cbVM9dUVtNTDKPcdXSMA7jfY+Jpd6rk3GB0lcQss0z5s/6CmVP0Z/hV+g6pw==} dev: true - /rollup@3.23.0: - resolution: {integrity: sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==} + /rollup@3.26.3: + resolution: {integrity: sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: fsevents: 2.3.2 dev: true - /shiki@0.14.2: - resolution: {integrity: sha512-ltSZlSLOuSY0M0Y75KA+ieRaZ0Trf5Wl3gutE7jzLuIcWxLp5i/uEnLoQWNvgKXQ5OMpGkJnVMRLAuzjc0LJ2A==} + /shiki@0.14.3: + resolution: {integrity: sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==} dependencies: ansi-sequence-parser: 1.1.0 jsonc-parser: 3.2.0 @@ -662,14 +760,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: true - - /sourcemap-codec@1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead + /tabbable@6.2.0: + resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} dev: true /to-fast-properties@2.0.0: @@ -677,13 +769,14 @@ packages: engines: {node: '>=4'} dev: true - /vite@4.3.8(@types/node@18.14.6): - resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==} + /vite@4.4.6(@types/node@18.14.6): + resolution: {integrity: sha512-EY6Mm8vJ++S3D4tNAckaZfw3JwG3wa794Vt70M6cNJ6NxT87yhq7EC8Rcap3ahyHdo8AhCmV9PTk+vG1HiYn1A==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -693,6 +786,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -703,9 +798,9 @@ packages: optional: true dependencies: '@types/node': 18.14.6 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 + esbuild: 0.18.16 + postcss: 8.4.27 + rollup: 3.26.3 optionalDependencies: fsevents: 2.3.2 dev: true @@ -716,41 +811,58 @@ packages: nprogress: 0.2.0 dev: true - /vitepress-plugin-tabs@0.2.0(vitepress@1.0.0-alpha.60)(vue@3.2.47): + /vitepress-plugin-tabs@0.2.0(vitepress@1.0.0-beta.6)(vue@3.3.4): resolution: {integrity: sha512-jTdtz4Z5fHllzcDAJaJK/bxE/2PhJSqetFUFgiB7xzw23O4yI+ntJrN+D3oP8XH/0559QUbrYd0K3YLoRaHbAA==} peerDependencies: vitepress: ^1.0.0-alpha.29 vue: ^3.2.45 dependencies: - vitepress: 1.0.0-alpha.60(@types/node@18.14.6) - vue: 3.2.47 + vitepress: 1.0.0-beta.6(@types/node@18.14.6) + vue: 3.3.4 dev: true - /vitepress@1.0.0-alpha.60(@types/node@18.14.6): - resolution: {integrity: sha512-GI5iLDkZRqGEPixbSloT+p6pbKcMh9ykRRxt8vf9AjV1gaPit6Stg/t9WNxTdIhKVCuQMexGs1605DNApSRK2A==} + /vitepress@1.0.0-beta.6(@types/node@18.14.6): + resolution: {integrity: sha512-xK/ulKgQpKZVbvlL4+/vW49VG7ySi5nmSoKUNH1G4kM+Cj9JwYM+PDJO7jSJROv8zW99G0ise+maDYnaLlbGBQ==} hasBin: true dependencies: - '@docsearch/css': 3.3.3 - '@docsearch/js': 3.3.3 - '@vitejs/plugin-vue': 4.2.3(vite@4.3.8)(vue@3.2.47) + '@docsearch/css': 3.5.1 + '@docsearch/js': 3.5.1 + '@vitejs/plugin-vue': 4.2.3(vite@4.4.6)(vue@3.3.4) '@vue/devtools-api': 6.5.0 - '@vueuse/core': 9.13.0(vue@3.2.47) + '@vueuse/core': 10.2.1(vue@3.3.4) + '@vueuse/integrations': 10.2.1(focus-trap@7.5.2)(vue@3.3.4) body-scroll-lock: 4.0.0-beta.0 - shiki: 0.14.2 - vite: 4.3.8(@types/node@18.14.6) - vue: 3.2.47 + focus-trap: 7.5.2 + mark.js: 8.11.1 + minisearch: 6.1.0 + shiki: 0.14.3 + vite: 4.4.6(@types/node@18.14.6) + vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' - '@types/react' - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode - less + - lightningcss + - nprogress + - qrcode - react - react-dom - sass + - search-insights + - sortablejs - stylus - sugarss - terser + - universal-cookie dev: true /vscode-oniguruma@1.7.0: @@ -761,8 +873,8 @@ packages: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true - /vue-demi@0.14.0(vue@3.2.47): - resolution: {integrity: sha512-gt58r2ogsNQeVoQ3EhoUAvUsH9xviydl0dWJj7dabBC/2L4uBId7ujtCwDRD0JhkGsV1i0CtfLAeyYKBht9oWg==} + /vue-demi@0.14.5(vue@3.3.4): + resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -773,15 +885,15 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.2.47 + vue: 3.3.4 dev: true - /vue@3.2.47: - resolution: {integrity: sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==} + /vue@3.3.4: + resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} dependencies: - '@vue/compiler-dom': 3.2.47 - '@vue/compiler-sfc': 3.2.47 - '@vue/runtime-dom': 3.2.47 - '@vue/server-renderer': 3.2.47(vue@3.2.47) - '@vue/shared': 3.2.47 + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-sfc': 3.3.4 + '@vue/runtime-dom': 3.3.4 + '@vue/server-renderer': 3.3.4(vue@3.3.4) + '@vue/shared': 3.3.4 dev: true From a8e7ac1a4bd3199e90a893ee7f4b9bae444e995e Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 13:50:23 +0700 Subject: [PATCH 03/17] =?UTF-8?q?=F0=9F=93=A6=20update=20to=20vitepress=20?= =?UTF-8?q?rc4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 ++++- pnpm-lock.yaml | 60 +++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 9822119..9a33ed6 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,14 @@ }, "devDependencies": { "@types/node": "^18.14.6", - "vitepress": "^1.0.0-beta.6", + "vitepress": "^1.0.0-rc.4", "vitepress-plugin-nprogress": "^0.0.4", "vitepress-plugin-tabs": "^0.2.0", "vue": "^3.3.4" }, + "engines": { + "node": ">=18" + }, "pnpm": { "peerDependencyRules": { "ignoreMissing": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53150d1..2387549 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,14 +9,14 @@ devDependencies: specifier: ^18.14.6 version: 18.14.6 vitepress: - specifier: ^1.0.0-beta.6 - version: 1.0.0-beta.6(@types/node@18.14.6) + specifier: ^1.0.0-rc.4 + version: 1.0.0-rc.4(@types/node@18.14.6) vitepress-plugin-nprogress: specifier: ^0.0.4 version: 0.0.4 vitepress-plugin-tabs: specifier: ^0.2.0 - version: 0.2.0(vitepress@1.0.0-beta.6)(vue@3.3.4) + version: 0.2.0(vitepress@1.0.0-rc.4)(vue@3.3.4) vue: specifier: ^3.3.4 version: 3.3.4 @@ -440,14 +440,14 @@ packages: resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} dev: true - /@vitejs/plugin-vue@4.2.3(vite@4.4.6)(vue@3.3.4): + /@vitejs/plugin-vue@4.2.3(vite@4.4.9)(vue@3.3.4): resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.6(@types/node@18.14.6) + vite: 4.4.9(@types/node@18.14.6) vue: 3.3.4 dev: true @@ -538,20 +538,20 @@ packages: resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} dev: true - /@vueuse/core@10.2.1(vue@3.3.4): - resolution: {integrity: sha512-c441bfMbkAwTNwVRHQ0zdYZNETK//P84rC01aP2Uy/aRFCiie9NE/k9KdIXbno0eDYP5NPUuWv0aA/I4Unr/7w==} + /@vueuse/core@10.3.0(vue@3.3.4): + resolution: {integrity: sha512-BEM5yxcFKb5btFjTSAFjTu5jmwoW66fyV9uJIP4wUXXU8aR5Hl44gndaaXp7dC5HSObmgbnR2RN+Un1p68Mf5Q==} dependencies: '@types/web-bluetooth': 0.0.17 - '@vueuse/metadata': 10.2.1 - '@vueuse/shared': 10.2.1(vue@3.3.4) + '@vueuse/metadata': 10.3.0 + '@vueuse/shared': 10.3.0(vue@3.3.4) vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/integrations@10.2.1(focus-trap@7.5.2)(vue@3.3.4): - resolution: {integrity: sha512-FDP5lni+z9FjHE9H3xuvwSjoRV9U8jmDvJpmHPCBjUgPGYRynwb60eHWXCFJXLUtb4gSIHy0e+iaEbrKdalCkQ==} + /@vueuse/integrations@10.3.0(focus-trap@7.5.2)(vue@3.3.4): + resolution: {integrity: sha512-Jgiv7oFyIgC6BxmDtiyG/fxyGysIds00YaY7sefwbhCZ2/tjEx1W/1WcsISSJPNI30in28+HC2J4uuU8184ekg==} peerDependencies: async-validator: '*' axios: '*' @@ -591,8 +591,8 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.2.1(vue@3.3.4) - '@vueuse/shared': 10.2.1(vue@3.3.4) + '@vueuse/core': 10.3.0(vue@3.3.4) + '@vueuse/shared': 10.3.0(vue@3.3.4) focus-trap: 7.5.2 vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: @@ -600,12 +600,12 @@ packages: - vue dev: true - /@vueuse/metadata@10.2.1: - resolution: {integrity: sha512-3Gt68mY/i6bQvFqx7cuGBzrCCQu17OBaGWS5JdwISpMsHnMKKjC2FeB5OAfMcCQ0oINfADP3i9A4PPRo0peHdQ==} + /@vueuse/metadata@10.3.0: + resolution: {integrity: sha512-Ema3YhNOa4swDsV0V7CEY5JXvK19JI/o1szFO1iWxdFg3vhdFtCtSTP26PCvbUpnUtNHBY2wx5y3WDXND5Pvnw==} dev: true - /@vueuse/shared@10.2.1(vue@3.3.4): - resolution: {integrity: sha512-QWHq2bSuGptkcxx4f4M/fBYC3Y8d3M2UYyLsyzoPgEoVzJURQ0oJeWXu79OiLlBb8gTKkqe4mO85T/sf39mmiw==} + /@vueuse/shared@10.3.0(vue@3.3.4): + resolution: {integrity: sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==} dependencies: vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: @@ -738,8 +738,8 @@ packages: resolution: {integrity: sha512-q44QFLhOhty2Bd0Y46fnYW0gD/cbVM9dUVtNTDKPcdXSMA7jfY+Jpd6rk3GB0lcQss0z5s/6CmVP0Z/hV+g6pw==} dev: true - /rollup@3.26.3: - resolution: {integrity: sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==} + /rollup@3.28.0: + resolution: {integrity: sha512-d7zhvo1OUY2SXSM6pfNjgD5+d0Nz87CUp4mt8l/GgVP3oBsPwzNvSzyu1me6BSG9JIgWNTVcafIXBIyM8yQ3yw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -769,8 +769,8 @@ packages: engines: {node: '>=4'} dev: true - /vite@4.4.6(@types/node@18.14.6): - resolution: {integrity: sha512-EY6Mm8vJ++S3D4tNAckaZfw3JwG3wa794Vt70M6cNJ6NxT87yhq7EC8Rcap3ahyHdo8AhCmV9PTk+vG1HiYn1A==} + /vite@4.4.9(@types/node@18.14.6): + resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -800,7 +800,7 @@ packages: '@types/node': 18.14.6 esbuild: 0.18.16 postcss: 8.4.27 - rollup: 3.26.3 + rollup: 3.28.0 optionalDependencies: fsevents: 2.3.2 dev: true @@ -811,32 +811,32 @@ packages: nprogress: 0.2.0 dev: true - /vitepress-plugin-tabs@0.2.0(vitepress@1.0.0-beta.6)(vue@3.3.4): + /vitepress-plugin-tabs@0.2.0(vitepress@1.0.0-rc.4)(vue@3.3.4): resolution: {integrity: sha512-jTdtz4Z5fHllzcDAJaJK/bxE/2PhJSqetFUFgiB7xzw23O4yI+ntJrN+D3oP8XH/0559QUbrYd0K3YLoRaHbAA==} peerDependencies: vitepress: ^1.0.0-alpha.29 vue: ^3.2.45 dependencies: - vitepress: 1.0.0-beta.6(@types/node@18.14.6) + vitepress: 1.0.0-rc.4(@types/node@18.14.6) vue: 3.3.4 dev: true - /vitepress@1.0.0-beta.6(@types/node@18.14.6): - resolution: {integrity: sha512-xK/ulKgQpKZVbvlL4+/vW49VG7ySi5nmSoKUNH1G4kM+Cj9JwYM+PDJO7jSJROv8zW99G0ise+maDYnaLlbGBQ==} + /vitepress@1.0.0-rc.4(@types/node@18.14.6): + resolution: {integrity: sha512-JCQ89Bm6ECUTnyzyas3JENo00UDJeK8q1SUQyJYou+4Yz5BKEc/F3O21cu++DnUT2zXc0kvQ2Aj4BZCc/nioXQ==} hasBin: true dependencies: '@docsearch/css': 3.5.1 '@docsearch/js': 3.5.1 - '@vitejs/plugin-vue': 4.2.3(vite@4.4.6)(vue@3.3.4) + '@vitejs/plugin-vue': 4.2.3(vite@4.4.9)(vue@3.3.4) '@vue/devtools-api': 6.5.0 - '@vueuse/core': 10.2.1(vue@3.3.4) - '@vueuse/integrations': 10.2.1(focus-trap@7.5.2)(vue@3.3.4) + '@vueuse/core': 10.3.0(vue@3.3.4) + '@vueuse/integrations': 10.3.0(focus-trap@7.5.2)(vue@3.3.4) body-scroll-lock: 4.0.0-beta.0 focus-trap: 7.5.2 mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.3 - vite: 4.4.6(@types/node@18.14.6) + vite: 4.4.9(@types/node@18.14.6) vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' From 1612a3c90391635b6792c63d121f1d522970c3b0 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 13:51:24 +0700 Subject: [PATCH 04/17] =?UTF-8?q?=F0=9F=94=A8=20add=20dev=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 46 +++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 679d5c0..7de62c8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,31 +1,59 @@ on: push: - branches: + branches: - main + - dev workflow_dispatch: jobs: + env-prod: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + environment: + name: production + url: https://pengu.lol + steps: + - run: echo >nul + + env-dev: + if: github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + environment: + name: development + url: https://beta.pengu.lol + steps: + - run: echo >nul + deploy: permissions: id-token: write contents: read runs-on: ubuntu-latest - environment: - name: production - url: https://pengu.lol steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set environment variables + run: | + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then + echo "DENO_DEPLOY_PROJECT=pengu-docs" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then + echo "DENO_DEPLOY_PROJECT=pengu-docs-dev" >> $GITHUB_ENV + fi - - uses: actions/setup-node@v3 + - name: Install NodeJS + uses: actions/setup-node@v3 with: node-version: 18.x - - uses: denoland/setup-deno@v1 + - name: Install Deno + uses: denoland/setup-deno@v1 with: deno-version: 1.x - - run: deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -r -f https://deno.land/x/deploy/deployctl.ts + - name: Install Deno deployctl + run: deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -r -f https://deno.land/x/deploy/deployctl.ts - name: Build project run: | @@ -36,4 +64,4 @@ jobs: - name: Deploy to Deno Deploy run: | cd .vitepress - deployctl deploy --prod --project=pengu-docs ./serve.ts --token ${{ secrets.DENO_DEPLOY_TOKEN }} + deployctl deploy --prod --project=$DENO_DEPLOY_PROJECT ./serve.ts --token ${{ secrets.DENO_DEPLOY_TOKEN }} From ad15842801a195372c97bcfa3cab317f731dcf39 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 15:44:54 +0700 Subject: [PATCH 05/17] =?UTF-8?q?=F0=9F=94=A5=20remove=20authcallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 1 - docs/runtime-api/auth-callback.md | 57 ------------------------------- 2 files changed, 58 deletions(-) delete mode 100644 docs/runtime-api/auth-callback.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 396bb35..27d5c2a 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -116,7 +116,6 @@ function sidebar() { items: [ { text: 'Overview', link: '/runtime-api/' }, { text: '[Pengu]', link: '/runtime-api/pengu' }, - { text: '[AuthCallback]', link: '/runtime-api/auth-callback' }, { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, ] diff --git a/docs/runtime-api/auth-callback.md b/docs/runtime-api/auth-callback.md deleted file mode 100644 index 4f06c99..0000000 --- a/docs/runtime-api/auth-callback.md +++ /dev/null @@ -1,57 +0,0 @@ -# ~~AuthCallback~~ - - - -This namespace helps you to create a callback URL and read its response from an -auth flow. - -## ~~AuthCallback.createURL~~ - - - - - -Create a unique callback URL that can be used for auth callback/redirect from -external web browsers. - -## ~~AuthCallback.readResponse~~ - - - - - -This function wait for response from a given callback URL. It returns a -`Promise` for async context, contains string if success or null when timeout. - -Parameters: - -- `url` - Callback URL created by `AuthCallback.createURL()`. -- `timeout` - Optional timeout in milliseconds, default is 180s. - -Callback URL supports **GET** request only, the response of this function could -be search params fullfilled by auth flow. - -Example: - -```js -async function requestUserAuth() { - const callbackURL = AuthCallback.createURL() - const requestAuth = 'https://.../?redirect_uri=' + - encodeURIComponent(callbackURL) - // Open in web browser - window.open(callbackURL) - - const response = await AuthCallback.readResponse(callbackURL) - if (response === null) { - console.log('timeout/fail') - } else { - console.log(response) - } - - // Should show UX to get back focus - fetch('/riotclient/ux-show', { method: 'POST' }) -} -``` - -See [spotify-gateway](https://github.com/LeagueLoader/spotify-gateway) example -to learn more. From 33a8acde4f0edf799c545b4e979933c25c9b0048 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 15:50:29 +0700 Subject: [PATCH 06/17] =?UTF-8?q?=F0=9F=A9=B9=20fix=20google=20analytics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/theme/analytics.ts | 4 +--- .vitepress/theme/index.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.vitepress/theme/analytics.ts b/.vitepress/theme/analytics.ts index 39ca6d6..1ef29e3 100644 --- a/.vitepress/theme/analytics.ts +++ b/.vitepress/theme/analytics.ts @@ -1,5 +1,3 @@ -/// - declare global { interface Window { dataLayer?: any[]; @@ -29,7 +27,7 @@ function mountGoogleAnalytics(id: string) { } export function vitepressGoogleAnalytics(id: string) { - if (import.meta.env.PROD && id && typeof window !== 'undefined') { + if (id && typeof window !== 'undefined') { mountGoogleAnalytics(id); } } \ No newline at end of file diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index bdd506d..7c3ea5c 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -2,6 +2,7 @@ import { h } from 'vue' import Theme from 'vitepress/theme' import './style.css' +import { vitepressGoogleAnalytics } from './analytics' export default { extends: Theme, @@ -11,6 +12,6 @@ export default { }) }, enhanceApp({ app, router, siteData }) { - // ... + vitepressGoogleAnalytics('G-KX1BWHTJ9S'); } } From ab5d8f1e66ad9199c824d3a374e860c16b2100e0 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 16:02:53 +0700 Subject: [PATCH 07/17] =?UTF-8?q?=E2=8F=AA=20take=20nprogress=20back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/theme/index.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 7c3ea5c..a7c527c 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -1,8 +1,13 @@ // https://vitepress.dev/guide/custom-theme -import { h } from 'vue' -import Theme from 'vitepress/theme' -import './style.css' -import { vitepressGoogleAnalytics } from './analytics' +import { h } from 'vue'; +import Theme from 'vitepress/theme'; +import type { EnhanceAppContext } from 'vitepress'; + +import { vitepressGoogleAnalytics } from './analytics'; +import vitepressNprogress from 'vitepress-plugin-nprogress'; + +import './style.css'; +import 'vitepress-plugin-nprogress/lib/css/index.css'; export default { extends: Theme, @@ -11,7 +16,8 @@ export default { // https://vitepress.dev/guide/extending-default-theme#layout-slots }) }, - enhanceApp({ app, router, siteData }) { + enhanceApp(ctx: EnhanceAppContext) { + vitepressNprogress(ctx); vitepressGoogleAnalytics('G-KX1BWHTJ9S'); } -} +} \ No newline at end of file From 68fb953e11ec4b1dabea9efc66dd62ca13c375d7 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 16:11:18 +0700 Subject: [PATCH 08/17] =?UTF-8?q?=F0=9F=93=9D=20update=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/runtime-api/effect.md | 4 ++-- docs/runtime-api/index.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/runtime-api/effect.md b/docs/runtime-api/effect.md index 5997dd5..3cd61cc 100644 --- a/docs/runtime-api/effect.md +++ b/docs/runtime-api/effect.md @@ -1,6 +1,6 @@ # Effect -This namespace supports changing window transparency effect. +This namespace supports changing window transparency/translucent effect.
@@ -26,7 +26,7 @@ console.log(Effect.current) ## Effect.apply(name, options?) - + A function that takes the name of the desired effect name and an optional object.
It returns a boolean indicating whether the effect was successfully diff --git a/docs/runtime-api/index.md b/docs/runtime-api/index.md index 117b3a6..9a5c6bf 100644 --- a/docs/runtime-api/index.md +++ b/docs/runtime-api/index.md @@ -21,6 +21,7 @@ window.openDevTools(true) // remote DevTools + Call this function to open the assets folder in new File Explorer window. @@ -85,9 +86,9 @@ window.getScriptPath() ## window.__llver - + - + This property returns the current version of Pengu Loader. From 7cf27500cca13266d008fc598ab8ac4344feded5 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 16:16:11 +0700 Subject: [PATCH 09/17] =?UTF-8?q?=F0=9F=93=A6=20set=20beta=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a33ed6..c6440d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pengu-docs", - "version": "1.0.6", + "version": "1.0.6-beta", "description": "Pengu Loader docs", "license": "MIT", "type": "module", From c6f63dfd5e38654735c7f6532652b7cd13af63ea Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Fri, 11 Aug 2023 17:04:33 +0700 Subject: [PATCH 10/17] =?UTF-8?q?=F0=9F=93=9D=20add=20rcp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 1 + docs/runtime-api/rcp.md | 139 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 docs/runtime-api/rcp.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 27d5c2a..eed00fb 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -118,6 +118,7 @@ function sidebar() { { text: '[Pengu]', link: '/runtime-api/pengu' }, { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, + { text: '[rcp]', link: '/runtime-api/rcp' }, ] }, { diff --git a/docs/runtime-api/rcp.md b/docs/runtime-api/rcp.md new file mode 100644 index 0000000..60d1343 --- /dev/null +++ b/docs/runtime-api/rcp.md @@ -0,0 +1,139 @@ +# Riot Client Pugin hooks + +## General usage + +This object provides easy access and hook to the Riot Client Plugin (RCP) system. + +Get the `rcp` in your plugin entry: + +```js +export function init(context) { + const rcp = context.rcp +} +``` + +Or get it globally via `window` object: + +```js +const rcp = window.rcp +``` + +## rcp.preInit(name, callback) + + + + +Register a callback that will be triggered before the target plugin loads. + +### Params + +- `name` - RCP name, should be prefixed with `rcp-`. +- `callback` - A function will be triggered before the plugin loads. + +Example: + +```js +rcp.preInit('rcp-name', (context) => { + // do something +}) +``` + +You can delay the plugin loads by blocking your async callback: + +```js +rcp.preInit('rcp-name', async () => { + // delay 2 seconds + await new Promise(r => setTimeout(r, 2000)) +}) +``` + +::: warning + +Do not pre-hook `rcp-fe-commom-libs`. It is used for the plugin loader, +so your callbacks sometimes will not triggered. + +::: + +## rcp.postInit(name, callback) + + + + +Register a callback that will be triggered after the target plugin is loaded. +Gives you an opportunity to access the plugin API. + +### Params + +- `name` - RCP name, should be prefixed with `rcp-`. +- `callback` - A function will be triggered after the plugin is loaded. + +Example: + +```js +rcp.postInit('rcp-name', (api) => { + // do something + console.log('got rcp-name:', api) +}) +``` + +::: tip + +`postInit` and `preInit` should be called before the target plugin loads, +preferably witin your plugin's `init` entry. So they will not work after the plugin is loaded. + +::: + +## rcp.whenInit(name) + + + + +This function works as same as `postInit` but allows you +to get the target plugin asynchronously and also works even after the plugin is loaded. + +Example with async context: + +```js +const uikit = await rcp.whenReady('rcp-fe-lol-uikit') +``` + +Or with .then chain: + +```js +rcp.whenReady('rcp-fe-lol-uikit') + .then(uikit => { + // do something + }) +``` + +With multiple plugins: + +```js +rcp.whenReady(['rcp-a', 'rcp-b', 'rcp-c']) + .then(([a, b, c]) => { + // do something + }) +``` + +## rcp.get(name) + + + + +Get a RCP plugin synchronously after it's registered in the callbacks map. + +Example: + +```js +// add to callbacks map +rcp.whenReady('rcp-name') + +// call it somewhere after ready +const api = rcp.get('rcp-name') +``` + +Common-libs always works: + +```js +rcp.get('rcp-fe-common-libs') +``` \ No newline at end of file From 4c59ea54ea00e46f799b4240f4b5b4dd84dc0ffd Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Sat, 12 Aug 2023 20:43:24 +0700 Subject: [PATCH 11/17] =?UTF-8?q?=F0=9F=93=9D=20add=20CommandBar=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 1 + docs/runtime-api/command-bar.md | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 docs/runtime-api/command-bar.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index eed00fb..1e95cf7 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -116,6 +116,7 @@ function sidebar() { items: [ { text: 'Overview', link: '/runtime-api/' }, { text: '[Pengu]', link: '/runtime-api/pengu' }, + { text: '[CommandBar]', link: '/runtime-api/command-bar' }, { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, { text: '[rcp]', link: '/runtime-api/rcp' }, diff --git a/docs/runtime-api/command-bar.md b/docs/runtime-api/command-bar.md new file mode 100644 index 0000000..6689331 --- /dev/null +++ b/docs/runtime-api/command-bar.md @@ -0,0 +1,70 @@ +# CommandBar + +Since v1.0.6, we bring to you a new Command Bar +that can provide access to app-level commands +and can be used with any navigation pattern. + +Let's press `Ctrl + K` to open the Command Bar. + +![](https://i.ibb.co/DWmwtSK/image.png) + +### Keyboard shortcuts: + +- Use arrow `Down` and `Up` to nagivate the selection. +- Press `Enter` or just click on an action to execute it. +- Press `ESC` to close the Command Bar. + +
+ +To add your custom actions, please use the APIs below. + +## CommandBar.addAction + + + + +```ts +function addAction(action: Action): void +``` + +Add a new action item to the Command Bar. It will automatically update even when showing. + +#### Params + +- `action`: An object that describes action information with these properties + +```ts +interface Action { + id?: string // (optional) an unique idetifier for the action + name: string // action's name + legend?: string // (optional) action's note/legend or shortcut key + tags?: string[] // (optional) tags or keywords to search + icon?: string // (optional) HTML tag in string + group?: string // (optional) group name + hidden?: boolean // (optional) hide the action, except for search results + perform?: (id?: string) => any // called when the action is executed +} +``` + +## CommandBar.show + + + + +```ts +function show(): void +``` + +Show the Command Bar programmatically if it was hidden. + +## CommandBar.update + + + + +```ts +function update(): void +``` + +Manually trigger the Command Bar to update its items. +Only use this function if your added actions are not updating. \ No newline at end of file From 4f72a114a168bec8f8cf8bb57039dcea50ae684e Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Sun, 13 Aug 2023 00:11:33 +0700 Subject: [PATCH 12/17] =?UTF-8?q?=F0=9F=94=A8=20add=20beta=20distinction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 13 +++++++++---- package.json | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 1e95cf7..7019962 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -1,15 +1,19 @@ import { defineConfig } from 'vitepress' import { join } from 'node:path' import pkg from '../package.json' +import { execSync } from 'node:child_process' + +const gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString().trimEnd() +const isBeta = gitBranch !== 'main' // https://vitepress.dev/reference/site-config export default defineConfig({ - title: "Pengu Loader", + title: "Pengu Loader" + (isBeta ? ' Beta' : ''), description: "Unleash the power of Customization from your League of Legends Client.", lang: 'en', - // appearance: 'dark', + appearance: isBeta ? undefined : 'dark', lastUpdated: true, cleanUrls: true, @@ -81,8 +85,9 @@ function nav() { activeMatch: '/runtime-api/' }, { - text: `v${pkg.version}`, - link: `https://github.com/PenguLoader/PenguLoader/releases/tag/v${pkg.version}` + text: `v${pkg.version}` + (isBeta ? '-beta' : ''), + link: isBeta ? 'https://github.com/PenguLoader/PenguLoader/actions' + : `https://github.com/PenguLoader/PenguLoader/releases/tag/v${pkg.version}` } ] } diff --git a/package.json b/package.json index c6440d9..9a33ed6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pengu-docs", - "version": "1.0.6-beta", + "version": "1.0.6", "description": "Pengu Loader docs", "license": "MIT", "type": "module", From 2493ec5d046e29f235f0b5624706c0db48bc1a0a Mon Sep 17 00:00:00 2001 From: BakaFT Date: Tue, 22 Aug 2023 10:00:12 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=F0=9F=93=9D=20add=20PluginFS=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 1 + docs/runtime-api/plugin-fs.md | 201 ++++++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 docs/runtime-api/plugin-fs.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 7019962..502b1d3 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -125,6 +125,7 @@ function sidebar() { { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, { text: '[rcp]', link: '/runtime-api/rcp' }, + { text: '[PluginFS]', link: '/runtime-api/plugin-fs' }, ] }, { diff --git a/docs/runtime-api/plugin-fs.md b/docs/runtime-api/plugin-fs.md new file mode 100644 index 0000000..b653e8a --- /dev/null +++ b/docs/runtime-api/plugin-fs.md @@ -0,0 +1,201 @@ +# PluginFS + +This API allows plugins to access **their own directory** and perform some basic file operations. + +::: warning + +**Top-level** plugin is not allowed since they don't own a directory. + +This API currently does not support calls in **remote** script. + +::: + +::: tip + +All paths passed into this API are relative to the root directory of your plugin. + +::: + +## PluginFS.read(path) + + + + +Read a file in text mode. + +### Params + +- `path` - The path of the file you want to access with respect to the plugin root directory. + +### Return value + +A `Promise` of the content string on success. + +A `Promise` of `undefined` on failure. + +### Example + +```javascript +PluginFS.read("./index.js").then( content => { + console.log(content) +}) + +const content = await PluginFs.read("./README.md") +``` + +## PluginFS.write(path,content,enableAppendMode?) + + + + +Write to a file in text mode. + +### Params + +- `path` - The path of the file you want to access with respect to the plugin root directory. +- `content` - The content string you want to write into. +- `enableAppendMode` - Append to file if set to `true` or overwrite file if `false`. This is `false` by default. + +### Return value + +A `Promise` of a boolean result indicating success or failure. + +### Example + +```javascript +// Create test.txt and write "Hello" into it +PluginFS.write("./test.txt","Hello").then( result => { + if(result){ + // success + }else{ + // fail + } +}) + +// Appending " World!" to it +const result = await PluginFs.write("./test.txt"," World!",true) +``` + +::: tip + +This API can create a file but can't create a file under a non-existing directory. + +::: + +## PluginFS.mkdir(path) + + + + +Create directories recursively. + +### Params + +`path` - The directory path you want to create with respect to the plugin root directory. + +### Return Value + +A `Promise` of a boolean result indicating success or failure. + +### Example + +```javascript +const bMkdir0 = await PluginFS.mkdir("utils") +const bMkdir1 = await PluginFS.mkdir("/a/b") +const bMkdir2 = await PluginFS.mkdir("/a\\c") +// false because it already exists +const bMkdir3 = await PluginFS.mkdir("a\\b/") +``` + +## PluginFS.stat(path) + + + + +Get the status of a file. + +### Params + +- `path` - The file path with respect to the plugin root directory. + +### Return value + +A `Promise` of `FileStat` or `undefined` depending on success or failure. + +```typescript +interface FileStat{ + fileName: string + // 0 if isDir is true + length: number + isDir: boolean +} +``` + +### Example + +```javascript +const stat1 = await PluginFS.stat("a/b") +if(stat1){ + console.log("it's a directory") +} +const stat2 = await PluginFS.stat("a/random.js") +``` + +## PluginFS.ls(path) + + + + +List files and directories under given path. + +### Params + +- `path` - The directory path with respect to the plugin root directory. + +### Return value + +A `Promise` of `Array` of file name strings on success. + +A `Promise` of `undefined` on failure. + +## PluginFS.rm(path,recursively?) + + + + +::: danger + +You should know what you are doing when using this. + +::: + +Remove file/directories. + +Just like `rm` command in Unix-like systems. + +### Params + +- `path` - The file/directory path with respect to the plugin root directory. +- `recursively` - Delete all files/directories under the give path recursively. This is `false` by default. + +### Return value + +A `Promise` of a `number` showing how many files and directories is deleted. + +When deleting with `recursively` set to `true`, the number value is sum of deleted `directories` and `files`. + +### Example + +You can only delete a non-empty directory with `recursively` set to `true` + +```javascript +// 1 +const bRm1 = await PluginFS.rm("./empty-dir") +// 1 +const bRm2 = await PluginFS.rm("./random-file-under-plugin-root") + +// bRm3 == 0 because it's not empty +const bRm3 = await PluginFS.rm("./non-empty-dir") +// bRm4 >= 1 with recursively set to true +const bRm4 = await PluginFS.rm("./non-empty-dir",true) +``` From 36fd15d8abe525f266188e67c385c3886024aaec Mon Sep 17 00:00:00 2001 From: BakaFT Date: Wed, 13 Sep 2023 15:28:25 +0800 Subject: [PATCH 14/17] new `path?` param of `openPluginsFolder` --- docs/runtime-api/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/runtime-api/index.md b/docs/runtime-api/index.md index 9a5c6bf..b110dc7 100644 --- a/docs/runtime-api/index.md +++ b/docs/runtime-api/index.md @@ -31,17 +31,20 @@ Example: window.openAssetsFolder() ``` -## window.openPluginsFolder() +## window.openPluginsFolder(path?) Call this function to open the plugins folder in new File Explorer window. +If `path` is given, it will open the path with respect to the plugins folder. + Example: ```js window.openPluginsFolder() +window.openPluginsFolder("/plugin-demo/config") ``` ## window.reloadClient() From 3581dcddc64db00b023ed085dcaecab56efdba90 Mon Sep 17 00:00:00 2001 From: BakaFT Date: Wed, 13 Sep 2023 15:30:48 +0800 Subject: [PATCH 15/17] new `blocking?` param of `rcp.postInit` --- docs/runtime-api/rcp.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/runtime-api/rcp.md b/docs/runtime-api/rcp.md index 60d1343..fdff41a 100644 --- a/docs/runtime-api/rcp.md +++ b/docs/runtime-api/rcp.md @@ -54,7 +54,7 @@ so your callbacks sometimes will not triggered. ::: -## rcp.postInit(name, callback) +## rcp.postInit(name, callback, blocking?) @@ -66,6 +66,7 @@ Gives you an opportunity to access the plugin API. - `name` - RCP name, should be prefixed with `rcp-`. - `callback` - A function will be triggered after the plugin is loaded. +- `blocking` - A boolean value indicating whether this callback will be executed in blocking way. It's `false` by default. Example: From 251290dc7a068226d5b903ca61eaa85b3e98b3b8 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Tue, 26 Sep 2023 18:19:23 +0000 Subject: [PATCH 16/17] =?UTF-8?q?=F0=9F=94=A8=20add=20Toast=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/config.ts | 1 + docs/runtime-api/toast.md | 89 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 docs/runtime-api/toast.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 502b1d3..4de87b1 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -126,6 +126,7 @@ function sidebar() { { text: '[Effect]', link: '/runtime-api/effect' }, { text: '[rcp]', link: '/runtime-api/rcp' }, { text: '[PluginFS]', link: '/runtime-api/plugin-fs' }, + { text: '[Toast]', link: '/runtime-api/toast' }, ] }, { diff --git a/docs/runtime-api/toast.md b/docs/runtime-api/toast.md new file mode 100644 index 0000000..e8ec936 --- /dev/null +++ b/docs/runtime-api/toast.md @@ -0,0 +1,89 @@ +# Toast + +This namespace is used to push your toast notifications onto the League Client screen. + +## Toast.success(message) + + + + +```ts +function success(message: string): void +``` + +Push a simple notification with a success checkmark. + +Params: + +- `message` a string to be shown on the notification. + +Example: + +```ts +Toast.success('Welcome to my theme!') +``` + +## Toast.error(message) + + + + +```ts +function error(message: string): void +``` + +Push a simple notification with a failure icon. + +Params: + +- `message` a string to be shown on the notification. + +Example: + +```ts +Toast.error('Oops! Something went wrong.') +``` + +## Toast.promise(promise, msg) + + + + +```ts +function promise(promise: Promise, msg: { + loading: string + success: string + error: string +}): Promise +``` + +Push a progress notification and wait for the given promise to complete. +This function returns the given promise that is helpful for then/catch chain. + +Params: + +- `promise` a promise that the progress waits for. +- `msg` an object with these properties: + - `loading` a string message to be shown when the progress starts loading. + - `success` a string to be shown when the promise is resolved. + - `error` a string to be shown when the promise is rejected. + +Example: + +```ts +let myTask = new Promise((resolve, reject) => { + // wait for 3s then fulfill randomly + setTimeout(() => { + if (Math.random() > 0.5) + resolve(10) + else + reject() + }, 3000) +}) + +Toast.promise(myTask, { + loading: 'Working in progress...', + success: 'Oh nice! 😎', + error: 'OOps! 😥' +}) +``` \ No newline at end of file From f427b5c3c4f2a06831d7ef66214ae59724fa3448 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Sun, 1 Oct 2023 07:46:52 +0700 Subject: [PATCH 17/17] bump v1.1.0 --- .vitepress/config.ts | 3 +- docs/guide/javascript-plugin.md | 26 ++++++++++++++- docs/guide/lcu-request.md | 6 ++++ docs/guide/module-system.md | 2 +- docs/runtime-api/command-bar.md | 8 ++--- docs/runtime-api/index.md | 4 +-- docs/runtime-api/pengu.md | 6 ++-- docs/runtime-api/plugin-fs.md | 12 +++---- docs/runtime-api/rcp.md | 8 ++--- docs/runtime-api/socket.md | 56 +++++++++++++++++++++++++++++++++ docs/runtime-api/toast.md | 6 ++-- package.json | 2 +- 12 files changed, 113 insertions(+), 26 deletions(-) create mode 100644 docs/runtime-api/socket.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 4de87b1..fe6e3ba 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -124,9 +124,10 @@ function sidebar() { { text: '[CommandBar]', link: '/runtime-api/command-bar' }, { text: '[DataStore]', link: '/runtime-api/data-store' }, { text: '[Effect]', link: '/runtime-api/effect' }, - { text: '[rcp]', link: '/runtime-api/rcp' }, { text: '[PluginFS]', link: '/runtime-api/plugin-fs' }, { text: '[Toast]', link: '/runtime-api/toast' }, + { text: '[rcp] context.rcp', link: '/runtime-api/rcp' }, + { text: 'context.socket', link: '/runtime-api/socket' }, ] }, { diff --git a/docs/guide/javascript-plugin.md b/docs/guide/javascript-plugin.md index 104c4b4..cd8b71f 100644 --- a/docs/guide/javascript-plugin.md +++ b/docs/guide/javascript-plugin.md @@ -54,10 +54,34 @@ in the DevTools and scroll to the top, you will see the output message. Hello, League Client! ``` +## Plugin entry points + + + +A plugin's entry point is an exported function in the plugin index that is called automatically by the loader. +The `init` entry should be called before League Client initializes its scripts. + +```js +export function init(context) { + // your code here +} +``` +- See [`context.rcp`](../runtime-api/rcp) to use RiotClientPlugin hooks from this `context`. +- See [`context.socket`](../runtime-api/socket.md) to use built-in socket observation. + +As of v1.1.0, you no longer need to put your load script in the `load` event of `window`. +Instead, you can put in the `load` entry, it will be called even after window is loaded. + +```js +export function load() { + // your code here +} +``` + ## Plugin templates To get started with ease, we have already provided base plugins, check it out: -https://github.com/PenguLoader/PenguLoader/tree/main/plugins +https://github.com/PenguLoader/PenguLoader/tree/v1.0.5/plugins ## What's next? diff --git a/docs/guide/lcu-request.md b/docs/guide/lcu-request.md index 25300c0..73f006a 100644 --- a/docs/guide/lcu-request.md +++ b/docs/guide/lcu-request.md @@ -95,6 +95,12 @@ Send `6` to unsubscribe from a specific API call, or `OnJsonApiEvent` for all. socket.send(JSON.stringify([6, ''])) ``` +::: tip + +Since v1.1.0, we have introduced [`context.socket`](../runtime-api/socket) to for easier socket observation. + +::: + ## Unauthenticated issue In some cases that the Ux loads faster than the LCU server, many API that diff --git a/docs/guide/module-system.md b/docs/guide/module-system.md index e473d2a..93dc4e4 100644 --- a/docs/guide/module-system.md +++ b/docs/guide/module-system.md @@ -158,7 +158,7 @@ console.log(config.enabled) // false ## TOML and YAML module -Since v1.0.6, TOML and YAML formats are supported. They are easy to read and +Since v1.1.0, TOML and YAML formats are supported. They are easy to read and solve the JSON brackets hell, as well as the trailing comma problem. ```js diff --git a/docs/runtime-api/command-bar.md b/docs/runtime-api/command-bar.md index 6689331..b0eae30 100644 --- a/docs/runtime-api/command-bar.md +++ b/docs/runtime-api/command-bar.md @@ -1,6 +1,6 @@ # CommandBar -Since v1.0.6, we bring to you a new Command Bar +Since v1.1.0, we bring to you a new Command Bar that can provide access to app-level commands and can be used with any navigation pattern. @@ -21,7 +21,7 @@ To add your custom actions, please use the APIs below. ## CommandBar.addAction - + ```ts function addAction(action: Action): void @@ -49,7 +49,7 @@ interface Action { ## CommandBar.show - + ```ts function show(): void @@ -60,7 +60,7 @@ Show the Command Bar programmatically if it was hidden. ## CommandBar.update - + ```ts function update(): void diff --git a/docs/runtime-api/index.md b/docs/runtime-api/index.md index b110dc7..8b50fd6 100644 --- a/docs/runtime-api/index.md +++ b/docs/runtime-api/index.md @@ -76,7 +76,7 @@ window.restartClient() ## window.getScriptPath() - + Call this function get the current script path. @@ -104,7 +104,7 @@ console.log(`You are using Pengu Loader v${window.__llver}`) ::: tip -Since v1.0.6, this property has been deprecated. +Since v1.1.0, this property has been deprecated. Please use `Pengu.version` instead. ::: \ No newline at end of file diff --git a/docs/runtime-api/pengu.md b/docs/runtime-api/pengu.md index 65ce64f..333a347 100644 --- a/docs/runtime-api/pengu.md +++ b/docs/runtime-api/pengu.md @@ -5,7 +5,7 @@ This namespace provides information about current Pengu version and its settings ## Pengu.version - + A read-only property that returns the current version of Pengu Loader. @@ -17,7 +17,7 @@ console.log(Pengu.version) ## Pengu.superPotato - + A boolean value that indicates the **Super Low Spec Mode** is enabled or not. @@ -29,7 +29,7 @@ console.log(Pengu.superPotato) ## Pengu.plugins - + An array of plugin entries. diff --git a/docs/runtime-api/plugin-fs.md b/docs/runtime-api/plugin-fs.md index b653e8a..d86c9f3 100644 --- a/docs/runtime-api/plugin-fs.md +++ b/docs/runtime-api/plugin-fs.md @@ -19,7 +19,7 @@ All paths passed into this API are relative to the root directory of your plugin ## PluginFS.read(path) - + Read a file in text mode. @@ -46,7 +46,7 @@ const content = await PluginFs.read("./README.md") ## PluginFS.write(path,content,enableAppendMode?) - + Write to a file in text mode. @@ -85,7 +85,7 @@ This API can create a file but can't create a file under a non-existing director ## PluginFS.mkdir(path) - + Create directories recursively. @@ -110,7 +110,7 @@ const bMkdir3 = await PluginFS.mkdir("a\\b/") ## PluginFS.stat(path) - + Get the status of a file. @@ -144,7 +144,7 @@ const stat2 = await PluginFS.stat("a/random.js") ## PluginFS.ls(path) - + List files and directories under given path. @@ -161,7 +161,7 @@ A `Promise` of `undefined` on failure. ## PluginFS.rm(path,recursively?) - + ::: danger diff --git a/docs/runtime-api/rcp.md b/docs/runtime-api/rcp.md index fdff41a..5ca4dca 100644 --- a/docs/runtime-api/rcp.md +++ b/docs/runtime-api/rcp.md @@ -21,7 +21,7 @@ const rcp = window.rcp ## rcp.preInit(name, callback) - + Register a callback that will be triggered before the target plugin loads. @@ -57,7 +57,7 @@ so your callbacks sometimes will not triggered. ## rcp.postInit(name, callback, blocking?) - + Register a callback that will be triggered after the target plugin is loaded. Gives you an opportunity to access the plugin API. @@ -87,7 +87,7 @@ preferably witin your plugin's `init` entry. So they will not work after the plu ## rcp.whenInit(name) - + This function works as same as `postInit` but allows you to get the target plugin asynchronously and also works even after the plugin is loaded. @@ -119,7 +119,7 @@ rcp.whenReady(['rcp-a', 'rcp-b', 'rcp-c']) ## rcp.get(name) - + Get a RCP plugin synchronously after it's registered in the callbacks map. diff --git a/docs/runtime-api/socket.md b/docs/runtime-api/socket.md new file mode 100644 index 0000000..4fb67ec --- /dev/null +++ b/docs/runtime-api/socket.md @@ -0,0 +1,56 @@ +# LCU Socket observation + +This namespace helps you to observe specific LCU APIs without creating a new WebSocket. +You cannot get it directly from `window`, instead use the context of the [`init` entry point](../guide/javascript-plugin#plugin-entry-points). + +## socket.observe(api, listener) + + + + +```ts +function observe( + api: string, + listener: ApiListener +): { disconnect: () => void } + +interface EventData { + data: any + uri: string + eventType: 'Create' | 'Update' | 'Delete' +} + +interface ApiListener { + (message: EventData): void +} +``` + +Subscribe a listener to listen when the given API endpoint get called. + +### Params: + +- `api` a string that presents a LCU API endpoint. +- `listener` a function that gets called with one data param. + +### Return value: + +An object with a prop `disconnect` that could be called to disconnect the observer. + +Example: + +```js +socket.observe('/lol-matchmaking/v1/ready-check', (data) => { + doAcceptReadyCheck() +}) +``` + +## socket.disconnect(api, listener) + + + + +```ts +function disconnect(api: string, listener: ApiListener) +``` + +Disconnect a subscribed listener. The function parameters like the function above. \ No newline at end of file diff --git a/docs/runtime-api/toast.md b/docs/runtime-api/toast.md index e8ec936..a10045e 100644 --- a/docs/runtime-api/toast.md +++ b/docs/runtime-api/toast.md @@ -5,7 +5,7 @@ This namespace is used to push your toast notifications onto the League Client s ## Toast.success(message) - + ```ts function success(message: string): void @@ -26,7 +26,7 @@ Toast.success('Welcome to my theme!') ## Toast.error(message) - + ```ts function error(message: string): void @@ -47,7 +47,7 @@ Toast.error('Oops! Something went wrong.') ## Toast.promise(promise, msg) - + ```ts function promise(promise: Promise, msg: { diff --git a/package.json b/package.json index 9a33ed6..8a9422c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pengu-docs", - "version": "1.0.6", + "version": "1.1.0", "description": "Pengu Loader docs", "license": "MIT", "type": "module",