@retailcrm/embed-ui 0.5.2 → 0.5.3-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.
package/CHANGELOG.md CHANGED
@@ -1,17 +1,82 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## [0.5.3-alpha.1](https://github.com/retailcrm/embed-ui/compare/v0.5.2-1.0...v0.5.3-alpha.1) (2024-12-24)
4
5
  ## [0.5.2](https://github.com/retailcrm/embed-ui/compare/v0.5.1...v0.5.2) (2024-12-24)
5
6
 
7
+ Special release for the fixes included. Please take a note here that alpha versions' changes were not included.
8
+
6
9
  ### Bug Fixes
7
10
 
8
11
  * Fixed description of target 'order/card:comment.manager.before' ([dbe61c7](https://github.com/retailcrm/embed-ui/commit/dbe61c7425d86a4cf85e56ba3fdc7684d4e75241))
12
+ ## [0.5.2-alpha.4](https://github.com/retailcrm/embed-ui/compare/v0.5.2-alpha.3...v0.5.2-alpha.4) (2024-12-24)
13
+
14
+ ### Features
15
+
16
+ * **v1-types:** Removed before/last fields from CustomDictionaryFilter ([54f64ab](https://github.com/retailcrm/embed-ui/commit/54f64aba383016a081d5efe3ff6ee05cb6ecbb47))
17
+
18
+ ### Bug Fixes
19
+
20
+ * Missing UiCheckbox/UiRadio in components' names list passed to remote root ([2d0981e](https://github.com/retailcrm/embed-ui/commit/2d0981eed28e076c51b4a4afb562a1fa69f0fd40))
21
+ ## [0.5.2-alpha.3](https://github.com/retailcrm/embed-ui/compare/v0.5.2-alpha.2...v0.5.2-alpha.3) (2024-12-23)
22
+
23
+ ### Bug Fixes
24
+
25
+ * **v1-contexts:** Missing company.KPP field of order/card context from v0.5.1 ([11c3cc4](https://github.com/retailcrm/embed-ui/commit/11c3cc41e66312b695e3fa500f07b352dde7812d))
26
+ ## [0.5.2-alpha.2](https://github.com/retailcrm/embed-ui/compare/v0.5.2-alpha.1...v0.5.2-alpha.2) (2024-12-23)
27
+
28
+ ### Bug Fixes
29
+
30
+ * **v1-components:** Missing UiRadio host export ([8811cf6](https://github.com/retailcrm/embed-ui/commit/8811cf6ca5a74f50aedcd354163e25da172a9c2b))
31
+ ## [0.5.2-alpha.1](https://github.com/retailcrm/embed-ui/compare/v0.5.1-1.0...v0.5.2-alpha.1) (2024-12-23)
32
+
33
+ ### Features
34
+
35
+ * **v1-components:** Added UiRadio component ([a29ab06](https://github.com/retailcrm/embed-ui/commit/a29ab061f995cb118d4f534ebdf2034e8235cccb))
9
36
  ## [0.5.1](https://github.com/retailcrm/embed-ui/compare/v0.5.0...v0.5.1) (2024-12-23)
10
37
 
38
+ Special release for the features included. Please take a note here that alpha versions' changes were not included.
39
+
11
40
  ### Features
12
41
 
13
42
  * New target definition 'order/card:comment.manager.before' for widgets in 'Client comments' block ([556ce64](https://github.com/retailcrm/embed-ui/commit/556ce64ab7b4405297a537a3b4c14a70a1dbe793))
14
43
  * **v1-contexts:** Added company.KPP field to order/card context ([c188ccb](https://github.com/retailcrm/embed-ui/commit/c188ccb1544904242fe2e00fa5054f8bbb7068bd))
44
+
45
+ ## [0.5.1-alpha.6](https://github.com/retailcrm/embed-ui/compare/v0.5.1-alpha.5...v0.5.1-alpha.6) (2024-12-20)
46
+
47
+ ### Features
48
+
49
+ * **v1-components:** Added UiCheckbox component ([87cbaa8](https://github.com/retailcrm/embed-ui/commit/87cbaa8b0381056a342bb1c70e5b2b45121641cb))
50
+ ## [0.5.1-alpha.5](https://github.com/retailcrm/embed-ui/compare/v0.5.1-alpha.4...v0.5.1-alpha.5) (2024-12-19)
51
+
52
+ ### Features
53
+
54
+ * **v1-contexts:** Adjusted validator to changed custom fields' kinds ([3f730be](https://github.com/retailcrm/embed-ui/commit/3f730bedae5fd2489f7ffcf7bd3cd43e92d0f9f6))
55
+ * **v1-contexts:** Removed before & last filters from custom dictionary query ([9e53e28](https://github.com/retailcrm/embed-ui/commit/9e53e28de6da07dfe3e02c92ec9a717e412b6f1f))
56
+ * **v1-types:** Renamed custom field kinds, additional custom fields ([0100148](https://github.com/retailcrm/embed-ui/commit/0100148b435b0e188dffd1fa8b4c7563e6f9af20))
57
+ ## [0.5.1-alpha.4](https://github.com/retailcrm/embed-ui/compare/v0.5.1-alpha.3...v0.5.1-alpha.4) (2024-12-17)
58
+
59
+ ### Bug Fixes
60
+
61
+ * Missing useCustomField declaration in index.d.ts ([4babd03](https://github.com/retailcrm/embed-ui/commit/4babd0373e2047288e12dd712cc636a530e25a41))
62
+ ## [0.5.1-alpha.3](https://github.com/retailcrm/embed-ui/compare/v0.5.1-alpha.2...v0.5.1-alpha.3) (2024-12-16)
63
+
64
+ ### Features
65
+
66
+ * **v1-types:** All fields except 'choice' were made nullable ([0311cb5](https://github.com/retailcrm/embed-ui/commit/0311cb506c97463279381cae17ea3bf0e18797b7))
67
+ ## [0.5.1-alpha.2](https://github.com/retailcrm/embed-ui/compare/v0.5.1-alpha.1...v0.5.1-alpha.2) (2024-12-16)
68
+
69
+ ### Bug Fixes
70
+
71
+ * **v1-contexts:** Missing utilities, renaming according to types changes ([5cdd029](https://github.com/retailcrm/embed-ui/commit/5cdd02923015ff12cf10f15699c517a7896099df))
72
+ * **v1-types:** Replacing experimental types ([3ebc4d2](https://github.com/retailcrm/embed-ui/commit/3ebc4d2809b80954ed4e53fcab3cf37624dffc97))
73
+ ## [0.5.1-alpha.1](https://github.com/retailcrm/embed-ui/compare/v0.5.0...v0.5.1-alpha.1) (2024-12-13)
74
+
75
+ ### Features
76
+
77
+ * Added useCustomField composable ([8290af2](https://github.com/retailcrm/embed-ui/commit/8290af2468308de132c24f17bb1be983b5c96d2e))
78
+ * **v1-contexts:** Logic of custom contexts ([b4e3dff](https://github.com/retailcrm/embed-ui/commit/b4e3dff92a9c258237d14e5ad8e25be1f87b9f1b))
79
+ * **v1-types:** Added types for custom contexts ([a86c795](https://github.com/retailcrm/embed-ui/commit/a86c795e2bd77c4086705c760277ecc03cfd8072))
15
80
  ## [0.5.0](https://github.com/retailcrm/embed-ui/compare/v0.4.9...v0.5.0) (2024-12-11)
16
81
 
17
82
  ### ⚠ BREAKING CHANGES
package/dist/index.cjs CHANGED
@@ -4,6 +4,7 @@ const rpc = require("@remote-ui/rpc");
4
4
  const pinia = require("pinia");
5
5
  const remote$1 = require("@omnicajs/vue-remote/remote");
6
6
  const remote = require("@retailcrm/embed-ui-v1-contexts/remote");
7
+ const custom = require("@retailcrm/embed-ui-v1-contexts/remote/custom");
7
8
  const card = require("@retailcrm/embed-ui-v1-contexts/remote/customer/card");
8
9
  const cardPhone = require("@retailcrm/embed-ui-v1-contexts/remote/customer/card-phone");
9
10
  const card$1 = require("@retailcrm/embed-ui-v1-contexts/remote/order/card");
@@ -21,6 +22,12 @@ const useField = (store, field, onReject = null) => {
21
22
  set: (value) => set(field, value, onReject ?? _onReject)
22
23
  });
23
24
  };
25
+ const useCustomField = (store, code) => {
26
+ return vue.computed({
27
+ get: () => code in store.values ? store.values[code] : void 0,
28
+ set: (value) => store.set(code, value)
29
+ });
30
+ };
24
31
  const useInternal = pinia.defineStore("@retailcrm/embed-ui/_internal", {});
25
32
  const useHost = () => {
26
33
  const store = useInternal();
@@ -35,12 +42,14 @@ const createRoot = async (channel) => {
35
42
  const root = remote$1.createRemoteRoot(channel, {
36
43
  components: [
37
44
  "UiButton",
45
+ "UiCheckbox",
38
46
  "UiError",
39
47
  "UiLink",
40
48
  "UiLoader",
41
49
  "UiModalSidebar",
42
50
  "UiModalWindow",
43
51
  "UiModalWindowSurface",
52
+ "UiRadio",
44
53
  "UiScrollBox",
45
54
  "UiTag",
46
55
  "UiToolbarButton",
@@ -56,6 +65,7 @@ const createWidgetEndpoint = (widget, messenger) => {
56
65
  const endpoint = rpc.createEndpoint(messenger);
57
66
  const pinia$1 = pinia.createPinia();
58
67
  pinia$1.use(remote.injectEndpoint(endpoint));
68
+ pinia$1.use(custom.injectAccessor(endpoint));
59
69
  let onRelease = () => {
60
70
  };
61
71
  endpoint.expose({
@@ -119,5 +129,6 @@ Object.defineProperty(exports, "useSettingsContext", {
119
129
  get: () => settings.useContext
120
130
  });
121
131
  exports.createWidgetEndpoint = createWidgetEndpoint;
132
+ exports.useCustomField = useCustomField;
122
133
  exports.useField = useField;
123
134
  exports.useHost = useHost;
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { createEndpoint, retain, release } from "@remote-ui/rpc";
2
2
  import { defineStore, createPinia } from "pinia";
3
3
  import { createRemoteRenderer, createRemoteRoot } from "@omnicajs/vue-remote/remote";
4
4
  import { injectEndpoint } from "@retailcrm/embed-ui-v1-contexts/remote";
5
+ import { injectAccessor } from "@retailcrm/embed-ui-v1-contexts/remote/custom";
5
6
  import { schema, useContext } from "@retailcrm/embed-ui-v1-contexts/remote/customer/card";
6
7
  import { schema as schema2, useContext as useContext2 } from "@retailcrm/embed-ui-v1-contexts/remote/customer/card-phone";
7
8
  import { schema as schema3, useContext as useContext3 } from "@retailcrm/embed-ui-v1-contexts/remote/order/card";
@@ -19,6 +20,12 @@ const useField = (store, field, onReject = null) => {
19
20
  set: (value) => set(field, value, onReject ?? _onReject)
20
21
  });
21
22
  };
23
+ const useCustomField = (store, code) => {
24
+ return computed({
25
+ get: () => code in store.values ? store.values[code] : void 0,
26
+ set: (value) => store.set(code, value)
27
+ });
28
+ };
22
29
  const useInternal = defineStore("@retailcrm/embed-ui/_internal", {});
23
30
  const useHost = () => {
24
31
  const store = useInternal();
@@ -33,12 +40,14 @@ const createRoot = async (channel) => {
33
40
  const root = createRemoteRoot(channel, {
34
41
  components: [
35
42
  "UiButton",
43
+ "UiCheckbox",
36
44
  "UiError",
37
45
  "UiLink",
38
46
  "UiLoader",
39
47
  "UiModalSidebar",
40
48
  "UiModalWindow",
41
49
  "UiModalWindowSurface",
50
+ "UiRadio",
42
51
  "UiScrollBox",
43
52
  "UiTag",
44
53
  "UiToolbarButton",
@@ -54,6 +63,7 @@ const createWidgetEndpoint = (widget, messenger) => {
54
63
  const endpoint = createEndpoint(messenger);
55
64
  const pinia = createPinia();
56
65
  pinia.use(injectEndpoint(endpoint));
66
+ pinia.use(injectAccessor(endpoint));
57
67
  let onRelease = () => {
58
68
  };
59
69
  endpoint.expose({
@@ -84,6 +94,7 @@ export {
84
94
  schema3 as orderCardSchema,
85
95
  schema5 as settingsSchema,
86
96
  useContext4 as useCurrentUserContext,
97
+ useCustomField,
87
98
  useContext as useCustomerCardContext,
88
99
  useContext2 as useCustomerCardPhoneContext,
89
100
  useField,
package/index.d.ts CHANGED
@@ -49,6 +49,11 @@ export declare const useField: <S extends ContextSchema, F extends keyof S>(
49
49
  ? ComputedRef<TypeOf<S[F]>>
50
50
  : WritableComputedRef<TypeOf<S[F]>>
51
51
 
52
+ export declare const useCustomField: <T extends string>(
53
+ store: CustomContextStore<T>,
54
+ code: string
55
+ ) => WritableComputedRef<CustomFieldType>
56
+
52
57
  export declare const useHost = () => RemoteCallable<Callable>
53
58
 
54
59
  declare module 'pinia' {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@retailcrm/embed-ui",
3
3
  "type": "module",
4
- "version": "0.5.2",
4
+ "version": "0.5.3-alpha.1",
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>",
@@ -33,8 +33,8 @@
33
33
  "dependencies": {
34
34
  "@omnicajs/vue-remote": "^0.2.3",
35
35
  "@remote-ui/rpc": "^1.4.5",
36
- "@retailcrm/embed-ui-v1-contexts": "^0.5.2",
37
- "@retailcrm/embed-ui-v1-types": "^0.5.2"
36
+ "@retailcrm/embed-ui-v1-contexts": "^0.5.3-alpha.1",
37
+ "@retailcrm/embed-ui-v1-types": "^0.5.3-alpha.1"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "pinia": "^2.2",
@@ -43,7 +43,7 @@
43
43
  "devDependencies": {
44
44
  "@eslint/eslintrc": "^3.0.2",
45
45
  "@eslint/js": "^9.13.0",
46
- "@retailcrm/embed-ui-v1-testing": "^0.5.2",
46
+ "@retailcrm/embed-ui-v1-testing": "^0.5.3-alpha.1",
47
47
  "@types/git-semver-tags": "^7.0.0",
48
48
  "@types/node": "^22.7.9",
49
49
  "@types/semver": "^7.5.8",
@@ -1,4 +0,0 @@
1
- {
2
- "nodejs.typescript.node.options": "",
3
- "toolchains": []
4
- }