@tarojs/taro-h5 4.0.9 → 4.0.10-alpha.1
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.
|
@@ -16,7 +16,7 @@ const unhandledRejectionListener = (res) => {
|
|
|
16
16
|
let themeMatchMedia = null;
|
|
17
17
|
const themeChangeListener = (res) => {
|
|
18
18
|
themeChangeCallbackManager.trigger({
|
|
19
|
-
theme: res.matches ? '
|
|
19
|
+
theme: res.matches ? 'light' : 'dark'
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
const pageNotFoundListener = (res) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-event.js","sources":["../../../../src/api/base/weapp/app-event.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport isNil from 'lodash-es/isNil'\nimport queryString from 'query-string'\n\nimport { temporarilyNotSupport } from '../../../utils'\nimport { CallbackManager } from '../../../utils/handler'\n\nconst unhandledRejectionCallbackManager = new CallbackManager<[Taro.onUnhandledRejection.Result]>()\nconst themeChangeCallbackManager = new CallbackManager<[Taro.onThemeChange.Result]>()\nconst pageNotFoundCallbackManager = new CallbackManager<[Taro.onPageNotFound.Result]>()\nconst errorCallbackManager = new CallbackManager<Parameters<Taro.onError.Callback>>()\nconst appShowCallbackManager = new CallbackManager<[Taro.onAppShow.CallbackResult]>()\nconst appHideCallbackManager = new CallbackManager<[Taro.onAppShow.CallbackResult]>()\n\nconst unhandledRejectionListener = (res: PromiseRejectionEvent) => {\n unhandledRejectionCallbackManager.trigger(res)\n}\n\nlet themeMatchMedia: MediaQueryList | null = null\nconst themeChangeListener = (res: MediaQueryListEvent) => {\n themeChangeCallbackManager.trigger({\n theme: res.matches ? 'dark' : 'light'\n })\n}\n\nconst pageNotFoundListener = (res: Taro.onPageNotFound.Result) => {\n pageNotFoundCallbackManager.trigger(res)\n}\n\nconst errorListener = (res: ErrorEvent) => {\n // @ts-ignore\n errorCallbackManager.trigger(res.stack || res.message || res)\n}\n\nconst getApp = () => {\n const path = Taro.Current.page?.path\n return {\n /** 小程序切前台的路径 */\n path: path?.substring(0, path.indexOf('?')) || '',\n /** 小程序切前台的 query 参数 */\n query: queryString.parse(location.search),\n /** 来源信息。 */\n referrerInfo: {},\n /** 小程序切前台的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */\n scene: 0,\n /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */\n shareTicket: ''\n }\n}\n\nconst appShowListener = () => {\n if (document.visibilityState !== 'hidden') {\n appShowCallbackManager.trigger(getApp())\n }\n}\n\nconst appHideListener = () => {\n if (document.visibilityState === 'hidden') {\n appHideCallbackManager.trigger(getApp())\n }\n}\n\n// 应用级事件\nexport const onUnhandledRejection: typeof Taro.onUnhandledRejection = callback => {\n unhandledRejectionCallbackManager.add(callback)\n if (unhandledRejectionCallbackManager.count() === 1) {\n window.addEventListener('unhandledrejection', unhandledRejectionListener)\n }\n}\n\nexport const onThemeChange: typeof Taro.onThemeChange = callback => {\n themeChangeCallbackManager.add(callback)\n if (themeChangeCallbackManager.count() === 1) {\n if (isNil(themeMatchMedia)) {\n themeMatchMedia = window.matchMedia('(prefers-color-scheme: light)')\n }\n themeMatchMedia!.addEventListener('change', themeChangeListener)\n }\n}\n\nexport const onPageNotFound: typeof Taro.onPageNotFound = callback => {\n pageNotFoundCallbackManager.add(callback)\n if (pageNotFoundCallbackManager.count() === 1) {\n Taro.eventCenter.on('__taroRouterNotFound', pageNotFoundListener)\n }\n}\n\nexport const onLazyLoadError = /* @__PURE__ */ temporarilyNotSupport('onLazyLoadError')\n\nexport const onError: typeof Taro.onError = callback => {\n errorCallbackManager.add(callback)\n if (errorCallbackManager.count() === 1) {\n window.addEventListener('error', errorListener)\n }\n}\n\nexport const onAudioInterruptionEnd = /* @__PURE__ */ temporarilyNotSupport('onAudioInterruptionEnd')\nexport const onAudioInterruptionBegin = /* @__PURE__ */ temporarilyNotSupport('onAudioInterruptionBegin')\n\nexport const onAppShow: typeof Taro.onAppShow = callback => {\n appShowCallbackManager.add(callback)\n if (appShowCallbackManager.count() === 1) {\n window.addEventListener('visibilitychange', appShowListener)\n }\n}\n\nexport const onAppHide: typeof Taro.onAppHide = callback => {\n appHideCallbackManager.add(callback)\n if (appHideCallbackManager.count() === 1) {\n window.addEventListener('visibilitychange', appHideListener)\n }\n}\n\nexport const offUnhandledRejection: typeof Taro.offUnhandledRejection = callback => {\n unhandledRejectionCallbackManager.remove(callback)\n if (unhandledRejectionCallbackManager.count() === 0) {\n window.removeEventListener('unhandledrejection', unhandledRejectionListener)\n }\n}\n\nexport const offThemeChange: typeof Taro.offThemeChange = callback => {\n themeChangeCallbackManager.remove(callback)\n if (themeChangeCallbackManager.count() === 0) {\n if (isNil(themeMatchMedia)) {\n themeMatchMedia = window.matchMedia('(prefers-color-scheme: light)')\n }\n themeMatchMedia!.removeEventListener('change', themeChangeListener)\n themeMatchMedia = null\n }\n}\n\nexport const offPageNotFound: typeof Taro.offPageNotFound = callback => {\n pageNotFoundCallbackManager.remove(callback)\n if (pageNotFoundCallbackManager.count() === 0) {\n Taro.eventCenter.off('__taroRouterNotFound', pageNotFoundListener)\n }\n}\n\nexport const offLazyLoadError = /* @__PURE__ */ temporarilyNotSupport('offLazyLoadError')\n\nexport const offError: typeof Taro.offError = callback => {\n errorCallbackManager.remove(callback)\n if (errorCallbackManager.count() === 0) {\n window.removeEventListener('error', errorListener)\n }\n}\n\nexport const offAudioInterruptionEnd = /* @__PURE__ */ temporarilyNotSupport('offAudioInterruptionEnd')\nexport const offAudioInterruptionBegin = /* @__PURE__ */ temporarilyNotSupport('offAudioInterruptionBegin')\n\nexport const offAppShow: typeof Taro.offAppShow = callback => {\n appShowCallbackManager.remove(callback)\n if (appShowCallbackManager.count() === 0) {\n window.removeEventListener('visibilitychange', appShowListener)\n }\n}\n\nexport const offAppHide: typeof Taro.offAppHide = callback => {\n appHideCallbackManager.remove(callback)\n if (appHideCallbackManager.count() === 0) {\n window.removeEventListener('visibilitychange', appHideListener)\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,iCAAiC,GAAG,IAAI,eAAe,EAAsC,CAAA;AACnG,MAAM,0BAA0B,GAAG,IAAI,eAAe,EAA+B,CAAA;AACrF,MAAM,2BAA2B,GAAG,IAAI,eAAe,EAAgC,CAAA;AACvF,MAAM,oBAAoB,GAAG,IAAI,eAAe,EAAqC,CAAA;AACrF,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAmC,CAAA;AACrF,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAmC,CAAA;AAErF,MAAM,0BAA0B,GAAG,CAAC,GAA0B,KAAI;AAChE,IAAA,iCAAiC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAChD,CAAC,CAAA;AAED,IAAI,eAAe,GAA0B,IAAI,CAAA;AACjD,MAAM,mBAAmB,GAAG,CAAC,GAAwB,KAAI;IACvD,0BAA0B,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO;AACtC,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,GAA+B,KAAI;AAC/D,IAAA,2BAA2B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,GAAe,KAAI;;AAExC,IAAA,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAA;AAC/D,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,MAAK;;IAClB,MAAM,IAAI,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,CAAC,IAAI,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAI,CAAA;IACpC,OAAO;;QAE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,EAAE,aAAa,CAAC,CAAA;KACnD;AACH,EAAC;AAEY,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,yBAAyB,mBAAmB,qBAAqB,CAAC,2BAA2B,EAAC;AAE9F,MAAA,UAAU,GAA2B,QAAQ,IAAG;AAC3D,IAAA,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACvC,IAAA,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACxC,QAAA,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAA;KAChE;AACH,EAAC;AAEY,MAAA,UAAU,GAA2B,QAAQ,IAAG;AAC3D,IAAA,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACvC,IAAA,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACxC,QAAA,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAA;KAChE;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"app-event.js","sources":["../../../../src/api/base/weapp/app-event.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport isNil from 'lodash-es/isNil'\nimport queryString from 'query-string'\n\nimport { temporarilyNotSupport } from '../../../utils'\nimport { CallbackManager } from '../../../utils/handler'\n\nconst unhandledRejectionCallbackManager = new CallbackManager<[Taro.onUnhandledRejection.Result]>()\nconst themeChangeCallbackManager = new CallbackManager<[Taro.onThemeChange.Result]>()\nconst pageNotFoundCallbackManager = new CallbackManager<[Taro.onPageNotFound.Result]>()\nconst errorCallbackManager = new CallbackManager<Parameters<Taro.onError.Callback>>()\nconst appShowCallbackManager = new CallbackManager<[Taro.onAppShow.CallbackResult]>()\nconst appHideCallbackManager = new CallbackManager<[Taro.onAppShow.CallbackResult]>()\n\nconst unhandledRejectionListener = (res: PromiseRejectionEvent) => {\n unhandledRejectionCallbackManager.trigger(res)\n}\n\nlet themeMatchMedia: MediaQueryList | null = null\nconst themeChangeListener = (res: MediaQueryListEvent) => {\n themeChangeCallbackManager.trigger({\n theme: res.matches ? 'light' : 'dark'\n })\n}\n\nconst pageNotFoundListener = (res: Taro.onPageNotFound.Result) => {\n pageNotFoundCallbackManager.trigger(res)\n}\n\nconst errorListener = (res: ErrorEvent) => {\n // @ts-ignore\n errorCallbackManager.trigger(res.stack || res.message || res)\n}\n\nconst getApp = () => {\n const path = Taro.Current.page?.path\n return {\n /** 小程序切前台的路径 */\n path: path?.substring(0, path.indexOf('?')) || '',\n /** 小程序切前台的 query 参数 */\n query: queryString.parse(location.search),\n /** 来源信息。 */\n referrerInfo: {},\n /** 小程序切前台的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */\n scene: 0,\n /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */\n shareTicket: ''\n }\n}\n\nconst appShowListener = () => {\n if (document.visibilityState !== 'hidden') {\n appShowCallbackManager.trigger(getApp())\n }\n}\n\nconst appHideListener = () => {\n if (document.visibilityState === 'hidden') {\n appHideCallbackManager.trigger(getApp())\n }\n}\n\n// 应用级事件\nexport const onUnhandledRejection: typeof Taro.onUnhandledRejection = callback => {\n unhandledRejectionCallbackManager.add(callback)\n if (unhandledRejectionCallbackManager.count() === 1) {\n window.addEventListener('unhandledrejection', unhandledRejectionListener)\n }\n}\n\nexport const onThemeChange: typeof Taro.onThemeChange = callback => {\n themeChangeCallbackManager.add(callback)\n if (themeChangeCallbackManager.count() === 1) {\n if (isNil(themeMatchMedia)) {\n themeMatchMedia = window.matchMedia('(prefers-color-scheme: light)')\n }\n themeMatchMedia!.addEventListener('change', themeChangeListener)\n }\n}\n\nexport const onPageNotFound: typeof Taro.onPageNotFound = callback => {\n pageNotFoundCallbackManager.add(callback)\n if (pageNotFoundCallbackManager.count() === 1) {\n Taro.eventCenter.on('__taroRouterNotFound', pageNotFoundListener)\n }\n}\n\nexport const onLazyLoadError = /* @__PURE__ */ temporarilyNotSupport('onLazyLoadError')\n\nexport const onError: typeof Taro.onError = callback => {\n errorCallbackManager.add(callback)\n if (errorCallbackManager.count() === 1) {\n window.addEventListener('error', errorListener)\n }\n}\n\nexport const onAudioInterruptionEnd = /* @__PURE__ */ temporarilyNotSupport('onAudioInterruptionEnd')\nexport const onAudioInterruptionBegin = /* @__PURE__ */ temporarilyNotSupport('onAudioInterruptionBegin')\n\nexport const onAppShow: typeof Taro.onAppShow = callback => {\n appShowCallbackManager.add(callback)\n if (appShowCallbackManager.count() === 1) {\n window.addEventListener('visibilitychange', appShowListener)\n }\n}\n\nexport const onAppHide: typeof Taro.onAppHide = callback => {\n appHideCallbackManager.add(callback)\n if (appHideCallbackManager.count() === 1) {\n window.addEventListener('visibilitychange', appHideListener)\n }\n}\n\nexport const offUnhandledRejection: typeof Taro.offUnhandledRejection = callback => {\n unhandledRejectionCallbackManager.remove(callback)\n if (unhandledRejectionCallbackManager.count() === 0) {\n window.removeEventListener('unhandledrejection', unhandledRejectionListener)\n }\n}\n\nexport const offThemeChange: typeof Taro.offThemeChange = callback => {\n themeChangeCallbackManager.remove(callback)\n if (themeChangeCallbackManager.count() === 0) {\n if (isNil(themeMatchMedia)) {\n themeMatchMedia = window.matchMedia('(prefers-color-scheme: light)')\n }\n themeMatchMedia!.removeEventListener('change', themeChangeListener)\n themeMatchMedia = null\n }\n}\n\nexport const offPageNotFound: typeof Taro.offPageNotFound = callback => {\n pageNotFoundCallbackManager.remove(callback)\n if (pageNotFoundCallbackManager.count() === 0) {\n Taro.eventCenter.off('__taroRouterNotFound', pageNotFoundListener)\n }\n}\n\nexport const offLazyLoadError = /* @__PURE__ */ temporarilyNotSupport('offLazyLoadError')\n\nexport const offError: typeof Taro.offError = callback => {\n errorCallbackManager.remove(callback)\n if (errorCallbackManager.count() === 0) {\n window.removeEventListener('error', errorListener)\n }\n}\n\nexport const offAudioInterruptionEnd = /* @__PURE__ */ temporarilyNotSupport('offAudioInterruptionEnd')\nexport const offAudioInterruptionBegin = /* @__PURE__ */ temporarilyNotSupport('offAudioInterruptionBegin')\n\nexport const offAppShow: typeof Taro.offAppShow = callback => {\n appShowCallbackManager.remove(callback)\n if (appShowCallbackManager.count() === 0) {\n window.removeEventListener('visibilitychange', appShowListener)\n }\n}\n\nexport const offAppHide: typeof Taro.offAppHide = callback => {\n appHideCallbackManager.remove(callback)\n if (appHideCallbackManager.count() === 0) {\n window.removeEventListener('visibilitychange', appHideListener)\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,iCAAiC,GAAG,IAAI,eAAe,EAAsC,CAAA;AACnG,MAAM,0BAA0B,GAAG,IAAI,eAAe,EAA+B,CAAA;AACrF,MAAM,2BAA2B,GAAG,IAAI,eAAe,EAAgC,CAAA;AACvF,MAAM,oBAAoB,GAAG,IAAI,eAAe,EAAqC,CAAA;AACrF,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAmC,CAAA;AACrF,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAmC,CAAA;AAErF,MAAM,0BAA0B,GAAG,CAAC,GAA0B,KAAI;AAChE,IAAA,iCAAiC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAChD,CAAC,CAAA;AAED,IAAI,eAAe,GAA0B,IAAI,CAAA;AACjD,MAAM,mBAAmB,GAAG,CAAC,GAAwB,KAAI;IACvD,0BAA0B,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,GAAG,CAAC,OAAO,GAAG,OAAO,GAAG,MAAM;AACtC,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,GAA+B,KAAI;AAC/D,IAAA,2BAA2B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,GAAe,KAAI;;AAExC,IAAA,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAA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AAA,gBAAgB,mBAAmB,qBAAqB,CAAC,kBAAkB,EAAC;AAE5E,MAAA,QAAQ,GAAyB,QAAQ,IAAG;AACvD,IAAA,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACrC,IAAA,IAAI,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACtC,QAAA,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;KACnD;AACH,EAAC;AAEY,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,yBAAyB,mBAAmB,qBAAqB,CAAC,2BAA2B,EAAC;AAE9F,MAAA,UAAU,GAA2B,QAAQ,IAAG;AAC3D,IAAA,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACvC,IAAA,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACxC,QAAA,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAA;KAChE;AACH,EAAC;AAEY,MAAA,UAAU,GAA2B,QAAQ,IAAG;AAC3D,IAAA,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACvC,IAAA,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;AACxC,QAAA,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAA;KAChE;AACH;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -559,7 +559,7 @@ const unhandledRejectionListener = (res) => {
|
|
|
559
559
|
let themeMatchMedia = null;
|
|
560
560
|
const themeChangeListener = (res) => {
|
|
561
561
|
themeChangeCallbackManager.trigger({
|
|
562
|
-
theme: res.matches ? '
|
|
562
|
+
theme: res.matches ? 'light' : 'dark'
|
|
563
563
|
});
|
|
564
564
|
};
|
|
565
565
|
const pageNotFoundListener = (res) => {
|