@retailcrm/embed-ui-v1-endpoint 0.9.23 → 0.9.24
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 +1 -0
- package/bin/embed-ui-v1-endpoint.mjs +5 -3
- package/docs/README.md +1 -0
- package/docs/layout.md +11 -5
- package/docs/menu-placements.md +33 -1
- package/docs/page-routes.md +24 -2
- package/docs/targets/customer-card-communications-after.yml +2 -0
- package/docs/targets/customer-card-inwork-after.yml +2 -0
- package/docs/targets/customer-card-inwork-before.yml +2 -0
- package/docs/targets/customer-card-phone.yml +2 -0
- package/docs/targets/order-card-comment-manager-before.yml +2 -0
- package/docs/targets/order-card-common-after.yml +2 -0
- package/docs/targets/order-card-common-before.yml +2 -0
- package/docs/targets/order-card-customer-after.yml +2 -0
- package/docs/targets/order-card-customer-before.yml +2 -0
- package/docs/targets/order-card-customer-email.yml +2 -0
- package/docs/targets/order-card-customer-phone.yml +2 -0
- package/docs/targets/order-card-delivery-address.yml +2 -0
- package/docs/targets/order-card-delivery-after.yml +2 -0
- package/docs/targets/order-card-delivery-before.yml +2 -0
- package/docs/targets/order-card-dimensions-before.yml +2 -0
- package/docs/targets/order-card-list-after.yml +2 -0
- package/docs/targets/order-card-list-before.yml +2 -0
- package/docs/targets/order-card-payment-before.yml +2 -0
- package/docs/targets/order-card-store-before.yml +2 -0
- package/docs/targets/order-mg-delivery-after.yml +2 -0
- package/docs/targets/order-mg-delivery-before.yml +2 -0
- package/docs/targets/order-mg-list-after.yml +2 -0
- package/docs/targets/order-mg-list-before.yml +2 -0
- package/docs/targets/order-mg-payment-after.yml +2 -0
- package/docs/targets/order-mg-payment-before.yml +2 -0
- package/docs/targets.md +15 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ runEndpoint(runner)
|
|
|
41
41
|
- [`createEndpoint`](./docs/create-endpoint.md) — как вручную создать endpoint с transport и messenger.
|
|
42
42
|
- [`runEndpoint`](./docs/run-endpoint.md) — как поднять endpoint в точке входа веб-воркера одной строкой.
|
|
43
43
|
- [`targets` и `defineTarget`](./docs/targets.md) — как типизировать цели виджетов и маршрутизировать их по target.
|
|
44
|
+
- `@retailcrm/embed-ui-v1-components` `docs/profiles/widgets/WidgetComposition.yml` — как оформлять inline UI виджетов и когда уносить сложность в modal/sidebar.
|
|
44
45
|
- [`menu-placements`](./docs/menu-placements.md) — как описывать меню и пункты навигации для встраиваемых страниц.
|
|
45
46
|
- [`page-routes`](./docs/page-routes.md) — как связывать page `code`, CRM-маршрут и `definePageRunner`.
|
|
46
47
|
- [`layout`](./docs/layout.md) — как выбирать паттерны компоновки страниц, `modal sidebar` и `modal window`, и из каких `v1-components` их собирать.
|
|
@@ -157,9 +157,11 @@ When working with \`${PACKAGE_NAME}\` in this project:
|
|
|
157
157
|
5. When the task involves widget targets, target placement, target contexts, target metadata, or choosing a target, use the package MCP server if it is available.
|
|
158
158
|
6. First read \`embed-ui-v1-endpoint://targets\` to discover available target profiles.
|
|
159
159
|
7. Then read the relevant \`embed-ui-v1-endpoint://targets/<encoded-target>\` resource before answering or changing code related to that target.
|
|
160
|
-
8.
|
|
161
|
-
9. If
|
|
162
|
-
10.
|
|
160
|
+
8. For widget UI composition, keep inline target content compact: prefer \`UiToolbarButton\`, \`UiToolbarLink\`, short text, and icons; move complex UI into \`UiModalSidebar\` or \`UiModalWindow\`.
|
|
161
|
+
9. If \`@retailcrm/embed-ui-v1-components\` is installed, read its widget composition docs before building widget UI.
|
|
162
|
+
10. A project \`.mcp.json\` may require restarting or reconnecting the AI client before MCP resources appear in the current session.
|
|
163
|
+
11. If MCP resources are not available, use the generated YAML profiles from \`./node_modules/${PACKAGE_NAME}/docs/targets/*.yml\` as the fallback source.
|
|
164
|
+
12. Prefer target profiles over guessing target placement, contexts, or semantic intent from names alone.
|
|
163
165
|
|
|
164
166
|
Suggested MCP stdio server configuration:
|
|
165
167
|
|
package/docs/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
- [`targets` и `defineTarget`](./targets.md) — типизированные цели для виджетов.
|
|
16
16
|
- [`targets/*.yml`](./targets/) — сгенерированные AI-friendly описания встроенных widget targets на английском.
|
|
17
|
+
- `@retailcrm/embed-ui-v1-components` `docs/profiles/widgets/WidgetComposition.yml` — как оформлять inline UI виджетов и когда уносить сложность в modal/sidebar.
|
|
17
18
|
- MCP-сервер `embed-ui-v1-endpoint-mcp` — поставляемый stdio server, который отдаёт `targets/*.yml` как MCP resources.
|
|
18
19
|
- [`menu-placements`](./menu-placements.md) — как описывать меню и пункты навигации, из которых открываются встраиваемые страницы.
|
|
19
20
|
- [`page-routes`](./page-routes.md) — как связывать page `code`, CRM-маршрут и `definePageRunner`.
|
package/docs/layout.md
CHANGED
|
@@ -47,10 +47,14 @@
|
|
|
47
47
|
|
|
48
48
|
### Кнопки
|
|
49
49
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
50
|
+
- В рамках всей страницы допускается максимум по одной page-level `primary`-кнопке каждого варианта: `Success Primary`, `Default Primary` и `Danger Primary`.
|
|
51
|
+
- `Success Primary` — главное call-to-action страницы: действие, которое создаёт или фиксирует результат, например `Сохранить`, `Применить`, `Создать`. Обычно оно находится в `UiPageFooter`.
|
|
52
|
+
- Если важное действие не является главным commit-действием, используйте `Default Primary`.
|
|
53
|
+
- `Danger Primary` допустим только для одного критичного деструктивного действия.
|
|
54
|
+
- Если важных действий несколько, выберите главное и оформите его как `Success Primary`; остальные переводите в `Default Primary`, `Default Secondary`, `Default Tertiary`, `Success Secondary` или другой менее доминирующий вариант по смыслу.
|
|
55
|
+
- `UiPageHeader` и `UiPageFooter` относятся к одному page-level scope: `UiPageFooter` не сбрасывает лимит сам по себе.
|
|
56
|
+
- Только `UiCollapseBox` с собственным footer создаёт локальный scope: внутри каждого блока может быть одна `Default Primary` для главного действия этой секции.
|
|
57
|
+
- Если действий много, оставьте видимыми только действительно важные, а остальные уводите во вторичный слой или dropdown.
|
|
54
58
|
|
|
55
59
|
Типичная компонентная основа:
|
|
56
60
|
|
|
@@ -207,6 +211,7 @@
|
|
|
207
211
|
- Если на странице используются `Collapse`-блоки, дополнительная общая белая подложка вокруг них обычно не нужна.
|
|
208
212
|
- Если подложка видна только ради пары collapse-блоков, от неё следует отказаться.
|
|
209
213
|
- Обычно и общая нижняя панель сохранения не нужна, потому что каждый блок сохраняется отдельно.
|
|
214
|
+
- Каждый `UiCollapseBox` с footer работает как локальная “мини-страница”: в его footer можно использовать одну `Default Primary` кнопку для главного действия секции, а остальные действия оформлять менее доминирующе.
|
|
210
215
|
|
|
211
216
|
### Типичный состав
|
|
212
217
|
|
|
@@ -247,6 +252,7 @@
|
|
|
247
252
|
- `UiModalSidebar` как контейнер `modal sidebar`.
|
|
248
253
|
- Внутри: обычные form/content primitives из `v1-components`.
|
|
249
254
|
- В `footer`: `UiButton` для сохранения, закрытия и удаления.
|
|
255
|
+
- Главное действие сохранения или применения в `footer` обычно оформляется как `Success Primary`; соседние действия должны быть менее доминирующими, если они не являются самостоятельным `Default Primary` или `Danger Primary` по смыслу.
|
|
250
256
|
|
|
251
257
|
### Типичный состав
|
|
252
258
|
|
|
@@ -329,7 +335,7 @@
|
|
|
329
335
|
2. Это список, карточка, карточка с колонками или collapse-настройки?
|
|
330
336
|
3. Нужны ли tabs, или блоки следует оставить на одном полотне?
|
|
331
337
|
4. Нужна ли общая панель сохранения, или каждый блок должен сохраняться отдельно?
|
|
332
|
-
5.
|
|
338
|
+
5. Есть ли на странице не больше одного page-level `primary`-действия каждого варианта, а дополнительные `Default Primary` находятся только внутри отдельных `UiCollapseBox`?
|
|
333
339
|
6. Держатся ли отступы и расстояния сетки `4px`?
|
|
334
340
|
|
|
335
341
|
---
|
package/docs/menu-placements.md
CHANGED
|
@@ -29,6 +29,38 @@
|
|
|
29
29
|
| `route` | Имя или путь CRM-маршрута, если пункт открывается через маршрутизацию host-части. |
|
|
30
30
|
| `visibility` | Условия показа: права, настройки, тариф, доступность фичи. |
|
|
31
31
|
|
|
32
|
+
## Manifest `pages`
|
|
33
|
+
|
|
34
|
+
В `extensionrc.json` и payload для RetailCRM API страницы нужно описывать объектами `ConfigurationPage`,
|
|
35
|
+
а не строками. Строковый список page codes достаточен только для runtime runner map на фронтенде; backend API
|
|
36
|
+
и меню страницы ожидают метаданные пункта меню.
|
|
37
|
+
|
|
38
|
+
Минимальная рабочая форма:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"pages": [
|
|
43
|
+
{
|
|
44
|
+
"code": "orders-dashboard",
|
|
45
|
+
"menu": "activity_main_menu",
|
|
46
|
+
"parentMenuItemCode": "orders",
|
|
47
|
+
"menuItemOrdering": 100,
|
|
48
|
+
"menuItemTitle": {
|
|
49
|
+
"ru": "Заказы",
|
|
50
|
+
"en": "Orders",
|
|
51
|
+
"es": "Pedidos"
|
|
52
|
+
},
|
|
53
|
+
"pageHelpLink": null
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`menu` обязателен для опубликованной страницы: без него backend не сможет открыть route вида
|
|
60
|
+
`/modules/<module-code>/<page-code>`. Для страниц в разделе настроек обычно используется
|
|
61
|
+
`menu: "private_main_menu"` и `parentMenuItemCode: "settings"`. Для страниц в разделе продаж используйте
|
|
62
|
+
`menu: "activity_main_menu"` и соответствующий parent menu item, например `orders`.
|
|
63
|
+
|
|
32
64
|
## Пример справочника меню
|
|
33
65
|
|
|
34
66
|
Конкретные `placement`, `item code` и `route` нужно брать из host/manifest расширения.
|
|
@@ -66,4 +98,4 @@ const pageRunner = definePageRunner({
|
|
|
66
98
|
- [`definePageRunner`](./define-page-runner.md) — как встраиваемая страница получает `code`.
|
|
67
99
|
- [`targets`](./targets.md) — точки встраивания виджетов, не пунктов меню.
|
|
68
100
|
- [`layout`](./layout.md) — когда делать полноценную страницу, а когда `modal sidebar` или `modal window`.
|
|
69
|
-
-
|
|
101
|
+
- `@retailcrm/embed-ui-v1-components` `docs/profiles/components/UiMenuItem.yml` — компонент строки меню внутри UI расширения.
|
package/docs/page-routes.md
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
host/manifest конкретного расширения, поэтому его нужно хранить в справочнике проекта рядом с кодом
|
|
8
8
|
расширения.
|
|
9
9
|
|
|
10
|
+
В runtime-коде `definePageRunner` сопоставляет page `code` с Vue-компонентом. В `extensionrc.json` этот же
|
|
11
|
+
page `code` нужно описывать объектом manifest `pages[]` с `menu` и, обычно, `menuItemTitle`. Не используйте
|
|
12
|
+
строковую форму `pages: ["orders-dashboard"]` для публикации через RetailCRM API: backend ожидает
|
|
13
|
+
`ConfigurationPage` object, а страница без `menu` не откроется по route `/modules/<module-code>/<page-code>`.
|
|
14
|
+
|
|
10
15
|
## Что такое `page code`
|
|
11
16
|
|
|
12
17
|
`page code` — стабильный идентификатор встраиваемой страницы внутри расширения.
|
|
@@ -59,6 +64,23 @@ console.log(settings['system.routing'].routes)
|
|
|
59
64
|
| `integration-settings` | `embed.page.integration_settings` | `{}` | `settings / integration-settings` | `IntegrationSettingsPage.vue` |
|
|
60
65
|
| `customer-tools` | `embed.page.customer_tools` | `{ customerId }` | `customer/card:actions / customer-tools` | `CustomerToolsPage.vue` |
|
|
61
66
|
|
|
67
|
+
Пример manifest-записи для страницы:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"code": "orders-dashboard",
|
|
72
|
+
"menu": "activity_main_menu",
|
|
73
|
+
"parentMenuItemCode": "orders",
|
|
74
|
+
"menuItemOrdering": 100,
|
|
75
|
+
"menuItemTitle": {
|
|
76
|
+
"ru": "Заказы",
|
|
77
|
+
"en": "Orders",
|
|
78
|
+
"es": "Pedidos"
|
|
79
|
+
},
|
|
80
|
+
"pageHelpLink": null
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
62
84
|
## Переход на CRM-маршрут
|
|
63
85
|
|
|
64
86
|
Если странице нужен переход на другой CRM-маршрут, используйте host API, а не прямую сборку URL.
|
|
@@ -76,5 +98,5 @@ const openSettings = (host: HostApi) => {
|
|
|
76
98
|
|
|
77
99
|
- [`menu-placements`](./menu-placements.md) — как связать пункт меню, page `code` и маршрут.
|
|
78
100
|
- [`definePageRunner`](./define-page-runner.md) — как page `code` попадает в компонент.
|
|
79
|
-
-
|
|
80
|
-
-
|
|
101
|
+
- `@retailcrm/embed-ui-v1-contexts` `docs/ru/CONCEPT.md` — общий принцип работы контекстов.
|
|
102
|
+
- `@retailcrm/embed-ui-v1-types` `host.d.ts` — публичный тип host API с `goTo`.
|
|
@@ -56,6 +56,8 @@ avoid_when:
|
|
|
56
56
|
|
|
57
57
|
ai_notes:
|
|
58
58
|
- "Use the target id as the runner registration key."
|
|
59
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
60
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
59
61
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
60
62
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
61
63
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -56,6 +56,8 @@ avoid_when:
|
|
|
56
56
|
|
|
57
57
|
ai_notes:
|
|
58
58
|
- "Use the target id as the runner registration key."
|
|
59
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
60
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
59
61
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
60
62
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
61
63
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -56,6 +56,8 @@ avoid_when:
|
|
|
56
56
|
|
|
57
57
|
ai_notes:
|
|
58
58
|
- "Use the target id as the runner registration key."
|
|
59
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
60
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
59
61
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
60
62
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
61
63
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -59,6 +59,8 @@ avoid_when:
|
|
|
59
59
|
|
|
60
60
|
ai_notes:
|
|
61
61
|
- "Use the target id as the runner registration key."
|
|
62
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
63
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
62
64
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
63
65
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
64
66
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
|
@@ -62,6 +62,8 @@ avoid_when:
|
|
|
62
62
|
|
|
63
63
|
ai_notes:
|
|
64
64
|
- "Use the target id as the runner registration key."
|
|
65
|
+
- "Keep UI rendered directly in the widget target compact and predictable: prefer UiToolbarButton, UiToolbarLink, short text, and icons."
|
|
66
|
+
- "Move complex widget UI such as forms, tables, maps, filters, summaries, and multi-step flows into UiModalSidebar or UiModalWindow."
|
|
65
67
|
- "Use targets[target].contexts as the source of truth for context availability."
|
|
66
68
|
- "Read linked context_resources, action_resources, and custom_context_resources before reasoning about fields, mutations, or custom data."
|
|
67
69
|
- "Do not infer context field shape from the target id, page name, or widget placement."
|
package/docs/targets.md
CHANGED
|
@@ -24,6 +24,19 @@
|
|
|
24
24
|
`target` не является данными заказа, клиента или пользователя. Это только место встраивания.
|
|
25
25
|
Данные нужно брать из контекстов, которые привязаны к этому `target`.
|
|
26
26
|
|
|
27
|
+
## Оформление виджета в target
|
|
28
|
+
|
|
29
|
+
Виджет должен добавлять в target простой и предсказуемый inline UI: обычно `UiToolbarButton`,
|
|
30
|
+
`UiToolbarLink`, короткий текст или компактное действие с иконкой. Это сохраняет страницу CRM
|
|
31
|
+
стабильной и не раздувает место встраивания.
|
|
32
|
+
|
|
33
|
+
Если сценарий требует сложной формы, таблицы, карты, фильтров, summary-блоков или многошагового UI,
|
|
34
|
+
оставьте в target только компактный вход в сценарий, а основную логику перенесите в `UiModalSidebar`
|
|
35
|
+
или `UiModalWindow`.
|
|
36
|
+
|
|
37
|
+
Подробные правила композиции описаны в `@retailcrm/embed-ui-v1-components`
|
|
38
|
+
`docs/profiles/widgets/WidgetComposition.yml`.
|
|
39
|
+
|
|
27
40
|
## Проверка контекстов для `target`
|
|
28
41
|
|
|
29
42
|
```ts
|
|
@@ -132,5 +145,5 @@ const testTarget = defineTarget('customer/card:test.after', [
|
|
|
132
145
|
- [`defineWidgetRunner`](./define-widget-runner.md) — как `target` попадает в компонент встраиваемого виджета.
|
|
133
146
|
- [`menu-placements`](./menu-placements.md) — чем пункты меню для страниц отличаются от widget `target`.
|
|
134
147
|
- [`page-routes`](./page-routes.md) — как описывать page `code` и CRM-маршрут.
|
|
135
|
-
-
|
|
136
|
-
-
|
|
148
|
+
- `@retailcrm/embed-ui-v1-contexts` `docs/ru/CONCEPT.md` — общий принцип работы контекстов.
|
|
149
|
+
- `@retailcrm/embed-ui-v1-contexts` `docs/ru/CUSTOM.md` — пользовательский контекст для custom fields.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"embed-ui-v1-endpoint-mcp": "bin/embed-ui-v1-endpoint-mcp.mjs"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "0.9.
|
|
8
|
+
"version": "0.9.24",
|
|
9
9
|
"description": "Endpoint API for integrations in RetailCRM",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
@@ -100,17 +100,17 @@
|
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"@omnicajs/vue-remote": "^0.2.24",
|
|
102
102
|
"@remote-ui/rpc": "^1.4",
|
|
103
|
-
"@retailcrm/embed-ui-v1-contexts": "^0.9.
|
|
104
|
-
"@retailcrm/embed-ui-v1-types": "^0.9.
|
|
103
|
+
"@retailcrm/embed-ui-v1-contexts": "^0.9.24",
|
|
104
|
+
"@retailcrm/embed-ui-v1-types": "^0.9.24",
|
|
105
105
|
"pinia": "^2.2",
|
|
106
106
|
"vue": "^3.5"
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
110
110
|
"@remote-ui/rpc": "^1.4.7",
|
|
111
|
-
"@retailcrm/embed-ui-v1-components": "^0.9.
|
|
112
|
-
"@retailcrm/embed-ui-v1-contexts": "^0.9.
|
|
113
|
-
"@retailcrm/embed-ui-v1-types": "^0.9.
|
|
111
|
+
"@retailcrm/embed-ui-v1-components": "^0.9.24",
|
|
112
|
+
"@retailcrm/embed-ui-v1-contexts": "^0.9.24",
|
|
113
|
+
"@retailcrm/embed-ui-v1-types": "^0.9.24"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@retailcrm/image-preview": "^1.0.2",
|