chayns-api 2.0.5 → 2.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.
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useUser = void 0;
7
7
  var _useContextSelector = require("use-context-selector");
8
8
  var _ChaynsContext = require("../components/ChaynsContext");
9
+ const empty = {};
9
10
  /**
10
11
  * @category Hooks
11
12
  */
12
- const useUser = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || {});
13
+ const useUser = () => (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || empty);
13
14
  exports.useUser = useUser;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.Language = exports.IconType = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogFadeAnimation = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
6
+ exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.Language = exports.IconType = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
7
7
  let DateType = exports.DateType = /*#__PURE__*/function (DateType) {
8
8
  DateType[DateType["DATE"] = 0] = "DATE";
9
9
  DateType[DateType["TIME"] = 1] = "TIME";
@@ -324,11 +324,6 @@ let DialogAnimation = exports.DialogAnimation = /*#__PURE__*/function (DialogAni
324
324
  DialogAnimation["CONFETTI"] = "confetti";
325
325
  return DialogAnimation;
326
326
  }({});
327
- let DialogFadeAnimation = exports.DialogFadeAnimation = /*#__PURE__*/function (DialogFadeAnimation) {
328
- DialogFadeAnimation["FADE"] = "fade";
329
- DialogFadeAnimation["SCALE"] = "scale";
330
- return DialogFadeAnimation;
331
- }({});
332
327
  let DialogIconType = exports.DialogIconType = /*#__PURE__*/function (DialogIconType) {
333
328
  DialogIconType["SuccessIcon"] = "%%DialogSuccessIcon%%";
334
329
  DialogIconType["WarningIcon"] = "%%DialogWarningIcon%%";
@@ -1,6 +1,7 @@
1
1
  import { useContextSelector } from 'use-context-selector';
2
2
  import { ChaynsContext } from '../components/ChaynsContext';
3
+ const empty = {};
3
4
  /**
4
5
  * @category Hooks
5
6
  */
6
- export const useUser = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || {});
7
+ export const useUser = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || empty);
@@ -321,11 +321,6 @@ export let DialogAnimation = /*#__PURE__*/function (DialogAnimation) {
321
321
  DialogAnimation["CONFETTI"] = "confetti";
322
322
  return DialogAnimation;
323
323
  }({});
324
- export let DialogFadeAnimation = /*#__PURE__*/function (DialogFadeAnimation) {
325
- DialogFadeAnimation["FADE"] = "fade";
326
- DialogFadeAnimation["SCALE"] = "scale";
327
- return DialogFadeAnimation;
328
- }({});
329
324
  export let DialogIconType = /*#__PURE__*/function (DialogIconType) {
330
325
  DialogIconType["SuccessIcon"] = "%%DialogSuccessIcon%%";
331
326
  DialogIconType["WarningIcon"] = "%%DialogWarningIcon%%";
@@ -82,9 +82,6 @@ export interface BaseDialog {
82
82
  type: DialogAnimation;
83
83
  config?: any;
84
84
  };
85
- fadeAnimation?: {
86
- type: DialogFadeAnimation;
87
- };
88
85
  }
89
86
  export type Dialog<T extends any = object> = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule<T> | DialogIFrame<T> | DialogSelect | DialogDate | DialogToast | DialogSignature | DialogFileSelect);
90
87
  export interface DialogSignature {
@@ -119,6 +116,7 @@ export interface DialogInput {
119
116
  inputType?: DialogInputType;
120
117
  defaultValue?: string;
121
118
  formatter?: (input: string) => string;
119
+ regex?: RegExp;
122
120
  }
123
121
  export declare enum DialogSelectType {
124
122
  DEFAULT = 0,
@@ -888,10 +886,6 @@ export type OpenMedia = {
888
886
  export declare enum DialogAnimation {
889
887
  CONFETTI = "confetti"
890
888
  }
891
- export declare enum DialogFadeAnimation {
892
- FADE = "fade",
893
- SCALE = "scale"
894
- }
895
889
  export declare enum DialogIconType {
896
890
  SuccessIcon = "%%DialogSuccessIcon%%",
897
891
  WarningIcon = "%%DialogWarningIcon%%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",