diff --git a/LICENSE b/LICENSE index 4947287..3fd0bc3 100644 --- a/LICENSE +++ b/LICENSE @@ -174,4 +174,5 @@ incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS \ No newline at end of file + END OF TERMS AND CONDITIONS + diff --git a/ace-loader/.eslintrc.js b/ace-loader/.eslintrc.js index 9e738f1..72f1709 100644 --- a/ace-loader/.eslintrc.js +++ b/ace-loader/.eslintrc.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/.npmignore b/ace-loader/.npmignore index 246c4aa..ad12608 100644 --- a/ace-loader/.npmignore +++ b/ace-loader/.npmignore @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + node_modules src test diff --git a/ace-loader/babel.config.js b/ace-loader/babel.config.js index c56c703..b305c50 100644 --- a/ace-loader/babel.config.js +++ b/ace-loader/babel.config.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/index.js b/ace-loader/index.js index d92b138..4673479 100644 --- a/ace-loader/index.js +++ b/ace-loader/index.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/main.product.js b/ace-loader/main.product.js index 7cb9448..0075df8 100644 --- a/ace-loader/main.product.js +++ b/ace-loader/main.product.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/module-source.js b/ace-loader/module-source.js index 05644ed..4d824dd 100644 --- a/ace-loader/module-source.js +++ b/ace-loader/module-source.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/npm-install.js b/ace-loader/npm-install.js index e039276..5517c1d 100644 --- a/ace-loader/npm-install.js +++ b/ace-loader/npm-install.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/codegen/index.js b/ace-loader/plugin/codegen/index.js index 3e25489..ba39d44 100644 --- a/ace-loader/plugin/codegen/index.js +++ b/ace-loader/plugin/codegen/index.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ @@ -6,9 +21,6 @@ /***/ ((__unused_webpack_module, exports) => { -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. - */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.errorMap = void 0; exports.errorMap = new Map([ @@ -25,9 +37,6 @@ exports.errorMap = new Map([ /***/ ((__unused_webpack_module, exports) => { -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ASTNode = void 0; class ASTNode { @@ -44,14 +53,12 @@ exports.ASTNode = ASTNode; /***/ ((__unused_webpack_module, exports) => { -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Cache = void 0; // There is no way pass value by reference with JS and TS, but object // This Cache is used to store output code temporarily class Cache { + /** * @description: constructor for Cache * @param INDENT the IDENT string you want to use, such as 4 spaces @@ -62,6 +69,7 @@ class Cache { this.flag = true; this.INDENT = INDENT; } + /** * @description: when flag is true, there should be some indents * @return void @@ -69,6 +77,7 @@ class Cache { indentOn() { this.flag = true; } + /** * @description: when flag is false, there should be no indents * @return void @@ -76,6 +85,7 @@ class Cache { indentOff() { this.flag = false; } + /** * @description: increase indent * @return void @@ -83,6 +93,7 @@ class Cache { incIndent() { this.indent++; } + /** * @description: decrease indent * @return void @@ -90,6 +101,7 @@ class Cache { decIndent() { this.indent--; } + /** * @description: check whether indent is LT 0 * @return boolean value representing whether indent is LT 0 @@ -97,6 +109,7 @@ class Cache { checkIndent() { return this.indent < 0; } + /** * @description: get indent * @return indents @@ -113,6 +126,7 @@ class Cache { return ""; } } + /** * @description: concat indents and HML/CSS code * @param strings means HML/CSS code @@ -123,6 +137,7 @@ class Cache { this.value = this.value.concat(...strings); return String(this.value); } + /** * @description: concat indents and HML/CSS code * @return HML/CSS code @@ -140,13 +155,11 @@ exports.Cache = Cache; /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Style = exports.Tag = void 0; const ASTNode_1 = __webpack_require__(117); class Tag extends ASTNode_1.ASTNode { + /** * @description: constructor for Tag * @param tagName is name of component @@ -162,6 +175,7 @@ class Tag extends ASTNode_1.ASTNode { } exports.Tag = Tag; class Style extends ASTNode_1.ASTNode { + /** * @description: constructor for Style * @param kind distinguishes id and class @@ -183,15 +197,12 @@ exports.Style = Style; /***/ 573: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ASTNodeGenerator = void 0; const AST_1 = __webpack_require__(243); const Token_1 = __webpack_require__(334); class ASTNodeGenerator { + /** * @description: constructor for BridgeVisitor * @param reference is cache for Harmony FA code @@ -199,6 +210,7 @@ class ASTNodeGenerator { constructor(reference) { this.cache = reference; } + /** * @description: visitor mode dispatcher * @param t Node in AST @@ -211,6 +223,7 @@ class ASTNodeGenerator { this.genStyle(t); } } + /** * @description: code generator * @param ref is cache for code @@ -225,6 +238,7 @@ class ASTNodeGenerator { } return ASTNodeGenerator.instance; } + /** * @description: cache for code * @param ref is cache for code @@ -233,6 +247,7 @@ class ASTNodeGenerator { setCache(ref) { this.cache = ref; } + /** * @description: parse Tag in AST and generate code for Tag in cache * @param t Tag in AST @@ -246,7 +261,8 @@ class ASTNodeGenerator { for (const char of value) { valueBK += (char === "\"" ? """ : (char === "\n" ? " " : char)); } - this.cache.concat(Token_1.TokenClass.SPACE, key, Token_1.TokenClass.ASSIGN, Token_1.TokenClass.LQUOTE, valueBK, Token_1.TokenClass.RQUOTE); + this.cache.concat(Token_1.TokenClass.SPACE, key, Token_1.TokenClass.ASSIGN, + Token_1.TokenClass.LQUOTE, valueBK, Token_1.TokenClass.RQUOTE); }); if (t.content === null) { this.cache.concat(Token_1.TokenClass.EMPTY_TAG_END); @@ -276,6 +292,7 @@ class ASTNodeGenerator { this.cache.concat(Token_1.TokenClass.END_TAG_START, t.tagName, Token_1.TokenClass.TAG_END); } } + /** * @description: parse Style in AST and generate code for Style in cache * @param s Style in AST @@ -290,7 +307,8 @@ class ASTNodeGenerator { this.cache.indentOn(); this.cache.incIndent(); s.content.forEach((value, key) => { - this.cache.concat(key, Token_1.TokenClass.COLON, Token_1.TokenClass.SPACE, value, Token_1.TokenClass.SEMICOLON, Token_1.TokenClass.NEW_LINE); + this.cache.concat(key, Token_1.TokenClass.COLON, Token_1.TokenClass.SPACE, value, + Token_1.TokenClass.SEMICOLON, Token_1.TokenClass.NEW_LINE); }); this.cache.decIndent(); this.cache.concat(Token_1.TokenClass.RBRA, Token_1.TokenClass.NEW_LINE, Token_1.TokenClass.NEW_LINE); @@ -306,9 +324,6 @@ ASTNodeGenerator.instance = undefined; /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CSSBridge = exports.HMLBridge = void 0; const AST_1 = __webpack_require__(243); @@ -317,6 +332,7 @@ class HMLBridge { constructor() { this.errors = 0; } + /** * @description: generate error message * @param msg is error message to show up in console @@ -325,6 +341,7 @@ class HMLBridge { console.error("Code generating error: " + msg); this.errors += 1; } + /** * @description: get error number * @return error number @@ -332,6 +349,7 @@ class HMLBridge { getErrorCount() { return this.errors; } + /** * @description: visitor guidance method for contents, * sort out incoming type and guide to matching code generator @@ -367,14 +385,15 @@ class CSSBridge { this.errors = 0; this.styles = []; } + /** * @description: generate error message * @param msg is error message to show up in console */ error(msg) { - console.error("Code generating error: " + msg); this.errors += 1; } + /** * @description: get error number * @return error number @@ -382,6 +401,7 @@ class CSSBridge { getErrorCount() { return this.errors; } + /** * @description: code generator for ID Style, which is CSS type in AST in IR * @param visualModel is a object with CSS type to be generated @@ -401,6 +421,7 @@ class CSSBridge { visualChild.accept(this); } } + /** * @description: visitor guidance method for contents, * sort out incoming type and guide to matching code generator @@ -421,13 +442,11 @@ exports.CSSBridge = CSSBridge; /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.genFACSS = exports.genFAHML = void 0; const ASTNodeVisitor_1 = __webpack_require__(573); const Cache_1 = __webpack_require__(862); + /** * @description: generate HML * @param t is Tag in AST @@ -439,6 +458,7 @@ function genFAHML(t) { return generator.cache.toString(); } exports.genFAHML = genFAHML; + /** * @description: generate CSS * @param t is Style in AST @@ -459,20 +479,20 @@ exports.genFACSS = genFACSS; /***/ 571: /***/ ((__unused_webpack_module, exports) => { - -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isEvent = exports.isData = exports.isUnknown = exports.isContent = exports.isAttribute = exports.isStyle = exports.styleSet = void 0; +exports.isEvent = exports.isData = exports.isUnknown = exports.isContent = + exports.isAttribute = exports.isStyle = exports.styleSet = void 0; // Unlike the property list in ComponentList, this one is only used to tell a property is a style or an attribute const SizeStyle = ["width", "height", "min-width", "min-height", "max-width", "max-height"]; const FlexStyle = ["flex", "flex-grow", "flex-shrink", "flex-basis"]; -const BackgroundImageStyle = ["background", "background-image", "background-size", "background-position", "background-repeat"]; +const BackgroundImageStyle = ["background", "background-image", "background-size", + "background-position", "background-repeat"]; const BackgroundStyle = ["background-color", ...BackgroundImageStyle]; const PositionStyle = ["position", "display", "top", "right", "bottom", "left"]; -const PaddingStyle = ["padding", "padding-start", "padding-end", "padding-top", "padding-right", "padding-bottom", "padding-left"]; -const MarginStyle = ["margin", "margin-start", "margin-end", "margin-top", "margin-right", "margin-bottom", "margin-left"]; +const PaddingStyle = ["padding", "padding-start", "padding-end", "padding-top", + "padding-right", "padding-bottom", "padding-left"]; +const MarginStyle = ["margin", "margin-start", "margin-end", "margin-top", "margin-right", + "margin-bottom", "margin-left"]; const BorderStyle = ["border-width", "border-style", "border-color", "border-radius", "border-top-width", "border-top-style", "border-top-color", "border-top-left-radius", "border-right-width", "border-right-style", "border-right-color", "border-top-right-radius", "border-bottom-width", "border-bottom-style", @@ -496,11 +516,12 @@ const buttonStyle = ["text-color", "allow-scale", "icon-width", "icon-height", " const switchStyle = ["texton-color", "textoff-color", "text-padding", "allow-scale", ...FontStyle]; const inputStyle = ["font-size", "font-family", "font-weight", "color", "placeholder-color", "allow-scale"]; const refreshStyle = ["progress-color"]; -const chartStyle = ["stroke-width", "radius", "start-angle", "total-angle", "center-x", "center-y", "colors", "weights"]; -const swiperStyle = ["indicator-color", "indicator-selected-color", "indicator-size", "indicator-top", "indicator-right", - "indicator-bottom", "indicator-left"]; -const pickerStyle = ["column-height", "text-color", "allow-scale", "letter-spacing", "text-decoration", "line-height", "opacity", - ...FontStyle]; +const chartStyle = ["stroke-width", "radius", "start-angle", "total-angle", "center-x", + "center-y", "colors", "weights"]; +const swiperStyle = ["indicator-color", "indicator-selected-color", "indicator-size", "indicator-top", + "indicator-right", "indicator-bottom", "indicator-left"]; +const pickerStyle = ["column-height", "text-color", "allow-scale", "letter-spacing", "text-decoration", + "line-height", "opacity", ...FontStyle]; const sliderStyle = ["color", "selected-color", "block-color"]; const listStyle = ["flex-direction", "columns", "item-extent", "fade-color"]; const listItemStyle = ["column-span"]; @@ -534,8 +555,10 @@ const inputAttribute = ["type", "checked", "name", "value", "placeholder", "maxl const refreshAttribute = ["offset", "refreshing", "type", "lasttime", "friction"]; const optionAttribute = ["value"]; const chartAttribute = ["percent", "datasets", "options"]; -const swiperAttribute = ["index", "autoplay", "interval", "indicator", "digital", "indicatordisabled", "loop", "duration", "vertical"]; -const pickerAttribute = ["range", "selected", "start", "end", "lunar", "lunarSwitch", "columns", "hours", "containSecond"]; +const swiperAttribute = ["index", "autoplay", "interval", "indicator", "digital", "indicatordisabled", + "loop", "duration", "vertical"]; +const pickerAttribute = ["range", "selected", "start", "end", "lunar", "lunarSwitch", "columns", + "hours", "containSecond"]; const sliderAttribute = ["min", "max", "step", "showtips", "showsteps", "mode"]; const menuAttribute = ["target", "title"]; const clockAttribute = ["clockconfig", "showdigit", "hourswest"]; @@ -619,9 +642,6 @@ exports.isEvent = isEvent; /***/ ((__unused_webpack_module, exports) => { -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TokenClass = void 0; var TokenClass; @@ -663,9 +683,6 @@ var TokenClass; /***/ ((__unused_webpack_module, exports) => { -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021:. All rights reserved. - */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Enum = exports.Characteristic = exports.Event = exports.Service = exports.Device = void 0; class Device { @@ -724,20 +741,20 @@ exports.Enum = Enum; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formManager = void 0; -/* -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ + + const Instance_1 = __webpack_require__(891); const FormModel_1 = __webpack_require__(945); exports.formManager = { + /** - * * remove a key-value in data node * @param key the entry to remove */ removeData(key) { this.getFormModel().data.delete(key); }, + /** * * add a key-value @@ -755,7 +772,9 @@ exports.formManager = { }); } }, + /** + * * update all the data * @param data */ @@ -763,6 +782,7 @@ exports.formManager = { this.getFormModel().data.clear(); this.addData(data); }, + /** * * add an action in action node @@ -778,7 +798,9 @@ exports.formManager = { }); this.getFormModel().actions.set(actionName, new FormModel_1.FormAction(actionType, paramMap, abilityName)); }, + /** + * * update all the actions * @param map: the new actions to be updated */ @@ -790,6 +812,7 @@ exports.formManager = { this.getFormModel().actions.set(key, action); }); }, + /** * * remove an action @@ -798,6 +821,7 @@ exports.formManager = { removeAction(actionName) { this.getFormModel().actions.delete(actionName); }, + /** * * add params in an action @@ -806,13 +830,15 @@ exports.formManager = { */ addActionParams(actionName, params) { var _a, _b; - const action = (_a = this.getFormModel().actions.get(actionName)) !== null && _a !== void 0 ? _a : new FormModel_1.FormAction(actionName); + const action = (_a = this.getFormModel().actions.get(actionName)) !== null && _a !== + void 0 ? _a : new FormModel_1.FormAction(actionName); const actionParams = (_b = action.params) !== null && _b !== void 0 ? _b : new Map(); Object.keys(params).forEach(key => { actionParams.set(key, params[key]); }); action.params = actionParams; }, + /** * * remove params in an action @@ -822,15 +848,20 @@ exports.formManager = { removeActionParam(actionName, paramKey) { var _a; const action = this.getFormModel().actions.get(actionName); - (_a = action === null || action === void 0 ? void 0 : action.params) === null || _a === void 0 ? void 0 : _a.delete(paramKey); + (_a = action === null || action === void 0 ? void 0 : action.params) === null || _a + === void 0 ? void 0 : _a.delete(paramKey); }, + /** + * * get the whole node */ getFormModel() { return Instance_1.getInstance().formData; }, + /** + * * codegen formModel to json */ codegenToJson: function () { @@ -845,13 +876,16 @@ exports.formManager = { }); return JSON.stringify(retObj, null, 4); }, + /** + * * clear all datas and actions in model */ clear() { Instance_1.getInstance().formData.data.clear(); Instance_1.getInstance().formData.actions.clear(); }, + /** * * convert a map to an object @@ -861,9 +895,12 @@ exports.formManager = { if (sourceMap === undefined) { return {}; } - return Array.from(sourceMap.entries()).reduce((main, [key, value]) => (Object.assign(Object.assign({}, main), { [key]: value })), {}); + return Array.from(sourceMap.entries()).reduce((main, [key, value]) => + (Object.assign(Object.assign({}, main), { [key]: value })), {}); }, + /** + * * convert an object to map */ objectToMap(sourceObj) { @@ -882,9 +919,6 @@ exports.formManager = { /***/ ((__unused_webpack_module, exports) => { -/* -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FormAction = exports.FormModel = void 0; class FormModel { @@ -933,9 +967,8 @@ exports.isBindingEvent = isBindingEvent; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addPhysicalModel = exports.getPhysicalModel = exports.setInstance = exports.getInstance = void 0; -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ + + const PhysicalModel_1 = __webpack_require__(234); const VisualModel_1 = __webpack_require__(933); const FormModel_1 = __webpack_require__(945); @@ -945,14 +978,18 @@ const instance = { harmonyConnectDevice: new PhysicalModel_1.Device(), formData: new FormModel_1.FormModel(), }; + /** +* * instance is unique during the entire web page lifecycle */ function getInstance() { return instance; } exports.getInstance = getInstance; + /** +* * replace instance * @param ins */ @@ -964,7 +1001,9 @@ function setInstance(ins) { } } exports.setInstance = setInstance; + /** +* * get a physical model by its serviceId and characteristicName * @param path */ @@ -976,7 +1015,9 @@ function getPhysicalModel(path) { return service.characteristics.find(e => e.name === path.characteristicName); } exports.getPhysicalModel = getPhysicalModel; + /** +* * add a service, would overide if serviceId and characteristicName is same * @param service */ @@ -1005,12 +1046,13 @@ exports.addPhysicalModel = addPhysicalModel; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.deserialize = exports.serialize = void 0; -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ -const VisualModel_1 = __webpack_require__(933); + + +const VisualModel_1 =__webpack_require__(933); const Instance_1 = __webpack_require__(891); + /** +* * @description: convert JsonModel to Json * @return model in json format */ @@ -1018,6 +1060,7 @@ function serialize() { return JSON.stringify(Instance_1.getInstance(), replacer); } exports.serialize = serialize; + /** * @description: convert Json to JsonModel * @return model in json format @@ -1027,7 +1070,9 @@ function deserialize(json) { Instance_1.setInstance(ins); } exports.deserialize = deserialize; + /** +* * json replacer, turn any class into string * @param key * @param value @@ -1062,7 +1107,9 @@ function replacer(key, value) { return value; } } + /** +* * json reviver, true magic, replace plain json to classes * @param key * @param value @@ -1091,9 +1138,6 @@ function reviver(key, value) { /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VisualModel = void 0; const CombinedModel_1 = __webpack_require__(964); @@ -1119,7 +1163,8 @@ class VisualModel { this.combinedInfo = { id: "", type: "", - selfType: obj.combinedSelfType === undefined ? CombinedModel_1.CombinedSelfType.None : obj.combinedSelfType, + selfType: obj.combinedSelfType === + undefined ? CombinedModel_1.CombinedSelfType.None : obj.combinedSelfType, data: obj.data, event: obj.event, }; @@ -1166,9 +1211,6 @@ var __webpack_exports__ = {}; (() => { var exports = __webpack_exports__; -/** -* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. -*/ Object.defineProperty(exports, "__esModule", ({ value: true })); const errorMap_1 = __webpack_require__(784); const Instance_1 = __webpack_require__(891); @@ -1177,7 +1219,9 @@ const BridgeVisitor_1 = __webpack_require__(844); const HmlCssCodeGenerator_1 = __webpack_require__(55); const FormManager_1 = __webpack_require__(207); const visualVersion = 12; + /** +* * @description: codegen hml and css according to code in visual file * @param source is code in visual file * @return object of hmlCSS, errorType and errorMessage @@ -1231,7 +1275,9 @@ function genHmlAndCss(source) { } return retObj; } + /** +* * @description: output hml and css source code of the model */ function emitFA(rootModel) { diff --git a/ace-loader/plugin/templater/bind.js b/ace-loader/plugin/templater/bind.js index 1ba595e..5a3e161 100644 --- a/ace-loader/plugin/templater/bind.js +++ b/ace-loader/plugin/templater/bind.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/card_component_map.js b/ace-loader/plugin/templater/card_component_map.js index 436654b..d636217 100644 --- a/ace-loader/plugin/templater/card_component_map.js +++ b/ace-loader/plugin/templater/card_component_map.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/component_validator.js b/ace-loader/plugin/templater/component_validator.js index 92928c0..db2f3e7 100644 --- a/ace-loader/plugin/templater/component_validator.js +++ b/ace-loader/plugin/templater/component_validator.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 @@ -1073,41 +1073,46 @@ function validateEvent(eventName, val, out, pos, relativePath) { let paramList = content[2] if (paramList) { paramList = transContent.parseExpression(paramList, true) - val = eval('(function (evt) {' + bind('{{' + functionName + '(' + paramList + ',evt)}}', false, true, out, pos) + '})') + val = eval('(function (evt) {' + bind('{{' + functionName + '(' + paramList + ',evt)}}', + false, true, out, pos) + '})') } } } - if ((process.env.DEVICE_LEVEL === DEVICE_LEVEL.LITE || TOUCH_EVENT_REGEXP.test(name)) && - process.env.PLATFORM_VERSION !== PLATFORM.VERSION3) { - if (eventName.match(START_CATCH_REGEXP)) { - if (eventName.match(END_CAPTURE_REGEXP)) { - out.jsonTemplate.catchCaptureEvents = out.jsonTemplate.catchCaptureEvents || {} - out.jsonTemplate.catchCaptureEvents[name] = val - } else { - out.jsonTemplate.catchBubbleEvents = out.jsonTemplate.catchBubbleEvents || {} - out.jsonTemplate.catchBubbleEvents[name] = val - } - } else if (eventName.match(END_CAPTURE_REGEXP)) { - out.jsonTemplate.onCaptureEvents = out.jsonTemplate.onCaptureEvents || {} - out.jsonTemplate.onCaptureEvents[name] = val + distributeEvent(out, eventName, name, val) + setDebugLine(out.jsonTemplate, relativePath, pos.line) + } +} + +function distributeEvent(out, eventName, name, val) { + if ((process.env.DEVICE_LEVEL === DEVICE_LEVEL.LITE || TOUCH_EVENT_REGEXP.test(name)) && + process.env.PLATFORM_VERSION !== PLATFORM.VERSION3) { + if (eventName.match(START_CATCH_REGEXP)) { + if (eventName.match(END_CAPTURE_REGEXP)) { + out.jsonTemplate.catchCaptureEvents = out.jsonTemplate.catchCaptureEvents || {} + out.jsonTemplate.catchCaptureEvents[name] = val } else { - out.jsonTemplate.onBubbleEvents = out.jsonTemplate.onBubbleEvents || {} - out.jsonTemplate.onBubbleEvents[name] = val - } - } else if (process.env.DEVICE_LEVEL === DEVICE_LEVEL.RICH && CLICK_EVENT_REGEXP.test(name) && - !eventName.match(END_CAPTURE_REGEXP) && process.env.PLATFORM_VERSION === PLATFORM.VERSION6) { - if (eventName.match(START_CATCH_REGEXP)) { out.jsonTemplate.catchBubbleEvents = out.jsonTemplate.catchBubbleEvents || {} out.jsonTemplate.catchBubbleEvents[name] = val - } else { - out.jsonTemplate.onBubbleEvents = out.jsonTemplate.onBubbleEvents || {} - out.jsonTemplate.onBubbleEvents[name] = val } + } else if (eventName.match(END_CAPTURE_REGEXP)) { + out.jsonTemplate.onCaptureEvents = out.jsonTemplate.onCaptureEvents || {} + out.jsonTemplate.onCaptureEvents[name] = val } else { - out.jsonTemplate.events = out.jsonTemplate.events || {} - out.jsonTemplate.events[name] = val + out.jsonTemplate.onBubbleEvents = out.jsonTemplate.onBubbleEvents || {} + out.jsonTemplate.onBubbleEvents[name] = val } - setDebugLine(out.jsonTemplate, relativePath, pos.line) + } else if (process.env.DEVICE_LEVEL === DEVICE_LEVEL.RICH && CLICK_EVENT_REGEXP.test(name) && + !eventName.match(END_CAPTURE_REGEXP) && process.env.PLATFORM_VERSION === PLATFORM.VERSION6) { + if (eventName.match(START_CATCH_REGEXP)) { + out.jsonTemplate.catchBubbleEvents = out.jsonTemplate.catchBubbleEvents || {} + out.jsonTemplate.catchBubbleEvents[name] = val + } else { + out.jsonTemplate.onBubbleEvents = out.jsonTemplate.onBubbleEvents || {} + out.jsonTemplate.onBubbleEvents[name] = val + } + } else { + out.jsonTemplate.events = out.jsonTemplate.events || {} + out.jsonTemplate.events[name] = val } } diff --git a/ace-loader/plugin/templater/content.js b/ace-loader/plugin/templater/content.js index 65c0642..a3785fd 100644 --- a/ace-loader/plugin/templater/content.js +++ b/ace-loader/plugin/templater/content.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/data.js b/ace-loader/plugin/templater/data.js index 32ab35a..602d11d 100644 --- a/ace-loader/plugin/templater/data.js +++ b/ace-loader/plugin/templater/data.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/index.js b/ace-loader/plugin/templater/index.js index fec735c..9fe1154 100644 --- a/ace-loader/plugin/templater/index.js +++ b/ace-loader/plugin/templater/index.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/lite_component_map.js b/ace-loader/plugin/templater/lite_component_map.js index fbe8925..3d7089c 100644 --- a/ace-loader/plugin/templater/lite_component_map.js +++ b/ace-loader/plugin/templater/lite_component_map.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/templater/rich_component_map.js b/ace-loader/plugin/templater/rich_component_map.js index 4e14ae1..a18ae0d 100644 --- a/ace-loader/plugin/templater/rich_component_map.js +++ b/ace-loader/plugin/templater/rich_component_map.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/theme/customThemeStyles.js b/ace-loader/plugin/theme/customThemeStyles.js index 2085d9e..d83c847 100644 --- a/ace-loader/plugin/theme/customThemeStyles.js +++ b/ace-loader/plugin/theme/customThemeStyles.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/plugin/theme/ohosStyles.js b/ace-loader/plugin/theme/ohosStyles.js index c249d61..83909e5 100644 --- a/ace-loader/plugin/theme/ohosStyles.js +++ b/ace-loader/plugin/theme/ohosStyles.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/sample/DataAbility/data.js b/ace-loader/sample/DataAbility/data.js index 439e396..13b64e6 100644 --- a/ace-loader/sample/DataAbility/data.js +++ b/ace-loader/sample/DataAbility/data.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onInitialize(abilityInfo) { console.info('DataAbility onInitialize'); diff --git a/ace-loader/sample/ServiceAbility/service.js b/ace-loader/sample/ServiceAbility/service.js index 60cb1c3..44aaf64 100644 --- a/ace-loader/sample/ServiceAbility/service.js +++ b/ace-loader/sample/ServiceAbility/service.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onStart(want) { console.info('ServiceAbility onStart'); diff --git a/ace-loader/sample/lite/app.js b/ace-loader/sample/lite/app.js index bb1f752..01b76ea 100644 --- a/ace-loader/sample/lite/app.js +++ b/ace-loader/sample/lite/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onCreate() { console.info("AceApplication onCreate"); diff --git a/ace-loader/sample/lite/pages/detail/detail.js b/ace-loader/sample/lite/pages/detail/detail.js index d352de5..6430218 100644 --- a/ace-loader/sample/lite/pages/detail/detail.js +++ b/ace-loader/sample/lite/pages/detail/detail.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 router = require('@system.router') export default { data: {}, diff --git a/ace-loader/sample/lite/pages/index/index.js b/ace-loader/sample/lite/pages/index/index.js index e59972a..f81bd29 100644 --- a/ace-loader/sample/lite/pages/index/index.js +++ b/ace-loader/sample/lite/pages/index/index.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { data: { title: 'World' diff --git a/ace-loader/sample/rich/app.js b/ace-loader/sample/rich/app.js index d624d9c..d4d615e 100644 --- a/ace-loader/sample/rich/app.js +++ b/ace-loader/sample/rich/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onCreate() { console.info('AceApplication onCreate'); diff --git a/ace-loader/sample/rich/pages/detail/detail.js b/ace-loader/sample/rich/pages/detail/detail.js index 42d99d6..3cfb534 100644 --- a/ace-loader/sample/rich/pages/detail/detail.js +++ b/ace-loader/sample/rich/pages/detail/detail.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import router from '@system.router' export default { diff --git a/ace-loader/sample/rich/pages/index/index.js b/ace-loader/sample/rich/pages/index/index.js index d236f6f..8f5763e 100644 --- a/ace-loader/sample/rich/pages/index/index.js +++ b/ace-loader/sample/rich/pages/index/index.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import router from '@system.router'; export default { diff --git a/ace-loader/src/card-loader.js b/ace-loader/src/card-loader.js index 6658653..faf5125 100644 --- a/ace-loader/src/card-loader.js +++ b/ace-loader/src/card-loader.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/cardJson-plugin.js b/ace-loader/src/cardJson-plugin.js index 4b430c8..5a27c28 100644 --- a/ace-loader/src/cardJson-plugin.js +++ b/ace-loader/src/cardJson-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/compile-plugin.js b/ace-loader/src/compile-plugin.js index 6068be1..fa80c12 100644 --- a/ace-loader/src/compile-plugin.js +++ b/ace-loader/src/compile-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/genBin-plugin.js b/ace-loader/src/genBin-plugin.js index 08931cb..f8f4d87 100644 --- a/ace-loader/src/genBin-plugin.js +++ b/ace-loader/src/genBin-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-customize.js b/ace-loader/src/lite/lite-customize.js index 08f1885..ea2f6cb 100644 --- a/ace-loader/src/lite/lite-customize.js +++ b/ace-loader/src/lite/lite-customize.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-enum.js b/ace-loader/src/lite/lite-enum.js index 6a19d8a..78a4251 100644 --- a/ace-loader/src/lite/lite-enum.js +++ b/ace-loader/src/lite/lite-enum.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-image-coverter-plugin.js b/ace-loader/src/lite/lite-image-coverter-plugin.js index efd6613..56049d3 100644 --- a/ace-loader/src/lite/lite-image-coverter-plugin.js +++ b/ace-loader/src/lite/lite-image-coverter-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-image2bin.js b/ace-loader/src/lite/lite-image2bin.js index 5ebf40d..dc9f3ed 100644 --- a/ace-loader/src/lite/lite-image2bin.js +++ b/ace-loader/src/lite/lite-image2bin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-return-exports-plugin.js b/ace-loader/src/lite/lite-return-exports-plugin.js index 5707822..ae70925 100644 --- a/ace-loader/src/lite/lite-return-exports-plugin.js +++ b/ace-loader/src/lite/lite-return-exports-plugin.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + const pluginName = 'LiteReturnExportsPlugin'; /** diff --git a/ace-loader/src/lite/lite-snapshot-plugin.js b/ace-loader/src/lite/lite-snapshot-plugin.js index a85e32e..8e5a4fc 100644 --- a/ace-loader/src/lite/lite-snapshot-plugin.js +++ b/ace-loader/src/lite/lite-snapshot-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-transform-style.js b/ace-loader/src/lite/lite-transform-style.js index 25572a3..4b34473 100644 --- a/ace-loader/src/lite/lite-transform-style.js +++ b/ace-loader/src/lite/lite-transform-style.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 @@ -53,7 +53,7 @@ function transformStyle(value) { } else if (key === MEDIA_QUERY) { styleSheet['@media'] = mediaQueryFormat(style[key]); } else { - // todo: Label style + } } if (style != null && keys.length !== 0) { diff --git a/ace-loader/src/lite/lite-transform-template.js b/ace-loader/src/lite/lite-transform-template.js index 5cc78d2..ddde4e3 100644 --- a/ace-loader/src/lite/lite-transform-template.js +++ b/ace-loader/src/lite/lite-transform-template.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/lite/lite-utils.js b/ace-loader/src/lite/lite-utils.js index 9ff2f18..0f87921 100644 --- a/ace-loader/src/lite/lite-utils.js +++ b/ace-loader/src/lite/lite-utils.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/loader-gen.js b/ace-loader/src/loader-gen.js index 1c6e7fe..888a82d 100644 --- a/ace-loader/src/loader-gen.js +++ b/ace-loader/src/loader-gen.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + /** * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. */ @@ -177,9 +192,12 @@ function codegenHmlAndCss() { if (process.env.DEVICE_LEVEL === 'card') { output = '//card_start\n' - output += `var card_template =` + getRequireString(this, jsonLoaders('template', undefined, true, 'template'), this.resourcePath) - output += `var card_style =` + getRequireString(this, jsonLoaders('style', undefined, true, 'style'), this.resourcePath) - output += `var card_json =` + getRequireString(this, jsonLoaders('json', undefined, true, 'json'), this.resourcePath) + output += `var card_template =` + getRequireString(this, + jsonLoaders('template', undefined, true, 'template'), this.resourcePath) + output += `var card_style =` + getRequireString(this, + jsonLoaders('style', undefined, true, 'style'), this.resourcePath) + output += `var card_json =` + getRequireString(this, + jsonLoaders('json', undefined, true, 'json'), this.resourcePath) output += '\n//card_end' } else { output = 'var $app_script$ = ' + getRequireString(this, getLoaderString('script', { @@ -207,7 +225,8 @@ function codegenHmlAndCss() { }), this.resourcePath) output += ` - $app_define$('@app-component/${getNameByPath(this.resourcePath)}', [], function($app_require$, $app_exports$, $app_module$) { + $app_define$('@app-component/${getNameByPath(this.resourcePath)}', [], + function($app_require$, $app_exports$, $app_module$) { ` + ` $app_script$($app_module$, $app_exports$, $app_require$) if ($app_exports$.__esModule && $app_exports$.default) { @@ -221,7 +240,8 @@ function codegenHmlAndCss() { }) ` if (isEntry) { - output += `$app_bootstrap$('@app-component/${getNameByPath(this.resourcePath)}'` + ',undefined' + ',undefined' + `)` + output += `$app_bootstrap$('@app-component/ + ${getNameByPath(this.resourcePath)}'` + ',undefined' + ',undefined' + `)` } } return output diff --git a/ace-loader/src/manifest-loader.js b/ace-loader/src/manifest-loader.js index d67782d..d4c51c2 100644 --- a/ace-loader/src/manifest-loader.js +++ b/ace-loader/src/manifest-loader.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/manifest-plugin.js b/ace-loader/src/manifest-plugin.js index 64be0eb..3f939e8 100644 --- a/ace-loader/src/manifest-plugin.js +++ b/ace-loader/src/manifest-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/module-script.js b/ace-loader/src/module-script.js index 287f7cb..3672138 100644 --- a/ace-loader/src/module-script.js +++ b/ace-loader/src/module-script.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/src/resource-plugin.js b/ace-loader/src/resource-plugin.js index 36f2a75..1619b04 100644 --- a/ace-loader/src/resource-plugin.js +++ b/ace-loader/src/resource-plugin.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/test/card/testError/common/component/comp/comp.js b/ace-loader/test/card/testError/common/component/comp/comp.js index 204bd7b..7e57f15 100644 --- a/ace-loader/test/card/testError/common/component/comp/comp.js +++ b/ace-loader/test/card/testError/common/component/comp/comp.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { props:{ title: { diff --git a/ace-loader/test/card/testcase/pages/importLess/importLess.less b/ace-loader/test/card/testcase/pages/importLess/importLess.less index 16d8348..fffa9e9 100644 --- a/ace-loader/test/card/testcase/pages/importLess/importLess.less +++ b/ace-loader/test/card/testcase/pages/importLess/importLess.less @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @colorBackground: #000000; .container { background-color: @colorBackground; diff --git a/ace-loader/test/card/testcase/pages/withJS/withJS.js b/ace-loader/test/card/testcase/pages/withJS/withJS.js index 547816b..ac6424c 100644 --- a/ace-loader/test/card/testcase/pages/withJS/withJS.js +++ b/ace-loader/test/card/testcase/pages/withJS/withJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { data: { name: this.map['amy'], diff --git a/ace-loader/test/lite/commandTest/compile.js b/ace-loader/test/lite/commandTest/compile.js index 893d397..faf4724 100644 --- a/ace-loader/test/lite/commandTest/compile.js +++ b/ace-loader/test/lite/commandTest/compile.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/test/lite/commandTest/compile.test.js b/ace-loader/test/lite/commandTest/compile.test.js index b8f71eb..15a7708 100644 --- a/ace-loader/test/lite/commandTest/compile.test.js +++ b/ace-loader/test/lite/commandTest/compile.test.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/test/lite/customize.js b/ace-loader/test/lite/customize.js index b255070..7a6392b 100644 --- a/ace-loader/test/lite/customize.js +++ b/ace-loader/test/lite/customize.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/test/lite/expected/attribute.js b/ace-loader/test/lite/expected/attribute.js index 503f1c7..503c5e4 100644 --- a/ace-loader/test/lite/expected/attribute.js +++ b/ace-loader/test/lite/expected/attribute.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('slider', {'attrs' : {'max' : 100}} ),_c('image'),_c('div', {'attrs' : {'key' : \"day\",'value' : \"hello\"}} ),_c('text', {'attrs' : {'value' : \"hello\"}} ),_c('text', {'attrs' : {'value' : function () {return _vm.num}}} )] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('slider', {'attrs' : {'max' : 100}} ),_c('image'),_c('div', {'attrs' : {'key' : \"day\",'value' : \"hello\"}} ),_c('text', {'attrs' : {'value' : \"hello\"}} ),_c('text', {'attrs' : {'value' : function () {return _vm.num}}} )] ) }"} diff --git a/ace-loader/test/lite/expected/bubble.js b/ace-loader/test/lite/expected/bubble.js index 9a7642f..a109bcd 100644 --- a/ace-loader/test/lite/expected/bubble.js +++ b/ace-loader/test/lite/expected/bubble.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', {'staticClass' : [\"container\"]} , [_c('div', {'onBubbleEvents' : {'click' : _vm.test1}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test2}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test3}} ),_c('div', {'catchBubbleEvents' : {'click' : _vm.test4}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test5}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test6}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test7}} ),_c('div', {'catchBubbleEvents' : {'click' : _vm.test8}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test9}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test10}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test11}} ),_c('div', {'catchCaptureEvents' : {'click' : _vm.test12}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe1},'catchCaptureEvents' : {'longpress' : _vm.longpress1}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe2},'onCaptureEvents' : {'longpress' : _vm.longpress2}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe3},'onCaptureEvents' : {'longpress' : _vm.longpress3}} ),_c('div', {'catchBubbleEvents' : {'swipe' : _vm.swipe4},'onCaptureEvents' : {'longpress' : _vm.longpress4}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe5},'catchBubbleEvents' : {'longpress' : _vm.longpress5}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe6,'longpress' : _vm.longpress6}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe7,'longpress' : _vm.longpress7}} ),_c('div', {'catchBubbleEvents' : {'swipe' : _vm.swipe8},'onBubbleEvents' : {'longpress' : _vm.longpress8}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe9},'catchBubbleEvents' : {'longpress' : _vm.longpress9}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe10},'onBubbleEvents' : {'longpress' : _vm.longpress10}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe11},'onBubbleEvents' : {'longpress' : _vm.longpress11}} ),_c('div', {'catchCaptureEvents' : {'swipe' : _vm.swipe12},'onBubbleEvents' : {'longpress' : _vm.longpress12}} )] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', {'staticClass' : [\"container\"]} , [_c('div', {'onBubbleEvents' : {'click' : _vm.test1}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test2}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test3}} ),_c('div', {'catchBubbleEvents' : {'click' : _vm.test4}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test5}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test6}} ),_c('div', {'onBubbleEvents' : {'click' : _vm.test7}} ),_c('div', {'catchBubbleEvents' : {'click' : _vm.test8}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test9}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test10}} ),_c('div', {'onCaptureEvents' : {'click' : _vm.test11}} ),_c('div', {'catchCaptureEvents' : {'click' : _vm.test12}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe1},'catchCaptureEvents' : {'longpress' : _vm.longpress1}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe2},'onCaptureEvents' : {'longpress' : _vm.longpress2}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe3},'onCaptureEvents' : {'longpress' : _vm.longpress3}} ),_c('div', {'catchBubbleEvents' : {'swipe' : _vm.swipe4},'onCaptureEvents' : {'longpress' : _vm.longpress4}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe5},'catchBubbleEvents' : {'longpress' : _vm.longpress5}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe6,'longpress' : _vm.longpress6}} ),_c('div', {'onBubbleEvents' : {'swipe' : _vm.swipe7,'longpress' : _vm.longpress7}} ),_c('div', {'catchBubbleEvents' : {'swipe' : _vm.swipe8},'onBubbleEvents' : {'longpress' : _vm.longpress8}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe9},'catchBubbleEvents' : {'longpress' : _vm.longpress9}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe10},'onBubbleEvents' : {'longpress' : _vm.longpress10}} ),_c('div', {'onCaptureEvents' : {'swipe' : _vm.swipe11},'onBubbleEvents' : {'longpress' : _vm.longpress11}} ),_c('div', {'catchCaptureEvents' : {'swipe' : _vm.swipe12},'onBubbleEvents' : {'longpress' : _vm.longpress12}} )] ) }"} diff --git a/ace-loader/test/lite/expected/class.js b/ace-loader/test/lite/expected/class.js index 7651b0d..85e6e7d 100644 --- a/ace-loader/test/lite/expected/class.js +++ b/ace-loader/test/lite/expected/class.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('div', {'staticClass' : [\"container\"]} ),_c('div', {'staticClass' : [\"container\",\"table\"]} )] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('div', {'staticClass' : [\"container\"]} ),_c('div', {'staticClass' : [\"container\",\"table\"]} )] ) }"} diff --git a/ace-loader/test/lite/expected/event.js b/ace-loader/test/lite/expected/event.js index 1a678da..ff75958 100644 --- a/ace-loader/test/lite/expected/event.js +++ b/ace-loader/test/lite/expected/event.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + {"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('div', {'onBubbleEvents' : {'click' : _vm.test}} ),_c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(_vm.value,evt)}}} ),_c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(_vm.value,_vm.time,evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput('(',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput('(',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput(')',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput(')',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput('kk',_vm.value,'dd',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput(_vm.value,_vm.time,'(',evt)}}} ),_c('input', {'onBubbleEvents' : {'click' : function (evt) {_vm.handleInput('(',_vm.value,_vm.time,evt)}}} )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/expression.js b/ace-loader/test/lite/expected/expression.js index 070d203..26185b6 100644 --- a/ace-loader/test/lite/expected/expression.js +++ b/ace-loader/test/lite/expected/expression.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('text', {'attrs' : {'value' : function () {return _vm.ti||_vm.subTitle}}} ),_c('text', {'attrs' : {'value' : function () {return _vm.ti&&_vm.subTitle}}} ),_c('div', {'attrs' : {'value' : function () {return _vm.isArrived==='arrived'&&_vm.isTravel===false}}} ),_c('div', {'attrs' : {'value' : function () {return _vm.isArrived==='arrived'||_vm.isTravel===false}}} ),_c('div', {'attrs' : {'value' : function () {return !_vm.flag}}} ),_c('div', {'attrs' : {'value' : function () {return !!_vm.flag}}} )] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('text', {'attrs' : {'value' : function () {return _vm.ti||_vm.subTitle}}} ),_c('text', {'attrs' : {'value' : function () {return _vm.ti&&_vm.subTitle}}} ),_c('div', {'attrs' : {'value' : function () {return _vm.isArrived==='arrived'&&_vm.isTravel===false}}} ),_c('div', {'attrs' : {'value' : function () {return _vm.isArrived==='arrived'||_vm.isTravel===false}}} ),_c('div', {'attrs' : {'value' : function () {return !_vm.flag}}} ),_c('div', {'attrs' : {'value' : function () {return !!_vm.flag}}} )] ) }"} diff --git a/ace-loader/test/lite/expected/exteriorStyle.js b/ace-loader/test/lite/expected/exteriorStyle.js index 2c00e83..b2b8fec 100644 --- a/ace-loader/test/lite/expected/exteriorStyle.js +++ b/ace-loader/test/lite/expected/exteriorStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "render": "function (vm) { var _vm = vm || this; return _c('div') }", "styleSheet": { diff --git a/ace-loader/test/lite/expected/forDirective.js b/ace-loader/test/lite/expected/forDirective.js index 656100b..e901262 100644 --- a/ace-loader/test/lite/expected/forDirective.js +++ b/ace-loader/test/lite/expected/forDirective.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($item,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )}),_c('div', [_l((function () {return _vm.list}),function(personItem,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($idx,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('-') + (personItem.name) + decodeURI('--') + (personItem.age)}}} )] )}),_c('image', {'attrs' : {'src' : function () {return _vm.personItem}}} )] ),_c('div', [_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}}} )] )}),_c('swiper', {'attrs' : {'index' : function () {return _vm.personIndex},'loop' : function () {return _vm.personItem}}} )] ),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return _vm.menu}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (personItem.id) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return personItem}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (index) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}},'onBubbleEvents' : {'click' : personItem.click}} )] )}),_l((function () {return value.list}),function(index,value){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(value,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return value.info}},'onBubbleEvents' : {'click' : value.click}} )] )})] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($item,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )}),_c('div', [_l((function () {return _vm.list}),function(personItem,$idx){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test($idx,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('-') + (personItem.name) + decodeURI('--') + (personItem.age)}}} )] )}),_c('image', {'attrs' : {'src' : function () {return _vm.personItem}}} )] ),_c('div', [_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('text', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}}} )] )}),_c('swiper', {'attrs' : {'index' : function () {return _vm.personIndex},'loop' : function () {return _vm.personItem}}} )] ),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return _vm.menu}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (personItem.id) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_l((function () {return personItem}),function(item,index){return _c('div', [_c('text', {'attrs' : {'value' : function () {return (index) + decodeURI('--') + (item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(personItem,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return (personIndex) + decodeURI('.') + (personItem.name)}},'onBubbleEvents' : {'click' : personItem.click}} )] )}),_l((function () {return value.list}),function(index,value){return _c('div', {'onBubbleEvents' : {'click' : function (evt) {_vm.test(value,evt)}}} , [_c('div', {'attrs' : {'value' : function () {return value.info}},'onBubbleEvents' : {'click' : value.click}} )] )})] ) }"} diff --git a/ace-loader/test/lite/expected/ifDirective.js b/ace-loader/test/lite/expected/ifDirective.js index 4f82ca8..a11efd3 100644 --- a/ace-loader/test/lite/expected/ifDirective.js +++ b/ace-loader/test/lite/expected/ifDirective.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_c('div', {'staticClass' : [\"item-content\"]} , [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_i((function () {return _vm.conditionVar===2&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.elif}}} )}),_i((function () {return !(_vm.conditionVar===2)&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.else}}} )})] ),_i((function () {return _vm.showTest}),function(){return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_i((function () {return _vm.showTest}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', [_i((function () {return personIndex==1}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return personItem.name}}} )] )})] )})] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_c('div', {'staticClass' : [\"item-content\"]} , [_i((function () {return _vm.conditionVar===1}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.if}}} )}),_i((function () {return _vm.conditionVar===2&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.elif}}} )}),_i((function () {return !(_vm.conditionVar===2)&&!(_vm.conditionVar===1)}),function(){return _c('text', {'attrs' : {'value' : function () {return _vm.componentData.else}}} )})] ),_i((function () {return _vm.showTest}),function(){return _c('div', [_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function($item,$idx){return _c('div', [_i((function () {return _vm.showTest}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return ($idx) + decodeURI('.') + ($item.name)}}} )] )})] )}),_l((function () {return _vm.list}),function(personItem,personIndex){return _c('div', [_i((function () {return personIndex==1}),function(){return _c('div', [_c('text', {'attrs' : {'value' : function () {return personItem.name}}} )] )})] )})] ) }"} diff --git a/ace-loader/test/lite/expected/importJS.js b/ace-loader/test/lite/expected/importJS.js index 7e94e67..413540e 100644 --- a/ace-loader/test/lite/expected/importJS.js +++ b/ace-loader/test/lite/expected/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "goHome": "function goHome() {\n _system[\"default\"].replace({\n uri: \"pages/index/index\"\n });\n }", "render": "function (vm) { var _vm = vm || this; return _c('div', [_c('image')] ) }" diff --git a/ace-loader/test/lite/expected/inlineStyle.js b/ace-loader/test/lite/expected/inlineStyle.js index 128e8f0..9d8ac2b 100644 --- a/ace-loader/test/lite/expected/inlineStyle.js +++ b/ace-loader/test/lite/expected/inlineStyle.js @@ -1 +1,16 @@ -{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('div', {'staticStyle' : {'width' : 10}, } ),_c('div', {'dynamicStyle' :{'height' : function () {return _vm.num}}} ),_c('text', {'staticStyle' : {'color' : 13047173}, } ),_c('div', {'staticStyle' : {'color' : 14745599}, } ),_c('div', {'staticStyle' : {'animationDelay' : \"900ms\"}, } ),_c('div', {'staticStyle' : {'animationDuration' : \"200ms\"}, } ),_c('div', {'staticStyle' : {'animationIterationCount' : \"infinite\"}, } ),_c('div', {'staticStyle' : {'animationIterationCount' : 1000}, } ),_c('div', {'staticStyle' : {'backgroundImage' : \"url(/common/img/xmad.jpg)\"}, } ),_c('div', {'staticStyle' : {'backgroundImage' : \"url(/common/img/map.jpg)\"}, } )] ) }"} \ No newline at end of file +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +{"render": "function (vm) { var _vm = vm || this; return _c('div', [_c('div', {'staticStyle' : {'width' : 10}, } ),_c('div', {'dynamicStyle' :{'height' : function () {return _vm.num}}} ),_c('text', {'staticStyle' : {'color' : 13047173}, } ),_c('div', {'staticStyle' : {'color' : 14745599}, } ),_c('div', {'staticStyle' : {'animationDelay' : \"900ms\"}, } ),_c('div', {'staticStyle' : {'animationDuration' : \"200ms\"}, } ),_c('div', {'staticStyle' : {'animationIterationCount' : \"infinite\"}, } ),_c('div', {'staticStyle' : {'animationIterationCount' : 1000}, } ),_c('div', {'staticStyle' : {'backgroundImage' : \"url(/common/img/xmad.jpg)\"}, } ),_c('div', {'staticStyle' : {'backgroundImage' : \"url(/common/img/map.jpg)\"}, } )] ) }"} diff --git a/ace-loader/test/lite/expected/music.js b/ace-loader/test/lite/expected/music.js index d938d28..114d56c 100644 --- a/ace-loader/test/lite/expected/music.js +++ b/ace-loader/test/lite/expected/music.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "data": { "musics": [ diff --git a/ace-loader/test/lite/expected/sick.js b/ace-loader/test/lite/expected/sick.js index b831011..8afba09 100644 --- a/ace-loader/test/lite/expected/sick.js +++ b/ace-loader/test/lite/expected/sick.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "change": "function change() {\n _system[\"default\"].replace({\n uri: 'pages/music/music'\n });\n }", "data": { diff --git a/ace-loader/test/lite/test.js b/ace-loader/test/lite/test.js index 213f993..92344f1 100644 --- a/ace-loader/test/lite/test.js +++ b/ace-loader/test/lite/test.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 diff --git a/ace-loader/test/lite/testcase/app.js b/ace-loader/test/lite/testcase/app.js index bb1f752..01b76ea 100644 --- a/ace-loader/test/lite/testcase/app.js +++ b/ace-loader/test/lite/testcase/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onCreate() { console.info("AceApplication onCreate"); diff --git a/ace-loader/test/lite/testcase/pages/importJS/importJS.js b/ace-loader/test/lite/testcase/pages/importJS/importJS.js index 7aae162..ba83dc3 100644 --- a/ace-loader/test/lite/testcase/pages/importJS/importJS.js +++ b/ace-loader/test/lite/testcase/pages/importJS/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + /* Test import syntax */ import router from "@system.router"; diff --git a/ace-loader/test/lite/testcase/pages/music/music.js b/ace-loader/test/lite/testcase/pages/music/music.js index 41778f4..22159d1 100644 --- a/ace-loader/test/lite/testcase/pages/music/music.js +++ b/ace-loader/test/lite/testcase/pages/music/music.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { data: { musics: [ diff --git a/ace-loader/test/lite/testcase/pages/sick/sick.js b/ace-loader/test/lite/testcase/pages/sick/sick.js index b8366ed..2ea689a 100644 --- a/ace-loader/test/lite/testcase/pages/sick/sick.js +++ b/ace-loader/test/lite/testcase/pages/sick/sick.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import router from '@system.router'; export default { data: { diff --git a/ace-loader/test/rich/expected/class.js b/ace-loader/test/rich/expected/class.js index 98a4c0d..1b9603b 100644 --- a/ace-loader/test/rich/expected/class.js +++ b/ace-loader/test/rich/expected/class.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/class": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/commonAttr.js b/ace-loader/test/rich/expected/commonAttr.js index 9a59e78..ecb36df 100644 --- a/ace-loader/test/rich/expected/commonAttr.js +++ b/ace-loader/test/rich/expected/commonAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/commonAttr": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/event.js b/ace-loader/test/rich/expected/event.js index a3c8317..db39746 100644 --- a/ace-loader/test/rich/expected/event.js +++ b/ace-loader/test/rich/expected/event.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/event": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/expression.js b/ace-loader/test/rich/expected/expression.js index 5c6f746..245e1e5 100644 --- a/ace-loader/test/rich/expected/expression.js +++ b/ace-loader/test/rich/expected/expression.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/expression": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/exteriorStyle.js b/ace-loader/test/rich/expected/exteriorStyle.js index 3c085d5..07f941e 100644 --- a/ace-loader/test/rich/expected/exteriorStyle.js +++ b/ace-loader/test/rich/expected/exteriorStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/exteriorStyle": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/forDirective.js b/ace-loader/test/rich/expected/forDirective.js index 6ad1461..669c040 100644 --- a/ace-loader/test/rich/expected/forDirective.js +++ b/ace-loader/test/rich/expected/forDirective.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/forDirective": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/ifDirective.js b/ace-loader/test/rich/expected/ifDirective.js index 7938f03..035d414 100644 --- a/ace-loader/test/rich/expected/ifDirective.js +++ b/ace-loader/test/rich/expected/ifDirective.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/ifDirective": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/importCSS.js b/ace-loader/test/rich/expected/importCSS.js index 1af384c..66e850e 100644 --- a/ace-loader/test/rich/expected/importCSS.js +++ b/ace-loader/test/rich/expected/importCSS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/importCSS": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/importJS.js b/ace-loader/test/rich/expected/importJS.js index 0a916f7..522edc5 100644 --- a/ace-loader/test/rich/expected/importJS.js +++ b/ace-loader/test/rich/expected/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/importJS": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/inlineStyle.js b/ace-loader/test/rich/expected/inlineStyle.js index 16bd91a..d5baab7 100644 --- a/ace-loader/test/rich/expected/inlineStyle.js +++ b/ace-loader/test/rich/expected/inlineStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/inlineStyle": { "_descriptor": {}, @@ -253,7 +268,7 @@ "value": "style_test23" }, "style": { - "backgroundImage": "https://huawei.com/logo.jpg" + "backgroundImage": "https://img2.baidu.com/it/u=2000577849,825990840&fm=26&fmt=auto" } } ] diff --git a/ace-loader/test/rich/expected/mediaQuery.js b/ace-loader/test/rich/expected/mediaQuery.js index c026b3a..dc241b7 100644 --- a/ace-loader/test/rich/expected/mediaQuery.js +++ b/ace-loader/test/rich/expected/mediaQuery.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/mediaQuery": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/privateAttr.js b/ace-loader/test/rich/expected/privateAttr.js index e423258..0ed854b 100644 --- a/ace-loader/test/rich/expected/privateAttr.js +++ b/ace-loader/test/rich/expected/privateAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/privateAttr": { "_descriptor": {}, diff --git a/ace-loader/test/rich/expected/uncommonAttr.js b/ace-loader/test/rich/expected/uncommonAttr.js index a2201f2..1f55d90 100644 --- a/ace-loader/test/rich/expected/uncommonAttr.js +++ b/ace-loader/test/rich/expected/uncommonAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "@app-component/uncommonAttr": { "_descriptor": {}, diff --git a/ace-loader/test/rich/test.js b/ace-loader/test/rich/test.js index b746cdf..3c79264 100644 --- a/ace-loader/test/rich/test.js +++ b/ace-loader/test/rich/test.js @@ -36,9 +36,10 @@ function getActualString(componentName) { } function getExpectJSON(componentName) { + const matchHashComment = /\/\*(.|\n)+\*\//; const filepath = path.join(__dirname, 'expected', `${componentName}.js`); const expectedContent = fs.readFileSync(filepath, 'utf-8'); - const expectedObj = JSON.parse(expectedContent.toString()); + const expectedObj = JSON.parse(expectedContent.toString().replace(matchHashComment, '')); return expectedObj; } diff --git a/ace-loader/test/rich/testcase/app.js b/ace-loader/test/rich/testcase/app.js index bb1f752..01b76ea 100644 --- a/ace-loader/test/rich/testcase/app.js +++ b/ace-loader/test/rich/testcase/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onCreate() { console.info("AceApplication onCreate"); diff --git a/ace-loader/test/rich/testcase/pages/class/class.js b/ace-loader/test/rich/testcase/pages/class/class.js index e69de29..2e73d04 100644 --- a/ace-loader/test/rich/testcase/pages/class/class.js +++ b/ace-loader/test/rich/testcase/pages/class/class.js @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ diff --git a/ace-loader/test/rich/testcase/pages/commonAttr/commonAttr.js b/ace-loader/test/rich/testcase/pages/commonAttr/commonAttr.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/commonAttr/commonAttr.js +++ b/ace-loader/test/rich/testcase/pages/commonAttr/commonAttr.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/event/event.js b/ace-loader/test/rich/testcase/pages/event/event.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/event/event.js +++ b/ace-loader/test/rich/testcase/pages/event/event.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/expression/expression.js b/ace-loader/test/rich/testcase/pages/expression/expression.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/expression/expression.js +++ b/ace-loader/test/rich/testcase/pages/expression/expression.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/exteriorStyle/exteriorStyle.js b/ace-loader/test/rich/testcase/pages/exteriorStyle/exteriorStyle.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/exteriorStyle/exteriorStyle.js +++ b/ace-loader/test/rich/testcase/pages/exteriorStyle/exteriorStyle.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/forDirective/forDirective.js b/ace-loader/test/rich/testcase/pages/forDirective/forDirective.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/forDirective/forDirective.js +++ b/ace-loader/test/rich/testcase/pages/forDirective/forDirective.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/importCSS/importCSS.js b/ace-loader/test/rich/testcase/pages/importCSS/importCSS.js index e69de29..d8fdade 100644 --- a/ace-loader/test/rich/testcase/pages/importCSS/importCSS.js +++ b/ace-loader/test/rich/testcase/pages/importCSS/importCSS.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + diff --git a/ace-loader/test/rich/testcase/pages/importJS/importJS.js b/ace-loader/test/rich/testcase/pages/importJS/importJS.js index 8397662..b7583f4 100644 --- a/ace-loader/test/rich/testcase/pages/importJS/importJS.js +++ b/ace-loader/test/rich/testcase/pages/importJS/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + /* Test import syntax */ import router from "@system.router"; diff --git a/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml index 26b9fe0..eef3554 100644 --- a/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml +++ b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml @@ -66,5 +66,5 @@