@trycourier/react-provider 6.2.2-internal.eaace00.0 → 6.3.0
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/index.js +22 -19
- package/package.json +5 -5
- package/typings/index.d.ts.map +1 -1
package/dist/index.js
CHANGED
|
@@ -41,8 +41,6 @@ var _deepExtend = _interopRequireDefault(require("deep-extend"));
|
|
|
41
41
|
|
|
42
42
|
var _theme2 = require("./theme");
|
|
43
43
|
|
|
44
|
-
var _styledComponents = require("styled-components");
|
|
45
|
-
|
|
46
44
|
var _useIsOnline = require("./hooks/use-is-online");
|
|
47
45
|
|
|
48
46
|
var _useListenForTransport = require("./hooks/use-listen-for-transport");
|
|
@@ -76,20 +74,25 @@ var registerReducer = _reducer.registerReducer;
|
|
|
76
74
|
exports.registerReducer = registerReducer;
|
|
77
75
|
var registerMiddleware = _middleware.registerMiddleware;
|
|
78
76
|
exports.registerMiddleware = registerMiddleware;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"--ci-
|
|
88
|
-
"--ci-
|
|
89
|
-
"--ci-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
77
|
+
|
|
78
|
+
var GlobalThemeVariables = function GlobalThemeVariables(_ref) {
|
|
79
|
+
var variables = _ref.variables;
|
|
80
|
+
(0, _react.useEffect)(function () {
|
|
81
|
+
var setGlobalThemeVariables = function setGlobalThemeVariables(variables) {
|
|
82
|
+
var _variables$background, _variables$textColor, _variables$titleColor, _variables$structure, _variables$icon;
|
|
83
|
+
|
|
84
|
+
var root = document.documentElement;
|
|
85
|
+
root.style.setProperty("--ci-background", (_variables$background = variables === null || variables === void 0 ? void 0 : variables.background) !== null && _variables$background !== void 0 ? _variables$background : null);
|
|
86
|
+
root.style.setProperty("--ci-text-color", (_variables$textColor = variables === null || variables === void 0 ? void 0 : variables.textColor) !== null && _variables$textColor !== void 0 ? _variables$textColor : null);
|
|
87
|
+
root.style.setProperty("--ci-title-color", (_variables$titleColor = variables === null || variables === void 0 ? void 0 : variables.titleColor) !== null && _variables$titleColor !== void 0 ? _variables$titleColor : null);
|
|
88
|
+
root.style.setProperty("--ci-structure", (_variables$structure = variables === null || variables === void 0 ? void 0 : variables.structure) !== null && _variables$structure !== void 0 ? _variables$structure : null);
|
|
89
|
+
root.style.setProperty("--ci-icon", (_variables$icon = variables === null || variables === void 0 ? void 0 : variables.icon) !== null && _variables$icon !== void 0 ? _variables$icon : null);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
setGlobalThemeVariables(variables);
|
|
93
|
+
}, [variables]);
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
93
96
|
|
|
94
97
|
var CourierContext = /*#__PURE__*/_react["default"].createContext(undefined);
|
|
95
98
|
|
|
@@ -149,10 +152,10 @@ var CourierProviderInner = function CourierProviderInner(_ref2) {
|
|
|
149
152
|
wsOptions: wsOptions
|
|
150
153
|
});
|
|
151
154
|
var theme = (0, _react.useMemo)(function () {
|
|
152
|
-
var _theme$
|
|
155
|
+
var _theme$variables;
|
|
153
156
|
|
|
154
157
|
return _objectSpread(_objectSpread({}, _theme), {}, {
|
|
155
|
-
variables: (0, _deepExtend["default"])({}, (_theme === null || _theme === void 0 ? void 0 : _theme.colorMode) === "dark" ? _theme2.darkVariables : _theme2.lightVariables, (_theme$
|
|
158
|
+
variables: (0, _deepExtend["default"])({}, (_theme === null || _theme === void 0 ? void 0 : _theme.colorMode) === "dark" ? _theme2.darkVariables : _theme2.lightVariables, (_theme$variables = _theme === null || _theme === void 0 ? void 0 : _theme.variables) !== null && _theme$variables !== void 0 ? _theme$variables : {})
|
|
156
159
|
});
|
|
157
160
|
}, [_theme]);
|
|
158
161
|
|
|
@@ -271,7 +274,7 @@ var CourierProviderInner = function CourierProviderInner(_ref2) {
|
|
|
271
274
|
clientSourceId: clientSourceId
|
|
272
275
|
})
|
|
273
276
|
}, /*#__PURE__*/_react["default"].createElement(GlobalThemeVariables, {
|
|
274
|
-
|
|
277
|
+
variables: theme.variables
|
|
275
278
|
}), children);
|
|
276
279
|
};
|
|
277
280
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-provider",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@trycourier/client-graphql": "^6.
|
|
19
|
-
"@trycourier/core": "^6.
|
|
18
|
+
"@trycourier/client-graphql": "^6.3.0",
|
|
19
|
+
"@trycourier/core": "^6.3.0",
|
|
20
20
|
"@trycourier/courier-js": "^1.4.2",
|
|
21
|
-
"@trycourier/transport": "^6.
|
|
21
|
+
"@trycourier/transport": "^6.3.0",
|
|
22
22
|
"buffer": "^6.0.3",
|
|
23
23
|
"jwt-decode": "^3.1.2",
|
|
24
24
|
"react-use": "^17.2.1",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"dist/",
|
|
35
35
|
"typings/"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "6f144ebe0739b5d7fcc3e99cc4fc52ea05378921"
|
|
38
38
|
}
|
package/typings/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAIZ,iBAAiB,EAClB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,aAAa,EAEd,MAAM,SAAS,CAAC;AAMjB,OAA0B,EACxB,UAAU,EAEX,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAIZ,iBAAiB,EAClB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,aAAa,EAEd,MAAM,SAAS,CAAC;AAMjB,OAA0B,EACxB,UAAU,EAEX,MAAM,cAAc,CAAC;AAStB,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,eAAe,oCAAmB,CAAC;AAChD,eAAO,MAAM,kBAAkB,8CAAsB,CAAC;AAEtD,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAqBpE,eAAO,MAAM,cAAc,4CACkC,CAAC;AAsO9D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CACnD,iBAAiB,CAAC,qBAAqB,CAAC,CAQzC,CAAC"}
|