@atls/react-app-links 0.0.2 → 0.0.4

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,3 @@
1
+ import type { FC } from 'react';
2
+ import type { AppLinkProps } from './app-url.interfaces';
3
+ export declare const AppLink: FC<AppLinkProps>;
@@ -4,12 +4,10 @@ exports.AppLink = void 0;
4
4
  const use_app_url_hook_1 = require("./use-app-url.hook");
5
5
  const AppLink = ({ children, subdomain, pathname }) => {
6
6
  const url = (0, use_app_url_hook_1.useAppUrl)({ subdomain, pathname });
7
- if (!children || !url) {
7
+ if (!children || !url)
8
8
  return null;
9
- }
10
- if (typeof children !== 'function') {
9
+ if (typeof children !== 'function')
11
10
  throw new Error('AppLink - children must be a function.');
12
- }
13
11
  return children(url);
14
12
  };
15
13
  exports.AppLink = AppLink;
@@ -0,0 +1,7 @@
1
+ export interface UseAppUrlProps {
2
+ subdomain?: string;
3
+ pathname?: string;
4
+ }
5
+ export interface AppLinkProps extends UseAppUrlProps {
6
+ children?: (value: string) => JSX.Element;
7
+ }
@@ -0,0 +1,3 @@
1
+ export * from './app-link.component';
2
+ export * from './app-url.interfaces';
3
+ export * from './use-app-url.hook';
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -0,0 +1,2 @@
1
+ import type { UseAppUrlProps } from './app-url.interfaces';
2
+ export declare const useAppUrl: ({ subdomain, pathname }?: UseAppUrlProps) => string | null;
@@ -0,0 +1,3 @@
1
+ import type { EffectCallback } from 'react';
2
+ import type { DependencyList } from 'react';
3
+ export declare const useBrowserEffect: (effect: EffectCallback, deps?: DependencyList) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atls/react-app-links",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "license": "BSD-3-Clause",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -18,11 +18,12 @@
18
18
  "@testing-library/jest-dom": "^5.16.1",
19
19
  "@testing-library/react": "^12.1.2",
20
20
  "@testing-library/react-hooks": "^7.0.2",
21
- "@types/react": "^17.0.38",
22
- "@types/react-dom": "^17.0.11",
21
+ "@types/react": "18.3.6",
22
+ "@types/react-dom": "18.2.7",
23
23
  "@types/testing-library__jest-dom": "^5.14.2",
24
- "react": "^17.0.2",
25
- "react-dom": "^17.0.2"
24
+ "@types/tldjs": "2.3.4",
25
+ "react": "^18.2.0",
26
+ "react-dom": "^18.2.0"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "react": "^17.0.1"