wevu 6.19.0 → 6.19.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.
Files changed (86) hide show
  1. package/dist/dev/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/defineProperty.mjs +1 -1
  2. package/dist/dev/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/toPrimitive.mjs +1 -1
  3. package/dist/dev/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/toPropertyKey.mjs +1 -1
  4. package/dist/dev/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/typeof.mjs +1 -1
  5. package/dist/dev/index.mjs +0 -1
  6. package/dist/dev/package.mjs +1 -1
  7. package/dist/dev/reactivity/core.mjs +1 -1
  8. package/dist/dev/reactivity/reactive/patch.mjs +2 -1
  9. package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
  10. package/dist/dev/reactivity/reactive.mjs +2 -1
  11. package/dist/dev/reactivity/reactive.mjs.map +1 -1
  12. package/dist/dev/reactivity/ref.mjs +1 -1
  13. package/dist/dev/router/createRouter.mjs +6 -3
  14. package/dist/dev/router/createRouter.mjs.map +1 -1
  15. package/dist/dev/router/navigationTarget.mjs +2 -1
  16. package/dist/dev/router/navigationTarget.mjs.map +1 -1
  17. package/dist/dev/router/resolve.mjs +9 -2
  18. package/dist/dev/router/resolve.mjs.map +1 -1
  19. package/dist/dev/routerInternal/location.mjs +3 -1
  20. package/dist/dev/routerInternal/location.mjs.map +1 -1
  21. package/dist/dev/routerInternal/records.mjs +2 -1
  22. package/dist/dev/routerInternal/records.mjs.map +1 -1
  23. package/dist/dev/runtime/app/mount.mjs +2 -1
  24. package/dist/dev/runtime/app/mount.mjs.map +1 -1
  25. package/dist/dev/runtime/define/scopedSlotOptions.mjs +6 -3
  26. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  27. package/dist/dev/runtime/define.mjs +6 -4
  28. package/dist/dev/runtime/define.mjs.map +1 -1
  29. package/dist/dev/runtime/platform.mjs +4 -2
  30. package/dist/dev/runtime/platform.mjs.map +1 -1
  31. package/dist/dev/runtime/register/app.mjs +3 -1
  32. package/dist/dev/runtime/register/app.mjs.map +1 -1
  33. package/dist/dev/runtime/register/component/lifecycle/platform.mjs +2 -1
  34. package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
  35. package/dist/dev/runtime/register/component/methods.mjs +3 -1
  36. package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
  37. package/dist/dev/runtime/register/component.mjs +35 -34
  38. package/dist/dev/runtime/register/component.mjs.map +1 -1
  39. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +4 -2
  40. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
  41. package/dist/dev/runtime/register/runtimeInstance.mjs +6 -3
  42. package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
  43. package/dist/dev/runtime/register/snapshot.mjs +2 -1
  44. package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
  45. package/dist/dev/runtime/templateRefs/helpers.mjs +13 -8
  46. package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
  47. package/dist/dev/runtime/vueCompat/model.mjs +2 -1
  48. package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
  49. package/dist/dev/vue-demi.mjs +0 -158
  50. package/dist/dev/vue-demi.mjs.map +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/package.mjs +1 -1
  53. package/dist/reactivity/core.mjs +1 -1
  54. package/dist/reactivity/reactive/patch.mjs +1 -1
  55. package/dist/reactivity/reactive.mjs +1 -1
  56. package/dist/reactivity/ref.mjs +1 -1
  57. package/dist/reactivity/watch/helpers.mjs +1 -1
  58. package/dist/router/createRouter.mjs +1 -1
  59. package/dist/router/navigationTarget.mjs +1 -1
  60. package/dist/router/resolve.mjs +1 -1
  61. package/dist/routerInternal/location.mjs +1 -1
  62. package/dist/routerInternal/records.mjs +1 -1
  63. package/dist/runtime/app/mount.mjs +1 -1
  64. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  65. package/dist/runtime/define.mjs +1 -1
  66. package/dist/runtime/platform.mjs +1 -1
  67. package/dist/runtime/register/app.mjs +1 -1
  68. package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
  69. package/dist/runtime/register/component/methods.mjs +1 -1
  70. package/dist/runtime/register/component/props.mjs +1 -1
  71. package/dist/runtime/register/component.mjs +1 -1
  72. package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
  73. package/dist/runtime/register/runtimeInstance.mjs +1 -1
  74. package/dist/runtime/register/snapshot.mjs +1 -1
  75. package/dist/runtime/templateRefs/helpers.mjs +1 -1
  76. package/dist/runtime/vueCompat/model.mjs +1 -1
  77. package/dist/store/storeToRefs.mjs +1 -1
  78. package/dist/vue-demi.d.mts +1 -3
  79. package/dist/vue-demi.mjs +1 -1
  80. package/package.json +4 -4
  81. package/dist/_virtual/_rolldown/runtime.mjs +0 -1
  82. package/dist/dev/_virtual/_rolldown/runtime.mjs +0 -36
  83. /package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/defineProperty.mjs +0 -0
  84. /package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/toPrimitive.mjs +0 -0
  85. /package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/toPropertyKey.mjs +0 -0
  86. /package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.142.0}/helpers/esm/typeof.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"model.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/model.ts"],"sourcesContent":["import type { Ref } from '../../reactivity'\nimport type {\n ModelBinding,\n ModelBindingOptions,\n ModelBindingPayload,\n} from '../types'\nimport { customRef } from '../../reactivity/ref'\nimport { capitalize } from '../../utils'\nimport { getCurrentInstance, getCurrentSetupContext } from '../hooks'\n\nexport type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>\nexport type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>]\n\nexport interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {\n get?: (value: T, modifiers: ModelModifiers<M>) => G\n set?: (value: S, modifiers: ModelModifiers<M>) => T\n}\n\nconst EMPTY_MODEL_MODIFIERS = Object.freeze(Object.create(null)) as ModelModifiers<any>\n\nfunction resolveModelModifiers<M extends PropertyKey = string>(\n props: Record<string, any>,\n name: string,\n): ModelModifiers<M> {\n const key = name === 'modelValue' ? 'modelModifiers' : `${name}Modifiers`\n const modifiers = props?.[key]\n if (!modifiers || typeof modifiers !== 'object') {\n return EMPTY_MODEL_MODIFIERS as ModelModifiers<M>\n }\n return modifiers as ModelModifiers<M>\n}\n\nfunction attachModelTuple<T, M extends PropertyKey = string, G = T, S = T>(\n model: Ref<G, S>,\n getModifiers: () => ModelModifiers<M>,\n): ModelRef<T, M, G, S> {\n const tupleModel = model as ModelRef<T, M, G, S>\n try {\n Object.defineProperty(tupleModel, Symbol.iterator, {\n configurable: true,\n value: () => {\n let index = 0\n return {\n next: () => {\n if (index === 0) {\n index += 1\n return { value: tupleModel, done: false }\n }\n if (index === 1) {\n index += 1\n return { value: getModifiers(), done: false }\n }\n return { value: undefined, done: true }\n },\n }\n },\n })\n }\n catch {\n // 忽略 defineProperty 失败场景,降级为普通 Ref 返回\n }\n return tupleModel\n}\n\nexport function useModel<T = any, M extends PropertyKey = string>(\n props: Record<string, any>,\n name: string,\n): ModelRef<T, M, T, T>\nexport function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(\n props: Record<string, any>,\n name: string,\n options: UseModelOptions<T, M, G, S>,\n): ModelRef<T, M, G, S>\nexport function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(\n props: Record<string, any>,\n name: string,\n options: UseModelOptions<T, M, G, S> = {},\n): ModelRef<T, M, G, S> {\n const ctx = getCurrentSetupContext<any>()\n if (!ctx) {\n throw new Error('useModel() 必须在 setup() 的同步阶段调用')\n }\n\n const emit: ((event: string, ...args: any[]) => void) | undefined = ctx.emit\n const eventName = `update:${name}`\n const getModifiers = () => resolveModelModifiers<M>(props, name)\n const model = customRef<G>({\n get: () => {\n const rawValue = (props as any)?.[name] as T\n if (!options.get) {\n return rawValue as unknown as G\n }\n return options.get(rawValue, getModifiers())\n },\n set: (value: G) => {\n const nextValue = options.set\n ? options.set(value as unknown as S, getModifiers())\n : (value as unknown as T)\n emit?.(eventName, nextValue)\n },\n })\n return attachModelTuple<T, M, G, S>(model, getModifiers)\n}\n\n/**\n * useBindModel 返回绑定到当前运行时实例的 bindModel。\n * 该方法必须在 setup() 的同步阶段调用。\n */\ntype BindModelWithHelper<\n DefaultEvent extends string = 'input',\n DefaultValueProp extends string = 'value',\n> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {\n model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => ModelBindingPayload<T, Event, ValueProp, Formatted>\n value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => Formatted\n on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => (event: any) => void\n}\n\nexport function useBindModel<\n DefaultEvent extends string = 'input',\n DefaultValueProp extends string = 'value',\n>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>) {\n const instance = getCurrentInstance()\n if (!instance?.__wevu || typeof instance.__wevu.bindModel !== 'function') {\n throw new Error('useBindModel() 必须在 setup() 的同步阶段调用')\n }\n const rawBindModel = instance.__wevu.bindModel.bind(instance.__wevu) as <T = any>(\n path: string,\n options?: ModelBindingOptions<T>,\n ) => ModelBinding<T>\n const bindModel: BindModelWithHelper<DefaultEvent, DefaultValueProp> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => {\n if (!defaultOptions) {\n return rawBindModel(path, options)\n }\n const merged = {\n ...(defaultOptions as ModelBindingOptions<T, DefaultEvent, DefaultValueProp, any>),\n ...(options as ModelBindingOptions<T, DefaultEvent, DefaultValueProp, any>),\n } as ModelBindingOptions<T>\n return rawBindModel(path, merged)\n }) as BindModelWithHelper<DefaultEvent, DefaultValueProp>\n\n bindModel.model = (path, options) => bindModel(path).model(options)\n bindModel.value = (path, options) => {\n const merged = { ...defaultOptions, ...options } as ModelBindingOptions<any>\n const valueProp = merged?.valueProp ?? 'value'\n const payload = bindModel.model(path, options) as Record<string, any>\n return payload[valueProp]\n }\n bindModel.on = (path, options) => {\n const merged = { ...defaultOptions, ...options } as ModelBindingOptions<any>\n const eventName = merged?.event ?? 'input'\n const handlerKey = `on${capitalize(eventName)}`\n const payload = bindModel.model(path, options) as Record<string, any>\n return payload[handlerKey]\n }\n\n return bindModel\n}\n\n/**\n * useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。\n */\nexport function useChangeModel() {\n const bindModel = useBindModel({ event: 'change' })\n\n return function changeModel<T = any, ValueProp extends string = 'value', Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, 'change', ValueProp, Formatted>,\n ): ModelBindingPayload<T, 'change', ValueProp, Formatted> {\n return bindModel.model<T, 'change', ValueProp, Formatted>(path, options)\n }\n}\n\nexport function mergeModels<T>(a: T, b: T): T {\n if (a == null) {\n return b\n }\n if (b == null) {\n return a\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return [...new Set([...a, ...b])] as any\n }\n if (typeof a === 'object' && typeof b === 'object') {\n return { ...(a as any), ...(b as any) }\n }\n return b\n}\n"],"mappings":";;;;;AAkBA,MAAM,wBAAwB,OAAO,OAAO,OAAO,OAAO,IAAI,CAAC;AAE/D,SAAS,sBACP,OACA,MACmB;CACnB,MAAM,MAAM,SAAS,eAAe,mBAAmB,GAAG,KAAK;CAC/D,MAAM,0DAAY,MAAQ;CAC1B,IAAI,CAAC,aAAa,OAAO,cAAc,UACrC,OAAO;CAET,OAAO;AACT;AAEA,SAAS,iBACP,OACA,cACsB;CACtB,MAAM,aAAa;CACnB,IAAI;EACF,OAAO,eAAe,YAAY,OAAO,UAAU;GACjD,cAAc;GACd,aAAa;IACX,IAAI,QAAQ;IACZ,OAAO,EACL,YAAY;KACV,IAAI,UAAU,GAAG;MACf,SAAS;MACT,OAAO;OAAE,OAAO;OAAY,MAAM;MAAM;KAC1C;KACA,IAAI,UAAU,GAAG;MACf,SAAS;MACT,OAAO;OAAE,OAAO,aAAa;OAAG,MAAM;MAAM;KAC9C;KACA,OAAO;MAAE,OAAO;MAAW,MAAM;KAAK;IACxC,EACF;GACF;EACF,CAAC;CACH,kBACM,CAEN;CACA,OAAO;AACT;AAWA,SAAgB,SACd,OACA,MACA,UAAuC,CAAC,GAClB;CACtB,MAAM,MAAM,uBAA4B;CACxC,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,OAA8D,IAAI;CACxE,MAAM,YAAY,UAAU;CAC5B,MAAM,qBAAqB,sBAAyB,OAAO,IAAI;CAgB/D,OAAO,iBAfO,UAAa;EACzB,WAAW;GACT,MAAM,yDAAY,MAAgB;GAClC,IAAI,CAAC,QAAQ,KACX,OAAO;GAET,OAAO,QAAQ,IAAI,UAAU,aAAa,CAAC;EAC7C;EACA,MAAM,UAAa;GACjB,MAAM,YAAY,QAAQ,MACtB,QAAQ,IAAI,OAAuB,aAAa,CAAC,IAChD;GACL,yCAAO,WAAW,SAAS;EAC7B;CACF,CACwC,GAAG,YAAY;AACzD;AAwBA,SAAgB,aAGd,gBAAgF;CAChF,MAAM,WAAW,mBAAmB;CACpC,IAAI,sDAAC,SAAU,WAAU,OAAO,SAAS,OAAO,cAAc,YAC5D,MAAM,IAAI,MAAM,oCAAoC;CAEtD,MAAM,eAAe,SAAS,OAAO,UAAU,KAAK,SAAS,MAAM;CAInE,MAAM,cAA4E,MAAc,YAAqC;EACnI,IAAI,CAAC,gBACH,OAAO,aAAa,MAAM,OAAO;EAEnC,MAAM,SAAS;GACb,GAAI;GACJ,GAAI;EACN;EACA,OAAO,aAAa,MAAM,MAAM;CAClC;CAEA,UAAU,SAAS,MAAM,YAAY,UAAU,IAAI,CAAC,CAAC,MAAM,OAAO;CAClE,UAAU,SAAS,MAAM,YAAY;;EACnC,MAAM,SAAS;GAAE,GAAG;GAAgB,GAAG;EAAQ;EAC/C,MAAM,iFAAY,OAAQ,0EAAa;EAEvC,OADgB,UAAU,MAAM,MAAM,OACzB,CAAC,CAAC;CACjB;CACA,UAAU,MAAM,MAAM,YAAY;;EAChC,MAAM,SAAS;GAAE,GAAG;GAAgB,GAAG;EAAQ;EAE/C,MAAM,aAAa,KAAK,4EADN,OAAQ,8DAAS,OACS;EAE5C,OADgB,UAAU,MAAM,MAAM,OACzB,CAAC,CAAC;CACjB;CAEA,OAAO;AACT;;;;AAKA,SAAgB,iBAAiB;CAC/B,MAAM,YAAY,aAAa,EAAE,OAAO,SAAS,CAAC;CAElD,OAAO,SAAS,YACd,MACA,SACwD;EACxD,OAAO,UAAU,MAAyC,MAAM,OAAO;CACzE;AACF;AAEA,SAAgB,YAAe,GAAM,GAAS;CAC5C,IAAI,KAAK,MACP,OAAO;CAET,IAAI,KAAK,MACP,OAAO;CAET,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GACrC,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;CAElC,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,UACxC,OAAO;EAAE,GAAI;EAAW,GAAI;CAAU;CAExC,OAAO;AACT"}
1
+ {"version":3,"file":"model.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/model.ts"],"sourcesContent":["import type { Ref } from '../../reactivity'\nimport type {\n ModelBinding,\n ModelBindingOptions,\n ModelBindingPayload,\n} from '../types'\nimport { customRef } from '../../reactivity/ref'\nimport { capitalize } from '../../utils'\nimport { getCurrentInstance, getCurrentSetupContext } from '../hooks'\n\nexport type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>\nexport type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>]\n\nexport interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {\n get?: (value: T, modifiers: ModelModifiers<M>) => G\n set?: (value: S, modifiers: ModelModifiers<M>) => T\n}\n\nconst EMPTY_MODEL_MODIFIERS = Object.freeze(Object.create(null)) as ModelModifiers<any>\n\nfunction resolveModelModifiers<M extends PropertyKey = string>(\n props: Record<string, any>,\n name: string,\n): ModelModifiers<M> {\n const key = name === 'modelValue' ? 'modelModifiers' : `${name}Modifiers`\n const modifiers = props?.[key]\n if (!modifiers || typeof modifiers !== 'object') {\n return EMPTY_MODEL_MODIFIERS as ModelModifiers<M>\n }\n return modifiers as ModelModifiers<M>\n}\n\nfunction attachModelTuple<T, M extends PropertyKey = string, G = T, S = T>(\n model: Ref<G, S>,\n getModifiers: () => ModelModifiers<M>,\n): ModelRef<T, M, G, S> {\n const tupleModel = model as ModelRef<T, M, G, S>\n try {\n Object.defineProperty(tupleModel, Symbol.iterator, {\n configurable: true,\n value: () => {\n let index = 0\n return {\n next: () => {\n if (index === 0) {\n index += 1\n return { value: tupleModel, done: false }\n }\n if (index === 1) {\n index += 1\n return { value: getModifiers(), done: false }\n }\n return { value: undefined, done: true }\n },\n }\n },\n })\n }\n catch {\n // 忽略 defineProperty 失败场景,降级为普通 Ref 返回\n }\n return tupleModel\n}\n\nexport function useModel<T = any, M extends PropertyKey = string>(\n props: Record<string, any>,\n name: string,\n): ModelRef<T, M, T, T>\nexport function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(\n props: Record<string, any>,\n name: string,\n options: UseModelOptions<T, M, G, S>,\n): ModelRef<T, M, G, S>\nexport function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(\n props: Record<string, any>,\n name: string,\n options: UseModelOptions<T, M, G, S> = {},\n): ModelRef<T, M, G, S> {\n const ctx = getCurrentSetupContext<any>()\n if (!ctx) {\n throw new Error('useModel() 必须在 setup() 的同步阶段调用')\n }\n\n const emit: ((event: string, ...args: any[]) => void) | undefined = ctx.emit\n const eventName = `update:${name}`\n const getModifiers = () => resolveModelModifiers<M>(props, name)\n const model = customRef<G>({\n get: () => {\n const rawValue = (props as any)?.[name] as T\n if (!options.get) {\n return rawValue as unknown as G\n }\n return options.get(rawValue, getModifiers())\n },\n set: (value: G) => {\n const nextValue = options.set\n ? options.set(value as unknown as S, getModifiers())\n : (value as unknown as T)\n emit?.(eventName, nextValue)\n },\n })\n return attachModelTuple<T, M, G, S>(model, getModifiers)\n}\n\n/**\n * useBindModel 返回绑定到当前运行时实例的 bindModel。\n * 该方法必须在 setup() 的同步阶段调用。\n */\ntype BindModelWithHelper<\n DefaultEvent extends string = 'input',\n DefaultValueProp extends string = 'value',\n> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {\n model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => ModelBindingPayload<T, Event, ValueProp, Formatted>\n value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => Formatted\n on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, Event, ValueProp, Formatted>,\n ) => (event: any) => void\n}\n\nexport function useBindModel<\n DefaultEvent extends string = 'input',\n DefaultValueProp extends string = 'value',\n>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>) {\n const instance = getCurrentInstance()\n if (!instance?.__wevu || typeof instance.__wevu.bindModel !== 'function') {\n throw new Error('useBindModel() 必须在 setup() 的同步阶段调用')\n }\n const rawBindModel = instance.__wevu.bindModel.bind(instance.__wevu) as <T = any>(\n path: string,\n options?: ModelBindingOptions<T>,\n ) => ModelBinding<T>\n const bindModel: BindModelWithHelper<DefaultEvent, DefaultValueProp> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => {\n if (!defaultOptions) {\n return rawBindModel(path, options)\n }\n const merged = {\n ...(defaultOptions as ModelBindingOptions<T, DefaultEvent, DefaultValueProp, any>),\n ...(options as ModelBindingOptions<T, DefaultEvent, DefaultValueProp, any>),\n } as ModelBindingOptions<T>\n return rawBindModel(path, merged)\n }) as BindModelWithHelper<DefaultEvent, DefaultValueProp>\n\n bindModel.model = (path, options) => bindModel(path).model(options)\n bindModel.value = (path, options) => {\n const merged = { ...defaultOptions, ...options } as ModelBindingOptions<any>\n const valueProp = merged?.valueProp ?? 'value'\n const payload = bindModel.model(path, options) as Record<string, any>\n return payload[valueProp]\n }\n bindModel.on = (path, options) => {\n const merged = { ...defaultOptions, ...options } as ModelBindingOptions<any>\n const eventName = merged?.event ?? 'input'\n const handlerKey = `on${capitalize(eventName)}`\n const payload = bindModel.model(path, options) as Record<string, any>\n return payload[handlerKey]\n }\n\n return bindModel\n}\n\n/**\n * useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。\n */\nexport function useChangeModel() {\n const bindModel = useBindModel({ event: 'change' })\n\n return function changeModel<T = any, ValueProp extends string = 'value', Formatted = T>(\n path: string,\n options?: ModelBindingOptions<T, 'change', ValueProp, Formatted>,\n ): ModelBindingPayload<T, 'change', ValueProp, Formatted> {\n return bindModel.model<T, 'change', ValueProp, Formatted>(path, options)\n }\n}\n\nexport function mergeModels<T>(a: T, b: T): T {\n if (a == null) {\n return b\n }\n if (b == null) {\n return a\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return [...new Set([...a, ...b])] as any\n }\n if (typeof a === 'object' && typeof b === 'object') {\n return { ...(a as any), ...(b as any) }\n }\n return b\n}\n"],"mappings":";;;;;AAkBA,MAAM,wBAAwB,OAAO,OAAO,OAAO,OAAO,IAAI,CAAC;AAE/D,SAAS,sBACP,OACA,MACmB;CACnB,MAAM,MAAM,SAAS,eAAe,mBAAmB,GAAG,KAAK;CAC/D,MAAM,0DAAY,MAAQ;CAC1B,IAAI,CAAC,aAAa,OAAO,cAAc,UACrC,OAAO;CAET,OAAO;AACT;AAEA,SAAS,iBACP,OACA,cACsB;CACtB,MAAM,aAAa;CACnB,IAAI;EACF,OAAO,eAAe,YAAY,OAAO,UAAU;GACjD,cAAc;GACd,aAAa;IACX,IAAI,QAAQ;IACZ,OAAO,EACL,YAAY;KACV,IAAI,UAAU,GAAG;MACf,SAAS;MACT,OAAO;OAAE,OAAO;OAAY,MAAM;MAAM;KAC1C;KACA,IAAI,UAAU,GAAG;MACf,SAAS;MACT,OAAO;OAAE,OAAO,aAAa;OAAG,MAAM;MAAM;KAC9C;KACA,OAAO;MAAE,OAAO;MAAW,MAAM;KAAK;IACxC,EACF;GACF;EACF,CAAC;CACH,kBACM,CAEN;CACA,OAAO;AACT;AAWA,SAAgB,SACd,OACA,MACA,UAAuC,CAAC,GAClB;CACtB,MAAM,MAAM,uBAA4B;CACxC,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,OAA8D,IAAI;CACxE,MAAM,YAAY,UAAU;CAC5B,MAAM,qBAAqB,sBAAyB,OAAO,IAAI;CAgB/D,OAAO,iBAfO,UAAa;EACzB,WAAW;GACT,MAAM,yDAAY,MAAgB;GAClC,IAAI,CAAC,QAAQ,KACX,OAAO;GAET,OAAO,QAAQ,IAAI,UAAU,aAAa,CAAC;EAC7C;EACA,MAAM,UAAa;GACjB,MAAM,YAAY,QAAQ,MACtB,QAAQ,IAAI,OAAuB,aAAa,CAAC,IAChD;GACL,yCAAO,WAAW,SAAS;EAC7B;CACF,CACwC,GAAG,YAAY;AACzD;AAwBA,SAAgB,aAGd,gBAAgF;CAChF,MAAM,WAAW,mBAAmB;CACpC,IAAI,sDAAC,SAAU,WAAU,OAAO,SAAS,OAAO,cAAc,YAC5D,MAAM,IAAI,MAAM,oCAAoC;CAEtD,MAAM,eAAe,SAAS,OAAO,UAAU,KAAK,SAAS,MAAM;CAInE,MAAM,cAA4E,MAAc,YAAqC;EACnI,IAAI,CAAC,gBACH,OAAO,aAAa,MAAM,OAAO;EAEnC,MAAM,SAAS;GACb,GAAI;GACJ,GAAI;EACN;EACA,OAAO,aAAa,MAAM,MAAM;CAClC;CAEA,UAAU,SAAS,MAAM,YAAY,UAAU,IAAI,CAAC,CAAC,MAAM,OAAO;CAClE,UAAU,SAAS,MAAM,YAAY;;EACnC,MAAM,SAAS;GAAE,GAAG;GAAgB,GAAG;EAAQ;EAC/C,MAAM,iFAAY,OAAQ,0EAAa;EAEvC,OADgB,UAAU,MAAM,MAAM,OACzB,CAAC,CAAC;CACjB;CACA,UAAU,MAAM,MAAM,YAAY;;EAChC,MAAM,SAAS;GAAE,GAAG;GAAgB,GAAG;EAAQ;EAC/C,MAAM,6EAAY,OAAQ,8DAAS;EACnC,MAAM,aAAa,KAAK,WAAW,SAAS;EAE5C,OADgB,UAAU,MAAM,MAAM,OACzB,CAAC,CAAC;CACjB;CAEA,OAAO;AACT;;;;AAKA,SAAgB,iBAAiB;CAC/B,MAAM,YAAY,aAAa,EAAE,OAAO,SAAS,CAAC;CAElD,OAAO,SAAS,YACd,MACA,SACwD;EACxD,OAAO,UAAU,MAAyC,MAAM,OAAO;CACzE;AACF;AAEA,SAAgB,YAAe,GAAM,GAAS;CAC5C,IAAI,KAAK,MACP,OAAO;CAET,IAAI,KAAK,MACP,OAAO;CAET,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GACrC,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;CAElC,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,UACxC,OAAO;EAAE,GAAI;EAAW,GAAI;CAAU;CAExC,OAAO;AACT"}
@@ -1,4 +1,3 @@
1
- import { __exportAll, __reExport } from "./_virtual/_rolldown/runtime.mjs";
2
1
  import { nextTick } from "./scheduler.mjs";
3
2
  import { batch, effect, effectScope, endBatch, getCurrentScope, onScopeDispose, startBatch, stop } from "./reactivity/core.mjs";
4
3
  import { addMutationRecorder, removeMutationRecorder } from "./reactivity/reactive/mutation.mjs";
@@ -51,163 +50,6 @@ import { storeToRefs } from "./store/storeToRefs.mjs";
51
50
  export * from "@wevu/web-apis"
52
51
 
53
52
  //#region src/vue-demi.ts
54
- var vue_demi_exports = /* @__PURE__ */ __exportAll({
55
- Vue2: () => void 0,
56
- addMutationRecorder: () => addMutationRecorder,
57
- batch: () => batch,
58
- callHookList: () => callHookList,
59
- callHookReturn: () => callHookReturn,
60
- callUpdateHooks: () => callUpdateHooks,
61
- computed: () => computed,
62
- createApp: () => createApp,
63
- createStore: () => createStore,
64
- createWevuComponent: () => createWevuComponent,
65
- createWevuScopedSlotComponent: () => createWevuScopedSlotComponent,
66
- customRef: () => customRef,
67
- defineAppSetup: () => defineAppSetup,
68
- defineComponent: () => defineComponent,
69
- defineStore: () => defineStore,
70
- effect: () => effect,
71
- effectScope: () => effectScope,
72
- endBatch: () => endBatch,
73
- getCurrentInstance: () => getCurrentInstance,
74
- getCurrentPageStackSnapshot: () => getCurrentPageStackSnapshot,
75
- getCurrentScope: () => getCurrentScope,
76
- getCurrentSetupContext: () => getCurrentSetupContext,
77
- getDeepWatchStrategy: () => getDeepWatchStrategy,
78
- getNavigationBarMetrics: () => getNavigationBarMetrics,
79
- getReactiveVersion: () => getReactiveVersion,
80
- hasInjectionContext: () => hasInjectionContext,
81
- inject: () => inject,
82
- injectGlobal: () => injectGlobal,
83
- install: () => install,
84
- isNoSetData: () => isNoSetData,
85
- isProxy: () => isProxy,
86
- isRaw: () => isRaw,
87
- isReactive: () => isReactive,
88
- isReadonly: () => isReadonly,
89
- isRef: () => isRef,
90
- isShallowReactive: () => isShallowReactive,
91
- isShallowRef: () => isShallowRef,
92
- isVue2: () => false,
93
- isVue3: () => true,
94
- markNoSetData: () => markNoSetData,
95
- markRaw: () => markRaw,
96
- mergeModels: () => mergeModels,
97
- mountRuntimeInstance: () => mountRuntimeInstance,
98
- nextTick: () => nextTick,
99
- normalizeClass: () => normalizeClass,
100
- normalizeStyle: () => normalizeStyle,
101
- onActivated: () => onActivated,
102
- onAddToFavorites: () => onAddToFavorites,
103
- onAttached: () => onAttached,
104
- onBeforeMount: () => onBeforeMount,
105
- onBeforeUnmount: () => onBeforeUnmount,
106
- onBeforeUpdate: () => onBeforeUpdate,
107
- onDeactivated: () => onDeactivated,
108
- onDetached: () => onDetached,
109
- onError: () => onError,
110
- onErrorCaptured: () => onErrorCaptured,
111
- onHide: () => onHide,
112
- onLaunch: () => onLaunch,
113
- onLoad: () => onLoad,
114
- onMemoryWarning: () => onMemoryWarning,
115
- onMounted: () => onMounted,
116
- onMoved: () => onMoved,
117
- onPageNotFound: () => onPageNotFound,
118
- onPageScroll: () => onPageScroll,
119
- onPullDownRefresh: () => onPullDownRefresh,
120
- onReachBottom: () => onReachBottom,
121
- onReady: () => onReady,
122
- onResize: () => onResize,
123
- onRouteDone: () => onRouteDone,
124
- onSaveExitState: () => onSaveExitState,
125
- onScopeDispose: () => onScopeDispose,
126
- onServerPrefetch: () => onServerPrefetch,
127
- onShareAppMessage: () => onShareAppMessage,
128
- onShareTimeline: () => onShareTimeline,
129
- onShow: () => onShow,
130
- onTabItemTap: () => onTabItemTap,
131
- onThemeChange: () => onThemeChange,
132
- onUnhandledRejection: () => onUnhandledRejection,
133
- onUnload: () => onUnload,
134
- onUnmounted: () => onUnmounted,
135
- onUpdated: () => onUpdated,
136
- prelinkReactiveTree: () => prelinkReactiveTree,
137
- provide: () => provide,
138
- provideGlobal: () => provideGlobal,
139
- reactive: () => reactive,
140
- readonly: () => readonly,
141
- ref: () => ref,
142
- registerApp: () => registerApp,
143
- registerComponent: () => registerComponent,
144
- registerPageLayoutBridge: () => registerPageLayoutBridge,
145
- registerRuntimeLayoutHosts: () => registerRuntimeLayoutHosts,
146
- removeMutationRecorder: () => removeMutationRecorder,
147
- resetWevuDefaults: () => resetWevuDefaults,
148
- resolveLayoutBridge: () => resolveLayoutBridge,
149
- resolveLayoutHost: () => resolveLayoutHost,
150
- resolvePropValue: () => resolvePropValue,
151
- resolveRuntimePageLayoutName: () => resolveRuntimePageLayoutName,
152
- runSetupFunction: () => runSetupFunction,
153
- setCurrentInstance: () => setCurrentInstance,
154
- setCurrentSetupContext: () => setCurrentSetupContext,
155
- setDeepWatchStrategy: () => setDeepWatchStrategy,
156
- setGlobalProvidedValue: () => setGlobalProvidedValue,
157
- setPageLayout: () => setPageLayout,
158
- setRuntimeSetDataVisibility: () => setRuntimeSetDataVisibility,
159
- setWevuDefaults: () => setWevuDefaults,
160
- shallowReactive: () => shallowReactive,
161
- shallowReadonly: () => shallowReadonly,
162
- shallowRef: () => shallowRef,
163
- startBatch: () => startBatch,
164
- stop: () => stop,
165
- storeToRefs: () => storeToRefs,
166
- syncRuntimePageLayoutState: () => syncRuntimePageLayoutState,
167
- syncRuntimePageLayoutStateFromRuntime: () => syncRuntimePageLayoutStateFromRuntime,
168
- teardownRuntimeInstance: () => teardownRuntimeInstance,
169
- toRaw: () => toRaw,
170
- toRef: () => toRef,
171
- toRefs: () => toRefs,
172
- toValue: () => toValue,
173
- touchReactive: () => touchReactive,
174
- traverse: () => traverse,
175
- triggerRef: () => triggerRef,
176
- unref: () => unref,
177
- unregisterPageLayoutBridge: () => unregisterPageLayoutBridge,
178
- unregisterRuntimeLayoutHosts: () => unregisterRuntimeLayoutHosts,
179
- use: () => use,
180
- useAsyncPullDownRefresh: () => useAsyncPullDownRefresh,
181
- useAttrs: () => useAttrs,
182
- useBindModel: () => useBindModel,
183
- useBoundingClientRect: () => useBoundingClientRect,
184
- useChangeModel: () => useChangeModel,
185
- useDisposables: () => useDisposables,
186
- useElementIntersectionObserver: () => useElementIntersectionObserver,
187
- useIntersectionObserver: () => useIntersectionObserver,
188
- useLayoutBridge: () => useLayoutBridge,
189
- useLayoutHosts: () => useLayoutHosts,
190
- useModel: () => useModel,
191
- useNativeInstance: () => useNativeInstance,
192
- useNativePageRouter: () => useNativePageRouter,
193
- useNativeRouter: () => useNativeRouter,
194
- useNavigationBarMetrics: () => useNavigationBarMetrics,
195
- usePageLayout: () => usePageLayout,
196
- usePageScrollThrottle: () => usePageScrollThrottle,
197
- usePageStack: () => usePageStack,
198
- useScrollOffset: () => useScrollOffset,
199
- useSelectorFields: () => useSelectorFields,
200
- useSelectorQuery: () => useSelectorQuery,
201
- useSlots: () => useSlots,
202
- useTemplateRef: () => useTemplateRef,
203
- useUpdatePerformanceListener: () => useUpdatePerformanceListener,
204
- version: () => version,
205
- waitForLayoutHost: () => waitForLayoutHost,
206
- watch: () => watch,
207
- watchEffect: () => watchEffect,
208
- watchPostEffect: () => watchPostEffect,
209
- watchSyncEffect: () => watchSyncEffect
210
- });
211
53
  /**
212
54
  * 标记当前兼容层运行在 Vue 3 风格分支。
213
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,SAAS;;;;AAKtB,MAAa,SAAS;;;;AAKtB,MAAa,OAAO;;;;AAKpB,SAAgB,UAAU,CAAC"}
1
+ {"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,SAAS;;;;AAKtB,MAAa,SAAS;;;;AAKtB,MAAa,OAAO;;;;AAKpB,SAAgB,UAAU,CAAC"}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.mjs";import{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{computed as E}from"./reactivity/computed.mjs";import{isProxy as D,isReadonly as O,readonly as k,shallowReadonly as A}from"./reactivity/readonly.mjs";import{isShallowRef as j,shallowRef as M,triggerRef as N}from"./reactivity/shallowRef.mjs";import{toRef as P,toRefs as F}from"./reactivity/toRefs.mjs";import{traverse as I}from"./reactivity/traverse.mjs";import{callHookList as L,callHookReturn as R,getCurrentInstance as z,getCurrentSetupContext as B,setCurrentInstance as V,setCurrentSetupContext as H}from"./runtime/hooks/base.mjs";import{onAddToFavorites as U,onAttached as W,onDetached as G,onError as K,onHide as q,onLaunch as J,onLoad as Y,onMemoryWarning as X,onMoved as Z,onPageNotFound as Q,onPageScroll as $,onPullDownRefresh as ee,onReachBottom as te,onReady as ne,onResize as re,onRouteDone as ie,onSaveExitState as ae,onShareAppMessage as oe,onShareTimeline as se,onShow as ce,onTabItemTap as le,onThemeChange as ue,onUnhandledRejection as de,onUnload as fe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as pe,onActivated as me,onBeforeMount as he,onBeforeUnmount as ge,onBeforeUpdate as _e,onDeactivated as ve,onErrorCaptured as ye,onMounted as be,onServerPrefetch as xe,onUnmounted as Se,onUpdated as Ce}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as we,setDeepWatchStrategy as Te}from"./reactivity/watch/types.mjs";import{watch as Ee,watchEffect as De,watchPostEffect as Oe,watchSyncEffect as ke}from"./reactivity/watch.mjs";import{version as Ae}from"./version.mjs";import{isNoSetData as je,markNoSetData as Me}from"./runtime/noSetData.mjs";import{resetWevuDefaults as Ne,setWevuDefaults as Pe}from"./runtime/defaults.mjs";import{setGlobalProvidedValue as Fe}from"./runtime/provideStore.mjs";import{resolveRuntimePageLayoutName as Ie,setPageLayout as Le,syncRuntimePageLayoutState as Re,syncRuntimePageLayoutStateFromRuntime as ze,usePageLayout as Be}from"./runtime/pageLayout.mjs";import{runSetupFunction as Ve}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as He,setRuntimeSetDataVisibility as Ue,teardownRuntimeInstance as We}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Ge}from"./runtime/register/app.mjs";import{registerPageLayoutBridge as Ke,registerRuntimeLayoutHosts as qe,resolveLayoutBridge as Je,resolveLayoutHost as Ye,unregisterPageLayoutBridge as Xe,unregisterRuntimeLayoutHosts as Ze,useLayoutBridge as Qe,useLayoutHosts as $e,waitForLayoutHost as et}from"./runtime/layoutBridge.mjs";import{registerComponent as tt}from"./runtime/register/component.mjs";import{createApp as nt}from"./runtime/app.mjs";import{hasInjectionContext as rt,inject as it,injectGlobal as at,provide as ot,provideGlobal as st}from"./runtime/provide.mjs";import{createWevuComponent as ct,createWevuScopedSlotComponent as lt,defineComponent as ut}from"./runtime/define.mjs";import{useDisposables as dt}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as ft}from"./runtime/elementIntersectionObserver.mjs";import{useIntersectionObserver as pt}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as mt,getNavigationBarMetrics as ht,useNavigationBarMetrics as gt,usePageStack as _t}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as vt}from"./runtime/pageScroll.mjs";import{useAsyncPullDownRefresh as yt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as bt,useScrollOffset as xt,useSelectorFields as St,useSelectorQuery as Ct}from"./runtime/selectorQuery.mjs";import{normalizeClass as wt,normalizeStyle as Tt,resolvePropValue as Et}from"./runtime/template.mjs";import{useUpdatePerformanceListener as Dt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as Ot,use as kt}from"./runtime/use.mjs";import{useAttrs as At,useNativeInstance as jt,useSlots as Mt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Nt,useBindModel as Pt,useChangeModel as Ft,useModel as It}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as Lt,useNativeRouter as Rt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as zt}from"./runtime/vueCompat/templateRef.mjs";import{createStore as Bt}from"./store/manager.mjs";import{defineStore as Vt}from"./store/define.mjs";import{storeToRefs as Ht}from"./store/storeToRefs.mjs";export*from"@wevu/web-apis";export{l as addMutationRecorder,t as batch,L as callHookList,R as callHookReturn,pe as callUpdateHooks,E as computed,nt as createApp,Bt as createStore,ct as createWevuComponent,lt as createWevuScopedSlotComponent,x as customRef,Ot as defineAppSetup,ut as defineComponent,Vt as defineStore,n as effect,r as effectScope,i as endBatch,z as getCurrentInstance,mt as getCurrentPageStackSnapshot,a as getCurrentScope,B as getCurrentSetupContext,we as getDeepWatchStrategy,ht as getNavigationBarMetrics,g as getReactiveVersion,rt as hasInjectionContext,it as inject,at as injectGlobal,je as isNoSetData,D as isProxy,_ as isRaw,v as isReactive,O as isReadonly,S as isRef,m as isShallowReactive,j as isShallowRef,Me as markNoSetData,y as markRaw,Nt as mergeModels,He as mountRuntimeInstance,e as nextTick,wt as normalizeClass,Tt as normalizeStyle,me as onActivated,U as onAddToFavorites,W as onAttached,he as onBeforeMount,ge as onBeforeUnmount,_e as onBeforeUpdate,ve as onDeactivated,G as onDetached,K as onError,ye as onErrorCaptured,q as onHide,J as onLaunch,Y as onLoad,X as onMemoryWarning,be as onMounted,Z as onMoved,Q as onPageNotFound,$ as onPageScroll,ee as onPullDownRefresh,te as onReachBottom,ne as onReady,re as onResize,ie as onRouteDone,ae as onSaveExitState,o as onScopeDispose,xe as onServerPrefetch,oe as onShareAppMessage,se as onShareTimeline,ce as onShow,le as onTabItemTap,ue as onThemeChange,de as onUnhandledRejection,fe as onUnload,Se as onUnmounted,Ce as onUpdated,f as prelinkReactiveTree,ot as provide,st as provideGlobal,b as reactive,k as readonly,C as ref,Ge as registerApp,tt as registerComponent,Ke as registerPageLayoutBridge,qe as registerRuntimeLayoutHosts,u as removeMutationRecorder,Ne as resetWevuDefaults,Je as resolveLayoutBridge,Ye as resolveLayoutHost,Et as resolvePropValue,Ie as resolveRuntimePageLayoutName,Ve as runSetupFunction,V as setCurrentInstance,H as setCurrentSetupContext,Te as setDeepWatchStrategy,Fe as setGlobalProvidedValue,Le as setPageLayout,Ue as setRuntimeSetDataVisibility,Pe as setWevuDefaults,h as shallowReactive,A as shallowReadonly,M as shallowRef,s as startBatch,c as stop,Ht as storeToRefs,Re as syncRuntimePageLayoutState,ze as syncRuntimePageLayoutStateFromRuntime,We as teardownRuntimeInstance,d as toRaw,P as toRef,F as toRefs,w as toValue,p as touchReactive,I as traverse,N as triggerRef,T as unref,Xe as unregisterPageLayoutBridge,Ze as unregisterRuntimeLayoutHosts,kt as use,yt as useAsyncPullDownRefresh,At as useAttrs,Pt as useBindModel,bt as useBoundingClientRect,Ft as useChangeModel,dt as useDisposables,ft as useElementIntersectionObserver,pt as useIntersectionObserver,Qe as useLayoutBridge,$e as useLayoutHosts,It as useModel,jt as useNativeInstance,Lt as useNativePageRouter,Rt as useNativeRouter,gt as useNavigationBarMetrics,Be as usePageLayout,vt as usePageScrollThrottle,_t as usePageStack,xt as useScrollOffset,St as useSelectorFields,Ct as useSelectorQuery,Mt as useSlots,zt as useTemplateRef,Dt as useUpdatePerformanceListener,Ae as version,et as waitForLayoutHost,Ee as watch,De as watchEffect,Oe as watchPostEffect,ke as watchSyncEffect};
1
+ import{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{computed as E}from"./reactivity/computed.mjs";import{isProxy as D,isReadonly as O,readonly as k,shallowReadonly as A}from"./reactivity/readonly.mjs";import{isShallowRef as j,shallowRef as M,triggerRef as N}from"./reactivity/shallowRef.mjs";import{toRef as P,toRefs as F}from"./reactivity/toRefs.mjs";import{traverse as I}from"./reactivity/traverse.mjs";import{callHookList as L,callHookReturn as R,getCurrentInstance as z,getCurrentSetupContext as B,setCurrentInstance as V,setCurrentSetupContext as H}from"./runtime/hooks/base.mjs";import{onAddToFavorites as U,onAttached as W,onDetached as G,onError as K,onHide as q,onLaunch as J,onLoad as Y,onMemoryWarning as X,onMoved as Z,onPageNotFound as Q,onPageScroll as $,onPullDownRefresh as ee,onReachBottom as te,onReady as ne,onResize as re,onRouteDone as ie,onSaveExitState as ae,onShareAppMessage as oe,onShareTimeline as se,onShow as ce,onTabItemTap as le,onThemeChange as ue,onUnhandledRejection as de,onUnload as fe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as pe,onActivated as me,onBeforeMount as he,onBeforeUnmount as ge,onBeforeUpdate as _e,onDeactivated as ve,onErrorCaptured as ye,onMounted as be,onServerPrefetch as xe,onUnmounted as Se,onUpdated as Ce}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as we,setDeepWatchStrategy as Te}from"./reactivity/watch/types.mjs";import{watch as Ee,watchEffect as De,watchPostEffect as Oe,watchSyncEffect as ke}from"./reactivity/watch.mjs";import{version as Ae}from"./version.mjs";import{isNoSetData as je,markNoSetData as Me}from"./runtime/noSetData.mjs";import{resetWevuDefaults as Ne,setWevuDefaults as Pe}from"./runtime/defaults.mjs";import{setGlobalProvidedValue as Fe}from"./runtime/provideStore.mjs";import{resolveRuntimePageLayoutName as Ie,setPageLayout as Le,syncRuntimePageLayoutState as Re,syncRuntimePageLayoutStateFromRuntime as ze,usePageLayout as Be}from"./runtime/pageLayout.mjs";import{runSetupFunction as Ve}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as He,setRuntimeSetDataVisibility as Ue,teardownRuntimeInstance as We}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Ge}from"./runtime/register/app.mjs";import{registerPageLayoutBridge as Ke,registerRuntimeLayoutHosts as qe,resolveLayoutBridge as Je,resolveLayoutHost as Ye,unregisterPageLayoutBridge as Xe,unregisterRuntimeLayoutHosts as Ze,useLayoutBridge as Qe,useLayoutHosts as $e,waitForLayoutHost as et}from"./runtime/layoutBridge.mjs";import{registerComponent as tt}from"./runtime/register/component.mjs";import{createApp as nt}from"./runtime/app.mjs";import{hasInjectionContext as rt,inject as it,injectGlobal as at,provide as ot,provideGlobal as st}from"./runtime/provide.mjs";import{createWevuComponent as ct,createWevuScopedSlotComponent as lt,defineComponent as ut}from"./runtime/define.mjs";import{useDisposables as dt}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as ft}from"./runtime/elementIntersectionObserver.mjs";import{useIntersectionObserver as pt}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as mt,getNavigationBarMetrics as ht,useNavigationBarMetrics as gt,usePageStack as _t}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as vt}from"./runtime/pageScroll.mjs";import{useAsyncPullDownRefresh as yt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as bt,useScrollOffset as xt,useSelectorFields as St,useSelectorQuery as Ct}from"./runtime/selectorQuery.mjs";import{normalizeClass as wt,normalizeStyle as Tt,resolvePropValue as Et}from"./runtime/template.mjs";import{useUpdatePerformanceListener as Dt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as Ot,use as kt}from"./runtime/use.mjs";import{useAttrs as At,useNativeInstance as jt,useSlots as Mt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Nt,useBindModel as Pt,useChangeModel as Ft,useModel as It}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as Lt,useNativeRouter as Rt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as zt}from"./runtime/vueCompat/templateRef.mjs";import{createStore as Bt}from"./store/manager.mjs";import{defineStore as Vt}from"./store/define.mjs";import{storeToRefs as Ht}from"./store/storeToRefs.mjs";export*from"@wevu/web-apis";export{l as addMutationRecorder,t as batch,L as callHookList,R as callHookReturn,pe as callUpdateHooks,E as computed,nt as createApp,Bt as createStore,ct as createWevuComponent,lt as createWevuScopedSlotComponent,x as customRef,Ot as defineAppSetup,ut as defineComponent,Vt as defineStore,n as effect,r as effectScope,i as endBatch,z as getCurrentInstance,mt as getCurrentPageStackSnapshot,a as getCurrentScope,B as getCurrentSetupContext,we as getDeepWatchStrategy,ht as getNavigationBarMetrics,g as getReactiveVersion,rt as hasInjectionContext,it as inject,at as injectGlobal,je as isNoSetData,D as isProxy,_ as isRaw,v as isReactive,O as isReadonly,S as isRef,m as isShallowReactive,j as isShallowRef,Me as markNoSetData,y as markRaw,Nt as mergeModels,He as mountRuntimeInstance,e as nextTick,wt as normalizeClass,Tt as normalizeStyle,me as onActivated,U as onAddToFavorites,W as onAttached,he as onBeforeMount,ge as onBeforeUnmount,_e as onBeforeUpdate,ve as onDeactivated,G as onDetached,K as onError,ye as onErrorCaptured,q as onHide,J as onLaunch,Y as onLoad,X as onMemoryWarning,be as onMounted,Z as onMoved,Q as onPageNotFound,$ as onPageScroll,ee as onPullDownRefresh,te as onReachBottom,ne as onReady,re as onResize,ie as onRouteDone,ae as onSaveExitState,o as onScopeDispose,xe as onServerPrefetch,oe as onShareAppMessage,se as onShareTimeline,ce as onShow,le as onTabItemTap,ue as onThemeChange,de as onUnhandledRejection,fe as onUnload,Se as onUnmounted,Ce as onUpdated,f as prelinkReactiveTree,ot as provide,st as provideGlobal,b as reactive,k as readonly,C as ref,Ge as registerApp,tt as registerComponent,Ke as registerPageLayoutBridge,qe as registerRuntimeLayoutHosts,u as removeMutationRecorder,Ne as resetWevuDefaults,Je as resolveLayoutBridge,Ye as resolveLayoutHost,Et as resolvePropValue,Ie as resolveRuntimePageLayoutName,Ve as runSetupFunction,V as setCurrentInstance,H as setCurrentSetupContext,Te as setDeepWatchStrategy,Fe as setGlobalProvidedValue,Le as setPageLayout,Ue as setRuntimeSetDataVisibility,Pe as setWevuDefaults,h as shallowReactive,A as shallowReadonly,M as shallowRef,s as startBatch,c as stop,Ht as storeToRefs,Re as syncRuntimePageLayoutState,ze as syncRuntimePageLayoutStateFromRuntime,We as teardownRuntimeInstance,d as toRaw,P as toRef,F as toRefs,w as toValue,p as touchReactive,I as traverse,N as triggerRef,T as unref,Xe as unregisterPageLayoutBridge,Ze as unregisterRuntimeLayoutHosts,kt as use,yt as useAsyncPullDownRefresh,At as useAttrs,Pt as useBindModel,bt as useBoundingClientRect,Ft as useChangeModel,dt as useDisposables,ft as useElementIntersectionObserver,pt as useIntersectionObserver,Qe as useLayoutBridge,$e as useLayoutHosts,It as useModel,jt as useNativeInstance,Lt as useNativePageRouter,Rt as useNativeRouter,gt as useNavigationBarMetrics,Be as usePageLayout,vt as usePageScrollThrottle,_t as usePageStack,xt as useScrollOffset,St as useSelectorFields,Ct as useSelectorQuery,Mt as useSlots,zt as useTemplateRef,Dt as useUpdatePerformanceListener,Ae as version,et as waitForLayoutHost,Ee as watch,De as watchEffect,Oe as watchPostEffect,ke as watchSyncEffect};
package/dist/package.mjs CHANGED
@@ -1 +1 @@
1
- var e=`6.19.0`;export{e as version};
1
+ var e=`6.19.1`;export{e as version};
@@ -1 +1 @@
1
- import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.mjs";const n=new WeakMap;let r=null;const i=[];let a=0;const o=new Set;function s(){a++}function c(){for(;o.size;){let e=[...o];o.clear();for(let t of e)t()}}function l(){a!==0&&(a--,a===0&&c())}function u(e){s();try{return e()}finally{l()}}function d(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function f(e){var t;e.active&&(e.active=!1,d(e),(t=e.onStop)==null||t.call(e))}let p;var m=class{constructor(e=!1){if(this.detached=e,t(this,`active`,!0),t(this,`effects`,[]),t(this,`cleanups`,[]),t(this,`parent`,void 0),t(this,`scopes`,void 0),!e&&p){var n;this.parent=p,((n=p).scopes||(n.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=p;p=this;try{return e()}finally{p=t}}stop(){var e;if(this.active){this.active=!1;for(let e of this.effects)f(e);this.effects.length=0;for(let e of this.cleanups)e();if(this.cleanups.length=0,this.scopes){for(let e of this.scopes)e.stop();this.scopes.length=0}if((e=this.parent)!=null&&e.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0}}};function h(e=!1){return new m(e)}function g(){return p}function _(e){p!=null&&p.active&&p.cleanups.push(e)}function v(e){p!=null&&p.active&&p.effects.push(e)}function y(e,t={}){let n=function(){if(!n.active||n._running)return e();d(n);try{return n._running=!0,i.push(n),r=n,e()}finally{var t;i.pop(),r=(t=i[i.length-1])==null?null:t,n._running=!1}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n}function b(e,t={}){let n=y(e,t);return v(n),t.lazy||n(),n}function x(e,t){if(!r)return;let i=n.get(e);i||(i=new Map,n.set(e,i));let a=i.get(t);a||(a=new Set,i.set(t,a)),a.has(r)||(a.add(r),r.deps.push(a))}function S(e){if(e.scheduler){e.scheduler();return}if(a>0){o.add(e);return}e()}function C(e,t){let i=n.get(e);if(!i)return;let a=i.get(t);if(!a)return;let o=new Set;a.forEach(e=>{e!==r&&o.add(e)}),o.forEach(S)}function w(e){r&&(e.has(r)||(e.add(r),r.deps.push(e)))}function T(e){new Set(e).forEach(S)}export{u as batch,y as createReactiveEffect,b as effect,h as effectScope,l as endBatch,g as getCurrentScope,_ as onScopeDispose,e as queueJob,s as startBatch,f as stop,x as track,w as trackEffects,C as trigger,T as triggerEffects};
1
+ import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs";const n=new WeakMap;let r=null;const i=[];let a=0;const o=new Set;function s(){a++}function c(){for(;o.size;){let e=[...o];o.clear();for(let t of e)t()}}function l(){a!==0&&(a--,a===0&&c())}function u(e){s();try{return e()}finally{l()}}function d(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function f(e){var t;e.active&&(e.active=!1,d(e),(t=e.onStop)==null||t.call(e))}let p;var m=class{constructor(e=!1){if(this.detached=e,t(this,`active`,!0),t(this,`effects`,[]),t(this,`cleanups`,[]),t(this,`parent`,void 0),t(this,`scopes`,void 0),!e&&p){var n;this.parent=p,((n=p).scopes||(n.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=p;p=this;try{return e()}finally{p=t}}stop(){var e;if(this.active){this.active=!1;for(let e of this.effects)f(e);this.effects.length=0;for(let e of this.cleanups)e();if(this.cleanups.length=0,this.scopes){for(let e of this.scopes)e.stop();this.scopes.length=0}if((e=this.parent)!=null&&e.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0}}};function h(e=!1){return new m(e)}function g(){return p}function _(e){p!=null&&p.active&&p.cleanups.push(e)}function v(e){p!=null&&p.active&&p.effects.push(e)}function y(e,t={}){let n=function(){if(!n.active||n._running)return e();d(n);try{return n._running=!0,i.push(n),r=n,e()}finally{var t;i.pop(),r=(t=i[i.length-1])==null?null:t,n._running=!1}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n}function b(e,t={}){let n=y(e,t);return v(n),t.lazy||n(),n}function x(e,t){if(!r)return;let i=n.get(e);i||(i=new Map,n.set(e,i));let a=i.get(t);a||(a=new Set,i.set(t,a)),a.has(r)||(a.add(r),r.deps.push(a))}function S(e){if(e.scheduler){e.scheduler();return}if(a>0){o.add(e);return}e()}function C(e,t){let i=n.get(e);if(!i)return;let a=i.get(t);if(!a)return;let o=new Set;a.forEach(e=>{e!==r&&o.add(e)}),o.forEach(S)}function w(e){r&&(e.has(r)||(e.add(r),r.deps.push(e)))}function T(e){new Set(e).forEach(S)}export{u as batch,y as createReactiveEffect,b as effect,h as effectScope,l as endBatch,g as getCurrentScope,_ as onScopeDispose,e as queueJob,s as startBatch,f as stop,x as track,w as trackEffects,C as trigger,T as triggerEffects};
@@ -1 +1 @@
1
- import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i==null?void 0:i.shouldIncludeTopKey,c=typeof(i==null?void 0:i.maxDepth)==`number`?Math.max(0,Math.floor(i.maxDepth)):1/0,u=typeof(i==null?void 0:i.maxKeys)==`number`?Math.max(0,Math.floor(i.maxKeys)):1/0,d=new WeakSet,m=[{current:a,path:``,depth:0}],h=0;for(;m.length;){let e=m.pop();if(d.has(e.current)||(d.add(e.current),o.set(e.current,e.path),n(a,e.current),h+=1,h>=u)||e.depth>=c||Array.isArray(e.current))continue;let i=Object.entries(e.current);for(let[c,u]of i){if(e.path===``&&s&&!s(c)||!f(u)||u.__r_skip)continue;let i=p(u);if(t(i,e.current),l(i,e.current,c),!r.has(i)){let t=e.path?`${e.path}.${c}`:c;o.set(i,t)}n(a,i),m.push({current:i,path:e.path?`${e.path}.${c}`:c,depth:e.depth+1})}}}function h(e){let t=p(e),n=u.get(t);if(!n){o.delete(t);return}for(let e of n)i.delete(e),a.delete(e),o.delete(e),r.delete(e),s.delete(e),c.delete(e);u.delete(t)}function g(t){e(p(t),d)}export{h as clearPatchIndices,m as prelinkReactiveTree,g as touchReactive};
1
+ import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i==null?void 0:i.shouldIncludeTopKey,c=typeof(i==null?void 0:i.maxDepth)==`number`?Math.max(0,Math.floor(i.maxDepth)):1/0,u=typeof(i==null?void 0:i.maxKeys)==`number`?Math.max(0,Math.floor(i.maxKeys)):1/0,d=new WeakSet,m=[{current:a,path:``,depth:0}],h=0;for(;m.length;){let e=m.pop();if(d.has(e.current)||(d.add(e.current),o.set(e.current,e.path),n(a,e.current),h+=1,h>=u)||e.depth>=c||Array.isArray(e.current))continue;let i=Object.entries(e.current);for(let[c,u]of i){if(e.path===``&&s&&!s(c)||!f(u)||u.__r_skip)continue;let i=p(u);if(t(i,e.current),l(i,e.current,c),!r.has(i)){let t=e.path?`${e.path}.${c}`:c;o.set(i,t)}n(a,i),m.push({current:i,path:e.path?`${e.path}.${c}`:c,depth:e.depth+1})}}}function h(e){let t=p(e),n=u.get(t);if(!n){o.delete(t);return}for(let e of n)i.delete(e),a.delete(e),o.delete(e),r.delete(e),s.delete(e),c.delete(e);u.delete(t)}function g(t){let n=p(t);e(n,d)}export{h as clearPatchIndices,m as prelinkReactiveTree,g as touchReactive};
@@ -1 +1 @@
1
- import{track as e,trigger as t}from"./core.mjs";import{addMutationRecorder as n,mutationRecorders as r,removeMutationRecorder as i}from"./reactive/mutation.mjs";import{adoptReactiveRoot as a,bumpAncestorVersions as o,bumpRawVersion as s,getRawVersion as c,rawMultiParentSet as l,rawParentsMap as u,rawPathMap as d,rawRootMap as f,rawVersionMap as p,recordParentLink as m,removeParentLink as h,resolvePathToTarget as g}from"./reactive/patchState.mjs";import{VERSION_KEY as _,getTargetType as v,hasOwn as y,isArrayIndexKey as b,isObject as x,toRaw as S}from"./reactive/shared.mjs";import{rawMap as C,reactiveMap as w}from"./reactive/state.mjs";import{clearPatchIndices as T,prelinkReactiveTree as E,touchReactive as D}from"./reactive/patch.mjs";import{isShallowReactive as O,shallowReactive as k}from"./reactive/shallow.mjs";function A(e){return c(S(e))}function j(e,t,n){var i;if(!r.size||typeof t!=`string`||t.startsWith(`__r_`))return;let a=(i=f.get(e))==null?e:i,o=Array.isArray(e)&&(t===`length`||b(t))?`array`:`property`,s=g(a,e);if(!s){let i=new Set,s=u.get(e);if(s)for(let[e,t]of s){var c;let n=d.get(e),r=n?n.split(`.`,1)[0]:void 0,o=r||(c=g(a,e))==null?void 0:c[0];for(let e of t){var l;typeof e==`string`&&i.add((l=r==null?o:r)==null?e:l)}}else i.add(t);for(let e of r)e({root:a,kind:o,op:n,path:void 0,fallbackTopKeys:i.size?[...i]:void 0});return}let p=s.findIndex(e=>b(e));if(p!==-1){let e=s.slice(0,p).join(`.`)||void 0;for(let t of r)t({root:a,kind:`array`,op:n,path:e});return}let m=s.length?s.join(`.`):``,h=o===`array`?m||void 0:m?`${m}.${t}`:t;for(let e of r)e({root:a,kind:o,op:n,path:h})}const M={get(t,n,i){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return t;let o=Reflect.get(t,n,i);if(e(t,n),x(o)){var s;if(o.__r_skip)return o;let e=(s=o==null?void 0:o.__r_raw)==null?o:s;a(e,t),m(e,t,n);let i=d.get(t);if(r.size&&typeof n==`string`&&i!=null&&!l.has(e)){let t=i?`${i}.${n}`:n;d.set(e,t)}return N(o)}return o},set(e,n,i,c){let u=Array.isArray(e),p=u?e.length:0,g=Reflect.get(e,n,c),v=x(g)?S(g):g,y=x(i)?S(i):i;if(Object.is(v,y))return!0;let C=Reflect.set(e,n,i,c);if(C){let i=x(v)?v:void 0;if(i&&h(i,e,n),x(y)&&!y.__r_skip){let t=y;a(t,e),m(t,e,n);let i=d.get(e);if(r.size&&typeof n==`string`&&i!=null&&!l.has(t)){let e=i?`${i}.${n}`:n;d.set(t,e)}}t(e,n),u&&typeof n==`string`&&b(n)&&Number(n)>=p&&t(e,`length`),t(e,_),s(e),o(e);let c=f.get(e);c&&c!==e&&(t(c,_),s(c)),j(e,n,`set`)}return C},deleteProperty(e,n){let r=y(e,n),i=r?e[n]:void 0,a=Reflect.deleteProperty(e,n);if(r&&a){var c;let r=x(i)?(c=i==null?void 0:i.__r_raw)==null?i:c:void 0;r&&h(r,e,n),t(e,n),t(e,_),s(e),o(e);let a=f.get(e);a&&a!==e&&(t(a,_),s(a)),j(e,n,`delete`)}return a},ownKeys(t){return e(t,Symbol.iterator),e(t,_),Reflect.ownKeys(t)}};function N(e){if(!x(e)||e.__r_isReactive)return e;let t=w.get(e);if(t)return t;if(v(e)===0)return e;let n=new Proxy(e,M);return w.set(e,n),C.set(n,e),p.has(e)||p.set(e,0),f.has(e)||f.set(e,e),n}function P(e){return!!(e&&e.__r_isReactive)}function F(e){return x(e)?N(e):e}function I(e){return x(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function L(e){return x(e)&&`__r_skip`in e}export{n as addMutationRecorder,T as clearPatchIndices,F as convertToReactive,A as getReactiveVersion,x as isObject,L as isRaw,P as isReactive,O as isShallowReactive,I as markRaw,E as prelinkReactiveTree,N as reactive,i as removeMutationRecorder,k as shallowReactive,S as toRaw,D as touchReactive};
1
+ import{track as e,trigger as t}from"./core.mjs";import{addMutationRecorder as n,mutationRecorders as r,removeMutationRecorder as i}from"./reactive/mutation.mjs";import{adoptReactiveRoot as a,bumpAncestorVersions as o,bumpRawVersion as s,getRawVersion as c,rawMultiParentSet as l,rawParentsMap as u,rawPathMap as d,rawRootMap as f,rawVersionMap as p,recordParentLink as m,removeParentLink as h,resolvePathToTarget as g}from"./reactive/patchState.mjs";import{VERSION_KEY as _,getTargetType as v,hasOwn as y,isArrayIndexKey as b,isObject as x,toRaw as S}from"./reactive/shared.mjs";import{rawMap as C,reactiveMap as w}from"./reactive/state.mjs";import{clearPatchIndices as T,prelinkReactiveTree as E,touchReactive as D}from"./reactive/patch.mjs";import{isShallowReactive as O,shallowReactive as k}from"./reactive/shallow.mjs";function A(e){let t=S(e);return c(t)}function j(e,t,n){var i;if(!r.size||typeof t!=`string`||t.startsWith(`__r_`))return;let a=(i=f.get(e))==null?e:i,o=Array.isArray(e)&&(t===`length`||b(t))?`array`:`property`,s=g(a,e);if(!s){let i=new Set,s=u.get(e);if(s)for(let[e,t]of s){var c;let n=d.get(e),r=n?n.split(`.`,1)[0]:void 0,o=r||(c=g(a,e))==null?void 0:c[0];for(let e of t){var l;typeof e==`string`&&i.add((l=r==null?o:r)==null?e:l)}}else i.add(t);for(let e of r)e({root:a,kind:o,op:n,path:void 0,fallbackTopKeys:i.size?[...i]:void 0});return}let p=s.findIndex(e=>b(e));if(p!==-1){let e=s.slice(0,p).join(`.`)||void 0;for(let t of r)t({root:a,kind:`array`,op:n,path:e});return}let m=s.length?s.join(`.`):``,h=o===`array`?m||void 0:m?`${m}.${t}`:t;for(let e of r)e({root:a,kind:o,op:n,path:h})}const M={get(t,n,i){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return t;let o=Reflect.get(t,n,i);if(e(t,n),x(o)){var s;if(o.__r_skip)return o;let e=(s=o==null?void 0:o.__r_raw)==null?o:s;a(e,t),m(e,t,n);let i=d.get(t);if(r.size&&typeof n==`string`&&i!=null&&!l.has(e)){let t=i?`${i}.${n}`:n;d.set(e,t)}return N(o)}return o},set(e,n,i,c){let u=Array.isArray(e),p=u?e.length:0,g=Reflect.get(e,n,c),v=x(g)?S(g):g,y=x(i)?S(i):i;if(Object.is(v,y))return!0;let C=Reflect.set(e,n,i,c);if(C){let i=x(v)?v:void 0;if(i&&h(i,e,n),x(y)&&!y.__r_skip){let t=y;a(t,e),m(t,e,n);let i=d.get(e);if(r.size&&typeof n==`string`&&i!=null&&!l.has(t)){let e=i?`${i}.${n}`:n;d.set(t,e)}}t(e,n),u&&typeof n==`string`&&b(n)&&Number(n)>=p&&t(e,`length`),t(e,_),s(e),o(e);let c=f.get(e);c&&c!==e&&(t(c,_),s(c)),j(e,n,`set`)}return C},deleteProperty(e,n){let r=y(e,n),i=r?e[n]:void 0,a=Reflect.deleteProperty(e,n);if(r&&a){var c;let r=x(i)?(c=i==null?void 0:i.__r_raw)==null?i:c:void 0;r&&h(r,e,n),t(e,n),t(e,_),s(e),o(e);let a=f.get(e);a&&a!==e&&(t(a,_),s(a)),j(e,n,`delete`)}return a},ownKeys(t){return e(t,Symbol.iterator),e(t,_),Reflect.ownKeys(t)}};function N(e){if(!x(e)||e.__r_isReactive)return e;let t=w.get(e);if(t)return t;if(v(e)===0)return e;let n=new Proxy(e,M);return w.set(e,n),C.set(n,e),p.has(e)||p.set(e,0),f.has(e)||f.set(e,e),n}function P(e){return!!(e&&e.__r_isReactive)}function F(e){return x(e)?N(e):e}function I(e){return x(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function L(e){return x(e)&&`__r_skip`in e}export{n as addMutationRecorder,T as clearPatchIndices,F as convertToReactive,A as getReactiveVersion,x as isObject,L as isRaw,P as isReactive,O as isShallowReactive,I as markRaw,E as prelinkReactiveTree,N as reactive,i as removeMutationRecorder,k as shallowReactive,S as toRaw,D as touchReactive};
@@ -1 +1 @@
1
- import e from"../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.mjs";import{trackEffects as t,triggerEffects as n}from"./core.mjs";import{convertToReactive as r,markRaw as i}from"./reactive.mjs";const a=`__v_isRef`;function o(e){try{Object.defineProperty(e,a,{value:!0,configurable:!0})}catch(t){e[a]=!0}return e}function s(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var c=class{constructor(t){e(this,`_value`,void 0),e(this,`_rawValue`,void 0),e(this,`dep`,void 0),o(this),this._rawValue=t,this._value=r(t)}get value(){return this.dep||(this.dep=new Set),t(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=r(e),this.dep&&n(this.dep))}};function l(e){return s(e)?e:i(new c(e))}function u(e){return s(e)?e.value:e}function d(e){return typeof e==`function`?e():u(e)}var f=class{constructor(r,i){e(this,`_getValue`,void 0),e(this,`_setValue`,void 0),e(this,`dep`,void 0),o(this);let a=i,s=()=>{this.dep||(this.dep=new Set),t(this.dep)},c=()=>{this.dep&&n(this.dep)},l=e=>e===void 0&&a!==void 0?a:e;if(typeof r==`function`){let e=r(s,c);this._getValue=()=>l(e.get()),this._setValue=t=>e.set(t);return}let u=r;this._getValue=()=>(s(),l(u.get())),this._setValue=e=>{u.set(e),c()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function p(e,t){return i(new f(e,t))}export{a as RefFlag,p as customRef,s as isRef,o as markAsRef,l as ref,d as toValue,u as unref};
1
+ import e from"../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs";import{trackEffects as t,triggerEffects as n}from"./core.mjs";import{convertToReactive as r,markRaw as i}from"./reactive.mjs";const a=`__v_isRef`;function o(e){try{Object.defineProperty(e,a,{value:!0,configurable:!0})}catch(t){e[a]=!0}return e}function s(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var c=class{constructor(t){e(this,`_value`,void 0),e(this,`_rawValue`,void 0),e(this,`dep`,void 0),o(this),this._rawValue=t,this._value=r(t)}get value(){return this.dep||(this.dep=new Set),t(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=r(e),this.dep&&n(this.dep))}};function l(e){return s(e)?e:i(new c(e))}function u(e){return s(e)?e.value:e}function d(e){return typeof e==`function`?e():u(e)}var f=class{constructor(r,i){e(this,`_getValue`,void 0),e(this,`_setValue`,void 0),e(this,`dep`,void 0),o(this);let a=i,s=()=>{this.dep||(this.dep=new Set),t(this.dep)},c=()=>{this.dep&&n(this.dep)},l=e=>e===void 0&&a!==void 0?a:e;if(typeof r==`function`){let e=r(s,c);this._getValue=()=>l(e.get()),this._setValue=t=>e.set(t);return}let u=r;this._getValue=()=>(s(),l(u.get())),this._setValue=e=>{u.set(e),c()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function p(e,t){return i(new f(e,t))}export{a as RefFlag,p as customRef,s as isRef,o as markAsRef,l as ref,d as toValue,u as unref};
@@ -1 +1 @@
1
- import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c==null?l:c;if(!(u===!0||typeof u==`number`))return e;let d=typeof u==`number`?u:u?1/0:0;return()=>{let t=e(),a=s();return i&&Array.isArray(t)?t.map(e=>a===`version`&&r(e)?(n(e),e):o(e,d)):a===`version`&&r(t)?(n(t),t):o(t,d)}}function d(n,r,i,a){if(a){a(n,i);return}if(r===`sync`){n();return}if(r===`post`){e(()=>t(n));return}i?n():t(n)}export{u as applyDeepWatchGetter,l as createWatchGetter,d as dispatchScheduledJob};
1
+ import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c==null?l:c;if(u!==!0&&typeof u!=`number`)return e;let d=typeof u==`number`?u:u?1/0:0;return()=>{let t=e(),a=s();return i&&Array.isArray(t)?t.map(e=>a===`version`&&r(e)?(n(e),e):o(e,d)):a===`version`&&r(t)?(n(t),t):o(t,d)}}function d(n,r,i,a){if(a){a(n,i);return}if(r===`sync`){n();return}if(r===`post`){e(()=>t(n));return}i?n():t(n)}export{u as applyDeepWatchGetter,l as createWatchGetter,d as dispatchScheduledJob};
@@ -1 +1 @@
1
- import{getMiniProgramGlobalObject as e}from"../runtime/platform.mjs";import{installRouteStateSyncOnNativeRouter as t}from"./routeSync.mjs";import{resolvePath as n}from"../routerInternal/path.mjs";import{parseQuery as r,stringifyQuery as i}from"../routerInternal/query.mjs";import{resolveNamedRouteLocation as a}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as o,resolveMatchedRouteRecord as s}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as c}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as l,resolveRouteOptionEntries as u}from"../routerInternal/records.mjs";import{cloneRouteMeta as d,cloneRouteParams as ee,createRouterOptionsSnapshot as f,normalizeRouteRecordMatched as te,snapshotRouteLocation as ne}from"../routerInternal/snapshots.mjs";import{createNavigationResultController as p}from"./navigationResult.mjs";import{runBackNavigationGuards as re}from"./backNavigation.mjs";import{setActiveRouter as m}from"./instance.mjs";import{createNavigationApi as h}from"./navigationApi.mjs";import{resolveRouteLocation as g}from"./resolve.mjs";import{createRouteRegistry as _}from"./routeRegistry.mjs";import{createRouteStateController as v,useNativeRouter as y}from"./useRoute.mjs";function b(b={}){var x,S,C,w,T,E;let D=y();t(e());let O=new Set,k=new Set,A=new Set,j=new Set,M=(x=b.maxRedirects)==null?10:x,N=(S=b.paramsMode)==null?`loose`:S,P=(C=b.rejectOnError)==null||C,F={parseQuery:(w=b.parseQuery)==null?r:w,stringifyQuery:(T=b.stringifyQuery)==null?i:T},I=Promise.resolve(),L=u(b);c(L);let R=l(L),z=((E=b.tabBarEntries)==null?[]:E).map(e=>n(e,``)).filter(Boolean),B=new Set(z),V=_(R),H=0,U=f(z,V.getRoutes(),N,M,F,P);function W(e){let t={...e};t.href=t.fullPath;let n=s(t,R);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=o(n.matchedRecords);r!==void 0&&(t.meta=d(r)),n.params&&Object.keys(t.params).length===0&&(t.params=ee(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>te(e,t===r.length-1?n.matchedPath:void 0))}else t.matched=[];return t}function G(e,t){return W(g(typeof e==`string`?e:a(e,R,N),t,F))}let K,q;function J(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function Y(e,t){H>0||!J(t)||e.fullPath===K.fullPath||re({target:e,from:ne(K),nativeRouter:D,beforeEachGuards:O,beforeResolveGuards:k,resolveWithCodec:G}).then(e=>q==null?void 0:q(e))}K=v({beforeRouteStateSync:Y,resolveRoute:W}).route;function ie(e){return G(e,K.path)}let X=p({afterEachHooks:A,errorHandlers:j,nativeRouter:D,rejectOnError:P});q=X.emitNavigationAfterEach;let Z=h({nativeRouter:D,route:K,routeResolveCodec:F,namedRouteLookup:R,beforeEachGuards:O,beforeResolveGuards:k,maxRedirects:M,tabBarPathSet:B,resolveWithCodec:G,settleNavigationResult:X.settleNavigationResult});async function Q(e){H+=1;try{return await e()}finally{--H}}function ae(e){return O.add(e),()=>{O.delete(e)}}function oe(e){return k.add(e),()=>{k.delete(e)}}function se(e){return A.add(e),()=>{A.delete(e)}}function ce(e){return j.add(e),()=>{j.delete(e)}}let $={nativeRouter:D,options:U,currentRoute:K,install(e){var t;m($);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=$)},resolve:ie,isReady(){return I},push:e=>Q(()=>Z.push(e)),replace:e=>Q(()=>Z.replace(e)),back:e=>Q(()=>Z.back(e)),go:e=>Q(()=>Z.go(e)),forward:()=>Q(()=>Z.forward()),hasRoute:V.hasRoute,getRoutes:V.getRoutes,addRoute:V.addRoute,removeRoute:V.removeRoute,clearRoutes:V.clearRoutes,beforeEach:ae,beforeResolve:oe,afterEach:se,onError:ce};return m($),$}export{b as createRouter};
1
+ import{getMiniProgramGlobalObject as e}from"../runtime/platform.mjs";import{installRouteStateSyncOnNativeRouter as t}from"./routeSync.mjs";import{resolvePath as n}from"../routerInternal/path.mjs";import{parseQuery as r,stringifyQuery as i}from"../routerInternal/query.mjs";import{resolveNamedRouteLocation as a}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as o,resolveMatchedRouteRecord as s}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as c}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as l,resolveRouteOptionEntries as u}from"../routerInternal/records.mjs";import{cloneRouteMeta as d,cloneRouteParams as ee,createRouterOptionsSnapshot as f,normalizeRouteRecordMatched as te,snapshotRouteLocation as ne}from"../routerInternal/snapshots.mjs";import{createNavigationResultController as p}from"./navigationResult.mjs";import{runBackNavigationGuards as m}from"./backNavigation.mjs";import{setActiveRouter as h}from"./instance.mjs";import{createNavigationApi as g}from"./navigationApi.mjs";import{resolveRouteLocation as _}from"./resolve.mjs";import{createRouteRegistry as re}from"./routeRegistry.mjs";import{createRouteStateController as v,useNativeRouter as y}from"./useRoute.mjs";function b(b={}){var x,S,C,w,T,E;let D=y();t(e());let O=new Set,k=new Set,A=new Set,j=new Set,M=(x=b.maxRedirects)==null?10:x,N=(S=b.paramsMode)==null?`loose`:S,P=(C=b.rejectOnError)==null||C,F={parseQuery:(w=b.parseQuery)==null?r:w,stringifyQuery:(T=b.stringifyQuery)==null?i:T},I=Promise.resolve(),L=u(b);c(L);let R=l(L),z=((E=b.tabBarEntries)==null?[]:E).map(e=>n(e,``)).filter(Boolean),B=new Set(z),V=re(R),H=0,U=f(z,V.getRoutes(),N,M,F,P);function W(e){let t={...e};t.href=t.fullPath;let n=s(t,R);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=o(n.matchedRecords);r!==void 0&&(t.meta=d(r)),n.params&&Object.keys(t.params).length===0&&(t.params=ee(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>{let i=t===r.length-1?n.matchedPath:void 0;return te(e,i)})}else t.matched=[];return t}function G(e,t){let n=typeof e==`string`?e:a(e,R,N);return W(_(n,t,F))}let K,q;function J(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function Y(e,t){if(H>0||!J(t)||e.fullPath===K.fullPath)return;let n=ne(K);m({target:e,from:n,nativeRouter:D,beforeEachGuards:O,beforeResolveGuards:k,resolveWithCodec:G}).then(e=>q==null?void 0:q(e))}K=v({beforeRouteStateSync:Y,resolveRoute:W}).route;function ie(e){return G(e,K.path)}let X=p({afterEachHooks:A,errorHandlers:j,nativeRouter:D,rejectOnError:P});q=X.emitNavigationAfterEach;let Z=g({nativeRouter:D,route:K,routeResolveCodec:F,namedRouteLookup:R,beforeEachGuards:O,beforeResolveGuards:k,maxRedirects:M,tabBarPathSet:B,resolveWithCodec:G,settleNavigationResult:X.settleNavigationResult});async function Q(e){H+=1;try{return await e()}finally{--H}}function ae(e){return O.add(e),()=>{O.delete(e)}}function oe(e){return k.add(e),()=>{k.delete(e)}}function se(e){return A.add(e),()=>{A.delete(e)}}function ce(e){return j.add(e),()=>{j.delete(e)}}let $={nativeRouter:D,options:U,currentRoute:K,install(e){var t;h($);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=$)},resolve:ie,isReady(){return I},push:e=>Q(()=>Z.push(e)),replace:e=>Q(()=>Z.replace(e)),back:e=>Q(()=>Z.back(e)),go:e=>Q(()=>Z.go(e)),forward:()=>Q(()=>Z.forward()),hasRoute:V.hasRoute,getRoutes:V.getRoutes,addRoute:V.addRoute,removeRoute:V.removeRoute,clearRoutes:V.clearRoutes,beforeEach:ae,beforeResolve:oe,afterEach:se,onError:ce};return h($),$}export{b as createRouter};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D}=g,O=v,k=_,A=0;for(;;){var j;let g=E.has(O.path);if(n(O,x.stringifyQuery)===n(y,x.stringifyQuery)&&O.hash!==y.hash)return l(k,y,O,f(O,y));if(g?O.path===y.path:O.fullPath===y.fullPath)return l(k,y,O,d(O,y));if(g&&r(O.query))return l(k,y,O,p(O,y));let _=await c(C,{mode:k,to:O,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(k,y,O,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||t!==k){if(u(e,O),O=e,k=t,A+=1,A>T)return l(k,y,O,m(O,y,T));continue}}let v=t(O,S),M=(j=v==null?void 0:v.matchedRecords)==null?[]:j,N=!1;for(let e of M){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,O,y,D)}catch(e){return l(k,y,O,a(i.aborted,O,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==O.fullPath||n!==k){if(u(r,O),O=r,k=n,A+=1,A>T)return l(k,y,O,m(O,y,T));N=!0;break}}if(N)continue;let P=!1;for(let e of M){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:k,to:O,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(k,y,O,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||n!==k){if(u(e,O),O=e,k=n,A+=1,A>T)return l(k,y,O,m(O,y,T));P=!0;break}}}if(P)continue;let F=await c(w,{mode:k,to:O,from:y,nativeRouter:b},D);if(F.status===`failure`)return l(k,y,O,F.failure);if(F.status===`redirect`){let e=F.target,t=F.replace===!0?`replace`:F.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||t!==k){if(u(e,O),O=e,k=t,A+=1,A>T)return l(k,y,O,m(O,y,T));continue}}if(g){let t=await o(b.switchTab,{url:e(O.path)},O,y);return s(t)?l(k,y,O,t):l(k,y,O)}let I=await o(k===`push`?b.navigateTo:b.redirectTo,{url:n(O,x.stringifyQuery)},O,y);return s(I)?l(k,y,O,I):l(k,y,O)}}export{g as navigateWithTarget};
1
+ import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D}=g,O=v,k=_,A=0;for(;;){var j;let g=E.has(O.path);if(n(O,x.stringifyQuery)===n(y,x.stringifyQuery)&&O.hash!==y.hash)return l(k,y,O,f(O,y));if(g?O.path===y.path:O.fullPath===y.fullPath)return l(k,y,O,d(O,y));if(g&&r(O.query))return l(k,y,O,p(O,y));let _=await c(C,{mode:k,to:O,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(k,y,O,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||t!==k){if(u(e,O),O=e,k=t,A+=1,A>T)return l(k,y,O,m(O,y,T));continue}}let v=t(O,S),M=(j=v==null?void 0:v.matchedRecords)==null?[]:j,N=!1;for(let e of M){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,O,y,D)}catch(e){return l(k,y,O,a(i.aborted,O,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==O.fullPath||n!==k){if(u(r,O),O=r,k=n,A+=1,A>T)return l(k,y,O,m(O,y,T));N=!0;break}}if(N)continue;let P=!1;for(let e of M){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:k,to:O,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(k,y,O,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||n!==k){if(u(e,O),O=e,k=n,A+=1,A>T)return l(k,y,O,m(O,y,T));P=!0;break}}}if(P)continue;let F=await c(w,{mode:k,to:O,from:y,nativeRouter:b},D);if(F.status===`failure`)return l(k,y,O,F.failure);if(F.status===`redirect`){let e=F.target,t=F.replace===!0?`replace`:F.replace===!1?`push`:k;if(e.fullPath!==O.fullPath||t!==k){if(u(e,O),O=e,k=t,A+=1,A>T)return l(k,y,O,m(O,y,T));continue}}if(g){let t=await o(b.switchTab,{url:e(O.path)},O,y);return s(t)?l(k,y,O,t):l(k,y,O)}let I=k===`push`?b.navigateTo:b.redirectTo,L=await o(I,{url:n(O,x.stringifyQuery)},O,y);return s(L)?l(k,y,O,L):l(k,y,O)}}export{g as navigateWithTarget};
@@ -1 +1 @@
1
- import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){var u,d,f,p;if(typeof i==`string`){let t=s(i,l);return o(e(t.path,a),t.query,t.hash,void 0,{},l.stringifyQuery)}let m=typeof i.fullPath==`string`?s(i.fullPath,l):void 0;return o(e((u=(d=i.path)==null?m==null?void 0:m.path:d)==null?a:u,a),i.query?n(i.query):(f=m==null?void 0:m.query)==null?{}:f,t((p=i.hash)==null?m==null?void 0:m.hash:p),typeof i.name==`string`?i.name:void 0,i.params?r(i.params):{},l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
1
+ import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){var u,d,f,p;if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let m=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,h=(u=(d=i.path)==null?m==null?void 0:m.path:d)==null?a:u,g=e(h,a),_=i.query?n(i.query):(f=m==null?void 0:m.query)==null?{}:f,v=t((p=i.hash)==null?m==null?void 0:m.hash:p),y=typeof i.name==`string`?i.name:void 0,b=i.params?r(i.params):{};return o(g,_,v,y,b,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){var n;return e?u(typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,a(t==null?(n=e.options)==null?{}:n:t),``,void 0,{}):u(``,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
1
+ import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){var n;if(!e)return u(``,{});let r=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,i=t==null?(n=e.options)==null?{}:n:t;return u(r,a(i),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);!r||r===t||i.includes(r)||i.push(r)}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){r(`ignored route record "${typeof(_==null?void 0:_.name)==`string`?_.name.trim():``}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
1
+ import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);!r||r===t||i.includes(r)||i.push(r)}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof(_==null?void 0:_.name)==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
@@ -1 +1 @@
1
- import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{addMutationRecorder as r,removeMutationRecorder as ee}from"../../reactivity/reactive/mutation.mjs";import{toRaw as te}from"../../reactivity/reactive/shared.mjs";import{clearPatchIndices as i,prelinkReactiveTree as a,touchReactive as o}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as ne}from"../../reactivity/reactive/shallow.mjs";import{isReactive as s,reactive as c}from"../../reactivity/reactive.mjs";import{watch as l}from"../../reactivity/watch.mjs";import{hasOwn as u}from"../../utils.mjs";import{createBindModel as re}from"../bindModel.mjs";import{hasTrackableSetupBinding as ie,touchSetupBinding as ae}from"../setupTracking.mjs";import{createRuntimeContext as oe}from"./context.mjs";import{createDiagnosticsLogger as d}from"./diagnostics.mjs";import{createSetDataScheduler as se}from"./setData/scheduler.mjs";import{resolveSetDataOptions as ce}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as le,WEVU_PROPS_DERIVED_KEYS_KEY as f,WEVU_PROPS_KEY as p,WEVU_SETUP_STATE_KEY as m}from"@weapp-core/constants";function h(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function g(e){return typeof e==`function`?e():e==null?{}:e}function _(_){let{data:v,resolvedComputed:ue,resolvedMethods:de,appConfig:fe,setDataOptions:pe}=_;return _=>{let y=g(v),b=_==null?void 0:_.__wevu_initialProps;if(y&&typeof y==`object`&&!u(y,p))try{Object.defineProperty(y,p,{value:ne(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let x=y&&typeof y==`object`?y[p]:void 0;x&&typeof x==`object`&&b&&typeof b==`object`&&Object.assign(x,b);let S=c(y),C=c(Object.create(null)),w=_==null?void 0:_.__wevu_snapshotOmitKeys,me=!!(_!=null&&_.__wevu_deferInitialSnapshot),T=_==null?void 0:_.__wevu_initialSnapshot,E=_==null?void 0:_.__wevu_initialState,D=new Set(w instanceof Set||Array.isArray(w)?w:[]);if(y&&typeof y==`object`&&!u(y,m))try{Object.defineProperty(y,m,{value:C,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(y&&typeof y==`object`&&E&&typeof E==`object`)for(let[e,t]of Object.entries(E))D.has(e)||(y[e]=t);let he=ue,ge=de,O=!0,k=[],A=new Set;Object.keys(S).forEach(e=>{let t=S[e];ie(t)&&A.add(e)});let{includeComputed:j,setDataStrategy:M,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:_e,computedCompare:ve,computedCompareMaxDepth:ye,computedCompareMaxKeys:be,prelinkMaxDepth:xe,prelinkMaxKeys:Se,debug:R,diagnostics:z,loopWarning:B,debugWhen:Ce,debugSampleRate:we,elevateTopKeyThreshold:Te,toPlainMaxDepth:Ee,toPlainMaxKeys:De,includeFunctions:Oe,functionPaths:ke,shouldIncludeKey:V}=ce(pe),H=d(z),U=z===`off`&&B?d(`fallback`):void 0,Ae=R||H||U?e=>{typeof R==`function`&&R(e),H==null||H(e),e.reason===`loopWarning`&&(U==null||U(e))}:void 0,je=z===`always`?`always`:Ce,{boundMethods:Me,computedRefs:W,computedSetters:Ne,dirtyComputedKeys:Pe,computedProxy:Fe,publicInstance:G,touchSetupMethodsVersion:K}=oe({state:S,setupState:C,computedDefs:he,methodDefs:ge,appConfig:fe,includeComputed:j,setDataStrategy:M}),q=_==null?{setData:()=>{}}:_,Ie=q.__wevu_targetLabel,J=te(S),Y,X=se({state:S,setupState:C,snapshotOmitKeys:D,computedRefs:W,dirtyComputedKeys:Pe,includeComputed:j,setDataStrategy:M,computedCompare:ve,computedCompareMaxDepth:ye,computedCompareMaxKeys:be,currentAdapter:q,shouldIncludeKey:V,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:_e,elevateTopKeyThreshold:Te,toPlainMaxDepth:Ee,toPlainMaxKeys:De,includeFunctions:Oe,functionPaths:ke,debug:Ae,debugWhen:je,debugSampleRate:we,loopWarning:B,targetLabel:Ie,runTracker:()=>Y==null?void 0:Y(),isMounted:()=>O,initialSnapshot:T&&typeof T==`object`?T:void 0,initialState:E&&typeof E==`object`?E:void 0}),Z=()=>X.job(J),Q=e=>X.mutationRecorder(e,J);Y=t(()=>{o(S);let e=S[p];s(e)&&o(e);let t=S[le];s(t)&&o(t),A.forEach(e=>{var t;ae((t=C[e])==null?S[e]:t)})},{lazy:!0,scheduler:()=>e(Z)}),me||Z(),k.push(h(()=>n(Y))),M===`patch`&&(a(S,{shouldIncludeTopKey:V,maxDepth:xe,maxKeys:Se}),r(Q),k.push(h(()=>ee(Q))),k.push(h(()=>i(S))));function Le(e,t,n){let r=l(e,(e,n)=>t(e,n),n);return k.push(r),h(()=>{r();let e=k.indexOf(r);e>=0&&k.splice(e,1)},r)}let $={get state(){return S},get setupState(){return C},get proxy(){return G},get methods(){return Me},get computed(){return Fe},get adapter(){return q},bindModel:re(G,S,W,Ne,C),watch:Le,snapshot:()=>X.snapshot(),unmount:()=>{O&&(O=!1,k.forEach(e=>{try{e()}catch(e){}}),k.length=0)}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:K,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_touchSetupMethodsVersion=K}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Z,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_flushSetupSnapshotSync=Z}try{Object.defineProperty($,"__wevu_cloneLatestSnapshot",{value:X.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_cloneLatestSnapshot=X.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{A.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_trackSetupReactiveKey=e=>{A.add(e)}}try{Object.defineProperty($,f,{value:D,configurable:!0,enumerable:!1,writable:!1})}catch(e){$[f]=D}return $}}export{_ as createRuntimeMount};
1
+ import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{addMutationRecorder as r,removeMutationRecorder as ee}from"../../reactivity/reactive/mutation.mjs";import{toRaw as te}from"../../reactivity/reactive/shared.mjs";import{clearPatchIndices as i,prelinkReactiveTree as a,touchReactive as o}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as ne}from"../../reactivity/reactive/shallow.mjs";import{isReactive as s,reactive as c}from"../../reactivity/reactive.mjs";import{watch as l}from"../../reactivity/watch.mjs";import{hasOwn as u}from"../../utils.mjs";import{createBindModel as re}from"../bindModel.mjs";import{hasTrackableSetupBinding as ie,touchSetupBinding as ae}from"../setupTracking.mjs";import{createRuntimeContext as oe}from"./context.mjs";import{createDiagnosticsLogger as d}from"./diagnostics.mjs";import{createSetDataScheduler as se}from"./setData/scheduler.mjs";import{resolveSetDataOptions as ce}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as le,WEVU_PROPS_DERIVED_KEYS_KEY as f,WEVU_PROPS_KEY as p,WEVU_SETUP_STATE_KEY as m}from"@weapp-core/constants";function h(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function g(e){return typeof e==`function`?e():e==null?{}:e}function _(_){let{data:v,resolvedComputed:ue,resolvedMethods:de,appConfig:fe,setDataOptions:pe}=_;return _=>{let y=g(v),b=_==null?void 0:_.__wevu_initialProps;if(y&&typeof y==`object`&&!u(y,p))try{Object.defineProperty(y,p,{value:ne(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let x=y&&typeof y==`object`?y[p]:void 0;x&&typeof x==`object`&&b&&typeof b==`object`&&Object.assign(x,b);let S=c(y),C=c(Object.create(null)),w=_==null?void 0:_.__wevu_snapshotOmitKeys,me=!!(_!=null&&_.__wevu_deferInitialSnapshot),T=_==null?void 0:_.__wevu_initialSnapshot,E=_==null?void 0:_.__wevu_initialState,D=new Set(w instanceof Set||Array.isArray(w)?w:[]);if(y&&typeof y==`object`&&!u(y,m))try{Object.defineProperty(y,m,{value:C,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(y&&typeof y==`object`&&E&&typeof E==`object`)for(let[e,t]of Object.entries(E))D.has(e)||(y[e]=t);let he=ue,ge=de,O=!0,k=[],A=new Set;Object.keys(S).forEach(e=>{let t=S[e];ie(t)&&A.add(e)});let{includeComputed:j,setDataStrategy:M,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:_e,computedCompare:ve,computedCompareMaxDepth:ye,computedCompareMaxKeys:be,prelinkMaxDepth:xe,prelinkMaxKeys:Se,debug:R,diagnostics:z,loopWarning:B,debugWhen:Ce,debugSampleRate:we,elevateTopKeyThreshold:Te,toPlainMaxDepth:Ee,toPlainMaxKeys:De,includeFunctions:Oe,functionPaths:ke,shouldIncludeKey:V}=ce(pe),H=d(z),U=z===`off`&&B?d(`fallback`):void 0,Ae=R||H||U?e=>{typeof R==`function`&&R(e),H==null||H(e),e.reason===`loopWarning`&&(U==null||U(e))}:void 0,je=z===`always`?`always`:Ce,{boundMethods:Me,computedRefs:W,computedSetters:Ne,dirtyComputedKeys:Pe,computedProxy:Fe,publicInstance:G,touchSetupMethodsVersion:K}=oe({state:S,setupState:C,computedDefs:he,methodDefs:ge,appConfig:fe,includeComputed:j,setDataStrategy:M}),q=_==null?{setData:()=>{}}:_,Ie=q.__wevu_targetLabel,J=te(S),Y,X=se({state:S,setupState:C,snapshotOmitKeys:D,computedRefs:W,dirtyComputedKeys:Pe,includeComputed:j,setDataStrategy:M,computedCompare:ve,computedCompareMaxDepth:ye,computedCompareMaxKeys:be,currentAdapter:q,shouldIncludeKey:V,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:_e,elevateTopKeyThreshold:Te,toPlainMaxDepth:Ee,toPlainMaxKeys:De,includeFunctions:Oe,functionPaths:ke,debug:Ae,debugWhen:je,debugSampleRate:we,loopWarning:B,targetLabel:Ie,runTracker:()=>Y==null?void 0:Y(),isMounted:()=>O,initialSnapshot:T&&typeof T==`object`?T:void 0,initialState:E&&typeof E==`object`?E:void 0}),Z=()=>X.job(J),Q=e=>X.mutationRecorder(e,J);Y=t(()=>{o(S);let e=S[p];s(e)&&o(e);let t=S[le];s(t)&&o(t),A.forEach(e=>{var t;let n=(t=C[e])==null?S[e]:t;ae(n)})},{lazy:!0,scheduler:()=>e(Z)}),me||Z(),k.push(h(()=>n(Y))),M===`patch`&&(a(S,{shouldIncludeTopKey:V,maxDepth:xe,maxKeys:Se}),r(Q),k.push(h(()=>ee(Q))),k.push(h(()=>i(S))));function Le(e,t,n){let r=l(e,(e,n)=>t(e,n),n);return k.push(r),h(()=>{r();let e=k.indexOf(r);e>=0&&k.splice(e,1)},r)}let $={get state(){return S},get setupState(){return C},get proxy(){return G},get methods(){return Me},get computed(){return Fe},get adapter(){return q},bindModel:re(G,S,W,Ne,C),watch:Le,snapshot:()=>X.snapshot(),unmount:()=>{O&&(O=!1,k.forEach(e=>{try{e()}catch(e){}}),k.length=0)}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:K,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_touchSetupMethodsVersion=K}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Z,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_flushSetupSnapshotSync=Z}try{Object.defineProperty($,"__wevu_cloneLatestSnapshot",{value:X.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_cloneLatestSnapshot=X.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{A.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_trackSetupReactiveKey=e=>{A.add(e)}}try{Object.defineProperty($,f,{value:D,configurable:!0,enumerable:!1,writable:!1})}catch(e){$[f]=D}return $}}export{_ as createRuntimeMount};
@@ -1 +1 @@
1
- import{hasOwn as e}from"../../utils.mjs";import{cloneSnapshotValue as t,isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveDatasetEventValue as r,runInlineExpression as i}from"../register/inline.mjs";import{getOwnerProxy as a,getOwnerSnapshot as o,getOwnerTarget as s,subscribeOwner as c}from"../scopedSlots.mjs";import{clearTemplateRefs as l,scheduleTemplateRefUpdate as u}from"../templateRefs.mjs";import{WEVU_INLINE_HANDLER as d,WEVU_INLINE_MAP_KEY as f,WEVU_OWNER_HANDLER as p,WEVU_PROPS_DERIVED_KEYS_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_SLOT_FUNCTION_TOKEN as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_OWNER_KEY as y,WEVU_SLOT_OWNER_PROXY_KEY as b,WEVU_SLOT_PROPS_DATA_KEY as x,WEVU_SLOT_PROPS_KEY as S,WEVU_SLOT_SCOPE_KEY as C,WEVU_TEMPLATE_REFS_KEY as w}from"@weapp-core/constants";const T=[_,v,b,y,x,S,C],E=/&amp;/g,D=/&quot;/g,O=/&#34;/g,k=/&apos;/g,A=/&#39;/g,j=/&lt;/g,M=/&gt;/g;function N(e){return e.replace(E,`&`).replace(D,`"`).replace(O,`"`).replace(k,`'`).replace(A,`'`).replace(j,`<`).replace(M,`>`)}function P(e){var t,n,i,a;let o=r((t=(n=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:n)==null?{}:t,`wvArgs`,e),s=[];if(Array.isArray(o))s=o;else if(typeof o==`string`)try{s=JSON.parse(o)}catch(e){try{s=JSON.parse(N(o))}catch(e){s=[]}}return Array.isArray(s)||(s=[]),s.map(t=>t===`$event`?e:t)}function F(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function I(e){return Array.isArray(e)&&e[0]===g&&typeof e[1]==`string`}function L(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[d];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function R(e,t){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,I(n)?L(e,n):n]))}function z(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[h])==null?void 0:i.proxy:n)==null?e:t}function B(e,t){if(!t||Object.keys(t).length===0)return;let n=z(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function V(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function H(r,i,a){var o;V(r);let s=B(r,i);if(!s||typeof(r==null?void 0:r.setData)!=`function`)return;let c=e(r,`__wvScopedSlotComputedSnapshot`),l=(o=r.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[r,i]of Object.entries(s))u[r]=t(i),(a!=null&&a.force||!c||!e(l,r)||!n(l[r],i,20,{keys:1e4}))&&(d[r]=i);for(let t of Object.keys(l))e(s,t)||(d[t]=null);r.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&r.setData(d)}function U(r,i){var a,o,s,c;let l=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],u=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],d=F(l),f=F(u),p={...d,...f},m=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,p,20,{keys:1e4}),h=m||!r[x]?R(r,p):r[x];m&&(r.__wvSlotPropsSnapshot=t(p)),r[x]=h;let g=r==null||(c=r.__wevu)==null?void 0:c.state;return g&&typeof g==`object`&&(g[x]=h),{merged:h,snapshot:p,snapshotChanged:m}}function W(e,t,n){let{snapshot:r,snapshotChanged:i}=U(e,n);i&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:r}),i&&H(e,t)}function G(e,t){var n;if(e[b]===t)return!1;e[b]=t;let r=e==null?void 0:e.data;if(r&&typeof r==`object`)try{Object.defineProperty(r,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[b]=t}let i=e==null||(n=e.__wevu)==null?void 0:n.state;return i&&typeof i==`object`&&(i[b]=t),!0}function K(r,i,a,o){var s;let c=G(r,a),{snapshotChanged:l}=U(r),u=i||{},d=!e(r,`__wvOwnerSnapshot`)||!n((s=r.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;r.__wvOwnerSnapshot=t(u),r[y]=u;let e=r==null||(f=r.__wevu)==null?void 0:f.state;e&&typeof e==`object`&&(e[y]=u)}d&&typeof(r==null?void 0:r.setData)==`function`&&r.setData({[y]:u}),(d||c||l)&&H(r,o)}function q(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,G(e,void 0);return}let r=(t,r)=>{K(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=c(t,r));let i=o(t);i&&r(i,a(t))}function J(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[v])==null?e==null||(i=e.properties)==null?void 0:i[_]:n)==null?``:t}function Y(e,t){W(e,t);let n=J(e);n&&q(e,n,t)}function X(){let e={[y]:{},[x]:{}};return Object.defineProperty(e,b,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function Z(e){let t=e==null?void 0:e.computed,n=e==null?void 0:e.templateRefs,a=e=>{let t=J(e);return t?s(t):void 0},o={options:{virtualHost:!0},setData:{omit:T},[m]:T,properties:{[v]:{type:String,value:``,observer(e){q(this,e||``,t)}},[_]:{type:String,value:``,observer(e){q(this,e||``,t)}},[S]:{type:null,value:null,observer(e){W(this,t,{[S]:e})}},[C]:{type:null,value:null,observer(e){W(this,t,{[C]:e})}}},data:X,lifetimes:{attached(){Y(this,t)},ready(){Y(this,t),H(this,t,{force:!0});let e=a(this);e&&u(this,void 0,e)},detached(){let e=a(this);e&&l(this,e),typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,G(this,void 0)}},methods:{[p](e){var t,n,a,o,s;let c=this[b],l=i(c,void 0,e,(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[f]);if(l!==void 0)return l;if(!c)return;let u=r((n=(a=e==null||(o=e.currentTarget)==null?void 0:o.dataset)==null?e==null||(s=e.target)==null?void 0:s.dataset:a)==null?{}:n,`wvHandler`,e);if(typeof u!=`string`||!u)return;let d=c==null?void 0:c[u];if(typeof d!=`function`)return;let p=P(e);return d.apply(c,p)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(o.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(o.methods={...o.methods,[f]:e.inlineMap}),n!=null&&n.length&&(o[w]=n),o}export{Z as createScopedSlotOptions};
1
+ import{hasOwn as e}from"../../utils.mjs";import{cloneSnapshotValue as t,isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveDatasetEventValue as r,runInlineExpression as i}from"../register/inline.mjs";import{getOwnerProxy as a,getOwnerSnapshot as o,getOwnerTarget as s,subscribeOwner as c}from"../scopedSlots.mjs";import{clearTemplateRefs as l,scheduleTemplateRefUpdate as u}from"../templateRefs.mjs";import{WEVU_INLINE_HANDLER as d,WEVU_INLINE_MAP_KEY as f,WEVU_OWNER_HANDLER as p,WEVU_PROPS_DERIVED_KEYS_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_SLOT_FUNCTION_TOKEN as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_OWNER_KEY as y,WEVU_SLOT_OWNER_PROXY_KEY as b,WEVU_SLOT_PROPS_DATA_KEY as x,WEVU_SLOT_PROPS_KEY as S,WEVU_SLOT_SCOPE_KEY as C,WEVU_TEMPLATE_REFS_KEY as w}from"@weapp-core/constants";const T=[_,v,b,y,x,S,C],E=/&amp;/g,D=/&quot;/g,O=/&#34;/g,k=/&apos;/g,A=/&#39;/g,j=/&lt;/g,M=/&gt;/g;function N(e){return e.replace(E,`&`).replace(D,`"`).replace(O,`"`).replace(k,`'`).replace(A,`'`).replace(j,`<`).replace(M,`>`)}function P(e){var t,n,i,a;let o=(t=(n=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:n)==null?{}:t,s=r(o,`wvArgs`,e),c=[];if(Array.isArray(s))c=s;else if(typeof s==`string`)try{c=JSON.parse(s)}catch(e){try{c=JSON.parse(N(s))}catch(e){c=[]}}return Array.isArray(c)||(c=[]),c.map(t=>t===`$event`?e:t)}function F(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function I(e){return Array.isArray(e)&&e[0]===g&&typeof e[1]==`string`}function L(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[d];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function R(e,t){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,I(n)?L(e,n):n]))}function z(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[h])==null?void 0:i.proxy:n)==null?e:t}function B(e,t){if(!t||Object.keys(t).length===0)return;let n=z(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function V(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function H(r,i,a){var o;V(r);let s=B(r,i);if(!s||typeof(r==null?void 0:r.setData)!=`function`)return;let c=e(r,`__wvScopedSlotComputedSnapshot`),l=(o=r.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[r,i]of Object.entries(s))u[r]=t(i),(a!=null&&a.force||!c||!e(l,r)||!n(l[r],i,20,{keys:1e4}))&&(d[r]=i);for(let t of Object.keys(l))e(s,t)||(d[t]=null);r.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&r.setData(d)}function U(r,i){var a,o,s,c;let l=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],u=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],d=F(l),f=F(u),p={...d,...f},m=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,p,20,{keys:1e4}),h=m||!r[x]?R(r,p):r[x];m&&(r.__wvSlotPropsSnapshot=t(p)),r[x]=h;let g=r==null||(c=r.__wevu)==null?void 0:c.state;return g&&typeof g==`object`&&(g[x]=h),{merged:h,snapshot:p,snapshotChanged:m}}function W(e,t,n){let{snapshot:r,snapshotChanged:i}=U(e,n);i&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:r}),i&&H(e,t)}function G(e,t){var n;if(e[b]===t)return!1;e[b]=t;let r=e==null?void 0:e.data;if(r&&typeof r==`object`)try{Object.defineProperty(r,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[b]=t}let i=e==null||(n=e.__wevu)==null?void 0:n.state;return i&&typeof i==`object`&&(i[b]=t),!0}function K(r,i,a,o){var s;let c=G(r,a),{snapshotChanged:l}=U(r),u=i||{},d=!e(r,`__wvOwnerSnapshot`)||!n((s=r.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;r.__wvOwnerSnapshot=t(u),r[y]=u;let e=r==null||(f=r.__wevu)==null?void 0:f.state;e&&typeof e==`object`&&(e[y]=u)}d&&typeof(r==null?void 0:r.setData)==`function`&&r.setData({[y]:u}),(d||c||l)&&H(r,o)}function q(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,G(e,void 0);return}let r=(t,r)=>{K(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=c(t,r));let i=o(t);i&&r(i,a(t))}function J(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[v])==null?e==null||(i=e.properties)==null?void 0:i[_]:n)==null?``:t}function Y(e,t){W(e,t);let n=J(e);n&&q(e,n,t)}function X(){let e={[y]:{},[x]:{}};return Object.defineProperty(e,b,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function Z(e){let t=e==null?void 0:e.computed,n=e==null?void 0:e.templateRefs,a=e=>{let t=J(e);return t?s(t):void 0},o={options:{virtualHost:!0},setData:{omit:T},[m]:T,properties:{[v]:{type:String,value:``,observer(e){q(this,e||``,t)}},[_]:{type:String,value:``,observer(e){q(this,e||``,t)}},[S]:{type:null,value:null,observer(e){W(this,t,{[S]:e})}},[C]:{type:null,value:null,observer(e){W(this,t,{[C]:e})}}},data:X,lifetimes:{attached(){Y(this,t)},ready(){Y(this,t),H(this,t,{force:!0});let e=a(this);e&&u(this,void 0,e)},detached(){let e=a(this);e&&l(this,e),typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,G(this,void 0)}},methods:{[p](e){var t,n,a,o,s;let c=this[b],l=(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[f],u=i(c,void 0,e,l);if(u!==void 0)return u;if(!c)return;let d=(n=(a=e==null||(o=e.currentTarget)==null?void 0:o.dataset)==null?e==null||(s=e.target)==null?void 0:s.dataset:a)==null?{}:n,p=r(d,`wvHandler`,e);if(typeof p!=`string`||!p)return;let m=c==null?void 0:c[p];if(typeof m!=`function`)return;let h=P(e);return m.apply(c,h)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(o.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(o.methods={...o.methods,[f]:e.inlineMap}),n!=null&&n.length&&(o[w]=n),o}export{Z as createScopedSlotOptions};
@@ -1 +1 @@
1
- import{getScopedSlotHostGlobalObject as e}from"./platform.mjs";import{hasOwn as t}from"../utils.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as n,applyWevuComponentDefaults as r}from"./defaults.mjs";import{allocateOwnerId as i}from"./scopedSlots.mjs";import{runSetupFunction as a}from"./register/setup.mjs";import{registerComponent as o}from"./register/component.mjs";import{createApp as s}from"./app.mjs";import{resolveNativeInitialData as c}from"./define/initialComputed.mjs";import{resolveVueComponentOptions as l}from"./define/options.mjs";import{applyOptionsApiProvide as u,resolveOptionsApiInjections as d}from"./define/optionsApi.mjs";import{normalizeProps as f}from"./define/props.mjs";import{createScopedSlotOptions as p}from"./define/scopedSlotOptions.mjs";import{applySetupResult as m}from"./define/setupResult.mjs";import{WEVU_FUNCTION_PROP_PATHS_KEY as h,WEVU_SCOPED_SLOT_CREATOR_KEY as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_SCOPE_KEY as y}from"@weapp-core/constants";let b;function x(){let t=e();if(!t)return;let n=t;b&&n[g]!==b&&(n[g]=b)}function S(e,n){let r={...n==null?{}:n};if(!e||typeof e!=`object`)return r;for(let[n,i]of Object.entries(e))i&&typeof i==`object`&&t(i,`value`)&&(r[n]=i.value);return r}function C(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(_)}function w(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(_)}function T(e){let t=e.properties;return!!(t&&typeof t==`object`&&(v in t||y in t))}function E(e,t){return(t==null?void 0:t.strategy)!==`patch`||!T(e)?t:{...t,strategy:`diff`}}function D(e){x();let{__typeProps:t,data:p,computed:g,methods:v,setData:y,watch:b,setup:T,props:D,inject:O,provide:k,allowFunctionProps:A,...j}=l(r(e)),M=j[h],N=Array.isArray(M)?[...new Set(M.filter(e=>typeof e==`string`&&e.length>0))]:[];delete j[h];let P=E(j,A===!0?{...y==null?{}:y,includeFunctions:!0,functionPaths:N}:A===!1?y:N.length?{...y==null?{}:y,functionPaths:N}:y),F=new Set(N.filter(e=>!e.includes(`.`))),I=f(j,D),L=S(I.properties,v),R=typeof p==`function`?()=>p.call(L):p,z=s({data:R,computed:g,methods:v,setData:P,[n]:`component`}),B=typeof T==`function`||O!=null||k!=null?((e,t)=>{var n,r;let i=(n=(r=t==null?void 0:t.proxy)==null?t==null?void 0:t.instance:r)==null?Object.create(null):n,o=d(O,i);k!=null&&u(k,i);let s=typeof T==`function`?a(T,e,t):void 0,c={...o,...s==null?{}:s};return t&&Object.keys(c).length&&m(t.runtime,t.instance,c,{includeFunctionsInState:A===!0,functionPropPaths:A===!1?void 0:F}),c}):void 0,V=typeof R==`function`?R():R,H=c(w(P)?{...V&&typeof V==`object`?V:{},[_]:C(j,P)?(V==null?void 0:V[_])||i():(V==null?void 0:V[_])||``}:V,g,P),U=H===void 0?I:{...I,data:H},W={data:R,computed:g,methods:v,setData:P,watch:b,setup:B,mpOptions:U};return o(z,v==null?{}:v,b,B,U),{__wevu_runtime:z,__wevu_options:W}}function O(e){var t;x();let{properties:n,props:r,...i}=e;D(f({...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0},r,n))}function k(e){O(p(e))}b=k,x();export{O as createWevuComponent,k as createWevuScopedSlotComponent,D as defineComponent};
1
+ import{getScopedSlotHostGlobalObject as e}from"./platform.mjs";import{hasOwn as t}from"../utils.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as n,applyWevuComponentDefaults as r}from"./defaults.mjs";import{allocateOwnerId as i}from"./scopedSlots.mjs";import{runSetupFunction as a}from"./register/setup.mjs";import{registerComponent as o}from"./register/component.mjs";import{createApp as s}from"./app.mjs";import{resolveNativeInitialData as c}from"./define/initialComputed.mjs";import{resolveVueComponentOptions as l}from"./define/options.mjs";import{applyOptionsApiProvide as u,resolveOptionsApiInjections as d}from"./define/optionsApi.mjs";import{normalizeProps as f}from"./define/props.mjs";import{createScopedSlotOptions as p}from"./define/scopedSlotOptions.mjs";import{applySetupResult as m}from"./define/setupResult.mjs";import{WEVU_FUNCTION_PROP_PATHS_KEY as h,WEVU_SCOPED_SLOT_CREATOR_KEY as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_SCOPE_KEY as y}from"@weapp-core/constants";let b;function x(){let t=e();if(!t)return;let n=t;b&&n[g]!==b&&(n[g]=b)}function S(e,n){let r={...n==null?{}:n};if(!e||typeof e!=`object`)return r;for(let[n,i]of Object.entries(e))i&&typeof i==`object`&&t(i,`value`)&&(r[n]=i.value);return r}function C(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(_)}function w(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(_)}function T(e){let t=e.properties;return!!(t&&typeof t==`object`&&(v in t||y in t))}function E(e,t){return(t==null?void 0:t.strategy)!==`patch`||!T(e)?t:{...t,strategy:`diff`}}function D(e){x();let{__typeProps:t,data:p,computed:g,methods:v,setData:y,watch:b,setup:T,props:D,inject:O,provide:k,allowFunctionProps:A,...j}=l(r(e)),M=j[h],N=Array.isArray(M)?[...new Set(M.filter(e=>typeof e==`string`&&e.length>0))]:[];delete j[h];let P=E(j,A===!0?{...y==null?{}:y,includeFunctions:!0,functionPaths:N}:A===!1?y:N.length?{...y==null?{}:y,functionPaths:N}:y),F=new Set(N.filter(e=>!e.includes(`.`))),I=f(j,D),L=S(I.properties,v),R=typeof p==`function`?()=>p.call(L):p,z=s({data:R,computed:g,methods:v,setData:P,[n]:`component`}),B=typeof T==`function`||O!=null||k!=null?((e,t)=>{var n,r;let i=(n=(r=t==null?void 0:t.proxy)==null?t==null?void 0:t.instance:r)==null?Object.create(null):n,o=d(O,i);k!=null&&u(k,i);let s=typeof T==`function`?a(T,e,t):void 0,c={...o,...s==null?{}:s};return t&&Object.keys(c).length&&m(t.runtime,t.instance,c,{includeFunctionsInState:A===!0,functionPropPaths:A===!1?void 0:F}),c}):void 0,V=typeof R==`function`?R():R,H=w(P)?{...V&&typeof V==`object`?V:{},[_]:C(j,P)?(V==null?void 0:V[_])||i():(V==null?void 0:V[_])||``}:V,U=c(H,g,P),W=U===void 0?I:{...I,data:U},G={data:R,computed:g,methods:v,setData:P,watch:b,setup:B,mpOptions:W};return o(z,v==null?{}:v,b,B,W),{__wevu_runtime:z,__wevu_options:G}}function O(e){var t;x();let{properties:n,props:r,...i}=e,a={...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0};D(f(a,r,n))}function k(e){O(p(e))}b=k,x();export{O as createWevuComponent,k as createWevuScopedSlotComponent,D as defineComponent};
@@ -1 +1 @@
1
- import{getMiniProgramPlatformByRuntimeGlobalKey as e,getMiniProgramRuntimeCapabilities as t,getMiniProgramRuntimeGlobalKey as n,getMiniProgramRuntimeGlobalKeys as r,getMiniProgramRuntimeHostConfigKey as i,resolveMiniProgramPlatform as a,supportsMiniProgramRuntimeCapability as o}from"@weapp-core/shared/platforms";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`];function c(){if(!(typeof globalThis>`u`))return globalThis}function l(){var t;let n=c(),i=a((t=import.meta.env)==null?void 0:t.PLATFORM);if(i)return i;for(let t of r())if(n!=null&&n[t])return e(t)}function u(){return t(l())}function d(e){return o(l(),e)}function f(){if(!d(`globalPageStack`))return[];let e=globalThis.getCurrentPages;if(typeof e!=`function`)return[];try{let t=e();return Array.isArray(t)?t:[]}catch(e){return[]}}function p(){let e=c(),t=i(l()),n=e==null?void 0:e[t];return n&&typeof n==`object`?n:void 0}function m(e){var t;let i=c(),o=a(e==null?(t=import.meta.env)==null?void 0:t.PLATFORM:e);if(o){let e=n(o);return i==null?void 0:i[e]}for(let e of r()){let t=i==null?void 0:i[e];if(t)return t}}function h(){if(!d(`globalRouterApi`))return;let e=m();if(!e)return;let t=Object.create(null);for(let n of s){let r=e[n];if(typeof r!=`function`)return;t[n]=(...t)=>r.apply(e,t)}return t}function g(){var e;return(e=m())==null?c():e}export{h as getCurrentMiniProgramGlobalRouter,p as getCurrentMiniProgramHostConfig,f as getCurrentMiniProgramPages,u as getCurrentMiniProgramRuntimeCapabilities,m as getMiniProgramGlobalObject,g as getScopedSlotHostGlobalObject,l as resolveCurrentMiniProgramPlatform,d as supportsCurrentMiniProgramRuntimeCapability};
1
+ import{getMiniProgramPlatformByRuntimeGlobalKey as e,getMiniProgramRuntimeCapabilities as t,getMiniProgramRuntimeGlobalKey as n,getMiniProgramRuntimeGlobalKeys as r,getMiniProgramRuntimeHostConfigKey as i,resolveMiniProgramPlatform as a,supportsMiniProgramRuntimeCapability as o}from"@weapp-core/shared/platforms";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`];function c(){if(!(typeof globalThis>`u`))return globalThis}function l(){var t;let n=c(),i=(t=import.meta.env)==null?void 0:t.PLATFORM,o=a(i);if(o)return o;for(let t of r())if(n!=null&&n[t])return e(t)}function u(){return t(l())}function d(e){return o(l(),e)}function f(){if(!d(`globalPageStack`))return[];let e=globalThis.getCurrentPages;if(typeof e!=`function`)return[];try{let t=e();return Array.isArray(t)?t:[]}catch(e){return[]}}function p(){let e=c(),t=i(l()),n=e==null?void 0:e[t];return n&&typeof n==`object`?n:void 0}function m(e){var t;let i=c(),o=e==null?(t=import.meta.env)==null?void 0:t.PLATFORM:e,s=a(o);if(s){let e=n(s);return i==null?void 0:i[e]}for(let e of r()){let t=i==null?void 0:i[e];if(t)return t}}function h(){if(!d(`globalRouterApi`))return;let e=m();if(!e)return;let t=Object.create(null);for(let n of s){let r=e[n];if(typeof r!=`function`)return;t[n]=(...t)=>r.apply(e,t)}return t}function g(){var e;return(e=m())==null?c():e}export{h as getCurrentMiniProgramGlobalRouter,p as getCurrentMiniProgramHostConfig,f as getCurrentMiniProgramPages,u as getCurrentMiniProgramRuntimeCapabilities,m as getMiniProgramGlobalObject,g as getScopedSlotHostGlobalObject,l as resolveCurrentMiniProgramPlatform,d as supportsCurrentMiniProgramRuntimeCapability};
@@ -1 +1 @@
1
- import{getMiniProgramGlobalObject as e,supportsCurrentMiniProgramRuntimeCapability as t}from"../platform.mjs";import{callHookList as n}from"../hooks/base.mjs";import{runInlineExpression as r}from"./inline.mjs";import{mountRuntimeInstance as i}from"./runtimeInstance.mjs";import{WEVU_HOOKS_KEY as a,WEVU_INLINE_HANDLER as o,WEVU_INLINE_MAP_KEY as s,WEVU_IS_APP_INSTANCE_KEY as c}from"@weapp-core/constants";const l=`__wevuAppGlobalListeners`,u=`__wevuOnMemoryWarningListener`;function d(r){let i=r[a],o=!!(i!=null&&i.onMemoryWarning);if(!t(`appMemoryWarningListener`)){delete r[u];return}let s=e(),c=s==null?void 0:s.onMemoryWarning,l=s==null?void 0:s.offMemoryWarning;if(typeof c!=`function`)return;let d=r[u];if(typeof d==`function`&&typeof l==`function`)try{l(d)}catch(e){}if(!o){delete r[u];return}let f=e=>{n(r,`onMemoryWarning`,[e])};r[u]=f,c(f)}function f(r,i){var o,s;let{hookName:c,onApiName:u,offApiName:d,capabilityName:f,userHandler:p}=i,m=r[a],h=!!(m!=null&&m[c]),g=(s=(o=r)[l])==null?o[l]=Object.create(null):s,_=g[c];if(!t(f)){delete g[c],delete r[c];return}let v=e(),y=v==null?void 0:v[u],b=v==null?void 0:v[d];if(typeof _==`function`&&typeof b==`function`)try{b(_)}catch(e){}if(!h&&typeof p!=`function`){delete g[c];return}let x=(...e)=>{n(r,c,e),typeof p==`function`&&p.apply(r,e)};r[c]=x,g[c]=x,typeof y==`function`&&y(x)}function p(e,t){f(e,{hookName:`onError`,onApiName:`onError`,offApiName:`offError`,capabilityName:`appErrorListener`,userHandler:t.onError}),f(e,{hookName:`onPageNotFound`,onApiName:`onPageNotFound`,offApiName:`offPageNotFound`,capabilityName:`appPageNotFoundListener`,userHandler:t.onPageNotFound}),f(e,{hookName:`onUnhandledRejection`,onApiName:`onUnhandledRejection`,offApiName:`offUnhandledRejection`,capabilityName:`appUnhandledRejectionListener`,userHandler:t.onUnhandledRejection}),f(e,{hookName:`onThemeChange`,onApiName:`onThemeChange`,offApiName:`offThemeChange`,capabilityName:`appThemeChangeListener`,userHandler:t.onThemeChange})}function m(e,t,a,l,u){var f;if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let m=Object.keys(t==null?{}:t),h={...u};h.globalData=(f=h.globalData)==null?{}:f,h[o]||(h[o]=function(e){var t,n;let i=this.__wevu;return r((t=i==null?void 0:i.proxy)==null?this:t,void 0,e,i==null||(n=i.methods)==null?void 0:n[s])});let g=h.onLaunch,_=h.onError,v=h.onPageNotFound,y=h.onUnhandledRejection,b=h.onThemeChange;h.onLaunch=function(...t){this[c]=!0,i(this,e,a,l),d(this),p(this,{onError:_,onPageNotFound:v,onUnhandledRejection:y,onThemeChange:b}),n(this,`onLaunch`,t),typeof g==`function`&&g.apply(this,t)};let x=h.onShow;h.onShow=function(...e){n(this,`onShow`,e),typeof x==`function`&&x.apply(this,e)};let S=h.onHide;h.onHide=function(...e){n(this,`onHide`,e),typeof S==`function`&&S.apply(this,e)},delete h.onError,delete h.onPageNotFound,delete h.onUnhandledRejection,delete h.onThemeChange;for(let e of m){let t=h[e];h[e]=function(...n){var r;let i=this.__wevu,a,o=i==null||(r=i.methods)==null?void 0:r[e];return o&&(a=o.apply(i.proxy,n)),typeof t==`function`?t.apply(this,n):a}}App(h)}export{m as registerApp};
1
+ import{getMiniProgramGlobalObject as e,supportsCurrentMiniProgramRuntimeCapability as t}from"../platform.mjs";import{callHookList as n}from"../hooks/base.mjs";import{runInlineExpression as r}from"./inline.mjs";import{mountRuntimeInstance as i}from"./runtimeInstance.mjs";import{WEVU_HOOKS_KEY as a,WEVU_INLINE_HANDLER as o,WEVU_INLINE_MAP_KEY as s,WEVU_IS_APP_INSTANCE_KEY as c}from"@weapp-core/constants";const l=`__wevuAppGlobalListeners`,u=`__wevuOnMemoryWarningListener`;function d(r){let i=r[a],o=!!(i!=null&&i.onMemoryWarning);if(!t(`appMemoryWarningListener`)){delete r[u];return}let s=e(),c=s==null?void 0:s.onMemoryWarning,l=s==null?void 0:s.offMemoryWarning;if(typeof c!=`function`)return;let d=r[u];if(typeof d==`function`&&typeof l==`function`)try{l(d)}catch(e){}if(!o){delete r[u];return}let f=e=>{n(r,`onMemoryWarning`,[e])};r[u]=f,c(f)}function f(r,i){var o,s;let{hookName:c,onApiName:u,offApiName:d,capabilityName:f,userHandler:p}=i,m=r[a],h=!!(m!=null&&m[c]),g=(s=(o=r)[l])==null?o[l]=Object.create(null):s,_=g[c];if(!t(f)){delete g[c],delete r[c];return}let v=e(),y=v==null?void 0:v[u],b=v==null?void 0:v[d];if(typeof _==`function`&&typeof b==`function`)try{b(_)}catch(e){}if(!h&&typeof p!=`function`){delete g[c];return}let x=(...e)=>{n(r,c,e),typeof p==`function`&&p.apply(r,e)};r[c]=x,g[c]=x,typeof y==`function`&&y(x)}function p(e,t){f(e,{hookName:`onError`,onApiName:`onError`,offApiName:`offError`,capabilityName:`appErrorListener`,userHandler:t.onError}),f(e,{hookName:`onPageNotFound`,onApiName:`onPageNotFound`,offApiName:`offPageNotFound`,capabilityName:`appPageNotFoundListener`,userHandler:t.onPageNotFound}),f(e,{hookName:`onUnhandledRejection`,onApiName:`onUnhandledRejection`,offApiName:`offUnhandledRejection`,capabilityName:`appUnhandledRejectionListener`,userHandler:t.onUnhandledRejection}),f(e,{hookName:`onThemeChange`,onApiName:`onThemeChange`,offApiName:`offThemeChange`,capabilityName:`appThemeChangeListener`,userHandler:t.onThemeChange})}function m(e,t,a,l,u){var f;if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let m=Object.keys(t==null?{}:t),h={...u};h.globalData=(f=h.globalData)==null?{}:f,h[o]||(h[o]=function(e){var t,n;let i=this.__wevu,a=(t=i==null?void 0:i.proxy)==null?this:t,o=i==null||(n=i.methods)==null?void 0:n[s];return r(a,void 0,e,o)});let g=h.onLaunch,_=h.onError,v=h.onPageNotFound,y=h.onUnhandledRejection,b=h.onThemeChange;h.onLaunch=function(...t){this[c]=!0,i(this,e,a,l),d(this),p(this,{onError:_,onPageNotFound:v,onUnhandledRejection:y,onThemeChange:b}),n(this,`onLaunch`,t),typeof g==`function`&&g.apply(this,t)};let x=h.onShow;h.onShow=function(...e){n(this,`onShow`,e),typeof x==`function`&&x.apply(this,e)};let S=h.onHide;h.onHide=function(...e){n(this,`onHide`,e),typeof S==`function`&&S.apply(this,e)},delete h.onError,delete h.onPageNotFound,delete h.onUnhandledRejection,delete h.onThemeChange;for(let e of m){let t=h[e];h[e]=function(...n){var r;let i=this.__wevu,a,o=i==null||(r=i.methods)==null?void 0:r[e];return o&&(a=o.apply(i.proxy,n)),typeof t==`function`?t.apply(this,n):a}}App(h)}export{m as registerApp};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e,getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../../platform.mjs";import{callHookList as i}from"../../../hooks/base.mjs";import{WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as a}from"@weapp-core/constants";let o=!1,s;function c(){return s}function l(e){s=e}function u(e){s===e&&(s=void 0)}function d(e,t){var n;e[a]=Number((n=e[a])==null?0:n)+1;try{return t()}finally{var r;let t=Number((r=e[a])==null?1:r)-1;t<=0?delete e[a]:e[a]=t}}function f(t){let n=t.options;if(n&&typeof n==`object`)return n;let r=e(),i=r[r.length-1],a=i&&typeof i==`object`?i.options:void 0;return a&&typeof a==`object`?a:{}}function p(){if(o)return;o=!0;let e=n();if(!(!e||typeof e!=`object`)){if(r(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return s&&i(s,`onPullDownRefresh`,[]),n})}if(r(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(s){let t=s;d(t,()=>{i(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function m(e){let{enableOnShareAppMessage:i,enableOnShareTimeline:a}=e;if(!i&&!a||!r(`pageShareMenu`))return;let o=n();if(!o||typeof o.showShareMenu!=`function`)return;let s=t().shareTimelineRequiresShareAppMessage?i||a:i;if(!s&&!a)return;let c=[];s&&c.push(`shareAppMessage`),a&&c.push(`shareTimeline`);let l=[{withShareTicket:!0,menus:c},{menus:c},a?{withShareTicket:!0}:void 0,a?{}:void 0,void 0];for(let e of l)try{e===void 0?o.showShareMenu():o.showShareMenu(e);break}catch(e){}}export{l as bindCurrentPageInstance,p as ensureMiniProgramGlobalPatched,m as ensurePageShareMenus,c as getCurrentPageInstance,u as releaseCurrentPageInstance,f as resolvePageOptions,d as runInPageScrollHook};
1
+ import{getCurrentMiniProgramPages as e,getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../../platform.mjs";import{callHookList as i}from"../../../hooks/base.mjs";import{WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as a}from"@weapp-core/constants";let o=!1,s;function c(){return s}function l(e){s=e}function u(e){s===e&&(s=void 0)}function d(e,t){var n;let r=Number((n=e[a])==null?0:n);e[a]=r+1;try{return t()}finally{var i;let t=Number((i=e[a])==null?1:i)-1;t<=0?delete e[a]:e[a]=t}}function f(t){let n=t.options;if(n&&typeof n==`object`)return n;let r=e(),i=r[r.length-1],a=i&&typeof i==`object`?i.options:void 0;return a&&typeof a==`object`?a:{}}function p(){if(o)return;o=!0;let e=n();if(!(!e||typeof e!=`object`)){if(r(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return s&&i(s,`onPullDownRefresh`,[]),n})}if(r(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(s){let t=s;d(t,()=>{i(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function m(e){let{enableOnShareAppMessage:i,enableOnShareTimeline:a}=e;if(!i&&!a||!r(`pageShareMenu`))return;let o=n();if(!o||typeof o.showShareMenu!=`function`)return;let s=t().shareTimelineRequiresShareAppMessage?i||a:i;if(!s&&!a)return;let c=[];s&&c.push(`shareAppMessage`),a&&c.push(`shareTimeline`);let l=[{withShareTicket:!0,menus:c},{menus:c},a?{withShareTicket:!0}:void 0,a?{}:void 0,void 0];for(let e of l)try{e===void 0?o.showShareMenu():o.showShareMenu(e);break}catch(e){}}export{l as bindCurrentPageInstance,p as ensureMiniProgramGlobalPatched,m as ensurePageShareMenus,c as getCurrentPageInstance,u as releaseCurrentPageInstance,f as resolvePageOptions,d as runInPageScrollHook};
@@ -1 +1 @@
1
- import{parseModelEventValue as e}from"../../internal.mjs";import{runInlineExpression as t}from"../inline.mjs";import{WEVU_INLINE_HANDLER as n,WEVU_INLINE_MAP_KEY as r,WEVU_MODEL_HANDLER as i,WEVU_NATIVE_INSTANCE_KEY as a,WEVU_OWNER_HANDLER as o,WEVU_RESERVED_METHOD_PREFIX as s,WEVU_RUNTIME_KEY as c}from"@weapp-core/constants";function l(l){let{userMethods:u,runtimeMethods:d}=l,f={...u};f[n]||(f[n]=function(e){var n,i;let a=this.__wevu;return t((n=a==null?void 0:a.proxy)==null?this:n,void 0,e,a==null||(i=a.methods)==null?void 0:i[r])}),f[i]||(f[i]=function(t){var n,r,i;let a=(n=t==null||(r=t.currentTarget)==null||(r=r.dataset)==null?void 0:r.wvModel)==null?t==null||(i=t.target)==null||(i=i.dataset)==null?void 0:i.wvModel:n;if(typeof a!=`string`||!a)return;let o=this.__wevu;if(!o||typeof o.bindModel!=`function`)return;let s=e(t);try{o.bindModel(a).update(s)}catch(e){}}),!f[o]&&typeof(d==null?void 0:d[o])==`function`&&(f[o]=d[o]);let p=Object.keys(d==null?{}:d);function m(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[c]}function h(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||!(typeof t.triggerEvent==`function`||typeof t.createSelectorQuery==`function`||typeof t.createIntersectionObserver==`function`||typeof t.setData==`function`))return;let i=e==null?void 0:e.state;if(!(!i||typeof i!=`object`)&&t.$state!==i)try{Object.defineProperty(i,a,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[a]=t}}for(let e of p){if(e===r||e.startsWith(s))continue;let t=f[e];f[e]=function(...n){var r;let i=m(this);h(i,this);let a,o=i==null||(r=i.methods)==null?void 0:r[e];if(o&&(a=o.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?a:e}return a}}return{finalMethods:f}}export{l as createComponentMethods};
1
+ import{parseModelEventValue as e}from"../../internal.mjs";import{runInlineExpression as t}from"../inline.mjs";import{WEVU_INLINE_HANDLER as n,WEVU_INLINE_MAP_KEY as r,WEVU_MODEL_HANDLER as i,WEVU_NATIVE_INSTANCE_KEY as a,WEVU_OWNER_HANDLER as o,WEVU_RESERVED_METHOD_PREFIX as s,WEVU_RUNTIME_KEY as c}from"@weapp-core/constants";function l(l){let{userMethods:u,runtimeMethods:d}=l,f={...u};f[n]||(f[n]=function(e){var n,i;let a=this.__wevu,o=(n=a==null?void 0:a.proxy)==null?this:n,s=a==null||(i=a.methods)==null?void 0:i[r];return t(o,void 0,e,s)}),f[i]||(f[i]=function(t){var n,r,i;let a=(n=t==null||(r=t.currentTarget)==null||(r=r.dataset)==null?void 0:r.wvModel)==null?t==null||(i=t.target)==null||(i=i.dataset)==null?void 0:i.wvModel:n;if(typeof a!=`string`||!a)return;let o=this.__wevu;if(!o||typeof o.bindModel!=`function`)return;let s=e(t);try{o.bindModel(a).update(s)}catch(e){}}),!f[o]&&typeof(d==null?void 0:d[o])==`function`&&(f[o]=d[o]);let p=Object.keys(d==null?{}:d);function m(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[c]}function h(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||typeof t.triggerEvent!=`function`&&typeof t.createSelectorQuery!=`function`&&typeof t.createIntersectionObserver!=`function`&&typeof t.setData!=`function`)return;let i=e==null?void 0:e.state;if(!(!i||typeof i!=`object`)&&t.$state!==i)try{Object.defineProperty(i,a,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[a]=t}}for(let e of p){if(e===r||e.startsWith(s))continue;let t=f[e];f[e]=function(...n){var r;let i=m(this);h(i,this);let a,o=i==null||(r=i.methods)==null?void 0:r[e];if(o&&(a=o.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?a:e}return a}}return{finalMethods:f}}export{l as createComponentMethods};
@@ -1 +1 @@
1
- import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{refreshOwnerSnapshotFromInstance as n}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as r,WEVU_PENDING_PROP_VALUES_KEY as i,WEVU_PROPS_DERIVED_KEYS_KEY as a,WEVU_PROPS_KEY as o,WEVU_PROP_KEYS_KEY as s,WEVU_SLOT_NAMES_PROP as c,WEVU_SLOT_OWNER_ID_PROP as l,WEVU_SLOT_SCOPE_KEY as u}from"@weapp-core/constants";function d(d){let{restOptions:f,propsAliases:p,propsDerivedKeys:m,userObservers:h}=d,g=f.properties&&typeof f.properties==`object`?Object.keys(f.properties):[],_=new Set(g),v=new Set(m==null?[]:m),y=Object.entries(p==null?{}:p).filter(([e,t])=>e&&t),b=new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=new WeakMap,C=e=>e.startsWith(`__wv_`),w=e=>{let t=e.__wevu,n=t==null?void 0:t[a];if(n instanceof Set)for(let e of x)n.add(e)},T=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),E=(n,r,i)=>b.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:T(n,r,i),D=(e,t,n)=>{var r;if(!b.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&E(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=E(r,t,n))}catch(e){}if(!(!i||typeof e.setData!=`function`))try{e.setData({[t]:n})}catch(e){}},O=(t,n)=>{var r;if(!y.length)return;let i=t.__wevu,a=i==null?void 0:i.setupState,o=i==null?void 0:i.state;if(!a||typeof a!=`object`)return;w(t);let s=(r=S.get(t))==null?new Set:r;S.set(t,s);for(let[t,r]of y){if(e(a,t)&&!s.has(t))continue;let i=n[r];try{T(a,t,i),s.add(t)}catch(e){}if(o&&typeof o==`object`&&(!e(o,t)||s.has(t)))try{T(o,t,i)}catch(e){}}},k=(t,n)=>{if(!v.size)return;let r=t.__wevu,i=r==null?void 0:r.setupState;if(!i||typeof i!=`object`)return;w(t);let a=new Map(y);for(let t of v){var o;let r=(o=a.get(t))==null?t:o;if(e(n,r))try{T(i,t,n[r])}catch(e){}}},A=e=>{try{Object.defineProperty(e,s,{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[s]=g}},j=t=>{let i=t[r];if(!i||typeof i!=`object`)return;let a=n=>{var r;let i=(r=t.__wevu)==null?void 0:r.state;return typeof i==`object`&&!!i&&e(i,n)},o=t.properties,s=o&&typeof o==`object`?o:void 0,c=Object.keys(i);for(let t of c)if(!s||!e(s,t)||C(t)||_.has(t)||a(t))try{delete i[t]}catch(e){}if(!s){n(t);return}for(let[e,t]of Object.entries(s))if(!(C(e)||_.has(e)||a(e)))try{i[e]=t}catch(e){}n(t)},M=t=>{let r=t[o],a=t.properties,s=t[i];if(r&&typeof r==`object`&&a&&typeof a==`object`){let i=a,o=Object.keys(r);for(let t of o)if(!_.has(t)||!e(i,t))try{delete r[t]}catch(e){}for(let n of g){let a=s&&e(s,n);if(!a&&!e(i,n))continue;let o=a?s[n]:i[n];try{E(r,n,o)}catch(e){}D(t,n,o)}k(t,r),O(t,r),n(t)}s&&delete t[i],j(t)},N=(t,r)=>{if(!r||typeof r!=`object`)return;let i=t[o];if(!i||typeof i!=`object`)return;let a=!1;for(let n of g)if(e(r,n)){try{a=E(i,n,r[n])||a}catch(e){}D(t,n,r[n])}a&&(k(t,i),O(t,i),n(t),j(t))},P=(e,t,r)=>{var a,s;let c=e[o];if(!c||typeof c!=`object`)return;try{if(!E(c,t,r)){D(e,t,r);return}}catch(e){}D(e,t,r);let l=(s=(a=e)[i])==null?a[i]=Object.create(null):s;l[t]=r,k(e,c),O(e,c),n(e),j(e)},F={};if(g.length)for(let e of g)F[e]=function(t){P(this,e,t)};let I={...h==null?{}:h};for(let[e,t]of Object.entries(F)){let n=I[e];typeof n==`function`?I[e]=function(...e){n.apply(this,e),t.apply(this,e)}:I[e]=t}let L=I[`**`];return I[`**`]=function(...e){typeof L==`function`&&L.apply(this,e),M(this)},{attachWevuPropKeys:A,directPropsDerivedKeys:x,syncWevuPropsFromInstance:M,syncWevuPropsFromValues:N,finalObservers:I}}export{d as createPropsSync};
1
+ import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{refreshOwnerSnapshotFromInstance as n}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as r,WEVU_PENDING_PROP_VALUES_KEY as i,WEVU_PROPS_DERIVED_KEYS_KEY as a,WEVU_PROPS_KEY as o,WEVU_PROP_KEYS_KEY as s,WEVU_SLOT_NAMES_PROP as c,WEVU_SLOT_OWNER_ID_PROP as l,WEVU_SLOT_SCOPE_KEY as u}from"@weapp-core/constants";function d(d){let{restOptions:f,propsAliases:p,propsDerivedKeys:m,userObservers:h}=d,g=f.properties&&typeof f.properties==`object`?Object.keys(f.properties):[],_=new Set(g),v=new Set(m==null?[]:m),y=Object.entries(p==null?{}:p).filter(([e,t])=>e&&t),b=new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=new WeakMap,C=e=>e.startsWith(`__wv_`),w=e=>{let t=e.__wevu,n=t==null?void 0:t[a];if(n instanceof Set)for(let e of x)n.add(e)},T=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),E=(n,r,i)=>b.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:T(n,r,i),D=(e,t,n)=>{var r;if(!b.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&E(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=E(r,t,n))}catch(e){}if(!(!i||typeof e.setData!=`function`))try{e.setData({[t]:n})}catch(e){}},O=(t,n)=>{var r;if(!y.length)return;let i=t.__wevu,a=i==null?void 0:i.setupState,o=i==null?void 0:i.state;if(!a||typeof a!=`object`)return;w(t);let s=(r=S.get(t))==null?new Set:r;S.set(t,s);for(let[t,r]of y){if(e(a,t)&&!s.has(t))continue;let i=n[r];try{T(a,t,i),s.add(t)}catch(e){}if(o&&typeof o==`object`&&(!e(o,t)||s.has(t)))try{T(o,t,i)}catch(e){}}},k=(t,n)=>{if(!v.size)return;let r=t.__wevu,i=r==null?void 0:r.setupState;if(!i||typeof i!=`object`)return;w(t);let a=new Map(y);for(let t of v){var o;let r=(o=a.get(t))==null?t:o;if(e(n,r))try{T(i,t,n[r])}catch(e){}}},A=e=>{try{Object.defineProperty(e,s,{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[s]=g}},j=t=>{let i=t[r];if(!i||typeof i!=`object`)return;let a=n=>{var r;let i=(r=t.__wevu)==null?void 0:r.state;return typeof i==`object`&&!!i&&e(i,n)},o=t.properties,s=o&&typeof o==`object`?o:void 0,c=Object.keys(i);for(let t of c)if(!s||!e(s,t)||C(t)||_.has(t)||a(t))try{delete i[t]}catch(e){}if(!s){n(t);return}for(let[e,t]of Object.entries(s))if(!(C(e)||_.has(e)||a(e)))try{i[e]=t}catch(e){}n(t)},M=t=>{let r=t[o],a=t.properties,s=t[i];if(r&&typeof r==`object`&&a&&typeof a==`object`){let i=a,o=Object.keys(r);for(let t of o)if(!_.has(t)||!e(i,t))try{delete r[t]}catch(e){}for(let n of g){let a=s&&e(s,n);if(!a&&!e(i,n))continue;let o=a?s[n]:i[n];try{E(r,n,o)}catch(e){}D(t,n,o)}k(t,r),O(t,r),n(t)}s&&delete t[i],j(t)},N=(t,r)=>{if(!r||typeof r!=`object`)return;let i=t[o];if(!i||typeof i!=`object`)return;let a=!1;for(let n of g)if(e(r,n)){try{a=E(i,n,r[n])||a}catch(e){}D(t,n,r[n])}a&&(k(t,i),O(t,i),n(t),j(t))},P=(e,t,r)=>{var a,s;let c=e[o];if(!c||typeof c!=`object`)return;try{if(!E(c,t,r)){D(e,t,r);return}}catch(e){}D(e,t,r);let l=(s=(a=e)[i])==null?a[i]=Object.create(null):s;l[t]=r,k(e,c),O(e,c),n(e),j(e)},F={};if(g.length)for(let e of g)F[e]=function(t){P(this,e,t)};let I={...h==null?{}:h};for(let[e,t]of Object.entries(F)){let n=I[e];I[e]=typeof n==`function`?function(...e){n.apply(this,e),t.apply(this,e)}:t}let L=I[`**`];return I[`**`]=function(...e){typeof L==`function`&&L.apply(this,e),M(this)},{attachWevuPropKeys:A,directPropsDerivedKeys:x,syncWevuPropsFromInstance:M,syncWevuPropsFromValues:N,finalObservers:I}}export{d as createPropsSync};