unity-webgl
Advanced tools
Comparing version
/*! | ||
* unity-webgl.js v3.5.2 | ||
* (c) 2023 Mervin<mengqing723@gmail.com> | ||
* (c) 2024 Mervin<mengqing723@gmail.com> | ||
* Released under the MIT License. | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* unity-webgl.js v3.5.2 | ||
* (c) 2023 Mervin<mengqing723@gmail.com> | ||
* (c) 2024 Mervin<mengqing723@gmail.com> | ||
* Released under the MIT License. | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* unity-webgl.js v3.5.2 | ||
* (c) 2023 Mervin<mengqing723@gmail.com> | ||
* (c) 2024 Mervin<mengqing723@gmail.com> | ||
* Released under the MIT License. | ||
@@ -5,0 +5,0 @@ */ |
{ | ||
"name": "unity-webgl", | ||
"version": "3.5.2", | ||
"version": "3.5.3", | ||
"description": "Unity-Webgl provides an easy solution for embedding Unity WebGL builds in your webApp or Vue.js project, with two-way communication between your webApp and Unity application with advanced API's.", | ||
@@ -30,2 +30,3 @@ "main": "dist/index.js", | ||
], | ||
"treeShaking": true, | ||
"scripts": { | ||
@@ -58,2 +59,6 @@ "clean": "rimraf -rf ./dist && rimraf -rf ./vue", | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"devDependencies": { | ||
@@ -60,0 +65,0 @@ "@vue/composition-api": "^1.7.0", |
@@ -304,2 +304,3 @@ # unity-webgl | ||
- `height` : canvas element height, default: `100%` | ||
- `tabindex` : Set the Canvas element tabindex. | ||
@@ -306,0 +307,0 @@ |
@@ -313,2 +313,3 @@ # unity-webgl | ||
- `height` : canvas元素高度, default: `100%` | ||
- `tabindex` : 设置Canvas元素tabindex | ||
@@ -315,0 +316,0 @@ |
@@ -15,2 +15,5 @@ import { PropType } from 'vue-demi'; | ||
}; | ||
tabindex: { | ||
type: PropType<string | number>; | ||
}; | ||
}, () => import("vue-demi").VNode<import("vue-demi").RendererNode, import("vue-demi").RendererElement, { | ||
@@ -30,2 +33,5 @@ [key: string]: any; | ||
}; | ||
tabindex: { | ||
type: PropType<string | number>; | ||
}; | ||
}>>, { | ||
@@ -32,0 +38,0 @@ width: string | number; |
@@ -5,13 +5,3 @@ import { defineComponent, ref, computed, onMounted, onBeforeUnmount, h, isVue2 } from 'vue-demi'; | ||
function cssUnit(val) { | ||
const regx = /^\d+(px|em|%|vw|vh|rem)?$/; | ||
if (typeof val === 'number') { | ||
return val + 'px'; | ||
} | ||
else { | ||
return regx.test(val) | ||
? isNaN(val) | ||
? val | ||
: val + 'px' | ||
: '100%'; | ||
} | ||
return isNaN(val) ? val : val + 'px'; | ||
} | ||
@@ -31,2 +21,5 @@ var index = defineComponent({ | ||
default: '100%' | ||
}, | ||
tabindex: { | ||
type: Number | ||
} | ||
@@ -43,2 +36,8 @@ }, | ||
}); | ||
const attrs = { | ||
id: `unity-canvas-${unityInstanceIdentifier}` | ||
}; | ||
if (props.tabindex || props.tabindex === 0) { | ||
attrs.tabindex = props.tabindex; | ||
} | ||
onMounted(() => { | ||
@@ -57,12 +56,6 @@ var _a; | ||
ref: canvas, | ||
attrs: { | ||
id: `unity-canvas-${unityInstanceIdentifier}` | ||
}, | ||
attrs, | ||
style: canvasStyle.value | ||
} | ||
: { | ||
ref: canvas, | ||
id: `unity-canvas-${unityInstanceIdentifier}`, | ||
style: canvasStyle.value | ||
}); | ||
: Object.assign({ ref: canvas, style: canvasStyle.value }, attrs)); | ||
} | ||
@@ -69,0 +62,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
var VueUnity=function(e){"use strict";let t=0;function n(e){return"number"==typeof e?e+"px":/^\d+(px|em|%|vw|vh|rem)?$/.test(e)?isNaN(e)?e:e+"px":"100%"}return e.defineComponent({name:"UnityWebglComponent",props:{unity:{type:Object},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"}},setup(u){const i=e.ref(null);t++;const r=e.computed((()=>({width:n(u.width),height:n(u.height)})));return e.onMounted((()=>{var e;i.value&&(null===(e=u.unity)||void 0===e||e.create(i.value))})),e.onBeforeUnmount((()=>{var e;null===(e=u.unity)||void 0===e||e._unsafe_unload()})),()=>e.h("canvas",e.isVue2?{ref:i,attrs:{id:`unity-canvas-${t}`},style:r.value}:{ref:i,id:`unity-canvas-${t}`,style:r.value})}})}(VueDemi); | ||
var VueUnity=function(e){"use strict";let t=0;function n(e){return isNaN(e)?e:e+"px"}return e.defineComponent({name:"UnityWebglComponent",props:{unity:{type:Object},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},tabindex:{type:Number}},setup(u){const i=e.ref(null);t++;const a=e.computed((()=>({width:n(u.width),height:n(u.height)}))),r={id:`unity-canvas-${t}`};return(u.tabindex||0===u.tabindex)&&(r.tabindex=u.tabindex),e.onMounted((()=>{var e;i.value&&(null===(e=u.unity)||void 0===e||e.create(i.value))})),e.onBeforeUnmount((()=>{var e;null===(e=u.unity)||void 0===e||e._unsafe_unload()})),()=>e.h("canvas",e.isVue2?{ref:i,attrs:r,style:a.value}:Object.assign({ref:i,style:a.value},r))}})}(VueDemi); |
@@ -7,13 +7,3 @@ 'use strict'; | ||
function cssUnit(val) { | ||
const regx = /^\d+(px|em|%|vw|vh|rem)?$/; | ||
if (typeof val === 'number') { | ||
return val + 'px'; | ||
} | ||
else { | ||
return regx.test(val) | ||
? isNaN(val) | ||
? val | ||
: val + 'px' | ||
: '100%'; | ||
} | ||
return isNaN(val) ? val : val + 'px'; | ||
} | ||
@@ -33,2 +23,5 @@ var index = vueDemi.defineComponent({ | ||
default: '100%' | ||
}, | ||
tabindex: { | ||
type: Number | ||
} | ||
@@ -45,2 +38,8 @@ }, | ||
}); | ||
const attrs = { | ||
id: `unity-canvas-${unityInstanceIdentifier}` | ||
}; | ||
if (props.tabindex || props.tabindex === 0) { | ||
attrs.tabindex = props.tabindex; | ||
} | ||
vueDemi.onMounted(() => { | ||
@@ -59,12 +58,6 @@ var _a; | ||
ref: canvas, | ||
attrs: { | ||
id: `unity-canvas-${unityInstanceIdentifier}` | ||
}, | ||
attrs, | ||
style: canvasStyle.value | ||
} | ||
: { | ||
ref: canvas, | ||
id: `unity-canvas-${unityInstanceIdentifier}`, | ||
style: canvasStyle.value | ||
}); | ||
: Object.assign({ ref: canvas, style: canvasStyle.value }, attrs)); | ||
} | ||
@@ -71,0 +64,0 @@ }); |
102129
0.07%438
0.23%1284
-0.62%