@esportsplus/template 0.19.6 → 0.19.7

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/build/svg.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import html from './html/index.js';
2
2
  declare const svg: typeof html & {
3
- sprite: (symbol: string) => ReturnType<typeof html>;
3
+ sprite: (href: string) => ReturnType<typeof html>;
4
4
  };
5
5
  export default svg;
package/build/svg.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import html from './html/index.js';
2
2
  const svg = html.bind(null);
3
- svg.sprite = (symbol) => {
4
- if (symbol[0] !== '#') {
5
- symbol = '#' + symbol;
3
+ svg.sprite = (href) => {
4
+ if (href[0] !== '#') {
5
+ href = '#' + href;
6
6
  }
7
- return html `<svg><use xlink:href='${symbol}' /></svg>`;
7
+ return html `<svg><use ${{ ['href']: href }} /></svg>`;
8
8
  };
9
9
  export default svg;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "private": false,
15
15
  "type": "module",
16
16
  "types": "./build/index.d.ts",
17
- "version": "0.19.6",
17
+ "version": "0.19.7",
18
18
  "scripts": {
19
19
  "build": "tsc && tsc-alias",
20
20
  "-": "-"
package/src/svg.ts CHANGED
@@ -2,15 +2,15 @@ import html from './html';
2
2
 
3
3
 
4
4
  const svg = html.bind(null) as typeof html & {
5
- sprite: (symbol: string) => ReturnType<typeof html>
5
+ sprite: (href: string) => ReturnType<typeof html>
6
6
  };
7
7
 
8
- svg.sprite = (symbol: string) => {
9
- if (symbol[0] !== '#') {
10
- symbol = '#' + symbol;
8
+ svg.sprite = (href: string) => {
9
+ if (href[0] !== '#') {
10
+ href = '#' + href;
11
11
  }
12
12
 
13
- return html`<svg><use xlink:href='${symbol}' /></svg>`;
13
+ return html`<svg><use ${{ ['href']: href }} /></svg>`;
14
14
  };
15
15
 
16
16