feat:android support ArrayBuffer Resource

This commit is contained in:
pengfei.zhou
2021-11-18 19:06:10 +08:00
committed by osborn
parent 3bedd8034c
commit e270b9c520
21 changed files with 481 additions and 59 deletions

View File

@@ -2243,7 +2243,18 @@ var BundleResource = /** @class */ (function (_super) {
return _super.call(this, "bundle", bundleName + "://" + fileName) || this;
}
return BundleResource;
<<<<<<< HEAD
}(iOSResource));
=======
}(Resource));
var ArrayBufferResource = /** @class */ (function (_super) {
__extends$e(ArrayBufferResource, _super);
function ArrayBufferResource(data) {
return _super.call(this, "arrayBuffer", "") || this;
}
return ArrayBufferResource;
}(Resource));
>>>>>>> f476a5b0... feat:android support ArrayBuffer Resource
var __extends$e = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
@@ -3999,7 +4010,7 @@ function repeat(action) {
};
}
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4008,7 +4019,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) { throw t[1]; } return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -4055,8 +4066,8 @@ function animate(context) {
var entity = context.entity;
if (entity instanceof Panel) {
var panel_1 = entity;
return function (args) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return function (args) { return __awaiter$1(_this, void 0, void 0, function () {
return __generator$1(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, context.callNative('animate', 'submit')];
case 1:
@@ -4213,6 +4224,71 @@ function resourceLoader(context) {
};
}
/*
* Copyright [2021] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) { throw t[1]; } return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) { throw new TypeError("Generator is already executing."); }
while (_) { try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }
if (y = 0, t) { op = [op[0] & 2, t.value]; }
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) { _.ops.pop(); }
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } }
if (op[0] & 5) { throw op[1]; } return { value: op[0] ? op[1] : void 0, done: true };
}
};
function imageDecoder(context) {
var _this = this;
return {
getImageInfo: function (resource) {
return context.callNative('imageDecoder', 'getImageInfo', resource);
},
decodeToPixels: function (resource) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, context.callNative('imageDecoder', 'decodeToPixels', resource)];
});
}); },
};
}
var __values = (undefined && undefined.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) { return m.call(o); }
@@ -4539,7 +4615,12 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
<<<<<<< HEAD
exports.AssetsResource = AssetsResource;
=======
exports.ArrayBufferResource = ArrayBufferResource;
exports.AssetResource = AssetResource;
>>>>>>> f476a5b0... feat:android support ArrayBuffer Resource
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@@ -4618,6 +4699,7 @@ exports.gravity = gravity;
exports.hlayout = hlayout;
exports.iOSResource = iOSResource;
exports.image = image;
exports.imageDecoder = imageDecoder;
exports.input = input;
exports.internalScheme = internalScheme;
exports.keyboard = keyboard;

View File

@@ -1680,6 +1680,11 @@ class BundleResource extends iOSResource {
super("bundle", `${bundleName}://${fileName}`);
}
}
class ArrayBufferResource extends Resource {
constructor(data) {
super("arrayBuffer", "");
}
}
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -3084,7 +3089,7 @@ function repeat(action) {
};
}
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3101,7 +3106,7 @@ function animate(context) {
const entity = context.entity;
if (entity instanceof Panel) {
let panel = entity;
return (args) => __awaiter(this, void 0, void 0, function* () {
return (args) => __awaiter$1(this, void 0, void 0, function* () {
yield context.callNative('animate', 'submit');
args.animations();
return takeLet(panel.getRootView())(root => {
@@ -3232,6 +3237,41 @@ function resourceLoader(context) {
};
}
/*
* Copyright [2021] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
function imageDecoder(context) {
return {
getImageInfo: (resource) => {
return context.callNative('imageDecoder', 'getImageInfo', resource);
},
decodeToPixels: (resource) => __awaiter(this, void 0, void 0, function* () {
return context.callNative('imageDecoder', 'decodeToPixels', resource);
}),
};
}
class Observable {
constructor(provider, clz) {
this.observers = new Set;
@@ -3470,7 +3510,12 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
<<<<<<< HEAD
exports.AssetsResource = AssetsResource;
=======
exports.ArrayBufferResource = ArrayBufferResource;
exports.AssetResource = AssetResource;
>>>>>>> f476a5b0... feat:android support ArrayBuffer Resource
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@@ -3549,6 +3594,7 @@ exports.gravity = gravity;
exports.hlayout = hlayout;
exports.iOSResource = iOSResource;
exports.image = image;
exports.imageDecoder = imageDecoder;
exports.input = input;
exports.internalScheme = internalScheme;
exports.keyboard = keyboard;

View File

@@ -3208,6 +3208,11 @@ class BundleResource extends iOSResource {
super("bundle", `${bundleName}://${fileName}`);
}
}
class ArrayBufferResource extends Resource {
constructor(data) {
super("arrayBuffer", "");
}
}
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4612,7 +4617,7 @@ function repeat(action) {
};
}
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4629,7 +4634,7 @@ function animate(context) {
const entity = context.entity;
if (entity instanceof Panel) {
let panel = entity;
return (args) => __awaiter$1(this, void 0, void 0, function* () {
return (args) => __awaiter$2(this, void 0, void 0, function* () {
yield context.callNative('animate', 'submit');
args.animations();
return takeLet(panel.getRootView())(root => {
@@ -4760,6 +4765,41 @@ function resourceLoader(context) {
};
}
/*
* Copyright [2021] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
function imageDecoder(context) {
return {
getImageInfo: (resource) => {
return context.callNative('imageDecoder', 'getImageInfo', resource);
},
decodeToPixels: (resource) => __awaiter$1(this, void 0, void 0, function* () {
return context.callNative('imageDecoder', 'decodeToPixels', resource);
}),
};
}
class Observable {
constructor(provider, clz) {
this.observers = new Set;
@@ -5239,7 +5279,12 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
<<<<<<< HEAD
exports.AssetsResource = AssetsResource;
=======
exports.ArrayBufferResource = ArrayBufferResource;
exports.AssetResource = AssetResource;
>>>>>>> f476a5b0... feat:android support ArrayBuffer Resource
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@@ -5318,6 +5363,7 @@ exports.gravity = gravity;
exports.hlayout = hlayout;
exports.iOSResource = iOSResource;
exports.image = image;
exports.imageDecoder = imageDecoder;
exports.input = input;
exports.internalScheme = internalScheme;
exports.keyboard = keyboard;