update iOS header import

This commit is contained in:
pengfei.zhou 2020-10-23 16:48:44 +08:00 committed by osborn
parent a913a5d700
commit c702f546ee
4 changed files with 50 additions and 12 deletions

View File

@ -20,7 +20,7 @@
// Created by on 2019/10/31.
//
#import "DoricJSRemoteExecutor.h"
#import <SocketRocket/SRWebSocket.h>
#import "SRWebSocket.h"
#import "DoricUtil.h"
#import "DoricJSRemoteArgType.h"
#import "NSString+JsonString.h"

View File

@ -21,7 +21,7 @@
//
#import "DoricWSClient.h"
#import <SocketRocket/SRWebSocket.h>
#import "SRWebSocket.h"
#import "DoricUtil.h"
#import "DoricContextManager.h"

View File

@ -1258,6 +1258,7 @@ var doric = (function (exports) {
class Context {
constructor(id) {
this.callbacks = new Map;
this.classes = new Map;
this.id = id;
return new Proxy(this, {
get: (target, p) => {
@ -1397,17 +1398,46 @@ var doric = (function (exports) {
}
function jsObtainEntry(contextId) {
const context = jsObtainContext(contextId);
return (constructor) => {
const ret = class extends constructor {
constructor() {
super(...arguments);
this.context = context;
}
const exportFunc = (constructor) => {
context === null || context === void 0 ? void 0 : context.classes.set(constructor.name, constructor);
const ret = new constructor;
Reflect.set(ret, 'context', context);
context === null || context === void 0 ? void 0 : context.register(ret);
return constructor;
};
if (context) {
context.register(new ret);
return function () {
if (arguments.length === 1) {
const args = arguments[0];
if (args instanceof Array) {
args.forEach(clz => {
context === null || context === void 0 ? void 0 : context.classes.set(clz.name, clz);
});
return exportFunc;
}
else {
return exportFunc(args);
}
}
else if (arguments.length === 2) {
const srcContextId = arguments[0];
const className = arguments[1];
const srcContext = gContexts.get(srcContextId);
if (srcContext) {
const clz = srcContext.classes.get(className);
if (clz) {
return exportFunc(clz);
}
else {
throw new Error(`Cannot find class:${className} in context:${srcContextId}`);
}
}
else {
throw new Error(`Cannot find context for ${srcContextId}`);
}
}
else {
throw new Error(`Entry arguments error:${arguments}`);
}
return ret;
};
}
const global$1 = Function('return this')();
@ -3808,10 +3838,16 @@ function navbar(context) {
};
}
function internalScheme(context, panelClass) {
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`;
}
function navigator(context) {
const moduleName = "navigator";
return {
push: (source, config) => {
if (typeof source === 'function') {
source = internalScheme(context, source);
}
if (config && config.extra) {
config.extra = JSON.stringify(config.extra);
}
@ -4206,6 +4242,7 @@ class VMPanel extends Panel {
build(root) {
this.vh = new (this.getViewHolderClass());
this.vm = new (this.getViewModelClass())(this.getState(), this.vh);
this.vm.context = this.context;
this.vm.attach(root);
}
}
@ -4268,6 +4305,7 @@ exports.gravity = gravity;
exports.hlayout = hlayout;
exports.image = image;
exports.input = input;
exports.internalScheme = internalScheme;
exports.layoutConfig = layoutConfig;
exports.list = list;
exports.listItem = listItem;

File diff suppressed because one or more lines are too long