@caperjs/solid 0.7.2 → 0.7.4
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/lib/caper-plugin-solid.mjs +1 -1
- package/lib/caper-plugin-solid.mjs.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/version.ts +1 -1
|
@@ -3,7 +3,7 @@ import { Show as t, createComponent as n, createEffect as r, createMemo as i, cr
|
|
|
3
3
|
import { Application as f, Container as p, FlexContainer as m, Scene as h, resolveAnchor as g, resolvePivot as _, resolvePosition as v, resolveScale as y, resolveUnknownKeys as b } from "@caperjs/core";
|
|
4
4
|
import { Container as x, Graphics as S, Sprite as C, Text as w } from "pixi.js";
|
|
5
5
|
//#region src/version.ts
|
|
6
|
-
var T = "0.7.
|
|
6
|
+
var T = "0.7.4";
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/animated.ts
|
|
9
9
|
function E(t, n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caper-plugin-solid.mjs","names":["gsap","Container","createEffect","createMemo","createSignal","on","onCleanup","Show","untrack","ENTER_FROM","TweenVars","pixi","alpha","scale","ENTER_TO","duration","ease","EXIT_TO","AnimatedShow","props","when","children","enter","exit","open","mounted","setMounted","wrapper","animation","core","Tween","stop","kill","undefined","isOpen","node","set","to","onComplete","defer","_el$","_$createElement","_$use","el","_$insert","_$createComponent","memo","mergeProps"],"sources":["../src/version.ts","../src/animated.ts","../src/AnimatedShow.tsx","../../../node_modules/.pnpm/solid-js@1.9.15/node_modules/solid-js/universal/dist/universal.js","../src/catalog.ts","../src/renderer.ts","../src/asComponent.ts","../src/Composable.ts","../src/useTick.ts","../src/index.ts"],"sourcesContent":["export const version = '0.7.2';","// A \"gliding\" signal: same read shape as any other accessor, but it eases toward\n// its source instead of snapping to it. The binding stays declarative —\n// `x={slid()}` — and nothing in the view knows an animation is running.\n\nimport gsap from 'gsap';\nimport { createEffect, createSignal, on, onCleanup, untrack } from 'solid-js';\n\n/**\n * Follow `source` smoothly.\n *\n * Must be called inside a reactive owner (a component body or a `compose()`),\n * because it registers an `onCleanup` to kill its animation.\n *\n * ```ts\n * const barWidth = animated(() => hp() / 100);\n * <graphics scale={{ x: barWidth(), y: 1 }} />\n * ```\n */\nexport function animated(source: () => number, opts?: { duration?: number; ease?: string }): () => number {\n const start = untrack(source);\n const [value, setValue] = createSignal(start);\n\n // gsap animates plain object properties, so the accessor's current value lives\n // on this proxy and is mirrored into the signal on every frame.\n const proxy = { v: start };\n\n const animateTo = gsap.quickTo(proxy, 'v', {\n duration: opts?.duration ?? 0.35,\n ease: opts?.ease ?? 'power2.out',\n onUpdate: () => setValue(proxy.v),\n });\n\n // `defer: true` skips the initial run, so mounting doesn't animate from nowhere.\n createEffect(on(source, (next) => animateTo(next), { defer: true }));\n\n onCleanup(() => animateTo.tween.kill());\n\n return value;\n}\n","// `<Show>` unmounts the instant its condition flips, which is fine for a scene\n// graph and terrible for a popup. `<AnimatedShow>` keeps the node on stage until\n// its exit animation finishes, so conditional UI can enter and leave gracefully\n// without the caller writing a single imperative line.\n\nimport gsap from 'gsap';\nimport type { Container } from 'pixi.js';\nimport { createEffect, createMemo, createSignal, on, onCleanup, Show, untrack } from 'solid-js';\n\n/** Where an entering node starts from, before it animates to `enter`. */\nconst ENTER_FROM: gsap.TweenVars = { pixi: { alpha: 0, scale: 0.85 } };\nconst ENTER_TO: gsap.TweenVars = { pixi: { alpha: 1, scale: 1 }, duration: 0.25, ease: 'back.out(1.7)' };\nconst EXIT_TO: gsap.TweenVars = { pixi: { alpha: 0, scale: 0.85 }, duration: 0.2, ease: 'power2.in' };\n\n/**\n * Conditional UI with enter / exit animations.\n *\n * ```tsx\n * <AnimatedShow when={open}>\n * <container>…</container>\n * </AnimatedShow>\n * ```\n *\n * Custom `enter` / `exit` are plain GSAP vars — put target properties in a\n * `pixi: {...}` block (`{ pixi: { y: 20, alpha: 0 }, duration: 0.3 }`).\n * There is no `fallback` — the whole point is that the node outlives the flag.\n *\n * Requires GSAP's PixiPlugin, which caper's `GSAPPlugin` registers during app\n * bootstrap. This package deliberately does not register it itself; outside a\n * booted `Application` (tests, standalone use) call\n * `gsap.registerPlugin(PixiPlugin)` yourself first.\n */\nexport function AnimatedShow(props: {\n when: boolean | (() => boolean);\n children: any;\n enter?: gsap.TweenVars;\n exit?: gsap.TweenVars;\n}) {\n const open = createMemo(() => (typeof props.when === 'function' ? props.when() : props.when));\n // Trails `open`: goes true immediately, goes false only once the exit is done.\n const [mounted, setMounted] = createSignal(untrack(open));\n\n let wrapper: Container | undefined;\n let animation: gsap.core.Tween | undefined;\n\n const stop = () => {\n animation?.kill();\n animation = undefined;\n };\n\n createEffect(\n on(\n open,\n (isOpen) => {\n const node = wrapper;\n if (!node) return;\n // Killing first is what makes rapid toggling safe: the exit's\n // `onComplete` can no longer unmount a node that is entering again.\n stop();\n\n if (isOpen) {\n setMounted(true);\n gsap.set(node, ENTER_FROM);\n animation = gsap.to(node, props.enter ?? ENTER_TO);\n } else {\n const exit = props.exit ?? EXIT_TO;\n animation = gsap.to(node, {\n ...exit,\n onComplete: () => {\n (exit.onComplete as (() => void) | undefined)?.();\n setMounted(false);\n },\n });\n }\n },\n { defer: true },\n ),\n );\n\n onCleanup(stop);\n\n return (\n <container ref={(el: Container) => (wrapper = el)}>\n <Show when={mounted()}>{props.children}</Show>\n </container>\n );\n}\n","import { createMemo, createComponent, createRenderEffect, mergeProps, untrack, createRoot } from 'solid-js';\n\nconst memo = fn => createMemo(() => fn());\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), current = value);\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return current = replacement;\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, multi && current || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return current = cleanChildren(parent, current, marker, value);\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart] : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while (removed = getFirstChild(parent)) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i) isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","import { FlexContainer } from '@caperjs/core';\nimport { Container, Graphics, Sprite, Text } from 'pixi.js';\n\n/**\n * The intrinsic elements JSX can name. Every entry is a zero-arg-constructible\n * Pixi display object; the renderer applies props to the instance afterwards.\n */\nexport const catalog = {\n container: Container,\n sprite: Sprite,\n text: Text,\n graphics: Graphics,\n // Caper UI primitive. Its layout props (`gap`, `flexDirection`, …) are plain\n // accessors that re-run its deferred layout pass, so `setProperty`'s default\n // assignment is all it needs.\n flexContainer: FlexContainer,\n} as const;\n\nexport type CatalogTag = keyof typeof catalog;\n\n/** Construct the display object for an intrinsic tag. Throws on unknown tags. */\nexport function createCatalogNode(tag: string): Container {\n const Ctor = catalog[tag as CatalogTag] as unknown as (new () => Container) | undefined;\n if (!Ctor) {\n throw new Error(`[@caperjs/solid] Unknown element <${tag}>. Known elements: ${Object.keys(catalog).join(', ')}.`);\n }\n return new Ctor();\n}\n","// A SolidJS \"universal renderer\" whose host nodes are Pixi display objects.\n//\n// This file plays the role of framework internals, so raw Pixi is fine here.\n\nimport {\n Application,\n FlexContainer,\n resolveAnchor,\n resolvePivot,\n resolvePosition,\n resolveScale,\n resolveUnknownKeys,\n} from '@caperjs/core';\nimport { Container, Graphics, Text } from 'pixi.js';\nimport { createRenderer } from 'solid-js/universal';\n\nimport { createCatalogNode } from './catalog';\n\nexport type PixiNode = Container;\n\n/**\n * Re-measure and relayout a FlexContainer child whose content just changed.\n *\n * Solid inserts a node first and sets `text` / `style` after, so yoga measures\n * the child while it is still empty and caches a zero-width intrinsic size — the\n * child then renders scaled to nothing. `FlexContainer.updateLayout()` alone\n * doesn't fix it: `@pixi/layout` throttles its intrinsic-size pass to 100ms, and\n * caper runs the layout system with `autoUpdate: false`, so nothing ever\n * re-measures. Drive that pass directly instead.\n */\nfunction invalidateFlexChild(node: any) {\n const parent = node.parent;\n if (!(parent instanceof FlexContainer)) return;\n node.layout?.forceUpdate?.();\n const layoutSystem = Application.getInstance().renderer.layout as any;\n layoutSystem._updateSize(parent);\n layoutSystem.updateLayout(parent);\n}\n\nconst renderer = createRenderer<PixiNode>({\n createElement(tag: string): PixiNode {\n const node = createCatalogNode(tag);\n // Text is decoration by default — opting into events is what `on*` props (or\n // an explicit `eventMode` prop, applied after creation) are for.\n if (node instanceof Text) node.eventMode = 'none';\n return node;\n },\n\n createTextNode(value: string): PixiNode {\n const node = new Text({ text: String(value) });\n node.eventMode = 'none';\n // Marks this as a JSX text node so `<text>` elements aren't mistaken for one.\n (node as any).__isTextNode = true;\n return node;\n },\n\n replaceText(node: PixiNode, value: string) {\n (node as Text).text = String(value);\n },\n\n isTextNode(node: PixiNode) {\n return node instanceof Text && (node as any).__isTextNode === true;\n },\n\n setProperty(node: any, name: string, value: any, prev?: any) {\n if (name === 'draw') {\n if (!(node instanceof Graphics)) {\n throw new Error(\n `[@caperjs/solid] The \\`draw\\` prop is only valid on <graphics>, received it on ${node?.constructor?.name}.`,\n );\n }\n node.clear();\n value?.(node);\n return;\n }\n\n if (name.startsWith('on') && typeof value === 'function') {\n const ev = name.slice(2).toLowerCase();\n if (prev) node.off(ev, prev);\n node.on(ev, value);\n node.eventMode = 'static';\n return;\n }\n\n // Point-like props go through the same resolvers `this.add.*` uses, so\n // `scale={2}`, `scale={{ x, y }}` and `scale={[x, y]}` behave identically in\n // JSX and in factory config.\n switch (name) {\n case 'position':\n resolvePosition({ position: value }, node);\n return;\n case 'scale':\n resolveScale({ scale: value }, node);\n return;\n case 'pivot':\n resolvePivot(value, node);\n return;\n case 'anchor':\n resolveAnchor(value, node);\n return;\n }\n\n resolveUnknownKeys({ [name]: value }, node);\n invalidateFlexChild(node);\n },\n\n insertNode(parent: PixiNode, node: PixiNode, anchor?: PixiNode) {\n if (anchor) {\n parent.addChildAt(node, parent.getChildIndex(anchor));\n } else {\n parent.addChild(node);\n }\n\n // Solid may set a node's props before inserting it, so re-measure on the next\n // tick — by then the whole tree has been built and every prop is applied.\n if (parent instanceof FlexContainer) {\n Application.getInstance().ticker.addOnce(() => invalidateFlexChild(node));\n }\n },\n\n removeNode(parent: PixiNode, node: PixiNode) {\n parent.removeChild(node);\n node.destroy({ children: true });\n },\n\n getParentNode(node: PixiNode) {\n return node.parent ?? undefined;\n },\n\n getFirstChild(node: PixiNode) {\n return node.children[0] as PixiNode | undefined;\n },\n\n getNextSibling(node: PixiNode) {\n const parent = node.parent;\n if (!parent) return undefined;\n return parent.children[parent.getChildIndex(node) + 1] as PixiNode | undefined;\n },\n});\n\n// The babel universal transform imports its runtime from this module.\nexport const {\n render,\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = renderer;\n","// Lifting existing imperative display classes into JSX — the escape hatch that\n// keeps the intrinsic catalog small.\n\nimport { untrack } from 'solid-js';\n\nimport type { PixiNode } from './renderer';\nimport { spread } from './renderer';\n\n/**\n * Lift an existing imperative display class into a JSX component.\n *\n * The instance is constructed once (untracked, so constructor reads don't\n * subscribe to anything) and every prop is then applied through the renderer's\n * own `spread`, which gives them the same reactivity as an intrinsic element —\n * including `ref`.\n *\n * ```tsx\n * const Orbiter$ = asComponent(Orbiter);\n * <Orbiter$ x={40} y={80} />\n * ```\n *\n * @param Ctor - The display class to lift. Called as `new Ctor(defaults)`.\n * @param defaults - Config handed to the constructor on every mount.\n */\nexport function asComponent<TNode extends PixiNode, TConfig>(\n Ctor: new (config?: TConfig) => TNode,\n defaults?: TConfig,\n): (props: Record<string, any>) => TNode {\n return (props) => {\n const node = untrack(() => new Ctor(defaults));\n // Skip the children pass when none were passed — otherwise Solid's spread\n // \"clears\" the node, which would wipe anything the class built for itself\n // (in `added()`, its own `compose()`, or the constructor).\n spread(node, props as any, !('children' in props));\n return node;\n };\n}\n","// The `compose()` contract: a display object declares its members by returning\n// JSX, that tree is mounted ONCE the first time the object hits the stage, and\n// signals do every update after that — no re-render, no diff.\n\nimport { Container, Constructor, Scene } from '@caperjs/core';\nimport type { DestroyOptions } from 'pixi.js';\n\nimport type { PixiNode } from './renderer';\nimport { render } from './renderer';\n\n/**\n * What `compose()` hands back. `unknown` for now so this file stays JSX-free;\n * it becomes the real element type when `jsx.d.ts` lands.\n */\nexport type Composed = unknown;\n\n/**\n * The optional contract a `Composable` subclass opts into. Declared separately\n * from the mixin (rather than merged onto it) so the mixin never claims a\n * `compose` member of its own — the runtime just checks for one.\n *\n * @example\n * ```tsx\n * class HealthBar extends ComposableContainer implements Composes {\n * compose() {\n * return <text text=\"100 HP\" />;\n * }\n * }\n * ```\n */\nexport interface Composes {\n compose(): Composed;\n}\n\n/**\n * Give a display class the `compose()` contract.\n *\n * The mixin adds no public members, so the returned constructor keeps `Base`'s\n * own type — `compose()` is declared by the subclass via {@link Composes}.\n *\n * @param Base - The display class to make composable.\n */\nexport function Composable<TBase extends Constructor<any>>(Base: TBase): TBase {\n return class extends Base {\n private __composeDispose?: () => void;\n private __composed = false;\n\n constructor(...args: any[]) {\n super(...args);\n // Mount off Pixi's native 'added' event rather than the `added()` hook:\n // subclasses routinely override `added()` without calling `super.added()`,\n // which would silently skip the mount. Core's own lifecycle listens to the\n // same event, so this coexists with it (and runs after it).\n this.once('added', this.__mountCompose);\n }\n\n destroy(options?: DestroyOptions): void {\n // Dispose the reactive graph first. Solid's disposal stops effects but does\n // not detach the nodes it created — `super.destroy()` handles those, so\n // there is no double-destroy path here.\n this.__composeDispose?.();\n this.__composeDispose = undefined;\n super.destroy(options);\n }\n\n private __mountCompose() {\n if (this.__composed) return;\n this.__composed = true;\n const host = this as Partial<Composes>;\n if (typeof host.compose !== 'function') return;\n // `Base` is only known as `Constructor<any>` here, so `this` has to be\n // asserted into the renderer's host-node type.\n this.__composeDispose = render(() => host.compose!() as PixiNode, this as unknown as PixiNode);\n }\n } as unknown as TBase;\n}\n\n/** A caper {@link Container} that can declare its members with JSX. */\nexport const ComposableContainer = Composable(Container);\nexport type ComposableContainer = InstanceType<typeof ComposableContainer>;\n\n/** A caper {@link Scene} that can declare its members with JSX. */\nexport const ComposableScene = Composable(Scene);\nexport type ComposableScene = InstanceType<typeof ComposableScene>;\n","import { Application } from '@caperjs/core';\nimport type { Ticker } from 'pixi.js';\nimport { onCleanup } from 'solid-js';\n\n/** Run `fn` every frame for the lifetime of the owning component. */\nexport function useTick(fn: (ticker: Ticker) => void) {\n const app = Application.getInstance();\n app.ticker.add(fn);\n onCleanup(() => app.ticker.remove(fn));\n}\n","import { version } from './version';\n\nexport const VERSION = version;\n\nexport * from './animated';\nexport * from './AnimatedShow';\nexport * from './asComponent';\nexport * from './catalog';\nexport * from './Composable';\nexport * from './renderer';\nexport * from './useTick';\n"],"x_google_ignoreList":[3],"mappings":";;;;;AAAA,IAAa,IAAU;;;ACkBvB,SAAgB,EAAS,GAAsB,GAA2D;CACxG,IAAM,IAAQ,EAAQ,EAAO,EACvB,CAAC,GAAO,KAAY,EAAa,EAAM,EAIvC,IAAQ,EAAE,GAAG,GAAO,EAEpB,IAAY,EAAK,QAAQ,GAAO,KAAK;EACzC,UAAU,GAAM,YAAY;EAC5B,MAAM,GAAM,QAAQ;EACpB,gBAAgB,EAAS,EAAM,EAAE;EAClC,CAAC;AAOF,QAJA,EAAa,EAAG,IAAS,MAAS,EAAU,EAAK,EAAE,EAAE,OAAO,IAAM,CAAC,CAAC,EAEpE,QAAgB,EAAU,MAAM,MAAM,CAAC,EAEhC;;;;AC3BT,IAAMS,IAA6B,EAAEE,MAAM;CAAEC,OAAO;CAAGC,OAAO;CAAK,EAAG,EAChEC,IAA2B;CAAEH,MAAM;EAAEC,OAAO;EAAGC,OAAO;EAAG;CAAEE,UAAU;CAAMC,MAAM;CAAiB,EAClGC,IAA0B;CAAEN,MAAM;EAAEC,OAAO;EAAGC,OAAO;EAAM;CAAEE,UAAU;CAAKC,MAAM;CAAa;AAoBrG,SAAgBE,EAAaC,GAK1B;CACD,IAAMK,IAAOrB,QAAkB,OAAOgB,EAAMC,QAAS,aAAaD,EAAMC,MAAM,GAAGD,EAAMC,KAAM,EAEvF,CAACK,GAASC,KAActB,EAAaI,EAAQgB,EAAK,CAAC,EAErDG,GACAC,GAEEG,UAAa;AAE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CAAC;;;AClHF,SAAgB,EACd,GACA,GACuC;AACvC,SAAQ,MAAU;EAChB,IAAM,IAAO,QAAc,IAAI,EAAK,EAAS,CAAC;AAK9C,SADA,EAAO,GAAM,GAAc,EAAE,cAAc,GAAO,EAC3C;;;;;ACQX,SAAgB,EAA2C,GAAoB;AAC7E,QAAO,cAAc,EAAK;EAIxB,YAAY,GAAG,GAAa;AAM1B,GALA,MAAM,GAAG,EAAK,oBAHK,IAQnB,KAAK,KAAK,SAAS,KAAK,eAAe;;EAGzC,QAAQ,GAAgC;AAMtC,GAFA,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,KAAA,GACxB,MAAM,QAAQ,EAAQ;;EAGxB,iBAAyB;AACvB,OAAI,KAAK,WAAY;AACrB,QAAK,aAAa;GAClB,IAAM,IAAO;AACT,UAAO,EAAK,WAAY,eAG5B,KAAK,mBAAmB,QAAa,EAAK,SAAU,EAAc,KAA4B;;;;AAMpG,IAAa,IAAsB,EAAW,EAAU,EAI3C,IAAkB,EAAW,EAAM;;;AC7EhD,SAAgB,EAAQ,GAA8B;CACpD,IAAM,IAAM,EAAY,aAAa;AAErC,CADA,EAAI,OAAO,IAAI,EAAG,EAClB,QAAgB,EAAI,OAAO,OAAO,EAAG,CAAC;;;;ACNxC,IAAa,KAAU"}
|
|
1
|
+
{"version":3,"file":"caper-plugin-solid.mjs","names":["gsap","Container","createEffect","createMemo","createSignal","on","onCleanup","Show","untrack","ENTER_FROM","TweenVars","pixi","alpha","scale","ENTER_TO","duration","ease","EXIT_TO","AnimatedShow","props","when","children","enter","exit","open","mounted","setMounted","wrapper","animation","core","Tween","stop","kill","undefined","isOpen","node","set","to","onComplete","defer","_el$","_$createElement","_$use","el","_$insert","_$createComponent","memo","mergeProps"],"sources":["../src/version.ts","../src/animated.ts","../src/AnimatedShow.tsx","../../../node_modules/.pnpm/solid-js@1.9.15/node_modules/solid-js/universal/dist/universal.js","../src/catalog.ts","../src/renderer.ts","../src/asComponent.ts","../src/Composable.ts","../src/useTick.ts","../src/index.ts"],"sourcesContent":["export const version = '0.7.4';","// A \"gliding\" signal: same read shape as any other accessor, but it eases toward\n// its source instead of snapping to it. The binding stays declarative —\n// `x={slid()}` — and nothing in the view knows an animation is running.\n\nimport gsap from 'gsap';\nimport { createEffect, createSignal, on, onCleanup, untrack } from 'solid-js';\n\n/**\n * Follow `source` smoothly.\n *\n * Must be called inside a reactive owner (a component body or a `compose()`),\n * because it registers an `onCleanup` to kill its animation.\n *\n * ```ts\n * const barWidth = animated(() => hp() / 100);\n * <graphics scale={{ x: barWidth(), y: 1 }} />\n * ```\n */\nexport function animated(source: () => number, opts?: { duration?: number; ease?: string }): () => number {\n const start = untrack(source);\n const [value, setValue] = createSignal(start);\n\n // gsap animates plain object properties, so the accessor's current value lives\n // on this proxy and is mirrored into the signal on every frame.\n const proxy = { v: start };\n\n const animateTo = gsap.quickTo(proxy, 'v', {\n duration: opts?.duration ?? 0.35,\n ease: opts?.ease ?? 'power2.out',\n onUpdate: () => setValue(proxy.v),\n });\n\n // `defer: true` skips the initial run, so mounting doesn't animate from nowhere.\n createEffect(on(source, (next) => animateTo(next), { defer: true }));\n\n onCleanup(() => animateTo.tween.kill());\n\n return value;\n}\n","// `<Show>` unmounts the instant its condition flips, which is fine for a scene\n// graph and terrible for a popup. `<AnimatedShow>` keeps the node on stage until\n// its exit animation finishes, so conditional UI can enter and leave gracefully\n// without the caller writing a single imperative line.\n\nimport gsap from 'gsap';\nimport type { Container } from 'pixi.js';\nimport { createEffect, createMemo, createSignal, on, onCleanup, Show, untrack } from 'solid-js';\n\n/** Where an entering node starts from, before it animates to `enter`. */\nconst ENTER_FROM: gsap.TweenVars = { pixi: { alpha: 0, scale: 0.85 } };\nconst ENTER_TO: gsap.TweenVars = { pixi: { alpha: 1, scale: 1 }, duration: 0.25, ease: 'back.out(1.7)' };\nconst EXIT_TO: gsap.TweenVars = { pixi: { alpha: 0, scale: 0.85 }, duration: 0.2, ease: 'power2.in' };\n\n/**\n * Conditional UI with enter / exit animations.\n *\n * ```tsx\n * <AnimatedShow when={open}>\n * <container>…</container>\n * </AnimatedShow>\n * ```\n *\n * Custom `enter` / `exit` are plain GSAP vars — put target properties in a\n * `pixi: {...}` block (`{ pixi: { y: 20, alpha: 0 }, duration: 0.3 }`).\n * There is no `fallback` — the whole point is that the node outlives the flag.\n *\n * Requires GSAP's PixiPlugin, which caper's `GSAPPlugin` registers during app\n * bootstrap. This package deliberately does not register it itself; outside a\n * booted `Application` (tests, standalone use) call\n * `gsap.registerPlugin(PixiPlugin)` yourself first.\n */\nexport function AnimatedShow(props: {\n when: boolean | (() => boolean);\n children: any;\n enter?: gsap.TweenVars;\n exit?: gsap.TweenVars;\n}) {\n const open = createMemo(() => (typeof props.when === 'function' ? props.when() : props.when));\n // Trails `open`: goes true immediately, goes false only once the exit is done.\n const [mounted, setMounted] = createSignal(untrack(open));\n\n let wrapper: Container | undefined;\n let animation: gsap.core.Tween | undefined;\n\n const stop = () => {\n animation?.kill();\n animation = undefined;\n };\n\n createEffect(\n on(\n open,\n (isOpen) => {\n const node = wrapper;\n if (!node) return;\n // Killing first is what makes rapid toggling safe: the exit's\n // `onComplete` can no longer unmount a node that is entering again.\n stop();\n\n if (isOpen) {\n setMounted(true);\n gsap.set(node, ENTER_FROM);\n animation = gsap.to(node, props.enter ?? ENTER_TO);\n } else {\n const exit = props.exit ?? EXIT_TO;\n animation = gsap.to(node, {\n ...exit,\n onComplete: () => {\n (exit.onComplete as (() => void) | undefined)?.();\n setMounted(false);\n },\n });\n }\n },\n { defer: true },\n ),\n );\n\n onCleanup(stop);\n\n return (\n <container ref={(el: Container) => (wrapper = el)}>\n <Show when={mounted()}>{props.children}</Show>\n </container>\n );\n}\n","import { createMemo, createComponent, createRenderEffect, mergeProps, untrack, createRoot } from 'solid-js';\n\nconst memo = fn => createMemo(() => fn());\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), current = value);\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return current = replacement;\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, multi && current || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return current = cleanChildren(parent, current, marker, value);\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart] : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while (removed = getFirstChild(parent)) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i) isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","import { FlexContainer } from '@caperjs/core';\nimport { Container, Graphics, Sprite, Text } from 'pixi.js';\n\n/**\n * The intrinsic elements JSX can name. Every entry is a zero-arg-constructible\n * Pixi display object; the renderer applies props to the instance afterwards.\n */\nexport const catalog = {\n container: Container,\n sprite: Sprite,\n text: Text,\n graphics: Graphics,\n // Caper UI primitive. Its layout props (`gap`, `flexDirection`, …) are plain\n // accessors that re-run its deferred layout pass, so `setProperty`'s default\n // assignment is all it needs.\n flexContainer: FlexContainer,\n} as const;\n\nexport type CatalogTag = keyof typeof catalog;\n\n/** Construct the display object for an intrinsic tag. Throws on unknown tags. */\nexport function createCatalogNode(tag: string): Container {\n const Ctor = catalog[tag as CatalogTag] as unknown as (new () => Container) | undefined;\n if (!Ctor) {\n throw new Error(`[@caperjs/solid] Unknown element <${tag}>. Known elements: ${Object.keys(catalog).join(', ')}.`);\n }\n return new Ctor();\n}\n","// A SolidJS \"universal renderer\" whose host nodes are Pixi display objects.\n//\n// This file plays the role of framework internals, so raw Pixi is fine here.\n\nimport {\n Application,\n FlexContainer,\n resolveAnchor,\n resolvePivot,\n resolvePosition,\n resolveScale,\n resolveUnknownKeys,\n} from '@caperjs/core';\nimport { Container, Graphics, Text } from 'pixi.js';\nimport { createRenderer } from 'solid-js/universal';\n\nimport { createCatalogNode } from './catalog';\n\nexport type PixiNode = Container;\n\n/**\n * Re-measure and relayout a FlexContainer child whose content just changed.\n *\n * Solid inserts a node first and sets `text` / `style` after, so yoga measures\n * the child while it is still empty and caches a zero-width intrinsic size — the\n * child then renders scaled to nothing. `FlexContainer.updateLayout()` alone\n * doesn't fix it: `@pixi/layout` throttles its intrinsic-size pass to 100ms, and\n * caper runs the layout system with `autoUpdate: false`, so nothing ever\n * re-measures. Drive that pass directly instead.\n */\nfunction invalidateFlexChild(node: any) {\n const parent = node.parent;\n if (!(parent instanceof FlexContainer)) return;\n node.layout?.forceUpdate?.();\n const layoutSystem = Application.getInstance().renderer.layout as any;\n layoutSystem._updateSize(parent);\n layoutSystem.updateLayout(parent);\n}\n\nconst renderer = createRenderer<PixiNode>({\n createElement(tag: string): PixiNode {\n const node = createCatalogNode(tag);\n // Text is decoration by default — opting into events is what `on*` props (or\n // an explicit `eventMode` prop, applied after creation) are for.\n if (node instanceof Text) node.eventMode = 'none';\n return node;\n },\n\n createTextNode(value: string): PixiNode {\n const node = new Text({ text: String(value) });\n node.eventMode = 'none';\n // Marks this as a JSX text node so `<text>` elements aren't mistaken for one.\n (node as any).__isTextNode = true;\n return node;\n },\n\n replaceText(node: PixiNode, value: string) {\n (node as Text).text = String(value);\n },\n\n isTextNode(node: PixiNode) {\n return node instanceof Text && (node as any).__isTextNode === true;\n },\n\n setProperty(node: any, name: string, value: any, prev?: any) {\n if (name === 'draw') {\n if (!(node instanceof Graphics)) {\n throw new Error(\n `[@caperjs/solid] The \\`draw\\` prop is only valid on <graphics>, received it on ${node?.constructor?.name}.`,\n );\n }\n node.clear();\n value?.(node);\n return;\n }\n\n if (name.startsWith('on') && typeof value === 'function') {\n const ev = name.slice(2).toLowerCase();\n if (prev) node.off(ev, prev);\n node.on(ev, value);\n node.eventMode = 'static';\n return;\n }\n\n // Point-like props go through the same resolvers `this.add.*` uses, so\n // `scale={2}`, `scale={{ x, y }}` and `scale={[x, y]}` behave identically in\n // JSX and in factory config.\n switch (name) {\n case 'position':\n resolvePosition({ position: value }, node);\n return;\n case 'scale':\n resolveScale({ scale: value }, node);\n return;\n case 'pivot':\n resolvePivot(value, node);\n return;\n case 'anchor':\n resolveAnchor(value, node);\n return;\n }\n\n resolveUnknownKeys({ [name]: value }, node);\n invalidateFlexChild(node);\n },\n\n insertNode(parent: PixiNode, node: PixiNode, anchor?: PixiNode) {\n if (anchor) {\n parent.addChildAt(node, parent.getChildIndex(anchor));\n } else {\n parent.addChild(node);\n }\n\n // Solid may set a node's props before inserting it, so re-measure on the next\n // tick — by then the whole tree has been built and every prop is applied.\n if (parent instanceof FlexContainer) {\n Application.getInstance().ticker.addOnce(() => invalidateFlexChild(node));\n }\n },\n\n removeNode(parent: PixiNode, node: PixiNode) {\n parent.removeChild(node);\n node.destroy({ children: true });\n },\n\n getParentNode(node: PixiNode) {\n return node.parent ?? undefined;\n },\n\n getFirstChild(node: PixiNode) {\n return node.children[0] as PixiNode | undefined;\n },\n\n getNextSibling(node: PixiNode) {\n const parent = node.parent;\n if (!parent) return undefined;\n return parent.children[parent.getChildIndex(node) + 1] as PixiNode | undefined;\n },\n});\n\n// The babel universal transform imports its runtime from this module.\nexport const {\n render,\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = renderer;\n","// Lifting existing imperative display classes into JSX — the escape hatch that\n// keeps the intrinsic catalog small.\n\nimport { untrack } from 'solid-js';\n\nimport type { PixiNode } from './renderer';\nimport { spread } from './renderer';\n\n/**\n * Lift an existing imperative display class into a JSX component.\n *\n * The instance is constructed once (untracked, so constructor reads don't\n * subscribe to anything) and every prop is then applied through the renderer's\n * own `spread`, which gives them the same reactivity as an intrinsic element —\n * including `ref`.\n *\n * ```tsx\n * const Orbiter$ = asComponent(Orbiter);\n * <Orbiter$ x={40} y={80} />\n * ```\n *\n * @param Ctor - The display class to lift. Called as `new Ctor(defaults)`.\n * @param defaults - Config handed to the constructor on every mount.\n */\nexport function asComponent<TNode extends PixiNode, TConfig>(\n Ctor: new (config?: TConfig) => TNode,\n defaults?: TConfig,\n): (props: Record<string, any>) => TNode {\n return (props) => {\n const node = untrack(() => new Ctor(defaults));\n // Skip the children pass when none were passed — otherwise Solid's spread\n // \"clears\" the node, which would wipe anything the class built for itself\n // (in `added()`, its own `compose()`, or the constructor).\n spread(node, props as any, !('children' in props));\n return node;\n };\n}\n","// The `compose()` contract: a display object declares its members by returning\n// JSX, that tree is mounted ONCE the first time the object hits the stage, and\n// signals do every update after that — no re-render, no diff.\n\nimport { Container, Constructor, Scene } from '@caperjs/core';\nimport type { DestroyOptions } from 'pixi.js';\n\nimport type { PixiNode } from './renderer';\nimport { render } from './renderer';\n\n/**\n * What `compose()` hands back. `unknown` for now so this file stays JSX-free;\n * it becomes the real element type when `jsx.d.ts` lands.\n */\nexport type Composed = unknown;\n\n/**\n * The optional contract a `Composable` subclass opts into. Declared separately\n * from the mixin (rather than merged onto it) so the mixin never claims a\n * `compose` member of its own — the runtime just checks for one.\n *\n * @example\n * ```tsx\n * class HealthBar extends ComposableContainer implements Composes {\n * compose() {\n * return <text text=\"100 HP\" />;\n * }\n * }\n * ```\n */\nexport interface Composes {\n compose(): Composed;\n}\n\n/**\n * Give a display class the `compose()` contract.\n *\n * The mixin adds no public members, so the returned constructor keeps `Base`'s\n * own type — `compose()` is declared by the subclass via {@link Composes}.\n *\n * @param Base - The display class to make composable.\n */\nexport function Composable<TBase extends Constructor<any>>(Base: TBase): TBase {\n return class extends Base {\n private __composeDispose?: () => void;\n private __composed = false;\n\n constructor(...args: any[]) {\n super(...args);\n // Mount off Pixi's native 'added' event rather than the `added()` hook:\n // subclasses routinely override `added()` without calling `super.added()`,\n // which would silently skip the mount. Core's own lifecycle listens to the\n // same event, so this coexists with it (and runs after it).\n this.once('added', this.__mountCompose);\n }\n\n destroy(options?: DestroyOptions): void {\n // Dispose the reactive graph first. Solid's disposal stops effects but does\n // not detach the nodes it created — `super.destroy()` handles those, so\n // there is no double-destroy path here.\n this.__composeDispose?.();\n this.__composeDispose = undefined;\n super.destroy(options);\n }\n\n private __mountCompose() {\n if (this.__composed) return;\n this.__composed = true;\n const host = this as Partial<Composes>;\n if (typeof host.compose !== 'function') return;\n // `Base` is only known as `Constructor<any>` here, so `this` has to be\n // asserted into the renderer's host-node type.\n this.__composeDispose = render(() => host.compose!() as PixiNode, this as unknown as PixiNode);\n }\n } as unknown as TBase;\n}\n\n/** A caper {@link Container} that can declare its members with JSX. */\nexport const ComposableContainer = Composable(Container);\nexport type ComposableContainer = InstanceType<typeof ComposableContainer>;\n\n/** A caper {@link Scene} that can declare its members with JSX. */\nexport const ComposableScene = Composable(Scene);\nexport type ComposableScene = InstanceType<typeof ComposableScene>;\n","import { Application } from '@caperjs/core';\nimport type { Ticker } from 'pixi.js';\nimport { onCleanup } from 'solid-js';\n\n/** Run `fn` every frame for the lifetime of the owning component. */\nexport function useTick(fn: (ticker: Ticker) => void) {\n const app = Application.getInstance();\n app.ticker.add(fn);\n onCleanup(() => app.ticker.remove(fn));\n}\n","import { version } from './version';\n\nexport const VERSION = version;\n\nexport * from './animated';\nexport * from './AnimatedShow';\nexport * from './asComponent';\nexport * from './catalog';\nexport * from './Composable';\nexport * from './renderer';\nexport * from './useTick';\n"],"x_google_ignoreList":[3],"mappings":";;;;;AAAA,IAAa,IAAU;;;ACkBvB,SAAgB,EAAS,GAAsB,GAA2D;CACxG,IAAM,IAAQ,EAAQ,EAAO,EACvB,CAAC,GAAO,KAAY,EAAa,EAAM,EAIvC,IAAQ,EAAE,GAAG,GAAO,EAEpB,IAAY,EAAK,QAAQ,GAAO,KAAK;EACzC,UAAU,GAAM,YAAY;EAC5B,MAAM,GAAM,QAAQ;EACpB,gBAAgB,EAAS,EAAM,EAAE;EAClC,CAAC;AAOF,QAJA,EAAa,EAAG,IAAS,MAAS,EAAU,EAAK,EAAE,EAAE,OAAO,IAAM,CAAC,CAAC,EAEpE,QAAgB,EAAU,MAAM,MAAM,CAAC,EAEhC;;;;AC3BT,IAAMS,IAA6B,EAAEE,MAAM;CAAEC,OAAO;CAAGC,OAAO;CAAK,EAAG,EAChEC,IAA2B;CAAEH,MAAM;EAAEC,OAAO;EAAGC,OAAO;EAAG;CAAEE,UAAU;CAAMC,MAAM;CAAiB,EAClGC,IAA0B;CAAEN,MAAM;EAAEC,OAAO;EAAGC,OAAO;EAAM;CAAEE,UAAU;CAAKC,MAAM;CAAa;AAoBrG,SAAgBE,EAAaC,GAK1B;CACD,IAAMK,I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KAAA;;CAGxB,cAAc,GAAgB;AAC5B,SAAO,EAAK,SAAS;;CAGvB,eAAe,GAAgB;EAC7B,IAAM,IAAS,EAAK;AACf,QACL,QAAO,EAAO,SAAS,EAAO,cAAc,EAAK,GAAG;;CAEvD,CAAC;;;AClHF,SAAgB,EACd,GACA,GACuC;AACvC,SAAQ,MAAU;EAChB,IAAM,IAAO,QAAc,IAAI,EAAK,EAAS,CAAC;AAK9C,SADA,EAAO,GAAM,GAAc,EAAE,cAAc,GAAO,EAC3C;;;;;ACQX,SAAgB,EAA2C,GAAoB;AAC7E,QAAO,cAAc,EAAK;EAIxB,YAAY,GAAG,GAAa;AAM1B,GALA,MAAM,GAAG,EAAK,oBAHK,IAQnB,KAAK,KAAK,SAAS,KAAK,eAAe;;EAGzC,QAAQ,GAAgC;AAMtC,GAFA,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,KAAA,GACxB,MAAM,QAAQ,EAAQ;;EAGxB,iBAAyB;AACvB,OAAI,KAAK,WAAY;AACrB,QAAK,aAAa;GAClB,IAAM,IAAO;AACT,UAAO,EAAK,WAAY,eAG5B,KAAK,mBAAmB,QAAa,EAAK,SAAU,EAAc,KAA4B;;;;AAMpG,IAAa,IAAsB,EAAW,EAAU,EAI3C,IAAkB,EAAW,EAAM;;;AC7EhD,SAAgB,EAAQ,GAA8B;CACpD,IAAM,IAAM,EAAY,aAAa;AAErC,CADA,EAAI,OAAO,IAAI,EAAG,EAClB,QAAgB,EAAI,OAAO,OAAO,EAAG,CAAC;;;;ACNxC,IAAa,KAAU"}
|
package/lib/index.d.ts
CHANGED
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.7.
|
|
1
|
+
export declare const version = "0.7.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@caperjs/core",
|
|
10
10
|
"caper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.7.
|
|
12
|
+
"version": "0.7.4",
|
|
13
13
|
"files": [
|
|
14
14
|
"lib",
|
|
15
15
|
"src",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"author": "",
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@caperjs/core": "^0.7.
|
|
49
|
+
"@caperjs/core": "^0.7.4",
|
|
50
50
|
"gsap": "^3.13.0",
|
|
51
51
|
"happy-dom": "^15",
|
|
52
52
|
"solid-js": "^1.9.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"vite-plugin-solid": "^2.11.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@caperjs/core": "^0.7.
|
|
61
|
+
"@caperjs/core": "^0.7.4",
|
|
62
62
|
"gsap": "^3.13.0",
|
|
63
63
|
"pixi.js": "8.22.0",
|
|
64
64
|
"solid-js": "^1.9.0"
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.7.
|
|
1
|
+
export const version = '0.7.4';
|