@retailcrm/embed-ui 0.4.1-alpha.9 → 0.4.1-beta.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,73 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## [0.4.1-beta.2](https://github.com/retailcrm/embed-ui/compare/v0.4.1-beta.1...v0.4.1-beta.2) (2024-11-29)
5
+
6
+ ### Features
7
+
8
+ * Replaced typeCode / siteCode with type / site in order/card schema ([102124b](https://github.com/retailcrm/embed-ui/commit/102124b2a591f034a89a53976b094979985fc48a))
9
+ ## [0.4.1-beta.1](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.25...v0.4.1-beta.1) (2024-11-29)
10
+
11
+ ### Features
12
+
13
+ * Added typeCode / siteCode to order/card schema ([c3c4a27](https://github.com/retailcrm/embed-ui/commit/c3c4a278497aceb179791a5476df08a7666d36fa))
14
+
15
+ ### Bug Fixes
16
+
17
+ * **v1-components:** Styles of ellipsis modifier of UiLink ([c3b2189](https://github.com/retailcrm/embed-ui/commit/c3b2189712a036bec982360f1e7fcccd75038423))
18
+ ## [0.4.1-alpha.25](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.24...v0.4.1-alpha.25) (2024-11-28)
19
+ ## [0.4.1-alpha.24](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.23...v0.4.1-alpha.24) (2024-11-28)
20
+ ## [0.4.1-alpha.23](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.22...v0.4.1-alpha.23) (2024-11-28)
21
+ ## [0.4.1-alpha.22](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.21...v0.4.1-alpha.22) (2024-11-28)
22
+
23
+ ### Bug Fixes
24
+
25
+ * **v1-components:** Added slot 'icon' to remote UiLink definition ([c15bd98](https://github.com/retailcrm/embed-ui/commit/c15bd989d0c1ed08f185b35104e09e678e90dfb6))
26
+ ## [0.4.1-alpha.21](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.20...v0.4.1-alpha.21) (2024-11-27)
27
+
28
+ ### Bug Fixes
29
+
30
+ * **v1-components:** Missing VueI18n export ([ed6ef3a](https://github.com/retailcrm/embed-ui/commit/ed6ef3ab50a5879c18b205d24db0c3c9c9da537a))
31
+ ## [0.4.1-alpha.20](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.19...v0.4.1-alpha.20) (2024-11-27)
32
+
33
+ ### Bug Fixes
34
+
35
+ * **v1-components:** Missing i18n plugin ([635b839](https://github.com/retailcrm/embed-ui/commit/635b839b0d533e00c04fba00e8293b4793bd0b42))
36
+ ## [0.4.1-alpha.19](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.18...v0.4.1-alpha.19) (2024-11-27)
37
+
38
+ ### Features
39
+
40
+ * Added field 'photo' to 'user/current' context ([4d6aece](https://github.com/retailcrm/embed-ui/commit/4d6aece931d23ad74d2afa54fcfc1cc821846ca2))
41
+ ## [0.4.1-alpha.18](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.17...v0.4.1-alpha.18) (2024-11-27)
42
+
43
+ ### Bug Fixes
44
+
45
+ * Missing components info for remote root ([ee0cf4a](https://github.com/retailcrm/embed-ui/commit/ee0cf4a33d5f9fe41462f66eb65b1715081cd8c8))
46
+ ## [0.4.1-alpha.17](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.16...v0.4.1-alpha.17) (2024-11-27)
47
+ ## [0.4.1-alpha.16](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.15...v0.4.1-alpha.16) (2024-11-27)
48
+
49
+ ### Bug Fixes
50
+
51
+ * **v1-components:** exports configuration ([4756f47](https://github.com/retailcrm/embed-ui/commit/4756f4723afb79238c4f543bc8ddabebd55411d1))
52
+ ## [0.4.1-alpha.15](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.14...v0.4.1-alpha.15) (2024-11-26)
53
+
54
+ ### Bug Fixes
55
+
56
+ * Types across schemas, removed artifacts from unsuccessful rebase ([d34514d](https://github.com/retailcrm/embed-ui/commit/d34514df0e6fcdd9b0e9a1a2e9c909e299138284))
57
+ ## [0.4.1-alpha.14](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.13...v0.4.1-alpha.14) (2024-11-26)
58
+ ## [0.4.1-alpha.13](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.12...v0.4.1-alpha.13) (2024-11-26)
59
+ ## [0.4.1-alpha.12](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.11...v0.4.1-alpha.12) (2024-11-26)
60
+ ## [0.4.1-alpha.11](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.10...v0.4.1-alpha.11) (2024-11-26)
61
+
62
+ ### Features
63
+
64
+ * **v1-components:** Added links validator for UiButton and UiLink ([94788df](https://github.com/retailcrm/embed-ui/commit/94788df863f1c25d80ec5ad537fe40b2b10d27ef))
65
+ * **v1-components:** Added UiToolbar, UiToolbarButton and UiToolbarLink ([2bba2b5](https://github.com/retailcrm/embed-ui/commit/2bba2b5ba422ced4649f4d634672b3fdf52c8b01))
66
+ ## [0.4.1-alpha.10](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.9...v0.4.1-alpha.10) (2024-11-26)
67
+
68
+ ### Bug Fixes
69
+
70
+ * Missing import of ReadonlyField ([5a068ce](https://github.com/retailcrm/embed-ui/commit/5a068cead28bb40ee5c2b66116c4ae615b9661ad))
4
71
  ## [0.4.1-alpha.9](https://github.com/retailcrm/embed-ui/compare/v0.4.1-alpha.8...v0.4.1-alpha.9) (2024-11-26)
5
72
 
6
73
  ### Bug Fixes
package/README.md CHANGED
@@ -7,47 +7,3 @@ API и компоненты для создания расширений инт
7
7
  Цели встраивания определяют места, где будет размещена разметка виджета, генерируемая расширением.
8
8
 
9
9
  https://docs.retailcrm.ru/Developers/modules/PublishingModuleMarketplace/JsModulesTargets
10
-
11
- ## Контексты
12
-
13
- Предоставляют данные из системы, реактивны.
14
-
15
- ### `customer/card`
16
-
17
- Данные карточки клиента
18
-
19
- ```typescript
20
- import { useCustomerCardContext } from '@retailcrm/embed-ui'
21
-
22
- const customer = useCustomerCardContext()
23
- ```
24
-
25
- ### `customer/card:phone`
26
-
27
- Данные телефона клиента
28
-
29
- ```typescript
30
- import { useCustomerCardPhoneContext } from '@retailcrm/embed-ui'
31
-
32
- const phone = useCustomerCardPhoneContext()
33
- ```
34
-
35
- ### `order/card`
36
-
37
- Данные карточки заказа
38
-
39
- ```typescript
40
- import { useOrderCardContext } from '@retailcrm/embed-ui'
41
-
42
- const order = useOrderCardContext()
43
- ```
44
-
45
- ### `settings`
46
-
47
- Настройки CRM
48
-
49
- ```typescript
50
- import { useSettingsContext } from '@retailcrm/embed-ui'
51
-
52
- const settings = useSettingsContext()
53
- ```
package/dist/index.cjs CHANGED
@@ -56,6 +56,9 @@ const defineContext = (id, schema2) => {
56
56
  const withMeta = (predicate, type) => {
57
57
  return Object.assign(predicate, { type });
58
58
  };
59
+ const isExactly = (expected) => {
60
+ return withMeta((value) => value === expected, JSON.stringify(expected));
61
+ };
59
62
  const isNull = withMeta((value) => value === null, "null");
60
63
  const isNumber = withMeta((value) => typeof value === "number", "number");
61
64
  const isString = withMeta((value) => typeof value === "string", "string");
@@ -97,6 +100,16 @@ const schema$4 = {
97
100
  defaults: () => null,
98
101
  readonly: true
99
102
  },
103
+ "photo": {
104
+ accepts: oneOf(isString, isNull),
105
+ defaults: () => null,
106
+ readonly: true
107
+ },
108
+ "groups": {
109
+ accepts: arrayOf(isString),
110
+ defaults: () => [],
111
+ readonly: true
112
+ },
100
113
  "permissions": {
101
114
  accepts: arrayOf(isString),
102
115
  defaults: () => [],
@@ -151,15 +164,28 @@ const schema$1 = {
151
164
  defaults: () => null,
152
165
  readonly: true
153
166
  },
167
+ "type": {
168
+ accepts: oneOf(isString, isNull),
169
+ defaults: () => null,
170
+ readonly: true
171
+ },
172
+ "site": {
173
+ accepts: oneOf(isString, isNull),
174
+ defaults: () => null,
175
+ readonly: true
176
+ },
154
177
  "number": {
155
178
  accepts: oneOf(isString, isNull),
156
179
  defaults: () => null,
157
180
  readonly: true
158
181
  },
159
182
  "customer.type": {
160
- accepts: oneOf(isNumber, isNull),
161
- defaults: () => null,
162
- readonly: false
183
+ accepts: oneOf(
184
+ isExactly("customer"),
185
+ isExactly("customer_corporate")
186
+ ),
187
+ defaults: () => "customer",
188
+ readonly: true
163
189
  },
164
190
  "customer.lastName": {
165
191
  accepts: oneOf(isString, isNull),
@@ -259,13 +285,9 @@ const schema$1 = {
259
285
  };
260
286
  const useContext$1 = defineContext("order/card", schema$1);
261
287
  const locales = ["en-GB", "es-ES", "ru-RU"];
262
- const isLocale = withMeta(
263
- (value) => locales.includes(value),
264
- locales.map((l) => `'${l}'`).join(" | ")
265
- );
266
288
  const schema = {
267
289
  "system.locale": {
268
- accepts: isLocale,
290
+ accepts: oneOf(...locales.map(isExactly)),
269
291
  defaults: () => "en-GB",
270
292
  readonly: true
271
293
  }
@@ -275,11 +297,10 @@ const useField = (store, field) => {
275
297
  if (store.schema[field].readonly) {
276
298
  return vue.computed(() => store[field]);
277
299
  }
300
+ const set = store.set;
278
301
  return vue.computed({
279
302
  get: () => store[field],
280
- set: (value) => {
281
- store.set(field, value);
282
- }
303
+ set: (value) => set(field, value)
283
304
  });
284
305
  };
285
306
  const useInternal = pinia.defineStore("@retailcrm/embed-ui/_internal", {});
@@ -298,13 +319,13 @@ const createRoot = async (channel) => {
298
319
  "UiError",
299
320
  "UiLink",
300
321
  "UiLoader",
301
- "UiMenuItem",
302
- "UiMenuItemGroup",
303
322
  "UiModalSidebar",
304
323
  "UiModalWindow",
305
324
  "UiModalWindowSurface",
306
325
  "UiScrollBox",
307
326
  "UiTag",
327
+ "UiToolbarButton",
328
+ "UiToolbarLink",
308
329
  "UiTransition",
309
330
  "CrmYandexMap"
310
331
  ]
package/dist/index.mjs CHANGED
@@ -54,6 +54,9 @@ const defineContext = (id, schema2) => {
54
54
  const withMeta = (predicate, type) => {
55
55
  return Object.assign(predicate, { type });
56
56
  };
57
+ const isExactly = (expected) => {
58
+ return withMeta((value) => value === expected, JSON.stringify(expected));
59
+ };
57
60
  const isNull = withMeta((value) => value === null, "null");
58
61
  const isNumber = withMeta((value) => typeof value === "number", "number");
59
62
  const isString = withMeta((value) => typeof value === "string", "string");
@@ -95,6 +98,16 @@ const schema$4 = {
95
98
  defaults: () => null,
96
99
  readonly: true
97
100
  },
101
+ "photo": {
102
+ accepts: oneOf(isString, isNull),
103
+ defaults: () => null,
104
+ readonly: true
105
+ },
106
+ "groups": {
107
+ accepts: arrayOf(isString),
108
+ defaults: () => [],
109
+ readonly: true
110
+ },
98
111
  "permissions": {
99
112
  accepts: arrayOf(isString),
100
113
  defaults: () => [],
@@ -149,15 +162,28 @@ const schema$1 = {
149
162
  defaults: () => null,
150
163
  readonly: true
151
164
  },
165
+ "type": {
166
+ accepts: oneOf(isString, isNull),
167
+ defaults: () => null,
168
+ readonly: true
169
+ },
170
+ "site": {
171
+ accepts: oneOf(isString, isNull),
172
+ defaults: () => null,
173
+ readonly: true
174
+ },
152
175
  "number": {
153
176
  accepts: oneOf(isString, isNull),
154
177
  defaults: () => null,
155
178
  readonly: true
156
179
  },
157
180
  "customer.type": {
158
- accepts: oneOf(isNumber, isNull),
159
- defaults: () => null,
160
- readonly: false
181
+ accepts: oneOf(
182
+ isExactly("customer"),
183
+ isExactly("customer_corporate")
184
+ ),
185
+ defaults: () => "customer",
186
+ readonly: true
161
187
  },
162
188
  "customer.lastName": {
163
189
  accepts: oneOf(isString, isNull),
@@ -257,13 +283,9 @@ const schema$1 = {
257
283
  };
258
284
  const useContext$1 = defineContext("order/card", schema$1);
259
285
  const locales = ["en-GB", "es-ES", "ru-RU"];
260
- const isLocale = withMeta(
261
- (value) => locales.includes(value),
262
- locales.map((l) => `'${l}'`).join(" | ")
263
- );
264
286
  const schema = {
265
287
  "system.locale": {
266
- accepts: isLocale,
288
+ accepts: oneOf(...locales.map(isExactly)),
267
289
  defaults: () => "en-GB",
268
290
  readonly: true
269
291
  }
@@ -273,11 +295,10 @@ const useField = (store, field) => {
273
295
  if (store.schema[field].readonly) {
274
296
  return computed(() => store[field]);
275
297
  }
298
+ const set = store.set;
276
299
  return computed({
277
300
  get: () => store[field],
278
- set: (value) => {
279
- store.set(field, value);
280
- }
301
+ set: (value) => set(field, value)
281
302
  });
282
303
  };
283
304
  const useInternal = defineStore("@retailcrm/embed-ui/_internal", {});
@@ -296,13 +317,13 @@ const createRoot = async (channel) => {
296
317
  "UiError",
297
318
  "UiLink",
298
319
  "UiLoader",
299
- "UiMenuItem",
300
- "UiMenuItemGroup",
301
320
  "UiModalSidebar",
302
321
  "UiModalWindow",
303
322
  "UiModalWindowSurface",
304
323
  "UiScrollBox",
305
324
  "UiTag",
325
+ "UiToolbarButton",
326
+ "UiToolbarLink",
306
327
  "UiTransition",
307
328
  "CrmYandexMap"
308
329
  ]
package/dist/meta.json CHANGED
@@ -1,67 +1,5 @@
1
1
  {
2
2
  "contexts": {
3
- "user/current": [
4
- {
5
- "name": "id",
6
- "type": "number | null",
7
- "description": {
8
- "en-GB": "User ID",
9
- "es-ES": "ID del usuario",
10
- "ru-RU": "ID пользователя"
11
- },
12
- "readonly": true
13
- },
14
- {
15
- "name": "email",
16
- "type": "string",
17
- "description": {
18
- "en-GB": "User email",
19
- "es-ES": "Correo electrónico del usuario",
20
- "ru-RU": "Email пользователя"
21
- },
22
- "readonly": true
23
- },
24
- {
25
- "name": "firstName",
26
- "type": "string | null",
27
- "description": {
28
- "en-GB": "User name",
29
- "es-ES": "Nombre del usuario",
30
- "ru-RU": "Имя пользователя"
31
- },
32
- "readonly": true
33
- },
34
- {
35
- "name": "lastName",
36
- "type": "string | null",
37
- "description": {
38
- "en-GB": "User last name",
39
- "es-ES": "Apellido del usuario",
40
- "ru-RU": "Фамилия пользователя"
41
- },
42
- "readonly": true
43
- },
44
- {
45
- "name": "patronymic",
46
- "type": "string | null",
47
- "description": {
48
- "en-GB": "Patronymic of the user",
49
- "es-ES": "Patronímico del usuario",
50
- "ru-RU": "Отчество пользователя"
51
- },
52
- "readonly": true
53
- },
54
- {
55
- "name": "permissions",
56
- "type": "Array<string>",
57
- "description": {
58
- "en-GB": "Character codes of available user permissions",
59
- "es-ES": "Códigos de caracteres de los permisos disponibles para el usuario",
60
- "ru-RU": "Символьные коды доступных пользователю разрешений"
61
- },
62
- "readonly": true
63
- }
64
- ],
65
3
  "customer/card": [
66
4
  {
67
5
  "name": "id",
@@ -147,6 +85,26 @@
147
85
  },
148
86
  "readonly": true
149
87
  },
88
+ {
89
+ "name": "type",
90
+ "type": "string | null",
91
+ "description": {
92
+ "en-GB": "Order type code",
93
+ "es-ES": "Código del tipo de pedido",
94
+ "ru-RU": "Код типа заказа"
95
+ },
96
+ "readonly": true
97
+ },
98
+ {
99
+ "name": "site",
100
+ "type": "string | null",
101
+ "description": {
102
+ "en-GB": "Store code associated with the order",
103
+ "es-ES": "Código de la tienda asociado al pedido",
104
+ "ru-RU": "Код магазина, к которому относится заказ"
105
+ },
106
+ "readonly": true
107
+ },
150
108
  {
151
109
  "name": "number",
152
110
  "type": "string | null",
@@ -159,13 +117,13 @@
159
117
  },
160
118
  {
161
119
  "name": "customer.type",
162
- "type": "number | null",
120
+ "type": "\"customer\" | \"customer_corporate\"",
163
121
  "description": {
164
122
  "en-GB": "Client type",
165
123
  "es-ES": "Tipo de cliente",
166
124
  "ru-RU": "Тип клиента"
167
125
  },
168
- "readonly": false
126
+ "readonly": true
169
127
  },
170
128
  {
171
129
  "name": "customer.lastName",
@@ -358,10 +316,92 @@
358
316
  "readonly": false
359
317
  }
360
318
  ],
319
+ "user/current": [
320
+ {
321
+ "name": "id",
322
+ "type": "number | null",
323
+ "description": {
324
+ "en-GB": "User ID",
325
+ "es-ES": "ID del usuario",
326
+ "ru-RU": "ID пользователя"
327
+ },
328
+ "readonly": true
329
+ },
330
+ {
331
+ "name": "email",
332
+ "type": "string",
333
+ "description": {
334
+ "en-GB": "User email",
335
+ "es-ES": "Correo electrónico del usuario",
336
+ "ru-RU": "Email пользователя"
337
+ },
338
+ "readonly": true
339
+ },
340
+ {
341
+ "name": "firstName",
342
+ "type": "string | null",
343
+ "description": {
344
+ "en-GB": "User name",
345
+ "es-ES": "Nombre del usuario",
346
+ "ru-RU": "Имя пользователя"
347
+ },
348
+ "readonly": true
349
+ },
350
+ {
351
+ "name": "lastName",
352
+ "type": "string | null",
353
+ "description": {
354
+ "en-GB": "User last name",
355
+ "es-ES": "Apellido del usuario",
356
+ "ru-RU": "Фамилия пользователя"
357
+ },
358
+ "readonly": true
359
+ },
360
+ {
361
+ "name": "patronymic",
362
+ "type": "string | null",
363
+ "description": {
364
+ "en-GB": "Patronymic of the user",
365
+ "es-ES": "Patronímico del usuario",
366
+ "ru-RU": "Отчество пользователя"
367
+ },
368
+ "readonly": true
369
+ },
370
+ {
371
+ "name": "photo",
372
+ "type": "string | null",
373
+ "description": {
374
+ "en-GB": "User photo",
375
+ "es-ES": "Foto del usuario",
376
+ "ru-RU": "Фото пользователя"
377
+ },
378
+ "readonly": true
379
+ },
380
+ {
381
+ "name": "groups",
382
+ "type": "Array<string>",
383
+ "description": {
384
+ "en-GB": "Symbolic codes of the groups the user belongs to",
385
+ "es-ES": "Códigos simbólicos de los grupos a los que pertenece el usuario",
386
+ "ru-RU": "Символьные коды групп, в которых состоит пользователь"
387
+ },
388
+ "readonly": true
389
+ },
390
+ {
391
+ "name": "permissions",
392
+ "type": "Array<string>",
393
+ "description": {
394
+ "en-GB": "Character codes of available user permissions",
395
+ "es-ES": "Códigos de caracteres de los permisos disponibles para el usuario",
396
+ "ru-RU": "Символьные коды доступных пользователю разрешений"
397
+ },
398
+ "readonly": true
399
+ }
400
+ ],
361
401
  "settings": [
362
402
  {
363
403
  "name": "system.locale",
364
- "type": "'en-GB' | 'es-ES' | 'ru-RU'",
404
+ "type": "\"en-GB\" | \"es-ES\" | \"ru-RU\"",
365
405
  "description": {
366
406
  "en-GB": "Current system's locale",
367
407
  "es-ES": "Configuración regional actual del sistema",
@@ -507,9 +547,9 @@
507
547
  "ru-RU": "Виджет для списка позиций заказа"
508
548
  },
509
549
  "location": {
510
- "en-GB": "[Temporary unavailable]",
511
- "es-ES": "[Temporalmente no disponible]",
512
- "ru-RU": "[Временно недоступен]"
550
+ "en-GB": "Section start, right above the input fields",
551
+ "es-ES": "Inicio de la sección, justo encima de los campos de entrada",
552
+ "ru-RU": "Начало секции, над полями ввода"
513
553
  },
514
554
  "contexts": [
515
555
  "order/card",
package/index.d.ts CHANGED
@@ -18,7 +18,10 @@ import type { TypeOf } from './types/context/schema'
18
18
  import type { WidgetRunner } from './types/widget'
19
19
  import type { WritableComputedRef } from 'vue'
20
20
 
21
- declare type Computed<S extends ContextSchema, F extends keyof S> = IsReadonly<S[F]> extends true ? ComputedRef<TypeOf<S[F]>> : WritableComputedRef<TypeOf<S[F]>>;
21
+ declare type Computed<
22
+ S extends ContextSchema,
23
+ F extends keyof S
24
+ > = IsReadonly<S[F]> extends true ? ComputedRef<TypeOf<S[F]>> : WritableComputedRef<TypeOf<S[F]>>;
22
25
 
23
26
  export declare const createWidgetEndpoint: (
24
27
  widget: WidgetRunner,
@@ -42,7 +45,7 @@ export type ContextStoreDefinition<
42
45
  Id extends string,
43
46
  S extends ContextSchema
44
47
  > = StoreDefinition<Id, Context<S>, {
45
- schema: () => S;
48
+ schema(): S;
46
49
  }, {
47
50
  initialize(): Promise<void>;
48
51
  set<F extends keyof S>(field: F, value: TypeOf<S[F]>): void;
@@ -51,7 +54,7 @@ export type ContextStoreDefinition<
51
54
  export declare const useCustomerCardContext: ContextStoreDefinition<'customer/card', CustomerCardSchema>
52
55
  export declare const useCustomerCardPhoneContext: ContextStoreDefinition<'customer/card:phone', CustomerCardPhoneSchema>
53
56
  export declare const useOrderCardContext: ContextStoreDefinition<'order/card', OrderCardSchema>
54
- export declare const useCurrentUserContext = DefineStore<'user/current', CurrentUserSchema>
57
+ export declare const useCurrentUserContext: ContextStoreDefinition<'user/current', CurrentUserSchema>
55
58
  export declare const useSettingsContext: ContextStoreDefinition<'settings', SettingsSchema>
56
59
 
57
60
  export declare const useField: <S extends ContextSchema, F extends keyof S>(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@retailcrm/embed-ui",
3
3
  "type": "module",
4
- "version": "0.4.1-alpha.9",
4
+ "version": "0.4.1-beta.2",
5
5
  "description": "API and components for creating RetailCRM UI extensions",
6
6
  "repository": "git@github.com:retailcrm/embed-ui.git",
7
7
  "author": "RetailDriverLLC <integration@retailcrm.ru>",
@@ -1,13 +1,13 @@
1
- import type { Schema as CurrentUserSchema } from './user/current'
2
1
  import type { Schema as CustomerCardSchema } from './customer/card'
3
2
  import type { Schema as CustomerCardPhoneSchema } from './customer/card-phone'
4
3
  import type { Schema as OrderCardSchema } from './order/card'
4
+ import type { Schema as CurrentUserSchema } from './user/current'
5
5
  import type { Schema as SettingsSchema } from './settings'
6
6
 
7
7
  export type SchemaList = {
8
- 'user/current': CurrentUserSchema;
9
8
  'customer/card': CustomerCardSchema;
10
9
  'customer/card:phone': CustomerCardPhoneSchema;
11
10
  'order/card': OrderCardSchema;
11
+ 'user/current': CurrentUserSchema;
12
12
  'settings': SettingsSchema;
13
13
  }
@@ -1,10 +1,12 @@
1
- import type { Field } from '../schema'
1
+ import type { Field, ReadonlyField } from '../schema'
2
2
 
3
3
  export type Schema = {
4
4
  'id': ReadonlyField<number | null>;
5
5
  'externalId': ReadonlyField<string | null>;
6
+ 'type': ReadonlyField<string | null>;
7
+ 'site': ReadonlyField<string | null>;
6
8
  'number': ReadonlyField<string | null>;
7
- 'customer.type': ReadonlyField<number | null>;
9
+ 'customer.type': ReadonlyField<'customer' | 'customer_corporate'>;
8
10
  'customer.lastName': Field<string | null>;
9
11
  'customer.firstName': Field<string | null>;
10
12
  'customer.patronymic': Field<string | null>;
@@ -1,9 +1,6 @@
1
1
  import type { ReadonlyField } from './schema'
2
2
 
3
3
  export type Locale = 'en-GB' | 'es-ES' | 'ru-RU'
4
-
5
4
  export type Schema = {
6
- 'order.templates.number.api': ReadonlyField<string>;
7
- 'order.templates.number.crm': ReadonlyField<string>;
8
5
  'system.locale': ReadonlyField<Locale>;
9
6
  }
@@ -3,8 +3,10 @@ import type { ReadonlyField } from '../schema'
3
3
  export type Schema = {
4
4
  'id': ReadonlyField<number | null>;
5
5
  'email': ReadonlyField<string>;
6
- 'firstName': ReadonlyField<number | null>;
6
+ 'firstName': ReadonlyField<string | null>;
7
7
  'lastName': ReadonlyField<string | null>;
8
- 'patronymic': ReadonlyField<number | null>;
8
+ 'patronymic': ReadonlyField<string | null>;
9
+ 'photo': ReadonlyField<string | null>;
10
+ 'groups': ReadonlyField<string[]>;
9
11
  'permissions': ReadonlyField<string[]>;
10
12
  }