@viewfly/router 0.0.14 → 0.0.16

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.
@@ -260,18 +260,7 @@ function Link(props) {
260
260
  attrs.href = navigator.join(props.to, router, props.queryParams);
261
261
  }
262
262
  if (isActive() && props.active) {
263
- if (!attrs.class) {
264
- attrs.class = props.active.toString();
265
- }
266
- else if (typeof attrs.class === 'string') {
267
- attrs.class += ' ' + props.active;
268
- }
269
- else if (Array.isArray(attrs.class)) {
270
- attrs.class.push(props.active);
271
- }
272
- else if (typeof attrs.class === 'object') {
273
- attrs.class[props.active] = true;
274
- }
263
+ attrs.class = [attrs.class, props.active];
275
264
  }
276
265
  return jsx(Tag, Object.assign({}, attrs, { children: props.children }));
277
266
  };
package/bundles/index.js CHANGED
@@ -262,18 +262,7 @@ function Link(props) {
262
262
  attrs.href = navigator.join(props.to, router, props.queryParams);
263
263
  }
264
264
  if (isActive() && props.active) {
265
- if (!attrs.class) {
266
- attrs.class = props.active.toString();
267
- }
268
- else if (typeof attrs.class === 'string') {
269
- attrs.class += ' ' + props.active;
270
- }
271
- else if (Array.isArray(attrs.class)) {
272
- attrs.class.push(props.active);
273
- }
274
- else if (typeof attrs.class === 'object') {
275
- attrs.class[props.active] = true;
276
- }
265
+ attrs.class = [attrs.class, props.active];
277
266
  }
278
267
  return jsxRuntime.jsx(Tag, Object.assign({}, attrs, { children: props.children }));
279
268
  };
package/bundles/link.d.ts CHANGED
@@ -7,4 +7,4 @@ export interface LinkProps extends Props {
7
7
  queryParams?: QueryParams;
8
8
  tag?: string;
9
9
  }
10
- export declare function Link(props: LinkProps): () => any;
10
+ export declare function Link(props: LinkProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { ComponentSetup } from '@viewfly/core';
1
+ import { JSXInternal } from '@viewfly/core';
2
2
  import { Observable } from '@tanbo/stream';
3
3
  import { Navigator, QueryParams } from './navigator';
4
4
  export interface RouteConfig {
5
5
  name: string;
6
- component: ComponentSetup | Promise<ComponentSetup>;
6
+ component: JSXInternal.ElementClass | Promise<JSXInternal.ElementClass>;
7
7
  beforeEach?(): boolean | Promise<boolean>;
8
8
  }
9
9
  export declare class Router {
@@ -1,6 +1,6 @@
1
- import { JSXChildNode, Props } from '@viewfly/core';
1
+ import { Props, JSXInternal } from '@viewfly/core';
2
2
  export interface RootRouterProps extends Props {
3
3
  basePath?: string;
4
- children?: JSXChildNode;
4
+ children?: JSXInternal.JSXChildNode;
5
5
  }
6
- export declare function RootRouter(props: RootRouterProps): () => any;
6
+ export declare function RootRouter(props: RootRouterProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ import { RouteConfig } from './providers/_api';
3
3
  export interface RouterOutletProps extends Props {
4
4
  config: RouteConfig[];
5
5
  }
6
- export declare function RouterOutlet(props: RouterOutletProps): () => any;
6
+ export declare function RouterOutlet(props: RouterOutletProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/router",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -13,7 +13,7 @@
13
13
  "keywords": [],
14
14
  "dependencies": {
15
15
  "@tanbo/stream": "^1.2.0",
16
- "@viewfly/core": "^0.0.14",
16
+ "@viewfly/core": "^0.0.16",
17
17
  "url": "^0.11.1"
18
18
  },
19
19
  "devDependencies": {
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/viewfly/viewfly.git/issues"
36
36
  },
37
- "gitHead": "bc795457277616f7f448bae91360eb11baf1ad6b"
37
+ "gitHead": "424aee30ec55010f16a8e055222d42b07fae4b38"
38
38
  }