@tarojs/plugin-platform-jd 3.3.14 → 3.5.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,6 +6,30 @@ var service = require('@tarojs/service');
6
6
  var template = require('@tarojs/shared/dist/template');
7
7
  var shared = require('@tarojs/shared');
8
8
 
9
+ /*! *****************************************************************************
10
+ Copyright (c) Microsoft Corporation. All rights reserved.
11
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12
+ this file except in compliance with the License. You may obtain a copy of the
13
+ License at http://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18
+ MERCHANTABLITY OR NON-INFRINGEMENT.
19
+
20
+ See the Apache Version 2.0 License for specific language governing permissions
21
+ and limitations under the License.
22
+ ***************************************************************************** */
23
+
24
+ function __awaiter(thisArg, _arguments, P, generator) {
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ }
32
+
9
33
  class Template extends template.UnRecursiveTemplate {
10
34
  constructor() {
11
35
  super(...arguments);
@@ -87,13 +111,15 @@ var index = (ctx) => {
87
111
  ctx.registerPlatform({
88
112
  name: 'jd',
89
113
  useConfigName: 'mini',
90
- async fn({ config }) {
91
- const program = new JD(ctx, config);
92
- await program.start();
114
+ fn({ config }) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ const program = new JD(ctx, config);
117
+ yield program.start();
118
+ });
93
119
  }
94
120
  });
95
121
  };
96
122
 
97
123
  exports.JD = JD;
98
- exports.default = index;
124
+ exports['default'] = index;
99
125
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/template.ts","../src/components.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["import { UnRecursiveTemplate } from '@tarojs/shared/dist/template'\n\nexport class Template extends UnRecursiveTemplate {\n supportXS = false\n Adapter = {\n if: 'jd:if',\n else: 'jd:else',\n elseif: 'jd:elif',\n for: 'jd:for',\n forItem: 'jd:for-item',\n forIndex: 'jd:for-index',\n key: 'jd:key',\n type: 'jd'\n }\n\n replacePropName (name, value, componentName) {\n if (value === 'eh') {\n const nameLowerCase = name.toLowerCase()\n if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress'\n return nameLowerCase\n }\n return name\n }\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { TaroPlatformBase } from '@tarojs/service'\nimport { Template } from './template'\nimport { components } from './components'\n\nconst PACKAGE_NAME = '@tarojs/plugin-platform-jd'\n\nexport default class JD extends TaroPlatformBase {\n platform = 'jd'\n globalObject = 'jd'\n projectConfigJson = 'project.jd.json'\n runtimePath = `${PACKAGE_NAME}/dist/runtime`\n fileType = {\n templ: '.jxml',\n style: '.jxss',\n config: '.json',\n script: '.js'\n }\n\n template = new Template()\n\n /**\n * 1. setupTransaction - init\n * 2. setup\n * 3. setupTransaction - close\n * 4. buildTransaction - init\n * 5. build\n * 6. buildTransaction - close\n */\n constructor (ctx, config) {\n super(ctx, config)\n\n this.setupTransaction.addWrapper({\n close: this.modifyTemplate\n })\n }\n\n /**\n * 增加组件或修改组件属性\n */\n modifyTemplate () {\n this.template.mergeComponents(this.ctx, components)\n }\n}\n","import JD from './program'\nimport type { IPluginContext } from '@tarojs/service'\n\n// 让其它平台插件可以继承此平台\nexport { JD }\n\nexport default (ctx: IPluginContext) => {\n ctx.registerPlatform({\n name: 'jd',\n useConfigName: 'mini',\n async fn ({ config }) {\n const program = new JD(ctx, config)\n await program.start()\n }\n })\n}\n"],"names":["UnRecursiveTemplate","singleQuote","TaroPlatformBase"],"mappings":";;;;;;;;MAEa,QAAS,SAAQA,4BAAmB;IAAjD;;QACE,cAAS,GAAG,KAAK,CAAA;QACjB,YAAO,GAAG;YACR,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,GAAG,EAAE,QAAQ;YACb,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,cAAc;YACxB,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,IAAI;SACX,CAAA;KAUF;IARC,eAAe,CAAE,IAAI,EAAE,KAAK,EAAE,aAAa;QACzC,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YACxC,IAAI,aAAa,KAAK,aAAa,IAAI,aAAa,KAAK,QAAQ;gBAAE,OAAO,eAAe,CAAA;YACzF,OAAO,aAAa,CAAA;SACrB;QACD,OAAO,IAAI,CAAA;KACZ;;;ACpBI,MAAM,UAAU,GAAG;;IAExB,MAAM,EAAE;QACN,iBAAiB,EAAEC,kBAAW,CAAC,SAAS,CAAC;KAC1C;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,kBAAkB,EAAE,EAAE;KACvB;IACD,GAAG,EAAE;QACH,gBAAgB,EAAE,EAAE;KACrB;CACF,CAAA;;ACZD,MAAM,YAAY,GAAG,4BAA4B,CAAA;AAEjD,MAAqB,EAAG,SAAQC,wBAAgB;;;;;;;;;IAsB9C,YAAa,GAAG,EAAE,MAAM;QACtB,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QAtBpB,aAAQ,GAAG,IAAI,CAAA;QACf,iBAAY,GAAG,IAAI,CAAA;QACnB,sBAAiB,GAAG,iBAAiB,CAAA;QACrC,gBAAW,GAAG,GAAG,YAAY,eAAe,CAAA;QAC5C,aAAQ,GAAG;YACT,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,KAAK;SACd,CAAA;QAED,aAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;QAavB,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC;YAC/B,KAAK,EAAE,IAAI,CAAC,cAAc;SAC3B,CAAC,CAAA;KACH;;;;IAKD,cAAc;QACZ,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;KACpD;CACF;;ACpCD,YAAe,CAAC,GAAmB;IACjC,GAAG,CAAC,gBAAgB,CAAC;QACnB,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,MAAM;QACrB,MAAM,EAAE,CAAE,EAAE,MAAM,EAAE;YAClB,MAAM,OAAO,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YACnC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;SACtB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/template.ts","../src/components.ts","../src/program.ts","../src/index.ts"],"sourcesContent":["import { UnRecursiveTemplate } from '@tarojs/shared/dist/template'\n\nexport class Template extends UnRecursiveTemplate {\n supportXS = false\n Adapter = {\n if: 'jd:if',\n else: 'jd:else',\n elseif: 'jd:elif',\n for: 'jd:for',\n forItem: 'jd:for-item',\n forIndex: 'jd:for-index',\n key: 'jd:key',\n type: 'jd'\n }\n\n replacePropName (name, value, componentName) {\n if (value === 'eh') {\n const nameLowerCase = name.toLowerCase()\n if (nameLowerCase === 'bindlongtap' && componentName !== 'canvas') return 'bindlongpress'\n return nameLowerCase\n }\n return name\n }\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { TaroPlatformBase } from '@tarojs/service'\nimport { Template } from './template'\nimport { components } from './components'\n\nconst PACKAGE_NAME = '@tarojs/plugin-platform-jd'\n\nexport default class JD extends TaroPlatformBase {\n platform = 'jd'\n globalObject = 'jd'\n projectConfigJson = 'project.jd.json'\n runtimePath = `${PACKAGE_NAME}/dist/runtime`\n fileType = {\n templ: '.jxml',\n style: '.jxss',\n config: '.json',\n script: '.js'\n }\n\n template = new Template()\n\n /**\n * 1. setupTransaction - init\n * 2. setup\n * 3. setupTransaction - close\n * 4. buildTransaction - init\n * 5. build\n * 6. buildTransaction - close\n */\n constructor (ctx, config) {\n super(ctx, config)\n\n this.setupTransaction.addWrapper({\n close: this.modifyTemplate\n })\n }\n\n /**\n * 增加组件或修改组件属性\n */\n modifyTemplate () {\n this.template.mergeComponents(this.ctx, components)\n }\n}\n","import JD from './program'\nimport type { IPluginContext } from '@tarojs/service'\n\n// 让其它平台插件可以继承此平台\nexport { JD }\n\nexport default (ctx: IPluginContext) => {\n ctx.registerPlatform({\n name: 'jd',\n useConfigName: 'mini',\n async fn ({ config }) {\n const program = new JD(ctx, config)\n await program.start()\n }\n })\n}\n"],"names":["UnRecursiveTemplate","singleQuote","TaroPlatformBase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEa,QAAS,SAAQA,4BAAmB;IAAjD;;QACE,cAAS,GAAG,KAAK,CAAA;QACjB,YAAO,GAAG;YACR,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,SAAS;YACf,MAAM,EAA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AAA;KACH;;;;IAKD,cAAc;QACZ,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;KACpD;;;ACnCH,YAAe,CAAC,GAAmB;IACjC,GAAG,CAAC,gBAAgB,CAAC;QACnB,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,MAAM;QACf,EAAE,CAAE,EAAE,MAAM,EAAE;;gBAClB,MAAM,OAAO,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;gBACnC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;aACtB;SAAA;KACF,CAAC,CAAA;AACJ,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-utils.js","sources":["../src/apis.ts","../src/components.ts","../src/runtime-utils.ts"],"sourcesContent":["import { processApis } from '@tarojs/shared'\n\ndeclare const jd: any\n\nexport function initNativeApi (taro) {\n processApis(taro, jd)\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { initNativeApi } from './apis'\n\nexport { initNativeApi }\nexport * from './components'\nexport const hostConfig = {\n initNativeApi\n}\n"],"names":[],"mappings":";;SAIgB,aAAa,CAAE,IAAI;IACjC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACvB;;MCJa,UAAU,GAAG;;IAExB,MAAM,EAAE;QACN,iBAAiB,EAAE,WAAW,CAAC,SAAS,CAAC;KAC1C;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,kBAAkB,EAAE,EAAE;KACvB;IACD,GAAG,EAAE;QACH,gBAAgB,EAAE,EAAE;KACrB;CACF;;MCZY,UAAU,GAAG;IACxB,aAAa;CACd;;;;"}
1
+ {"version":3,"file":"runtime-utils.js","sources":["../src/apis.ts","../src/components.ts","../src/runtime-utils.ts"],"sourcesContent":["import { processApis } from '@tarojs/shared'\n\ndeclare const jd: any\n\nexport function initNativeApi (taro) {\n processApis(taro, jd)\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { initNativeApi } from './apis'\n\nexport { initNativeApi }\nexport * from './components'\nexport const hostConfig = {\n initNativeApi\n}\n"],"names":[],"mappings":";;SAIgB,aAAa,CAAE,IAAI;IACjC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACvB;;MCJa,UAAU,GAAG;;IAExB,MAAM,EAAE;QACN,iBAAiB,EAAE,WAAW,CAAC,SAAS,CAAC;KAC1C;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,kBAAkB,EAAE,EAAE;KACvB;IACD,GAAG,EAAE;QACH,gBAAgB,EAAE,EAAE;KACrB;;;MCXU,UAAU,GAAG;IACxB,aAAa;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sources":["../src/apis.ts","../src/components.ts","../src/runtime-utils.ts","../src/runtime.ts"],"sourcesContent":["import { processApis } from '@tarojs/shared'\n\ndeclare const jd: any\n\nexport function initNativeApi (taro) {\n processApis(taro, jd)\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { initNativeApi } from './apis'\n\nexport { initNativeApi }\nexport * from './components'\nexport const hostConfig = {\n initNativeApi\n}\n","import { mergeReconciler, mergeInternalComponents } from '@tarojs/shared'\nimport { hostConfig, components } from './runtime-utils'\n\nmergeReconciler(hostConfig)\nmergeInternalComponents(components)\n"],"names":[],"mappings":";;SAIgB,aAAa,CAAE,IAAI;IACjC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACvB;;ACJO,MAAM,UAAU,GAAG;;IAExB,MAAM,EAAE;QACN,iBAAiB,EAAE,WAAW,CAAC,SAAS,CAAC;KAC1C;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,kBAAkB,EAAE,EAAE;KACvB;IACD,GAAG,EAAE;QACH,gBAAgB,EAAE,EAAE;KACrB;CACF,CAAA;;ACZM,MAAM,UAAU,GAAG;IACxB,aAAa;CACd,CAAA;;ACHD,eAAe,CAAC,UAAU,CAAC,CAAA;AAC3B,uBAAuB,CAAC,UAAU,CAAC,CAAA"}
1
+ {"version":3,"file":"runtime.js","sources":["../src/apis.ts","../src/components.ts","../src/runtime-utils.ts","../src/runtime.ts"],"sourcesContent":["import { processApis } from '@tarojs/shared'\n\ndeclare const jd: any\n\nexport function initNativeApi (taro) {\n processApis(taro, jd)\n}\n","import { singleQuote } from '@tarojs/shared'\n\nexport const components = {\n // ======== 调整属性 ========\n Swiper: {\n 'easing-function': singleQuote('default')\n },\n Canvas: {\n type: ''\n },\n Button: {\n bindGetPhoneNumber: ''\n },\n Map: {\n bindRegionChange: ''\n }\n}\n","import { initNativeApi } from './apis'\n\nexport { initNativeApi }\nexport * from './components'\nexport const hostConfig = {\n initNativeApi\n}\n","import { mergeReconciler, mergeInternalComponents } from '@tarojs/shared'\nimport { hostConfig, components } from './runtime-utils'\n\nmergeReconciler(hostConfig)\nmergeInternalComponents(components)\n"],"names":[],"mappings":";;SAIgB,aAAa,CAAE,IAAI;IACjC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACvB;;ACJO,MAAM,UAAU,GAAG;;IAExB,MAAM,EAAE;QACN,iBAAiB,EAAE,WAAW,CAAC,SAAS,CAAC;KAC1C;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACN,kBAAkB,EAAE,EAAE;KACvB;IACD,GAAG,EAAE;QACH,gBAAgB,EAAE,EAAE;KACrB;CACF;;ACZM,MAAM,UAAU,GAAG;IACxB,aAAa;CACd;;ACHD,eAAe,CAAC,UAAU,CAAC,CAAA;AAC3B,uBAAuB,CAAC,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-jd",
3
- "version": "3.3.14",
3
+ "version": "3.5.0-canary.0",
4
4
  "description": "京东小程序平台插件",
5
5
  "author": "Chen-jj",
6
6
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-jd#readme",
@@ -27,8 +27,8 @@
27
27
  "url": "https://github.com/NervJS/taro/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@tarojs/service": "3.3.14",
31
- "@tarojs/shared": "3.3.14"
30
+ "@tarojs/service": "3.5.0-canary.0",
31
+ "@tarojs/shared": "3.5.0-canary.0"
32
32
  },
33
- "gitHead": "ffd2b33c2a760094372a9ec69735ab9c4d1877e5"
33
+ "gitHead": "a0222bc41bc05b0e34413d6db3de963d777a5015"
34
34
  }