@number10/jsx-core 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +667 -0
- package/README.md +38 -0
- package/dist/animation/animated-signal.cjs +19 -0
- package/dist/animation/animated-signal.cjs.map +1 -0
- package/dist/animation/animated-signal.d.ts +35 -0
- package/dist/animation/animated-signal.d.ts.map +1 -0
- package/dist/animation/animated-signal.js +19 -0
- package/dist/animation/animated-signal.js.map +1 -0
- package/dist/animation/create-spring.cjs +80 -0
- package/dist/animation/create-spring.cjs.map +1 -0
- package/dist/animation/create-spring.d.ts +56 -0
- package/dist/animation/create-spring.d.ts.map +1 -0
- package/dist/animation/create-spring.js +80 -0
- package/dist/animation/create-spring.js.map +1 -0
- package/dist/animation/easing.cjs +76 -0
- package/dist/animation/easing.cjs.map +1 -0
- package/dist/animation/easing.d.ts +45 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +76 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/effect-definitions.cjs +441 -0
- package/dist/animation/effect-definitions.cjs.map +1 -0
- package/dist/animation/effect-definitions.d.ts +60 -0
- package/dist/animation/effect-definitions.d.ts.map +1 -0
- package/dist/animation/effect-definitions.js +441 -0
- package/dist/animation/effect-definitions.js.map +1 -0
- package/dist/animation/effect-engine.cjs +189 -0
- package/dist/animation/effect-engine.cjs.map +1 -0
- package/dist/animation/effect-engine.d.ts +70 -0
- package/dist/animation/effect-engine.d.ts.map +1 -0
- package/dist/animation/effect-engine.js +189 -0
- package/dist/animation/effect-engine.js.map +1 -0
- package/dist/animation/index.d.ts +24 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/spring-physics.cjs +94 -0
- package/dist/animation/spring-physics.cjs.map +1 -0
- package/dist/animation/spring-physics.d.ts +145 -0
- package/dist/animation/spring-physics.d.ts.map +1 -0
- package/dist/animation/spring-physics.js +94 -0
- package/dist/animation/spring-physics.js.map +1 -0
- package/dist/animation/tween.cjs +67 -0
- package/dist/animation/tween.cjs.map +1 -0
- package/dist/animation/tween.d.ts +60 -0
- package/dist/animation/tween.d.ts.map +1 -0
- package/dist/animation/tween.js +67 -0
- package/dist/animation/tween.js.map +1 -0
- package/dist/animation/types.d.ts +31 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/useSpring.cjs +152 -0
- package/dist/animation/useSpring.cjs.map +1 -0
- package/dist/animation/useSpring.d.ts +55 -0
- package/dist/animation/useSpring.d.ts.map +1 -0
- package/dist/animation/useSpring.js +149 -0
- package/dist/animation/useSpring.js.map +1 -0
- package/dist/animation/useTween.cjs +208 -0
- package/dist/animation/useTween.cjs.map +1 -0
- package/dist/animation/useTween.d.ts +116 -0
- package/dist/animation/useTween.d.ts.map +1 -0
- package/dist/animation/useTween.js +208 -0
- package/dist/animation/useTween.js.map +1 -0
- package/dist/border-geometry.cjs +447 -0
- package/dist/border-geometry.cjs.map +1 -0
- package/dist/border-geometry.d.ts +114 -0
- package/dist/border-geometry.d.ts.map +1 -0
- package/dist/border-geometry.js +447 -0
- package/dist/border-geometry.js.map +1 -0
- package/dist/colors/color-presets.cjs +236 -0
- package/dist/colors/color-presets.cjs.map +1 -0
- package/dist/colors/color-presets.d.ts +89 -0
- package/dist/colors/color-presets.d.ts.map +1 -0
- package/dist/colors/color-presets.js +236 -0
- package/dist/colors/color-presets.js.map +1 -0
- package/dist/colors/color-theme-helpers.cjs +32 -0
- package/dist/colors/color-theme-helpers.cjs.map +1 -0
- package/dist/colors/color-theme-helpers.d.ts +65 -0
- package/dist/colors/color-theme-helpers.d.ts.map +1 -0
- package/dist/colors/color-theme-helpers.js +32 -0
- package/dist/colors/color-theme-helpers.js.map +1 -0
- package/dist/colors/color-types.cjs +38 -0
- package/dist/colors/color-types.cjs.map +1 -0
- package/dist/colors/color-types.d.ts +112 -0
- package/dist/colors/color-types.d.ts.map +1 -0
- package/dist/colors/color-types.js +38 -0
- package/dist/colors/color-types.js.map +1 -0
- package/dist/colors/color-utils.cjs +197 -0
- package/dist/colors/color-utils.cjs.map +1 -0
- package/dist/colors/color-utils.d.ts +216 -0
- package/dist/colors/color-utils.d.ts.map +1 -0
- package/dist/colors/color-utils.js +197 -0
- package/dist/colors/color-utils.js.map +1 -0
- package/dist/colors/contrast-contracts.cjs +265 -0
- package/dist/colors/contrast-contracts.cjs.map +1 -0
- package/dist/colors/contrast-contracts.d.ts +289 -0
- package/dist/colors/contrast-contracts.d.ts.map +1 -0
- package/dist/colors/contrast-contracts.js +265 -0
- package/dist/colors/contrast-contracts.js.map +1 -0
- package/dist/colors/index.cjs +55 -0
- package/dist/colors/index.cjs.map +1 -0
- package/dist/colors/index.d.ts +16 -0
- package/dist/colors/index.d.ts.map +1 -0
- package/dist/colors/index.js +55 -0
- package/dist/colors/index.js.map +1 -0
- package/dist/core-props.cjs +66 -0
- package/dist/core-props.cjs.map +1 -0
- package/dist/core-props.d.ts +395 -0
- package/dist/core-props.d.ts.map +1 -0
- package/dist/core-props.js +66 -0
- package/dist/core-props.js.map +1 -0
- package/dist/design-tokens/design-token-presets.cjs +91 -0
- package/dist/design-tokens/design-token-presets.cjs.map +1 -0
- package/dist/design-tokens/design-token-presets.d.ts +34 -0
- package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
- package/dist/design-tokens/design-token-presets.js +91 -0
- package/dist/design-tokens/design-token-presets.js.map +1 -0
- package/dist/design-tokens/design-token-types.d.ts +97 -0
- package/dist/design-tokens/design-token-types.d.ts.map +1 -0
- package/dist/design-tokens/index.cjs +10 -0
- package/dist/design-tokens/index.cjs.map +1 -0
- package/dist/design-tokens/index.d.ts +9 -0
- package/dist/design-tokens/index.d.ts.map +1 -0
- package/dist/design-tokens/index.js +10 -0
- package/dist/design-tokens/index.js.map +1 -0
- package/dist/dev-config.cjs +296 -0
- package/dist/dev-config.cjs.map +1 -0
- package/dist/dev-config.d.ts +238 -0
- package/dist/dev-config.d.ts.map +1 -0
- package/dist/dev-config.js +296 -0
- package/dist/dev-config.js.map +1 -0
- package/dist/effects.cjs +69 -0
- package/dist/effects.cjs.map +1 -0
- package/dist/effects.d.ts +152 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +69 -0
- package/dist/effects.js.map +1 -0
- package/dist/global-registry.cjs +25 -0
- package/dist/global-registry.cjs.map +1 -0
- package/dist/global-registry.d.ts +19 -0
- package/dist/global-registry.d.ts.map +1 -0
- package/dist/global-registry.js +25 -0
- package/dist/global-registry.js.map +1 -0
- package/dist/hooks.cjs +378 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.ts +322 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +378 -0
- package/dist/hooks.js.map +1 -0
- package/dist/host-adapter.d.ts +414 -0
- package/dist/host-adapter.d.ts.map +1 -0
- package/dist/index.cjs +229 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +226 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.cjs +10 -0
- package/dist/jsx-dev-runtime.cjs.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +5 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +11 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.cjs +44 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.ts +24 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +44 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-types.d.ts +25 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/layout/appliers/container-applier.cjs +20 -0
- package/dist/layout/appliers/container-applier.cjs.map +1 -0
- package/dist/layout/appliers/container-applier.d.ts +9 -0
- package/dist/layout/appliers/container-applier.d.ts.map +1 -0
- package/dist/layout/appliers/container-applier.js +20 -0
- package/dist/layout/appliers/container-applier.js.map +1 -0
- package/dist/layout/appliers/position-applier.cjs +31 -0
- package/dist/layout/appliers/position-applier.cjs.map +1 -0
- package/dist/layout/appliers/position-applier.d.ts +8 -0
- package/dist/layout/appliers/position-applier.d.ts.map +1 -0
- package/dist/layout/appliers/position-applier.js +31 -0
- package/dist/layout/appliers/position-applier.js.map +1 -0
- package/dist/layout/layout-engine-test-utils.d.ts +26 -0
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
- package/dist/layout/layout-engine.cjs +628 -0
- package/dist/layout/layout-engine.cjs.map +1 -0
- package/dist/layout/layout-engine.d.ts +140 -0
- package/dist/layout/layout-engine.d.ts.map +1 -0
- package/dist/layout/layout-engine.js +628 -0
- package/dist/layout/layout-engine.js.map +1 -0
- package/dist/layout/strategies/base-strategy.cjs +31 -0
- package/dist/layout/strategies/base-strategy.cjs.map +1 -0
- package/dist/layout/strategies/base-strategy.d.ts +59 -0
- package/dist/layout/strategies/base-strategy.d.ts.map +1 -0
- package/dist/layout/strategies/base-strategy.js +31 -0
- package/dist/layout/strategies/base-strategy.js.map +1 -0
- package/dist/layout/strategies/column-layout.cjs +145 -0
- package/dist/layout/strategies/column-layout.cjs.map +1 -0
- package/dist/layout/strategies/column-layout.d.ts +38 -0
- package/dist/layout/strategies/column-layout.d.ts.map +1 -0
- package/dist/layout/strategies/column-layout.js +145 -0
- package/dist/layout/strategies/column-layout.js.map +1 -0
- package/dist/layout/strategies/row-layout.cjs +145 -0
- package/dist/layout/strategies/row-layout.cjs.map +1 -0
- package/dist/layout/strategies/row-layout.d.ts +38 -0
- package/dist/layout/strategies/row-layout.d.ts.map +1 -0
- package/dist/layout/strategies/row-layout.js +145 -0
- package/dist/layout/strategies/row-layout.js.map +1 -0
- package/dist/layout/strategies/stack-layout.cjs +94 -0
- package/dist/layout/strategies/stack-layout.cjs.map +1 -0
- package/dist/layout/strategies/stack-layout.d.ts +30 -0
- package/dist/layout/strategies/stack-layout.d.ts.map +1 -0
- package/dist/layout/strategies/stack-layout.js +94 -0
- package/dist/layout/strategies/stack-layout.js.map +1 -0
- package/dist/layout/types.d.ts +134 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.cjs +129 -0
- package/dist/layout/utils/child-utils.cjs.map +1 -0
- package/dist/layout/utils/child-utils.d.ts +54 -0
- package/dist/layout/utils/child-utils.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.js +129 -0
- package/dist/layout/utils/child-utils.js.map +1 -0
- package/dist/layout/utils/dimension-calculator.cjs +109 -0
- package/dist/layout/utils/dimension-calculator.cjs.map +1 -0
- package/dist/layout/utils/dimension-calculator.d.ts +59 -0
- package/dist/layout/utils/dimension-calculator.d.ts.map +1 -0
- package/dist/layout/utils/dimension-calculator.js +109 -0
- package/dist/layout/utils/dimension-calculator.js.map +1 -0
- package/dist/layout/utils/flex-distributor.cjs +173 -0
- package/dist/layout/utils/flex-distributor.cjs.map +1 -0
- package/dist/layout/utils/flex-distributor.d.ts +18 -0
- package/dist/layout/utils/flex-distributor.d.ts.map +1 -0
- package/dist/layout/utils/flex-distributor.js +173 -0
- package/dist/layout/utils/flex-distributor.js.map +1 -0
- package/dist/layout/utils/size-resolver.cjs +280 -0
- package/dist/layout/utils/size-resolver.cjs.map +1 -0
- package/dist/layout/utils/size-resolver.d.ts +84 -0
- package/dist/layout/utils/size-resolver.d.ts.map +1 -0
- package/dist/layout/utils/size-resolver.js +280 -0
- package/dist/layout/utils/size-resolver.js.map +1 -0
- package/dist/layout/utils/spacing-calculator.cjs +50 -0
- package/dist/layout/utils/spacing-calculator.cjs.map +1 -0
- package/dist/layout/utils/spacing-calculator.d.ts +27 -0
- package/dist/layout/utils/spacing-calculator.d.ts.map +1 -0
- package/dist/layout/utils/spacing-calculator.js +50 -0
- package/dist/layout/utils/spacing-calculator.js.map +1 -0
- package/dist/memo.cjs +18 -0
- package/dist/memo.cjs.map +1 -0
- package/dist/memo.d.ts +29 -0
- package/dist/memo.d.ts.map +1 -0
- package/dist/memo.js +18 -0
- package/dist/memo.js.map +1 -0
- package/dist/nineslice-contract.cjs +60 -0
- package/dist/nineslice-contract.cjs.map +1 -0
- package/dist/nineslice-contract.d.ts +107 -0
- package/dist/nineslice-contract.d.ts.map +1 -0
- package/dist/nineslice-contract.js +60 -0
- package/dist/nineslice-contract.js.map +1 -0
- package/dist/placeholder.cjs +12 -0
- package/dist/placeholder.cjs.map +1 -0
- package/dist/placeholder.d.ts +44 -0
- package/dist/placeholder.d.ts.map +1 -0
- package/dist/placeholder.js +12 -0
- package/dist/placeholder.js.map +1 -0
- package/dist/portal.cjs +89 -0
- package/dist/portal.cjs.map +1 -0
- package/dist/portal.d.ts +62 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +89 -0
- package/dist/portal.js.map +1 -0
- package/dist/primitive-contracts.cjs +12 -0
- package/dist/primitive-contracts.cjs.map +1 -0
- package/dist/primitive-contracts.d.ts +186 -0
- package/dist/primitive-contracts.d.ts.map +1 -0
- package/dist/primitive-contracts.js +12 -0
- package/dist/primitive-contracts.js.map +1 -0
- package/dist/theme.cjs +332 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +204 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +332 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vdom/create-runtime.cjs +79 -0
- package/dist/vdom/create-runtime.cjs.map +1 -0
- package/dist/vdom/create-runtime.d.ts +7 -0
- package/dist/vdom/create-runtime.d.ts.map +1 -0
- package/dist/vdom/create-runtime.js +79 -0
- package/dist/vdom/create-runtime.js.map +1 -0
- package/dist/vdom/index.cjs +8 -0
- package/dist/vdom/index.cjs.map +1 -0
- package/dist/vdom/index.d.ts +4 -0
- package/dist/vdom/index.d.ts.map +1 -0
- package/dist/vdom/index.js +8 -0
- package/dist/vdom/index.js.map +1 -0
- package/dist/vdom/mount.cjs +161 -0
- package/dist/vdom/mount.cjs.map +1 -0
- package/dist/vdom/mount.d.ts +6 -0
- package/dist/vdom/mount.d.ts.map +1 -0
- package/dist/vdom/mount.js +161 -0
- package/dist/vdom/mount.js.map +1 -0
- package/dist/vdom/patch.cjs +163 -0
- package/dist/vdom/patch.cjs.map +1 -0
- package/dist/vdom/patch.d.ts +3 -0
- package/dist/vdom/patch.d.ts.map +1 -0
- package/dist/vdom/patch.js +163 -0
- package/dist/vdom/patch.js.map +1 -0
- package/dist/vdom/registry.cjs +85 -0
- package/dist/vdom/registry.cjs.map +1 -0
- package/dist/vdom/registry.d.ts +28 -0
- package/dist/vdom/registry.d.ts.map +1 -0
- package/dist/vdom/registry.js +85 -0
- package/dist/vdom/registry.js.map +1 -0
- package/dist/vdom/runtime-helpers.cjs +23 -0
- package/dist/vdom/runtime-helpers.cjs.map +1 -0
- package/dist/vdom/runtime-helpers.d.ts +8 -0
- package/dist/vdom/runtime-helpers.d.ts.map +1 -0
- package/dist/vdom/runtime-helpers.js +23 -0
- package/dist/vdom/runtime-helpers.js.map +1 -0
- package/dist/vdom/surface.cjs +107 -0
- package/dist/vdom/surface.cjs.map +1 -0
- package/dist/vdom/surface.d.ts +9 -0
- package/dist/vdom/surface.d.ts.map +1 -0
- package/dist/vdom/surface.js +107 -0
- package/dist/vdom/surface.js.map +1 -0
- package/dist/vdom/types.d.ts +104 -0
- package/dist/vdom/types.d.ts.map +1 -0
- package/dist/vdom/utils.cjs +146 -0
- package/dist/vdom/utils.cjs.map +1 -0
- package/dist/vdom/utils.d.ts +24 -0
- package/dist/vdom/utils.d.ts.map +1 -0
- package/dist/vdom/utils.js +146 -0
- package/dist/vdom/utils.js.map +1 -0
- package/dist/vdom.d.ts +4 -0
- package/dist/vdom.d.ts.map +1 -0
- package/dist/vector-draw-context.d.ts +63 -0
- package/dist/vector-draw-context.d.ts.map +1 -0
- package/package.json +161 -0
- package/vdom/index.cjs +1 -0
- package/vdom/index.d.ts +1 -0
- package/vdom/index.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.cjs","sources":["../../src/vdom/registry.ts"],"sourcesContent":["import type { HostAdapter, HostNode, HostParent, SurfaceTarget } from '../host-adapter'\nimport type { MountRegistryContract, MountRegistryEntry } from './types'\nimport { isObjectKey } from './utils'\n\nexport class MountRegistry implements MountRegistryContract {\n private entries = new Map<number, MountRegistryEntry>()\n private nextId = 1\n private nodeIds = new WeakMap<object, number>()\n\n register(entry: Omit<MountRegistryEntry, 'id'>): number {\n const id = this.nextId++\n this.entries.set(id, { id, ...entry })\n if (isObjectKey(entry.rootNode)) {\n this.nodeIds.set(entry.rootNode, id)\n }\n return id\n }\n\n unregister(id: number): void {\n const entry = this.entries.get(id)\n if (!entry) return\n if (isObjectKey(entry.rootNode)) {\n this.nodeIds.delete(entry.rootNode)\n }\n this.entries.delete(id)\n }\n\n getEntry(id: number): MountRegistryEntry | undefined {\n return this.entries.get(id)\n }\n\n getEntryByNode(node: unknown): MountRegistryEntry | undefined {\n if (!isObjectKey(node)) return undefined\n const id = this.nodeIds.get(node)\n return id !== undefined ? this.entries.get(id) : undefined\n }\n\n findByParentAndKey(\n parent: HostParent,\n key: string | undefined,\n isAlive: (target: HostNode | HostParent) => boolean\n ): MountRegistryEntry | undefined {\n for (const entry of this.entries.values()) {\n if (!isAlive(entry.parent) || !isAlive(entry.rootNode)) {\n this.unregister(entry.id)\n continue\n }\n\n const entryKey = entry.props.key\n if (key !== undefined) {\n if (entry.parent === parent && entryKey === key) return entry\n } else if (entry.parent === parent) {\n return entry\n }\n }\n\n return undefined\n }\n\n getAllEntries(): MountRegistryEntry[] {\n return Array.from(this.entries.values())\n }\n\n clear(): void {\n this.entries.clear()\n this.nodeIds = new WeakMap<object, number>()\n this.nextId = 1\n }\n\n getStats(hostAdapter: HostAdapter) {\n const byType = new Map<string, number>()\n const byParent = new Map<HostParent, number>()\n const byKey = new Map<string, number>()\n const mounts: Array<{\n id: number\n type: string\n key?: string\n parentType: string\n propsKeys: string[]\n }> = []\n\n for (const entry of this.entries.values()) {\n const typeName = typeof entry.type === 'string' ? entry.type : entry.type.name || 'Component'\n byType.set(typeName, (byType.get(typeName) ?? 0) + 1)\n byParent.set(entry.parent, (byParent.get(entry.parent) ?? 0) + 1)\n\n if (entry.props.key) {\n byKey.set(entry.props.key, (byKey.get(entry.props.key) ?? 0) + 1)\n }\n\n mounts.push({\n id: entry.id,\n type: typeName,\n ...(entry.props.key !== undefined ? { key: entry.props.key } : {}),\n parentType: entry.surface\n ? 'RootSurface'\n : hostAdapter.isSurface?.(entry.parent as SurfaceTarget)\n ? 'Surface'\n : 'Container',\n propsKeys: Object.keys(entry.props),\n })\n }\n\n return {\n totalMounts: this.entries.size,\n byType,\n byParent,\n byKey,\n mounts,\n }\n }\n}\n"],"names":["isObjectKey"],"mappings":";;;AAIO,MAAM,cAA+C;AAAA,EAClD,8BAAc,IAAA;AAAA,EACd,SAAS;AAAA,EACT,8BAAc,QAAA;AAAA,EAEtB,SAAS,OAA+C;AACtD,UAAM,KAAK,KAAK;AAChB,SAAK,QAAQ,IAAI,IAAI,EAAE,IAAI,GAAG,OAAO;AACrC,QAAIA,MAAAA,YAAY,MAAM,QAAQ,GAAG;AAC/B,WAAK,QAAQ,IAAI,MAAM,UAAU,EAAE;AAAA,IACrC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,IAAkB;AAC3B,UAAM,QAAQ,KAAK,QAAQ,IAAI,EAAE;AACjC,QAAI,CAAC,MAAO;AACZ,QAAIA,MAAAA,YAAY,MAAM,QAAQ,GAAG;AAC/B,WAAK,QAAQ,OAAO,MAAM,QAAQ;AAAA,IACpC;AACA,SAAK,QAAQ,OAAO,EAAE;AAAA,EACxB;AAAA,EAEA,SAAS,IAA4C;AACnD,WAAO,KAAK,QAAQ,IAAI,EAAE;AAAA,EAC5B;AAAA,EAEA,eAAe,MAA+C;AAC5D,QAAI,CAACA,MAAAA,YAAY,IAAI,EAAG,QAAO;AAC/B,UAAM,KAAK,KAAK,QAAQ,I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AM,MAAM,QAAQ,SAAY,EAAE,KAAK,MAAM,MAAM,IAAA,IAAQ,CAAA;AAAA,QAC/D,YAAY,MAAM,UACd,gBACA,YAAY,YAAY,MAAM,MAAuB,IACnD,YACA;AAAA,QACN,WAAW,OAAO,KAAK,MAAM,KAAK;AAAA,MAAA,CACnC;AAAA,IACH;AAEA,WAAO;AAAA,MACL,aAAa,KAAK,QAAQ;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HostAdapter, HostNode, HostParent } from '../host-adapter';
|
|
2
|
+
import { MountRegistryContract, MountRegistryEntry } from './types';
|
|
3
|
+
export declare class MountRegistry implements MountRegistryContract {
|
|
4
|
+
private entries;
|
|
5
|
+
private nextId;
|
|
6
|
+
private nodeIds;
|
|
7
|
+
register(entry: Omit<MountRegistryEntry, 'id'>): number;
|
|
8
|
+
unregister(id: number): void;
|
|
9
|
+
getEntry(id: number): MountRegistryEntry | undefined;
|
|
10
|
+
getEntryByNode(node: unknown): MountRegistryEntry | undefined;
|
|
11
|
+
findByParentAndKey(parent: HostParent, key: string | undefined, isAlive: (target: HostNode | HostParent) => boolean): MountRegistryEntry | undefined;
|
|
12
|
+
getAllEntries(): MountRegistryEntry[];
|
|
13
|
+
clear(): void;
|
|
14
|
+
getStats(hostAdapter: HostAdapter): {
|
|
15
|
+
totalMounts: number;
|
|
16
|
+
byType: Map<string, number>;
|
|
17
|
+
byParent: Map<unknown, number>;
|
|
18
|
+
byKey: Map<string, number>;
|
|
19
|
+
mounts: {
|
|
20
|
+
id: number;
|
|
21
|
+
type: string;
|
|
22
|
+
key?: string;
|
|
23
|
+
parentType: string;
|
|
24
|
+
propsKeys: string[];
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/vdom/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAiB,MAAM,iBAAiB,CAAA;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAGxE,qBAAa,aAAc,YAAW,qBAAqB;IACzD,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,OAAO,CAAgC;IAE/C,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,MAAM;IASvD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAS5B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIpD,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS;IAM7D,kBAAkB,CAChB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,GAClD,kBAAkB,GAAG,SAAS;IAkBjC,aAAa,IAAI,kBAAkB,EAAE;IAIrC,KAAK,IAAI,IAAI;IAMb,QAAQ,CAAC,WAAW,EAAE,WAAW;;;;;;gBAKzB,MAAM;kBACJ,MAAM;kBACN,MAAM;wBACA,MAAM;uBACP,MAAM,EAAE;;;CAiCxB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isObjectKey } from "./utils.js";
|
|
2
|
+
class MountRegistry {
|
|
3
|
+
entries = /* @__PURE__ */ new Map();
|
|
4
|
+
nextId = 1;
|
|
5
|
+
nodeIds = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
register(entry) {
|
|
7
|
+
const id = this.nextId++;
|
|
8
|
+
this.entries.set(id, { id, ...entry });
|
|
9
|
+
if (isObjectKey(entry.rootNode)) {
|
|
10
|
+
this.nodeIds.set(entry.rootNode, id);
|
|
11
|
+
}
|
|
12
|
+
return id;
|
|
13
|
+
}
|
|
14
|
+
unregister(id) {
|
|
15
|
+
const entry = this.entries.get(id);
|
|
16
|
+
if (!entry) return;
|
|
17
|
+
if (isObjectKey(entry.rootNode)) {
|
|
18
|
+
this.nodeIds.delete(entry.rootNode);
|
|
19
|
+
}
|
|
20
|
+
this.entries.delete(id);
|
|
21
|
+
}
|
|
22
|
+
getEntry(id) {
|
|
23
|
+
return this.entries.get(id);
|
|
24
|
+
}
|
|
25
|
+
getEntryByNode(node) {
|
|
26
|
+
if (!isObjectKey(node)) return void 0;
|
|
27
|
+
const id = this.nodeIds.get(node);
|
|
28
|
+
return id !== void 0 ? this.entries.get(id) : void 0;
|
|
29
|
+
}
|
|
30
|
+
findByParentAndKey(parent, key, isAlive) {
|
|
31
|
+
for (const entry of this.entries.values()) {
|
|
32
|
+
if (!isAlive(entry.parent) || !isAlive(entry.rootNode)) {
|
|
33
|
+
this.unregister(entry.id);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const entryKey = entry.props.key;
|
|
37
|
+
if (key !== void 0) {
|
|
38
|
+
if (entry.parent === parent && entryKey === key) return entry;
|
|
39
|
+
} else if (entry.parent === parent) {
|
|
40
|
+
return entry;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
getAllEntries() {
|
|
46
|
+
return Array.from(this.entries.values());
|
|
47
|
+
}
|
|
48
|
+
clear() {
|
|
49
|
+
this.entries.clear();
|
|
50
|
+
this.nodeIds = /* @__PURE__ */ new WeakMap();
|
|
51
|
+
this.nextId = 1;
|
|
52
|
+
}
|
|
53
|
+
getStats(hostAdapter) {
|
|
54
|
+
const byType = /* @__PURE__ */ new Map();
|
|
55
|
+
const byParent = /* @__PURE__ */ new Map();
|
|
56
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
57
|
+
const mounts = [];
|
|
58
|
+
for (const entry of this.entries.values()) {
|
|
59
|
+
const typeName = typeof entry.type === "string" ? entry.type : entry.type.name || "Component";
|
|
60
|
+
byType.set(typeName, (byType.get(typeName) ?? 0) + 1);
|
|
61
|
+
byParent.set(entry.parent, (byParent.get(entry.parent) ?? 0) + 1);
|
|
62
|
+
if (entry.props.key) {
|
|
63
|
+
byKey.set(entry.props.key, (byKey.get(entry.props.key) ?? 0) + 1);
|
|
64
|
+
}
|
|
65
|
+
mounts.push({
|
|
66
|
+
id: entry.id,
|
|
67
|
+
type: typeName,
|
|
68
|
+
...entry.props.key !== void 0 ? { key: entry.props.key } : {},
|
|
69
|
+
parentType: entry.surface ? "RootSurface" : hostAdapter.isSurface?.(entry.parent) ? "Surface" : "Container",
|
|
70
|
+
propsKeys: Object.keys(entry.props)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
totalMounts: this.entries.size,
|
|
75
|
+
byType,
|
|
76
|
+
byParent,
|
|
77
|
+
byKey,
|
|
78
|
+
mounts
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
MountRegistry
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sources":["../../src/vdom/registry.ts"],"sourcesContent":["import type { HostAdapter, HostNode, HostParent, SurfaceTarget } from '../host-adapter'\nimport type { MountRegistryContract, MountRegistryEntry } from './types'\nimport { isObjectKey } from './utils'\n\nexport class MountRegistry implements MountRegistryContract {\n private entries = new Map<number, MountRegistryEntry>()\n private nextId = 1\n private nodeIds = new WeakMap<object, number>()\n\n register(entry: Omit<MountRegistryEntry, 'id'>): number {\n const id = this.nextId++\n this.entries.set(id, { id, ...entry })\n if (isObjectKey(entry.rootNode)) {\n this.nodeIds.set(entry.rootNode, id)\n }\n return id\n }\n\n unregister(id: number): void {\n const entry = this.entries.get(id)\n if (!entry) return\n if (isObjectKey(entry.rootNode)) {\n this.nodeIds.delete(entry.rootNode)\n }\n this.entries.delete(id)\n }\n\n getEntry(id: number): MountRegistryEntry | undefined {\n return this.entries.get(id)\n }\n\n getEntryByNode(node: unknown): MountRegistryEntry | undefined {\n if (!isObjectKey(node)) return undefined\n const id = this.nodeIds.get(node)\n return id !== undefined ? this.entries.get(id) : undefined\n }\n\n findByParentAndKey(\n parent: HostParent,\n key: string | undefined,\n isAlive: (target: HostNode | HostParent) => boolean\n ): MountRegistryEntry | undefined {\n for (const entry of this.entries.values()) {\n if (!isAlive(entry.parent) || !isAlive(entry.rootNode)) {\n this.unregister(entry.id)\n continue\n }\n\n const entryKey = entry.props.key\n if (key !== undefined) {\n if (entry.parent === parent && entryKey === key) return entry\n } else if (entry.parent === parent) {\n return entry\n }\n }\n\n return undefined\n }\n\n getAllEntries(): MountRegistryEntry[] {\n return Array.from(this.entries.values())\n }\n\n clear(): void {\n this.entries.clear()\n this.nodeIds = new WeakMap<object, number>()\n this.nextId = 1\n }\n\n getStats(hostAdapter: HostAdapter) {\n const byType = new Map<string, number>()\n const byParent = new Map<HostParent, number>()\n const byKey = new Map<string, number>()\n const mounts: Array<{\n id: number\n type: string\n key?: string\n parentType: string\n propsKeys: string[]\n }> = []\n\n for (const entry of this.entries.values()) {\n const typeName = typeof entry.type === 'string' ? entry.type : entry.type.name || 'Component'\n byType.set(typeName, (byType.get(typeName) ?? 0) + 1)\n byParent.set(entry.parent, (byParent.get(entry.parent) ?? 0) + 1)\n\n if (entry.props.key) {\n byKey.set(entry.props.key, (byKey.get(entry.props.key) ?? 0) + 1)\n }\n\n mounts.push({\n id: entry.id,\n type: typeName,\n ...(entry.props.key !== undefined ? { key: entry.props.key } : {}),\n parentType: entry.surface\n ? 'RootSurface'\n : hostAdapter.isSurface?.(entry.parent as SurfaceTarget)\n ? 'Surface'\n : 'Container',\n propsKeys: Object.keys(entry.props),\n })\n }\n\n return {\n tot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../layout/layout-engine.cjs");
|
|
4
|
+
function createRuntimeHelpers(state) {
|
|
5
|
+
function getHostContext(parent) {
|
|
6
|
+
return state.bridge.getHostContext(parent);
|
|
7
|
+
}
|
|
8
|
+
function recalculateLayout(container, parent) {
|
|
9
|
+
if (!container.__layoutProps) return;
|
|
10
|
+
layoutEngine.calculateLayout(container, container.__layoutProps, state.bridge.getParentContentSize?.(parent));
|
|
11
|
+
state.bridge.afterLayout?.(container, parent);
|
|
12
|
+
}
|
|
13
|
+
function runEffects(ctx) {
|
|
14
|
+
for (const run of ctx.effects) run();
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
getHostContext,
|
|
18
|
+
recalculateLayout,
|
|
19
|
+
runEffects
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.createRuntimeHelpers = createRuntimeHelpers;
|
|
23
|
+
//# sourceMappingURL=runtime-helpers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-helpers.cjs","sources":["../../src/vdom/runtime-helpers.ts"],"sourcesContent":["import { calculateLayout } from '../layout/layout-engine'\nimport type { LayoutContainer } from '../layout/types'\nimport type { VDOMHookContext, RuntimeState } from './types'\n\nexport function createRuntimeHelpers(state: RuntimeState) {\n function getHostContext(parent: Parameters<typeof state.bridge.getHostContext>[0]) {\n return state.bridge.getHostContext(parent)\n }\n\n function recalculateLayout(\n container: LayoutContainer,\n parent: Parameters<typeof state.bridge.getHostContext>[0]\n ): void {\n if (!container.__layoutProps) return\n calculateLayout(container, container.__layoutProps, state.bridge.getParentContentSize?.(parent))\n state.bridge.afterLayout?.(container, parent)\n }\n\n function runEffects(ctx: VDOMHookContext): void {\n for (const run of ctx.effects) run()\n }\n\n return {\n getHostContext,\n recalculateLayout,\n runEffects,\n }\n}\n"],"names":["calculateLayout"],"mappings":";;;AAIO,SAAS,qBAAqB,OAAqB;AACxD,WAAS,eAAe,QAA2D;AACjF,WAAO,MAAM,OAAO,eAAe,MAAM;AAAA,EAC3C;AAEA,WAAS,kBACP,WACA,QACM;AACN,QAAI,CAAC,UAAU,cAAe;AAC9BA,iCAAgB,WAAW,UAAU,eAAe,MAAM,OAAO,uBAAuB,MAAM,CAAC;AAC/F,UAAM,OAAO,cAAc,WAAW,MAAM;AAAA,EAC9C;AAEA,WAAS,WAAW,KAA4B;AAC9C,eAAW,OAAO,IAAI,QAAS,KAAA;AAAA,EACjC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LayoutContainer } from '../layout/types';
|
|
2
|
+
import { VDOMHookContext, RuntimeState } from './types';
|
|
3
|
+
export declare function createRuntimeHelpers(state: RuntimeState): {
|
|
4
|
+
getHostContext: (parent: Parameters<typeof state.bridge.getHostContext>[0]) => import('..').SurfaceContext;
|
|
5
|
+
recalculateLayout: (container: LayoutContainer, parent: Parameters<typeof state.bridge.getHostContext>[0]) => void;
|
|
6
|
+
runEffects: (ctx: VDOMHookContext) => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=runtime-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-helpers.d.ts","sourceRoot":"","sources":["../../src/vdom/runtime-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE5D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY;6BACtB,UAAU,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;mCAKpE,eAAe,UAClB,UAAU,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KACxD,IAAI;sBAMkB,eAAe,KAAG,IAAI;EAShD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { calculateLayout } from "../layout/layout-engine.js";
|
|
2
|
+
function createRuntimeHelpers(state) {
|
|
3
|
+
function getHostContext(parent) {
|
|
4
|
+
return state.bridge.getHostContext(parent);
|
|
5
|
+
}
|
|
6
|
+
function recalculateLayout(container, parent) {
|
|
7
|
+
if (!container.__layoutProps) return;
|
|
8
|
+
calculateLayout(container, container.__layoutProps, state.bridge.getParentContentSize?.(parent));
|
|
9
|
+
state.bridge.afterLayout?.(container, parent);
|
|
10
|
+
}
|
|
11
|
+
function runEffects(ctx) {
|
|
12
|
+
for (const run of ctx.effects) run();
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
getHostContext,
|
|
16
|
+
recalculateLayout,
|
|
17
|
+
runEffects
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
createRuntimeHelpers
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=runtime-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-helpers.js","sources":["../../src/vdom/runtime-helpers.ts"],"sourcesContent":["import { calculateLayout } from '../layout/layout-engine'\nimport type { LayoutContainer } from '../layout/types'\nimport type { VDOMHookContext, RuntimeState } from './types'\n\nexport function createRuntimeHelpers(state: RuntimeState) {\n function getHostContext(parent: Parameters<typeof state.bridge.getHostContext>[0]) {\n return state.bridge.getHostContext(parent)\n }\n\n function recalculateLayout(\n container: LayoutContainer,\n parent: Parameters<typeof state.bridge.getHostContext>[0]\n ): void {\n if (!container.__layoutProps) return\n calculateLayout(container, container.__layoutProps, state.bridge.getParentContentSize?.(parent))\n state.bridge.afterLayout?.(container, parent)\n }\n\n function runEffects(ctx: VDOMHookContext): void {\n for (const run of ctx.effects) run()\n }\n\n return {\n getHostContext,\n recalculateLayout,\n runEffects,\n }\n}\n"],"names":[],"mappings":";AAIO,SAAS,qBAAqB,OAAqB;AACxD,WAAS,eAAe,QAA2D;AACjF,WAAO,MAAM,OAAO,eAAe,MAAM;AAAA,EAC3C;AAEA,WAAS,kBACP,WACA,QACM;AACN,QAAI,CAAC,UAAU,cAAe;AAC9B,oBAAgB,WAAW,UAAU,eAAe,MAAM,OAAO,uBAAuB,MAAM,CAAC;AAC/F,UAAM,OAAO,cAAc,WAAW,MAAM;AAAA,EAC9C;AAEA,WAAS,WAAW,KAA4B;AAC9C,eAAW,OAAO,IAAI,QAAS,KAAA;AAAA,EACjC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function buildRootVNode(state, type, props) {
|
|
4
|
+
if (state.bridge.wrapRootVNode) {
|
|
5
|
+
return state.bridge.wrapRootVNode(type, props);
|
|
6
|
+
}
|
|
7
|
+
const { disableAutoSize: _d, key: _k, ...componentProps } = props;
|
|
8
|
+
return {
|
|
9
|
+
type,
|
|
10
|
+
props: componentProps,
|
|
11
|
+
children: []
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function createSurfaceOps(state, getMount, getUnmount, getPatchVNode) {
|
|
15
|
+
function mountJSX(parent, type, props = { width: 0, height: 0 }) {
|
|
16
|
+
const mount = getMount();
|
|
17
|
+
const patchVNode = getPatchVNode();
|
|
18
|
+
const key = props.key;
|
|
19
|
+
const existingMount = state.registry.findByParentAndKey(
|
|
20
|
+
parent,
|
|
21
|
+
key,
|
|
22
|
+
state.getHostAdapter().isAlive
|
|
23
|
+
);
|
|
24
|
+
if (existingMount) {
|
|
25
|
+
const newWidth = props.width ?? existingMount.props.width;
|
|
26
|
+
const newHeight = props.height ?? existingMount.props.height;
|
|
27
|
+
const { key: _k, ...componentProps } = props;
|
|
28
|
+
existingMount.props = {
|
|
29
|
+
...existingMount.props,
|
|
30
|
+
...componentProps,
|
|
31
|
+
width: newWidth,
|
|
32
|
+
height: newHeight
|
|
33
|
+
};
|
|
34
|
+
const newVNode = buildRootVNode(state, existingMount.type, existingMount.props);
|
|
35
|
+
patchVNode(parent, existingMount.vnode, newVNode);
|
|
36
|
+
existingMount.vnode = newVNode;
|
|
37
|
+
const handle2 = existingMount.rootNode;
|
|
38
|
+
handle2.unmount = () => unmountJSX(handle2);
|
|
39
|
+
return handle2;
|
|
40
|
+
}
|
|
41
|
+
const surface = state.getSurfaceAdapter().createRoot({
|
|
42
|
+
kind: "root",
|
|
43
|
+
target: state.bridge.extractSurfaceTarget?.(parent) ?? parent,
|
|
44
|
+
width: props.width,
|
|
45
|
+
height: props.height
|
|
46
|
+
});
|
|
47
|
+
const vnode = buildRootVNode(state, type, props);
|
|
48
|
+
const rootNode = mount(surface.root, vnode);
|
|
49
|
+
const registryId = state.registry.register({
|
|
50
|
+
parent,
|
|
51
|
+
type,
|
|
52
|
+
props,
|
|
53
|
+
rootNode,
|
|
54
|
+
vnode,
|
|
55
|
+
surface
|
|
56
|
+
});
|
|
57
|
+
const handle = rootNode;
|
|
58
|
+
handle.unmount = () => unmountJSX(handle);
|
|
59
|
+
if (!state.registry.getEntry(registryId)) {
|
|
60
|
+
throw new Error("Failed to register mount");
|
|
61
|
+
}
|
|
62
|
+
return handle;
|
|
63
|
+
}
|
|
64
|
+
function remountAll() {
|
|
65
|
+
const mount = getMount();
|
|
66
|
+
const unmount = getUnmount();
|
|
67
|
+
const entries = state.registry.getAllEntries();
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
const surface = entry.surface;
|
|
70
|
+
const adapter = state.getSurfaceAdapter();
|
|
71
|
+
if (!surface || (adapter.isAlive ? !adapter.isAlive(surface) : false)) {
|
|
72
|
+
state.registry.unregister(entry.id);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
adapter.updateRoot(surface, {
|
|
76
|
+
width: entry.props.width,
|
|
77
|
+
height: entry.props.height
|
|
78
|
+
});
|
|
79
|
+
if (entry.vnode) {
|
|
80
|
+
unmount(entry.vnode);
|
|
81
|
+
}
|
|
82
|
+
const nextVNode = buildRootVNode(state, entry.type, entry.props);
|
|
83
|
+
const rootNode = mount(surface.root, nextVNode);
|
|
84
|
+
entry.rootNode = rootNode;
|
|
85
|
+
entry.vnode = nextVNode;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function unmountJSX(target) {
|
|
89
|
+
const unmount = getUnmount();
|
|
90
|
+
const entry = state.bridge.isSurfaceTarget?.(target) ? state.registry.findByParentAndKey(target, void 0, state.getHostAdapter().isAlive) : state.registry.getEntryByNode(target);
|
|
91
|
+
if (!entry) return;
|
|
92
|
+
if (entry.vnode) {
|
|
93
|
+
unmount(entry.vnode);
|
|
94
|
+
}
|
|
95
|
+
if (entry.surface) {
|
|
96
|
+
state.getSurfaceAdapter().destroyRoot(entry.surface);
|
|
97
|
+
}
|
|
98
|
+
state.registry.unregister(entry.id);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
mountJSX,
|
|
102
|
+
remountAll,
|
|
103
|
+
unmountJSX
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
exports.createSurfaceOps = createSurfaceOps;
|
|
107
|
+
//# sourceMappingURL=surface.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.cjs","sources":["../../src/vdom/surface.ts"],"sourcesContent":["import type { NodeType, SurfaceTarget } from '../host-adapter'\nimport type { VNode, VNodeLike } from '../types'\nimport type {\n MountFn,\n MountHandle,\n MountProps,\n PatchVNodeFn,\n RuntimeState,\n UnmountFn,\n} from './types'\n\nfunction buildRootVNode(\n state: RuntimeState,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown>\n): VNode {\n if (state.bridge.wrapRootVNode) {\n return state.bridge.wrapRootVNode(type, props)\n }\n\n const { disableAutoSize: _d, key: _k, ...componentProps } = props\n return {\n type,\n props: componentProps,\n children: [],\n }\n}\n\nexport function createSurfaceOps(\n state: RuntimeState,\n getMount: () => MountFn,\n getUnmount: () => UnmountFn,\n getPatchVNode: () => PatchVNodeFn\n) {\n function mountJSX(\n parent: unknown,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown> = { width: 0, height: 0 }\n ): MountHandle {\n const mount = getMount()\n const patchVNode = getPatchVNode()\n const key = props.key\n const existingMount = state.registry.findByParentAndKey(\n parent,\n key,\n state.getHostAdapter().isAlive\n )\n\n if (existingMount) {\n const newWidth = props.width ?? existingMount.props.width\n const newHeight = props.height ?? existingMount.props.height\n const { key: _k, ...componentProps } = props\n existingMount.props = {\n ...existingMount.props,\n ...componentProps,\n width: newWidth,\n height: newHeight,\n }\n\n const newVNode = buildRootVNode(state, existingMount.type, existingMount.props)\n patchVNode(parent, existingMount.vnode, newVNode)\n existingMount.vnode = newVNode\n\n const handle = existingMount.rootNode as MountHandle\n handle.unmount = () => unmountJSX(handle)\n return handle\n }\n\n const surface = state.getSurfaceAdapter().createRoot({\n kind: 'root',\n target: state.bridge.extractSurfaceTarget?.(parent) ?? (parent as SurfaceTarget),\n width: props.width,\n height: props.height,\n })\n\n const vnode = buildRootVNode(state, type, props)\n const rootNode = mount(surface.root, vnode)\n const registryId = state.registry.register({\n parent,\n type,\n props,\n rootNode,\n vnode,\n surface,\n })\n\n const handle = rootNode as MountHandle\n handle.unmount = () => unmountJSX(handle)\n if (!state.registry.getEntry(registryId)) {\n throw new Error('Failed to register mount')\n }\n return handle\n }\n\n function remountAll(): void {\n const mount = getMount()\n const unmount = getUnmount()\n const entries = state.registry.getAllEntries()\n for (const entry of entries) {\n const surface = entry.surface\n const adapter = state.getSurfaceAdapter()\n if (!surface || (adapter.isAlive ? !adapter.isAlive(surface) : false)) {\n state.registry.unregister(entry.id)\n continue\n }\n\n adapter.updateRoot(surface, {\n width: entry.props.width,\n height: entry.props.height,\n })\n\n if (entry.vnode) {\n unmount(entry.vnode)\n }\n\n const nextVNode = buildRootVNode(state, entry.type, entry.props)\n const rootNode = mount(surface.root, nextVNode)\n entry.rootNode = rootNode\n entry.vnode = nextVNode\n }\n }\n\n function unmountJSX(target: SurfaceTarget | unknown): void {\n const unmount = getUnmount()\n const entry = state.bridge.isSurfaceTarget?.(target)\n ? state.registry.findByParentAndKey(target, undefined, state.getHostAdapter().isAlive)\n : state.registry.getEntryByNode(target)\n\n if (!entry) return\n\n if (entry.vnode) {\n unmount(entry.vnode)\n }\n\n if (entry.surface) {\n state.getSurfaceAdapter().destroyRoot(entry.surface)\n }\n\n state.registry.unregister(entry.id)\n }\n\n return {\n mountJSX,\n remountAll,\n unmountJSX,\n }\n}\n"],"names":["handle"],"mappings":";;AAWA,SAAS,eACP,OACA,MACA,OACO;AACP,MAAI,MAAM,OAAO,eAAe;AAC9B,WAAO,MAAM,OAAO,cAAc,MAAM,KAAK;AAAA,EAC/C;AAEA,QAAM,EAAE,iBAAiB,IAAI,KAAK,IAAI,GAAG,mBAAmB;AAC5D,SAAO;AAAA,IACL;AAAA,IACA,OAAO;AAAA,IACP,UAAU,CAAA;AAAA,EAAC;AAEf;AAEO,SAAS,iBACd,OACA,UACA,YACA,eACA;AACA,WAAS,SACP,QACA,MACA,QAA8C,EAAE,OAAO,GAAG,QAAQ,KACrD;AACb,UAAM,QAAQ,SAAA;AACd,UAAM,aAAa,cAAA;AACnB,UAAM,MAAM,MAAM;AAClB,UAAM,gBAAgB,MAAM,SAAS;AAAA,MACnC;AAAA,MACA;AAAA,MACA,MAAM,iBAAiB;AAAA,IAAA;AAGzB,QAAI,eAAe;AACjB,YAAM,WAAW,MAAM,SAAS,cAAc,MAAM;AACpD,YAAM,YAAY,MAAM,UAAU,cAAc,MAAM;AACtD,YAAM,EAAE,KAAK,IAAI,GAAG,mBAAmB;AACvC,oBAAc,QAAQ;AAAA,QACpB,GAAG,cAAc;AAAA,QACjB,GAAG;AAAA,QACH,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA;AAGV,YAAM,WAAW,eAAe,OAAO,cAAc,MAAM,cAAc,KAAK;A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M,KAAK;AAC/D,YAAM,WAAW,MAAM,QAAQ,MAAM,SAAS;AAC9C,YAAM,WAAW;AACjB,YAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AAEA,WAAS,WAAW,QAAuC;AACzD,UAAM,UAAU,WAAA;AAChB,UAAM,QAAQ,MAAM,OAAO,kBAAkB,MAAM,IAC/C,MAAM,SAAS,mBAAmB,QAAQ,QAAW,MAAM,iBAAiB,OAAO,IACnF,MAAM,SAAS,eAAe,MAAM;AAExC,QAAI,CAAC,MAAO;AAEZ,QAAI,MAAM,OAAO;AACf,cAAQ,MAAM,KAAK;AAAA,IACrB;AAEA,QAAI,MAAM,SAAS;AACjB,YAAM,kBAAA,EAAoB,YAAY,MAAM,OAAO;AAAA,IACrD;AAEA,UAAM,SAAS,WAAW,MAAM,EAAE;AAAA,EACpC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeType, SurfaceTarget } from '../host-adapter';
|
|
2
|
+
import { VNodeLike } from '../types';
|
|
3
|
+
import { MountFn, MountHandle, MountProps, PatchVNodeFn, RuntimeState, UnmountFn } from './types';
|
|
4
|
+
export declare function createSurfaceOps(state: RuntimeState, getMount: () => MountFn, getUnmount: () => UnmountFn, getPatchVNode: () => PatchVNodeFn): {
|
|
5
|
+
mountJSX: (parent: unknown, type: NodeType | ((props: unknown) => VNodeLike), props?: MountProps & Record<string, unknown>) => MountHandle;
|
|
6
|
+
remountAll: () => void;
|
|
7
|
+
unmountJSX: (target: SurfaceTarget | unknown) => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/vdom/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACV,MAAM,SAAS,CAAA;AAmBhB,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,OAAO,EACvB,UAAU,EAAE,MAAM,SAAS,EAC3B,aAAa,EAAE,MAAM,YAAY;uBAGvB,OAAO,QACT,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS,CAAC,UACzC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1C,WAAW;sBAwDS,IAAI;yBA4BC,aAAa,GAAG,OAAO,KAAG,IAAI;EAwB3D"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
function buildRootVNode(state, type, props) {
|
|
2
|
+
if (state.bridge.wrapRootVNode) {
|
|
3
|
+
return state.bridge.wrapRootVNode(type, props);
|
|
4
|
+
}
|
|
5
|
+
const { disableAutoSize: _d, key: _k, ...componentProps } = props;
|
|
6
|
+
return {
|
|
7
|
+
type,
|
|
8
|
+
props: componentProps,
|
|
9
|
+
children: []
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function createSurfaceOps(state, getMount, getUnmount, getPatchVNode) {
|
|
13
|
+
function mountJSX(parent, type, props = { width: 0, height: 0 }) {
|
|
14
|
+
const mount = getMount();
|
|
15
|
+
const patchVNode = getPatchVNode();
|
|
16
|
+
const key = props.key;
|
|
17
|
+
const existingMount = state.registry.findByParentAndKey(
|
|
18
|
+
parent,
|
|
19
|
+
key,
|
|
20
|
+
state.getHostAdapter().isAlive
|
|
21
|
+
);
|
|
22
|
+
if (existingMount) {
|
|
23
|
+
const newWidth = props.width ?? existingMount.props.width;
|
|
24
|
+
const newHeight = props.height ?? existingMount.props.height;
|
|
25
|
+
const { key: _k, ...componentProps } = props;
|
|
26
|
+
existingMount.props = {
|
|
27
|
+
...existingMount.props,
|
|
28
|
+
...componentProps,
|
|
29
|
+
width: newWidth,
|
|
30
|
+
height: newHeight
|
|
31
|
+
};
|
|
32
|
+
const newVNode = buildRootVNode(state, existingMount.type, existingMount.props);
|
|
33
|
+
patchVNode(parent, existingMount.vnode, newVNode);
|
|
34
|
+
existingMount.vnode = newVNode;
|
|
35
|
+
const handle2 = existingMount.rootNode;
|
|
36
|
+
handle2.unmount = () => unmountJSX(handle2);
|
|
37
|
+
return handle2;
|
|
38
|
+
}
|
|
39
|
+
const surface = state.getSurfaceAdapter().createRoot({
|
|
40
|
+
kind: "root",
|
|
41
|
+
target: state.bridge.extractSurfaceTarget?.(parent) ?? parent,
|
|
42
|
+
width: props.width,
|
|
43
|
+
height: props.height
|
|
44
|
+
});
|
|
45
|
+
const vnode = buildRootVNode(state, type, props);
|
|
46
|
+
const rootNode = mount(surface.root, vnode);
|
|
47
|
+
const registryId = state.registry.register({
|
|
48
|
+
parent,
|
|
49
|
+
type,
|
|
50
|
+
props,
|
|
51
|
+
rootNode,
|
|
52
|
+
vnode,
|
|
53
|
+
surface
|
|
54
|
+
});
|
|
55
|
+
const handle = rootNode;
|
|
56
|
+
handle.unmount = () => unmountJSX(handle);
|
|
57
|
+
if (!state.registry.getEntry(registryId)) {
|
|
58
|
+
throw new Error("Failed to register mount");
|
|
59
|
+
}
|
|
60
|
+
return handle;
|
|
61
|
+
}
|
|
62
|
+
function remountAll() {
|
|
63
|
+
const mount = getMount();
|
|
64
|
+
const unmount = getUnmount();
|
|
65
|
+
const entries = state.registry.getAllEntries();
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
const surface = entry.surface;
|
|
68
|
+
const adapter = state.getSurfaceAdapter();
|
|
69
|
+
if (!surface || (adapter.isAlive ? !adapter.isAlive(surface) : false)) {
|
|
70
|
+
state.registry.unregister(entry.id);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
adapter.updateRoot(surface, {
|
|
74
|
+
width: entry.props.width,
|
|
75
|
+
height: entry.props.height
|
|
76
|
+
});
|
|
77
|
+
if (entry.vnode) {
|
|
78
|
+
unmount(entry.vnode);
|
|
79
|
+
}
|
|
80
|
+
const nextVNode = buildRootVNode(state, entry.type, entry.props);
|
|
81
|
+
const rootNode = mount(surface.root, nextVNode);
|
|
82
|
+
entry.rootNode = rootNode;
|
|
83
|
+
entry.vnode = nextVNode;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function unmountJSX(target) {
|
|
87
|
+
const unmount = getUnmount();
|
|
88
|
+
const entry = state.bridge.isSurfaceTarget?.(target) ? state.registry.findByParentAndKey(target, void 0, state.getHostAdapter().isAlive) : state.registry.getEntryByNode(target);
|
|
89
|
+
if (!entry) return;
|
|
90
|
+
if (entry.vnode) {
|
|
91
|
+
unmount(entry.vnode);
|
|
92
|
+
}
|
|
93
|
+
if (entry.surface) {
|
|
94
|
+
state.getSurfaceAdapter().destroyRoot(entry.surface);
|
|
95
|
+
}
|
|
96
|
+
state.registry.unregister(entry.id);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
mountJSX,
|
|
100
|
+
remountAll,
|
|
101
|
+
unmountJSX
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
createSurfaceOps
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.js","sources":["../../src/vdom/surface.ts"],"sourcesContent":["import type { NodeType, SurfaceTarget } from '../host-adapter'\nimport type { VNode, VNodeLike } from '../types'\nimport type {\n MountFn,\n MountHandle,\n MountProps,\n PatchVNodeFn,\n RuntimeState,\n UnmountFn,\n} from './types'\n\nfunction buildRootVNode(\n state: RuntimeState,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown>\n): VNode {\n if (state.bridge.wrapRootVNode) {\n return state.bridge.wrapRootVNode(type, props)\n }\n\n const { disableAutoSize: _d, key: _k, ...componentProps } = props\n return {\n type,\n props: componentProps,\n children: [],\n }\n}\n\nexport function createSurfaceOps(\n state: RuntimeState,\n getMount: () => MountFn,\n getUnmount: () => UnmountFn,\n getPatchVNode: () => PatchVNodeFn\n) {\n function mountJSX(\n parent: unknown,\n type: NodeType | ((props: unknown) => VNodeLike),\n props: MountProps & Record<string, unknown> = { width: 0, height: 0 }\n ): MountHandle {\n const mount = getMount()\n const patchVNode = getPatchVNode()\n const key = props.key\n const existingMount = state.registry.findByParentAndKey(\n parent,\n key,\n state.getHostAdapter().isAlive\n )\n\n if (existingMount) {\n const newWidth = props.width ?? existingMount.props.width\n const newHeight = props.height ?? existingMount.props.height\n const { key: _k, ...componentProps } = props\n existingMount.props = {\n ...existingMount.props,\n ...componentProps,\n width: newWidth,\n height: newHeight,\n }\n\n const newVNode = buildRootVNode(state, existingMount.type, existingMount.props)\n patchVNode(parent, existingMount.vnode, newVNode)\n existingMount.vnode = newVNode\n\n const handle = existingMount.rootNode as MountHandle\n handle.unmount = () => unmountJSX(handle)\n return handle\n }\n\n const surface = state.getSurfaceAdapter().createRoot({\n kind: 'root',\n target: state.bridge.extractSurfaceTarget?.(parent) ?? (parent as SurfaceTarget),\n width: props.width,\n height: props.height,\n })\n\n const vnode = buildRootVNode(state, type, props)\n const rootNode = mount(surface.root, vnode)\n const registryId = state.registry.register({\n parent,\n type,\n props,\n rootNode,\n vnode,\n surface,\n })\n\n const handle = rootNode as MountHandle\n handle.unmount = () => unmountJSX(handle)\n if (!state.registry.getEntry(registryId)) {\n throw new Error('Failed to register mount')\n }\n return handle\n }\n\n function remountAll(): void {\n const mount = getMount()\n const unmount = getUnmount()\n const entries = state.registry.getAllEntries()\n for (const entry of entries) {\n const surface = entry.surface\n const adapter = state.getSurfaceAdapter()\n if (!surface || (adapter.isAlive ? !adapter.isAlive(surface) : false)) {\n state.registry.unregister(entry.id)\n continue\n }\n\n adapter.updateRoot(surface, {\n width: entry.props.width,\n height: entry.props.height,\n })\n\n if (entry.vnode) {\n unmount(entry.vnode)\n }\n\n const nextVNode = buildRootVNode(state, entry.type, entry.props)\n const rootNode = mount(surface.root, nextVNode)\n entry.rootNode = rootNode\n entry.vnode = nextVNode\n }\n }\n\n function unmountJSX(target: SurfaceTarget | unknown): void {\n const unmount = getUnmount()\n const entry = state.bridge.isSurfaceTarget?.(target)\n ? state.registry.findByParentAndKey(target, undefined, state.getHostAdapter().isAlive)\n : state.registry.getEntryByNode(target)\n\n if (!entry) return\n\n if (entry.vnode) {\n unmount(entry.vnode)\n }\n\n if (entry.surface) {\n state.getSurfaceAdapter().destroyRoot(entry.surface)\n }\n\n state.registry.unregister(entry.id)\n }\n\n return {\n mountJSX,\n remountAll,\n unmountJSX,\n }\n}\n"],"names":["handle"],"mappings":"AAWA,SAAS,eACP,OACA,MACA,OACO;AACP,MAAI,MAAM,OAAO,eAAe;AAC9B,WAAO,MAAM,OAAO,cAAc,MAAM,KAAK;AAAA,EAC/C;AAEA,QAAM,EAAE,iBAAiB,IAAI,KAAK,IAAI,GAAG,mBAAmB;AAC5D,SAAO;AAAA,IACL;AAAA,IACA,OAAO;AAAA,IACP,UAAU,CAAA;AAAA,EAAC;AAEf;AAEO,SAAS,iBACd,OACA,UACA,YACA,eACA;AACA,WAAS,SACP,QACA,MACA,QAA8C,EAAE,OAAO,GAAG,QAAQ,KACrD;AACb,UAAM,QAAQ,SAAA;AACd,UAAM,aAAa,cAAA;AACnB,UAAM,MAAM,MAAM;AAClB,UAAM,gBAAgB,MAAM,SAAS;AAAA,MACnC;AAAA,MACA;AAAA,MACA,MAAM,iBAAiB;AAAA,IAAA;AAGzB,QAAI,eAAe;AACjB,YAAM,WAAW,MAAM,SAAS,cAAc,MAAM;AACpD,YAAM,YAAY,MAAM,UAAU,cAAc,MAAM;AACtD,YAAM,EAAE,KAAK,IAAI,GAAG,mBAAmB;AACvC,oBAAc,QAAQ;AAAA,QACpB,GAAG,cAAc;AAAA,QACjB,GAAG;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,UAAI,MAAM,OAAO;AACf,gBAAQ,MAAM,KAAK;AAAA,MACrB;AAEA,YAAM,YAAY,eAAe,OAAO,MAAM,MAAM,MAAM,KAAK;AAC/D,YAAM,WAAW,MAAM,QAAQ,MAAM,SAAS;AAC9C,YAAM,WAAW;AACjB,YAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AAEA,WAAS,WAAW,QAAuC;AACzD,UAAM,UAAU,WAAA;AAChB,UAAM,QAAQ,MAAM,OAAO,kBAAkB,MAAM,IAC/C,MAAM,SAAS,mBAAmB,QAAQ,QAAW,MAAM,iBAAiB,OAAO,IACnF,MAAM,SAAS,eAAe,MAAM;AAExC,QAAI,CAAC,MAAO;AAEZ,QAAI,MAAM,OAAO;AACf,cAAQ,MAAM,KAAK;AAAA,IACrB;AAEA,QAAI,MAAM,SAAS;AACjB,YAAM,kBAAA,EAAoB,YAAY,MAAM,OAAO;AAAA,IACrD;AAEA,UAAM,SAAS,WAAW,MAAM,EAAE;AAAA,EACpC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { HookContext } from '../hooks';
|
|
2
|
+
import { HostAdapter, HostContext, HostNode, HostParent, NodeType, Props, RootSurface, SurfaceAdapter, SurfaceTarget } from '../host-adapter';
|
|
3
|
+
import { LayoutContainer } from '../layout/types';
|
|
4
|
+
import { PartialTheme } from '../theme';
|
|
5
|
+
import { VNode, VNodeLike } from '../types';
|
|
6
|
+
export interface MountProps {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
disableAutoSize?: boolean;
|
|
10
|
+
key?: string;
|
|
11
|
+
}
|
|
12
|
+
export type MountComponentProps<P = Record<string, never>> = MountProps & P;
|
|
13
|
+
export type MountHandle = HostNode & {
|
|
14
|
+
unmount: () => void;
|
|
15
|
+
};
|
|
16
|
+
export interface MountRegistryEntry {
|
|
17
|
+
id: number;
|
|
18
|
+
parent: HostParent;
|
|
19
|
+
type: NodeType | ((props: unknown) => VNodeLike);
|
|
20
|
+
props: MountProps & Record<string, unknown>;
|
|
21
|
+
rootNode: HostNode;
|
|
22
|
+
vnode: VNode;
|
|
23
|
+
surface?: RootSurface | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolveNodePropsResult {
|
|
26
|
+
props: Props;
|
|
27
|
+
nestedTheme: PartialTheme;
|
|
28
|
+
}
|
|
29
|
+
export interface VDOMRuntimeBridge {
|
|
30
|
+
createDummyNode(parent: HostParent): HostNode;
|
|
31
|
+
getHostContext(parent: HostParent): HostContext;
|
|
32
|
+
resolveProps(type: NodeType, theme: PartialTheme | undefined, props: Props): ResolveNodePropsResult;
|
|
33
|
+
attachSurfaceContext?(node: HostNode, context: HostContext): void;
|
|
34
|
+
getParentContentSize?(parent: HostParent): {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
} | undefined;
|
|
38
|
+
afterLayout?(container: LayoutContainer, parent: HostParent): void;
|
|
39
|
+
wrapRootVNode?(type: NodeType | ((props: unknown) => VNodeLike), props: MountProps & Record<string, unknown>): VNode;
|
|
40
|
+
extractSurfaceTarget?(parent: HostParent): SurfaceTarget | null;
|
|
41
|
+
isSurfaceTarget?(target: unknown): boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface VDOMHookContext extends HookContext {
|
|
44
|
+
parent: HostParent;
|
|
45
|
+
vnode: VNode | null;
|
|
46
|
+
componentVNode: VNode;
|
|
47
|
+
function: (props: unknown) => VNodeLike;
|
|
48
|
+
theme?: PartialTheme | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface MountRegistryContract {
|
|
51
|
+
register(entry: Omit<MountRegistryEntry, 'id'>): number;
|
|
52
|
+
unregister(id: number): void;
|
|
53
|
+
getEntry(id: number): MountRegistryEntry | undefined;
|
|
54
|
+
getEntryByNode(node: unknown): MountRegistryEntry | undefined;
|
|
55
|
+
findByParentAndKey(parent: HostParent, key: string | undefined, isAlive: (target: HostNode | HostParent) => boolean): MountRegistryEntry | undefined;
|
|
56
|
+
getAllEntries(): MountRegistryEntry[];
|
|
57
|
+
clear(): void;
|
|
58
|
+
getStats(hostAdapter: HostAdapter): {
|
|
59
|
+
totalMounts: number;
|
|
60
|
+
byType: Map<string, number>;
|
|
61
|
+
byParent: Map<HostParent, number>;
|
|
62
|
+
byKey: Map<string, number>;
|
|
63
|
+
mounts: Array<{
|
|
64
|
+
id: number;
|
|
65
|
+
type: string;
|
|
66
|
+
key?: string;
|
|
67
|
+
parentType: string;
|
|
68
|
+
propsKeys: string[];
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export interface RuntimeState {
|
|
73
|
+
getHostAdapter(): HostAdapter;
|
|
74
|
+
getSurfaceAdapter(): SurfaceAdapter;
|
|
75
|
+
bridge: VDOMRuntimeBridge;
|
|
76
|
+
registry: MountRegistryContract;
|
|
77
|
+
}
|
|
78
|
+
export type MountFn = (parent: HostParent, vnode: VNode) => HostNode;
|
|
79
|
+
export type UnmountFn = (vnode: VNode | null | undefined | false) => void;
|
|
80
|
+
export type PatchVNodeFn = (parent: HostParent, oldV: VNode | null, newV: VNode | null) => void;
|
|
81
|
+
export interface VDOMRuntime {
|
|
82
|
+
mount(parent: HostParent, vnode: VNode): HostNode;
|
|
83
|
+
unmount(vnode: VNode | null | undefined | false): void;
|
|
84
|
+
patchVNode(parent: HostParent, oldV: VNode | null, newV: VNode | null): void;
|
|
85
|
+
mountJSX(parent: HostParent, type: NodeType | ((props: unknown) => VNodeLike), props?: MountProps & Record<string, unknown>): MountHandle;
|
|
86
|
+
unmountJSX(target: SurfaceTarget | HostNode): void;
|
|
87
|
+
remountAll(): void;
|
|
88
|
+
normalizeVNodeLike(rendered: VNodeLike): VNode | null;
|
|
89
|
+
createElement(type: string | ((props: Record<string, unknown>) => VNode), props: Record<string, unknown> | null, ...children: VNode[]): VNode;
|
|
90
|
+
getHostAdapter(): HostAdapter;
|
|
91
|
+
setHostAdapter(adapter: HostAdapter): HostAdapter;
|
|
92
|
+
getSurfaceAdapter(): SurfaceAdapter;
|
|
93
|
+
setSurfaceAdapter(adapter: SurfaceAdapter): SurfaceAdapter;
|
|
94
|
+
getMountStats(): ReturnType<MountRegistryContract['getStats']>;
|
|
95
|
+
readonly mountRegistry: {
|
|
96
|
+
register(entry: Omit<MountRegistryEntry, 'id'>): number;
|
|
97
|
+
unregister(id: number): void;
|
|
98
|
+
findByParentAndKey(parent: HostParent, key?: string): MountRegistryEntry | undefined;
|
|
99
|
+
getAllEntries(): MountRegistryEntry[];
|
|
100
|
+
getEntry(id: number): MountRegistryEntry | undefined;
|
|
101
|
+
clear(): void;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/vdom/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,KAAK,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,UAAU,GAAG,CAAC,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