@dolphinweex/weex-harmony-transform 0.1.8 → 0.1.10
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/package.json +1 -1
- package/src/adapter.ts +17 -1
- package/src/weexExtModules.js +2 -1
- package/weexTransform.js +2 -2
package/package.json
CHANGED
package/src/adapter.ts
CHANGED
|
@@ -564,6 +564,21 @@ let router = {
|
|
|
564
564
|
weexModule.callNative('router.deleteGlobalAppCache', { 'options': param }, callback, undefined, failCallback)
|
|
565
565
|
},
|
|
566
566
|
}
|
|
567
|
+
let modal = {
|
|
568
|
+
name: 'modal',
|
|
569
|
+
toast: function (param, callback, failCallback) {
|
|
570
|
+
weexModule.callNative('modal.toast', { 'options': param }, callback, undefined, failCallback)
|
|
571
|
+
},
|
|
572
|
+
alert: function (param, callback, failCallback) {
|
|
573
|
+
weexModule.callNative('modal.alert', { 'options': param }, callback, undefined, failCallback)
|
|
574
|
+
},
|
|
575
|
+
confirm: function (param, callback, failCallback) {
|
|
576
|
+
weexModule.callNative('modal.confirm', { 'options': param }, callback, undefined, failCallback)
|
|
577
|
+
},
|
|
578
|
+
prompt: function (param, callback, failCallback) {
|
|
579
|
+
weexModule.callNative('modal.prompt', { 'options': param }, callback, undefined, failCallback)
|
|
580
|
+
},
|
|
581
|
+
}
|
|
567
582
|
export {
|
|
568
583
|
clipboard,
|
|
569
584
|
weexModule,
|
|
@@ -581,5 +596,6 @@ export {
|
|
|
581
596
|
singleBlueToothModule,
|
|
582
597
|
routerModule,
|
|
583
598
|
nfcModule,
|
|
584
|
-
router
|
|
599
|
+
router,
|
|
600
|
+
modal
|
|
585
601
|
}
|
package/src/weexExtModules.js
CHANGED
package/weexTransform.js
CHANGED
|
@@ -79,9 +79,9 @@ module.exports = function ({ types: t }) {
|
|
|
79
79
|
const arguments = astPath.node.arguments
|
|
80
80
|
if (arguments && arguments.length > 0 && arguments[0].value) {
|
|
81
81
|
const oldPath = arguments[0].value;
|
|
82
|
-
if (oldPath
|
|
82
|
+
if (oldPath.includes('weex-bindingx')) {
|
|
83
83
|
// 构建新的路径节点
|
|
84
|
-
const newPathNode =
|
|
84
|
+
const newPathNode = oldPath.replace('weex-bindingx', '@dolphinweex/weex-bindingx')
|
|
85
85
|
// 替换原来的路径节点
|
|
86
86
|
astPath.node.arguments[0] = newPathNode;
|
|
87
87
|
}
|