@hoci/core 0.5.1 → 0.5.3
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/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +8 -3
package/dist/index.cjs
CHANGED
|
@@ -502,6 +502,7 @@ const iconProps = shared.defineHookProps({
|
|
|
502
502
|
default: () => "auto"
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
|
+
const isSvg = (src) => src.endsWith(".svg") || src.startsWith("data:image/svg+xml");
|
|
505
506
|
const useIcon = shared.defineHookComponent({
|
|
506
507
|
props: iconProps,
|
|
507
508
|
setup(props, context) {
|
|
@@ -520,7 +521,7 @@ const useIcon = shared.defineHookComponent({
|
|
|
520
521
|
};
|
|
521
522
|
});
|
|
522
523
|
const dynamicStyle = vue.computed(() => {
|
|
523
|
-
const mask = props.mask === "auto" ? props.src
|
|
524
|
+
const mask = props.mask === "auto" ? isSvg(props.src) : props.mask;
|
|
524
525
|
if (!mask) {
|
|
525
526
|
return {
|
|
526
527
|
"background-image": "var(--icon-url)",
|
|
@@ -537,7 +538,7 @@ const useIcon = shared.defineHookComponent({
|
|
|
537
538
|
});
|
|
538
539
|
const staticStyle = vue.computed(() => {
|
|
539
540
|
return {
|
|
540
|
-
"--icon-url": `url(
|
|
541
|
+
"--icon-url": `url("${props.src}")`
|
|
541
542
|
};
|
|
542
543
|
});
|
|
543
544
|
const style = vue.computed(() => {
|
package/dist/index.mjs
CHANGED
|
@@ -501,6 +501,7 @@ const iconProps = defineHookProps({
|
|
|
501
501
|
default: () => "auto"
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
|
+
const isSvg = (src) => src.endsWith(".svg") || src.startsWith("data:image/svg+xml");
|
|
504
505
|
const useIcon = defineHookComponent({
|
|
505
506
|
props: iconProps,
|
|
506
507
|
setup(props, context) {
|
|
@@ -519,7 +520,7 @@ const useIcon = defineHookComponent({
|
|
|
519
520
|
};
|
|
520
521
|
});
|
|
521
522
|
const dynamicStyle = computed(() => {
|
|
522
|
-
const mask = props.mask === "auto" ? props.src
|
|
523
|
+
const mask = props.mask === "auto" ? isSvg(props.src) : props.mask;
|
|
523
524
|
if (!mask) {
|
|
524
525
|
return {
|
|
525
526
|
"background-image": "var(--icon-url)",
|
|
@@ -536,7 +537,7 @@ const useIcon = defineHookComponent({
|
|
|
536
537
|
});
|
|
537
538
|
const staticStyle = computed(() => {
|
|
538
539
|
return {
|
|
539
|
-
"--icon-url": `url(
|
|
540
|
+
"--icon-url": `url("${props.src}")`
|
|
540
541
|
};
|
|
541
542
|
});
|
|
542
543
|
const style = computed(() => {
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoci/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "Chizuki <chizukicn@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/chizukicn/hoci",
|
|
10
|
+
"directory": "packages/core"
|
|
11
|
+
},
|
|
7
12
|
"exports": {
|
|
8
13
|
".": {
|
|
9
14
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +30,7 @@
|
|
|
25
30
|
"@vueuse/core": ">=10.5.0",
|
|
26
31
|
"maybe-types": "^0.1.0",
|
|
27
32
|
"tslx": "^0.1.1",
|
|
28
|
-
"@hoci/shared": "0.5.
|
|
33
|
+
"@hoci/shared": "0.5.3"
|
|
29
34
|
},
|
|
30
35
|
"scripts": {
|
|
31
36
|
"build": "unbuild",
|