@asgardeo/browser 0.1.16 → 0.1.18

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { ThemeMode } from '@asgardeo/javascript';
19
+ import { BrowserThemeDetection } from './themeDetection';
20
+ /**
21
+ * Gets the active theme based on the theme mode preference
22
+ * @param mode - The theme mode preference ('light', 'dark', 'system', or 'class')
23
+ * @param config - Additional configuration for theme detection
24
+ * @returns 'light' or 'dark' based on the resolved theme
25
+ */
26
+ declare const getActiveTheme: (mode: ThemeMode, config?: BrowserThemeDetection) => ThemeMode;
27
+ export default getActiveTheme;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * Navigates to a new URL within the browser.
20
+ *
21
+ * - For same-origin URLs (relative paths or absolute URLs with the same origin),
22
+ * uses the History API and dispatches a `popstate` event (SPA navigation).
23
+ * - For cross-origin URLs, performs a full page load using `window.location.assign`.
24
+ *
25
+ * This allows seamless navigation for both SPA routes and external links.
26
+ *
27
+ * @param url - The target URL to navigate to. Can be a path, query, or absolute URL.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // SPA navigation (same origin)
32
+ * navigate('/dashboard');
33
+ *
34
+ * // SPA navigation with query
35
+ * navigate('/search?q=asgardeo');
36
+ *
37
+ * // Cross-origin navigation (full page load)
38
+ * navigate('https://accounts.asgardeo.io/t/dxlab/accountrecoveryendpoint/register.do');
39
+ * ```
40
+ */
41
+ declare const navigate: (url: string) => void;
42
+ export default navigate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/browser",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Browser-specific implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -60,7 +60,7 @@
60
60
  "randombytes": "^2.1.0",
61
61
  "stream-browserify": "^3.0.0",
62
62
  "tslib": "^2.8.1",
63
- "@asgardeo/javascript": "^0.1.15"
63
+ "@asgardeo/javascript": "^0.1.17"
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"