diff --git a/packages/uni-components/build.json b/packages/uni-components/build.json deleted file mode 100644 index ee8b4f775674407fdaacb3c29a631c91b47f10f6..0000000000000000000000000000000000000000 --- a/packages/uni-components/build.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "input": { - "src/nvue/index.ts": ["dist/nvue.js"] - }, - "replacements": { - "__PLATFORM__": "'app'", - "__APP_VIEW__": "false", - "__VUE_OPTIONS_API__": "true", - "__VUE_PROD_DEVTOOLS__": "false", - "__UNI_FEATURE_WX__": "false", - "__UNI_FEATURE_PROMISE__": "false", - "__UNI_FEATURE_I18N_EN__": "true", - "__UNI_FEATURE_I18N_ES__": "true", - "__UNI_FEATURE_I18N_FR__": "true", - "__UNI_FEATURE_I18N_ZH_HANS__": "true", - "__UNI_FEATURE_I18N_ZH_HANT__": "true" - } - } -] diff --git a/packages/uni-components/dist/nvue.js b/packages/uni-components/dist/nvue.js deleted file mode 100644 index 5c3dbad49d30589eb5cc74bbe1eacb01a0d89475..0000000000000000000000000000000000000000 --- a/packages/uni-components/dist/nvue.js +++ /dev/null @@ -1,81 +0,0 @@ -const E = function () { - // Keep this empty so it's easier to inherit from - // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) -}; -E.prototype = { - on: function (name, callback, ctx) { - var e = this.e || (this.e = {}); - (e[name] || (e[name] = [])).push({ - fn: callback, - ctx: ctx, - }); - return this; - }, - once: function (name, callback, ctx) { - var self = this; - function listener() { - self.off(name, listener); - callback.apply(ctx, arguments); - } - listener._ = callback; - return this.on(name, listener, ctx); - }, - emit: function (name) { - var data = [].slice.call(arguments, 1); - var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); - var i = 0; - var len = evtArr.length; - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } - return this; - }, - off: function (name, callback) { - var e = this.e || (this.e = {}); - var evts = e[name]; - var liveEvents = []; - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if (evts[i].fn !== callback && evts[i].fn._ !== callback) - liveEvents.push(evts[i]); - } - } - // Remove event from queue to prevent memory leak - // Suggested by https://github.com/lazd - // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 - liveEvents.length ? (e[name] = liveEvents) : delete e[name]; - return this; - }, -}; -var E$1 = E; - -function initBridge(subscribeNamespace) { - const emitter = new E$1(); - return { - on(event, callback) { - return emitter.on(event, callback); - }, - once(event, callback) { - return emitter.once(event, callback); - }, - off(event, callback) { - return emitter.off(event, callback); - }, - emit(event, ...args) { - return emitter.emit(event, ...args); - }, - subscribe(event, callback, once = false) { - emitter[once ? 'once' : 'on'](`${subscribeNamespace}.${event}`, callback); - }, - unsubscribe(event, callback) { - emitter.off(`${subscribeNamespace}.${event}`, callback); - }, - subscribeHandler(event, args, pageId) { - emitter.emit(`${subscribeNamespace}.${event}`, args, pageId); - }, - }; -} - -const UniViewJSBridge = initBridge('nvue'); - -export { UniViewJSBridge }; diff --git a/packages/uni-components/src/nvue/index.ts b/packages/uni-components/src/nvue/index.ts deleted file mode 100644 index 96131b785b5135017c2ba251f7b9a4978e3be168..0000000000000000000000000000000000000000 --- a/packages/uni-components/src/nvue/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { initBridge } from '@dcloudio/uni-core' -export const UniViewJSBridge = initBridge('nvue')