solid-navigator 0.3.10 → 0.3.11

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.
package/dist/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, createEffect, on, useContext } from 'solid-js';
1
+ import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, splitProps, createEffect, on, useContext } from 'solid-js';
2
2
  import { delegateEvents, createComponent, spread, mergeProps as mergeProps$1, template } from 'solid-js/web';
3
3
  import { createStore, reconcile } from 'solid-js/store';
4
4
 
@@ -370,8 +370,9 @@ var matchComponent = (name) => {
370
370
  return component();
371
371
  });
372
372
  };
373
- var _tmpl$ = /* @__PURE__ */ template(`<a sn-link>`);
373
+ var _tmpl$ = /* @__PURE__ */ template(`<a>`);
374
374
  var A = (props) => {
375
+ const [, rest] = splitProps(props, ["href", "state"]);
375
376
  const location2 = useLocation();
376
377
  const resolvedHref = () => {
377
378
  if (!props.href)
@@ -388,12 +389,13 @@ var A = (props) => {
388
389
  };
389
390
  return (() => {
390
391
  var _el$ = _tmpl$();
391
- spread(_el$, mergeProps$1(props, {
392
- get ["d-state"]() {
393
- return JSON.stringify(props.state);
394
- },
392
+ spread(_el$, mergeProps$1(rest, {
395
393
  get href() {
396
394
  return resolvedHref();
395
+ },
396
+ "sn-link": "",
397
+ get ["d-state"]() {
398
+ return JSON.stringify(props.state);
397
399
  }
398
400
  }), false, false);
399
401
  return _el$;
package/dist/dev.jsx CHANGED
@@ -384,8 +384,9 @@ var matchComponent = (name) => {
384
384
  };
385
385
 
386
386
  // src/Link.tsx
387
- import { createMemo as createMemo5 } from "solid-js";
387
+ import { createMemo as createMemo5, splitProps } from "solid-js";
388
388
  var A = (props) => {
389
+ const [, rest] = splitProps(props, ["href", "state"]);
389
390
  const location2 = useLocation();
390
391
  const resolvedHref = () => {
391
392
  if (!props.href)
@@ -400,7 +401,12 @@ var A = (props) => {
400
401
  }
401
402
  return newPath;
402
403
  };
403
- return <a sn-link {...props} d-state={JSON.stringify(props.state)} href={resolvedHref()} />;
404
+ return <a
405
+ {...rest}
406
+ href={resolvedHref()}
407
+ sn-link
408
+ d-state={JSON.stringify(props.state)}
409
+ />;
404
410
  };
405
411
  var useMatch = (path) => {
406
412
  const location2 = useLocation();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, createEffect, on, useContext } from 'solid-js';
1
+ import { createContext, children, createMemo, createSignal, onCleanup, batch, mergeProps, splitProps, createEffect, on, useContext } from 'solid-js';
2
2
  import { delegateEvents, createComponent, spread, mergeProps as mergeProps$1, template } from 'solid-js/web';
3
3
  import { createStore, reconcile } from 'solid-js/store';
4
4
 
@@ -366,8 +366,9 @@ var matchComponent = (name) => {
366
366
  return component();
367
367
  });
368
368
  };
369
- var _tmpl$ = /* @__PURE__ */ template(`<a sn-link>`);
369
+ var _tmpl$ = /* @__PURE__ */ template(`<a>`);
370
370
  var A = (props) => {
371
+ const [, rest] = splitProps(props, ["href", "state"]);
371
372
  const location2 = useLocation();
372
373
  const resolvedHref = () => {
373
374
  if (!props.href)
@@ -384,12 +385,13 @@ var A = (props) => {
384
385
  };
385
386
  return (() => {
386
387
  var _el$ = _tmpl$();
387
- spread(_el$, mergeProps$1(props, {
388
- get ["d-state"]() {
389
- return JSON.stringify(props.state);
390
- },
388
+ spread(_el$, mergeProps$1(rest, {
391
389
  get href() {
392
390
  return resolvedHref();
391
+ },
392
+ "sn-link": "",
393
+ get ["d-state"]() {
394
+ return JSON.stringify(props.state);
393
395
  }
394
396
  }), false, false);
395
397
  return _el$;
package/dist/index.jsx CHANGED
@@ -381,8 +381,9 @@ var matchComponent = (name) => {
381
381
  };
382
382
 
383
383
  // src/Link.tsx
384
- import { createMemo as createMemo5 } from "solid-js";
384
+ import { createMemo as createMemo5, splitProps } from "solid-js";
385
385
  var A = (props) => {
386
+ const [, rest] = splitProps(props, ["href", "state"]);
386
387
  const location2 = useLocation();
387
388
  const resolvedHref = () => {
388
389
  if (!props.href)
@@ -397,7 +398,12 @@ var A = (props) => {
397
398
  }
398
399
  return newPath;
399
400
  };
400
- return <a sn-link {...props} d-state={JSON.stringify(props.state)} href={resolvedHref()} />;
401
+ return <a
402
+ {...rest}
403
+ href={resolvedHref()}
404
+ sn-link
405
+ d-state={JSON.stringify(props.state)}
406
+ />;
401
407
  };
402
408
  var useMatch = (path) => {
403
409
  const location2 = useLocation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-navigator",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Solid Navigator is a library that is inspired by vue router and solid router.",
5
5
  "license": "MIT",
6
6
  "author": "SupertigerDev",