wevu 6.20.3 → 6.20.5

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 (39) hide show
  1. package/dist/dev/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/defineProperty.mjs +1 -1
  2. package/dist/dev/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPrimitive.mjs +1 -1
  3. package/dist/dev/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPropertyKey.mjs +1 -1
  4. package/dist/dev/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/typeof.mjs +1 -1
  5. package/dist/dev/internal-runtime.mjs +3 -3
  6. package/dist/dev/package.mjs +1 -1
  7. package/dist/dev/reactivity/core.mjs +1 -1
  8. package/dist/dev/reactivity/ref.mjs +1 -1
  9. package/dist/dev/runtime/app/context.mjs +4 -0
  10. package/dist/dev/runtime/app/context.mjs.map +1 -1
  11. package/dist/dev/runtime/define/scopedSlotOptions.mjs +40 -1
  12. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  13. package/dist/dev/runtime/define.mjs +28 -4
  14. package/dist/dev/runtime/define.mjs.map +1 -1
  15. package/dist/dev/runtime/register/component/registerDefinition.mjs +6 -2
  16. package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
  17. package/dist/dev/runtime/register/component.mjs +4 -3
  18. package/dist/dev/runtime/register/component.mjs.map +1 -1
  19. package/dist/index.d.mts +1 -1
  20. package/dist/internal-runtime.d.mts +3 -3
  21. package/dist/internal-runtime.mjs +1 -1
  22. package/dist/package.mjs +1 -1
  23. package/dist/reactivity/core.mjs +1 -1
  24. package/dist/reactivity/ref.mjs +1 -1
  25. package/dist/runtime/app/context.mjs +1 -1
  26. package/dist/runtime/defaults.d.mts +2 -1
  27. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  28. package/dist/runtime/define.d.mts +15 -1
  29. package/dist/runtime/define.mjs +1 -1
  30. package/dist/runtime/index.d.mts +1 -1
  31. package/dist/runtime/register/component/registerDefinition.mjs +1 -1
  32. package/dist/runtime/register/component.d.mts +3 -1
  33. package/dist/runtime/register/component.mjs +1 -1
  34. package/dist/vue-demi.d.mts +1 -1
  35. package/package.json +2 -2
  36. /package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/defineProperty.mjs +0 -0
  37. /package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPrimitive.mjs +0 -0
  38. /package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPropertyKey.mjs +0 -0
  39. /package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/typeof.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"registerDefinition.mjs","names":[],"sources":["../../../../../src/runtime/register/component/registerDefinition.ts"],"sourcesContent":["import type { LayoutHostBinding } from '../../layoutBridge'\nimport type { TemplateRefBinding } from '../../templateRefs'\nimport type {\n ComponentPropsOptions,\n ComputedDefinitions,\n DefineComponentOptions,\n InternalRuntimeState,\n MethodDefinitions,\n RuntimeApp,\n} from '../../types'\nimport type { WatchMap } from '../watch'\nimport {\n WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY,\n WEVU_LAYOUT_HOST_BRIDGE_KEY,\n WEVU_PAGE_LAYOUT_NAME_KEY,\n WEVU_PAGE_LAYOUT_PROPS_KEY,\n WEVU_PAGE_LAYOUT_SETTER_KEY,\n WEVU_PUBLIC_RUNTIME_KEY,\n WEVU_READY_CALLED_KEY,\n WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD,\n WEVU_RUNTIME_KEY,\n WEVU_RUNTIME_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_TEMPLATE_REFS_KEY,\n} from '@weapp-core/constants'\nimport { callHookList } from '../../hooks'\nimport { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from '../../layoutBridge'\nimport { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from '../../pageLayout'\nimport { getMiniProgramRuntimeGlobalObject } from '../../platform'\nimport { getOwnerProxy } from '../../scopedSlots'\nimport { clearTemplateRefs, scheduleTemplateRefUpdate } from '../../templateRefs'\nimport { enableDeferredSetData, mountRuntimeInstance, refreshRuntimeInstance, setRuntimeSetDataVisibility, teardownRuntimeInstance } from '../runtimeInstance'\nimport { registerNativeComponentDefinition } from './registerNativeDefinition'\n\nfunction scheduleOwnerTemplateRefUpdate(target: InternalRuntimeState) {\n const selectOwnerComponent = (target as any).selectOwnerComponent\n if (typeof selectOwnerComponent !== 'function') {\n return\n }\n try {\n const owner = selectOwnerComponent.call(target) as InternalRuntimeState | null | undefined\n if (owner && owner !== target) {\n scheduleTemplateRefUpdate(owner)\n }\n }\n catch {\n // 宿主不支持 owner 查询时保持当前组件生命周期正常执行。\n }\n}\n\nexport function registerComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: {\n runtimeApp: RuntimeApp<D, C, M>\n watch: WatchMap | undefined\n setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup']\n restOptions: Record<string, any>\n pageLifecycleHooks: Record<string, any>\n finalObservers: Record<string, any>\n userLifetimes: Record<string, any>\n userPageLifetimes: Record<string, any>\n finalMethods: Record<string, (...args: any[]) => any>\n finalOptions: Record<string, any>\n applyExtraInstanceFields: (instance: InternalRuntimeState) => void\n templateRefs: TemplateRefBinding[] | undefined\n layoutHosts: LayoutHostBinding[] | undefined\n attachWevuPropKeys: (instance: InternalRuntimeState) => void\n setupLifecycle: 'created' | 'attached'\n syncWevuPropsFromInstance: (instance: InternalRuntimeState) => void\n syncWevuPropsFromValues: (instance: InternalRuntimeState, values: Record<string, unknown> | undefined) => void\n directPropsDerivedKeys: string[]\n isPage: boolean\n vueLifecycles: Record<string, unknown>\n getRuntimeOwnerLabel: (instance: InternalRuntimeState) => string\n}) {\n const {\n runtimeApp,\n watch,\n setup,\n restOptions,\n pageLifecycleHooks,\n finalObservers,\n userLifetimes,\n userPageLifetimes,\n finalMethods,\n finalOptions,\n applyExtraInstanceFields,\n templateRefs,\n layoutHosts,\n attachWevuPropKeys,\n setupLifecycle,\n syncWevuPropsFromInstance,\n directPropsDerivedKeys,\n isPage,\n vueLifecycles,\n getRuntimeOwnerLabel,\n } = options\n\n const resolveRuntime = (instance: InternalRuntimeState) => {\n const directRuntime = (instance as any).__wevu ?? (instance as any)[WEVU_PUBLIC_RUNTIME_KEY]\n if (directRuntime) {\n return directRuntime\n }\n const runtimeState = (instance as any).$state\n if (runtimeState && typeof runtimeState === 'object') {\n return (runtimeState as any)[WEVU_RUNTIME_KEY]\n }\n return undefined\n }\n\n const resolveLifecycleOwnerId = (instance: InternalRuntimeState) => (instance as any)[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? (instance as any)[WEVU_SLOT_OWNER_ID_KEY]\n ?? (instance as any).data?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? (instance as any).properties?.[WEVU_SLOT_OWNER_ID_KEY]\n\n const resolveLifecycleContext = (instance: InternalRuntimeState) => {\n const runtimeProxy = resolveRuntime(instance)?.proxy\n if (runtimeProxy) {\n return runtimeProxy\n }\n const ownerId = resolveLifecycleOwnerId(instance)\n if (typeof ownerId === 'string' && ownerId) {\n return getOwnerProxy(ownerId) ?? instance\n }\n return instance\n }\n\n const mountMissingRuntime = (instance: InternalRuntimeState) => {\n const existing = resolveRuntime(instance)\n if (existing) {\n return { runtime: existing, mounted: false }\n }\n applyExtraInstanceFields(instance)\n attachWevuPropKeys(instance)\n mountRuntimeInstance(instance, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n syncWevuPropsFromInstance(instance)\n enableDeferredSetData(instance)\n return { runtime: resolveRuntime(instance), mounted: true }\n }\n\n const callVueLifecycle = (instance: InternalRuntimeState, name: string, args: any[]) => {\n const hook = vueLifecycles[name]\n if (typeof hook === 'function') {\n return hook.apply(resolveLifecycleContext(instance), args)\n }\n return undefined\n }\n\n const ensureReadyRuntime = (instance: InternalRuntimeState) => {\n if (resolveRuntime(instance) || typeof vueLifecycles.mounted !== 'function') {\n return\n }\n const result = mountMissingRuntime(instance)\n if (result.mounted) {\n callVueLifecycle(instance, 'created', [])\n callVueLifecycle(instance, 'beforeMount', [])\n }\n }\n\n const pageMethodBridges: Record<string, (...args: any[]) => any> = {}\n const attachRuntimeLayoutHosts = (instance: InternalRuntimeState) => {\n if (!Array.isArray(layoutHosts) || !layoutHosts.length) {\n return\n }\n if ((instance as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n return\n }\n const bridge = registerRuntimeLayoutHosts(layoutHosts, instance)\n if (bridge) {\n instance[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge\n }\n }\n const attachPageLayoutSetter = (instance: InternalRuntimeState) => {\n if (!isPage) {\n return\n }\n instance[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout: string | false, props?: Record<string, any>) => {\n const runtimeState = instance.__wevu?.state as Record<string, any> | undefined\n if (!runtimeState || typeof runtimeState !== 'object') {\n return\n }\n runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout)\n const nextProps = layout === false ? {} : (props ?? {})\n runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps\n syncRuntimePageLayoutState(instance as Record<string, any>, layout, nextProps)\n }\n }\n if (isPage) {\n const methodBridgeHookNames = ['onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onShareTimeline', 'onAddToFavorites']\n for (const hookName of methodBridgeHookNames) {\n const pageHook = (pageLifecycleHooks as any)[hookName]\n if (typeof pageHook !== 'function') {\n continue\n }\n if (typeof (finalMethods as any)[hookName] === 'function') {\n continue\n }\n pageMethodBridges[hookName] = function pageMethodBridge(this: InternalRuntimeState, ...args: any[]) {\n return pageHook.apply(this, args)\n }\n }\n }\n\n const componentDefinition = {\n ...restOptions,\n ...(isPage ? pageLifecycleHooks : {}),\n observers: finalObservers,\n lifetimes: {\n ...userLifetimes,\n created: function created(this: InternalRuntimeState, ...args: any[]) {\n callVueLifecycle(this, 'beforeCreate', args)\n applyExtraInstanceFields(this)\n if (Array.isArray(templateRefs) && templateRefs.length) {\n Object.defineProperty(this, WEVU_TEMPLATE_REFS_KEY, {\n value: templateRefs,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n attachWevuPropKeys(this)\n if (setupLifecycle === 'created') {\n try {\n mountRuntimeInstance(this, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n }\n catch (error) {\n const label = getRuntimeOwnerLabel(this)\n throw new Error(`[wevu] mount runtime failed in created (${label}): ${error instanceof Error ? error.message : String(error)}`)\n }\n syncWevuPropsFromInstance(this)\n attachPageLayoutSetter(this)\n }\n if (typeof (userLifetimes as any).created === 'function') {\n ;(userLifetimes as any).created.apply(this, args)\n }\n },\n moved: function moved(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, 'onMoved', args)\n if (typeof (userLifetimes as any).moved === 'function') {\n ;(userLifetimes as any).moved.apply(this, args)\n }\n },\n attached: function attached(this: InternalRuntimeState, ...args: any[]) {\n applyExtraInstanceFields(this)\n if (Array.isArray(templateRefs) && templateRefs.length && !(this as any)[WEVU_TEMPLATE_REFS_KEY]) {\n Object.defineProperty(this, WEVU_TEMPLATE_REFS_KEY, {\n value: templateRefs,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n attachWevuPropKeys(this)\n if (setupLifecycle !== 'created' || !(this as any).__wevu) {\n try {\n mountRuntimeInstance(this, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n }\n catch (error) {\n const label = getRuntimeOwnerLabel(this)\n throw new Error(`[wevu] mount runtime failed in attached (${label}): ${error instanceof Error ? error.message : String(error)}`)\n }\n }\n syncWevuPropsFromInstance(this)\n callVueLifecycle(this, 'created', args)\n callVueLifecycle(this, 'beforeMount', args)\n attachPageLayoutSetter(this)\n attachRuntimeLayoutHosts(this)\n enableDeferredSetData(this)\n callHookList(this, 'onAttached', args)\n if (typeof (userLifetimes as any).attached === 'function') {\n ;(userLifetimes as any).attached.apply(this, args)\n }\n },\n ready: function ready(this: InternalRuntimeState, ...args: any[]) {\n ensureReadyRuntime(this)\n if (isPage && typeof (pageLifecycleHooks as any).onReady === 'function') {\n const wasReadyCalled = Boolean((this as any)[WEVU_READY_CALLED_KEY])\n ;(pageLifecycleHooks as any).onReady.call(this, ...args)\n if (!wasReadyCalled) {\n callVueLifecycle(this, 'mounted', args)\n }\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n return\n }\n if (!(this as any)[WEVU_READY_CALLED_KEY]) {\n ;(this as any)[WEVU_READY_CALLED_KEY] = true\n syncWevuPropsFromInstance(this)\n scheduleOwnerTemplateRefUpdate(this)\n scheduleTemplateRefUpdate(this, () => {\n callHookList(this, 'onReady', args)\n callVueLifecycle(this, 'mounted', args)\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n })\n return\n }\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n },\n detached: function detached(this: InternalRuntimeState, ...args: any[]) {\n callVueLifecycle(this, 'beforeUnmount', args)\n callVueLifecycle(this, 'beforeDestroy', args)\n scheduleOwnerTemplateRefUpdate(this)\n callHookList(this, 'onDetached', args)\n if (isPage && typeof (pageLifecycleHooks as any).onUnload === 'function') {\n ;(pageLifecycleHooks as any).onUnload.call(this, ...args)\n if (typeof (userLifetimes as any).detached === 'function') {\n ;(userLifetimes as any).detached.apply(this, args)\n }\n callVueLifecycle(this, 'unmounted', args)\n callVueLifecycle(this, 'destroyed', args)\n return\n }\n clearTemplateRefs(this)\n if (Array.isArray(layoutHosts) && layoutHosts.length && (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n unregisterRuntimeLayoutHosts(layoutHosts, (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY])\n delete (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n }\n teardownRuntimeInstance(this)\n callVueLifecycle(this, 'unmounted', args)\n callVueLifecycle(this, 'destroyed', args)\n if (typeof (userLifetimes as any).detached === 'function') {\n ;(userLifetimes as any).detached.apply(this, args)\n }\n },\n error: function error(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, 'onError', args)\n if (typeof (userLifetimes as any).error === 'function') {\n ;(userLifetimes as any).error.apply(this, args)\n }\n },\n },\n pageLifetimes: {\n ...userPageLifetimes,\n show: function show(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onShow === 'function') {\n ;(pageLifecycleHooks as any).onShow.call(this, ...args)\n if (typeof (userPageLifetimes as any).show === 'function') {\n ;(userPageLifetimes as any).show.apply(this, args)\n }\n return\n }\n setRuntimeSetDataVisibility(this, true)\n callHookList(this, 'onShow', args)\n if (typeof (userPageLifetimes as any).show === 'function') {\n ;(userPageLifetimes as any).show.apply(this, args)\n }\n },\n hide: function hide(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onHide === 'function') {\n ;(pageLifecycleHooks as any).onHide.call(this, ...args)\n if (typeof (userPageLifetimes as any).hide === 'function') {\n ;(userPageLifetimes as any).hide.apply(this, args)\n }\n return\n }\n setRuntimeSetDataVisibility(this, false)\n callHookList(this, 'onHide', args)\n if (typeof (userPageLifetimes as any).hide === 'function') {\n ;(userPageLifetimes as any).hide.apply(this, args)\n }\n },\n resize: function resize(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onResize === 'function') {\n ;(pageLifecycleHooks as any).onResize.call(this, ...args)\n if (typeof (userPageLifetimes as any).resize === 'function') {\n ;(userPageLifetimes as any).resize.apply(this, args)\n }\n return\n }\n callHookList(this, 'onResize', args)\n if (typeof (userPageLifetimes as any).resize === 'function') {\n ;(userPageLifetimes as any).resize.apply(this, args)\n }\n },\n routeDone: function routeDone(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onRouteDone === 'function') {\n ;(pageLifecycleHooks as any).onRouteDone.call(this, ...args)\n if (typeof (userPageLifetimes as any).routeDone === 'function') {\n ;(userPageLifetimes as any).routeDone.apply(this, args)\n }\n return\n }\n callHookList(this, 'onRouteDone', args)\n if (typeof (userPageLifetimes as any).routeDone === 'function') {\n ;(userPageLifetimes as any).routeDone.apply(this, args)\n }\n },\n },\n methods: {\n ...pageMethodBridges,\n ...finalMethods,\n [WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD]: function resolvePublicInstance(this: InternalRuntimeState) {\n const result = mountMissingRuntime(this)\n if (result.mounted) {\n callVueLifecycle(this, 'created', [])\n callVueLifecycle(this, 'beforeMount', [])\n }\n return result.runtime?.proxy\n },\n },\n options: finalOptions,\n }\n const statefulHmrBridge = getMiniProgramRuntimeGlobalObject()?.[WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY]\n if (typeof statefulHmrBridge?.trackWevuComponent === 'function') {\n const definition = statefulHmrBridge.trackWevuComponent(componentDefinition, (\n instance: InternalRuntimeState,\n stateSnapshot?: Record<string, any>,\n ) => {\n refreshRuntimeInstance(instance, runtimeApp, watch, setup, {\n snapshotOmitKeys: directPropsDerivedKeys,\n stateSnapshot,\n })\n syncWevuPropsFromInstance(instance)\n attachPageLayoutSetter(instance)\n attachRuntimeLayoutHosts(instance)\n enableDeferredSetData(instance, { rehydrateSetupState: true })\n })\n if (!statefulHmrBridge.isApplying()) {\n registerNativeComponentDefinition(definition, isPage)\n }\n }\n else {\n registerNativeComponentDefinition(componentDefinition, isPage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FAAI;CAChE,IAAI,8EAAO,kBAAmB,wBAAuB,YAAY;EAC/D,MAAM,aAAa,kBAAkB,mBAAmB,sBACtD,UACA,kBACG;GACH,uBAAuB,UAAU,YAAY,OAAO,OAAO;IACzD,kBAAkB;IAClB;GACF,CAAC;GACD,0BAA0B,QAAQ;GAClC,uBAAuB,QAAQ;GAC/B,yBAAyB,QAAQ;GACjC,sBAAsB,UAAU,EAAE,qBAAqB,KAAK,CAAC;EAC/D,CAAC;EACD,IAAI,CAAC,kBAAkB,WAAW,GAChC,kCAAkC,YAAY,MAAM;CAExD,OAEE,kCAAkC,qBAAqB,MAAM;AAEjE"}
1
+ {"version":3,"file":"registerDefinition.mjs","names":[],"sources":["../../../../../src/runtime/register/component/registerDefinition.ts"],"sourcesContent":["import type { LayoutHostBinding } from '../../layoutBridge'\nimport type { TemplateRefBinding } from '../../templateRefs'\nimport type {\n ComponentPropsOptions,\n ComputedDefinitions,\n DefineComponentOptions,\n InternalRuntimeState,\n MethodDefinitions,\n RuntimeApp,\n} from '../../types'\nimport type { WatchMap } from '../watch'\nimport {\n WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY,\n WEVU_LAYOUT_HOST_BRIDGE_KEY,\n WEVU_PAGE_LAYOUT_NAME_KEY,\n WEVU_PAGE_LAYOUT_PROPS_KEY,\n WEVU_PAGE_LAYOUT_SETTER_KEY,\n WEVU_PUBLIC_RUNTIME_KEY,\n WEVU_READY_CALLED_KEY,\n WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD,\n WEVU_RUNTIME_KEY,\n WEVU_RUNTIME_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_TEMPLATE_REFS_KEY,\n} from '@weapp-core/constants'\nimport { callHookList } from '../../hooks'\nimport { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from '../../layoutBridge'\nimport { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from '../../pageLayout'\nimport { getMiniProgramRuntimeGlobalObject } from '../../platform'\nimport { getOwnerProxy } from '../../scopedSlots'\nimport { clearTemplateRefs, scheduleTemplateRefUpdate } from '../../templateRefs'\nimport { enableDeferredSetData, mountRuntimeInstance, refreshRuntimeInstance, setRuntimeSetDataVisibility, teardownRuntimeInstance } from '../runtimeInstance'\nimport { registerNativeComponentDefinition } from './registerNativeDefinition'\n\nfunction scheduleOwnerTemplateRefUpdate(target: InternalRuntimeState) {\n const selectOwnerComponent = (target as any).selectOwnerComponent\n if (typeof selectOwnerComponent !== 'function') {\n return\n }\n try {\n const owner = selectOwnerComponent.call(target) as InternalRuntimeState | null | undefined\n if (owner && owner !== target) {\n scheduleTemplateRefUpdate(owner)\n }\n }\n catch {\n // 宿主不支持 owner 查询时保持当前组件生命周期正常执行。\n }\n}\n\nexport function registerComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: {\n runtimeApp: RuntimeApp<D, C, M>\n watch: WatchMap | undefined\n setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup']\n restOptions: Record<string, any>\n pageLifecycleHooks: Record<string, any>\n finalObservers: Record<string, any>\n userLifetimes: Record<string, any>\n userPageLifetimes: Record<string, any>\n finalMethods: Record<string, (...args: any[]) => any>\n finalOptions: Record<string, any>\n applyExtraInstanceFields: (instance: InternalRuntimeState) => void\n templateRefs: TemplateRefBinding[] | undefined\n layoutHosts: LayoutHostBinding[] | undefined\n attachWevuPropKeys: (instance: InternalRuntimeState) => void\n setupLifecycle: 'created' | 'attached'\n syncWevuPropsFromInstance: (instance: InternalRuntimeState) => void\n syncWevuPropsFromValues: (instance: InternalRuntimeState, values: Record<string, unknown> | undefined) => void\n directPropsDerivedKeys: string[]\n isPage: boolean\n vueLifecycles: Record<string, unknown>\n getRuntimeOwnerLabel: (instance: InternalRuntimeState) => string\n registerNative?: boolean\n}) {\n const {\n runtimeApp,\n watch,\n setup,\n restOptions,\n pageLifecycleHooks,\n finalObservers,\n userLifetimes,\n userPageLifetimes,\n finalMethods,\n finalOptions,\n applyExtraInstanceFields,\n templateRefs,\n layoutHosts,\n attachWevuPropKeys,\n setupLifecycle,\n syncWevuPropsFromInstance,\n directPropsDerivedKeys,\n isPage,\n vueLifecycles,\n getRuntimeOwnerLabel,\n registerNative = true,\n } = options\n\n const resolveRuntime = (instance: InternalRuntimeState) => {\n const directRuntime = (instance as any).__wevu ?? (instance as any)[WEVU_PUBLIC_RUNTIME_KEY]\n if (directRuntime) {\n return directRuntime\n }\n const runtimeState = (instance as any).$state\n if (runtimeState && typeof runtimeState === 'object') {\n return (runtimeState as any)[WEVU_RUNTIME_KEY]\n }\n return undefined\n }\n\n const resolveLifecycleOwnerId = (instance: InternalRuntimeState) => (instance as any)[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? (instance as any)[WEVU_SLOT_OWNER_ID_KEY]\n ?? (instance as any).data?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? (instance as any).properties?.[WEVU_SLOT_OWNER_ID_KEY]\n\n const resolveLifecycleContext = (instance: InternalRuntimeState) => {\n const runtimeProxy = resolveRuntime(instance)?.proxy\n if (runtimeProxy) {\n return runtimeProxy\n }\n const ownerId = resolveLifecycleOwnerId(instance)\n if (typeof ownerId === 'string' && ownerId) {\n return getOwnerProxy(ownerId) ?? instance\n }\n return instance\n }\n\n const mountMissingRuntime = (instance: InternalRuntimeState) => {\n const existing = resolveRuntime(instance)\n if (existing) {\n return { runtime: existing, mounted: false }\n }\n applyExtraInstanceFields(instance)\n attachWevuPropKeys(instance)\n mountRuntimeInstance(instance, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n syncWevuPropsFromInstance(instance)\n enableDeferredSetData(instance)\n return { runtime: resolveRuntime(instance), mounted: true }\n }\n\n const callVueLifecycle = (instance: InternalRuntimeState, name: string, args: any[]) => {\n const hook = vueLifecycles[name]\n if (typeof hook === 'function') {\n return hook.apply(resolveLifecycleContext(instance), args)\n }\n return undefined\n }\n\n const ensureReadyRuntime = (instance: InternalRuntimeState) => {\n if (resolveRuntime(instance) || typeof vueLifecycles.mounted !== 'function') {\n return\n }\n const result = mountMissingRuntime(instance)\n if (result.mounted) {\n callVueLifecycle(instance, 'created', [])\n callVueLifecycle(instance, 'beforeMount', [])\n }\n }\n\n const pageMethodBridges: Record<string, (...args: any[]) => any> = {}\n const attachRuntimeLayoutHosts = (instance: InternalRuntimeState) => {\n if (!Array.isArray(layoutHosts) || !layoutHosts.length) {\n return\n }\n if ((instance as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n return\n }\n const bridge = registerRuntimeLayoutHosts(layoutHosts, instance)\n if (bridge) {\n instance[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge\n }\n }\n const attachPageLayoutSetter = (instance: InternalRuntimeState) => {\n if (!isPage) {\n return\n }\n instance[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout: string | false, props?: Record<string, any>) => {\n const runtimeState = instance.__wevu?.state as Record<string, any> | undefined\n if (!runtimeState || typeof runtimeState !== 'object') {\n return\n }\n runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout)\n const nextProps = layout === false ? {} : (props ?? {})\n runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps\n syncRuntimePageLayoutState(instance as Record<string, any>, layout, nextProps)\n }\n }\n if (isPage) {\n const methodBridgeHookNames = ['onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onShareTimeline', 'onAddToFavorites']\n for (const hookName of methodBridgeHookNames) {\n const pageHook = (pageLifecycleHooks as any)[hookName]\n if (typeof pageHook !== 'function') {\n continue\n }\n if (typeof (finalMethods as any)[hookName] === 'function') {\n continue\n }\n pageMethodBridges[hookName] = function pageMethodBridge(this: InternalRuntimeState, ...args: any[]) {\n return pageHook.apply(this, args)\n }\n }\n }\n\n const componentDefinition = {\n ...restOptions,\n ...(isPage ? pageLifecycleHooks : {}),\n observers: finalObservers,\n lifetimes: {\n ...userLifetimes,\n created: function created(this: InternalRuntimeState, ...args: any[]) {\n callVueLifecycle(this, 'beforeCreate', args)\n applyExtraInstanceFields(this)\n if (Array.isArray(templateRefs) && templateRefs.length) {\n Object.defineProperty(this, WEVU_TEMPLATE_REFS_KEY, {\n value: templateRefs,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n attachWevuPropKeys(this)\n if (setupLifecycle === 'created') {\n try {\n mountRuntimeInstance(this, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n }\n catch (error) {\n const label = getRuntimeOwnerLabel(this)\n throw new Error(`[wevu] mount runtime failed in created (${label}): ${error instanceof Error ? error.message : String(error)}`)\n }\n syncWevuPropsFromInstance(this)\n attachPageLayoutSetter(this)\n }\n if (typeof (userLifetimes as any).created === 'function') {\n ;(userLifetimes as any).created.apply(this, args)\n }\n },\n moved: function moved(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, 'onMoved', args)\n if (typeof (userLifetimes as any).moved === 'function') {\n ;(userLifetimes as any).moved.apply(this, args)\n }\n },\n attached: function attached(this: InternalRuntimeState, ...args: any[]) {\n applyExtraInstanceFields(this)\n if (Array.isArray(templateRefs) && templateRefs.length && !(this as any)[WEVU_TEMPLATE_REFS_KEY]) {\n Object.defineProperty(this, WEVU_TEMPLATE_REFS_KEY, {\n value: templateRefs,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n attachWevuPropKeys(this)\n if (setupLifecycle !== 'created' || !(this as any).__wevu) {\n try {\n mountRuntimeInstance(this, runtimeApp, watch, setup, {\n deferSetData: true,\n snapshotOmitKeys: directPropsDerivedKeys,\n })\n }\n catch (error) {\n const label = getRuntimeOwnerLabel(this)\n throw new Error(`[wevu] mount runtime failed in attached (${label}): ${error instanceof Error ? error.message : String(error)}`)\n }\n }\n syncWevuPropsFromInstance(this)\n callVueLifecycle(this, 'created', args)\n callVueLifecycle(this, 'beforeMount', args)\n attachPageLayoutSetter(this)\n attachRuntimeLayoutHosts(this)\n enableDeferredSetData(this)\n callHookList(this, 'onAttached', args)\n if (typeof (userLifetimes as any).attached === 'function') {\n ;(userLifetimes as any).attached.apply(this, args)\n }\n },\n ready: function ready(this: InternalRuntimeState, ...args: any[]) {\n ensureReadyRuntime(this)\n if (isPage && typeof (pageLifecycleHooks as any).onReady === 'function') {\n const wasReadyCalled = Boolean((this as any)[WEVU_READY_CALLED_KEY])\n ;(pageLifecycleHooks as any).onReady.call(this, ...args)\n if (!wasReadyCalled) {\n callVueLifecycle(this, 'mounted', args)\n }\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n return\n }\n if (!(this as any)[WEVU_READY_CALLED_KEY]) {\n ;(this as any)[WEVU_READY_CALLED_KEY] = true\n syncWevuPropsFromInstance(this)\n scheduleOwnerTemplateRefUpdate(this)\n scheduleTemplateRefUpdate(this, () => {\n callHookList(this, 'onReady', args)\n callVueLifecycle(this, 'mounted', args)\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n })\n return\n }\n if (typeof (userLifetimes as any).ready === 'function') {\n ;(userLifetimes as any).ready.apply(this, args)\n }\n },\n detached: function detached(this: InternalRuntimeState, ...args: any[]) {\n callVueLifecycle(this, 'beforeUnmount', args)\n callVueLifecycle(this, 'beforeDestroy', args)\n scheduleOwnerTemplateRefUpdate(this)\n callHookList(this, 'onDetached', args)\n if (isPage && typeof (pageLifecycleHooks as any).onUnload === 'function') {\n ;(pageLifecycleHooks as any).onUnload.call(this, ...args)\n if (typeof (userLifetimes as any).detached === 'function') {\n ;(userLifetimes as any).detached.apply(this, args)\n }\n callVueLifecycle(this, 'unmounted', args)\n callVueLifecycle(this, 'destroyed', args)\n return\n }\n clearTemplateRefs(this)\n if (Array.isArray(layoutHosts) && layoutHosts.length && (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n unregisterRuntimeLayoutHosts(layoutHosts, (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY])\n delete (this as any)[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n }\n teardownRuntimeInstance(this)\n callVueLifecycle(this, 'unmounted', args)\n callVueLifecycle(this, 'destroyed', args)\n if (typeof (userLifetimes as any).detached === 'function') {\n ;(userLifetimes as any).detached.apply(this, args)\n }\n },\n error: function error(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, 'onError', args)\n if (typeof (userLifetimes as any).error === 'function') {\n ;(userLifetimes as any).error.apply(this, args)\n }\n },\n },\n pageLifetimes: {\n ...userPageLifetimes,\n show: function show(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onShow === 'function') {\n ;(pageLifecycleHooks as any).onShow.call(this, ...args)\n if (typeof (userPageLifetimes as any).show === 'function') {\n ;(userPageLifetimes as any).show.apply(this, args)\n }\n return\n }\n setRuntimeSetDataVisibility(this, true)\n callHookList(this, 'onShow', args)\n if (typeof (userPageLifetimes as any).show === 'function') {\n ;(userPageLifetimes as any).show.apply(this, args)\n }\n },\n hide: function hide(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onHide === 'function') {\n ;(pageLifecycleHooks as any).onHide.call(this, ...args)\n if (typeof (userPageLifetimes as any).hide === 'function') {\n ;(userPageLifetimes as any).hide.apply(this, args)\n }\n return\n }\n setRuntimeSetDataVisibility(this, false)\n callHookList(this, 'onHide', args)\n if (typeof (userPageLifetimes as any).hide === 'function') {\n ;(userPageLifetimes as any).hide.apply(this, args)\n }\n },\n resize: function resize(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onResize === 'function') {\n ;(pageLifecycleHooks as any).onResize.call(this, ...args)\n if (typeof (userPageLifetimes as any).resize === 'function') {\n ;(userPageLifetimes as any).resize.apply(this, args)\n }\n return\n }\n callHookList(this, 'onResize', args)\n if (typeof (userPageLifetimes as any).resize === 'function') {\n ;(userPageLifetimes as any).resize.apply(this, args)\n }\n },\n routeDone: function routeDone(this: InternalRuntimeState, ...args: any[]) {\n if (isPage && typeof (pageLifecycleHooks as any).onRouteDone === 'function') {\n ;(pageLifecycleHooks as any).onRouteDone.call(this, ...args)\n if (typeof (userPageLifetimes as any).routeDone === 'function') {\n ;(userPageLifetimes as any).routeDone.apply(this, args)\n }\n return\n }\n callHookList(this, 'onRouteDone', args)\n if (typeof (userPageLifetimes as any).routeDone === 'function') {\n ;(userPageLifetimes as any).routeDone.apply(this, args)\n }\n },\n },\n methods: {\n ...pageMethodBridges,\n ...finalMethods,\n [WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD]: function resolvePublicInstance(this: InternalRuntimeState) {\n const result = mountMissingRuntime(this)\n if (result.mounted) {\n callVueLifecycle(this, 'created', [])\n callVueLifecycle(this, 'beforeMount', [])\n }\n return result.runtime?.proxy\n },\n },\n options: finalOptions,\n }\n if (!registerNative) {\n return componentDefinition\n }\n\n const statefulHmrBridge = getMiniProgramRuntimeGlobalObject()?.[WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY]\n if (typeof statefulHmrBridge?.trackWevuComponent === 'function') {\n const definition = statefulHmrBridge.trackWevuComponent(componentDefinition, (\n instance: InternalRuntimeState,\n stateSnapshot?: Record<string, any>,\n ) => {\n refreshRuntimeInstance(instance, runtimeApp, watch, setup, {\n snapshotOmitKeys: directPropsDerivedKeys,\n stateSnapshot,\n })\n syncWevuPropsFromInstance(instance)\n attachPageLayoutSetter(instance)\n attachRuntimeLayoutHosts(instance)\n enableDeferredSetData(instance, { rehydrateSetupState: true })\n })\n if (!statefulHmrBridge.isApplying()) {\n registerNativeComponentDefinition(definition, isPage)\n }\n return definition\n }\n registerNativeComponentDefinition(componentDefinition, isPage)\n return componentDefinition\n}\n"],"mappings":";;;;;;;;;;;AAkCA,SAAS,+BAA+B,QAA8B;CACpE,MAAM,uBAAwB,OAAe;CAC7C,IAAI,OAAO,yBAAyB,YAClC;CAEF,IAAI;EACF,MAAM,QAAQ,qBAAqB,KAAK,MAAM;EA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O,OAAO;IACzD,kBAAkB;IAClB;GACF,CAAC;GACD,0BAA0B,QAAQ;GAClC,uBAAuB,QAAQ;GAC/B,yBAAyB,QAAQ;GACjC,sBAAsB,UAAU,EAAE,qBAAqB,KAAK,CAAC;EAC/D,CAAC;EACD,IAAI,CAAC,kBAAkB,WAAW,GAChC,kCAAkC,YAAY,MAAM;EAEtD,OAAO;CACT;CACA,kCAAkC,qBAAqB,MAAM;CAC7D,OAAO;AACT"}
@@ -11,7 +11,7 @@ import { WEVU_EXPOSED_KEY, WEVU_HOOKS_KEY } from "@weapp-core/constants";
11
11
  * 注册组件入口(框架内部使用)。
12
12
  * @internal
13
13
  */
14
- function registerComponent(runtimeApp, methods, watch, setup, mpOptions) {
14
+ function registerComponent(runtimeApp, methods, watch, setup, mpOptions, options = {}) {
15
15
  var _multipleSlots;
16
16
  const { userMethods, userLifetimes, userPageLifetimes, userOptions, restOptions, topLevelMethods, templateRefs, layoutHosts, propsAliases, propsDerivedKeys, userObservers, setupLifecycle, vueLifecycles, isPage, features, userOnLoad, userOnUnload, userOnShow, userOnHide, userOnReady, userOnSaveExitState, userOnPullDownRefresh, userOnReachBottom, userOnPageScroll, userOnRouteDone, userOnTabItemTap, userOnResize, userOnShareAppMessage, userOnShareTimeline, userOnAddToFavorites, applyExtraInstanceFields } = prepareComponentOptions(mpOptions);
17
17
  const { enableOnPullDownRefresh, enableOnReachBottom, enableOnPageScroll, enableOnRouteDone, enableOnRouteDoneFallback, enableOnTabItemTap, enableOnResize, enableOnShareAppMessage, enableOnShareTimeline, enableOnAddToFavorites, enableOnSaveExitState, effectiveOnSaveExitState, effectiveOnPullDownRefresh, effectiveOnReachBottom, effectiveOnPageScroll, effectiveOnRouteDone, effectiveOnTabItemTap, effectiveOnResize, effectiveOnShareAppMessage, effectiveOnShareTimeline, effectiveOnAddToFavorites } = resolveComponentFeatures({
@@ -99,7 +99,7 @@ function registerComponent(runtimeApp, methods, watch, setup, mpOptions) {
99
99
  effectiveOnAddToFavorites,
100
100
  hasHook
101
101
  });
102
- registerComponentDefinition({
102
+ return registerComponentDefinition({
103
103
  runtimeApp,
104
104
  watch,
105
105
  setup,
@@ -120,7 +120,8 @@ function registerComponent(runtimeApp, methods, watch, setup, mpOptions) {
120
120
  directPropsDerivedKeys,
121
121
  isPage,
122
122
  vueLifecycles,
123
- getRuntimeOwnerLabel
123
+ getRuntimeOwnerLabel,
124
+ registerNative: options.registerNative
124
125
  });
125
126
  }
126
127
 
@@ -1 +1 @@
1
- {"version":3,"file":"component.mjs","names":[],"sources":["../../../../src/runtime/register/component.ts"],"sourcesContent":["import type { ComponentPropsOptions, ComputedDefinitions, DefineComponentOptions, InternalRuntimeState, MethodDefinitions, MiniProgramComponentRawOptions, RuntimeApp } from '../types'\nimport type { WatchMap } from './watch'\nimport { WEVU_EXPOSED_KEY, WEVU_HOOKS_KEY } from '@weapp-core/constants'\nimport { resolveComponentFeatures } from './component/features'\nimport { createPageLifecycleHooks } from './component/lifecycle'\nimport { createComponentMethods } from './component/methods'\nimport { getRuntimeOwnerLabel, prepareComponentOptions } from './component/options'\nimport { createPropsSync } from './component/props'\nimport { registerComponentDefinition } from './component/registerDefinition'\n\n/**\n * 注册组件入口(框架内部使用)。\n * @internal\n */\nexport function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(\n runtimeApp: RuntimeApp<D, C, M>,\n methods: MethodDefinitions,\n watch: WatchMap | undefined,\n setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'],\n mpOptions: MiniProgramComponentRawOptions,\n) {\n const {\n userMethods,\n userLifetimes,\n userPageLifetimes,\n userOptions,\n restOptions,\n topLevelMethods,\n templateRefs,\n layoutHosts,\n propsAliases,\n propsDerivedKeys,\n userObservers,\n setupLifecycle,\n vueLifecycles,\n isPage,\n features,\n userOnLoad,\n userOnUnload,\n userOnShow,\n userOnHide,\n userOnReady,\n userOnSaveExitState,\n userOnPullDownRefresh,\n userOnReachBottom,\n userOnPageScroll,\n userOnRouteDone,\n userOnTabItemTap,\n userOnResize,\n userOnShareAppMessage,\n userOnShareTimeline,\n userOnAddToFavorites,\n applyExtraInstanceFields,\n } = prepareComponentOptions(mpOptions)\n\n const {\n enableOnPullDownRefresh,\n enableOnReachBottom,\n enableOnPageScroll,\n enableOnRouteDone,\n enableOnRouteDoneFallback,\n enableOnTabItemTap,\n enableOnResize,\n enableOnShareAppMessage,\n enableOnShareTimeline,\n enableOnAddToFavorites,\n enableOnSaveExitState,\n effectiveOnSaveExitState,\n effectiveOnPullDownRefresh,\n effectiveOnReachBottom,\n effectiveOnPageScroll,\n effectiveOnRouteDone,\n effectiveOnTabItemTap,\n effectiveOnResize,\n effectiveOnShareAppMessage,\n effectiveOnShareTimeline,\n effectiveOnAddToFavorites,\n } = resolveComponentFeatures({\n features,\n userOnSaveExitState,\n userOnPullDownRefresh,\n userOnReachBottom,\n userOnPageScroll,\n userOnRouteDone,\n userOnTabItemTap,\n userOnResize,\n userOnShareAppMessage,\n userOnShareTimeline,\n userOnAddToFavorites,\n })\n\n const hasHook = (target: InternalRuntimeState, name: string) => {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return false\n }\n const entry = (hooks as any)[name]\n if (!entry) {\n return false\n }\n if (Array.isArray(entry)) {\n return entry.length > 0\n }\n return typeof entry === 'function'\n }\n\n // 自动对齐 Vue 3 的 expose:\n // - 若用户未提供 component-export 的 export(),默认返回 setup() 中 expose() 写入的 __wevuExposed\n // - 若用户同时提供 export() 与 expose(),则自动浅合并(export() 优先级更高)\n {\n const userExport = (restOptions as any).export\n ;(restOptions as any).export = function __wevu_export(this: InternalRuntimeState) {\n const exposed = (this as any)[WEVU_EXPOSED_KEY] ?? {}\n const base = typeof userExport === 'function' ? userExport.call(this) : {}\n\n if (base && typeof base === 'object' && !Array.isArray(base)) {\n return {\n ...exposed,\n ...base,\n }\n }\n\n // 若用户 export() 返回非对象(理论上不应发生),则保持原返回值;否则回退 exposed\n return base ?? exposed\n }\n }\n\n // 默认启用多 slot 以兼容微信小程序具名插槽写法;用户显式配置时保持原值\n const finalOptions = {\n multipleSlots: (userOptions as any).multipleSlots ?? true,\n ...(userOptions as any),\n }\n\n const { attachWevuPropKeys, directPropsDerivedKeys, syncWevuPropsFromInstance, syncWevuPropsFromValues, finalObservers } = createPropsSync({\n restOptions,\n propsAliases,\n propsDerivedKeys,\n userObservers,\n })\n\n const { finalMethods } = createComponentMethods({\n userMethods: {\n ...topLevelMethods,\n ...userMethods,\n },\n runtimeMethods: methods,\n })\n\n const pageLifecycleHooks = createPageLifecycleHooks({\n runtimeApp,\n watch,\n setup,\n userOnLoad,\n userOnUnload,\n userOnShow,\n userOnHide,\n userOnReady,\n isPage,\n enableOnSaveExitState,\n enableOnPullDownRefresh,\n enableOnReachBottom,\n enableOnPageScroll,\n enableOnRouteDone,\n enableOnRouteDoneFallback,\n enableOnTabItemTap,\n enableOnResize,\n enableOnShareAppMessage,\n enableOnShareTimeline,\n enableOnAddToFavorites,\n syncWevuPropsFromValues,\n effectiveOnSaveExitState,\n effectiveOnPullDownRefresh,\n effectiveOnReachBottom,\n effectiveOnPageScroll,\n effectiveOnRouteDone,\n effectiveOnTabItemTap,\n effectiveOnResize,\n effectiveOnShareAppMessage,\n effectiveOnShareTimeline,\n effectiveOnAddToFavorites,\n hasHook,\n })\n\n registerComponentDefinition({\n runtimeApp,\n watch,\n setup,\n restOptions,\n pageLifecycleHooks,\n finalObservers,\n userLifetimes,\n userPageLifetimes,\n finalMethods,\n finalOptions,\n applyExtraInstanceFields,\n templateRefs,\n layoutHosts,\n attachWevuPropKeys,\n setupLifecycle,\n syncWevuPropsFromInstance,\n syncWevuPropsFromValues,\n directPropsDerivedKeys,\n isPage,\n vueLifecycles,\n getRuntimeOwnerLabel,\n })\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,kBACd,YACA,SACA,OACA,OACA,WACA;;CACA,MAAM,EACJ,aACA,eACA,mBACA,aACA,aACA,iBACA,cACA,aACA,cACA,kBACA,e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EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,4BAA4B;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"component.mjs","names":[],"sources":["../../../../src/runtime/register/component.ts"],"sourcesContent":["import type { ComponentPropsOptions, ComputedDefinitions, DefineComponentOptions, InternalRuntimeState, MethodDefinitions, MiniProgramComponentRawOptions, RuntimeApp } from '../types'\nimport type { WatchMap } from './watch'\nimport { WEVU_EXPOSED_KEY, WEVU_HOOKS_KEY } from '@weapp-core/constants'\nimport { resolveComponentFeatures } from './component/features'\nimport { createPageLifecycleHooks } from './component/lifecycle'\nimport { createComponentMethods } from './component/methods'\nimport { getRuntimeOwnerLabel, prepareComponentOptions } from './component/options'\nimport { createPropsSync } from './component/props'\nimport { registerComponentDefinition } from './component/registerDefinition'\n\n/**\n * 注册组件入口(框架内部使用)。\n * @internal\n */\nexport function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(\n runtimeApp: RuntimeApp<D, C, M>,\n methods: MethodDefinitions,\n watch: WatchMap | undefined,\n setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'],\n mpOptions: MiniProgramComponentRawOptions,\n options: { registerNative?: boolean } = {},\n) {\n const {\n userMethods,\n userLifetimes,\n userPageLifetimes,\n userOptions,\n restOptions,\n topLevelMethods,\n templateRefs,\n layoutHosts,\n propsAliases,\n propsDerivedKeys,\n userObservers,\n setupLifecycle,\n vueLifecycles,\n isPage,\n features,\n userOnLoad,\n userOnUnload,\n userOnShow,\n userOnHide,\n userOnReady,\n userOnSaveExitState,\n userOnPullDownRefresh,\n userOnReachBottom,\n userOnPageScroll,\n userOnRouteDone,\n userOnTabItemTap,\n userOnResize,\n userOnShareAppMessage,\n userOnShareTimeline,\n userOnAddToFavorites,\n applyExtraInstanceFields,\n } = prepareComponentOptions(mpOptions)\n\n const {\n enableOnPullDownRefresh,\n enableOnReachBottom,\n enableOnPageScroll,\n enableOnRouteDone,\n enableOnRouteDoneFallback,\n enableOnTabItemTap,\n enableOnResize,\n enableOnShareAppMessage,\n enableOnShareTimeline,\n enableOnAddToFavorites,\n enableOnSaveExitState,\n effectiveOnSaveExitState,\n effectiveOnPullDownRefresh,\n effectiveOnReachBottom,\n effectiveOnPageScroll,\n effectiveOnRouteDone,\n effectiveOnTabItemTap,\n effectiveOnResize,\n effectiveOnShareAppMessage,\n effectiveOnShareTimeline,\n effectiveOnAddToFavorites,\n } = resolveComponentFeatures({\n features,\n userOnSaveExitState,\n userOnPullDownRefresh,\n userOnReachBottom,\n userOnPageScroll,\n userOnRouteDone,\n userOnTabItemTap,\n userOnResize,\n userOnShareAppMessage,\n userOnShareTimeline,\n userOnAddToFavorites,\n })\n\n const hasHook = (target: InternalRuntimeState, name: string) => {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return false\n }\n const entry = (hooks as any)[name]\n if (!entry) {\n return false\n }\n if (Array.isArray(entry)) {\n return entry.length > 0\n }\n return typeof entry === 'function'\n }\n\n // 自动对齐 Vue 3 的 expose:\n // - 若用户未提供 component-export 的 export(),默认返回 setup() 中 expose() 写入的 __wevuExposed\n // - 若用户同时提供 export() 与 expose(),则自动浅合并(export() 优先级更高)\n {\n const userExport = (restOptions as any).export\n ;(restOptions as any).export = function __wevu_export(this: InternalRuntimeState) {\n const exposed = (this as any)[WEVU_EXPOSED_KEY] ?? {}\n const base = typeof userExport === 'function' ? userExport.call(this) : {}\n\n if (base && typeof base === 'object' && !Array.isArray(base)) {\n return {\n ...exposed,\n ...base,\n }\n }\n\n // 若用户 export() 返回非对象(理论上不应发生),则保持原返回值;否则回退 exposed\n return base ?? exposed\n }\n }\n\n // 默认启用多 slot 以兼容微信小程序具名插槽写法;用户显式配置时保持原值\n const finalOptions = {\n multipleSlots: (userOptions as any).multipleSlots ?? true,\n ...(userOptions as any),\n }\n\n const { attachWevuPropKeys, directPropsDerivedKeys, syncWevuPropsFromInstance, syncWevuPropsFromValues, finalObservers } = createPropsSync({\n restOptions,\n propsAliases,\n propsDerivedKeys,\n userObservers,\n })\n\n const { finalMethods } = createComponentMethods({\n userMethods: {\n ...topLevelMethods,\n ...userMethods,\n },\n runtimeMethods: methods,\n })\n\n const pageLifecycleHooks = createPageLifecycleHooks({\n runtimeApp,\n watch,\n setup,\n userOnLoad,\n userOnUnload,\n userOnShow,\n userOnHide,\n userOnReady,\n isPage,\n enableOnSaveExitState,\n enableOnPullDownRefresh,\n enableOnReachBottom,\n enableOnPageScroll,\n enableOnRouteDone,\n enableOnRouteDoneFallback,\n enableOnTabItemTap,\n enableOnResize,\n enableOnShareAppMessage,\n enableOnShareTimeline,\n enableOnAddToFavorites,\n syncWevuPropsFromValues,\n effectiveOnSaveExitState,\n effectiveOnPullDownRefresh,\n effectiveOnReachBottom,\n effectiveOnPageScroll,\n effectiveOnRouteDone,\n effectiveOnTabItemTap,\n effectiveOnResize,\n effectiveOnShareAppMessage,\n effectiveOnShareTimeline,\n effectiveOnAddToFavorites,\n hasHook,\n })\n\n return registerComponentDefinition({\n runtimeApp,\n watch,\n setup,\n restOptions,\n pageLifecycleHooks,\n finalObservers,\n userLifetimes,\n userPageLifetimes,\n finalMethods,\n finalOptions,\n applyExtraInstanceFields,\n templateRefs,\n layoutHosts,\n attachWevuPropKeys,\n setupLifecycle,\n syncWevuPropsFromInstance,\n syncWevuPropsFromValues,\n directPropsDerivedKeys,\n isPage,\n vueLifecycles,\n getRuntimeOwnerLabel,\n registerNative: options.registerNative,\n })\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,kBACd,YACA,SACA,OACA,OACA,WACA,UAAwC,CAAC,GACzC;;CACA,MAAM,EACJ,aACA,eACA,mBACA,aACA,aACA,iBACA,cACA,aACA,cACA,kBACA,eACA,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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OAAO,4BAA4B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,QAAQ;CAC1B,CAAC;AACH"}
package/dist/index.d.mts CHANGED
@@ -69,4 +69,4 @@ import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
69
69
  import "./store.mjs";
70
70
  import { version } from "./version.mjs";
71
71
  export * from "@wevu/web-apis";
72
- export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type MiniProgramCSSProperties, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramDatasetAttributes, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramHtmlAliasIntrinsicElements, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type MiniProgramIntrinsicElementBaseAttributes, type MiniProgramIntrinsicElements, type MiniProgramIntrinsicEventHandler, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, type MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, PageLayoutState, PageMeta, PageStackSnapshot, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, SetupContextWithTypeProps, type SetupFunction, SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WeappCSSProperties, type WeappDatasetAttributes, type WeappHtmlAliasIntrinsicElements, type WeappIntrinsicElementBaseAttributes, type WeappIntrinsicElements, type WeappIntrinsicEventHandler, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, WevuComponentConstructor, type WevuDefaults, WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
72
+ export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type MiniProgramCSSProperties, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramDatasetAttributes, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramHtmlAliasIntrinsicElements, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type MiniProgramIntrinsicElementBaseAttributes, type MiniProgramIntrinsicElements, type MiniProgramIntrinsicEventHandler, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, type MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, PageLayoutState, PageMeta, PageStackSnapshot, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WeappCSSProperties, type WeappDatasetAttributes, type WeappHtmlAliasIntrinsicElements, type WeappIntrinsicElementBaseAttributes, type WeappIntrinsicElements, type WeappIntrinsicEventHandler, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
@@ -1,6 +1,6 @@
1
1
  import { createApp } from "./runtime/app.mjs";
2
- import { resetWevuDefaults, setWevuDefaults } from "./runtime/defaults.mjs";
3
- import { createWevuComponent, createWevuScopedSlotComponent, defineComponent } from "./runtime/define.mjs";
2
+ import { INTERNAL_DEFAULTS_SCOPE_KEY, resetWevuDefaults, setWevuDefaults } from "./runtime/defaults.mjs";
3
+ import { createWevuComponent, createWevuComponentDefinition, createWevuScopedSlotComponent, defineComponent, getWevuComponentLifecycleDefinition } from "./runtime/define.mjs";
4
4
  import { useDisposables } from "./runtime/disposables.mjs";
5
5
  import { useElementIntersectionObserver } from "./runtime/elementIntersectionObserver.mjs";
6
6
  import { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext } from "./runtime/hooks/base.mjs";
@@ -33,4 +33,4 @@ import { version } from "./version.mjs";
33
33
  import { takePendingRuntimeAppRegistration } from "./runtime/app/pending.mjs";
34
34
  import { Fragment, createTextVNode, createVNode, isVNode, mergeProps, normalizeJsxIsland, resolveComponent, resolveDirective, transformOn, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, withDirectives } from "./runtime/jsxIsland.mjs";
35
35
  import { createUniAppHost } from "./runtime/uniAppHost.mjs";
36
- export { Fragment, callHookList, callHookReturn, createApp, createTextVNode, createUniAppHost, createVNode, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, isVNode, markNoSetData, mergeModels, mergeProps, mountRuntimeInstance, normalizeJsxIsland, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, resetWevuDefaults, resolveComponent, resolveDirective, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, takePendingRuntimeAppRegistration, teardownRuntimeInstance, transformOn, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, version, waitForLayoutHost, withDirectives };
36
+ export { Fragment, INTERNAL_DEFAULTS_SCOPE_KEY, callHookList, callHookReturn, createApp, createTextVNode, createUniAppHost, createVNode, createWevuComponent, createWevuComponentDefinition, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, getWevuComponentLifecycleDefinition, hasInjectionContext, inject, injectGlobal, isNoSetData, isVNode, markNoSetData, mergeModels, mergeProps, mountRuntimeInstance, normalizeJsxIsland, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, resetWevuDefaults, resolveComponent, resolveDirective, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, takePendingRuntimeAppRegistration, teardownRuntimeInstance, transformOn, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, vModelCheckbox, vModelRadio, vModelSelect, vModelText, vShow, version, waitForLayoutHost, withDirectives };
@@ -1 +1 @@
1
- import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{version as B}from"./version.mjs";import{isNoSetData as V,markNoSetData as H}from"./runtime/noSetData.mjs";import{takePendingRuntimeAppRegistration as U}from"./runtime/app/pending.mjs";import{resetWevuDefaults as W,setWevuDefaults as G}from"./runtime/defaults.mjs";import{setGlobalProvidedValue as K}from"./runtime/provideStore.mjs";import{resolveRuntimePageLayoutName as q,setPageLayout as J,syncRuntimePageLayoutState as Y,syncRuntimePageLayoutStateFromRuntime as X,usePageLayout as Z}from"./runtime/pageLayout.mjs";import{runSetupFunction as Q}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as $,setRuntimeSetDataVisibility as ee,teardownRuntimeInstance as te}from"./runtime/register/runtimeInstance.mjs";import{registerApp as ne}from"./runtime/register/app.mjs";import{Fragment as re,createTextVNode as ie,createVNode as ae,isVNode as oe,mergeProps as se,normalizeJsxIsland as ce,resolveComponent as le,resolveDirective as ue,transformOn as de,vModelCheckbox as fe,vModelRadio as pe,vModelSelect as me,vModelText as he,vShow as ge,withDirectives as _e}from"./runtime/jsxIsland.mjs";import{resolveLayoutBridge as ve,resolveLayoutHost as ye,useLayoutBridge as be,useLayoutHosts as xe,waitForLayoutHost as Se}from"./runtime/layoutBridge.mjs";import{registerComponent as Ce}from"./runtime/register/component.mjs";import{createApp as we}from"./runtime/app.mjs";import{hasInjectionContext as Te,inject as Ee,injectGlobal as De,provide as Oe,provideGlobal as ke}from"./runtime/provide.mjs";import{createWevuComponent as Ae,createWevuScopedSlotComponent as je,defineComponent as Me}from"./runtime/define.mjs";import{useDisposables as Ne}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Pe}from"./runtime/elementIntersectionObserver.mjs";import{useIntersectionObserver as Fe}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as Ie,getNavigationBarMetrics as Le,useNavigationBarMetrics as Re,usePageStack as ze}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as Be}from"./runtime/pageScroll.mjs";import{useAsyncPullDownRefresh as Ve}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as He,useScrollOffset as Ue,useSelectorFields as We,useSelectorQuery as Ge}from"./runtime/selectorQuery.mjs";import{useUpdatePerformanceListener as Ke}from"./runtime/updatePerformance.mjs";import{defineAppSetup as qe,use as Je}from"./runtime/use.mjs";import{useAttrs as Ye,useNativeInstance as Xe,useSlots as Ze}from"./runtime/vueCompat/context.mjs";import{mergeModels as Qe,useBindModel as $e,useChangeModel as et,useModel as tt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as nt,useNativeRouter as rt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as it}from"./runtime/vueCompat/templateRef.mjs";import{createUniAppHost as at}from"./runtime/uniAppHost.mjs";export{re as Fragment,e as callHookList,t as callHookReturn,we as createApp,ie as createTextVNode,at as createUniAppHost,ae as createVNode,Ae as createWevuComponent,je as createWevuScopedSlotComponent,qe as defineAppSetup,Me as defineComponent,n as getCurrentInstance,Ie as getCurrentPageStackSnapshot,r as getCurrentSetupContext,Le as getNavigationBarMetrics,Te as hasInjectionContext,Ee as inject,De as injectGlobal,V as isNoSetData,oe as isVNode,H as markNoSetData,Qe as mergeModels,se as mergeProps,$ as mountRuntimeInstance,ce as normalizeJsxIsland,A as onActivated,o as onAddToFavorites,s as onAttached,j as onBeforeMount,M as onBeforeUnmount,N as onBeforeUpdate,P as onDeactivated,c as onDetached,l as onError,F as onErrorCaptured,u as onHide,d as onLaunch,f as onLoad,p as onMemoryWarning,I as onMounted,m as onMoved,h as onPageNotFound,g as onPageScroll,_ as onPullDownRefresh,v as onReachBottom,y as onReady,b as onResize,x as onRouteDone,S as onSaveExitState,L as onServerPrefetch,C as onShareAppMessage,w as onShareTimeline,T as onShow,E as onTabItemTap,D as onThemeChange,O as onUnhandledRejection,k as onUnload,R as onUnmounted,z as onUpdated,Oe as provide,ke as provideGlobal,ne as registerApp,Ce as registerComponent,W as resetWevuDefaults,le as resolveComponent,ue as resolveDirective,ve as resolveLayoutBridge,ye as resolveLayoutHost,q as resolveRuntimePageLayoutName,Q as runSetupFunction,i as setCurrentInstance,a as setCurrentSetupContext,K as setGlobalProvidedValue,J as setPageLayout,ee as setRuntimeSetDataVisibility,G as setWevuDefaults,Y as syncRuntimePageLayoutState,X as syncRuntimePageLayoutStateFromRuntime,U as takePendingRuntimeAppRegistration,te as teardownRuntimeInstance,de as transformOn,Je as use,Ve as useAsyncPullDownRefresh,Ye as useAttrs,$e as useBindModel,He as useBoundingClientRect,et as useChangeModel,Ne as useDisposables,Pe as useElementIntersectionObserver,Fe as useIntersectionObserver,be as useLayoutBridge,xe as useLayoutHosts,tt as useModel,Xe as useNativeInstance,nt as useNativePageRouter,rt as useNativeRouter,Re as useNavigationBarMetrics,Z as usePageLayout,Be as usePageScrollThrottle,ze as usePageStack,Ue as useScrollOffset,We as useSelectorFields,Ge as useSelectorQuery,Ze as useSlots,it as useTemplateRef,Ke as useUpdatePerformanceListener,fe as vModelCheckbox,pe as vModelRadio,me as vModelSelect,he as vModelText,ge as vShow,B as version,Se as waitForLayoutHost,_e as withDirectives};
1
+ import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{version as B}from"./version.mjs";import{isNoSetData as V,markNoSetData as H}from"./runtime/noSetData.mjs";import{takePendingRuntimeAppRegistration as U}from"./runtime/app/pending.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as W,resetWevuDefaults as G,setWevuDefaults as K}from"./runtime/defaults.mjs";import{setGlobalProvidedValue as q}from"./runtime/provideStore.mjs";import{resolveRuntimePageLayoutName as J,setPageLayout as Y,syncRuntimePageLayoutState as X,syncRuntimePageLayoutStateFromRuntime as Z,usePageLayout as Q}from"./runtime/pageLayout.mjs";import{runSetupFunction as $}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as ee,setRuntimeSetDataVisibility as te,teardownRuntimeInstance as ne}from"./runtime/register/runtimeInstance.mjs";import{registerApp as re}from"./runtime/register/app.mjs";import{Fragment as ie,createTextVNode as ae,createVNode as oe,isVNode as se,mergeProps as ce,normalizeJsxIsland as le,resolveComponent as ue,resolveDirective as de,transformOn as fe,vModelCheckbox as pe,vModelRadio as me,vModelSelect as he,vModelText as ge,vShow as _e,withDirectives as ve}from"./runtime/jsxIsland.mjs";import{resolveLayoutBridge as ye,resolveLayoutHost as be,useLayoutBridge as xe,useLayoutHosts as Se,waitForLayoutHost as Ce}from"./runtime/layoutBridge.mjs";import{registerComponent as we}from"./runtime/register/component.mjs";import{createApp as Te}from"./runtime/app.mjs";import{hasInjectionContext as Ee,inject as De,injectGlobal as Oe,provide as ke,provideGlobal as Ae}from"./runtime/provide.mjs";import{createWevuComponent as je,createWevuComponentDefinition as Me,createWevuScopedSlotComponent as Ne,defineComponent as Pe,getWevuComponentLifecycleDefinition as Fe}from"./runtime/define.mjs";import{useDisposables as Ie}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Le}from"./runtime/elementIntersectionObserver.mjs";import{useIntersectionObserver as Re}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as ze,getNavigationBarMetrics as Be,useNavigationBarMetrics as Ve,usePageStack as He}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as Ue}from"./runtime/pageScroll.mjs";import{useAsyncPullDownRefresh as We}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as Ge,useScrollOffset as Ke,useSelectorFields as qe,useSelectorQuery as Je}from"./runtime/selectorQuery.mjs";import{useUpdatePerformanceListener as Ye}from"./runtime/updatePerformance.mjs";import{defineAppSetup as Xe,use as Ze}from"./runtime/use.mjs";import{useAttrs as Qe,useNativeInstance as $e,useSlots as et}from"./runtime/vueCompat/context.mjs";import{mergeModels as tt,useBindModel as nt,useChangeModel as rt,useModel as it}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as at,useNativeRouter as ot}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as st}from"./runtime/vueCompat/templateRef.mjs";import{createUniAppHost as ct}from"./runtime/uniAppHost.mjs";export{ie as Fragment,W as INTERNAL_DEFAULTS_SCOPE_KEY,e as callHookList,t as callHookReturn,Te as createApp,ae as createTextVNode,ct as createUniAppHost,oe as createVNode,je as createWevuComponent,Me as createWevuComponentDefinition,Ne as createWevuScopedSlotComponent,Xe as defineAppSetup,Pe as defineComponent,n as getCurrentInstance,ze as getCurrentPageStackSnapshot,r as getCurrentSetupContext,Be as getNavigationBarMetrics,Fe as getWevuComponentLifecycleDefinition,Ee as hasInjectionContext,De as inject,Oe as injectGlobal,V as isNoSetData,se as isVNode,H as markNoSetData,tt as mergeModels,ce as mergeProps,ee as mountRuntimeInstance,le as normalizeJsxIsland,A as onActivated,o as onAddToFavorites,s as onAttached,j as onBeforeMount,M as onBeforeUnmount,N as onBeforeUpdate,P as onDeactivated,c as onDetached,l as onError,F as onErrorCaptured,u as onHide,d as onLaunch,f as onLoad,p as onMemoryWarning,I as onMounted,m as onMoved,h as onPageNotFound,g as onPageScroll,_ as onPullDownRefresh,v as onReachBottom,y as onReady,b as onResize,x as onRouteDone,S as onSaveExitState,L as onServerPrefetch,C as onShareAppMessage,w as onShareTimeline,T as onShow,E as onTabItemTap,D as onThemeChange,O as onUnhandledRejection,k as onUnload,R as onUnmounted,z as onUpdated,ke as provide,Ae as provideGlobal,re as registerApp,we as registerComponent,G as resetWevuDefaults,ue as resolveComponent,de as resolveDirective,ye as resolveLayoutBridge,be as resolveLayoutHost,J as resolveRuntimePageLayoutName,$ as runSetupFunction,i as setCurrentInstance,a as setCurrentSetupContext,q as setGlobalProvidedValue,Y as setPageLayout,te as setRuntimeSetDataVisibility,K as setWevuDefaults,X as syncRuntimePageLayoutState,Z as syncRuntimePageLayoutStateFromRuntime,U as takePendingRuntimeAppRegistration,ne as teardownRuntimeInstance,fe as transformOn,Ze as use,We as useAsyncPullDownRefresh,Qe as useAttrs,nt as useBindModel,Ge as useBoundingClientRect,rt as useChangeModel,Ie as useDisposables,Le as useElementIntersectionObserver,Re as useIntersectionObserver,xe as useLayoutBridge,Se as useLayoutHosts,it as useModel,$e as useNativeInstance,at as useNativePageRouter,ot as useNativeRouter,Ve as useNavigationBarMetrics,Q as usePageLayout,Ue as usePageScrollThrottle,He as usePageStack,Ke as useScrollOffset,qe as useSelectorFields,Je as useSelectorQuery,et as useSlots,st as useTemplateRef,Ye as useUpdatePerformanceListener,pe as vModelCheckbox,me as vModelRadio,he as vModelSelect,ge as vModelText,_e as vShow,B as version,Ce as waitForLayoutHost,ve as withDirectives};
package/dist/package.mjs CHANGED
@@ -1 +1 @@
1
- var e=`6.20.3`;export{e as version};
1
+ var e=`6.20.5`;export{e as version};
@@ -1 +1 @@
1
- import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.144.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.146.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 e from"../_virtual/_@oxc-project_runtime@0.144.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.146.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}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_INLINE_MAP_KEY as f,WEVU_NATIVE_INSTANCE_KEY as p,WEVU_PARENT_INSTANCE_KEY as m,WEVU_PROPS_KEY as h,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as g,WEVU_RUNTIME_APP_KEY as _,WEVU_RUNTIME_KEY as v}from"@weapp-core/constants";function y(y){let{state:b,setupState:x,computedDefs:S,methodDefs:C,appConfig:w,includeComputed:T,setDataStrategy:E}=y,D={},{computedRefs:O,computedSetters:k,dirtyComputedKeys:A,createTrackedComputed:j,computedProxy:M}=u({includeComputed:T,setDataStrategy:E}),N=r(0),P=Object.create(null),F=(e,n)=>{let r=t(e),i=r[v],a=i==null?void 0:i.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[p];if(s(l))return l;let u=i==null?void 0:i.instance;if(s(u))return u},I=e=>{if(i(D,e))return;let t=(...t)=>{let n=F(b,b);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),D[e]=t},L=(e,t)=>{let n=new Set,r=e;for(;r&&!n.has(r);){var a;n.add(r);let e=(a=r[_])==null||(a=a.config)==null?void 0:a.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[m]}let o=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof o==`function`)try{var s;let e=o(),n=e==null||(s=e[_])==null||(s=s.config)==null?void 0:s.globalProperties;if(n&&i(n,t))return{found:!0,value:n[t]}}catch(e){}return{found:!1,value:void 0}},R=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{var n,r,i,a;let o=t.call(e);if(!o||typeof o!=`object`)return;let s=Reflect.get(o,g);if(typeof s==`function`){let e=s.call(o);if(e)return e}return(n=(r=(i=o[v])==null?void 0:i.proxy)==null?(a=o.__wevu)==null?void 0:a.proxy:r)==null?o:n}catch(e){return}},z=new Proxy(b,{get(n,r,a){if(typeof r==`string`){if(N.value,i(x,r))return Reflect.get(x,r,a);if(r===`props`){let e=n[h];if(e&&typeof e==`object`)return e}let p=n[h];if(p&&typeof p==`object`&&i(p,r))return Reflect.get(p,r);if(r===`data`||r===`$state`)return b;if(r===`$computed`)return M;if(r===`$emit`)return(e,...t)=>{let r=F(n,a),i=r&&Reflect.get(r,`triggerEvent`);if(typeof i!=`function`)return;let{detail:c,options:l}=s(t);return i.call(r,o(e),c,l)};if(r===`$nextTick`)return t=>t?e(()=>t.call(z)):e();if(r===`$set`)return(e,t,n)=>(Reflect.set(e,t,n),n);if(r===`$delete`)return(e,t)=>Reflect.deleteProperty(e,t);if(r===`$slots`){var c;return(c=t(n).$slots)==null?Object.freeze(Object.create(null)):c}if(r===`$refs`){var l;return(l=t(n).$refs)==null?Object.create(null):l}if(r===`$parent`)return R(F(n,a));if(r===`$options`){var u,f;let e=F(n,a);return{name:(u=(f=e==null?void 0:e[d])==null?e==null?void 0:e.name:f)==null?e==null?void 0:e.is:u}}if(i(P,r))return Reflect.get(P,r);if(i(D,r))return D[r];if(O[r])return O[r].value;if(i(w.globalProperties,r))return w.globalProperties[r];let m=L(F(n,a),r);if(m.found)return m.value}if(!Reflect.has(n,r)){let e=F(n,a);if(e&&Reflect.has(e,r)){let t=Reflect.get(e,r);return typeof t==`function`?t.bind(e):t}}let p=Reflect.get(n,r,a);return typeof r==`string`&&i(x,r)?Reflect.get(x,r,a):p},set(e,t,r,o){if(typeof t==`string`&&O[t])return a(k,t,r),!0;if(i(x,t)){let e=Reflect.get(x,t,o);return n(e)&&!n(r)?(e.value=r,!0):Reflect.set(x,t,r,o)}if(i(P,t))return Reflect.set(P,t,r);if(Reflect.has(e,t)){var s;let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i((s=e[h])==null?{}:s,t)?Reflect.set(x,t,r,o):Reflect.set(e,t,r,o)}return Reflect.set(P,t,r)},has(e,t){if(t===`data`||t===`$emit`||t===`$nextTick`||t===`$set`||t===`$delete`||t===`$slots`||t===`$refs`||t===`$parent`||t===`$options`||typeof t==`string`&&(i(x,t)||O[t]||i(D,t))||i(P,t))return!0;let n=F(e,e);return typeof t==`string`&&L(n,t).found||n&&Reflect.has(n,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(x).forEach(e=>{t.add(e)}),Reflect.ownKeys(P).forEach(e=>t.add(e)),Object.keys(D).forEach(e=>t.add(e)),Object.keys(O).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&i(x,t))return Object.getOwnPropertyDescriptor(x,t);if(i(P,t))return Object.getOwnPropertyDescriptor(P,t);if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(t===`data`)return{configurable:!0,enumerable:!1,get(){return b}};if(O[t])return{configurable:!0,enumerable:!0,get(){return O[t].value},set(e){a(k,t,e)}};if(i(D,t))return{configurable:!0,enumerable:!1,value:D[t]}}}});return Object.keys(C).forEach(e=>{let t=C[e];if(typeof t==`function`){D[e]=(...e)=>t.apply(z,e);return}e===f&&t&&typeof t==`object`&&(D[e]=t)}),I(`triggerEvent`),I(`createSelectorQuery`),I(`createIntersectionObserver`),I(`setData`),Object.keys(S).forEach(e=>{let t=S[e];if(typeof t==`function`)O[e]=j(e,()=>t.call(z));else{var n,r;let i=(n=t.get)==null?void 0:n.bind(z);if(!i)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(r=t.set)==null?void 0:r.bind(z);a?(k[e]=a,O[e]=j(e,i,a)):O[e]=j(e,i)}}),{boundMethods:D,computedRefs:O,computedSetters:k,dirtyComputedKeys:A,computedProxy:M,publicInstance:z,touchSetupMethodsVersion(){N.value+=1}}}export{y as createRuntimeContext};
1
+ import{nextTick as e}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_INLINE_MAP_KEY as f,WEVU_NATIVE_INSTANCE_KEY as p,WEVU_PARENT_INSTANCE_KEY as m,WEVU_PROPS_KEY as h,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as g,WEVU_RUNTIME_APP_KEY as _,WEVU_RUNTIME_KEY as v}from"@weapp-core/constants";function y(y){let{state:b,setupState:x,computedDefs:S,methodDefs:C,appConfig:w,includeComputed:T,setDataStrategy:E}=y,D={},{computedRefs:O,computedSetters:k,dirtyComputedKeys:A,createTrackedComputed:j,computedProxy:M}=u({includeComputed:T,setDataStrategy:E}),N=r(0),P=Object.create(null),F=(e,n)=>{let r=t(e),i=r[v],a=i==null?void 0:i.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[p];if(s(l))return l;let u=i==null?void 0:i.instance;if(s(u))return u},I=e=>{if(i(D,e))return;let t=(...t)=>{let n=F(b,b);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),D[e]=t},L=(e,t)=>{let n=new Set,r=e;for(;r&&!n.has(r);){var a;n.add(r);let e=(a=r[_])==null||(a=a.config)==null?void 0:a.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[m]}let o=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof o==`function`)try{var s;let e=o(),n=e==null||(s=e[_])==null||(s=s.config)==null?void 0:s.globalProperties;if(n&&i(n,t))return{found:!0,value:n[t]}}catch(e){}return{found:!1,value:void 0}},R=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{var n,r,i,a;let o=t.call(e);if(!o||typeof o!=`object`)return;let s=Reflect.get(o,g);if(typeof s==`function`){let e=s.call(o);if(e)return e}return(n=(r=(i=o[v])==null?void 0:i.proxy)==null?(a=o.__wevu)==null?void 0:a.proxy:r)==null?o:n}catch(e){return}},z=new Proxy(b,{get(n,r,a){if(typeof r==`string`){if(N.value,i(x,r))return Reflect.get(x,r,a);if(r===`props`){let e=n[h];if(e&&typeof e==`object`)return e}if(r===`$props`){let e=n[h];if(e&&typeof e==`object`)return e}let p=n[h];if(p&&typeof p==`object`&&i(p,r))return Reflect.get(p,r);if(r===`data`||r===`$state`)return b;if(r===`$computed`)return M;if(r===`$emit`)return(e,...t)=>{let r=F(n,a),i=r&&Reflect.get(r,`triggerEvent`);if(typeof i!=`function`)return;let{detail:c,options:l}=s(t);return i.call(r,o(e),c,l)};if(r===`$nextTick`)return t=>t?e(()=>t.call(z)):e();if(r===`$set`)return(e,t,n)=>(Reflect.set(e,t,n),n);if(r===`$delete`)return(e,t)=>Reflect.deleteProperty(e,t);if(r===`$slots`){var c;return(c=t(n).$slots)==null?Object.freeze(Object.create(null)):c}if(r===`$refs`){var l;return(l=t(n).$refs)==null?Object.create(null):l}if(r===`$parent`)return R(F(n,a));if(r===`$options`){var u,f;let e=F(n,a);return{name:(u=(f=e==null?void 0:e[d])==null?e==null?void 0:e.name:f)==null?e==null?void 0:e.is:u}}if(i(P,r))return Reflect.get(P,r);if(i(D,r))return D[r];if(O[r])return O[r].value;if(i(w.globalProperties,r))return w.globalProperties[r];let m=L(F(n,a),r);if(m.found)return m.value}if(!Reflect.has(n,r)){let e=F(n,a);if(e&&Reflect.has(e,r)){let t=Reflect.get(e,r);return typeof t==`function`?t.bind(e):t}}let p=Reflect.get(n,r,a);return typeof r==`string`&&i(x,r)?Reflect.get(x,r,a):p},set(e,t,r,o){if(typeof t==`string`&&O[t])return a(k,t,r),!0;if(i(x,t)){let e=Reflect.get(x,t,o);return n(e)&&!n(r)?(e.value=r,!0):Reflect.set(x,t,r,o)}if(i(P,t))return Reflect.set(P,t,r);if(Reflect.has(e,t)){var s;let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i((s=e[h])==null?{}:s,t)?Reflect.set(x,t,r,o):Reflect.set(e,t,r,o)}return Reflect.set(P,t,r)},has(e,t){if(t===`data`||t===`$emit`||t===`$nextTick`||t===`$set`||t===`$delete`||t===`$slots`||t===`$refs`||t===`$parent`||t===`$options`||typeof t==`string`&&(i(x,t)||O[t]||i(D,t))||i(P,t))return!0;let n=F(e,e);return typeof t==`string`&&L(n,t).found||n&&Reflect.has(n,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(x).forEach(e=>{t.add(e)}),Reflect.ownKeys(P).forEach(e=>t.add(e)),Object.keys(D).forEach(e=>t.add(e)),Object.keys(O).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&i(x,t))return Object.getOwnPropertyDescriptor(x,t);if(i(P,t))return Object.getOwnPropertyDescriptor(P,t);if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(t===`data`)return{configurable:!0,enumerable:!1,get(){return b}};if(O[t])return{configurable:!0,enumerable:!0,get(){return O[t].value},set(e){a(k,t,e)}};if(i(D,t))return{configurable:!0,enumerable:!1,value:D[t]}}}});return Object.keys(C).forEach(e=>{let t=C[e];if(typeof t==`function`){D[e]=(...e)=>t.apply(z,e);return}e===f&&t&&typeof t==`object`&&(D[e]=t)}),I(`triggerEvent`),I(`createSelectorQuery`),I(`createIntersectionObserver`),I(`setData`),Object.keys(S).forEach(e=>{let t=S[e];if(typeof t==`function`)O[e]=j(e,()=>t.call(z));else{var n,r;let i=(n=t.get)==null?void 0:n.bind(z);if(!i)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(r=t.set)==null?void 0:r.bind(z);a?(k[e]=a,O[e]=j(e,i,a)):O[e]=j(e,i)}}),{boundMethods:D,computedRefs:O,computedSetters:k,dirtyComputedKeys:A,computedProxy:M,publicInstance:z,touchSetupMethodsVersion(){N.value+=1}}}export{y as createRuntimeContext};
@@ -1,6 +1,7 @@
1
1
  import { CreateAppOptions, DefineComponentOptions } from "./types/options.mjs";
2
2
  import "./types.mjs";
3
3
  //#region src/runtime/defaults.d.ts
4
+ declare const INTERNAL_DEFAULTS_SCOPE_KEY = "__wevuDefaultsScope";
4
5
  interface WevuDefaults {
5
6
  app?: Partial<CreateAppOptions<any, any, any>>;
6
7
  component?: Partial<DefineComponentOptions<any, any, any, any>>;
@@ -8,4 +9,4 @@ interface WevuDefaults {
8
9
  declare function setWevuDefaults(next: WevuDefaults): void;
9
10
  declare function resetWevuDefaults(): void;
10
11
  //#endregion
11
- export { WevuDefaults, resetWevuDefaults, setWevuDefaults };
12
+ export { INTERNAL_DEFAULTS_SCOPE_KEY, WevuDefaults, resetWevuDefaults, setWevuDefaults };
@@ -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=(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,l;let u=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],d=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],f=F(u),p=F(d),m={...f,...p},h=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!r[x]?R(r,m):r[x];h&&(r.__wvSlotPropsSnapshot=t(m)),r[x]=g;let _=r==null||(c=r.__wevu)==null?void 0:c.state,v=!!(_&&typeof _==`object`&&(!e(_,x)||!n((l=_[x])==null?{}:l,m,20,{keys:1e4})));return _&&typeof _==`object`&&(_[x]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function W(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=U(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:i}),a&&H(e,t)}function G(e,t){var n;let r=!1;e[b]!==t&&(e[b]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[b]!==t){try{Object.defineProperty(i,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[b]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[b]!==t&&(a[b]=t,r=!0),r}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
+ 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,l;let u=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],d=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],f=F(u),p=F(d),m={...f,...p},h=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!r[x]?R(r,m):r[x];h&&(r.__wvSlotPropsSnapshot=t(m)),r[x]=g;let _=r==null||(c=r.__wevu)==null?void 0:c.state,v=!!(_&&typeof _==`object`&&(!e(_,x)||!n((l=_[x])==null?{}:l,m,20,{keys:1e4})));return _&&typeof _==`object`&&(_[x]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function W(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=U(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:i}),a&&H(e,t)}function G(e,t){var n;let r=!1;e[b]!==t&&(e[b]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[b]!==t){try{Object.defineProperty(i,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[b]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[b]!==t&&(a[b]=t,r=!0),r}function K(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function q(e,n,r,i){if(typeof e==`function`){r[n]=e;return}if(typeof e!=`object`||!e)return e;if(i.has(e))return;if(Array.isArray(e)){i.add(e);let t=e.map((e,t)=>{let a=q(e,`${n}.${t}`,r,i);return a===void 0?null:a});return i.delete(e),t}if(!K(e))return t(e);i.add(e);let a={};for(let[t,o]of Object.entries(e)){let e=q(o,`${n}.${t}`,r,i);e!==void 0&&(a[t]=e)}return i.delete(e),a}function J(e){let t={},n=q(e,y,t,new WeakSet);return{[y]:n,...t}}function Y(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(J(u)),(d||c||l)&&H(r,o)}function X(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)=>{Y(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 Z(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 Q(e,t){W(e,t);let n=Z(e);n&&X(e,n,t)}function $(){let e={[y]:{},[x]:{}};return Object.defineProperty(e,b,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function ee(e){let t=e==null?void 0:e.computed,n=e==null?void 0:e.templateRefs,a=e=>{let t=Z(e);return t?s(t):void 0},o={options:{virtualHost:!0},setData:{omit:T},[m]:T,properties:{[v]:{type:String,value:``,observer(e){X(this,e||``,t)}},[_]:{type:String,value:``,observer(e){X(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:$,lifetimes:{attached(){Q(this,t)},ready(){Q(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{ee as createScopedSlotOptions};
@@ -83,6 +83,20 @@ interface DefineComponentWithTypeProps<TypeProps> {
83
83
  */
84
84
  declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
85
85
  declare function defineComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
86
+ /**
87
+ * 创建不触发宿主全局注册的 Wevu 组件定义。
88
+ *
89
+ * @param options 组件选项
90
+ * @internal
91
+ */
92
+ declare function createWevuComponentDefinition(options: DefineComponentOptions<any, any, any, any, any>): WevuComponentConstructor<InferProps<ComponentPropsOptions>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions> & ComponentDefinition<any, any, any>;
93
+ /**
94
+ * 获取组件定义对应的宿主生命周期定义。
95
+ *
96
+ * @param definition Wevu 组件定义
97
+ * @internal
98
+ */
99
+ declare function getWevuComponentLifecycleDefinition(definition: object): Record<string, any> | undefined;
86
100
  /**
87
101
  * 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
88
102
  *
@@ -102,4 +116,4 @@ declare function createWevuScopedSlotComponent(overrides?: {
102
116
  templateRefs?: TemplateRefBinding[];
103
117
  }): void;
104
118
  //#endregion
105
- export { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent, createWevuComponent, createWevuScopedSlotComponent, defineComponent };
119
+ export { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent, createWevuComponent, createWevuComponentDefinition, createWevuScopedSlotComponent, defineComponent, getWevuComponentLifecycleDefinition };
@@ -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=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,v),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
+ 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;const x=new WeakMap;function S(){let t=e();if(!t)return;let n=t;b&&n[g]!==b&&(n[g]=b)}function C(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 w(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(_)}function T(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(_)}function E(e){let t=e.properties;return!!(t&&typeof t==`object`&&(v in t||y in t))}function D(e,t){return(t==null?void 0:t.strategy)!==`patch`||!E(e)?t:{...t,strategy:`diff`}}function O(e){return k(e,!0)}function k(e,t){t&&S();let{__typeProps:p,data:g,computed:v,methods:y,setData:b,watch:E,setup:O,props:k,inject:A,provide:j,allowFunctionProps:M,...N}=l(r(e)),P=N[h],F=Array.isArray(P)?[...new Set(P.filter(e=>typeof e==`string`&&e.length>0))]:[];delete N[h];let I=D(N,M===!0?{...b==null?{}:b,includeFunctions:!0,functionPaths:F}:M===!1?b:F.length?{...b==null?{}:b,functionPaths:F}:b),L=new Set(F.filter(e=>!e.includes(`.`))),R=f(N,k),z=C(R.properties,y),B=typeof g==`function`?()=>g.call(z):g,V=s({data:B,computed:v,methods:y,setData:I,[n]:`component`}),H=typeof O==`function`||A!=null||j!=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(A,i);j!=null&&u(j,i);let s=typeof O==`function`?a(O,e,t):void 0,c={...o,...s==null?{}:s};return t&&Object.keys(c).length&&m(t.runtime,t.instance,c,{includeFunctionsInState:M===!0,functionPropPaths:M===!1?void 0:L}),c}):void 0,U=typeof B==`function`?B():B,W=T(I)?{...U&&typeof U==`object`?U:{},[_]:w(N,I)?(U==null?void 0:U[_])||i():(U==null?void 0:U[_])||``}:U,G=c(W,v,I,y),K=G===void 0?R:{...R,data:G},q={data:B,computed:v,methods:y,setData:I,watch:E,setup:H,mpOptions:K},J=o(V,y==null?{}:y,E,H,K,{registerNative:t}),Y={__wevu_runtime:V,__wevu_options:q};return x.set(Y,J),Y}function A(e){return k(e,!1)}function j(e){return x.get(e)}function M(e){var t;S();let{properties:n,props:r,...i}=e,a={...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0};O(f(a,r,n))}function N(e){M(p(e))}b=N,S();export{M as createWevuComponent,A as createWevuComponentDefinition,N as createWevuScopedSlotComponent,O as defineComponent,j as getWevuComponentLifecycleDefinition};
@@ -44,4 +44,4 @@ import { ModelModifiers, UseModelOptions, mergeModels, useBindModel, useChangeMo
44
44
  import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
45
45
  import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
46
46
  import "./vueCompat.mjs";
47
- export { type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, type CreateAppOptions, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, ElementIntersectionObserverCallback, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type MiniProgramCSSProperties, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramDatasetAttributes, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramHtmlAliasIntrinsicElements, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type MiniProgramIntrinsicElementBaseAttributes, type MiniProgramIntrinsicElements, type MiniProgramIntrinsicEventHandler, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type PageFeatures, PageLayoutState, PageStackSnapshot, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, SetupContextWithTypeProps, type SetupFunction, SetupFunctionWithTypeProps, type ShallowUnwrapRef, type TemplateRef, TemplateRefValue, TemplateRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WeappCSSProperties, type WeappDatasetAttributes, type WeappHtmlAliasIntrinsicElements, type WeappIntrinsicElementBaseAttributes, type WeappIntrinsicElements, type WeappIntrinsicEventHandler, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, WevuComponentConstructor, type WevuDefaults, WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, callHookList, callHookReturn, callUpdateHooks, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, waitForLayoutHost };
47
+ export { type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, type CreateAppOptions, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, ElementIntersectionObserverCallback, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type MiniProgramCSSProperties, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramDatasetAttributes, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramHtmlAliasIntrinsicElements, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type MiniProgramIntrinsicElementBaseAttributes, type MiniProgramIntrinsicElements, type MiniProgramIntrinsicEventHandler, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type PageFeatures, PageLayoutState, PageStackSnapshot, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowUnwrapRef, type TemplateRef, TemplateRefValue, TemplateRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WeappCSSProperties, type WeappDatasetAttributes, type WeappHtmlAliasIntrinsicElements, type WeappIntrinsicElementBaseAttributes, type WeappIntrinsicElements, type WeappIntrinsicEventHandler, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, callHookList, callHookReturn, callUpdateHooks, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, waitForLayoutHost };
@@ -1 +1 @@
1
- import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{resolveRuntimePageLayoutName as n,syncRuntimePageLayoutState as r}from"../../pageLayout.mjs";import{getOwnerProxy as i}from"../../scopedSlots.mjs";import{clearTemplateRefs as a,scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,refreshRuntimeInstance as l,setRuntimeSetDataVisibility as u,teardownRuntimeInstance as ee}from"../runtimeInstance.mjs";import{registerRuntimeLayoutHosts as te,unregisterRuntimeLayoutHosts as ne}from"../../layoutBridge.mjs";import{registerNativeComponentDefinition as d}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as f,WEVU_LAYOUT_HOST_BRIDGE_KEY as p,WEVU_PAGE_LAYOUT_NAME_KEY as m,WEVU_PAGE_LAYOUT_PROPS_KEY as h,WEVU_PAGE_LAYOUT_SETTER_KEY as g,WEVU_PUBLIC_RUNTIME_KEY as _,WEVU_READY_CALLED_KEY as v,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as y,WEVU_RUNTIME_KEY as b,WEVU_RUNTIME_OWNER_ID_KEY as re,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_TEMPLATE_REFS_KEY as S}from"@weapp-core/constants";function C(e){let t=e.selectOwnerComponent;if(typeof t==`function`)try{let n=t.call(e);n&&n!==e&&o(n)}catch(e){}}function w(w){var T;let{runtimeApp:E,watch:D,setup:O,restOptions:k,pageLifecycleHooks:A,finalObservers:j,userLifetimes:M,userPageLifetimes:N,finalMethods:P,finalOptions:F,applyExtraInstanceFields:I,templateRefs:L,layoutHosts:R,attachWevuPropKeys:z,setupLifecycle:B,syncWevuPropsFromInstance:V,directPropsDerivedKeys:H,isPage:U,vueLifecycles:W,getRuntimeOwnerLabel:G}=w,K=e=>{var t;let n=(t=e.__wevu)==null?e[_]:t;if(n)return n;let r=e.$state;if(r&&typeof r==`object`)return r[b]},ie=e=>{var t,n,r,i,a;return(t=(n=(r=e[re])==null?e[x]:r)==null?(i=e.data)==null?void 0:i[x]:n)==null?(a=e.properties)==null?void 0:a[x]:t},ae=e=>{var t;let n=(t=K(e))==null?void 0:t.proxy;if(n)return n;let r=ie(e);if(typeof r==`string`&&r){var a;return(a=i(r))==null?e:a}return e},q=e=>{let t=K(e);return t?{runtime:t,mounted:!1}:(I(e),z(e),c(e,E,D,O,{deferSetData:!0,snapshotOmitKeys:H}),V(e),s(e),{runtime:K(e),mounted:!0})},J=(e,t,n)=>{let r=W[t];if(typeof r==`function`)return r.apply(ae(e),n)},oe=e=>{K(e)||typeof W.mounted!=`function`||q(e).mounted&&(J(e,`created`,[]),J(e,`beforeMount`,[]))},Y={},X=e=>{if(!Array.isArray(R)||!R.length||e[p])return;let t=te(R,e);t&&(e[p]=t)},Z=e=>{U&&(e[g]=(t,i)=>{var a;let o=(a=e.__wevu)==null?void 0:a.state;if(!o||typeof o!=`object`)return;o[m]=n(t);let s=t===!1||i==null?{}:i;o[h]=s,r(e,t,s)})};if(U)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=A[e];typeof t==`function`&&typeof P[e]!=`function`&&(Y[e]=function(...e){return t.apply(this,e)})}let Q={...k,...U?A:{},observers:j,lifetimes:{...M,created:function(...e){if(J(this,`beforeCreate`,e),I(this),Array.isArray(L)&&L.length&&Object.defineProperty(this,S,{value:L,configurable:!0,enumerable:!1,writable:!1}),z(this),B===`created`){try{c(this,E,D,O,{deferSetData:!0,snapshotOmitKeys:H})}catch(e){let t=G(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}V(this),Z(this)}typeof M.created==`function`&&M.created.apply(this,e)},moved:function(...e){t(this,`onMoved`,e),typeof M.moved==`function`&&M.moved.apply(this,e)},attached:function(...e){if(I(this),Array.isArray(L)&&L.length&&!this[S]&&Object.defineProperty(this,S,{value:L,configurable:!0,enumerable:!1,writable:!1}),z(this),B!==`created`||!this.__wevu)try{c(this,E,D,O,{deferSetData:!0,snapshotOmitKeys:H})}catch(e){let t=G(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}V(this),J(this,`created`,e),J(this,`beforeMount`,e),Z(this),X(this),s(this),t(this,`onAttached`,e),typeof M.attached==`function`&&M.attached.apply(this,e)},ready:function(...e){if(oe(this),U&&typeof A.onReady==`function`){let t=!!this[v];A.onReady.call(this,...e),t||J(this,`mounted`,e),typeof M.ready==`function`&&M.ready.apply(this,e);return}if(!this[v]){this[v]=!0,V(this),C(this),o(this,()=>{t(this,`onReady`,e),J(this,`mounted`,e),typeof M.ready==`function`&&M.ready.apply(this,e)});return}typeof M.ready==`function`&&M.ready.apply(this,e)},detached:function(...e){if(J(this,`beforeUnmount`,e),J(this,`beforeDestroy`,e),C(this),t(this,`onDetached`,e),U&&typeof A.onUnload==`function`){A.onUnload.call(this,...e),typeof M.detached==`function`&&M.detached.apply(this,e),J(this,`unmounted`,e),J(this,`destroyed`,e);return}a(this),Array.isArray(R)&&R.length&&this[p]&&(ne(R,this[p]),delete this[p]),ee(this),J(this,`unmounted`,e),J(this,`destroyed`,e),typeof M.detached==`function`&&M.detached.apply(this,e)},error:function(...e){t(this,`onError`,e),typeof M.error==`function`&&M.error.apply(this,e)}},pageLifetimes:{...N,show:function(...e){if(U&&typeof A.onShow==`function`){A.onShow.call(this,...e),typeof N.show==`function`&&N.show.apply(this,e);return}u(this,!0),t(this,`onShow`,e),typeof N.show==`function`&&N.show.apply(this,e)},hide:function(...e){if(U&&typeof A.onHide==`function`){A.onHide.call(this,...e),typeof N.hide==`function`&&N.hide.apply(this,e);return}u(this,!1),t(this,`onHide`,e),typeof N.hide==`function`&&N.hide.apply(this,e)},resize:function(...e){if(U&&typeof A.onResize==`function`){A.onResize.call(this,...e),typeof N.resize==`function`&&N.resize.apply(this,e);return}t(this,`onResize`,e),typeof N.resize==`function`&&N.resize.apply(this,e)},routeDone:function(...e){if(U&&typeof A.onRouteDone==`function`){A.onRouteDone.call(this,...e),typeof N.routeDone==`function`&&N.routeDone.apply(this,e);return}t(this,`onRouteDone`,e),typeof N.routeDone==`function`&&N.routeDone.apply(this,e)}},methods:{...Y,...P,[y]:function(){var e;let t=q(this);return t.mounted&&(J(this,`created`,[]),J(this,`beforeMount`,[])),(e=t.runtime)==null?void 0:e.proxy}},options:F},$=(T=e())==null?void 0:T[f];if(typeof($==null?void 0:$.trackWevuComponent)==`function`){let e=$.trackWevuComponent(Q,(e,t)=>{l(e,E,D,O,{snapshotOmitKeys:H,stateSnapshot:t}),V(e),Z(e),X(e),s(e,{rehydrateSetupState:!0})});$.isApplying()||d(e,U)}else d(Q,U)}export{w as registerComponentDefinition};
1
+ import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{resolveRuntimePageLayoutName as n,syncRuntimePageLayoutState as r}from"../../pageLayout.mjs";import{getOwnerProxy as i}from"../../scopedSlots.mjs";import{clearTemplateRefs as a,scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,refreshRuntimeInstance as l,setRuntimeSetDataVisibility as u,teardownRuntimeInstance as ee}from"../runtimeInstance.mjs";import{registerRuntimeLayoutHosts as te,unregisterRuntimeLayoutHosts as ne}from"../../layoutBridge.mjs";import{registerNativeComponentDefinition as d}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as f,WEVU_LAYOUT_HOST_BRIDGE_KEY as p,WEVU_PAGE_LAYOUT_NAME_KEY as m,WEVU_PAGE_LAYOUT_PROPS_KEY as h,WEVU_PAGE_LAYOUT_SETTER_KEY as g,WEVU_PUBLIC_RUNTIME_KEY as _,WEVU_READY_CALLED_KEY as v,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as y,WEVU_RUNTIME_KEY as b,WEVU_RUNTIME_OWNER_ID_KEY as re,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_TEMPLATE_REFS_KEY as S}from"@weapp-core/constants";function C(e){let t=e.selectOwnerComponent;if(typeof t==`function`)try{let n=t.call(e);n&&n!==e&&o(n)}catch(e){}}function w(w){var T;let{runtimeApp:E,watch:D,setup:O,restOptions:k,pageLifecycleHooks:A,finalObservers:j,userLifetimes:M,userPageLifetimes:N,finalMethods:P,finalOptions:F,applyExtraInstanceFields:I,templateRefs:L,layoutHosts:R,attachWevuPropKeys:z,setupLifecycle:B,syncWevuPropsFromInstance:V,directPropsDerivedKeys:H,isPage:U,vueLifecycles:W,getRuntimeOwnerLabel:G,registerNative:ie=!0}=w,K=e=>{var t;let n=(t=e.__wevu)==null?e[_]:t;if(n)return n;let r=e.$state;if(r&&typeof r==`object`)return r[b]},ae=e=>{var t,n,r,i,a;return(t=(n=(r=e[re])==null?e[x]:r)==null?(i=e.data)==null?void 0:i[x]:n)==null?(a=e.properties)==null?void 0:a[x]:t},oe=e=>{var t;let n=(t=K(e))==null?void 0:t.proxy;if(n)return n;let r=ae(e);if(typeof r==`string`&&r){var a;return(a=i(r))==null?e:a}return e},q=e=>{let t=K(e);return t?{runtime:t,mounted:!1}:(I(e),z(e),c(e,E,D,O,{deferSetData:!0,snapshotOmitKeys:H}),V(e),s(e),{runtime:K(e),mounted:!0})},J=(e,t,n)=>{let r=W[t];if(typeof r==`function`)return r.apply(oe(e),n)},se=e=>{K(e)||typeof W.mounted!=`function`||q(e).mounted&&(J(e,`created`,[]),J(e,`beforeMount`,[]))},Y={},X=e=>{if(!Array.isArray(R)||!R.length||e[p])return;let t=te(R,e);t&&(e[p]=t)},Z=e=>{U&&(e[g]=(t,i)=>{var a;let o=(a=e.__wevu)==null?void 0:a.state;if(!o||typeof o!=`object`)return;o[m]=n(t);let s=t===!1||i==null?{}:i;o[h]=s,r(e,t,s)})};if(U)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=A[e];typeof t==`function`&&typeof P[e]!=`function`&&(Y[e]=function(...e){return t.apply(this,e)})}let Q={...k,...U?A:{},observers:j,lifetimes:{...M,created:function(...e){if(J(this,`beforeCreate`,e),I(this),Array.isArray(L)&&L.length&&Object.defineProperty(this,S,{value:L,configurable:!0,enumerable:!1,writable:!1}),z(this),B===`created`){try{c(this,E,D,O,{deferSetData:!0,snapshotOmitKeys:H})}catch(e){let t=G(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}V(this),Z(this)}typeof M.created==`function`&&M.created.apply(this,e)},moved:function(...e){t(this,`onMoved`,e),typeof M.moved==`function`&&M.moved.apply(this,e)},attached:function(...e){if(I(this),Array.isArray(L)&&L.length&&!this[S]&&Object.defineProperty(this,S,{value:L,configurable:!0,enumerable:!1,writable:!1}),z(this),B!==`created`||!this.__wevu)try{c(this,E,D,O,{deferSetData:!0,snapshotOmitKeys:H})}catch(e){let t=G(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}V(this),J(this,`created`,e),J(this,`beforeMount`,e),Z(this),X(this),s(this),t(this,`onAttached`,e),typeof M.attached==`function`&&M.attached.apply(this,e)},ready:function(...e){if(se(this),U&&typeof A.onReady==`function`){let t=!!this[v];A.onReady.call(this,...e),t||J(this,`mounted`,e),typeof M.ready==`function`&&M.ready.apply(this,e);return}if(!this[v]){this[v]=!0,V(this),C(this),o(this,()=>{t(this,`onReady`,e),J(this,`mounted`,e),typeof M.ready==`function`&&M.ready.apply(this,e)});return}typeof M.ready==`function`&&M.ready.apply(this,e)},detached:function(...e){if(J(this,`beforeUnmount`,e),J(this,`beforeDestroy`,e),C(this),t(this,`onDetached`,e),U&&typeof A.onUnload==`function`){A.onUnload.call(this,...e),typeof M.detached==`function`&&M.detached.apply(this,e),J(this,`unmounted`,e),J(this,`destroyed`,e);return}a(this),Array.isArray(R)&&R.length&&this[p]&&(ne(R,this[p]),delete this[p]),ee(this),J(this,`unmounted`,e),J(this,`destroyed`,e),typeof M.detached==`function`&&M.detached.apply(this,e)},error:function(...e){t(this,`onError`,e),typeof M.error==`function`&&M.error.apply(this,e)}},pageLifetimes:{...N,show:function(...e){if(U&&typeof A.onShow==`function`){A.onShow.call(this,...e),typeof N.show==`function`&&N.show.apply(this,e);return}u(this,!0),t(this,`onShow`,e),typeof N.show==`function`&&N.show.apply(this,e)},hide:function(...e){if(U&&typeof A.onHide==`function`){A.onHide.call(this,...e),typeof N.hide==`function`&&N.hide.apply(this,e);return}u(this,!1),t(this,`onHide`,e),typeof N.hide==`function`&&N.hide.apply(this,e)},resize:function(...e){if(U&&typeof A.onResize==`function`){A.onResize.call(this,...e),typeof N.resize==`function`&&N.resize.apply(this,e);return}t(this,`onResize`,e),typeof N.resize==`function`&&N.resize.apply(this,e)},routeDone:function(...e){if(U&&typeof A.onRouteDone==`function`){A.onRouteDone.call(this,...e),typeof N.routeDone==`function`&&N.routeDone.apply(this,e);return}t(this,`onRouteDone`,e),typeof N.routeDone==`function`&&N.routeDone.apply(this,e)}},methods:{...Y,...P,[y]:function(){var e;let t=q(this);return t.mounted&&(J(this,`created`,[]),J(this,`beforeMount`,[])),(e=t.runtime)==null?void 0:e.proxy}},options:F};if(!ie)return Q;let $=(T=e())==null?void 0:T[f];if(typeof($==null?void 0:$.trackWevuComponent)==`function`){let e=$.trackWevuComponent(Q,(e,t)=>{l(e,E,D,O,{snapshotOmitKeys:H,stateSnapshot:t}),V(e),Z(e),X(e),s(e,{rehydrateSetupState:!0})});return $.isApplying()||d(e,U),e}return d(Q,U),Q}export{w as registerComponentDefinition};
@@ -10,6 +10,8 @@ import { WatchMap } from "./watch.mjs";
10
10
  * 注册组件入口(框架内部使用)。
11
11
  * @internal
12
12
  */
13
- declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions): void;
13
+ declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions, options?: {
14
+ registerNative?: boolean;
15
+ }): any;
14
16
  //#endregion
15
17
  export { registerComponent };