@vnejs/docs 0.2.78 → 0.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,21 +32,21 @@ The package has two scenario entries. Compare them and pick one. Both link to `p
32
32
 
33
33
  ## Monorepo map
34
34
 
35
- | Directory | Role |
36
- | --------------------------------------------------- | ---------------------------------------- |
35
+ | Directory | Role |
36
+ | --------------------------------------------------- | ------------------------------------------ |
37
37
  | [`packages/`](./architecture/packages.md) | Runtime: `registry`, `observer`, `core`, … |
38
- | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
- | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
- | [`contracts/`](./architecture/contracts.md) | Public plugin API |
41
- | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
- | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
- | [`compatibility/`](./architecture/compatibility.md) | Link between plugins |
44
- | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
- | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
- | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
- | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
- | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
- | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
- | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
51
-
52
- A game imports one `bundles/` package and gets `VneCore`, the engine entry. Menu factories come from `@vnejs/shared.*` in the game script.
38
+ | [`modules_extensions/`](./architecture/modules.md) | Module base classes |
39
+ | [`configs/`](./architecture/configs.md) | Shared TypeScript configs |
40
+ | [`contracts/`](./architecture/contracts.md) | Public plugin API |
41
+ | [`shared/`](./architecture/shared.md) | Plugin setup presets |
42
+ | [`plugins/`](./architecture/plugins.md) | Behavior on the bus |
43
+ | [`compatibility/`](./architecture/compatibility.md) | Link between plugins |
44
+ | [`bundles/`](./architecture/bundles.md) | Plugin set for a game |
45
+ | [`helpers/`](./architecture/helpers.md) | Utils with no engine tie |
46
+ | [`uis/`](./architecture/uis.md) | React components for view plugins |
47
+ | [`cli/`](./architecture/cli.md) | Build the monorepo and the games |
48
+ | [`games/`](./architecture/games.md) | Game projects: scenario, entry, dist |
49
+ | [`backends/`](./architecture/backends.md) | Workers: Steam token and label JSON |
50
+ | [`vs_code_extensions/`](./architecture/editor.md) | `.vne` highlighting in the editor |
51
+
52
+ A game imports one `bundles/` package and gets `VneCore`, the engine entry. That bundle lists the matching `@vnejs/shared.*` package in `dependencies`. Menu factories still come from `@vnejs/shared.*` in the game script.
@@ -26,6 +26,7 @@ flowchart TD
26
26
  CT --> SH
27
27
  PL --> BD
28
28
  CP --> BD
29
+ SH --> BD
29
30
  BD --> EN
30
31
  SC --> CL
31
32
  CL -->|"data + client"| ART[dist/]
@@ -33,7 +34,7 @@ flowchart TD
33
34
  ART --> PLAY[Browser / Electron]
34
35
  ```
35
36
 
36
- 1. `bundles/` регистрирует `plugins/` и `compatibility/` в `VNE`. Фабрики из `shared/` импортирует скрипт игры.
37
+ 1. `bundles/` регистрирует `plugins/` и `compatibility/` в `VNE` и записывает соответствующий `@vnejs/shared.*` в `dependencies`. Фабрики из `shared/` импортирует скрипт игры.
37
38
  2. `cli/` собирает сценарий в JSON и клиент в `dist/`.
38
39
  3. `new VneCore().init()` — модули, media, lifecycle до `start`.
39
40
  4. Игра живёт на событиях шины; cross-plugin связи — через `compatibility/` из `bundles/`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  - Определяет **набор возможностей** для `games/`.
6
6
  - Экспортирует **`VneCore`**.
7
- - Фабрики из **`@vnejs/shared.*`** бандл не импортирует и не реэкспортирует. Их импортирует скрипт игры.
7
+ - Бандл, который включает плагин, записывает соответствующий **`@vnejs/shared.*`** в `dependencies`. Исходники фабрики не импортируют и не реэкспортируют. Их импортирует скрипт игры.
8
8
 
9
9
  ```mermaid
10
10
  flowchart BT
@@ -7,7 +7,8 @@ flowchart TD
7
7
  G -.->|HTTP| BE[backends/]
8
8
  B --> P[plugins/]
9
9
  B --> C[compatibility/]
10
- G --> SH[shared/]
10
+ B --> SH[shared/]
11
+ G --> SH
11
12
  SH --> CT[contracts/]
12
13
  P --> CT[contracts/]
13
14
  C --> CT
@@ -24,18 +25,19 @@ flowchart TD
24
25
 
25
26
  **Направление зависимостей:**
26
27
 
27
- | От | К | Смысл |
28
- | ---------------- | ----------------------------------- | -------------------------------------------------------- |
28
+ | От | К | Смысл |
29
+ | ---------------- | ----------------------------------- | -------------------------------------------------------------------------------------- |
29
30
  | `games/` | `bundles/`, `cli/`, `shared/` | Сборка через `cli/`. Фабрики `shared/` импортирует скрипт, без записи в `package.json` |
30
- | `games/` | `backends/` | HTTP к воркерам токена и меток, без импорта пакетов |
31
- | `bundles/` | `plugins/`, `compatibility/` | Набор плагинов. Фабрики `shared/` не реэкспортирует |
32
- | `shared/` | `contracts/` | Фабрики настройки читают события, не реализации |
33
- | `plugins/` | `contracts/` | Реализация следует объявленному API |
34
- | `plugins/` | `modules_extensions/` → `packages/` | Модули наследуют базы, базы опираются на registry/observer |
35
- | `compatibility/` | `contracts/` (2+) | Связка по событиям, без импорта реализаций |
36
- | `plugins/` | `helpers/`, `uis/` | Горизонтальные утилиты и UI |
37
- | `plugins/` | — другой `plugins/` | **Напрямую не зависит** |
38
- | `configs/` | пакеты workspace | Общие tsconfig, не runtime |
31
+ | `games/` | `backends/` | HTTP к воркерам токена и меток, без импорта пакетов |
32
+ | `bundles/` | `plugins/`, `compatibility/` | Набор плагинов |
33
+ | `bundles/` | `shared/` | `@vnejs/shared.*` в `dependencies` бандла с этим плагином. Фабрики не реэкспортирует |
34
+ | `shared/` | `contracts/` | Фабрики настройки читают события, не реализации |
35
+ | `plugins/` | `contracts/` | Реализация следует объявленному API |
36
+ | `plugins/` | `modules_extensions/` → `packages/` | Модули наследуют базы, базы опираются на registry/observer |
37
+ | `compatibility/` | `contracts/` (2+) | Связка по событиям, без импорта реализаций |
38
+ | `plugins/` | `helpers/`, `uis/` | Горизонтальные утилиты и UI |
39
+ | `plugins/` | — другой `plugins/` | **Напрямую не зависит** |
40
+ | `configs/` | пакеты workspace | Общие tsconfig, не runtime |
39
41
 
40
42
  ## Резюме
41
43
 
@@ -6,10 +6,11 @@
6
6
 
7
7
  ### Состав
8
8
 
9
- | Пакет | Назначение |
10
- | ---------------------------------------- | --------------------------------------------------------------------------------------------------- |
11
- | **`@vnejs/shared.views.screens.gamemenu`** | Функции пунктов игрового меню. Каждая возвращает `GameMenuItemFactory`. `locKey` обязателен. Необязательные `cbBefore` и `cbAfter` вызываются вокруг клика. |
12
- | **`@vnejs/shared.views.screens.mainmenu`** | Функции пунктов главного меню. Каждая возвращает `MainMenuItemFactory`. `locKey` обязателен. Необязательные `cbBefore` и `cbAfter` вызываются вокруг клика. |
9
+ | Пакет | Назначение |
10
+ | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | **`@vnejs/shared.views.screens.gamemenu`** | Функции пунктов игрового меню. Каждая возвращает `GameMenuItemFactory`. `locKey` обязателен. Необязательные `cbBefore` и `cbAfter` вызываются вокруг клика. |
12
+ | **`@vnejs/shared.views.screens.mainmenu`** | Функции пунктов главного меню. Каждая возвращает `MainMenuItemFactory`. `locKey` обязателен. Необязательные `cbBefore` и `cbAfter` вызываются вокруг клика. |
13
+ | **`@vnejs/shared.views.settings`** | Функции экшенов и полей настроек. Экшен с подтверждением принимает `locKey`, `locKeyAccept` и `locKeyDecline`. Без подтверждения вызывается без аргументов. `createFieldToggle` принимает `locKey` и `settingKey` и возвращает поле `toggle`. `createFieldRangeX` и `createFieldRangeS` принимают `locKey`, `settingKey`, `min`, `max`, `step` и необязательный `valueMap` и возвращают поле `range` с постфиксом `x` или `s`. `createFieldVolume` принимает `locKey` и `settingKey` и возвращает поле `range` от 0 до 100 с шагом 1 и постфиксом `%`. `createFieldQuality` принимает `locKey`, флажок на каждый ключ `CONST.LAYER.QUALITIES` и необязательный `optionsWidthModifier`. `createFieldFilter` принимает `locKey`, `optionsWidthModifier` и массив значений. Первым пунктом идёт пустое значение с ключом `locKey.off`. `createFieldLang` принимает `locKey` и массив значений. Пункт получает ключ `locKey` плюс точка и значение. `createFieldActions` принимает `locKey` и массив значений. Пункт получает ключ `locKey` плюс точка и значение, а `action` равен этому значению. |
13
14
 
14
15
  ```mermaid
15
16
  flowchart TD
@@ -22,6 +23,7 @@ flowchart TD
22
23
  G --> B
23
24
  G --> SH
24
25
  B --> P
26
+ B --> SH
25
27
  P --> CT
26
28
  SH --> CT
27
29
  ```
@@ -31,6 +33,6 @@ flowchart TD
31
33
  - Пакет импортирует **`@vnejs/registry`** и нужные **`contracts/`**. Реализации из **`plugins/`** не импортирует.
32
34
  - Один пакет может зависеть от нескольких контрактов: клик пункта связывает события разных плагинов.
33
35
  - Функция возвращает фабрику `(module) => item`. Она ничего не пишет в `VNE.PARAMS`.
34
- - Бандл регистрирует плагин и не реэкспортирует фабрики.
35
- - Игра импортирует `@vnejs/shared.*` в скрипте и сама собирает `PARAMS.ITEMS`. В `package.json` игры этой зависимости нет: пакет резолвится из workspace.
36
+ - Бандл, который зависит от плагина, записывает соответствующий `@vnejs/shared.*` в `dependencies`. Исходники бандла фабрики не импортируют и не реэкспортируют.
37
+ - Игра импортирует `@vnejs/shared.*` в скрипте и сама собирает `PARAMS.ITEMS`. В `package.json` игры этой зависимости нет.
36
38
  - **`plugins/`** пакеты **`shared/`** не импортируют.
@@ -0,0 +1,11 @@
1
+ # 0.2.79
2
+
3
+ - `shared/views/settings` — `createActionStateClear`, `createActionResetText`, `createActionResetSave`, and `createActionResetGallery` take `locKey`, `locKeyAccept`, and `locKeyDecline` and return a `SettingsAction` that emits `EVENTS.CONFIRM.EMIT`. Accept emits `EVENTS.STORAGE.CLEAR`, `EVENTS.FASTFORWARD.CLEAR`, `EVENTS.SAVE.CLEAR`, or `EVENTS.GALLERY.CLEAR`. `createActionStateExport`, `createActionStateImport`, `createActionLogsClear`, and `createActionLogsLoad` take no arguments and emit `EVENTS.STORAGE.EXPORT`, `EVENTS.STORAGE.IMPORT`, `EVENTS.LOGS.CLEAR`, and `EVENTS.LOGS.LOAD`.
4
+ - `shared/views/settings` — `createFieldToggle({ locKey, settingKey })` returns a `SettingsField`. `type` is `toggle`. `titleToggledLocKey` is `locKey` plus `.on`. `titleUntoggledLocKey` is `locKey` plus `.off`.
5
+ - `shared/views/settings` — `createFieldRangeX` and `createFieldRangeS` take `locKey`, `settingKey`, `min`, `max`, `step`, and optional `valueMap`. They return a `SettingsField` with `type` `range` and `valuePostfix` `x` or `s`.
6
+ - `shared/views/settings` — `createFieldVolume({ locKey, settingKey })` returns a `SettingsField` with `type` `range`, `min` `0`, `max` `100`, `step` `1`, and `valuePostfix` `%`.
7
+ - `shared/views/settings` — `createFieldQuality` takes `locKey`, a boolean for every key of `CONST.LAYER.QUALITIES`, and an optional `optionsWidthModifier`. It returns a `SettingsField` with `type` `selector_texts` and `settingKey` `SETTINGS.LAYER.QUALITY`. Enabled options are ordered from `nnHD` to `UHD`. The option text and value are the quality string, for example `1080p`.
8
+ - `shared/views/settings` — `createFieldFilter({ locKey, optionsWidthModifier, values })` returns a `SettingsField` with `type` `selector_texts` and `settingKey` `SETTINGS.FILTER.VALUE`. The first option is `{ locKey: locKey + ".off", value: "" }`. Each entry in `values` becomes `{ locKey: locKey + "." + value, value }`.
9
+ - `shared/views/settings` — `createFieldLang({ locKey, values })` returns a `SettingsField` with `type` `selector_texts` and `settingKey` `SETTINGS.LOCS.LANG`. Each entry in `values` becomes `{ locKey: locKey + "." + value, value }`.
10
+ - `text/locs` — `PARAMS.LOCS.LANGS` defaults to an empty list. A game fills it. `PARAMS.LOCS.DEFAULT_LANG` stays `"ru"`. Query `defaultLang` and `forceLang` are still accepted only when the value is in `PARAMS.LOCS.LANGS`.
11
+ - `shared/views/settings` — `createFieldActions({ locKey, values })` returns a `SettingsField` with `type` `actions`. Each entry in `values` becomes `{ locKey: locKey + "." + value, action: value }`.
@@ -0,0 +1,3 @@
1
+ # 0.2.80
2
+
3
+ - `bundles/vn.base` — depends on `@vnejs/shared.views.screens.gamemenu`, `@vnejs/shared.views.screens.mainmenu`, and `@vnejs/shared.views.settings`. The bundle does not import or re-export the factories. A game script still imports those packages. The game `package.json` still omits them.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Engine and public API changes. One file per `@vnejs/docs` release. Newest first.
4
4
 
5
+ - [0.2.80](./0.2.80.md)
6
+ - [0.2.79](./0.2.79.md)
5
7
  - [0.2.78](./0.2.78.md)
6
8
  - [0.2.77](./0.2.77.md)
7
9
  - [0.2.76](./0.2.76.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/docs",
3
- "version": "0.2.78",
3
+ "version": "0.2.80",
4
4
  "description": "VNEJS documentation for engine consumers and coding agents",
5
5
  "files": [
6
6
  "*.md",
@@ -28,7 +28,7 @@ None.
28
28
  | Key | Type | Meaning |
29
29
  | -------------- | ---------- | --------------------------------------------------------------------------------------- |
30
30
  | `DEFAULT_LANG` | `string` | Default: `"ru"`. |
31
- | `LANGS` | `string[]` | Query languages that are allowed. Default: `"ru"`, `"en"`. A game may replace the list. |
31
+ | `LANGS` | `string[]` | Query languages that are allowed. Default: empty. A game fills the list, for example `"ru"` and `"en"`. |
32
32
  | `GROUPS` | `object` | `VIEWS: "views"`, `LABELS: "labels"` — folders after `{lang}/`. |
33
33
 
34
34
  `LOCS.GET` / `LOCS.LOAD` require `group`. `TEXT.REPLACE` without `group` in the locs handler uses `GROUPS.LABELS`. View inject (`LOC_LABEL`) uses `GROUPS.VIEWS`.
@@ -4,6 +4,8 @@ Package: `@vnejs/plugins.views.settings` · namespace: `SETTINGS_VIEW`
4
4
 
5
5
  Settings field-list layer: render `<Settings />` and keyboard navigation across fields. Screens (`SETTINGS_SCREEN_VIEW`, `SETTINGS_DEFAULT_VIEW`) pass the active tab through `SHOW` / `TAB_SET` and hide through `HIDE`.
6
6
 
7
+ Action presets live in `@vnejs/shared.views.settings`. Each function returns a `SettingsAction`. A confirm action takes `locKey`, `locKeyAccept`, and `locKeyDecline`. An action without confirm takes no arguments. The game script imports those functions and assigns the results to `PARAMS.SETTINGS_VIEW.ACTIONS`. `createFieldToggle` takes `locKey` and `settingKey` and returns a `SettingsField` with `type` `toggle`. `titleToggledLocKey` is `locKey` plus `.on`. `titleUntoggledLocKey` is `locKey` plus `.off`. `createFieldRangeX` and `createFieldRangeS` take `locKey`, `settingKey`, `min`, `max`, and `step`, and an optional `valueMap`. They return a `SettingsField` with `type` `range` and `valuePostfix` `x` or `s`. `createFieldVolume` takes `locKey` and `settingKey` and returns a `SettingsField` with `type` `range`, `min` `0`, `max` `100`, `step` `1`, and `valuePostfix` `%`. `createFieldQuality` takes `locKey`, a boolean flag for every `CONST.LAYER.QUALITIES` key, and an optional `optionsWidthModifier`. It returns a `selector_texts` field for `SETTINGS.LAYER.QUALITY`. Enabled options run from `nnHD` to `UHD`. `createFieldFilter` takes `locKey`, `optionsWidthModifier`, and filter values such as `grayscale`. It returns a `selector_texts` field for `SETTINGS.FILTER.VALUE`. The first option is `locKey` plus `.off` with value `""`. Each value becomes an option `locKey` plus `.` plus the value. `createFieldLang` takes `locKey` and language values such as `ru`. It returns a `selector_texts` field for `SETTINGS.LOCS.LANG`. Each value becomes an option `locKey` plus `.` plus the value. `createFieldActions` takes `locKey` and action values. It returns an `actions` field. Each value becomes an option `locKey` plus `.` plus the value, and the option `action` is that value.
8
+
7
9
  ## Events
8
10
 
9
11
  Handler payloads and results are typed through module augmentation of the contract (`VneEventPayloadMap` / `VneEventResultMap`). The types live in `@vnejs/contracts.views.settings`.