@retailcrm/embed-ui 0.2.0 → 0.2.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
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.2.2](https://github.com/retailcrm/embed-ui/compare/v0.2.1...v0.2.2) (2024-11-04)
6
+
7
+
8
+ ### Fixes
9
+
10
+ * Missing types field in package.json manifest ([71fe0a5](https://github.com/retailcrm/embed-ui/commit/71fe0a5ea11761a61f076486ea66b2a13b5f302b))
11
+
12
+ ### [0.2.1](https://github.com/retailcrm/embed-ui/compare/v0.2.0...v0.2.1) (2024-11-04)
13
+
14
+
15
+ ### Features
16
+
17
+ * Added CrmYandexMap to known components ([90621b0](https://github.com/retailcrm/embed-ui/commit/90621b079465970b558d783d5e65bb01aef54586))
18
+
19
+
20
+ ### Fixes
21
+
22
+ * ContextAccessor getter return type ([5a98241](https://github.com/retailcrm/embed-ui/commit/5a98241fd230ef0341f4bb8b935d8cf33ae8db11))
23
+
5
24
  ## [0.2.0](https://github.com/retailcrm/embed-ui/compare/v0.1.0...v0.2.0) (2024-11-02)
6
25
 
7
26
 
package/dist/index.cjs CHANGED
@@ -173,7 +173,8 @@ const createRoot = async (channel) => {
173
173
  "UiModalWindowSurface",
174
174
  "UiScrollbar",
175
175
  "UiTag",
176
- "UiTransition"
176
+ "UiTransition",
177
+ "CrmYandexMap"
177
178
  ]
178
179
  });
179
180
  await root.mount();
package/dist/index.mjs CHANGED
@@ -171,7 +171,8 @@ const createRoot = async (channel) => {
171
171
  "UiModalWindowSurface",
172
172
  "UiScrollbar",
173
173
  "UiTag",
174
- "UiTransition"
174
+ "UiTransition",
175
+ "CrmYandexMap"
175
176
  ]
176
177
  });
177
178
  await root.mount();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@retailcrm/embed-ui",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.2.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>",
@@ -19,6 +19,7 @@
19
19
  "./dist/*": "./dist/*",
20
20
  "./types/*": "./types/*"
21
21
  },
22
+ "types": "dist/index.d.ts",
22
23
  "scripts": {
23
24
  "build": "vite build",
24
25
  "eslint": "eslint .",
@@ -46,14 +46,14 @@ export type EventHandler<
46
46
  > = (payload: TypeOf<S[EventMap<S>[E]]>) => void
47
47
 
48
48
  export type ContextAccessor<M extends ContextSchemaMap = ContextSchemaMap> = {
49
- get <
50
- C extends keyof M
51
- >(context: C, field: '~'): Context<M[C]>;
52
-
53
49
  get <
54
50
  C extends keyof M,
55
51
  F extends keyof M[C]
56
- >(context: C, field: F): Context<M[C]>[F];
52
+ >(context: C, field: F | '~'): If<
53
+ IsTilda<typeof field>,
54
+ Context<M[C]>,
55
+ Context<M[C]>[F]
56
+ >;
57
57
 
58
58
  set <
59
59
  C extends keyof M,
@@ -1,54 +0,0 @@
1
- import type { ContextSchema } from '~types/context/schema'
2
- import type { SchemaDocumentation } from '~meta'
3
-
4
- import * as fs from 'node:fs'
5
-
6
- import { fileURLToPath } from 'node:url'
7
-
8
- import {
9
- dirname,
10
- join,
11
- resolve,
12
- } from 'node:path'
13
-
14
- import { keysOf } from '@/utilities'
15
-
16
- import {
17
- schemaList,
18
- schemaListDocumentation,
19
- targetListDocumentation,
20
- pageListDocumentation,
21
- } from '~meta'
22
-
23
- const __dirname = dirname(fileURLToPath(import.meta.url))
24
-
25
- const dist = resolve(__dirname, '../dist/')
26
-
27
- if (!fs.existsSync(dist)) {
28
- fs.mkdirSync(dist)
29
- }
30
-
31
- fs.writeFileSync(join(dist, 'meta.json'), JSON.stringify({
32
- contexts: keysOf(schemaList).reduce((meta, key) => {
33
- const schema = schemaList[key] as ContextSchema
34
-
35
- meta[key] = keysOf(schema).map(field => {
36
- const accepts = schema[field].accepts
37
- const documentation = schemaListDocumentation[key] as SchemaDocumentation<ContextSchema>
38
-
39
- return {
40
- name: field,
41
- type: 'type' in accepts ? accepts.type : 'unknown',
42
- description: documentation[field].description,
43
- readonly: schema[field].readonly,
44
- }
45
- })
46
-
47
- return meta
48
- }, {} as Record<string, unknown>),
49
- targets: keysOf(targetListDocumentation).map(target => ({
50
- id: target,
51
- ...targetListDocumentation[target],
52
- })),
53
- pages: pageListDocumentation,
54
- }, null, 2))