提交 362b8057 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 0ce42fd4
{"version":3,"sources":["/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/guoshengqiang/Documents/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import Log from 'android.util.Log'\nimport { login } from './login.uts'\nexport class User {\n async login(name: string, pwd: string) {\n login(name, pwd)\n Log.info('123')\n }\n}\n","export function login(name: string, pwd: string) {\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA,OAAgB,gBAAkB,CAAA;ACA3B,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;;ADCf,WAAM,IAAI;IACf,iBAAM,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;;CAElB"}
\ No newline at end of file
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import Log from 'android.util.Log'\nimport { login } from './login.uts'\nexport class User {\n async login(name: string, pwd: string) {\n login(name, pwd)\n Log.info('123')\n }\n}\n","export function login(name: string, pwd: string) {\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA,OAAgB,gBAAkB,CAAA;ACA3B,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;;ADCf,WAAM,IAAI;IACf,iBAAM,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;;CAElB"}
\ No newline at end of file
......@@ -239,7 +239,7 @@ function initUtsProxyClass({ package: pkg, class: cls, methods, props, staticPro
}
else if (shared.hasOwn(staticMethods, name)) {
// 静态方法
target[name] = initUtsStaticMethod(!!staticMethods[name].async, shared.extend({ name }, baseOptions));
target[name] = initUtsStaticMethod(!!staticMethods[name].async, shared.extend({ name, companion: true }, baseOptions));
}
else if (props.includes(name)) {
// 实例属性
......@@ -247,7 +247,7 @@ function initUtsProxyClass({ package: pkg, class: cls, methods, props, staticPro
}
else if (staticProps.includes(name)) {
// 静态属性
return invokePropGetter(shared.extend({ name: name }, baseOptions));
return invokePropGetter(shared.extend({ name: name, companion: true }, baseOptions));
}
}
return target[name];
......
......@@ -180,6 +180,10 @@ declare interface ProxyBaseOptions {
* 属性名或方法名
*/
name: string;
/**
* 是否是伴生对象
*/
companion?: boolean;
}
declare interface ProxyClassOptions {
......
......@@ -207,7 +207,7 @@ function initUtsProxyClass({ package: pkg, class: cls, methods, props, staticPro
}
else if (hasOwn(staticMethods, name)) {
// 静态方法
target[name] = initUtsStaticMethod(!!staticMethods[name].async, extend({ name }, baseOptions));
target[name] = initUtsStaticMethod(!!staticMethods[name].async, extend({ name, companion: true }, baseOptions));
}
else if (props.includes(name)) {
// 实例属性
......@@ -215,7 +215,7 @@ function initUtsProxyClass({ package: pkg, class: cls, methods, props, staticPro
}
else if (staticProps.includes(name)) {
// 静态属性
return invokePropGetter(extend({ name: name }, baseOptions));
return invokePropGetter(extend({ name: name, companion: true }, baseOptions));
}
}
return target[name];
......
......@@ -29,6 +29,10 @@ interface ProxyBaseOptions {
* 属性名或方法名
*/
name: string
/**
* 是否是伴生对象
*/
companion?: boolean
}
interface ProxyInstanceOptions extends ProxyBaseOptions {
......@@ -234,7 +238,7 @@ export function initUtsProxyClass({
// 静态方法
target[name] = initUtsStaticMethod(
!!staticMethods[name].async,
extend({ name }, baseOptions)
extend({ name, companion: true }, baseOptions)
)
} else if (props.includes(name as string)) {
// 实例属性
......@@ -242,7 +246,7 @@ export function initUtsProxyClass({
} else if (staticProps.includes(name as string)) {
// 静态属性
return invokePropGetter(
extend({ name: name as string }, baseOptions)
extend({ name: name as string, companion: true }, baseOptions)
)
}
}
......
......@@ -7896,6 +7896,10 @@ const props$8 = {
src: {
type: String,
default: ""
},
fullscreen: {
type: Boolean,
default: true
}
};
var index$d = /* @__PURE__ */ defineBuiltInComponent({
......@@ -7915,7 +7919,9 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
});
let _resize;
return () => {
return vue.createVNode(vue.Fragment, null, [vue.createVNode("uni-web-view", vue.mergeProps($listeners.value, $excludeAttrs.value, {
return vue.createVNode(vue.Fragment, null, [vue.createVNode("uni-web-view", vue.mergeProps({
"class": props2.fullscreen ? "uni-webview--fullscreen" : ""
}, $listeners.value, $excludeAttrs.value, {
"ref": rootRef
}), [vue.createVNode(ResizeSensor, {
"onResize": _resize
......@@ -10700,7 +10706,8 @@ function useState() {
"--window-margin": value + "px"
}));
return {
layoutState: layoutState2
layoutState: layoutState2,
windowState: vue.computed(() => ({}))
};
}
const topWindowMediaQuery = vue.ref(false);
......@@ -10749,14 +10756,14 @@ function useState() {
vue.watch(() => layoutState.rightWindowWidth + layoutState.marginWidth, (value) => updateCssVar({
"--window-right": value + "px"
}));
const windowState = vue.reactive({
const windowState = vue.computed(() => ({
matchTopWindow: layoutState.topWindowMediaQuery,
showTopWindow: layoutState.showTopWindow || layoutState.apiShowTopWindow,
matchLeftWindow: layoutState.leftWindowMediaQuery,
showLeftWindow: layoutState.showLeftWindow || layoutState.apiShowLeftWindow,
matchRightWindow: layoutState.rightWindowMediaQuery,
showRightWindow: layoutState.showRightWindow || layoutState.apiShowRightWindow
});
}));
return {
layoutState,
windowState
......@@ -10767,9 +10774,9 @@ function createLayoutTsx(keepAliveRoute, layoutState, windowState, topWindow, le
if (!__UNI_FEATURE_RESPONSIVE__) {
return routerVNode;
}
const topWindowTsx = __UNI_FEATURE_TOPWINDOW__ ? createTopWindowTsx(topWindow, layoutState, windowState) : null;
const leftWindowTsx = __UNI_FEATURE_LEFTWINDOW__ ? createLeftWindowTsx(leftWindow, layoutState, windowState) : null;
const rightWindowTsx = __UNI_FEATURE_RIGHTWINDOW__ ? createRightWindowTsx(rightWindow, layoutState, windowState) : null;
const topWindowTsx = __UNI_FEATURE_TOPWINDOW__ ? createTopWindowTsx(topWindow, layoutState, windowState.value) : null;
const leftWindowTsx = __UNI_FEATURE_LEFTWINDOW__ ? createLeftWindowTsx(leftWindow, layoutState, windowState.value) : null;
const rightWindowTsx = __UNI_FEATURE_RIGHTWINDOW__ ? createRightWindowTsx(rightWindow, layoutState, windowState.value) : null;
return vue.createVNode("uni-layout", {
"class": {
"uni-app--showtopwindow": __UNI_FEATURE_TOPWINDOW__ && layoutState.showTopWindow,
......
......@@ -15304,6 +15304,10 @@ const props$f = {
src: {
type: String,
default: ""
},
fullscreen: {
type: Boolean,
default: true
}
};
var index$d = /* @__PURE__ */ defineBuiltInComponent({
......@@ -15335,13 +15339,18 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
watchEffect(() => {
iframe.src = getRealPath(props2.src);
});
document.body.appendChild(iframe);
iframeRef.value = iframe;
_resize = useWebViewSize(rootRef, iframeRef);
_resize = useWebViewSize(rootRef, iframe, props2.fullscreen);
if (props2.fullscreen) {
document.body.appendChild(iframe);
} else {
iframeRef.value = iframe;
}
};
renderIframe();
onMounted(() => {
var _a;
_resize();
!props2.fullscreen && ((_a = rootRef.value) == null ? void 0 : _a.appendChild(iframeRef.value));
});
onActivated(() => {
iframeRef.value && (iframeRef.value.style.display = "block");
......@@ -15350,10 +15359,12 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
iframeRef.value && (iframeRef.value.style.display = "none");
});
onBeforeUnmount(() => {
document.body.removeChild(iframeRef.value);
iframeRef.value && document.body.removeChild(iframeRef.value);
});
return () => {
return createVNode(Fragment, null, [createVNode("uni-web-view", mergeProps($listeners.value, $excludeAttrs.value, {
return createVNode(Fragment, null, [createVNode("uni-web-view", mergeProps({
"class": props2.fullscreen ? "uni-webview--fullscreen" : ""
}, $listeners.value, $excludeAttrs.value, {
"ref": rootRef
}), [createVNode(ResizeSensor, {
"onResize": _resize
......@@ -15361,23 +15372,31 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
function useWebViewSize(rootRef, iframeRef) {
function useWebViewSize(rootRef, iframe, fullscreen) {
const _resize = () => {
const {
top,
left,
width,
height
} = rootRef.value.getBoundingClientRect();
iframeRef.value && updateElementStyle(iframeRef.value, {
position: "absolute",
display: "block",
border: "0",
top: top + "px",
left: left + "px",
width: width + "px",
height: height + "px"
});
var _a, _b;
if (fullscreen) {
const {
top,
left,
width,
height
} = rootRef.value.getBoundingClientRect();
updateElementStyle(iframe, {
position: "absolute",
display: "block",
border: "0",
top: top + "px",
left: left + "px",
width: width + "px",
height: height + "px"
});
} else {
updateElementStyle(iframe, {
width: ((_a = rootRef.value) == null ? void 0 : _a.style.width) || "300px",
height: ((_b = rootRef.value) == null ? void 0 : _b.style.height) || "150px"
});
}
};
return _resize;
}
......@@ -20140,7 +20159,8 @@ function useState() {
"--window-margin": value + "px"
}));
return {
layoutState: layoutState2
layoutState: layoutState2,
windowState: computed(() => ({}))
};
}
const topWindowMediaQuery = ref(false);
......@@ -20193,14 +20213,14 @@ function useState() {
watch(() => layoutState.rightWindowWidth + layoutState.marginWidth, (value) => updateCssVar({
"--window-right": value + "px"
}));
const windowState = reactive({
const windowState = computed(() => ({
matchTopWindow: layoutState.topWindowMediaQuery,
showTopWindow: layoutState.showTopWindow || layoutState.apiShowTopWindow,
matchLeftWindow: layoutState.leftWindowMediaQuery,
showLeftWindow: layoutState.showLeftWindow || layoutState.apiShowLeftWindow,
matchRightWindow: layoutState.rightWindowMediaQuery,
showRightWindow: layoutState.showRightWindow || layoutState.apiShowRightWindow
});
}));
return {
layoutState,
windowState
......@@ -20211,9 +20231,9 @@ function createLayoutTsx(keepAliveRoute, layoutState, windowState, topWindow, le
if (!__UNI_FEATURE_RESPONSIVE__) {
return routerVNode;
}
const topWindowTsx = __UNI_FEATURE_TOPWINDOW__ ? createTopWindowTsx(topWindow, layoutState, windowState) : null;
const leftWindowTsx = __UNI_FEATURE_LEFTWINDOW__ ? createLeftWindowTsx(leftWindow, layoutState, windowState) : null;
const rightWindowTsx = __UNI_FEATURE_RIGHTWINDOW__ ? createRightWindowTsx(rightWindow, layoutState, windowState) : null;
const topWindowTsx = __UNI_FEATURE_TOPWINDOW__ ? createTopWindowTsx(topWindow, layoutState, windowState.value) : null;
const leftWindowTsx = __UNI_FEATURE_LEFTWINDOW__ ? createLeftWindowTsx(leftWindow, layoutState, windowState.value) : null;
const rightWindowTsx = __UNI_FEATURE_RIGHTWINDOW__ ? createRightWindowTsx(rightWindow, layoutState, windowState.value) : null;
return createVNode("uni-layout", {
"class": {
"uni-app--showtopwindow": __UNI_FEATURE_TOPWINDOW__ && layoutState.showTopWindow,
......
......@@ -65,9 +65,9 @@ export default /*#__PURE__*/ defineBuiltInComponent({
iframe.src = getRealPath(props.src)
})
_resize = useWebViewSize(rootRef, iframe, props.fullscreen)
if(props.fullscreen){
if (props.fullscreen) {
document.body.appendChild(iframe)
}else{
} else {
iframeRef.value = iframe
}
}
......@@ -94,7 +94,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
return (
<>
<uni-web-view
class={props.fullscreen ? 'uni-webview--fullscreen': ''}
class={props.fullscreen ? 'uni-webview--fullscreen' : ''}
{...$listeners.value}
{...$excludeAttrs.value}
ref={rootRef}
......@@ -117,10 +117,15 @@ export default /*#__PURE__*/ defineBuiltInComponent({
},
})
function useWebViewSize(rootRef: RootRef, iframe: HTMLIFrameElement, fullscreen:boolean) {
function useWebViewSize(
rootRef: RootRef,
iframe: HTMLIFrameElement,
fullscreen: boolean
) {
const _resize = () => {
if(fullscreen){
const { top, left, width, height } = rootRef.value!.getBoundingClientRect()
if (fullscreen) {
const { top, left, width, height } =
rootRef.value!.getBoundingClientRect()
updateElementStyle(iframe, {
position: 'absolute',
display: 'block',
......@@ -130,7 +135,7 @@ function useWebViewSize(rootRef: RootRef, iframe: HTMLIFrameElement, fullscreen:
width: width + 'px',
height: height + 'px',
})
}else{
} else {
updateElementStyle(iframe, {
width: rootRef.value?.style.width || '300px',
height: rootRef.value?.style.height || '150px',
......
......@@ -717,6 +717,7 @@ function createVueComponent(mpType, mpInstance, vueOptions, parent) {
}, {
mpType,
mpInstance,
slots: mpInstance.props.uS || {},
parentComponent: parent && parent.$,
onBeforeSetup(instance, options) {
initMocks(instance, mpInstance, mocks);
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app mp-alipay",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app mp-kuaishou",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app mp-lark",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app mp-qq",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app mp-toutiao",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
......@@ -3,6 +3,10 @@
"version": "3.0.0-alpha-3050420220803001",
"description": "uni-app quickapp-webview",
"main": "dist/index.js",
"files": [
"dist",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册