@retailcrm/embed-ui-v1-contexts 0.9.4 → 0.9.6
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/dist/host.cjs +5 -5
- package/dist/host.js +5 -5
- package/dist/predicates.es.js +2 -2
- package/dist/remote/customer/card-phone.js +1 -1
- package/dist/remote/customer/card.js +1 -1
- package/dist/remote/order/card-settings.js +1 -1
- package/dist/remote/order/card.js +1 -1
- package/dist/remote/settings.js +1 -1
- package/dist/remote/user/current.js +1 -1
- package/package.json +12 -10
package/dist/host.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const rpc = require("@remote-ui/rpc");
|
|
|
5
5
|
class HostError extends Error {
|
|
6
6
|
constructor(message, previous = void 0) {
|
|
7
7
|
super(`[crm:embed:host] ${message}`);
|
|
8
|
-
if (previous
|
|
8
|
+
if (previous?.stack) {
|
|
9
9
|
this.stack = `${previous.stack}
|
|
10
10
|
${this.stack}`;
|
|
11
11
|
}
|
|
@@ -33,7 +33,7 @@ class RuntimeError extends HostError {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
const createGetter = (id, getters) => {
|
|
36
|
-
return (field) => {
|
|
36
|
+
return ((field) => {
|
|
37
37
|
if (field === "~") {
|
|
38
38
|
return utilities.keysOf(getters).reduce((context, field2) => ({
|
|
39
39
|
...context,
|
|
@@ -44,15 +44,15 @@ const createGetter = (id, getters) => {
|
|
|
44
44
|
return getters[field]();
|
|
45
45
|
}
|
|
46
46
|
throw new LogicalError(`Field ${String(field)} is not supported in context ${id}`);
|
|
47
|
-
};
|
|
47
|
+
});
|
|
48
48
|
};
|
|
49
49
|
const createSetter = (id, setters) => {
|
|
50
|
-
return (field, value) => {
|
|
50
|
+
return ((field, value) => {
|
|
51
51
|
if (!(field in setters)) {
|
|
52
52
|
throw new LogicalError(`Setting field ${String(field)} is not supported in context ${id}`);
|
|
53
53
|
}
|
|
54
54
|
setters[field](value);
|
|
55
|
-
};
|
|
55
|
+
});
|
|
56
56
|
};
|
|
57
57
|
const createContextAccessor = (accessors, onError = null) => {
|
|
58
58
|
const guard = (context) => {
|
package/dist/host.js
CHANGED
|
@@ -3,7 +3,7 @@ import { retain, release } from "@remote-ui/rpc";
|
|
|
3
3
|
class HostError extends Error {
|
|
4
4
|
constructor(message, previous = void 0) {
|
|
5
5
|
super(`[crm:embed:host] ${message}`);
|
|
6
|
-
if (previous
|
|
6
|
+
if (previous?.stack) {
|
|
7
7
|
this.stack = `${previous.stack}
|
|
8
8
|
${this.stack}`;
|
|
9
9
|
}
|
|
@@ -31,7 +31,7 @@ class RuntimeError extends HostError {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
const createGetter = (id, getters) => {
|
|
34
|
-
return (field) => {
|
|
34
|
+
return ((field) => {
|
|
35
35
|
if (field === "~") {
|
|
36
36
|
return keysOf(getters).reduce((context, field2) => ({
|
|
37
37
|
...context,
|
|
@@ -42,15 +42,15 @@ const createGetter = (id, getters) => {
|
|
|
42
42
|
return getters[field]();
|
|
43
43
|
}
|
|
44
44
|
throw new LogicalError(`Field ${String(field)} is not supported in context ${id}`);
|
|
45
|
-
};
|
|
45
|
+
});
|
|
46
46
|
};
|
|
47
47
|
const createSetter = (id, setters) => {
|
|
48
|
-
return (field, value) => {
|
|
48
|
+
return ((field, value) => {
|
|
49
49
|
if (!(field in setters)) {
|
|
50
50
|
throw new LogicalError(`Setting field ${String(field)} is not supported in context ${id}`);
|
|
51
51
|
}
|
|
52
52
|
setters[field](value);
|
|
53
|
-
};
|
|
53
|
+
});
|
|
54
54
|
};
|
|
55
55
|
const createContextAccessor = (accessors, onError = null) => {
|
|
56
56
|
const guard = (context) => {
|
package/dist/predicates.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineContext } from "../../remote.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as arrayOf, o as oneOf, i as isString, b as isNull, c as isNumber } from "../../predicates.es.js";
|
|
3
3
|
const id = "customer/card";
|
|
4
4
|
const schema = {
|
|
5
5
|
"id": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineContext } from "../../remote.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as arrayOf, i as isString, o as oneOf, b as isNull, g as isBoolean } from "../../predicates.es.js";
|
|
3
3
|
const id = "order/card:settings";
|
|
4
4
|
const schema = {
|
|
5
5
|
"changePriceTypeByPriority": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineActions, defineContext } from "../../remote.js";
|
|
2
|
-
import { o as oneOf, d as isExactly, e as isShape, c as isNumber, i as isString, a as arrayOf, f as
|
|
2
|
+
import { o as oneOf, d as isExactly, e as isShape, b as isNull, c as isNumber, i as isString, a as arrayOf, f as isNumeric, g as isBoolean, h as cortegeOf, j as isVoid } from "../../predicates.es.js";
|
|
3
3
|
const isProductType = oneOf(
|
|
4
4
|
isExactly("PRODUCT"),
|
|
5
5
|
isExactly("SERVICE")
|
package/dist/remote/settings.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineContext } from "../remote.js";
|
|
2
|
-
import { a as arrayOf,
|
|
2
|
+
import { a as arrayOf, i as isString, o as oneOf, k as isObject, l as isArray, g as isBoolean, w as withMeta, d as isExactly } from "../predicates.es.js";
|
|
3
3
|
import { k as keysOf } from "../utilities.es.js";
|
|
4
4
|
const id = "settings";
|
|
5
5
|
const locales = ["en-GB", "es-ES", "ru-RU"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineContext } from "../../remote.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as arrayOf, i as isString, o as oneOf, b as isNull, c as isNumber, g as isBoolean } from "../../predicates.es.js";
|
|
3
3
|
const id = "user/current";
|
|
4
4
|
const schema = {
|
|
5
5
|
"id": {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@retailcrm/embed-ui-v1-contexts",
|
|
3
3
|
"description": "Reactive contexts for RetailCRM JS API",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.6",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
8
8
|
"repository": "git@github.com:retailcrm/embed-ui.git",
|
|
@@ -97,21 +97,23 @@
|
|
|
97
97
|
"test": "yarn prepare && vitest --run"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@remote-ui/rpc": "^1.4
|
|
100
|
+
"@remote-ui/rpc": "^1.4",
|
|
101
101
|
"pinia": "^2.2"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@floating-ui/core": "^1.
|
|
105
|
-
"@floating-ui/dom": "^1.
|
|
104
|
+
"@floating-ui/core": "^1.7.3",
|
|
105
|
+
"@floating-ui/dom": "^1.7.4",
|
|
106
106
|
"@omnicajs/symfony-router": "^1.0.0",
|
|
107
|
-
"@retailcrm/embed-ui-v1-types": "^0.9.
|
|
107
|
+
"@retailcrm/embed-ui-v1-types": "^0.9.6"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@
|
|
111
|
-
"
|
|
110
|
+
"@remote-ui/rpc": "^1.4.7",
|
|
111
|
+
"@retailcrm/embed-ui-v1-testing": "^0.9.6",
|
|
112
|
+
"tsx": "^4.21.0",
|
|
112
113
|
"typescript": "^5.9.3",
|
|
113
|
-
"vite": "^
|
|
114
|
-
"vite-plugin-dts": "^4.
|
|
115
|
-
"vitest": "^
|
|
114
|
+
"vite": "^7.2.7",
|
|
115
|
+
"vite-plugin-dts": "^4.5.4",
|
|
116
|
+
"vitest": "^4.0.15",
|
|
117
|
+
"vue": "^3.5.25"
|
|
116
118
|
}
|
|
117
119
|
}
|