@retailcrm/embed-ui-v1-endpoint 0.9.21 → 0.9.22-alpha.1

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.
Files changed (46) hide show
  1. package/README.md +70 -11
  2. package/bin/embed-ui-v1-endpoint-mcp.mjs +10 -0
  3. package/bin/embed-ui-v1-endpoint.mjs +416 -0
  4. package/dist/common/targets.cjs +61 -130
  5. package/dist/common/targets.d.ts +38 -27
  6. package/dist/common/targets.documentation.d.ts +302 -0
  7. package/dist/common/targets.js +61 -130
  8. package/dist/mcp/server.cjs +115 -0
  9. package/dist/mcp/server.d.ts +3 -0
  10. package/dist/mcp/server.js +97 -0
  11. package/dist/meta.json +618 -0
  12. package/docs/README.md +8 -6
  13. package/docs/create-endpoint.md +8 -10
  14. package/docs/define-page-runner.md +3 -3
  15. package/docs/define-widget-runner.md +2 -2
  16. package/docs/layout.md +14 -37
  17. package/docs/menu-placements.md +11 -13
  18. package/docs/page-routes.md +12 -14
  19. package/docs/run-endpoint.md +4 -4
  20. package/docs/targets/customer-card-communications-after.yml +48 -0
  21. package/docs/targets/customer-card-inwork-after.yml +48 -0
  22. package/docs/targets/customer-card-inwork-before.yml +48 -0
  23. package/docs/targets/customer-card-phone.yml +49 -0
  24. package/docs/targets/order-card-comment-manager-before.yml +51 -0
  25. package/docs/targets/order-card-common-after.yml +51 -0
  26. package/docs/targets/order-card-common-before.yml +51 -0
  27. package/docs/targets/order-card-customer-after.yml +51 -0
  28. package/docs/targets/order-card-customer-before.yml +51 -0
  29. package/docs/targets/order-card-customer-email.yml +51 -0
  30. package/docs/targets/order-card-customer-phone.yml +51 -0
  31. package/docs/targets/order-card-delivery-address.yml +51 -0
  32. package/docs/targets/order-card-delivery-after.yml +51 -0
  33. package/docs/targets/order-card-delivery-before.yml +51 -0
  34. package/docs/targets/order-card-dimensions-before.yml +51 -0
  35. package/docs/targets/order-card-list-after.yml +51 -0
  36. package/docs/targets/order-card-list-before.yml +51 -0
  37. package/docs/targets/order-card-payment-before.yml +51 -0
  38. package/docs/targets/order-card-store-before.yml +51 -0
  39. package/docs/targets/order-mg-delivery-after.yml +51 -0
  40. package/docs/targets/order-mg-delivery-before.yml +51 -0
  41. package/docs/targets/order-mg-list-after.yml +51 -0
  42. package/docs/targets/order-mg-list-before.yml +51 -0
  43. package/docs/targets/order-mg-payment-after.yml +51 -0
  44. package/docs/targets/order-mg-payment-before.yml +51 -0
  45. package/docs/targets.md +42 -17
  46. package/package.json +27 -7
@@ -1,7 +1,7 @@
1
1
  # `createEndpoint`
2
2
 
3
- `createEndpoint` связывает runner и transport (messenger), после чего
4
- экспортирует endpoint API (`run`, `release`, `reset`) через `@remote-ui/rpc`.
3
+ `createEndpoint` связывает runner и transport (`messenger`) и экспортирует
4
+ endpoint API (`run`, `release`, `reset`) через `@remote-ui/rpc`.
5
5
 
6
6
  ## Сигнатура
7
7
 
@@ -15,15 +15,15 @@ createEndpoint(
15
15
  ): Endpoint<RemoteApi>
16
16
  ```
17
17
 
18
- ## Что делает под капотом
18
+ ## Поведение
19
19
 
20
20
  При `run(...)`:
21
21
 
22
- 1. сбрасывает предыдущий mount для того же `id` (widget) или `code` (page),
23
- 2. поднимает remote root (`mountEndpointRoot`),
22
+ 1. сбрасывает предыдущее монтирование для того же `id` (widget) или `code` (page),
23
+ 2. поднимает endpoint root (`mountEndpointRoot`),
24
24
  3. создаёт `pinia` и инжектит endpoint/context accessors,
25
25
  4. вызывает нужный runner (`page.run` или `widget.run`),
26
- 5. сохраняет destroy-функцию в registry.
26
+ 5. сохраняет destroy-функцию в реестре.
27
27
 
28
28
  При `release(...)`:
29
29
 
@@ -33,7 +33,7 @@ createEndpoint(
33
33
 
34
34
  - вызывает destroy для всех активных page/widget инстансов.
35
35
 
36
- ## Пример (низкоуровневый)
36
+ ## Пример
37
37
 
38
38
  ```ts
39
39
  import { defineRunner, createEndpoint } from '@retailcrm/embed-ui-v1-endpoint/remote'
@@ -43,12 +43,10 @@ const runner = defineRunner({
43
43
  widgets: [MyWidgetRoot],
44
44
  })
45
45
 
46
- // messenger зависит от среды исполнения
47
46
  createEndpoint(runner, self as unknown as MessageEndpoint)
48
47
  ```
49
48
 
50
49
  ## Когда нужен именно `createEndpoint`
51
50
 
52
51
  - Нужна кастомная интеграция transport-слоя.
53
- - Вы сами контролируете, где и как создаётся `MessageEndpoint`.
54
- - Нужно использовать endpoint не через стандартный worker-entry сценарий.
52
+ - Нужно использовать endpoint не через стандартную точку входа веб-воркера.
@@ -1,6 +1,6 @@
1
1
  # `definePageRunner`
2
2
 
3
- `definePageRunner` создаёт runner для remote-страниц.
3
+ `definePageRunner` создаёт runner для встраиваемых страниц.
4
4
  При запуске в компонент пробрасывается проп `code`.
5
5
 
6
6
  ## Перегрузки
@@ -58,5 +58,5 @@ const pageRunner = definePageRunner(PageRoot, async (app, pinia) => {
58
58
 
59
59
  Читайте также:
60
60
 
61
- - [`page-routes`](./page-routes.md) — как связать page `code`, CRM route и компонент страницы.
62
- - [`menu-placements`](./menu-placements.md) — как описывать пункты меню, которые открывают remote-страницы.
61
+ - [`page-routes`](./page-routes.md) — как связать page `code`, CRM-маршрут и компонент страницы.
62
+ - [`menu-placements`](./menu-placements.md) — как описывать пункты меню, которые открывают встраиваемые страницы.
@@ -1,6 +1,6 @@
1
1
  # `defineWidgetRunner`
2
2
 
3
- `defineWidgetRunner` создаёт runner для remote-виджетов.
3
+ `defineWidgetRunner` создаёт runner для встраиваемых виджетов.
4
4
  При запуске в компонент пробрасывается проп `target`.
5
5
 
6
6
  ## Перегрузки
@@ -47,7 +47,7 @@ const widgetRunner = defineWidgetRunner({
47
47
 
48
48
  ## `beforeMount`
49
49
 
50
- `beforeMount` работает аналогично page-раннеру: выполняется перед mount и после подключения `pinia`.
50
+ `beforeMount` работает аналогично page-раннеру: выполняется перед монтированием и после подключения `pinia`.
51
51
 
52
52
  ```ts
53
53
  const widgetRunner = defineWidgetRunner(WidgetRoot, async (app, pinia) => {
package/docs/layout.md CHANGED
@@ -1,14 +1,9 @@
1
- # Гайд по layout для страниц и связанных экранов
1
+ # Компоновка страниц и связанных экранов
2
2
 
3
- Этот документ собирает в одном месте практические правила по тому, как проектировать
4
- страницы для `@retailcrm/embed-ui-v1-endpoint`: списки, карточки, страницы с несколькими
5
- колонками, страницы с collapse-блоками, а также случаи, когда вместо полноценной страницы
6
- следует использовать `modal sidebar` или `modal window`.
3
+ Практические правила для встраиваемых страниц `@retailcrm/embed-ui-v1-endpoint`: списков,
4
+ карточек, многоколоночных страниц, collapse-страниц, `modal sidebar` и `modal window`.
7
5
 
8
- Это не API-справка по `v1-endpoint`, а UX/layout guide для людей, которые собирают remote-page
9
- через `definePageRunner(...)` и хотят держаться общего визуального языка CRM.
10
-
11
- ## Базовая ментальная модель
6
+ ## Структура страницы
12
7
 
13
8
  Обычная страница в CRM чаще всего состоит из таких зон:
14
9
 
@@ -18,19 +13,14 @@
18
13
  4. Основной контент на белых подложках.
19
14
  5. Опционально: нижняя панель сохранения.
20
15
 
21
- Если экран перестаёт быть удобной полноценной страницей, его не следует усложнять бесконечно;
22
- в этом случае его следует переводить в другой паттерн: `modal sidebar` или `modal window`.
16
+ Если сценарий перестаёт быть удобной полноценной страницей, используйте другой паттерн:
17
+ `modal sidebar` или `modal window`.
23
18
 
24
19
  ## Термины
25
20
 
26
- В этом документе используются следующие термины:
27
-
28
21
  - `modal sidebar` — боковая выезжающая панель. В разговорной речи может называться “шторкой”.
29
22
  - `modal window` — всплывающее модальное окно. В разговорной речи может называться “модалкой”.
30
- - `страница` — основной route-level экран, который занимает центральную рабочую область CRM.
31
-
32
- Далее по тексту предпочтительно используются термины `modal sidebar` и `modal window`, потому что
33
- они напрямую соотносятся с компонентами `UiModalSidebar`, `UiModalWindow` и `UiModalWindowSurface`.
23
+ - `страница` — основной экран уровня маршрута, который занимает центральную рабочую область CRM.
34
24
 
35
25
  ## Общие правила
36
26
 
@@ -246,10 +236,6 @@
246
236
  - Дополнительная информация, которую не хочется разворачивать в отдельную страницу.
247
237
  - Сценарии вроде задач, уведомлений, нового обращения, редактирования шага.
248
238
 
249
- ### Размеры
250
-
251
- - Часто используется одна из двух ширин: `720px` или `416px`.
252
-
253
239
  ### Основные части
254
240
 
255
241
  1. Закреплённый `header`.
@@ -275,7 +261,8 @@
275
261
  - Контент в двух колонках на разных подложках.
276
262
  - Громоздкие, большие и сложные интерфейсы.
277
263
 
278
- Если экран фактически превращается в полноценную страницу или большую предметную область, `modal sidebar` уже не является подходящим выбором.
264
+ Если экран превращается в полноценную страницу или большую предметную область, `modal sidebar`
265
+ уже не подходит.
279
266
 
280
267
  ## 5. Когда вместо страницы нужен `modal window`
281
268
 
@@ -283,12 +270,7 @@
283
270
 
284
271
  - Для отображения большой вспомогательной таблицы “по месту”.
285
272
  - Для дополнительных настроек, когда `modal sidebar` уже не хватает.
286
- - Для сценариев просмотра или выбора, не заслуживающих отдельного route-level экрана.
287
-
288
- ### Размеры
289
-
290
- - Обычный `modal window` шириной около `960px`.
291
- - Или полноэкранный режим с внешними отступами по краям.
273
+ - Для сценариев просмотра или выбора, не заслуживающих отдельного экрана уровня маршрута.
292
274
 
293
275
  ### Основные части
294
276
 
@@ -328,9 +310,9 @@
328
310
  - требуется быстро завершить отдельный шаг без перехода на полноценную страницу;
329
311
  - `modal sidebar` уже тесен, но полноценная страница всё ещё избыточна.
330
312
 
331
- ## Сопоставление с `embed-ui`
313
+ ## Компонентная карта
332
314
 
333
- Ниже не жёсткий contract, а практичное соответствие layout-паттернов библиотечным примитивам:
315
+ Соответствие паттернов компоновки публичным компонентам:
334
316
 
335
317
  - заголовок страницы: `UiPageHeader`;
336
318
  - верхние actions: `UiButton`, `UiToolbarButton`, `UiToolbarLink`;
@@ -341,9 +323,7 @@
341
323
  - `modal sidebar`: `UiModalSidebar`;
342
324
  - `modal window`: `UiModalWindow` и `UiModalWindowSurface`.
343
325
 
344
- ## Чеклист перед реализацией страницы
345
-
346
- Перед тем как собирать новый page runner, полезно ответить на несколько вопросов:
326
+ ## Чеклист перед реализацией
347
327
 
348
328
  1. Это действительно страница, а не `modal sidebar` и не `modal window`?
349
329
  2. Это список, карточка, карточка с колонками или collapse-настройки?
@@ -352,12 +332,9 @@
352
332
  5. Не перегружен ли экран количеством primary-действий?
353
333
  6. Держатся ли отступы и расстояния сетки `4px`?
354
334
 
355
- Если на эти вопросы нет уверенного ответа, сначала следует выбрать подходящий layout-паттерн,
356
- а уже потом собирать компоненты и wiring через `v1-endpoint`.
357
-
358
335
  ---
359
336
 
360
- Примечание: все упоминаемые в этом документе компоненты вида `Ui*` относятся к пакету
337
+ Все упоминаемые компоненты вида `Ui*` относятся к пакету
361
338
  `@retailcrm/embed-ui-v1-components`. Термины `modal sidebar`, `modal window`, tabs, collapse-группы,
362
339
  таблицы, поля и другие layout-примитивы в этом гайде привязаны именно к публичным компонентам
363
340
  из `v1-components`, а не к произвольной внутренней терминологии проекта.
@@ -1,9 +1,8 @@
1
1
  # Меню и точки входа страниц
2
2
 
3
- Этот справочник описывает, как документировать меню и пункты навигации, из которых запускаются
4
- remote-страницы расширения.
3
+ Справочник для описания меню и пунктов навигации, из которых запускаются встраиваемые страницы расширения.
5
4
 
6
- Важно: `v1-endpoint` не экспортирует типизированный registry CRM-меню. Пакет отвечает за запуск
5
+ `v1-endpoint` не экспортирует типизированный реестр CRM-меню. Пакет отвечает за запуск
7
6
  страницы по `code`, а список меню, подпунктов и их видимость задаются на стороне host/manifest
8
7
  конкретного расширения.
9
8
 
@@ -11,13 +10,13 @@ remote-страницы расширения.
11
10
 
12
11
  - `menu placement` — зона CRM, куда host добавляет пункт навигации.
13
12
  - `menu item` — конкретный пункт меню, который видит пользователь.
14
- - `page code` — стабильный код remote-страницы, который host передаёт в `definePageRunner`.
15
- - `route` — маршрут CRM или route name, через который host открывает страницу.
13
+ - `page code` — стабильный код встраиваемой страницы, который host передаёт в `definePageRunner`.
14
+ - `route` — маршрут CRM или имя маршрута, через который host открывает страницу.
16
15
 
17
- `menu item` не равен `target`. Меню открывает полноценную remote-страницу по `code`, а `target`
16
+ `menu item` не равен `target`. Меню открывает полноценную встраиваемую страницу по `code`, а `target`
18
17
  используется для виджетов, которые встраиваются внутрь уже существующей CRM-страницы.
19
18
 
20
- ## Что нужно фиксировать в справочнике проекта
19
+ ## Что фиксировать в справочнике проекта
21
20
 
22
21
  Для каждого пункта меню указывайте:
23
22
 
@@ -26,14 +25,13 @@ remote-страницы расширения.
26
25
  | `placement` | Зона CRM, где находится пункт меню. |
27
26
  | `item code` | Стабильный код пункта меню в host/manifest. |
28
27
  | `label` | Пользовательское название пункта меню. |
29
- | `page code` | Код remote-страницы, который получит `definePageRunner`. |
30
- | `route` | Имя или путь CRM-маршрута, если пункт открывается через host routing. |
28
+ | `page code` | Код встраиваемой страницы, который получит `definePageRunner`. |
29
+ | `route` | Имя или путь CRM-маршрута, если пункт открывается через маршрутизацию host-части. |
31
30
  | `visibility` | Условия показа: права, настройки, тариф, доступность фичи. |
32
31
 
33
32
  ## Пример справочника меню
34
33
 
35
- Это пример формата. Конкретные `placement`, `item code` и `route` нужно брать из host/manifest
36
- расширения.
34
+ Конкретные `placement`, `item code` и `route` нужно брать из host/manifest расширения.
37
35
 
38
36
  | Placement | Item code | Label | Page code | Route | Когда использовать |
39
37
  | --- | --- | --- | --- | --- | --- |
@@ -64,8 +62,8 @@ const pageRunner = definePageRunner({
64
62
 
65
63
  Читайте также:
66
64
 
67
- - [`page-routes`](./page-routes.md) — как описывать page `code` и CRM route.
68
- - [`definePageRunner`](./define-page-runner.md) — как remote-страница получает `code`.
65
+ - [`page-routes`](./page-routes.md) — как описывать page `code` и CRM-маршрут.
66
+ - [`definePageRunner`](./define-page-runner.md) — как встраиваемая страница получает `code`.
69
67
  - [`targets`](./targets.md) — точки встраивания виджетов, не пунктов меню.
70
68
  - [`layout`](./layout.md) — когда делать полноценную страницу, а когда `modal sidebar` или `modal window`.
71
69
  - [`UiMenuItem`](../../v1-components/docs/profiles/UiMenuItem.yml) — компонент строки меню внутри UI расширения.
@@ -1,16 +1,15 @@
1
- # Роуты страниц
1
+ # Маршруты страниц
2
2
 
3
- Remote-страницы в `v1-endpoint` запускаются по `code`. Этот `code` приходит от host и пробрасывается
4
- в компонент через `definePageRunner`.
3
+ Встраиваемые страницы в `v1-endpoint` запускаются по `code`. Host передаёт `code`, а
4
+ `definePageRunner` пробрасывает его в компонент.
5
5
 
6
- `v1-endpoint` не задаёт фиксированный список page routes. Список страниц и CRM-маршрутов принадлежит
6
+ `v1-endpoint` не задаёт фиксированный список маршрутов страниц. Список страниц и CRM-маршрутов принадлежит
7
7
  host/manifest конкретного расширения, поэтому его нужно хранить в справочнике проекта рядом с кодом
8
8
  расширения.
9
9
 
10
10
  ## Что такое `page code`
11
11
 
12
- `page code` — стабильный идентификатор remote-страницы внутри расширения. Он отвечает на вопрос:
13
- «какую страницу расширения нужно смонтировать?».
12
+ `page code` — стабильный идентификатор встраиваемой страницы внутри расширения.
14
13
 
15
14
  Пример:
16
15
 
@@ -37,11 +36,10 @@ defineProps<{
37
36
 
38
37
  ## Что такое `route`
39
38
 
40
- `route` — CRM-маршрут или route name, через который host открывает страницу. В remote-коде route
41
- может использоваться для переходов через `HostApi.goTo(route, params)`.
39
+ `route` — CRM-маршрут или имя маршрута, через который host открывает страницу. В коде расширения
40
+ route может использоваться для переходов через `HostApi.goTo(route, params)`.
42
41
 
43
- Данные Symfony JS router доступны в контексте `settings` в поле `system.routing`. Это полезно,
44
- когда нужно проверить доступные route names или собрать ссылку тем же routing data, что отдаёт host.
42
+ Данные Symfony JS router доступны в контексте `settings` в поле `system.routing`.
45
43
 
46
44
  ```ts
47
45
  import { useContext as useSettingsContext } from '@retailcrm/embed-ui-v1-contexts/remote/settings'
@@ -51,9 +49,9 @@ const settings = useSettingsContext()
51
49
  console.log(settings['system.routing'].routes)
52
50
  ```
53
51
 
54
- ## Пример справочника роутов страниц
52
+ ## Пример справочника маршрутов страниц
55
53
 
56
- Это пример формата. Конкретные `code`, `route` и параметры нужно брать из host/manifest расширения.
54
+ Конкретные `code`, `route` и параметры нужно брать из host/manifest расширения.
57
55
 
58
56
  | Page code | Route | Params | Открывается из | Компонент |
59
57
  | --- | --- | --- | --- | --- |
@@ -61,7 +59,7 @@ console.log(settings['system.routing'].routes)
61
59
  | `integration-settings` | `embed.page.integration_settings` | `{}` | `settings / integration-settings` | `IntegrationSettingsPage.vue` |
62
60
  | `customer-tools` | `embed.page.customer_tools` | `{ customerId }` | `customer/card:actions / customer-tools` | `CustomerToolsPage.vue` |
63
61
 
64
- ## Переход на CRM route
62
+ ## Переход на CRM-маршрут
65
63
 
66
64
  Если странице нужен переход на другой CRM-маршрут, используйте host API, а не прямую сборку URL.
67
65
  Способ получения `HostApi` зависит от host-интеграции проекта, но сам публичный контракт выглядит так:
@@ -76,7 +74,7 @@ const openSettings = (host: HostApi) => {
76
74
 
77
75
  Читайте также:
78
76
 
79
- - [`menu-placements`](./menu-placements.md) — как связать пункт меню, page `code` и route.
77
+ - [`menu-placements`](./menu-placements.md) — как связать пункт меню, page `code` и маршрут.
80
78
  - [`definePageRunner`](./define-page-runner.md) — как page `code` попадает в компонент.
81
79
  - [`settings context`](../../v1-contexts/docs/ru/CONCEPT.md) — общий принцип работы контекстов.
82
80
  - [`HostApi`](../../v1-types/host.d.ts) — публичный тип host API с `goTo`.
@@ -1,6 +1,6 @@
1
1
  # `runEndpoint`
2
2
 
3
- `runEndpoint` — shortcut для worker entry:
3
+ `runEndpoint` — краткая форма для точки входа веб-воркера:
4
4
  он вызывает `createEndpoint(runner, self as Worker)`.
5
5
 
6
6
  ## Сигнатура
@@ -28,10 +28,10 @@ runEndpoint(runner)
28
28
 
29
29
  ## Когда использовать
30
30
 
31
- - Почти всегда, если endpoint запускается как web worker.
31
+ - Почти всегда, если endpoint запускается как веб-воркер.
32
32
  - Когда не нужен ручной контроль над messenger/transport.
33
33
 
34
34
  ## Когда лучше `createEndpoint`
35
35
 
36
- - Когда transport создаётся не от `self` worker.
37
- - Когда у вас кастомный runtime/bridge между host и remote.
36
+ - Когда transport создаётся не от `self` веб-воркера.
37
+ - Когда у вас кастомная среда выполнения или bridge между host и remote.
@@ -0,0 +1,48 @@
1
+ target: "customer/card:communications.after"
2
+ summary: >
3
+ Widget for enhancing the communication section in the left column of the customer page. It is placed in the customer card: Right below the short summary, in the communication section.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "customer/card"
21
+ label: "customer card"
22
+ area: "communications.after"
23
+
24
+ description: "Widget for enhancing the communication section in the left column of the customer page."
25
+ location: "Right below the short summary, in the communication section"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "customer/card"
30
+ - "user/current"
31
+ - "settings"
32
+ custom_contexts:
33
+ - "customer"
34
+ action_scopes: []
35
+
36
+ use_when:
37
+ - "Place a widget exactly at customer/card:communications.after."
38
+ - "The widget belongs to the customer card and should appear at this location: Right below the short summary, in the communication section."
39
+ - "The widget can work with the contexts listed in target_config.contexts."
40
+
41
+ avoid_when:
42
+ - "The widget belongs to a different page, section, or field-level insertion point."
43
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
44
+
45
+ ai_notes:
46
+ - "Use the target id as the runner registration key."
47
+ - "Use targets[target].contexts as the source of truth for context availability."
48
+ - "Do not duplicate target context lists in generated widget code."
@@ -0,0 +1,48 @@
1
+ target: "customer/card:inWork.after"
2
+ summary: >
3
+ Widget for the contact request item. It is placed in the customer card: At the end of the "In progress" block in the client card.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "customer/card"
21
+ label: "customer card"
22
+ area: "inWork.after"
23
+
24
+ description: "Widget for the contact request item"
25
+ location: "At the end of the \"In progress\" block in the client card"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "customer/card"
30
+ - "user/current"
31
+ - "settings"
32
+ custom_contexts:
33
+ - "customer"
34
+ action_scopes: []
35
+
36
+ use_when:
37
+ - "Place a widget exactly at customer/card:inWork.after."
38
+ - "The widget belongs to the customer card and should appear at this location: At the end of the \"In progress\" block in the client card."
39
+ - "The widget can work with the contexts listed in target_config.contexts."
40
+
41
+ avoid_when:
42
+ - "The widget belongs to a different page, section, or field-level insertion point."
43
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
44
+
45
+ ai_notes:
46
+ - "Use the target id as the runner registration key."
47
+ - "Use targets[target].contexts as the source of truth for context availability."
48
+ - "Do not duplicate target context lists in generated widget code."
@@ -0,0 +1,48 @@
1
+ target: "customer/card:inWork.before"
2
+ summary: >
3
+ Widget for the contact request item. It is placed in the customer card: At the beginning of the "In Progress" block in the client card.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "customer/card"
21
+ label: "customer card"
22
+ area: "inWork.before"
23
+
24
+ description: "Widget for the contact request item"
25
+ location: "At the beginning of the \"In Progress\" block in the client card"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "customer/card"
30
+ - "user/current"
31
+ - "settings"
32
+ custom_contexts:
33
+ - "customer"
34
+ action_scopes: []
35
+
36
+ use_when:
37
+ - "Place a widget exactly at customer/card:inWork.before."
38
+ - "The widget belongs to the customer card and should appear at this location: At the beginning of the \"In Progress\" block in the client card."
39
+ - "The widget can work with the contexts listed in target_config.contexts."
40
+
41
+ avoid_when:
42
+ - "The widget belongs to a different page, section, or field-level insertion point."
43
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
44
+
45
+ ai_notes:
46
+ - "Use the target id as the runner registration key."
47
+ - "Use targets[target].contexts as the source of truth for context availability."
48
+ - "Do not duplicate target context lists in generated widget code."
@@ -0,0 +1,49 @@
1
+ target: "customer/card:phone"
2
+ summary: >
3
+ Widget for customer phone list item. It is placed in the customer card: Right after the phone number in the list.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "customer/card"
21
+ label: "customer card"
22
+ area: "phone"
23
+
24
+ description: "Widget for customer phone list item"
25
+ location: "Right after the phone number in the list"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "customer/card"
30
+ - "customer/card:phone"
31
+ - "user/current"
32
+ - "settings"
33
+ custom_contexts:
34
+ - "customer"
35
+ action_scopes: []
36
+
37
+ use_when:
38
+ - "Place a widget exactly at customer/card:phone."
39
+ - "The widget belongs to the customer card and should appear at this location: Right after the phone number in the list."
40
+ - "The widget can work with the contexts listed in target_config.contexts."
41
+
42
+ avoid_when:
43
+ - "The widget belongs to a different page, section, or field-level insertion point."
44
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
45
+
46
+ ai_notes:
47
+ - "Use the target id as the runner registration key."
48
+ - "Use targets[target].contexts as the source of truth for context availability."
49
+ - "Do not duplicate target context lists in generated widget code."
@@ -0,0 +1,51 @@
1
+ target: "order/card:comment.manager.before"
2
+ summary: >
3
+ Widget for the block "Manager comment". It is placed in the full order form: Section start, right above the input field.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "order/card"
21
+ label: "full order form"
22
+ area: "comment.manager.before"
23
+
24
+ description: "Widget for the block \"Manager comment\""
25
+ location: "Section start, right above the input field"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "order/card"
30
+ - "order/card:settings"
31
+ - "user/current"
32
+ - "settings"
33
+ custom_contexts:
34
+ - "order"
35
+ action_scopes:
36
+ - "order/card"
37
+
38
+ use_when:
39
+ - "Place a widget exactly at order/card:comment.manager.before."
40
+ - "The widget belongs to the full order form and should appear at this location: Section start, right above the input field."
41
+ - "The widget can work with the contexts listed in target_config.contexts."
42
+
43
+ avoid_when:
44
+ - "The widget belongs to a different page, section, or field-level insertion point."
45
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
46
+
47
+ ai_notes:
48
+ - "Use the target id as the runner registration key."
49
+ - "Use targets[target].contexts as the source of truth for context availability."
50
+ - "Do not duplicate target context lists in generated widget code."
51
+ - "Order card and chat order form targets share the same order form data contract."
@@ -0,0 +1,51 @@
1
+ target: "order/card:common.after"
2
+ summary: >
3
+ Widget for the section with common data. It is placed in the full order form: Section end, right under the input fields.
4
+ language: en-GB
5
+ audience: ai
6
+
7
+ public_import:
8
+ from: "@retailcrm/embed-ui-v1-endpoint/common"
9
+ named:
10
+ - targets
11
+ - TargetName
12
+
13
+ runner_import:
14
+ from: "@retailcrm/embed-ui-v1-endpoint/remote/widgets"
15
+ named:
16
+ - defineWidgetRunner
17
+ - defineMultiRunner
18
+
19
+ page:
20
+ id: "order/card"
21
+ label: "full order form"
22
+ area: "common.after"
23
+
24
+ description: "Widget for the section with common data"
25
+ location: "Section end, right under the input fields"
26
+
27
+ target_config:
28
+ contexts:
29
+ - "order/card"
30
+ - "order/card:settings"
31
+ - "user/current"
32
+ - "settings"
33
+ custom_contexts:
34
+ - "order"
35
+ action_scopes:
36
+ - "order/card"
37
+
38
+ use_when:
39
+ - "Place a widget exactly at order/card:common.after."
40
+ - "The widget belongs to the full order form and should appear at this location: Section end, right under the input fields."
41
+ - "The widget can work with the contexts listed in target_config.contexts."
42
+
43
+ avoid_when:
44
+ - "The widget belongs to a different page, section, or field-level insertion point."
45
+ - "The widget requires contexts, custom contexts, or action scopes that are not listed in target_config."
46
+
47
+ ai_notes:
48
+ - "Use the target id as the runner registration key."
49
+ - "Use targets[target].contexts as the source of truth for context availability."
50
+ - "Do not duplicate target context lists in generated widget code."
51
+ - "Order card and chat order form targets share the same order form data contract."