diff --git a/LICENSE b/LICENSE index 4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d..9d2381c51371f4fcbb3b4c43af6045cd9db5ff3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2020 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. + */ Apache License Version 2.0, January 2004 @@ -174,4 +188,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/.npmignore b/ace-loader/.npmignore index 246c4aa256ecc7c8938671947bff1019300d1a1d..bb2d4270e502b03703e84e20755bacde84ad261a 100644 --- a/ace-loader/.npmignore +++ b/ace-loader/.npmignore @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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/plugin/codegen/index.js b/ace-loader/plugin/codegen/index.js index 3e254897150410bef8dd399f5b68c2288463da3c..fc95cbd32d5170e6e26277710aa49911e9577397 100644 --- a/ace-loader/plugin/codegen/index.js +++ b/ace-loader/plugin/codegen/index.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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__ = ({ @@ -22,7 +37,7 @@ exports.errorMap = new Map([ /***/ }), /***/ 117: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { /** @@ -41,7 +56,7 @@ exports.ASTNode = ASTNode; /***/ }), /***/ 862: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { /** @@ -52,7 +67,9 @@ 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,42 +79,55 @@ class Cache { this.flag = true; this.INDENT = INDENT; } + /** + * * @description: when flag is true, there should be some indents * @return void */ indentOn() { this.flag = true; } + /** + * * @description: when flag is false, there should be no indents * @return void */ indentOff() { this.flag = false; } + /** + * * @description: increase indent * @return void */ incIndent() { this.indent++; } + /** + * * @description: decrease indent * @return void */ + decIndent() { this.indent--; } + /** + * * @description: check whether indent is LT 0 * @return boolean value representing whether indent is LT 0 */ checkIndent() { return this.indent < 0; } + /** + * * @description: get indent * @return indents */ @@ -113,7 +143,9 @@ class Cache { return ""; } } + /** + * * @description: concat indents and HML/CSS code * @param strings means HML/CSS code * @return HML/CSS code after indents are set @@ -123,7 +155,9 @@ class Cache { this.value = this.value.concat(...strings); return String(this.value); } + /** + * * @description: concat indents and HML/CSS code * @return HML/CSS code */ @@ -137,7 +171,7 @@ exports.Cache = Cache; /***/ }), /***/ 243: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { /* @@ -145,9 +179,11 @@ exports.Cache = Cache; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Style = exports.Tag = void 0; -const ASTNode_1 = __webpack_require__(117); -class Tag extends ASTNode_1.ASTNode { +const ASTNode1 = __webpack_require__(117); +class Tag extends ASTNode1.ASTNode { + /** + * * @description: constructor for Tag * @param tagName is name of component * @param attributes is attributes of component @@ -161,8 +197,10 @@ class Tag extends ASTNode_1.ASTNode { } } exports.Tag = Tag; -class Style extends ASTNode_1.ASTNode { +class Style extends ASTNode1.ASTNode { + /** + * * @description: constructor for Style * @param kind distinguishes id and class * @param name is name of id or class @@ -181,17 +219,13 @@ exports.Style = Style; /***/ }), /***/ 573: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -/* -* @Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved. -*/ +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ASTNodeGenerator = void 0; -const AST_1 = __webpack_require__(243); -const Token_1 = __webpack_require__(334); +const AST1 = __WebpackRequire__(243); +const Token1 = __webpack_require__(334); class ASTNodeGenerator { + /** * @description: constructor for BridgeVisitor * @param reference is cache for Harmony FA code @@ -199,6 +233,7 @@ class ASTNodeGenerator { constructor(reference) { this.cache = reference; } + /** * @description: visitor mode dispatcher * @param t Node in AST @@ -211,6 +246,7 @@ class ASTNodeGenerator { this.genStyle(t); } } + /** * @description: code generator * @param ref is cache for code @@ -225,6 +261,7 @@ class ASTNodeGenerator { } return ASTNodeGenerator.instance; } + /** * @description: cache for code * @param ref is cache for code @@ -233,26 +270,28 @@ class ASTNodeGenerator { setCache(ref) { this.cache = ref; } + /** * @description: parse Tag in AST and generate code for Tag in cache * @param t Tag in AST * @return void */ genTag(t) { - this.cache.concat(Token_1.TokenClass.TAG_START, t.tagName); + this.cache.concat(Token1.TokenClass.TAG_START, t.tagName); this.cache.indentOff(); t.attributes.forEach((value, key) => { let valueBK = ""; 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(Token1.TokenClass.SPACE, key, Token1.TokenClass.ASSIGN, + Token1.TokenClass.LQUOTE, valueBK, Token1.TokenClass.RQUOTE); }); if (t.content === null) { - this.cache.concat(Token_1.TokenClass.EMPTY_TAG_END); + this.cache.concat(Token1.TokenClass.EMPTY_TAG_END); } else { - this.cache.concat(Token_1.TokenClass.TAG_END); + this.cache.concat(Token1.TokenClass.TAG_END); if (typeof t.content === "string") { let contentBK = ""; for (const char of t.content) { @@ -261,21 +300,22 @@ class ASTNodeGenerator { this.cache.concat(contentBK); } else if (t.content.length !== 0) { - this.cache.concat(Token_1.TokenClass.NEW_LINE); + this.cache.concat(Token1.TokenClass.NEW_LINE); this.cache.indentOn(); this.cache.incIndent(); t.content.forEach((tag) => { tag.accept(this); this.cache.indentOff(); - this.cache.concat(Token_1.TokenClass.NEW_LINE); + this.cache.concat(Token1.TokenClass.NEW_LINE); this.cache.indentOn(); }); this.cache.decIndent(); this.cache.indentOn(); } - this.cache.concat(Token_1.TokenClass.END_TAG_START, t.tagName, Token_1.TokenClass.TAG_END); + this.cache.concat(Token1.TokenClass.END_TAG_START, t.tagName, Token1.TokenClass.TAG_END); } } + /** * @description: parse Style in AST and generate code for Style in cache * @param s Style in AST @@ -283,17 +323,18 @@ class ASTNodeGenerator { */ genStyle(s) { if (s.kind === "IDStyle") { - this.cache.concat(Token_1.TokenClass.ID_STYLE_START); + this.cache.concat(Token1.TokenClass.ID_STYLE_START); this.cache.indentOff(); } - this.cache.concat(s.name, Token_1.TokenClass.SPACE, Token_1.TokenClass.LBRA, Token_1.TokenClass.NEW_LINE); + this.cache.concat(s.name, Token1.TokenClass.SPACE, Token1.TokenClass.LBRA, Token1.TokenClass.NEW_LINE); 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, Token1.TokenClass.COLON, Token1.TokenClass.SPACE, value, + Token1.TokenClass.SEMICOLON, Token1.TokenClass.NEW_LINE); }); this.cache.decIndent(); - this.cache.concat(Token_1.TokenClass.RBRA, Token_1.TokenClass.NEW_LINE, Token_1.TokenClass.NEW_LINE); + this.cache.concat(Token1.TokenClass.RBRA, Token1.TokenClass.NEW_LINE, Token1.TokenClass.NEW_LINE); } } exports.ASTNodeGenerator = ASTNodeGenerator; @@ -303,21 +344,21 @@ ASTNodeGenerator.instance = undefined; /***/ }), /***/ 844: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { + -/* -* @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); -const PropertySet_1 = __webpack_require__(571); +const PropertySet1 = __webpack_require__(571); class HMLBridge { constructor() { this.errors = 0; } + /** + * * @description: generate error message * @param msg is error message to show up in console */ @@ -325,14 +366,18 @@ class HMLBridge { console.error("Code generating error: " + msg); this.errors += 1; } + /** + * * @description: get error number * @return error number */ getErrorCount() { return this.errors; } + /** + * * @description: visitor guidance method for contents, * sort out incoming type and guide to matching code generator * @param visualModel is a object with Model or Container or CharUI primitive types to be generated @@ -342,13 +387,13 @@ class HMLBridge { const attributes = new Map([["id", visualModel.id]]); let content = ""; for (let [key, val] of visualModel.property) { - if (PropertySet_1.isAttribute(key)) { + if (PropertySet1.isAttribute(key)) { if (typeof val !== "string") { val = JSON.stringify(val); } attributes.set(key, val); } - else if (PropertySet_1.isContent(key)) { + else if (PropertySet1.isContent(key)) { content = val; } } @@ -367,30 +412,35 @@ 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 */ 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 * @return a code tree representing Harmony FA CSS code */ genIDStyle(visualModel) { const styles = new Map(); - for (const prop of PropertySet_1.styleSet) { - if (visualModel.property.has(prop) && PropertySet_1.isStyle(prop)) { + for (const prop of PropertySet1.styleSet) { + if (visualModel.Property.has(prop) && PropertySet1.isStyle(prop)) { styles.set(prop, visualModel.property.get(prop)); } } @@ -401,7 +451,9 @@ class CSSBridge { visualChild.accept(this); } } + /** + * * @description: visitor guidance method for contents, * sort out incoming type and guide to matching code generator * @param obj is a object with Model or Container or CharUI primitive types to be generated @@ -418,7 +470,7 @@ exports.CSSBridge = CSSBridge; /***/ }), /***/ 55: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { /* @@ -426,26 +478,30 @@ exports.CSSBridge = CSSBridge; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.genFACSS = exports.genFAHML = void 0; -const ASTNodeVisitor_1 = __webpack_require__(573); -const Cache_1 = __webpack_require__(862); +const ASTNodeVisitor1 = __webpack_require__(573); +const Cache1 = __webpack_require__(862); + /** +* * @description: generate HML * @param t is Tag in AST * @return HML code */ function genFAHML(t) { - const generator = ASTNodeVisitor_1.ASTNodeGenerator.getMethodGen(new Cache_1.Cache(" ")); + const generator = ASTNodeVisitor1.ASTNodeGenerator.getMethodGen(new Cache1.Cache(" ")); t.accept(generator); return generator.cache.toString(); } exports.genFAHML = genFAHML; + /** +* * @description: generate CSS * @param t is Style in AST * @return CSS code */ function genFACSS(t) { - const generator = ASTNodeVisitor_1.ASTNodeGenerator.getMethodGen(new Cache_1.Cache(" ")); + const generator = ASTNodeVisitor1.ASTNodeGenerator.getMethodGen(new Cache1.Cache(" ")); t.forEach((value) => { value.accept(generator); }); @@ -457,22 +513,22 @@ exports.genFACSS = genFACSS; /***/ }), /***/ 571: -/***/ ((__unused_webpack_module, exports) => { - +/***/ ((__unusedWebpackModule, 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 +552,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 +591,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"]; @@ -616,7 +675,7 @@ exports.isEvent = isEvent; /***/ }), /***/ 334: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { /** @@ -660,7 +719,7 @@ var TokenClass; /***/ }), /***/ 234: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { /** @@ -719,17 +778,19 @@ exports.Enum = Enum; /***/ }), /***/ 207: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { 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); +const Instance1 = __webpack_require__(891); +const FormModel1 = __webpack_require__(945); exports.formManager = { + /** * * remove a key-value in data node @@ -738,6 +799,7 @@ exports.formManager = { removeData(key) { this.getFormModel().data.delete(key); }, + /** * * add a key-value @@ -755,7 +817,9 @@ exports.formManager = { }); } }, + /** + * * update all the data * @param data */ @@ -763,6 +827,7 @@ exports.formManager = { this.getFormModel().data.clear(); this.addData(data); }, + /** * * add an action in action node @@ -776,9 +841,11 @@ exports.formManager = { Object.keys(params).forEach(key => { paramMap.set(key, params[key]); }); - this.getFormModel().actions.set(actionName, new FormModel_1.FormAction(actionType, paramMap, abilityName)); + this.getFormModel().actions.set(actionName, new FormModel1.FormAction(actionType, paramMap, abilityName)); }, + /** + * * update all the actions * @param map: the new actions to be updated */ @@ -786,10 +853,11 @@ exports.formManager = { this.getFormModel().actions.clear(); map.forEach((value, key) => { const params = this.objectToMap(value.params); - const action = new FormModel_1.FormAction(value.actionType, params, value.abilityName); + const action = new FormModel1.FormAction(value.ActionType, params, value.AbilityName); this.getFormModel().actions.set(key, action); }); }, + /** * * remove an action @@ -798,6 +866,7 @@ exports.formManager = { removeAction(actionName) { this.getFormModel().actions.delete(actionName); }, + /** * * add params in an action @@ -806,13 +875,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 FormModel1.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,19 +893,24 @@ 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; + return Instance1.getInstance().formData; }, + /** + * * codegen formModel to json */ - codegenToJson: function () { - const model = Instance_1.getInstance().formData; + CodegenToJson: function () { + const model = Instance1.getInstance().formData; const data = this.mapToObject(model.data); const actions = this.mapToObject(model.actions); const retObj = { actions: {}, data: {} }; @@ -845,13 +921,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(); + Instance1.getInstance().formData.data.clear(); + Instance1.getInstance().formData.actions.clear();; }, + /** * * convert a map to an object @@ -861,9 +940,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) { @@ -879,7 +961,7 @@ exports.formManager = { /***/ }), /***/ 945: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { /* @@ -907,7 +989,7 @@ exports.FormAction = FormAction; /***/ }), /***/ 964: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unusedWebpackModule, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -928,31 +1010,37 @@ exports.isBindingEvent = isBindingEvent; /***/ }), /***/ 891: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { 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); +const PhysicalModel1 = __webpack_require__(234); +const VisualModel1 = __webpack_require__(933); +const FormModel1 = __webpack_require__(945); const instance = { document: { VisualVersion: "12", type: "FA" }, - visualModel: new VisualModel_1.VisualModel({ type: "div", id: "wrapper" }), - harmonyConnectDevice: new PhysicalModel_1.Device(), - formData: new FormModel_1.FormModel(), + VisualModel: new VisualModel1.VisualModel({ type: "div", id: "wrapper" }), + HarmonyConnectDevice: new PhysicalModel1.Device(), + formData: new FormModel1.FormModel(), }; + /** +* * instance is unique during the entire web page lifecycle */ function getInstance() { return instance; } exports.getInstance = getInstance; + /** +* * replace instance * @param ins */ @@ -964,19 +1052,23 @@ function setInstance(ins) { } } exports.setInstance = setInstance; + /** +* * get a physical model by its serviceId and characteristicName * @param path */ function getPhysicalModel(path) { const service = getInstance().harmonyConnectDevice.services.find(e => e.serviceId === path.serviceId); if (service === undefined) { - return undefined; + return undefined; } 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 */ @@ -1000,34 +1092,41 @@ exports.addPhysicalModel = addPhysicalModel; /***/ }), /***/ 977: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __webpackRequire__) => { 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 Instance_1 = __webpack_require__(891); +const VisualModel1 =__webpack_require__(933); +const Instance1 = __webpack_require__(891); + /** +* * @description: convert JsonModel to Json * @return model in json format */ function serialize() { - return JSON.stringify(Instance_1.getInstance(), replacer); + return JSON.stringify(Instance1.getInstance(), replacer); } exports.serialize = serialize; + /** * @description: convert Json to JsonModel * @return model in json format */ -function deserialize(json) { +function Deserialize(json) { const ins = JSON.parse(json, reviver); - Instance_1.setInstance(ins); + Instance1.setInstance(ins); } -exports.deserialize = deserialize; +exports.Deserialize = Deserialize; + /** +* * json replacer, turn any class into string * @param key * @param value @@ -1046,7 +1145,7 @@ function replacer(key, value) { }; } else if (value instanceof VisualModel_1.VisualModel) { - const visualObj = new VisualModel_1.VisualModel({ type: "none"}); + const VisualObj = new VisualModel_1.VisualModel({ type: "none"}); const res = {}; for (const visualKey in visualObj) { if (Object.prototype.hasOwnProperty.call(value, visualKey)) { @@ -1062,7 +1161,9 @@ function replacer(key, value) { return value; } } + /** +* * json reviver, true magic, replace plain json to classes * @param key * @param value @@ -1076,7 +1177,7 @@ function reviver(key, value) { return new Set(value.value); } else if (value.dataType === "VisualModel") { - const res = new VisualModel_1.VisualModel({ type: "" }); + const res = new VisualModel1.VisualModel({ type: "" }); Object.assign(res, value.value); value = res; } @@ -1088,15 +1189,13 @@ function reviver(key, value) { /***/ }), /***/ 933: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unusedWebpackModule, exports, __WebpackRequire__) => { + -/* -* @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); +const CombinedModel1 = __webpack_require__(964); // sometimes the type of VisualModel would be add a suffix to distinguish origin component of GrapesJs // e.g. button-visual const typeSuffix = "-visual"; @@ -1119,7 +1218,8 @@ class VisualModel { this.combinedInfo = { id: "", type: "", - selfType: obj.combinedSelfType === undefined ? CombinedModel_1.CombinedSelfType.None : obj.combinedSelfType, + selfType: obj.combinedSelfType === + undefined ? CombinedModel1.CombinedSelfType.None : obj.combinedSelfType, data: obj.data, event: obj.event, }; @@ -1137,47 +1237,50 @@ exports.VisualModel = VisualModel; /******/ }); /************************************************************************/ /******/ // The module cache -/******/ var __webpack_module_cache__ = {}; +/******/ var __WebpackModuleCache__ = {}; /******/ /******/ // The require function -/******/ function __webpack_require__(moduleId) { +/******/ function __WebpackRequire__(ModuleId) { /******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ var CachedModule = __WebpackModuleCache[ModuleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ var Module = __WebpackModuleCache__[ModuleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ webpackModules[moduleId](module, module.exports, webpackRequire); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ -var __webpack_exports__ = {}; +var __WebpackExports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { -var exports = __webpack_exports__; +var exports = __WebpackExports__; /** +* * 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); -const Serialization_1 = __webpack_require__(977); -const BridgeVisitor_1 = __webpack_require__(844); -const HmlCssCodeGenerator_1 = __webpack_require__(55); -const FormManager_1 = __webpack_require__(207); -const visualVersion = 12; +const ErrorMap1 = __WebpackRequire__(784); +const Instance1 = __WebpackRequire__(891); +const Serialization1 = __WebpackRequire__(977); +const BridgeVisitor1 = __WebpackRequire__(844); +const HmlCssCodeGenerator1 =__WebpackRequire__(55); +const FormManager1 = __WebpackRequire__(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 @@ -1194,8 +1297,8 @@ function genHmlAndCss(source) { }; try { // parse source code in visual file - Serialization_1.deserialize(source); - const destVisualVersion = Instance_1.getInstance().document.VisualVersion; + Serialization1.deserialize(source); + const destVisualVersion = Instance1.getInstance().document.VisualVersion; const regex = /^([1-9]+[0-9]*)$/; if (destVisualVersion === undefined) { retObj.errorType = "versionError"; @@ -1207,14 +1310,14 @@ function genHmlAndCss(source) { } } try { - const model = Instance_1.getInstance().visualModel; + const model = Instance1.getInstance().visualModel; const hmlCss = emitFA(model); if (hmlCss.hml === "error" || hmlCss.css === "error") { retObj.errorType = "codegenError"; } retObj.hmlCss = hmlCss; - if (Instance_1.getInstance().document.type === "FORM") { - retObj.hmlCss.json = FormManager_1.formManager.codegenToJson(); + if (Instance1.getInstance().document.type === "FORM") { + retObj.hmlCss.json = FormManager1.formManager.codegenToJson(); } } catch (e) { @@ -1225,13 +1328,15 @@ function genHmlAndCss(source) { retObj.errorType = "fileError"; } if (retObj.errorType !== "") { - retObj.errorMessage = errorMap_1.errorMap.get(retObj.errorType); + retObj.errorMessage = errorMap1.errorMap.get(retObj.errorType); retObj.hmlCss.hml = ""; retObj.hmlCss.css = ""; } return retObj; } + /** +* * @description: output hml and css source code of the model */ function emitFA(rootModel) { @@ -1241,9 +1346,9 @@ function emitFA(rootModel) { json: "", }; // generate hml - const hmlVisitor = new BridgeVisitor_1.HMLBridge(); + const hmlVisitor = new BridgeVisitor1.HMLBridge(); const ast = rootModel.accept(hmlVisitor); - const hmlRes = HmlCssCodeGenerator_1.genFAHML(ast); + const hmlRes = HmlCssCodeGenerator1.genFAHML(ast); if (hmlVisitor.getErrorCount() > 0) { hmlCss.hml = "error"; } @@ -1251,9 +1356,9 @@ function emitFA(rootModel) { hmlCss.hml = hmlRes; } // generate css - const cssVisitor = new BridgeVisitor_1.CSSBridge(); + const cssVisitor = new BridgeVisitor1.CSSBridge(); const styles = rootModel.accept(cssVisitor); - const cssRes = HmlCssCodeGenerator_1.genFACSS(styles); + const cssRes = HmlCssCodeGenerator1.genFACSS(styles); if (cssVisitor.getErrorCount() > 0) { hmlCss.css = "error"; } @@ -1266,8 +1371,8 @@ exports.genHmlAndCss = genHmlAndCss; })(); -var __webpack_export_target__ = exports; -for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; -if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); +var __WebpackExportTarget__ = exports; +for(var i in __WebpackExports__) __WebpackExportTarget__[i] = __WebpackExports__[i]; +if(__WebpackExports__.__esModule) Object.defineProperty(__WebpackExportTarget__, "__esModule", { value: true }); /******/ })() ; diff --git a/ace-loader/plugin/templater/component_validator.js b/ace-loader/plugin/templater/component_validator.js index 92928c0bb560b966ab00eab0030e3da9120f35ec..3612ed066210ba5b720da96f3dd1405f2fde9668 100644 --- a/ace-loader/plugin/templater/component_validator.js +++ b/ace-loader/plugin/templater/component_validator.js @@ -1073,7 +1073,8 @@ 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) + '})') } } } diff --git a/ace-loader/sample/DataAbility/data.js b/ace-loader/sample/DataAbility/data.js index 439e396a55ba789e75f2a12d26f77cab56eaa1bb..eea1151abcc6e40672d1a2c185cd6ce8d100b248 100644 --- a/ace-loader/sample/DataAbility/data.js +++ b/ace-loader/sample/DataAbility/data.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 60cb1c3ca71b14bd8b52e4d324482226705f594e..073ca2d3ce4ff2cfaa62ec3e051712b586b0077e 100644 --- a/ace-loader/sample/ServiceAbility/service.js +++ b/ace-loader/sample/ServiceAbility/service.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 bb1f75249d30a6ad0bbf9ff28e64d4ebfef362df..d05541851ce24e120b20385717f3efd331f1a8f2 100644 --- a/ace-loader/sample/lite/app.js +++ b/ace-loader/sample/lite/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 d352de55f3dcd2b063c6900c2cd7fd1ffb60b060..2b6cd2b80809e46050f7e7f777830fc646cdbcd0 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) 2020 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 e59972a1a2e747e9486bc6426715dfab8284a6d9..19975f84d7619390753d7fa4fb38d75d7d7b6a4b 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) 2020 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 d624d9cee70c2ab40c7c4b32ccb50ef054873f09..243d25f1de00b614af318915e7528fddea406cd1 100644 --- a/ace-loader/sample/rich/app.js +++ b/ace-loader/sample/rich/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 42d99d619b61f42b736ad48a9e4d8f4c5ee2e50e..ee3e752ee40524bf57f530e2fa4284ceb22257f5 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) 2020 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 d236f6fb3c06d2faeca660520edd31550f6b314c..07ce9f26be96ac1218271afb119254976f4bb3c1 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) 2020 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/lite/lite-return-exports-plugin.js b/ace-loader/src/lite/lite-return-exports-plugin.js index 5707822bea0fc84a04be36f71fd5d793658fdcc1..b711b669bde37ac3cf73eafa02577cb7ccd32ad4 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) 2020 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'; /** @@ -5,6 +20,7 @@ const pluginName = 'LiteReturnExportsPlugin'; */ class LiteReturnExportsPlugin { /** + * * return exports from runtime * @param {Object} compiler API specification, all configuration information of Webpack environment. */ diff --git a/ace-loader/src/lite/lite-transform-style.js b/ace-loader/src/lite/lite-transform-style.js index 25572a394268f21f682795d12fed1859b14eb66a..2618ee9bca929337871df909cff85b1daf4aeb4d 100644 --- a/ace-loader/src/lite/lite-transform-style.js +++ b/ace-loader/src/lite/lite-transform-style.js @@ -53,7 +53,6 @@ function transformStyle(value) { } else if (key === MEDIA_QUERY) { styleSheet['@media'] = mediaQueryFormat(style[key]); } else { - // todo: Label style } } if (style != null && keys.length !== 0) { @@ -68,6 +67,7 @@ function transformStyle(value) { return res; } /** + * * keyFrame style special compilation. * @param {Obejct} obj Preliminary compilation results of keyFrame style. * @return {Obejct} keyFrame style obejct. diff --git a/ace-loader/src/loader-gen.js b/ace-loader/src/loader-gen.js index 1c6e7fef5721f1f6d4a9262be6a1706694fec14a..768b262172e1c299aed1a8296b90919b90a9c3c0 100644 --- a/ace-loader/src/loader-gen.js +++ b/ace-loader/src/loader-gen.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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/test/card/testError/common/component/comp/comp.js b/ace-loader/test/card/testError/common/component/comp/comp.js index 204bd7b89ed87eafe90762170082a38f6c66d7d6..03cdc6f5d9df9dd95611e51d6431be221f4a8875 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) 2020 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 16d83484738812ae33f350028e398e04d89d6fbd..582b3036f261bb3fa55e510d9c465ba5aa02690d 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) 2020 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 547816b6e15e716db4f7cb4b577e9200742bda25..b5698936db0c2374130a8fb055ed13b28b5af5db 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) 2020 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/expected/attribute.js b/ace-loader/test/lite/expected/attribute.js index 503f1c7cbbf7cba7f349798da2726c5287fe5229..f92e5f1c749b4c133dbd149a3d782cddeb2d1894 100644 --- a/ace-loader/test/lite/expected/attribute.js +++ b/ace-loader/test/lite/expected/attribute.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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}}} )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/bubble.js b/ace-loader/test/lite/expected/bubble.js index 9a7642f93a5d7dd0297f1f46b45c826e051cad2e..05e9d62cc66f54a92833508297e0083e616a8e73 100644 --- a/ace-loader/test/lite/expected/bubble.js +++ b/ace-loader/test/lite/expected/bubble.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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}} )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/class.js b/ace-loader/test/lite/expected/class.js index 7651b0d40078d70f2967867b9ae68b9df7756f92..51f4f65e4125afa79b37c7467e59c9be0d7ee29f 100644 --- a/ace-loader/test/lite/expected/class.js +++ b/ace-loader/test/lite/expected/class.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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\"]} )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/event.js b/ace-loader/test/lite/expected/event.js index 1a678da2e81b0a60fd1e77632a32cd1a07a6cda1..c1e42cee0417788647644d69cf41dc130ada62dd 100644 --- a/ace-loader/test/lite/expected/event.js +++ b/ace-loader/test/lite/expected/event.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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 070d2033f28e05d4d0647fcd43ba86ac617f7563..0214e196d6a543da710e969c46604e87301b3daa 100644 --- a/ace-loader/test/lite/expected/expression.js +++ b/ace-loader/test/lite/expected/expression.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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}}} )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/exteriorStyle.js b/ace-loader/test/lite/expected/exteriorStyle.js index 2c00e8390c5d62b019e6322dbb7fd097132bd520..f619522a7b2ebd139b4019dfd149e8b8532f468d 100644 --- a/ace-loader/test/lite/expected/exteriorStyle.js +++ b/ace-loader/test/lite/expected/exteriorStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 656100bc29a303fe6e7677625aa362ac0442c241..1f14fe54d2c0991d1d94d9cacf8b6803007679e1 100644 --- a/ace-loader/test/lite/expected/forDirective.js +++ b/ace-loader/test/lite/expected/forDirective.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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}} )] )})] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/ifDirective.js b/ace-loader/test/lite/expected/ifDirective.js index 4f82ca83ae8886a0b36d179b67100c5d43cc6fc4..898bc0107dccdcfdceb85f1b4c474a1cf00fdd8c 100644 --- a/ace-loader/test/lite/expected/ifDirective.js +++ b/ace-loader/test/lite/expected/ifDirective.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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}}} )] )})] )})] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/importJS.js b/ace-loader/test/lite/expected/importJS.js index 7e94e674c8badfb0f31614860b3223b066190b23..7ab95ca44a0cf6173cf96c3d6fb7d58f15a4b175 100644 --- a/ace-loader/test/lite/expected/importJS.js +++ b/ace-loader/test/lite/expected/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 128e8f01ece69dbdc7d322df7933db905ed38037..e3ce4a72e6fe023ced978fa3324175f264d66534 100644 --- a/ace-loader/test/lite/expected/inlineStyle.js +++ b/ace-loader/test/lite/expected/inlineStyle.js @@ -1 +1,16 @@ +/* + * Copyright (c) 2020 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)\"}, } )] ) }"} \ No newline at end of file diff --git a/ace-loader/test/lite/expected/music.js b/ace-loader/test/lite/expected/music.js index d938d28b5a0b35d01f10642149274a12cdeeb910..be3253cdca9cf874da2dffc659031a29c91fc567 100644 --- a/ace-loader/test/lite/expected/music.js +++ b/ace-loader/test/lite/expected/music.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 b83101112f00b681b3b38b91cb27d2ea36693a62..f7c7d18fa53b176e2121d7a62d9f1c0f8978a8c8 100644 --- a/ace-loader/test/lite/expected/sick.js +++ b/ace-loader/test/lite/expected/sick.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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/testcase/app.js b/ace-loader/test/lite/testcase/app.js index bb1f75249d30a6ad0bbf9ff28e64d4ebfef362df..d05541851ce24e120b20385717f3efd331f1a8f2 100644 --- a/ace-loader/test/lite/testcase/app.js +++ b/ace-loader/test/lite/testcase/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 7aae1624ee5ffbeeef7aec1f0c936edb78733cd9..19789b1e291231bc267e8e69c27caf678a641930 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) 2020 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 41778f4505fb21bb5173b63924cafff0824deff9..8ca422ea3ec0c6051dbf3bdbbc5ca1992a0937df 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) 2020 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 b8366edc81ae3e3c8776b492f1ea259c89936b14..c1d7dbb767df6eb8310856c3e2e36593e2641987 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) 2020 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 98a4c0dc04745133299d315e26693c6ad18b55bb..c027ecb037c1f458d6eddbad3605da68e973847c 100644 --- a/ace-loader/test/rich/expected/class.js +++ b/ace-loader/test/rich/expected/class.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 9a59e78646dc7922ffe62cef9eb874e2a082c226..0120c1ae1aa153655288f59cf7773cf1161df777 100644 --- a/ace-loader/test/rich/expected/commonAttr.js +++ b/ace-loader/test/rich/expected/commonAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 a3c8317f4ebbaa5be6e29c6740b1fc8dfa691e88..d5efa8fe54522f72c6f2026f644fbbefd587fe13 100644 --- a/ace-loader/test/rich/expected/event.js +++ b/ace-loader/test/rich/expected/event.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 5c6f7464f8caccf66d7d4a0393e1a4ea4d7fd1a3..347f1f07f016d469179633ac1441be50bf13ad8c 100644 --- a/ace-loader/test/rich/expected/expression.js +++ b/ace-loader/test/rich/expected/expression.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 3c085d5f6625239e894be8247c6a5c03371c1c00..a284e8a52c9e87b677f959cf78807cb2318b9fa3 100644 --- a/ace-loader/test/rich/expected/exteriorStyle.js +++ b/ace-loader/test/rich/expected/exteriorStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 6ad1461850bbb13948e6f7c0d82fbed0bcbc2e38..c7cd3cb756788ba85ae840120130bb3069d4ce6b 100644 --- a/ace-loader/test/rich/expected/forDirective.js +++ b/ace-loader/test/rich/expected/forDirective.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 7938f03bd917e627b4afa3a8b132aa31f93e3bc2..13fa126bb67f18534949cf7c571bee457cf8b29c 100644 --- a/ace-loader/test/rich/expected/ifDirective.js +++ b/ace-loader/test/rich/expected/ifDirective.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 1af384c7377199fcb35bfc3c43928e839976d7e0..6cf66f71c534692fcfb27e6a5a681f8a43b05230 100644 --- a/ace-loader/test/rich/expected/importCSS.js +++ b/ace-loader/test/rich/expected/importCSS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 0a916f781b4b2a65e0d8389fab731f49c4a9e7ca..a81a7165821911c8c51b144d7ce5f9fc2fa60b63 100644 --- a/ace-loader/test/rich/expected/importJS.js +++ b/ace-loader/test/rich/expected/importJS.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 16bd91a21cdad7dacf8f5c3b26aa2f9798e25dd1..c30c27b84a82f27bdad86f6d87ef284b0b254194 100644 --- a/ace-loader/test/rich/expected/inlineStyle.js +++ b/ace-loader/test/rich/expected/inlineStyle.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 c026b3abb4871f5026784f7ed2e88ab049dd3a0e..69c08283e97f8e7da5837c064c059ca1d0ade148 100644 --- a/ace-loader/test/rich/expected/mediaQuery.js +++ b/ace-loader/test/rich/expected/mediaQuery.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 e4232587902ae9bae97b7e9fe98d686b05542d36..36283531a9055df58dd9c6b99d9c3d93cf9e7e55 100644 --- a/ace-loader/test/rich/expected/privateAttr.js +++ b/ace-loader/test/rich/expected/privateAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 a2201f2ea9c6a13f72ae028e77311908cf52c21c..f42cd056559a136d7c3d7d951c72d34db86809fd 100644 --- a/ace-loader/test/rich/expected/uncommonAttr.js +++ b/ace-loader/test/rich/expected/uncommonAttr.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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/testcase/app.js b/ace-loader/test/rich/testcase/app.js index bb1f75249d30a6ad0bbf9ff28e64d4ebfef362df..d05541851ce24e120b20385717f3efd331f1a8f2 100644 --- a/ace-loader/test/rich/testcase/app.js +++ b/ace-loader/test/rich/testcase/app.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..06a7a5d4d24326c22218fae497425b90d84aed4b 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 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) 2020 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 8397662555fc4a58e4fd0efeeb0b1bee26ff4961..1be68ee4cc500cb4e9a36471903f14f6f16d20e2 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) 2020 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.js b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 100644 --- a/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.js +++ b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 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/mediaQuery/mediaQuery.js b/ace-loader/test/rich/testcase/pages/mediaQuery/mediaQuery.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 100644 --- a/ace-loader/test/rich/testcase/pages/mediaQuery/mediaQuery.js +++ b/ace-loader/test/rich/testcase/pages/mediaQuery/mediaQuery.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 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/privateAttr/privateAttr.js b/ace-loader/test/rich/testcase/pages/privateAttr/privateAttr.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 100644 --- a/ace-loader/test/rich/testcase/pages/privateAttr/privateAttr.js +++ b/ace-loader/test/rich/testcase/pages/privateAttr/privateAttr.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 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/uncommonAttr/uncommonAttr.js b/ace-loader/test/rich/testcase/pages/uncommonAttr/uncommonAttr.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..75dc730987cc3ba86b4ee86c3cf0173d9813d0b8 100644 --- a/ace-loader/test/rich/testcase/pages/uncommonAttr/uncommonAttr.js +++ b/ace-loader/test/rich/testcase/pages/uncommonAttr/uncommonAttr.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 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/webpack.lite.config.js b/ace-loader/webpack.lite.config.js index f296976d399090149f2de582294c9a0679a51418..b43c6aec4e1d19614d35435a50a647c12ffdd8e9 100644 --- a/ace-loader/webpack.lite.config.js +++ b/ace-loader/webpack.lite.config.js @@ -136,7 +136,8 @@ module.exports = (env) => { setConfigs(env) deleteFolderRecursive(process.env.buildPath); webpackConfig.cache.cacheDirectory = path.resolve(process.env.cachePath, '.lite_cache'); - webpackConfig.entry = loadEntryObj(process.env.projectPath, process.env.DEVICE_LEVEL, process.env.abilityType, process.env.aceManifestPath) + webpackConfig.entry = loadEntryObj(process.env.projectPath, process.env.DEVICE_LEVEL, + process.env.abilityType, process.env.aceManifestPath) webpackConfig.output.path = path.resolve(__dirname, process.env.buildPath) webpackConfig.plugins = [ new ResourcePlugin(process.env.projectPath, process.env.buildPath, process.env.aceManifestPath), diff --git a/ace-loader/webpack.rich.config.js b/ace-loader/webpack.rich.config.js index b7d47e30082d1b1d4d99a1429ec0442e0015d809..3790aafa8ba93d2a26f7444df8d4dd3c34227b6c 100644 --- a/ace-loader/webpack.rich.config.js +++ b/ace-loader/webpack.rich.config.js @@ -158,7 +158,8 @@ function setConfigs(env) { process.env.logLevel = env.logLevel || '1' process.env.isPreview = env.isPreview || false process.env.projectPath = env.aceModuleRoot || process.env.aceModuleRoot || process.cwd(); - process.env.buildPath = env.aceModuleBuild || process.env.aceModuleBuild || path.resolve(process.env.projectPath, 'build'); + process.env.buildPath = env.aceModuleBuild || process.env.aceModuleBuild || + path.resolve(process.env.projectPath, 'build'); process.env.cachePath = env.cachePath || process.env.cachePath || path.resolve(__dirname, 'node_modules/.cache'); process.env.aceManifestPath = process.env.aceManifestPath || path.resolve(process.env.projectPath, 'manifest.json'); process.env.abilityType = process.env.abilityType || 'page' @@ -189,7 +190,8 @@ module.exports = (env) => { loader: path.resolve(__dirname, './index.js') }] }) - config.entry = loadEntryObj(process.env.projectPath, process.env.DEVICE_LEVEL, process.env.abilityType, process.env.aceManifestPath) + config.entry = loadEntryObj(process.env.projectPath, process.env.DEVICE_LEVEL, + process.env.abilityType, process.env.aceManifestPath) config.output.path = path.resolve(__dirname, process.env.buildPath) config.plugins = [ new ResourcePlugin(process.env.projectPath, process.env.buildPath, process.env.aceManifestPath), @@ -223,7 +225,8 @@ module.exports = (env) => { if (env.isPreview !== "true") { config.plugins.push(new ModuleCollectionPlugin()) if (env.compilerType && env.compilerType === 'ark') { - config.plugins.push(new GenAbcPlugin(process.env.buildPath, path.join(__dirname, 'bin'), env.buildMode === 'debug')) + config.plugins.push(new GenAbcPlugin(process.env.buildPath, path.join(__dirname, 'bin'), + env.buildMode === 'debug')) } else { if (env.deviceType) { let deviceArr = env.deviceType.split(/,/) @@ -244,7 +247,7 @@ module.exports = (env) => { minimizer: [ new TerserPlugin({ terserOptions: { - keep_fnames: true + keepFnames: true }, minify: (file, sourceMap) => { const uglifyEsOptions = {