@oxyhq/services 5.6.6 → 5.6.8

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.
@@ -4,30 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
- OxyServices: true,
8
- DeviceManager: true,
9
7
  toast: true
10
8
  };
11
- Object.defineProperty(exports, "DeviceManager", {
12
- enumerable: true,
13
- get: function () {
14
- return _utils.DeviceManager;
15
- }
16
- });
17
- Object.defineProperty(exports, "OxyServices", {
18
- enumerable: true,
19
- get: function () {
20
- return _core.OxyServices;
21
- }
22
- });
23
- exports.default = void 0;
24
9
  Object.defineProperty(exports, "toast", {
25
10
  enumerable: true,
26
11
  get: function () {
27
12
  return _sonnerSafe.toast;
28
13
  }
29
14
  });
30
- var _core = _interopRequireWildcard(require("./core"));
15
+ var _core = require("./core");
31
16
  Object.keys(_core).forEach(function (key) {
32
17
  if (key === "default" || key === "__esModule") return;
33
18
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -39,81 +24,17 @@ Object.keys(_core).forEach(function (key) {
39
24
  }
40
25
  });
41
26
  });
42
- var _utils = require("./utils");
43
- var _interfaces = require("./models/interfaces");
44
- Object.keys(_interfaces).forEach(function (key) {
45
- if (key === "default" || key === "__esModule") return;
46
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
47
- if (key in exports && exports[key] === _interfaces[key]) return;
48
- Object.defineProperty(exports, key, {
49
- enumerable: true,
50
- get: function () {
51
- return _interfaces[key];
52
- }
53
- });
54
- });
55
- var _secureSession = require("./models/secureSession");
56
- Object.keys(_secureSession).forEach(function (key) {
27
+ var _ui = require("./ui");
28
+ Object.keys(_ui).forEach(function (key) {
57
29
  if (key === "default" || key === "__esModule") return;
58
30
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
59
- if (key in exports && exports[key] === _secureSession[key]) return;
31
+ if (key in exports && exports[key] === _ui[key]) return;
60
32
  Object.defineProperty(exports, key, {
61
33
  enumerable: true,
62
34
  get: function () {
63
- return _secureSession[key];
35
+ return _ui[key];
64
36
  }
65
37
  });
66
38
  });
67
39
  var _sonnerSafe = require("./lib/sonner-safe");
68
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
69
- /**
70
- * OxyHQServices Main Export File - Universal (Frontend + Backend)
71
- *
72
- * This exports everything but uses environment detection to avoid crashes.
73
- * - Frontend: Full UI + Core functionality
74
- * - Backend: Core functionality only (UI components are no-ops)
75
- */
76
-
77
- // ------------- Core Imports (Always Safe) -------------
78
-
79
- // ------------- Environment Detection -------------
80
- const isFrontend = typeof window !== 'undefined' || typeof global !== 'undefined' && global.navigator || typeof process !== 'undefined' && process.env.NODE_ENV === 'development' && typeof document !== 'undefined';
81
-
82
- // ------------- Core Exports (Always Available) -------------
83
- var _default = exports.default = _core.default; // ------------- Safe Toast Export -------------
84
- // ------------- UI Exports (Conditional) -------------
85
- if (isFrontend) {
86
- // Frontend: Export all UI components
87
- try {
88
- const ui = require('./ui');
89
- Object.keys(ui).forEach(key => {
90
- exports[key] = ui[key];
91
- });
92
- } catch (e) {
93
- // UI import failed, continue without UI
94
- }
95
- } else {
96
- // Backend: Export no-op UI components
97
- const noopComponent = () => null;
98
- const noopHook = () => ({});
99
- exports.OxyProvider = noopComponent;
100
- exports.OxySignInButton = noopComponent;
101
- exports.OxyLogo = noopComponent;
102
- exports.Avatar = noopComponent;
103
- exports.FollowButton = noopComponent;
104
- exports.OxyPayButton = noopComponent;
105
- exports.FontLoader = {
106
- setupFonts: () => {}
107
- };
108
- exports.useOxy = noopHook;
109
- exports.useOxyAuth = noopHook;
110
- exports.useOxyUser = noopHook;
111
- exports.useOxyKarma = noopHook;
112
- exports.useOxyPayments = noopHook;
113
- exports.useOxyDevices = noopHook;
114
- exports.useOxyNotifications = noopHook;
115
- exports.useOxySocket = noopHook;
116
- exports.useOxyQR = noopHook;
117
- exports.useOxyIAP = noopHook;
118
- }
119
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_core","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_utils","_interfaces","_secureSession","_sonnerSafe","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor","isFrontend","window","global","navigator","process","env","NODE_ENV","document","_default","OxyCore","ui","noopComponent","noopHook","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","useOxy","useOxyAuth","useOxyUser","useOxyKarma","useOxyPayments","useOxyDevices","useOxyNotifications","useOxySocket","useOxyQR","useOxyIAP"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaAC,MAAA,CAAAC,IAAA,CAAAJ,KAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,KAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAA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O,CAACC,GAAG,IAAI;MAC7BK,OAAO,CAACL,GAAG,CAAC,GAAGqC,EAAE,CAACrC,GAAG,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOa,CAAC,EAAE;IACV;EAAA;AAEJ,CAAC,MAAM;EACL;EACA,MAAMyB,aAAa,GAAGA,CAAA,KAAM,IAAI;EAChC,MAAMC,QAAQ,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;EAE3BlC,OAAO,CAACmC,WAAW,GAAGF,aAAa;EACnCjC,OAAO,CAACoC,eAAe,GAAGH,aAAa;EACvCjC,OAAO,CAACqC,OAAO,GAAGJ,aAAa;EAC/BjC,OAAO,CAACsC,MAAM,GAAGL,aAAa;EAC9BjC,OAAO,CAACuC,YAAY,GAAGN,aAAa;EACpCjC,OAAO,CAACwC,YAAY,GAAGP,aAAa;EACpCjC,OAAO,CAACyC,UAAU,GAAG;IAAEC,UAAU,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC;EAC7C1C,OAAO,CAAC2C,MAAM,GAAGT,QAAQ;EACzBlC,OAAO,CAAC4C,UAAU,GAAGV,QAAQ;EAC7BlC,OAAO,CAAC6C,UAAU,GAAGX,QAAQ;EAC7BlC,OAAO,CAAC8C,WAAW,GAAGZ,QAAQ;EAC9BlC,OAAO,CAAC+C,cAAc,GAAGb,QAAQ;EACjClC,OAAO,CAACgD,aAAa,GAAGd,QAAQ;EAChClC,OAAO,CAACiD,mBAAmB,GAAGf,QAAQ;EACtClC,OAAO,CAACkD,YAAY,GAAGhB,QAAQ;EAC/BlC,OAAO,CAACmD,QAAQ,GAAGjB,QAAQ;EAC3BlC,OAAO,CAACoD,SAAS,GAAGlB,QAAQ;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_ui","_sonnerSafe"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;AASA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,GAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,GAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,GAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,WAAA,GAAAd,OAAA","ignoreList":[]}
@@ -3,182 +3,100 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- OxyProvider: true,
8
- OxySignInButton: true,
9
- OxyLogo: true,
10
- Avatar: true,
11
- FollowButton: true,
12
- OxyPayButton: true,
13
- FontLoader: true,
14
- setupFonts: true,
15
- OxyIcon: true,
16
- OxyContextProvider: true,
17
- useOxy: true,
18
- OxyContextState: true,
19
- OxyContextProviderProps: true,
20
- fontFamilies: true,
21
- fontStyles: true,
22
- useFollow: true,
23
- ProfileScreen: true,
24
- OxyRouter: true,
25
- useAuthStore: true,
26
- toast: true,
27
- OxyServices: true
28
- };
29
- Object.defineProperty(exports, "Avatar", {
30
- enumerable: true,
31
- get: function () {
32
- return _Avatar.default;
33
- }
34
- });
35
- Object.defineProperty(exports, "FollowButton", {
36
- enumerable: true,
37
- get: function () {
38
- return _FollowButton.default;
39
- }
40
- });
41
- Object.defineProperty(exports, "FontLoader", {
42
- enumerable: true,
43
- get: function () {
44
- return _FontLoader.FontLoader;
45
- }
46
- });
47
- Object.defineProperty(exports, "OxyContextProvider", {
48
- enumerable: true,
49
- get: function () {
50
- return _OxyContext.OxyContextProvider;
51
- }
52
- });
53
- Object.defineProperty(exports, "OxyContextProviderProps", {
54
- enumerable: true,
55
- get: function () {
56
- return _OxyContext.OxyContextProviderProps;
57
- }
58
- });
59
- Object.defineProperty(exports, "OxyContextState", {
60
- enumerable: true,
61
- get: function () {
62
- return _OxyContext.OxyContextState;
63
- }
64
- });
65
- Object.defineProperty(exports, "OxyIcon", {
66
- enumerable: true,
67
- get: function () {
68
- return _icon.OxyIcon;
69
- }
70
- });
71
- Object.defineProperty(exports, "OxyLogo", {
72
- enumerable: true,
73
- get: function () {
74
- return _OxyLogo.default;
75
- }
76
- });
77
- Object.defineProperty(exports, "OxyPayButton", {
78
- enumerable: true,
79
- get: function () {
80
- return _OxyPayButton.default;
81
- }
82
- });
83
- Object.defineProperty(exports, "OxyProvider", {
84
- enumerable: true,
85
- get: function () {
86
- return _OxyProvider.default;
87
- }
88
- });
89
- Object.defineProperty(exports, "OxyRouter", {
90
- enumerable: true,
91
- get: function () {
92
- return _OxyRouter.default;
93
- }
94
- });
6
+ exports.OxyRouter = exports.OxyProvider = exports.OxyPayButton = exports.OxyLogo = exports.OxyIcon = exports.OxyContextState = exports.OxyContextProviderProps = exports.OxyContextProvider = exports.FontLoader = exports.FollowButton = exports.Avatar = void 0;
95
7
  Object.defineProperty(exports, "OxyServices", {
96
8
  enumerable: true,
97
9
  get: function () {
98
10
  return _core.OxyServices;
99
11
  }
100
12
  });
101
- Object.defineProperty(exports, "OxySignInButton", {
102
- enumerable: true,
103
- get: function () {
104
- return _OxySignInButton.default;
105
- }
106
- });
107
- Object.defineProperty(exports, "ProfileScreen", {
108
- enumerable: true,
109
- get: function () {
110
- return _ProfileScreen.default;
111
- }
112
- });
113
- Object.defineProperty(exports, "fontFamilies", {
114
- enumerable: true,
115
- get: function () {
116
- return _fonts.fontFamilies;
117
- }
118
- });
119
- Object.defineProperty(exports, "fontStyles", {
120
- enumerable: true,
121
- get: function () {
122
- return _fonts.fontStyles;
123
- }
124
- });
125
- Object.defineProperty(exports, "setupFonts", {
126
- enumerable: true,
127
- get: function () {
128
- return _FontLoader.setupFonts;
129
- }
130
- });
131
- Object.defineProperty(exports, "toast", {
132
- enumerable: true,
133
- get: function () {
134
- return _sonner.toast;
135
- }
136
- });
137
- Object.defineProperty(exports, "useAuthStore", {
138
- enumerable: true,
139
- get: function () {
140
- return _authStore.useAuthStore;
141
- }
142
- });
143
- Object.defineProperty(exports, "useFollow", {
144
- enumerable: true,
145
- get: function () {
146
- return _hooks.useFollow;
147
- }
148
- });
149
- Object.defineProperty(exports, "useOxy", {
150
- enumerable: true,
151
- get: function () {
152
- return _OxyContext.useOxy;
153
- }
154
- });
155
- var _OxyProvider = _interopRequireDefault(require("./components/OxyProvider"));
156
- var _OxySignInButton = _interopRequireDefault(require("./components/OxySignInButton"));
157
- var _OxyLogo = _interopRequireDefault(require("./components/OxyLogo"));
158
- var _Avatar = _interopRequireDefault(require("./components/Avatar"));
159
- var _FollowButton = _interopRequireDefault(require("./components/FollowButton"));
160
- var _OxyPayButton = _interopRequireDefault(require("./components/OxyPayButton"));
161
- var _FontLoader = require("./components/FontLoader");
162
- var _icon = require("./components/icon");
163
- var _OxyContext = require("./context/OxyContext");
164
- var _fonts = require("./styles/fonts");
165
- var _types = require("./navigation/types");
166
- Object.keys(_types).forEach(function (key) {
167
- if (key === "default" || key === "__esModule") return;
168
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
169
- if (key in exports && exports[key] === _types[key]) return;
170
- Object.defineProperty(exports, key, {
171
- enumerable: true,
172
- get: function () {
173
- return _types[key];
174
- }
175
- });
176
- });
177
- var _hooks = require("./hooks");
178
- var _ProfileScreen = _interopRequireDefault(require("./screens/ProfileScreen"));
179
- var _OxyRouter = _interopRequireDefault(require("./navigation/OxyRouter"));
180
- var _authStore = require("./stores/authStore");
181
- var _sonner = require("../lib/sonner");
13
+ exports.useOxy = exports.useFollow = exports.useAuthStore = exports.toast = exports.setupFonts = exports.fontStyles = exports.fontFamilies = exports.ProfileScreen = exports.OxySignInButton = void 0;
14
+ var _isFrontend = _interopRequireDefault(require("./isFrontend"));
182
15
  var _core = require("../core");
183
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ /**
18
+ * UI Component exports - Frontend Only (with backend-safe fallbacks)
19
+ *
20
+ * This module exports all React/React Native UI components and hooks.
21
+ * In backend, all exports are no-ops or empty objects.
22
+ */
23
+
24
+ // Real UI exports
25
+ let OxyProvider = exports.OxyProvider = void 0,
26
+ OxySignInButton = exports.OxySignInButton = void 0,
27
+ OxyLogo = exports.OxyLogo = void 0,
28
+ Avatar = exports.Avatar = void 0,
29
+ FollowButton = exports.FollowButton = void 0,
30
+ OxyPayButton = exports.OxyPayButton = void 0,
31
+ FontLoader = exports.FontLoader = void 0,
32
+ setupFonts = exports.setupFonts = void 0,
33
+ OxyIcon = exports.OxyIcon = void 0,
34
+ useOxy = exports.useOxy = void 0,
35
+ useOxyAuth,
36
+ useOxyUser,
37
+ useOxyKarma,
38
+ useOxyPayments,
39
+ useOxyDevices,
40
+ useOxyNotifications,
41
+ useOxySocket,
42
+ useOxyQR,
43
+ useOxyIAP,
44
+ OxyContextProvider = exports.OxyContextProvider = void 0,
45
+ OxyContextState = exports.OxyContextState = void 0,
46
+ OxyContextProviderProps = exports.OxyContextProviderProps = void 0,
47
+ useFollow = exports.useFollow = void 0,
48
+ ProfileScreen = exports.ProfileScreen = void 0,
49
+ OxyRouter = exports.OxyRouter = void 0,
50
+ useAuthStore = exports.useAuthStore = void 0,
51
+ fontFamilies = exports.fontFamilies = void 0,
52
+ fontStyles = exports.fontStyles = void 0,
53
+ toast = exports.toast = void 0;
54
+ if (_isFrontend.default) {
55
+ exports.OxyProvider = OxyProvider = require('./components/OxyProvider').default;
56
+ exports.OxySignInButton = OxySignInButton = require('./components/OxySignInButton').default;
57
+ exports.OxyLogo = OxyLogo = require('./components/OxyLogo').default;
58
+ exports.Avatar = Avatar = require('./components/Avatar').default;
59
+ exports.FollowButton = FollowButton = require('./components/FollowButton').default;
60
+ exports.OxyPayButton = OxyPayButton = require('./components/OxyPayButton').default;
61
+ exports.FontLoader = FontLoader = require('./components/FontLoader').FontLoader;
62
+ exports.setupFonts = setupFonts = require('./components/FontLoader').setupFonts;
63
+ exports.OxyIcon = OxyIcon = require('./components/icon').OxyIcon;
64
+ exports.useOxy = useOxy = require('./context/OxyContext').useOxy;
65
+ exports.OxyContextProvider = OxyContextProvider = require('./context/OxyContext').OxyContextProvider;
66
+ exports.OxyContextState = OxyContextState = require('./context/OxyContext').OxyContextState;
67
+ exports.OxyContextProviderProps = OxyContextProviderProps = require('./context/OxyContext').OxyContextProviderProps;
68
+ exports.useFollow = useFollow = require('./hooks').useFollow;
69
+ exports.ProfileScreen = ProfileScreen = require('./screens/ProfileScreen').default;
70
+ exports.OxyRouter = OxyRouter = require('./navigation/OxyRouter').default;
71
+ exports.useAuthStore = useAuthStore = require('./stores/authStore').useAuthStore;
72
+ exports.fontFamilies = fontFamilies = require('./styles/fonts').fontFamilies;
73
+ exports.fontStyles = fontStyles = require('./styles/fonts').fontStyles;
74
+ exports.toast = toast = require('../lib/sonner').toast;
75
+ } else {
76
+ // Backend: no-op fallbacks
77
+ const noopComponent = () => null;
78
+ const noopHook = () => ({});
79
+ exports.OxyProvider = OxyProvider = noopComponent;
80
+ exports.OxySignInButton = OxySignInButton = noopComponent;
81
+ exports.OxyLogo = OxyLogo = noopComponent;
82
+ exports.Avatar = Avatar = noopComponent;
83
+ exports.FollowButton = FollowButton = noopComponent;
84
+ exports.OxyPayButton = OxyPayButton = noopComponent;
85
+ exports.FontLoader = FontLoader = noopComponent;
86
+ exports.setupFonts = setupFonts = () => {};
87
+ exports.OxyIcon = OxyIcon = noopComponent;
88
+ exports.useOxy = useOxy = noopHook;
89
+ exports.OxyContextProvider = OxyContextProvider = noopComponent;
90
+ exports.OxyContextState = OxyContextState = {};
91
+ exports.OxyContextProviderProps = OxyContextProviderProps = {};
92
+ exports.useFollow = useFollow = noopHook;
93
+ exports.ProfileScreen = ProfileScreen = noopComponent;
94
+ exports.OxyRouter = OxyRouter = noopComponent;
95
+ exports.useAuthStore = useAuthStore = noopHook;
96
+ exports.fontFamilies = fontFamilies = {};
97
+ exports.fontStyles = fontStyles = {};
98
+ exports.toast = toast = () => {};
99
+ }
100
+
101
+ // Re-export core services for convenience in UI context
184
102
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_OxyProvider","_interopRequireDefault","require","_OxySignInButton","_OxyLogo","_Avatar","_FollowButton","_OxyPayButton","_FontLoader","_icon","_OxyContext","_fonts","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_hooks","_ProfileScreen","_OxyRouter","_authStore","_sonner","_core","e","__esModule","default"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAGA,IAAAO,KAAA,GAAAP,OAAA;AAIA,IAAAQ,WAAA,GAAAR,OAAA;AAQA,IAAAS,MAAA,GAAAT,OAAA;AAGA,IAAAU,MAAA,GAAAV,OAAA;AAAAW,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAS,MAAA,GAAAvB,OAAA;AAGA,IAAAwB,cAAA,GAAAzB,sBAAA,CAAAC,OAAA;AAGA,IAAAyB,UAAA,GAAA1B,sBAAA,CAAAC,OAAA;AAGA,IAAA0B,UAAA,GAAA1B,OAAA;AAGA,IAAA2B,OAAA,GAAA3B,OAAA;AAGA,IAAA4B,KAAA,GAAA5B,OAAA;AAAsC,SAAAD,uBAAA8B,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_isFrontend","_interopRequireDefault","require","_core","e","__esModule","default","OxyProvider","exports","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","useOxy","useOxyAuth","useOxyUser","useOxyKarma","useOxyPayments","useOxyDevices","useOxyNotifications","useOxySocket","useOxyQR","useOxyIAP","OxyContextProvider","OxyContextState","OxyContextProviderProps","useFollow","ProfileScreen","OxyRouter","useAuthStore","fontFamilies","fontStyles","toast","isFrontend","noopComponent","noopHook"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;;;;;;;;;;;;AAMA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AA4EA,IAAAC,KAAA,GAAAD,OAAA;AAAsC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAlFtC;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA,IAAIG,WAAW,GAAAC,OAAA,CAAAD,WAAA;EAAEE,eAAe,GAAAD,OAAA,CAAAC,eAAA;EAAEC,OAAO,GAAAF,OAAA,CAAAE,OAAA;EAAEC,MAAM,GAAAH,OAAA,CAAAG,MAAA;EAAEC,YAAY,GAAAJ,OAAA,CAAAI,YAAA;EAAEC,YAAY,GAAAL,OAAA,CAAAK,YAAA;EAAEC,UAAU,GAAAN,OAAA,CAAAM,UAAA;EAAEC,UAAU,GAAAP,OAAA,CAAAO,UAAA;EAAEC,OAAO,GAAAR,OAAA,CAAAQ,OAAA;EAAEC,MAAM,GAAAT,OAAA,CAAAS,MAAA;EAAEC,UAAU;EAAEC,UAAU;EAAEC,WAAW;EAAEC,cAAc;EAAEC,aAAa;EAAEC,mBAAmB;EAAEC,YAAY;EAAEC,QAAQ;EAAEC,SAAS;EAAEC,kBAAkB,GAAAnB,OAAA,CAAAmB,kBAAA;EAAEC,eAAe,GAAApB,OAAA,CAAAoB,eAAA;EAAEC,uBAAuB,GAAArB,OAAA,CAAAqB,uBAAA;EAAEC,SAAS,GAAAtB,OAAA,CAAAsB,SAAA;EAAEC,aAAa,GAAAvB,OAAA,CAAAuB,aA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AGyB,aAAa;EAC5B9B,OAAA,CAAAM,UAAA,GAAAA,UAAU,GAAGwB,aAAa;EAC1B9B,OAAA,CAAAO,UAAA,GAAAA,UAAU,GAAGA,CAAA,KAAM,CAAC,CAAC;EACrBP,OAAA,CAAAQ,OAAA,GAAAA,OAAO,GAAGsB,aAAa;EACvB9B,OAAA,CAAAS,MAAA,GAAAA,MAAM,GAAGsB,QAAQ;EACjB/B,OAAA,CAAAmB,kBAAA,GAAAA,kBAAkB,GAAGW,aAAa;EAClC9B,OAAA,CAAAoB,eAAA,GAAAA,eAAe,GAAG,CAAC,CAAC;EACpBpB,OAAA,CAAAqB,uBAAA,GAAAA,uBAAuB,GAAG,CAAC,CAAC;EAC5BrB,OAAA,CAAAsB,SAAA,GAAAA,SAAS,GAAGS,QAAQ;EACpB/B,OAAA,CAAAuB,aAAA,GAAAA,aAAa,GAAGO,aAAa;EAC7B9B,OAAA,CAAAwB,SAAA,GAAAA,SAAS,GAAGM,aAAa;EACzB9B,OAAA,CAAAyB,YAAA,GAAAA,YAAY,GAAGM,QAAQ;EACvB/B,OAAA,CAAA0B,YAAA,GAAAA,YAAY,GAAG,CAAC,CAAC;EACjB1B,OAAA,CAAA2B,UAAA,GAAAA,UAAU,GAAG,CAAC,CAAC;EACf3B,OAAA,CAAA4B,KAAA,GAAAA,KAAK,GAAGA,CAAA,KAAM,CAAC,CAAC;AAClB;;AAyBA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ // Utility to detect if running in a frontend (browser or React Native) environment
8
+ const isFrontend = typeof window !== 'undefined' || typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
9
+ var _default = exports.default = isFrontend;
10
+ //# sourceMappingURL=isFrontend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isFrontend","window","navigator","product","_default","exports","default"],"sourceRoot":"../../../src","sources":["ui/isFrontend.ts"],"mappings":";;;;;;AAAA;AACA,MAAMA,UAAU,GAAG,OAAOC,MAAM,KAAK,WAAW,IAC7C,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,OAAO,KAAK,aAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE7DN,UAAU","ignoreList":[]}
@@ -8,56 +8,8 @@
8
8
  * - Backend: Core functionality only (UI components are no-ops)
9
9
  */
10
10
 
11
- // ------------- Core Imports (Always Safe) -------------
12
- import OxyCore from './core';
13
- import { OxyServices } from './core';
14
- // ------------- Environment Detection -------------
15
- const isFrontend = typeof window !== 'undefined' || typeof global !== 'undefined' && global.navigator || typeof process !== 'undefined' && process.env.NODE_ENV === 'development' && typeof document !== 'undefined';
16
-
17
- // ------------- Core Exports (Always Available) -------------
18
- export default OxyCore;
19
- export { OxyServices };
11
+ // Universal entry: always statically export everything
20
12
  export * from './core';
21
- export { DeviceManager } from './utils';
22
- export * from './models/interfaces';
23
- export * from './models/secureSession';
24
-
25
- // ------------- Safe Toast Export -------------
13
+ export * from './ui';
26
14
  export { toast } from './lib/sonner-safe';
27
-
28
- // ------------- UI Exports (Conditional) -------------
29
- if (isFrontend) {
30
- // Frontend: Export all UI components
31
- try {
32
- const ui = require('./ui');
33
- Object.keys(ui).forEach(key => {
34
- exports[key] = ui[key];
35
- });
36
- } catch (e) {
37
- // UI import failed, continue without UI
38
- }
39
- } else {
40
- // Backend: Export no-op UI components
41
- const noopComponent = () => null;
42
- const noopHook = () => ({});
43
- exports.OxyProvider = noopComponent;
44
- exports.OxySignInButton = noopComponent;
45
- exports.OxyLogo = noopComponent;
46
- exports.Avatar = noopComponent;
47
- exports.FollowButton = noopComponent;
48
- exports.OxyPayButton = noopComponent;
49
- exports.FontLoader = {
50
- setupFonts: () => {}
51
- };
52
- exports.useOxy = noopHook;
53
- exports.useOxyAuth = noopHook;
54
- exports.useOxyUser = noopHook;
55
- exports.useOxyKarma = noopHook;
56
- exports.useOxyPayments = noopHook;
57
- exports.useOxyDevices = noopHook;
58
- exports.useOxyNotifications = noopHook;
59
- exports.useOxySocket = noopHook;
60
- exports.useOxyQR = noopHook;
61
- exports.useOxyIAP = noopHook;
62
- }
63
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["OxyCore","OxyServices","isFrontend","window","global","navigator","process","env","NODE_ENV","document","DeviceManager","toast","ui","require","Object","keys","forEach","key","exports","e","noopComponent","noopHook","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","useOxy","useOxyAuth","useOxyUser","useOxyKarma","useOxyPayments","useOxyDevices","useOxyNotifications","useOxySocket","useOxyQR","useOxyIAP"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,OAAO,MAAM,QAAQ;AAC5B,SAASC,WAAW,QAAQ,QAAQ;AAIpC;AACA,MAAMC,UAAU,GAAG,OAAOC,MAAM,KAAK,WAAW,IAC5B,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,SAAU,IAClD,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,IAAI,OAAOC,QAAQ,KAAK,WAAY;;AAEhI;AACA,eAAeT,OAAO;AACtB,SAASC,WAAW;AACpB,cAAc,QAAQ;AACtB,SAASS,aAAa,QAAQ,SAAS;AAEvC,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;;AAEtC;AACA,SAASC,KAAK,QAAQ,mBAAmB;;AAEzC;AACA,IAAIT,UAAU,EAAE;EACd;EACA,IAAI;IACF,MAAMU,EAAE,GAAGC,OAAO,CAAC,MAAM,CAAC;IAC1BC,MAAM,CAACC,IAAI,CAACH,EAAE,CAAC,CAACI,OAAO,CAACC,GAAG,IAAI;MAC7BC,OAAO,CAACD,GAAG,CAAC,GAAGL,EAAE,CAACK,GAAG,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOE,CAAC,EAAE;IACV;EAAA;AAEJ,CAAC,MAAM;EACL;EACA,MAAMC,aAAa,GAAGA,CAAA,KAAM,IAAI;EAChC,MAAMC,QAAQ,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;EAE3BH,OAAO,CAACI,WAAW,GAAGF,aAAa;EACnCF,OAAO,CAACK,eAAe,GAAGH,aAAa;EACvCF,OAAO,CAACM,OAAO,GAAGJ,aAAa;EAC/BF,OAAO,CAACO,MAAM,GAAGL,aAAa;EAC9BF,OAAO,CAACQ,YAAY,GAAGN,aAAa;EACpCF,OAAO,CAACS,YAAY,GAAGP,aAAa;EACpCF,OAAO,CAACU,UAAU,GAAG;IAAEC,UAAU,EAAEA,CAAA,KAAM,CAAC;EAAE,CAAC;EAC7CX,OAAO,CAACY,MAAM,GAAGT,QAAQ;EACzBH,OAAO,CAACa,UAAU,GAAGV,QAAQ;EAC7BH,OAAO,CAACc,UAAU,GAAGX,QAAQ;EAC7BH,OAAO,CAACe,WAAW,GAAGZ,QAAQ;EAC9BH,OAAO,CAACgB,cAAc,GAAGb,QAAQ;EACjCH,OAAO,CAACiB,aAAa,GAAGd,QAAQ;EAChCH,OAAO,CAACkB,mBAAmB,GAAGf,QAAQ;EACtCH,OAAO,CAACmB,YAAY,GAAGhB,QAAQ;EAC/BH,OAAO,CAACoB,QAAQ,GAAGjB,QAAQ;EAC3BH,OAAO,CAACqB,SAAS,GAAGlB,QAAQ;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["toast"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,QAAQ;AACtB,cAAc,MAAM;AACpB,SAASA,KAAK,QAAQ,mBAAmB","ignoreList":[]}
@@ -1,46 +1,62 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
- * UI Component exports - Frontend Only
4
+ * UI Component exports - Frontend Only (with backend-safe fallbacks)
5
5
  *
6
6
  * This module exports all React/React Native UI components and hooks.
7
- * Use this for frontend applications only. For backend usage, import from the main package.
7
+ * In backend, all exports are no-ops or empty objects.
8
8
  */
9
-
10
- // Export the main provider component and context
11
- export { default as OxyProvider } from './components/OxyProvider';
12
- export { default as OxySignInButton } from './components/OxySignInButton';
13
- export { default as OxyLogo } from './components/OxyLogo';
14
- export { default as Avatar } from './components/Avatar';
15
- export { default as FollowButton } from './components/FollowButton';
16
- export { default as OxyPayButton } from './components/OxyPayButton';
17
- export { FontLoader, setupFonts } from './components/FontLoader';
18
-
19
- // Export icon components
20
- export { OxyIcon } from './components/icon';
21
- // Export context and hooks
22
- export { OxyContextProvider, useOxy, OxyContextState, OxyContextProviderProps } from './context/OxyContext';
23
-
24
- // Export styles
25
- export { fontFamilies, fontStyles } from './styles/fonts';
26
-
27
- // Export types for navigation and UI
28
- export * from './navigation/types';
29
-
30
- // Hooks
31
- export { useFollow } from './hooks';
32
-
33
- // Screens
34
- export { default as ProfileScreen } from './screens/ProfileScreen';
35
-
36
- // Navigation
37
- export { default as OxyRouter } from './navigation/OxyRouter';
38
-
39
- // Export stores for advanced usage
40
- export { useAuthStore } from './stores/authStore';
41
-
42
- // Export toast for UI notifications
43
- export { toast } from '../lib/sonner';
9
+ import isFrontend from './isFrontend';
10
+
11
+ // Real UI exports
12
+ let OxyProvider, OxySignInButton, OxyLogo, Avatar, FollowButton, OxyPayButton, FontLoader, setupFonts, OxyIcon, useOxy, useOxyAuth, useOxyUser, useOxyKarma, useOxyPayments, useOxyDevices, useOxyNotifications, useOxySocket, useOxyQR, useOxyIAP, OxyContextProvider, OxyContextState, OxyContextProviderProps, useFollow, ProfileScreen, OxyRouter, useAuthStore, fontFamilies, fontStyles, toast;
13
+ if (isFrontend) {
14
+ OxyProvider = require('./components/OxyProvider').default;
15
+ OxySignInButton = require('./components/OxySignInButton').default;
16
+ OxyLogo = require('./components/OxyLogo').default;
17
+ Avatar = require('./components/Avatar').default;
18
+ FollowButton = require('./components/FollowButton').default;
19
+ OxyPayButton = require('./components/OxyPayButton').default;
20
+ FontLoader = require('./components/FontLoader').FontLoader;
21
+ setupFonts = require('./components/FontLoader').setupFonts;
22
+ OxyIcon = require('./components/icon').OxyIcon;
23
+ useOxy = require('./context/OxyContext').useOxy;
24
+ OxyContextProvider = require('./context/OxyContext').OxyContextProvider;
25
+ OxyContextState = require('./context/OxyContext').OxyContextState;
26
+ OxyContextProviderProps = require('./context/OxyContext').OxyContextProviderProps;
27
+ useFollow = require('./hooks').useFollow;
28
+ ProfileScreen = require('./screens/ProfileScreen').default;
29
+ OxyRouter = require('./navigation/OxyRouter').default;
30
+ useAuthStore = require('./stores/authStore').useAuthStore;
31
+ fontFamilies = require('./styles/fonts').fontFamilies;
32
+ fontStyles = require('./styles/fonts').fontStyles;
33
+ toast = require('../lib/sonner').toast;
34
+ } else {
35
+ // Backend: no-op fallbacks
36
+ const noopComponent = () => null;
37
+ const noopHook = () => ({});
38
+ OxyProvider = noopComponent;
39
+ OxySignInButton = noopComponent;
40
+ OxyLogo = noopComponent;
41
+ Avatar = noopComponent;
42
+ FollowButton = noopComponent;
43
+ OxyPayButton = noopComponent;
44
+ FontLoader = noopComponent;
45
+ setupFonts = () => {};
46
+ OxyIcon = noopComponent;
47
+ useOxy = noopHook;
48
+ OxyContextProvider = noopComponent;
49
+ OxyContextState = {};
50
+ OxyContextProviderProps = {};
51
+ useFollow = noopHook;
52
+ ProfileScreen = noopComponent;
53
+ OxyRouter = noopComponent;
54
+ useAuthStore = noopHook;
55
+ fontFamilies = {};
56
+ fontStyles = {};
57
+ toast = () => {};
58
+ }
59
+ export { OxyProvider, OxySignInButton, OxyLogo, Avatar, FollowButton, OxyPayButton, FontLoader, setupFonts, OxyIcon, useOxy, OxyContextProvider, OxyContextState, OxyContextProviderProps, useFollow, ProfileScreen, OxyRouter, useAuthStore, fontFamilies, fontStyles, toast };
44
60
 
45
61
  // Re-export core services for convenience in UI context
46
62
  export { OxyServices } from '../core';
@@ -1 +1 @@
1
- {"version":3,"names":["default","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","OxyContextProvider","useOxy","OxyContextState","OxyContextProviderProps","fontFamilies","fontStyles","useFollow","ProfileScreen","OxyRouter","useAuthStore","toast","OxyServices"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,0BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,8BAA8B;AACzE,SAASF,OAAO,IAAIG,OAAO,QAAQ,sBAAsB;AACzD,SAASH,OAAO,IAAII,MAAM,QAAQ,qBAAqB;AACvD,SAASJ,OAAO,IAAIK,YAAY,QAAQ,2BAA2B;AACnE,SAASL,OAAO,IAAIM,YAAY,QAAQ,2BAA2B;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,yBAAyB;;AAEhE;AACA,SAASC,OAAO,QAAQ,mBAAmB;AAG3C;AACA,SACEC,kBAAkB,EAClBC,MAAM,EACNC,eAAe,EACfC,uBAAuB,QAClB,sBAAsB;;AAE7B;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;;AAEzD;AACA,cAAc,oBAAoB;;AAElC;AACA,SAASC,SAAS,QAAQ,SAAS;;AAEnC;AACA,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,yBAAyB;;AAElE;AACA,SAASjB,OAAO,IAAIkB,SAAS,QAAQ,wBAAwB;;AAE7D;AACA,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA,SAASC,KAAK,QAAQ,eAAe;;AAErC;AACA,SAASC,WAAW,QAAQ,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["isFrontend","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","useOxy","useOxyAuth","useOxyUser","useOxyKarma","useOxyPayments","useOxyDevices","useOxyNotifications","useOxySocket","useOxyQR","useOxyIAP","OxyContextProvider","OxyContextState","OxyContextProviderProps","useFollow","ProfileScreen","OxyRouter","useAuthStore","fontFamilies","fontStyles","toast","require","default","noopComponent","noopHook","OxyServices"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,cAAc;;AAErC;AACA,IAAIC,WAAW,EAAEC,eAAe,EAAEC,OAAO,EAAEC,MAAM,EAAEC,YAAY,EAAEC,YAAY,EAAEC,UAAU,EAAEC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEC,WAAW,EAAEC,cAAc,EAAEC,aAAa,EAAEC,mBAAmB,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,kBAAkB,EAAEC,eAAe,EAAEC,uBAAuB,EAAEC,SAAS,EAAEC,aAAa,EAAEC,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAEC,UAAU,EAAEC,KAAK;AAEpY,IAAI7B,UAAU,EAAE;EACdC,WAAW,GAAG6B,OAAO,CAAC,0BAA0B,CAAC,CAACC,OAAO;EACzD7B,eAAe,GAAG4B,OAAO,CAAC,8BAA8B,CAAC,CAACC,OAAO;EACjE5B,OAAO,GAAG2B,OAAO,CAAC,sBAAsB,CAAC,CAACC,OAAO;EACjD3B,MAAM,GAAG0B,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;EAC/C1B,YAAY,GAAGyB,OAAO,CAAC,2BAA2B,CAAC,CAACC,OAAO;EAC3DzB,YAAY,GAAGwB,OAAO,CAAC,2BAA2B,CAAC,CAACC,OAAO;EAC3DxB,UAAU,GAAGuB,OAAO,CAAC,yBAAyB,CAAC,CAACvB,UAAU;EAC1DC,UAAU,GAAGsB,OAAO,CAAC,yBAAyB,CAAC,CAACtB,UAAU;EAC1DC,OAAO,GAAGqB,OAAO,CAAC,mBAAmB,CAAC,C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;EACpBT,aAAa,GAAGQ,aAAa;EAC7BP,SAAS,GAAGO,aAAa;EACzBN,YAAY,GAAGO,QAAQ;EACvBN,YAAY,GAAG,CAAC,CAAC;EACjBC,UAAU,GAAG,CAAC,CAAC;EACfC,KAAK,GAAGA,CAAA,KAAM,CAAC,CAAC;AAClB;AAEA,SACE5B,WAAW,EACXC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNU,kBAAkB,EAClBC,eAAe,EACfC,uBAAuB,EACvBC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,KAAK;;AAGP;AACA,SAASK,WAAW,QAAQ,SAAS","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ // Utility to detect if running in a frontend (browser or React Native) environment
4
+ const isFrontend = typeof window !== 'undefined' || typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
5
+ export default isFrontend;
6
+ //# sourceMappingURL=isFrontend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isFrontend","window","navigator","product"],"sourceRoot":"../../../src","sources":["ui/isFrontend.ts"],"mappings":";;AAAA;AACA,MAAMA,UAAU,GAAG,OAAOC,MAAM,KAAK,WAAW,IAC7C,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,OAAO,KAAK,aAAc;AAE3E,eAAeH,UAAU","ignoreList":[]}
@@ -5,14 +5,7 @@
5
5
  * - Frontend: Full UI + Core functionality
6
6
  * - Backend: Core functionality only (UI components are no-ops)
7
7
  */
8
- import OxyCore from './core';
9
- import { OxyServices } from './core';
10
- export default OxyCore;
11
- export { OxyServices };
12
8
  export * from './core';
13
- export { DeviceManager } from './utils';
14
- export type { DeviceFingerprint, StoredDeviceInfo } from './utils';
15
- export * from './models/interfaces';
16
- export * from './models/secureSession';
9
+ export * from './ui';
17
10
  export { toast } from './lib/sonner-safe';
18
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAUrC,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACnE,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,26 +1,5 @@
1
- /**
2
- * UI Component exports - Frontend Only
3
- *
4
- * This module exports all React/React Native UI components and hooks.
5
- * Use this for frontend applications only. For backend usage, import from the main package.
6
- */
7
- export { default as OxyProvider } from './components/OxyProvider';
8
- export { default as OxySignInButton } from './components/OxySignInButton';
9
- export { default as OxyLogo } from './components/OxyLogo';
10
- export { default as Avatar } from './components/Avatar';
11
- export { default as FollowButton } from './components/FollowButton';
12
- export { default as OxyPayButton } from './components/OxyPayButton';
13
- export { FontLoader, setupFonts } from './components/FontLoader';
14
- export { OxyIcon } from './components/icon';
15
- export type { IconProps } from './components/icon';
16
- export { OxyContextProvider, useOxy, OxyContextState, OxyContextProviderProps } from './context/OxyContext';
17
- export { fontFamilies, fontStyles } from './styles/fonts';
18
- export * from './navigation/types';
19
- export { useFollow } from './hooks';
20
- export { default as ProfileScreen } from './screens/ProfileScreen';
21
- export { default as OxyRouter } from './navigation/OxyRouter';
22
- export { useAuthStore } from './stores/authStore';
23
- export { toast } from '../lib/sonner';
1
+ declare let OxyProvider: any, OxySignInButton: any, OxyLogo: any, Avatar: any, FollowButton: any, OxyPayButton: any, FontLoader: any, setupFonts: any, OxyIcon: any, useOxy: any, OxyContextProvider: any, OxyContextState: any, OxyContextProviderProps: any, useFollow: any, ProfileScreen: any, OxyRouter: any, useAuthStore: any, fontFamilies: any, fontStyles: any, toast: any;
2
+ export { OxyProvider, OxySignInButton, OxyLogo, Avatar, FollowButton, OxyPayButton, FontLoader, setupFonts, OxyIcon, useOxy, OxyContextProvider, OxyContextState, OxyContextProviderProps, useFollow, ProfileScreen, OxyRouter, useAuthStore, fontFamilies, fontStyles, toast };
24
3
  export { OxyServices } from '../core';
25
4
  export type { User, LoginResponse, ApiError } from '../models/interfaces';
26
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,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AAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,KAAK,EACN,CAAC;AAGF,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const isFrontend: boolean;
2
+ export default isFrontend;
3
+ //# sourceMappingURL=isFrontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFrontend.d.ts","sourceRoot":"","sources":["../../../src/ui/isFrontend.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU,SAC2D,CAAC;AAE5E,eAAe,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "5.6.6",
3
+ "version": "5.6.8",
4
4
  "description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
package/src/index.ts CHANGED
@@ -6,60 +6,7 @@
6
6
  * - Backend: Core functionality only (UI components are no-ops)
7
7
  */
8
8
 
9
- // ------------- Core Imports (Always Safe) -------------
10
- import OxyCore from './core';
11
- import { OxyServices } from './core';
12
- import { DeviceManager } from './utils/deviceManager';
13
- import * as Models from './models/interfaces';
14
-
15
- // ------------- Environment Detection -------------
16
- const isFrontend = typeof window !== 'undefined' ||
17
- (typeof global !== 'undefined' && global.navigator) ||
18
- (typeof process !== 'undefined' && process.env.NODE_ENV === 'development' && typeof document !== 'undefined');
19
-
20
- // ------------- Core Exports (Always Available) -------------
21
- export default OxyCore;
22
- export { OxyServices };
9
+ // Universal entry: always statically export everything
23
10
  export * from './core';
24
- export { DeviceManager } from './utils';
25
- export type { DeviceFingerprint, StoredDeviceInfo } from './utils';
26
- export * from './models/interfaces';
27
- export * from './models/secureSession';
28
-
29
- // ------------- Safe Toast Export -------------
30
- export { toast } from './lib/sonner-safe';
31
-
32
- // ------------- UI Exports (Conditional) -------------
33
- if (isFrontend) {
34
- // Frontend: Export all UI components
35
- try {
36
- const ui = require('./ui');
37
- Object.keys(ui).forEach(key => {
38
- exports[key] = ui[key];
39
- });
40
- } catch (e) {
41
- // UI import failed, continue without UI
42
- }
43
- } else {
44
- // Backend: Export no-op UI components
45
- const noopComponent = () => null;
46
- const noopHook = () => ({});
47
-
48
- exports.OxyProvider = noopComponent;
49
- exports.OxySignInButton = noopComponent;
50
- exports.OxyLogo = noopComponent;
51
- exports.Avatar = noopComponent;
52
- exports.FollowButton = noopComponent;
53
- exports.OxyPayButton = noopComponent;
54
- exports.FontLoader = { setupFonts: () => {} };
55
- exports.useOxy = noopHook;
56
- exports.useOxyAuth = noopHook;
57
- exports.useOxyUser = noopHook;
58
- exports.useOxyKarma = noopHook;
59
- exports.useOxyPayments = noopHook;
60
- exports.useOxyDevices = noopHook;
61
- exports.useOxyNotifications = noopHook;
62
- exports.useOxySocket = noopHook;
63
- exports.useOxyQR = noopHook;
64
- exports.useOxyIAP = noopHook;
65
- }
11
+ export * from './ui';
12
+ export { toast } from './lib/sonner-safe';
package/src/ui/index.ts CHANGED
@@ -1,51 +1,83 @@
1
1
  /**
2
- * UI Component exports - Frontend Only
2
+ * UI Component exports - Frontend Only (with backend-safe fallbacks)
3
3
  *
4
4
  * This module exports all React/React Native UI components and hooks.
5
- * Use this for frontend applications only. For backend usage, import from the main package.
5
+ * In backend, all exports are no-ops or empty objects.
6
6
  */
7
+ import isFrontend from './isFrontend';
7
8
 
8
- // Export the main provider component and context
9
- export { default as OxyProvider } from './components/OxyProvider';
10
- export { default as OxySignInButton } from './components/OxySignInButton';
11
- export { default as OxyLogo } from './components/OxyLogo';
12
- export { default as Avatar } from './components/Avatar';
13
- export { default as FollowButton } from './components/FollowButton';
14
- export { default as OxyPayButton } from './components/OxyPayButton';
15
- export { FontLoader, setupFonts } from './components/FontLoader';
9
+ // Real UI exports
10
+ let OxyProvider, OxySignInButton, OxyLogo, Avatar, FollowButton, OxyPayButton, FontLoader, setupFonts, OxyIcon, useOxy, useOxyAuth, useOxyUser, useOxyKarma, useOxyPayments, useOxyDevices, useOxyNotifications, useOxySocket, useOxyQR, useOxyIAP, OxyContextProvider, OxyContextState, OxyContextProviderProps, useFollow, ProfileScreen, OxyRouter, useAuthStore, fontFamilies, fontStyles, toast;
16
11
 
17
- // Export icon components
18
- export { OxyIcon } from './components/icon';
19
- export type { IconProps } from './components/icon';
12
+ if (isFrontend) {
13
+ OxyProvider = require('./components/OxyProvider').default;
14
+ OxySignInButton = require('./components/OxySignInButton').default;
15
+ OxyLogo = require('./components/OxyLogo').default;
16
+ Avatar = require('./components/Avatar').default;
17
+ FollowButton = require('./components/FollowButton').default;
18
+ OxyPayButton = require('./components/OxyPayButton').default;
19
+ FontLoader = require('./components/FontLoader').FontLoader;
20
+ setupFonts = require('./components/FontLoader').setupFonts;
21
+ OxyIcon = require('./components/icon').OxyIcon;
22
+ useOxy = require('./context/OxyContext').useOxy;
23
+ OxyContextProvider = require('./context/OxyContext').OxyContextProvider;
24
+ OxyContextState = require('./context/OxyContext').OxyContextState;
25
+ OxyContextProviderProps = require('./context/OxyContext').OxyContextProviderProps;
26
+ useFollow = require('./hooks').useFollow;
27
+ ProfileScreen = require('./screens/ProfileScreen').default;
28
+ OxyRouter = require('./navigation/OxyRouter').default;
29
+ useAuthStore = require('./stores/authStore').useAuthStore;
30
+ fontFamilies = require('./styles/fonts').fontFamilies;
31
+ fontStyles = require('./styles/fonts').fontStyles;
32
+ toast = require('../lib/sonner').toast;
33
+ } else {
34
+ // Backend: no-op fallbacks
35
+ const noopComponent = () => null;
36
+ const noopHook = () => ({});
37
+ OxyProvider = noopComponent;
38
+ OxySignInButton = noopComponent;
39
+ OxyLogo = noopComponent;
40
+ Avatar = noopComponent;
41
+ FollowButton = noopComponent;
42
+ OxyPayButton = noopComponent;
43
+ FontLoader = noopComponent;
44
+ setupFonts = () => {};
45
+ OxyIcon = noopComponent;
46
+ useOxy = noopHook;
47
+ OxyContextProvider = noopComponent;
48
+ OxyContextState = {};
49
+ OxyContextProviderProps = {};
50
+ useFollow = noopHook;
51
+ ProfileScreen = noopComponent;
52
+ OxyRouter = noopComponent;
53
+ useAuthStore = noopHook;
54
+ fontFamilies = {};
55
+ fontStyles = {};
56
+ toast = () => {};
57
+ }
20
58
 
21
- // Export context and hooks
22
59
  export {
23
- OxyContextProvider,
60
+ OxyProvider,
61
+ OxySignInButton,
62
+ OxyLogo,
63
+ Avatar,
64
+ FollowButton,
65
+ OxyPayButton,
66
+ FontLoader,
67
+ setupFonts,
68
+ OxyIcon,
24
69
  useOxy,
70
+ OxyContextProvider,
25
71
  OxyContextState,
26
- OxyContextProviderProps
27
- } from './context/OxyContext';
28
-
29
- // Export styles
30
- export { fontFamilies, fontStyles } from './styles/fonts';
31
-
32
- // Export types for navigation and UI
33
- export * from './navigation/types';
34
-
35
- // Hooks
36
- export { useFollow } from './hooks';
37
-
38
- // Screens
39
- export { default as ProfileScreen } from './screens/ProfileScreen';
40
-
41
- // Navigation
42
- export { default as OxyRouter } from './navigation/OxyRouter';
43
-
44
- // Export stores for advanced usage
45
- export { useAuthStore } from './stores/authStore';
46
-
47
- // Export toast for UI notifications
48
- export { toast } from '../lib/sonner';
72
+ OxyContextProviderProps,
73
+ useFollow,
74
+ ProfileScreen,
75
+ OxyRouter,
76
+ useAuthStore,
77
+ fontFamilies,
78
+ fontStyles,
79
+ toast
80
+ };
49
81
 
50
82
  // Re-export core services for convenience in UI context
51
83
  export { OxyServices } from '../core';
@@ -0,0 +1,5 @@
1
+ // Utility to detect if running in a frontend (browser or React Native) environment
2
+ const isFrontend = typeof window !== 'undefined' ||
3
+ (typeof navigator !== 'undefined' && navigator.product === 'ReactNative');
4
+
5
+ export default isFrontend;