@carbonorm/carbonreact 3.0.6 → 3.0.7

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.d.ts CHANGED
@@ -36,6 +36,8 @@ export * from "./hoc/isEdgeBrowser";
36
36
  export * from "./hoc/parseMultipleJson";
37
37
  export { default as scrollIntoView } from "./hoc/scrollIntoView";
38
38
  export * from "./hoc/scrollIntoView";
39
+ export { default as setCookies } from "./hoc/setCookies";
40
+ export * from "./hoc/setCookies";
39
41
  export { default as setUrl } from "./hoc/setUrl";
40
42
  export * from "./hoc/setUrl";
41
43
  export { default as updateRestfulObjectArrays } from "./hoc/updateRestfulObjectArrays";
package/dist/index.esm.js CHANGED
@@ -4183,6 +4183,27 @@ function ScrollIntoViewDirective(el) {
4183
4183
  el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'auto', block: 'nearest' });
4184
4184
  }
4185
4185
 
4186
+ function setCookies(cookies, req) {
4187
+ if (req === void 0) { req = undefined; }
4188
+ console.log("Setting cookies", cookies);
4189
+ cookies.map(function (cookie) {
4190
+ var newCookie = cookie
4191
+ .replace("HttpOnly", "")
4192
+ .replace("secure", "");
4193
+ if (document === undefined || document === null) {
4194
+ var getStackTrace_1 = function () {
4195
+ var obj = {};
4196
+ Error.captureStackTrace(obj, getStackTrace_1);
4197
+ return obj.stack;
4198
+ };
4199
+ console.error(req);
4200
+ console.log('Testing error, document not defined', req);
4201
+ throw new Error("Document is undefined while trying to set cookie: (" + newCookie + ") in axiosInterceptors.tsx after (" + JSON.stringify([req === null || req === void 0 ? void 0 : req.config, req === null || req === void 0 ? void 0 : req.data], undefined, 4) + ") Please make sure all requests are wrapped in an act() from import {act} from '@testing-library/react'; (" + JSON.stringify(getStackTrace_1(), undefined, 4) + ")");
4202
+ }
4203
+ document.cookie = newCookie;
4204
+ });
4205
+ }
4206
+
4186
4207
  // @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
4187
4208
  function setUrl(host, https) {
4188
4209
  if (host === void 0) { host = 'www.example.com'; }
@@ -4408,5 +4429,5 @@ function useWindowDimensions() {
4408
4429
  return windowDimensions;
4409
4430
  }
4410
4431
 
4411
- export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setUrl, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
4432
+ export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
4412
4433
  //# sourceMappingURL=index.esm.js.map