@motionscript/grids 0.1.0-alpha.5 → 0.1.0-alpha.7
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/CHANGELOG.md +24 -0
- package/README.md +47 -15
- package/dist/browser/chunks/chunk-J62D7EFZ.js +2 -0
- package/dist/browser/chunks/chunk-J62D7EFZ.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/engine.d.ts +4 -4
- package/dist/engine.js +4 -4
- package/dist/engine.js.map +1 -1
- package/dist/kit/index.d.ts +3 -1
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +4 -1
- package/dist/kit/index.js.map +1 -1
- package/dist/kit/item-grid.d.ts +203 -198
- package/dist/kit/item-grid.d.ts.map +1 -1
- package/dist/kit/item-grid.js +413 -440
- package/dist/kit/item-grid.js.map +1 -1
- package/dist/nodes.d.ts +8 -3
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +6 -10
- package/dist/nodes.js.map +1 -1
- package/dist/path-grid/path-grid.d.ts +187 -73
- package/dist/path-grid/path-grid.d.ts.map +1 -1
- package/dist/path-grid/path-grid.js +129 -172
- package/dist/path-grid/path-grid.js.map +1 -1
- package/dist/radial-grid/radial-grid.d.ts +171 -45
- package/dist/radial-grid/radial-grid.d.ts.map +1 -1
- package/dist/radial-grid/radial-grid.js +55 -87
- package/dist/radial-grid/radial-grid.js.map +1 -1
- package/dist/rectangular-grid/rectangular-grid.d.ts +203 -70
- package/dist/rectangular-grid/rectangular-grid.d.ts.map +1 -1
- package/dist/rectangular-grid/rectangular-grid.js +107 -145
- package/dist/rectangular-grid/rectangular-grid.js.map +1 -1
- package/dist/sphere-grid/sphere-grid.d.ts +192 -60
- package/dist/sphere-grid/sphere-grid.d.ts.map +1 -1
- package/dist/sphere-grid/sphere-grid.js +90 -137
- package/dist/sphere-grid/sphere-grid.js.map +1 -1
- package/package.json +4 -4
- package/src/engine.ts +4 -4
- package/src/kit/index.ts +13 -1
- package/src/kit/item-grid.ts +505 -442
- package/src/nodes.ts +18 -3
- package/src/path-grid/path-grid.ts +137 -164
- package/src/radial-grid/radial-grid.ts +69 -78
- package/src/rectangular-grid/rectangular-grid.ts +118 -133
- package/src/sphere-grid/sphere-grid.ts +103 -117
- package/dist/browser/chunks/chunk-XDUDKWM7.js +0 -2
- package/dist/browser/chunks/chunk-XDUDKWM7.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-grid.js","sourceRoot":"","sources":["../../src/kit/item-grid.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,OAAO,EACP,UAAU,EACV,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,GAWb,MAAM,mBAAmB,CAAA;AAE1B,kFAAkF;AAClF,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,GAMZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAA+B,MAAM,SAAS,CAAA;AACpG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAA;AA+C5F,0FAA0F;AAC1F,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO;QACL,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE;QAChF,EAAE,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ACzB,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAA;AACxD,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;AACnF,CAAC;AAED,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IAC3C,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC","sourcesContent":["import {\r\n command,\r\n easeIn,\r\n easeInOut,\r\n easeOut,\r\n findNode2D,\r\n flowOps,\r\n frameIn,\r\n insetsOps,\r\n Node2D,\r\n property,\r\n sizeInputOps,\r\n type BoxBounds,\r\n type ChildPlacement,\r\n type Command,\r\n type CommandArgs,\r\n type MeasureContext2D,\r\n type EasingFunction,\r\n type Node2DProps,\r\n type Size2D,\r\n type SizeConstraints,\r\n type SpaceCamera,\r\n} from \"@motionscript/sdk\"\r\n\r\n// Once this kit's own; kept on its barrel for the grids that import them from it.\r\nexport { findNode2D, frameIn } from \"@motionscript/sdk\"\r\n\r\nimport {\r\n applyItemEffects,\r\n REVEAL_STYLES,\r\n WAVE_STYLES,\r\n type FocusState,\r\n type RevealState,\r\n type RevealStyle,\r\n type WaveState,\r\n type WaveStyle,\r\n} from \"./item-effects\"\r\nimport { normalizeOrder, parseOrder, slotOfItem } from \"./order\"\r\nimport { hashSeed, shuffled } from \"./random\"\r\nimport { blendSlot, focalLengthOf, slotsOf, spreadSlot, type Arrangement, type Slot } from \"./slots\"\r\nimport { STAGGER_ORDERS, staggerProgress, staggerRanks, type StaggerOrder } from \"./stagger\"\r\n\r\n/** An arrangement a grid is leaving, kept as data so its slots can be worked out afresh every frame. */\r\nexport interface GridSnapshot {\r\n arrangement: Arrangement\r\n /** The grid the arrangement was borrowed from, or `\"\"` for the grid's own. */\r\n source: string\r\n order: readonly number[]\r\n spread: number\r\n}\r\n\r\n/** A change of arrangement under way: where the items are coming from, and how far each has come. */\r\nexport interface GridTransition {\r\n from: GridSnapshot\r\n /** Each item's eased, staggered progress, `0..1`. */\r\n mix: readonly number[]\r\n}\r\n\r\nexport interface ItemGridProps extends Node2DProps {\r\n /** Items in slot order: slot `k` holds child `order[k]`. Empty is the children's own order. */\r\n order: number[]\r\n /** `0` gathers every item at the centre, `1` is the arrangement, past `1` pushes them apart. */\r\n spread: number\r\n /** Another grid whose arrangement this one takes on — what {@link ItemGrid.morphInto} animates. */\r\n arrangeLike: string\r\n // What the per-item commands write. State rather than settings: a command\r\n // owns each while it runs, and a document has no reason to name them.\r\n revealState: RevealState | null\r\n waveState: WaveState | null\r\n focusState: FocusState | null\r\n transition: GridTransition | null\r\n}\r\n\r\n/** What a command that moves the items to new slots is built from. */\r\nexport interface TransitionArgs {\r\n data?: StaggerArgs\r\n duration: number\r\n easing?: EasingFunction\r\n}\r\n\r\n/** The stagger options every per-item command takes. */\r\nexport interface StaggerArgs {\r\n staggerOrder?: StaggerOrder\r\n /** `0..0.95`: how much of the command's length the items' offsets take up. */\r\n stagger?: number\r\n}\r\n\r\n/** `@command` descriptors for {@link StaggerArgs}, `stagger` defaulting to `fallback`. */\r\nexport function staggerArgs(fallback: number) {\r\n return [\r\n { key: \"staggerOrder\", kind: \"enum\", options: STAGGER_ORDERS, default: \"index\" },\r\n { key: \"stagger\", min: 0, max: 0.95, step: 0.05, default: fallback },\r\n ] as const\r\n}\r\n\r\n/**\r\n * Every grid's document key — what a reference to \"another grid\" may name. A\r\n * `nodeRef` descriptor carries it as `nodeTypes`, for a host's picker to offer\r\n * only those.\r\n */\r\nexport const ITEM_GRID_TYPES = [\"rectangularGrid\", \"radialGrid\", \"pathGrid\", \"sphereGrid\"] as const\r\n\r\n/** The stagger a move to new slots takes when its command states none. */\r\nexport const TRANSITION_STAGGER = 0.3\r\n\r\nconst NO_CONTENT: Size2D = { width: 0, height: 0 }\r\nconst CENTRE = { x: 0, y: 0 }\r\n\r\n/**\r\n * The base of every grid: a container that places each of its children in a\r\n * slot of an arrangement — a rectangular grid, a ring, a path, a sphere.\r\n *\r\n * ## Children only\r\n *\r\n * The items are the children, in layer order. A child's slot is a parent\r\n * transform on it, so its own `x`/`y`/`rotation`/`scale` — and any command on\r\n * them — still work, relative to the slot. A group is one item; a grid of\r\n * grids is a grid of items that happen to be grids.\r\n *\r\n * ## One pass\r\n *\r\n * Every frame: measure the children, ask the arrangement for its slots (a pure\r\n * function of the props, the sizes and the clock), blend them from where a\r\n * transition is leaving, and layer on the per-item effects — reveal, wave,\r\n * focus. What is left is each child's box and {@link ChildPlacement}, which the\r\n * renderer, picking and `global` all read, so a selection outline lands on\r\n * the pixels even on a sphere.\r\n *\r\n * ## Commands\r\n *\r\n * Every command is a pure function of time, like the rest of the library. The\r\n * per-item ones stagger *inside* their duration — a one-second reveal takes one\r\n * second for four children or four hundred — and write their per-item state\r\n * into props ({@link revealState} and its siblings), which is what keeps them\r\n * seekable. The ones that change the arrangement itself (a reorder, a morph, a\r\n * column count) keep the arrangement they are leaving as data and blend each\r\n * item from its old slot to its new one.\r\n */\r\nexport abstract class ItemGrid<P extends ItemGridProps = ItemGridProps> extends Node2D<P> {\r\n @property({ default: [], kind: \"order\", animatable: false }) declare order: number[]\r\n @property({ default: 1, min: 0, max: 3, step: 0.05 }) declare spread: number\r\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: ITEM_GRID_TYPES, animatable: false }) declare arrangeLike: string\r\n // Unset until a command writes one, so a fresh node's row does not state them.\r\n @property({ default: undefined, kind: \"state\", animatable: false }) declare revealState: RevealState | null | undefined\r\n @property({ default: undefined, kind: \"state\", animatable: false }) declare waveState: WaveState | null | undefined\r\n @property({ default: undefined, kind: \"state\", animatable: false }) declare focusState: FocusState | null | undefined\r\n @property({ default: undefined, kind: \"state\", animatable: false }) declare transition: GridTransition | null | undefined\r\n\r\n /**\r\n * Bring the items in, one after another. Every item starts hidden, so place\r\n * it where the grid enters — or after a {@link conceal}.\r\n */\r\n @command({ args: [{ key: \"style\", kind: \"enum\", options: REVEAL_STYLES, default: \"scale\" }, ...staggerArgs(0.5)] })\r\n reveal(args: CommandArgs<{ style?: RevealStyle } & StaggerArgs> & { duration: number }): Command<ItemGridProps> {\r\n const style = args.data?.style ?? \"scale\"\r\n const ease = args.easing ?? (style === \"scale\" || style === \"flip\" ? easeOut(\"back\") : easeOut(\"cubic\"))\r\n const ranks = this._ranks(args.data?.staggerOrder)\r\n const stagger = args.data?.stagger ?? 0.5\r\n return this.command<ItemGridProps>((t) => {\r\n if (t >= 1) return { revealState: null }\r\n return { revealState: { style, values: ranks.map((rank) => ease(staggerProgress(rank, t, stagger))) } }\r\n }, args.duration)\r\n }\r\n\r\n /** Take the items out, one after another — {@link reveal} in reverse. They stay hidden after. */\r\n @command({ args: [{ key: \"style\", kind: \"enum\", options: REVEAL_STYLES, default: \"scale\" }, ...staggerArgs(0.5)] })\r\n conceal(args: CommandArgs<{ style?: RevealStyle } & StaggerArgs> & { duration: number }): Command<ItemGridProps> {\r\n const style = args.data?.style ?? \"scale\"\r\n const ease = args.easing ?? (style === \"scale\" || style === \"flip\" ? easeIn(\"back\") : easeInOut(\"cubic\"))\r\n const ranks = this._ranks(args.data?.staggerOrder)\r\n const stagger = args.data?.stagger ?? 0.5\r\n const from = this.revealState?.values\r\n return this.command<ItemGridProps>((t) => ({\r\n revealState: {\r\n style,\r\n values: ranks.map((rank, i) => (from?.[i] ?? 1) * (1 - ease(staggerProgress(rank, t, stagger)))),\r\n },\r\n }), args.duration)\r\n }\r\n\r\n /** Send a ripple through the items that swells each in turn and settles back. */\r\n @command({\r\n args: [\r\n { key: \"style\", kind: \"enum\", options: WAVE_STYLES, default: \"scale\" },\r\n { key: \"amount\", min: 0, max: 2, step: 0.05, default: 0.3 },\r\n ...staggerArgs(0.7),\r\n ],\r\n })\r\n wave(args: CommandArgs<{ style?: WaveStyle; amount?: number } & StaggerArgs> & { duration: number }): Command<ItemGridProps> {\r\n const style = args.data?.style ?? \"scale\"\r\n const amount = args.data?.amount ?? 0.3\r\n const ease = args.easing ?? easeInOut(\"sine\")\r\n const ranks = this._ranks(args.data?.staggerOrder)\r\n const stagger = args.data?.stagger ?? 0.7\r\n return this.command<ItemGridProps>((t) => {\r\n if (t >= 1) return { waveState: null }\r\n return {\r\n waveState: {\r\n style,\r\n amount,\r\n values: ranks.map((rank) => Math.sin(Math.PI * ease(staggerProgress(rank, t, stagger)))),\r\n },\r\n }\r\n }, args.duration)\r\n }\r\n\r\n /** Bring one item (by its place in the layers, from 0) forward and push the rest back. */\r\n @command({\r\n args: [\r\n { key: \"item\", min: 0, step: 1, default: 0 },\r\n { key: \"dim\", min: 0, max: 1, step: 0.05, default: 0.7 },\r\n { key: \"grow\", min: 0, max: 1, step: 0.05, default: 0.15 },\r\n ],\r\n })\r\n focus(args: CommandArgs<{ item?: number; dim?: number; grow?: number }> & { duration: number }): Command<ItemGridProps> {\r\n const n = this._itemCount()\r\n const item = Math.round(args.data?.item ?? 0)\r\n return this._focusOn((i) => i === item, n, args)\r\n }\r\n\r\n /** Bring every item back to even. */\r\n @command()\r\n unfocus(args: CommandArgs<Record<string, never>> & { duration: number }): Command<ItemGridProps> {\r\n const from = this.focusState\r\n const ease = args.easing ?? easeInOut(\"cubic\")\r\n return this.command<ItemGridProps>((t) => {\r\n if (t >= 1 || !from) return { focusState: null }\r\n const k = 1 - ease(t)\r\n return { focusState: { ...from, values: from.values.map((v) => v * k) } }\r\n }, args.duration)\r\n }\r\n\r\n /** Gather the items toward the centre (`0`), back to the arrangement (`1`), or push them apart. */\r\n @command({ args: [{ key: \"spread\", min: 0, max: 3, step: 0.05, default: 1 }] })\r\n spreadTo(args: CommandArgs<{ spread: number }> & { duration: number }): Command<P> {\r\n return this.to({ data: { spread: args.data?.spread ?? 1 } as Partial<P>, duration: args.duration, easing: args.easing })\r\n }\r\n\r\n /** Send every item to a random slot. The same `seed` always deals the same way. */\r\n @command({ args: [{ key: \"seed\", min: 0, step: 1, default: 1 }, ...staggerArgs(TRANSITION_STAGGER)] })\r\n shuffle(args: CommandArgs<{ seed?: number } & StaggerArgs> & { duration: number }): Command<P> {\r\n const current = normalizeOrder(this.order, this._itemCount())\r\n let next = shuffled(current, args.data?.seed ?? 1)\r\n // A shuffle that deals everything back where it was would look like nothing happened.\r\n if (next.length > 1 && next.every((item, k) => item === current[k])) next = [...next.slice(1), next[0]]\r\n return this._transitionTo({ order: next } as Partial<P>, args)\r\n }\r\n\r\n /** Two items trade places, by their place in the layers. */\r\n @command({\r\n args: [\r\n { key: \"first\", min: 0, step: 1, default: 0 },\r\n { key: \"second\", min: 0, step: 1, default: 1 },\r\n ...staggerArgs(0),\r\n ],\r\n })\r\n swap(args: CommandArgs<{ first?: number; second?: number } & StaggerArgs> & { duration: number }): Command<P> {\r\n const order = normalizeOrder(this.order, this._itemCount())\r\n const a = order.indexOf(Math.round(args.data?.first ?? 0))\r\n const b = order.indexOf(Math.round(args.data?.second ?? 1))\r\n if (a >= 0 && b >= 0) [order[a], order[b]] = [order[b], order[a]]\r\n return this._transitionTo({ order } as Partial<P>, args, 0)\r\n }\r\n\r\n /** Move the items into a new order — a list of layer indices, first slot first, like `\"2, 0, 1\"`. */\r\n @command({ args: [{ key: \"order\", kind: \"text\", default: \"\" }, ...staggerArgs(TRANSITION_STAGGER)] })\r\n reorder(args: CommandArgs<{ order?: string | number[] } & StaggerArgs> & { duration: number }): Command<P> {\r\n const order = normalizeOrder(parseOrder(args.data?.order), this._itemCount())\r\n return this._transitionTo({ order } as Partial<P>, args)\r\n }\r\n\r\n /**\r\n * Move every item into another grid's arrangement — a grid into a ring, a ring\r\n * onto a sphere — and keep following it. An empty `target` morphs back to\r\n * this grid's own.\r\n */\r\n @command({ args: [{ key: \"target\", kind: \"nodeRef\", nodeTypes: ITEM_GRID_TYPES }, ...staggerArgs(TRANSITION_STAGGER)] })\r\n morphInto(args: CommandArgs<{ target?: string } & StaggerArgs> & { duration: number }): Command<P> {\r\n return this._transitionTo({ arrangeLike: args.data?.target ?? \"\" } as Partial<P>, args)\r\n }\r\n\r\n /** This grid's own arrangement, for a content box of `box`. */\r\n protected abstract arrangementFor(box: Size2D): Arrangement\r\n\r\n // A grid's size is what its items come to. The base's rule — hug only when\r\n // built with children — would have a grid from a document, whose children\r\n // arrive after it, fill its parent instead.\r\n protected override applyDefaultSize(props?: { readonly width?: unknown; readonly height?: unknown }): void {\r\n if (!props || props.width === undefined) this.applyProp(\"width\", \"hug\", { tween: sizeInputOps.lerp })\r\n if (!props || props.height === undefined) this.applyProp(\"height\", \"hug\", { tween: sizeInputOps.lerp })\r\n }\r\n\r\n /** The room each item is measured in — the whole content box, unless an arrangement has cells. */\r\n protected itemSpace(_count: number, space: Size2D, _sizes?: readonly Size2D[]): Size2D {\r\n return space\r\n }\r\n\r\n override measure(constraints: SizeConstraints, scope: MeasureContext2D): Partial<Size2D> {\r\n this.lastMeasure = { constraints, measurer: scope }\r\n const padding = this.effectivePadding()\r\n const items = this.flowChildren()\r\n if (items.length === 0) {\r\n this._measured = null\r\n return flowOps.size(this, constraints, padding, NO_CONTENT)\r\n }\r\n const space = flowOps.contentBox(this, constraints, padding)\r\n const sizes = this._measureItems(items, space, scope)\r\n this._measured = { space, sizes }\r\n return flowOps.size(this, constraints, padding, extentOf(this._targetSlots(items.length, sizes, space).slots, sizes, this._focal))\r\n }\r\n\r\n protected override layoutChildren(rect: BoxBounds, scope: MeasureContext2D): void {\r\n this._placements.clear()\r\n const items = this.flowChildren()\r\n if (items.length === 0) {\r\n this._slots = []\r\n this._sizes = []\r\n this._focal = 0\r\n return\r\n }\r\n const inner = insetsOps.insetBounds(rect.width, rect.height, this.effectivePadding())\r\n const measured = this._measured\r\n this._measured = null\r\n const sizes = measured && measured.sizes.length === items.length && sameSize(measured.space, inner)\r\n ? measured.sizes\r\n : this._measureItems(items, inner, scope)\r\n const slots = this._resolve(sizes, inner)\r\n this._slots = slots\r\n this._sizes = sizes\r\n for (let i = 0; i < items.length; i++) {\r\n const s = slots[i]\r\n items[i].layout({ x: inner.x + s.x, y: inner.y - s.y, width: sizes[i].width, height: sizes[i].height }, scope)\r\n if (s.rotation !== 0 || s.scale !== 1 || s.rotationX !== 0 || s.rotationY !== 0 || s.depth !== 0 || s.opacity !== 1) {\r\n this._placements.set(items[i], {\r\n rotation: s.rotation,\r\n scale: s.scale,\r\n rotationX: s.rotationX,\r\n rotationY: s.rotationY,\r\n depth: s.depth,\r\n opacity: s.opacity,\r\n })\r\n }\r\n }\r\n }\r\n\r\n override _placementOf(child: Node2D): ChildPlacement | null {\r\n return this._placements.get(child) ?? null\r\n }\r\n\r\n /**\r\n * A grid whose arrangement has depth is seen through a camera of its own,\r\n * which paints its items far to near — unless it already sits in a space (an\r\n * orbit camera, a 3D stage), where its items join that one and its camera.\r\n */\r\n override _spaceCamera(): SpaceCamera | null {\r\n const focal = this._focal\r\n if (focal <= 0 || this._inSpace()) return null\r\n return {\r\n perspective: focal,\r\n orbit: 0,\r\n elevation: 0,\r\n dolly: 0,\r\n lookAt: CENTRE,\r\n zoom: 1,\r\n heading: 0,\r\n viewportX: 0,\r\n viewportY: 0,\r\n }\r\n }\r\n\r\n private readonly _placements = new Map<Node2D, ChildPlacement>()\r\n /** What {@link measure} found, for {@link layoutChildren} to reuse in the same pass. */\r\n private _measured: { space: Size2D; sizes: Size2D[] } | null = null\r\n /** Each item's slot from the last layout — what a command ranks its stagger by. */\r\n private _slots: Slot[] = []\r\n /** Each item's size from the last layout. */\r\n private _sizes: readonly Size2D[] = []\r\n /** The last layout's camera distance, `0` while flat. */\r\n private _focal = 0\r\n private _borrowCache: { id: string; grid: ItemGrid } | null = null\r\n\r\n /** How many items a command built now will act on. */\r\n protected _itemCount(): number {\r\n return this.flowChildren().length\r\n }\r\n\r\n /** Each item's slot as it stands, for a command being built — the last layout's where it still fits. */\r\n protected _itemSlots(): Slot[] {\r\n const n = this._itemCount()\r\n if (this._slots.length === n) return this._slots\r\n const sizes = new Array<Size2D>(n).fill({ width: 100, height: 100 })\r\n return this._targetSlots(n, sizes, contentBoxOf(this)).slots\r\n }\r\n\r\n /** The item sizes the last layout found. */\r\n protected _itemSizes(): readonly Size2D[] {\r\n return this._sizes.length === this._itemCount() ? this._sizes : []\r\n }\r\n\r\n /** Each item's start in a stagger. A random order is seeded by the node's id, so it never changes between builds. */\r\n protected _ranks(order: StaggerOrder | undefined): number[] {\r\n return staggerRanks(order ?? \"index\", this._itemSlots(), hashSeed(this.id))\r\n }\r\n\r\n /**\r\n * Write `changes` to the arrangement and move each item from its slot in the\r\n * one being left to its slot in the new one, staggered.\r\n */\r\n protected _transitionTo(changes: Partial<P>, args: TransitionArgs, stagger = TRANSITION_STAGGER): Command<P> {\r\n const from = this._snapshot()\r\n const ease = args.easing ?? easeInOut(\"cubic\")\r\n const ranks = this._ranks(args.data?.staggerOrder)\r\n const spread = args.data?.stagger ?? stagger\r\n return this.command<P>((t) => {\r\n if (t >= 1) return { ...changes, transition: null } as Partial<P>\r\n const mix = ranks.map((rank) => ease(staggerProgress(rank, t, spread)))\r\n return { ...changes, transition: { from, mix } } as Partial<P>\r\n }, args.duration)\r\n }\r\n\r\n /** Emphasise the items `isFocus` picks and push the rest back. */\r\n protected _focusOn(\r\n isFocus: (item: number) => boolean,\r\n count: number,\r\n args: CommandArgs<{ dim?: number; grow?: number }> & { duration: number },\r\n ): Command<ItemGridProps> {\r\n const from = this.focusState\r\n const dim = args.data?.dim ?? 0.7\r\n const grow = args.data?.grow ?? 0.15\r\n const target = Array.from({ length: count }, (_, i) => (isFocus(i) ? 1 : -1))\r\n const ease = args.easing ?? easeInOut(\"cubic\")\r\n return this.command<ItemGridProps>((t) => {\r\n const e = ease(t)\r\n return {\r\n focusState: {\r\n dim: lerp(from?.dim ?? dim, dim, e),\r\n grow: lerp(from?.grow ?? grow, grow, e),\r\n values: target.map((v, i) => lerp(from?.values[i] ?? 0, v, e)),\r\n },\r\n }\r\n }, args.duration)\r\n }\r\n\r\n private _snapshot(): GridSnapshot {\r\n const source = this._borrowed()\r\n return {\r\n arrangement: source ? source.arrangementFor(contentBoxOf(source)) : this.arrangementFor(contentBoxOf(this)),\r\n source: source?.id ?? \"\",\r\n order: normalizeOrder(this.order, this._itemCount()),\r\n spread: this.spread,\r\n }\r\n }\r\n\r\n private _measureItems(items: readonly Node2D[], space: Size2D, scope: MeasureContext2D): Size2D[] {\r\n const measured = flowOps.measure({}, items, space, scope).sizes\r\n const cell = this.itemSpace(items.length, space, measured)\r\n if (cell === space) return [...measured]\r\n return [...flowOps.measure({}, items, cell, scope).sizes]\r\n }\r\n\r\n /** Where each item sits in the arrangement it is heading for, before any transition or effect. */\r\n private _targetSlots(count: number, sizes: readonly Size2D[], box: Size2D): { slots: Slot[]; arrangement: Arrangement } {\r\n const source = this._borrowed()\r\n const arrangement = source ? source.arrangementFor(contentBoxOf(source)) : this.arrangementFor(box)\r\n let slots = slotsOf(arrangement, { count, sizes, box: source ? contentBoxOf(source) : box, time: this.time.total })\r\n if (source) slots = this._fromGrid(source, slots)\r\n const slotOf = slotOfItem(normalizeOrder(this.order, count))\r\n return { slots: slotOf.map((k) => spreadSlot(slots[k], this.spread)), arrangement }\r\n }\r\n\r\n /** Each item's final slot this frame: the target, blended from any transition, with its effects on. */\r\n private _resolve(sizes: readonly Size2D[], box: Size2D): Slot[] {\r\n const count = sizes.length\r\n const target = this._targetSlots(count, sizes, box)\r\n const slots = target.slots\r\n let focal = focalLengthOf(target.arrangement)\r\n const transition = this.transition\r\n if (transition) {\r\n const { from } = transition\r\n const source = from.source ? this._gridById(from.source) : null\r\n const fromBox = source ? contentBoxOf(source) : box\r\n let leaving = slotsOf(from.arrangement, { count, sizes, box: fromBox, time: this.time.total })\r\n if (source && source !== this) leaving = this._fromGrid(source, leaving)\r\n const slotOf = slotOfItem(normalizeOrder(from.order, count))\r\n for (let i = 0; i < count; i++) {\r\n slots[i] = blendSlot(spreadSlot(leaving[slotOf[i]], from.spread), slots[i], transition.mix[i] ?? 1)\r\n }\r\n // A morph into or out of depth keeps the camera for its whole length.\r\n focal = focal || focalLengthOf(from.arrangement)\r\n }\r\n this._focal = focal\r\n const reveal = this.revealState\r\n const wave = this.waveState\r\n const focus = this.focusState\r\n if (reveal || wave || focus) {\r\n for (let i = 0; i < count; i++) applyItemEffects(slots[i], i, sizes[i], reveal, wave, focus)\r\n }\r\n return slots\r\n }\r\n\r\n /** Whether an ancestor places this grid in a space, as `spaceFrameOf` walks it. */\r\n private _inSpace(): boolean {\r\n for (let n = this.parent; n; n = n.parent) {\r\n if (n._spaceCamera()) return true\r\n if (!n._rendersChildrenInSpace()) return false\r\n }\r\n return false\r\n }\r\n\r\n /** The grid {@link arrangeLike} names, when it names another grid in this tree. */\r\n private _borrowed(): ItemGrid | null {\r\n const id = this.arrangeLike\r\n if (!id || id === this.id) return null\r\n return this._gridById(id)\r\n }\r\n\r\n private _gridById(id: string): ItemGrid | null {\r\n if (id === this.id) return this\r\n const cached = this._borrowCache\r\n if (cached && cached.id === id && cached.grid.mounted) return cached.grid\r\n const found = findNode2D(this, id)\r\n const grid = found instanceof ItemGrid ? found : null\r\n this._borrowCache = grid ? { id, grid } : null\r\n return grid\r\n }\r\n\r\n /** `slots`, laid out in `source`'s frame, moved into this grid's. */\r\n private _fromGrid(source: ItemGrid, slots: Slot[]): Slot[] {\r\n const frame = frameIn(this, source)\r\n return slots.map((s) => {\r\n const p = rotateClockwise(s.x * frame.scale, s.y * frame.scale, frame.rotation)\r\n return {\r\n ...s,\r\n x: frame.x + p.x,\r\n y: frame.y + p.y,\r\n depth: s.depth * frame.scale,\r\n rotation: s.rotation + frame.rotation,\r\n scale: s.scale * frame.scale,\r\n }\r\n })\r\n }\r\n}\r\n\r\n/** A node's content box: its laid-out size inside its padding. */\r\nexport function contentBoxOf(grid: Node2D): Size2D {\r\n const b = grid.layoutBounds\r\n const inner = insetsOps.insetBounds(b.width, b.height, grid.effectivePadding())\r\n return { width: inner.width, height: inner.height }\r\n}\r\n\r\n/** The box, centred on the grid, that holds every item where its slot puts it. */\r\nfunction extentOf(slots: readonly Slot[], sizes: readonly Size2D[], focal: number): Size2D {\r\n let halfWidth = 0\r\n let halfHeight = 0\r\n for (let i = 0; i < slots.length; i++) {\r\n const s = slots[i]\r\n const size = sizes[i]\r\n const rad = (s.rotation * Math.PI) / 180\r\n const cos = Math.abs(Math.cos(rad))\r\n const sin = Math.abs(Math.sin(rad))\r\n // What the camera does to a slot at depth, so a sphere hugs its front.\r\n const lens = focal > 0 && focal - s.depth > 1 ? focal / (focal - s.depth) : 1\r\n const w = ((size.width * cos + size.height * sin) / 2) * s.scale * lens\r\n const h = ((size.width * sin + size.height * cos) / 2) * s.scale * lens\r\n halfWidth = Math.max(halfWidth, Math.abs(s.x) * lens + w)\r\n halfHeight = Math.max(halfHeight, Math.abs(s.y) * lens + h)\r\n }\r\n return { width: halfWidth * 2, height: halfHeight * 2 }\r\n}\r\n\r\nfunction rotateClockwise(x: number, y: number, degrees: number): { x: number; y: number } {\r\n if (degrees === 0) return { x, y }\r\n const rad = (degrees * Math.PI) / 180\r\n const cos = Math.cos(rad)\r\n const sin = Math.sin(rad)\r\n return { x: x * cos + y * sin, y: -x * sin + y * cos }\r\n}\r\n\r\nfunction sameSize(a: Size2D, b: Size2D): boolean {\r\n return Math.abs(a.width - b.width) < 1e-6 && Math.abs(a.height - b.height) < 1e-6\r\n}\r\n\r\nfunction lerp(a: number, b: number, t: number): number {\r\n return a + (b - a) * t\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"item-grid.js","sourceRoot":"","sources":["../../src/kit/item-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,MAAM,EACN,S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AAC,CAAA;IAC7D,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,GAAG,CAAC,EAAE,CAAA;AACzD,CAAC;AAED,SAAS,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,OAAe;IAC5D,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;IAClC,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACzB,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAA;AACxD,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;AACnF,CAAC;AAED,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IAC3C,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC","sourcesContent":["import {\r\n commandsFor,\r\n easeIn,\r\n easeInOut,\r\n easeOut,\r\n flowOps,\r\n insetsOps,\r\n Types,\r\n type ChildView,\r\n type InsetsResolved,\r\n type LayoutBox,\r\n type LayoutItem,\r\n type Measurer,\r\n type Node2D,\r\n type NodeFrame,\r\n type NodeView,\r\n type Piece,\r\n type Placement2D,\r\n type RenderContext,\r\n type Size2D,\r\n type SpaceCamera,\r\n type Timeline,\r\n type Values,\r\n} from \"@motionscript/sdk\"\r\n\r\nimport {\r\n applyItemEffects,\r\n REVEAL_STYLES,\r\n WAVE_STYLES,\r\n type FocusState,\r\n type RevealState,\r\n type WaveState,\r\n} from \"./item-effects\"\r\nimport { normalizeOrder, parseOrder, slotOfItem } from \"./order\"\r\nimport { hashSeed, shuffled } from \"./random\"\r\nimport { blendSlot, focalLengthOf, slotsOf, spreadSlot, type Arrangement, type Slot } from \"./slots\"\r\nimport { STAGGER_ORDERS, staggerProgress, staggerRanks, type StaggerOrder } from \"./stagger\"\r\n\r\n/**\r\n * What every grid is built from: a container that places each of its children\r\n * in a slot of an arrangement — a rectangular grid, a ring, a path, a sphere.\r\n * Spread `state` and `commands` in, take `defaults`, hand `fields` the\r\n * {@link Arranger} that makes this grid's arrangement from its state, and pass\r\n * the finished component and its arranger through {@link define}.\r\n *\r\n * ## Children only\r\n *\r\n * The items are the children, in layer order. A child's slot is a parent\r\n * transform on it, so its own `x`/`y`/`rotation`/`scale` — and any command on\r\n * them — still work, relative to the slot. A group is one item; a grid of\r\n * grids is a grid of items that happen to be grids.\r\n *\r\n * ## One pass\r\n *\r\n * Every frame: measure the children, ask the arrangement for its slots (a pure\r\n * function of the state, the sizes and the clock), blend them from where a\r\n * transition is leaving, and layer on the per-item effects — reveal, wave,\r\n * focus. What is left is each child's box and slot, which the renderer,\r\n * picking and `global` all read, so a selection outline lands on the pixels\r\n * even on a sphere.\r\n *\r\n * ## Commands\r\n *\r\n * Every command is a pure function of time. The per-item ones stagger *inside*\r\n * their duration — a one-second reveal takes one second for four children or\r\n * four hundred — and write their per-item state into entries\r\n * (`revealState` and its siblings), which is what keeps them seekable. The ones\r\n * that change the arrangement itself (a reorder, a morph, a column count) keep\r\n * the arrangement they are leaving as data and blend each item from its old\r\n * slot to its new one.\r\n */\r\n\r\n/** An arrangement a grid is leaving, kept as data so its slots can be worked out afresh every frame. */\r\nexport interface GridSnapshot {\r\n arrangement: Arrangement\r\n /** The grid the arrangement was borrowed from, or `\"\"` for the grid's own. */\r\n source: string\r\n order: readonly number[]\r\n spread: number\r\n}\r\n\r\n/** A change of arrangement under way: where the items are coming from, and how far each has come. */\r\nexport interface GridTransition {\r\n from: GridSnapshot\r\n /** Each item's eased, staggered progress, `0..1`. */\r\n mix: readonly number[]\r\n}\r\n\r\n/** The stagger options every per-item command takes. */\r\nexport interface StaggerArgs {\r\n staggerOrder?: StaggerOrder\r\n /** `0..0.95`: how much of the command's length the items' offsets take up. */\r\n stagger?: number\r\n}\r\n\r\n/**\r\n * Every grid's document key — what a reference to \"another grid\" may name. A\r\n * `nodeRef` descriptor carries it as `nodeTypes`, for a host's picker to offer\r\n * only those.\r\n */\r\nexport const ITEM_GRID_TYPES = [\"rectangularGrid\", \"radialGrid\", \"pathGrid\", \"sphereGrid\"] as const\r\n\r\n/** The stagger a move to new slots takes when its command states none. */\r\nexport const TRANSITION_STAGGER = 0.3\r\n\r\n/** A reference to another node, a host's picker offering only `types`. Its fields read a view of it. */\r\nexport function nodeRef(types: readonly string[]) {\r\n const described = { kind: \"nodeRef\", nodeTypes: types, animatable: false }\r\n return Types.custom<string, NodeView | null>(\"\", described)\r\n}\r\n\r\n/** The stagger args every per-item command takes, `stagger` defaulting to `fallback`. */\r\nexport function staggerArgs(fallback: number) {\r\n return {\r\n staggerOrder: Types.oneOf(STAGGER_ORDERS, { default: \"index\" }),\r\n stagger: Types.number(fallback, { min: 0, max: 0.95, step: 0.05 }),\r\n }\r\n}\r\n\r\n/**\r\n * A command arg a host fills in with `hint`, which a row may leave out: the\r\n * command then keeps what the grid has. A run arg's default is both what a\r\n * host offers and what an omitted arg means, so the hint rides on the arg's\r\n * description alone, and an omitted arg reads `undefined`.\r\n */\r\nexport function hinted<T extends number | string>(hint: T, options: object = {}) {\r\n const described: Record<string, unknown> = { ...options, default: hint }\r\n return Types.custom<T | undefined>(undefined, described as never)\r\n}\r\n\r\n/** A command arg naming another node, a host's picker offering only `types`; left out, it reads `undefined`. */\r\nexport function nodeRefArg(types: readonly string[]) {\r\n const described = { kind: \"nodeRef\", nodeTypes: types }\r\n return Types.custom<string | undefined>(undefined, described)\r\n}\r\n\r\n/** The state every grid shares. */\r\nexport const state = {\r\n /** Items in slot order: slot `k` holds child `order[k]`. Empty is the children's own order. */\r\n order: Types.custom<number[]>([], { kind: \"order\", animatable: false }),\r\n /** `0` gathers every item at the centre, `1` is the arrangement, past `1` pushes them apart. */\r\n spread: Types.number(1, { min: 0, max: 3, step: 0.05 }),\r\n /** Another grid whose arrangement this one takes on — what `morphInto` animates. */\r\n arrangeLike: nodeRef(ITEM_GRID_TYPES),\r\n // What the per-item commands write. State rather than settings: a command\r\n // owns each while it runs, and a document has no reason to name them. Unset\r\n // until a command writes one, so a fresh node's row does not state them.\r\n revealState: Types.custom<RevealState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\r\n waveState: Types.custom<WaveState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\r\n focusState: Types.custom<FocusState | null | undefined>(undefined, { kind: \"state\", animatable: false }),\r\n transition: Types.custom<GridTransition | null | undefined>(undefined, { kind: \"state\", animatable: false }),\r\n /** The grid a transition's leaving arrangement was borrowed from, followed while the items travel. */\r\n transitionSource: Types.custom<string, NodeView | null, { readonly private: true }>(\"\", { kind: \"nodeRef\", private: true }),\r\n}\r\n\r\n/** A grid's size is what its items come to, whether it was built with children or they arrive after it. */\r\nexport const defaults = { width: \"hug\", height: \"hug\" } as const\r\n\r\n/** What a grid's commands read of its state, beyond its own arrangement's entries. */\r\nexport type GridValues = Values<typeof state> & { readonly padding: InsetsResolved }\r\n\r\n/** What a grid's measure, layout and render read of its state, beyond its own arrangement's entries. */\r\nexport type GridState = GridValues & {\r\n readonly width: LayoutItem[\"width\"]\r\n readonly height: LayoutItem[\"height\"]\r\n readonly children: readonly ChildView[]\r\n}\r\n\r\n/** What makes one grid's arrangement from its state: the rest of a grid is this module. */\r\nexport interface Arranger<S = unknown> {\r\n /** This grid's own arrangement, for a content box of `box`. */\r\n arrangement(state: S, box: Size2D): Arrangement\r\n /** The room each item is measured in — the whole content box, unless the arrangement has cells. */\r\n itemSpace?(state: S, count: number, space: Size2D): Size2D\r\n}\r\n\r\ntype GridComponent = { readonly key: string; readonly node: abstract new (...args: never[]) => object }\r\n\r\nconst GRIDS = new Map<string, { readonly component: GridComponent; readonly arranger: Arranger<never> }>()\r\n\r\n/**\r\n * `component` as a grid: registers its `arranger`, which another grid borrowing\r\n * its arrangement or morphing into it reads it by, and which {@link isGrid} knows it by.\r\n */\r\nexport function define<C extends GridComponent, S>(component: C, arranger: Arranger<S>): C {\r\n GRIDS.set(component.key, { component, arranger: arranger as Arranger<never> })\r\n return component\r\n}\r\n\r\n/** Whether `value` is a node of one of the grids {@link define} has seen. */\r\nexport function isGrid(value: unknown): boolean {\r\n for (const { component } of GRIDS.values()) if (value instanceof component.node) return true\r\n return false\r\n}\r\n\r\n/** The grid's measure, layout and render, for `arranger`'s arrangement: spread them into the component. */\r\nexport function fields<S>(arranger: Arranger<S>) {\r\n return {\r\n measure: (measurer: Measurer, s: GridState & S, children: readonly ChildView[]) => measure(measurer, s, children, arranger),\r\n layout: (box: LayoutBox, s: GridState & S, children: readonly ChildView[]) => layout(box, s, children, arranger),\r\n render: (ctx: RenderContext, s: GridState & S) => render(ctx, s, arranger),\r\n }\r\n}\r\n\r\nconst NO_CONTENT: Size2D = { width: 0, height: 0 }\r\nconst CENTRE = { x: 0, y: 0 }\r\n\r\n/** What `measure` found, for `layout` to reuse in the same pass. Keyed by the grid's state, one object per node. */\r\nconst measured = new WeakMap<object, { space: Size2D; sizes: Size2D[] }>()\r\n\r\nexport function measure<S>(measurer: Measurer, s: GridState & S, children: readonly ChildView[], arranger: Arranger<S>): Size2D {\r\n const constraints = { maxWidth: measurer.max.width, maxHeight: measurer.max.height }\r\n const padding = s.padding\r\n if (children.length === 0) {\r\n measured.delete(s)\r\n return flowOps.size(s, constraints, padding, NO_CONTENT)\r\n }\r\n const space = flowOps.contentBox(s, constraints, padding)\r\n const sizes = measureItems(children, space, s, arranger)\r\n measured.set(s, { space, sizes })\r\n const grid = { state: s, arranger, children, isSelf: sharesChildren(children) }\r\n const target = targetSlots(grid, sizes.length, sizes, space, measurer.time.total)\r\n return flowOps.size(s, constraints, padding, extentOf(target.slots, sizes, focalOf(s, target.arrangement)))\r\n}\r\n\r\nexport function layout<S>(box: LayoutBox, s: GridState & S, children: readonly ChildView[], arranger: Arranger<S>): readonly Placement2D[] {\r\n const kept = measured.get(s)\r\n measured.delete(s)\r\n if (children.length === 0) return []\r\n const inner = insetsOps.insetBounds(box.width, box.height, s.padding)\r\n const sizes = kept && kept.sizes.length === children.length && sameSize(kept.space, inner)\r\n ? kept.sizes\r\n : measureItems(children, inner, s, arranger)\r\n const slots = resolve({ state: s, arranger, children, isSelf: sharesChildren(children) }, sizes, inner, box.time.total)\r\n return slots.map((slot, i) => placement(inner, slot, sizes[i]))\r\n}\r\n\r\n/**\r\n * A grid whose arrangement has depth is seen through a camera of its own,\r\n * which paints its items far to near — unless it already sits in a space (an\r\n * orbit camera, a 3D stage), where its items join that one and its camera.\r\n */\r\nexport function render<S>(ctx: RenderContext, s: GridState & S, arranger: Arranger<S>): void {\r\n // With no items there is nothing to see through a camera.\r\n const focal = s.children.length === 0 ? 0 : focalOf(s, arrangementOf({ state: s, arranger, children: [], isSelf: () => false }, contentBox(ctx.size, s.padding)))\r\n if (focal > 0 && !ctx.inSpace) ctx.space(cameraAt(focal))\r\n else ctx.children()\r\n}\r\n\r\n/** A node's content box: its laid-out size inside its padding. */\r\nexport function contentBoxOf(grid: Node2D): Size2D {\r\n const b = grid.layoutBounds\r\n return contentBox({ width: b.width, height: b.height }, grid.effectivePadding())\r\n}\r\n\r\n// ---- what commands share --------------------------------------------------\r\n\r\ntype GridTimeline = Timeline<StaggerArgs, never>\r\n\r\n/**\r\n * Each item's slot in its arrangement as it stands, for a command being built,\r\n * at the clock commands are built against (the tree stands at time 0 while a\r\n * timeline compiles): what its stagger is ranked by.\r\n */\r\nexport function itemSlots(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): Slot[] {\r\n const grid = commandGrid(timeline, s, children)\r\n const sizes = children.map((child) => child.size)\r\n return targetSlots(grid, children.length, sizes, contentBox(timeline.node.size, s.padding), 0).slots\r\n}\r\n\r\n/** Each item's start in a stagger. A random order is seeded by the node's id, so it never changes between builds. */\r\nexport function ranks(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[], order: StaggerOrder | undefined): number[] {\r\n return staggerRanks(order ?? \"index\", itemSlots(timeline, s, children), hashSeed(timeline.node.id))\r\n}\r\n\r\n/**\r\n * Write `changes` to the arrangement and move each item from its slot in the\r\n * one being left to its slot in the new one, staggered.\r\n */\r\nexport function transitionTo(\r\n timeline: GridTimeline,\r\n s: GridValues,\r\n children: readonly ChildView[],\r\n changes: Record<string, unknown>,\r\n stagger = TRANSITION_STAGGER,\r\n): Piece {\r\n const from = snapshot(timeline, s, children)\r\n const ease = timeline.easing ?? easeInOut(\"cubic\")\r\n const order = ranks(timeline, s, children, timeline.args.staggerOrder)\r\n const spread = timeline.args.stagger ?? stagger\r\n return timeline.animate((t) => {\r\n if (t >= 1) return { ...changes, transition: null, transitionSource: \"\" } as never\r\n const mix = order.map((rank) => ease(staggerProgress(rank, t, spread)))\r\n return { ...changes, transition: { from, mix }, transitionSource: from.source } as never\r\n }, { eased: false })\r\n}\r\n\r\n/** Emphasise the items `isFocus` picks and push the rest back. */\r\nexport function focusOn(\r\n timeline: Timeline<object, never>,\r\n s: GridValues,\r\n isFocus: (item: number) => boolean,\r\n count: number,\r\n dim: number,\r\n grow: number,\r\n): Piece {\r\n const from = s.focusState\r\n const target = Array.from({ length: count }, (_, i) => (isFocus(i) ? 1 : -1))\r\n const ease = timeline.easing ?? easeInOut(\"cubic\")\r\n return timeline.animate((t) => {\r\n const e = ease(t)\r\n return {\r\n focusState: {\r\n dim: lerp(from?.dim ?? dim, dim, e),\r\n grow: lerp(from?.grow ?? grow, grow, e),\r\n values: target.map((v, i) => lerp(from?.values[i] ?? 0, v, e)),\r\n },\r\n } as never\r\n }, { eased: false })\r\n}\r\n\r\n// What the commands are typed against: the shared state, and the padding every node has.\r\nconst GRID_STATE = { ...state, padding: Types.insets }\r\n\r\nexport const commands = commandsFor(GRID_STATE, {\r\n /**\r\n * Bring the items in, one after another. Every item starts hidden, so place\r\n * it where the grid enters — or after a `conceal`.\r\n */\r\n reveal: {\r\n args: { style: Types.oneOf(REVEAL_STYLES, { default: \"scale\" }), ...staggerArgs(0.5) },\r\n run: (timeline, s, children) => {\r\n const style = timeline.args.style ?? \"scale\"\r\n const ease = timeline.easing ?? (style === \"scale\" || style === \"flip\" ? easeOut(\"back\") : easeOut(\"cubic\"))\r\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\r\n const stagger = timeline.args.stagger ?? 0.5\r\n return timeline.animate((t) => {\r\n if (t >= 1) return { revealState: null }\r\n return { revealState: { style, values: order.map((rank) => ease(staggerProgress(rank, t, stagger))) } }\r\n }, { eased: false })\r\n },\r\n },\r\n /** Take the items out, one after another — `reveal` in reverse. They stay hidden after. */\r\n conceal: {\r\n args: { style: Types.oneOf(REVEAL_STYLES, { default: \"scale\" }), ...staggerArgs(0.5) },\r\n run: (timeline, s, children) => {\r\n const style = timeline.args.style ?? \"scale\"\r\n const ease = timeline.easing ?? (style === \"scale\" || style === \"flip\" ? easeIn(\"back\") : easeInOut(\"cubic\"))\r\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\r\n const stagger = timeline.args.stagger ?? 0.5\r\n const from = s.revealState?.values\r\n return timeline.animate((t) => ({\r\n revealState: {\r\n style,\r\n values: order.map((rank, i) => (from?.[i] ?? 1) * (1 - ease(staggerProgress(rank, t, stagger)))),\r\n },\r\n }), { eased: false })\r\n },\r\n },\r\n /** Send a ripple through the items that swells each in turn and settles back. */\r\n wave: {\r\n args: {\r\n style: Types.oneOf(WAVE_STYLES, { default: \"scale\" }),\r\n amount: Types.number(0.3, { min: 0, max: 2, step: 0.05 }),\r\n ...staggerArgs(0.7),\r\n },\r\n run: (timeline, s, children) => {\r\n const style = timeline.args.style ?? \"scale\"\r\n const amount = timeline.args.amount ?? 0.3\r\n const ease = timeline.easing ?? easeInOut(\"sine\")\r\n const order = ranks(timeline as never, s, children, timeline.args.staggerOrder)\r\n const stagger = timeline.args.stagger ?? 0.7\r\n return timeline.animate((t) => {\r\n if (t >= 1) return { waveState: null }\r\n return { waveState: { style, amount, values: order.map((rank) => Math.sin(Math.PI * ease(staggerProgress(rank, t, stagger)))) } }\r\n }, { eased: false })\r\n },\r\n },\r\n /** Bring one item (by its place in the layers, from 0) forward and push the rest back. */\r\n focus: {\r\n args: {\r\n item: Types.number(0, { min: 0, step: 1 }),\r\n dim: Types.number(0.7, { min: 0, max: 1, step: 0.05 }),\r\n grow: Types.number(0.15, { min: 0, max: 1, step: 0.05 }),\r\n },\r\n run: (timeline, s, children) => {\r\n const item = Math.round(timeline.args.item ?? 0)\r\n return focusOn(timeline as never, s, (i) => i === item, children.length, timeline.args.dim ?? 0.7, timeline.args.grow ?? 0.15)\r\n },\r\n },\r\n /** Bring every item back to even. */\r\n unfocus: (timeline, s) => {\r\n const from = s.focusState\r\n const ease = timeline.easing ?? easeInOut(\"cubic\")\r\n return timeline.animate((t) => {\r\n if (t >= 1 || !from) return { focusState: null }\r\n const k = 1 - ease(t)\r\n return { focusState: { ...from, values: from.values.map((v) => v * k) } }\r\n }, { eased: false })\r\n },\r\n /** Gather the items toward the centre (`0`), back to the arrangement (`1`), or push them apart. */\r\n spreadTo: {\r\n args: { spread: Types.number(1, { min: 0, max: 3, step: 0.05 }) },\r\n run: (timeline) => timeline.tween({ spread: timeline.args.spread ?? 1 }),\r\n },\r\n /** Send every item to a random slot. The same `seed` always deals the same way. */\r\n shuffle: {\r\n args: { seed: Types.number(1, { min: 0, step: 1 }), ...staggerArgs(TRANSITION_STAGGER) },\r\n run: (timeline, s, children) => {\r\n const current = normalizeOrder(s.order, children.length)\r\n let next = shuffled(current, timeline.args.seed ?? 1)\r\n // A shuffle that deals everything back where it was would look like nothing happened.\r\n if (next.length > 1 && next.every((item, k) => item === current[k])) next = [...next.slice(1), next[0]]\r\n return transitionTo(timeline as never, s, children, { order: next })\r\n },\r\n },\r\n /** Two items trade places, by their place in the layers. */\r\n swap: {\r\n args: {\r\n first: Types.number(0, { min: 0, step: 1 }),\r\n second: Types.number(1, { min: 0, step: 1 }),\r\n ...staggerArgs(0),\r\n },\r\n run: (timeline, s, children) => {\r\n const order = normalizeOrder(s.order, children.length)\r\n const a = order.indexOf(Math.round(timeline.args.first ?? 0))\r\n const b = order.indexOf(Math.round(timeline.args.second ?? 1))\r\n if (a >= 0 && b >= 0) [order[a], order[b]] = [order[b], order[a]]\r\n return transitionTo(timeline as never, s, children, { order }, 0)\r\n },\r\n },\r\n /** Move the items into a new order — a list of layer indices, first slot first, like `\"2, 0, 1\"`. */\r\n reorder: {\r\n args: { order: Types.text(\"\"), ...staggerArgs(TRANSITION_STAGGER) },\r\n run: (timeline, s, children) => {\r\n const order = normalizeOrder(parseOrder(timeline.args.order), children.length)\r\n return transitionTo(timeline as never, s, children, { order })\r\n },\r\n },\r\n /**\r\n * Move every item into another grid's arrangement — a grid into a ring, a ring\r\n * onto a sphere — and keep following it. An empty `target` morphs back to\r\n * this grid's own.\r\n */\r\n morphInto: {\r\n args: { target: nodeRefArg(ITEM_GRID_TYPES), ...staggerArgs(TRANSITION_STAGGER) },\r\n run: (timeline, s, children) => transitionTo(timeline as never, s, children, { arrangeLike: timeline.args.target ?? \"\" }),\r\n },\r\n})\r\n\r\n// ---- the one pass ------------------------------------------------------------\r\n\r\ninterface Grid {\r\n readonly state: GridValues\r\n readonly arranger: Arranger<never>\r\n readonly children: readonly ChildView[]\r\n /** Whether a view is this grid itself, which borrows nothing from itself. */\r\n readonly isSelf: (view: NodeView) => boolean\r\n}\r\n\r\nfunction arrangerOf(key: string): Arranger<never> {\r\n const grid = GRIDS.get(key)\r\n if (!grid) throw new Error(`\"${key}\" is no grid: pass its component through ItemGrid.define.`)\r\n return grid.arranger\r\n}\r\n\r\n/** A grid `view` names, when it is one this kit can arrange and not the reader itself. */\r\nfunction gridIn(view: NodeView | null | undefined, grid: Grid): { view: NodeView; arranger: Arranger<never> } | null {\r\n if (!view) return null\r\n const found = GRIDS.get(view.key)\r\n if (!found || grid.isSelf(view)) return null\r\n return { view, arranger: found.arranger }\r\n}\r\n\r\n/** In layout, a view is this grid when it holds the same children: a child has one parent. */\r\nfunction sharesChildren(children: readonly ChildView[]): (view: NodeView) => boolean {\r\n return (view) => {\r\n if (children.length === 0) return false\r\n const theirs = (view.state as { readonly children?: readonly ChildView[] }).children\r\n return theirs?.[0] === children[0]\r\n }\r\n}\r\n\r\nfunction commandGrid(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): Grid {\r\n return { state: s, arranger: arrangerOf(timeline.node.key), children, isSelf: (view) => view.id === timeline.node.id }\r\n}\r\n\r\nfunction snapshot(timeline: Timeline<object, never>, s: GridValues, children: readonly ChildView[]): GridSnapshot {\r\n const grid = commandGrid(timeline, s, children)\r\n const source = gridIn(s.arrangeLike, grid)\r\n return {\r\n arrangement: source\r\n ? source.arranger.arrangement(source.view.state as never, viewBox(source.view))\r\n : grid.arranger.arrangement(s as never, contentBox(timeline.node.size, s.padding)),\r\n source: source?.view.id ?? \"\",\r\n order: normalizeOrder(s.order, children.length),\r\n spread: s.spread,\r\n }\r\n}\r\n\r\nfunction measureItems(children: readonly ChildView[], space: Size2D, s: unknown, arranger: Arranger<never>): Size2D[] {\r\n const sizes = children.map((child) => child.measure(space))\r\n const cell = arranger.itemSpace ? arranger.itemSpace(s as never, children.length, space) : space\r\n if (cell === space) return sizes\r\n return children.map((child) => child.measure(cell))\r\n}\r\n\r\n/** The arrangement the grid is heading for: the one it borrows, or its own. */\r\nfunction arrangementOf(grid: Grid, box: Size2D): Arrangement {\r\n const source = gridIn(grid.state.arrangeLike, grid)\r\n return source ? source.arranger.arrangement(source.view.state as never, viewBox(source.view)) : grid.arranger.arrangement(grid.state as never, box)\r\n}\r\n\r\n/** Where each item sits in the arrangement it is heading for, before any transition or effect. */\r\nfunction targetSlots(grid: Grid, count: number, sizes: readonly Size2D[], box: Size2D, time: number): { slots: Slot[]; arrangement: Arrangement } {\r\n const s = grid.state\r\n const source = gridIn(s.arrangeLike, grid)\r\n const sourceBox = source ? viewBox(source.view) : box\r\n const arrangement = source ? source.arranger.arrangement(source.view.state as never, sourceBox) : grid.arranger.arrangement(s as never, box)\r\n let slots = slotsOf(arrangement, { count, sizes, box: sourceBox, time })\r\n if (source) slots = inFrame(source.view.frame, slots)\r\n const slotOf = slotOfItem(normalizeOrder(s.order, count))\r\n return { slots: slotOf.map((k) => spreadSlot(slots[k], s.spread)), arrangement }\r\n}\r\n\r\n/** Each item's final slot this frame: the target, blended from any transition, with its effects on. */\r\nfunction resolve(grid: Grid, sizes: readonly Size2D[], box: Size2D, time: number): Slot[] {\r\n const s = grid.state\r\n const count = sizes.length\r\n const slots = targetSlots(grid, count, sizes, box, time).slots\r\n const transition = s.transition\r\n if (transition) {\r\n const { from } = transition\r\n const named = from.source ? s.transitionSource : null\r\n const source = named && named.id === from.source && GRIDS.has(named.key) ? named : null\r\n const self = source !== null && grid.isSelf(source)\r\n const fromBox = source && !self ? viewBox(source) : box\r\n let leaving = slotsOf(from.arrangement, { count, sizes, box: fromBox, time })\r\n if (source && !self) leaving = inFrame(source.frame, leaving)\r\n const slotOf = slotOfItem(normalizeOrder(from.order, count))\r\n for (let i = 0; i < count; i++) {\r\n slots[i] = blendSlot(spreadSlot(leaving[slotOf[i]], from.spread), slots[i], transition.mix[i] ?? 1)\r\n }\r\n }\r\n const reveal = s.revealState\r\n const wave = s.waveState\r\n const focus = s.focusState\r\n if (reveal || wave || focus) {\r\n for (let i = 0; i < count; i++) applyItemEffects(slots[i], i, sizes[i], reveal, wave, focus)\r\n }\r\n return slots\r\n}\r\n\r\n/** The camera distance the grid is seen through: the target's, or, while a morph runs, the one it is leaving. */\r\nfunction focalOf(s: GridValues, target: Arrangement): number {\r\n // A morph into or out of depth keeps the camera for its whole length.\r\n return focalLengthOf(target) || (s.transition ? focalLengthOf(s.transition.from.arrangement) : 0)\r\n}\r\n\r\nfunction cameraAt(focal: number): SpaceCamera {\r\n return {\r\n perspective: focal,\r\n orbit: 0,\r\n elevation: 0,\r\n dolly: 0,\r\n lookAt: CENTRE,\r\n zoom: 1,\r\n heading: 0,\r\n viewportX: 0,\r\n viewportY: 0,\r\n }\r\n}\r\n\r\n/** A slot as a child's placement: its box centred on the slot, and the slot's transform when it has one. */\r\nfunction placement(inner: { x: number; y: number }, s: Slot, size: Size2D): Placement2D {\r\n const box = { x: inner.x + s.x, y: s.y - inner.y, width: size.width, height: size.height }\r\n if (s.rotation === 0 && s.scale === 1 && s.rotationX === 0 && s.rotationY === 0 && s.depth === 0 && s.opacity === 1) return box\r\n return {\r\n ...box,\r\n rotation: s.rotation,\r\n scale: s.scale,\r\n rotationX: s.rotationX,\r\n rotationY: s.rotationY,\r\n depth: s.depth,\r\n opacity: s.opacity,\r\n }\r\n}\r\n\r\n/** `slots`, laid out in another grid's frame, moved into this grid's. */\r\nfunction inFrame(frame: NodeFrame, slots: Slot[]): Slot[] {\r\n return slots.map((s) => {\r\n const p = rotateClockwise(s.x * frame.scale, s.y * frame.scale, frame.rotation)\r\n return {\r\n ...s,\r\n x: frame.x + p.x,\r\n y: frame.y + p.y,\r\n depth: s.depth * frame.scale,\r\n rotation: s.rotation + frame.rotation,\r\n scale: s.scale * frame.scale,\r\n }\r\n })\r\n}\r\n\r\nfunction viewBox(view: NodeView): Size2D {\r\n return contentBox(view.size, (view.state as { readonly padding: InsetsResolved }).padding)\r\n}\r\n\r\n/** A box of `size` inside `padding`: what a command reads as its grid's content box from `timeline.node.size`. */\r\nexport function contentBox(size: Size2D, padding: InsetsResolved): Size2D {\r\n const inner = insetsOps.insetBounds(size.width, size.height, padding)\r\n return { width: inner.width, height: inner.height }\r\n}\r\n\r\n/** The box, centred on the grid, that holds every item where its slot puts it. */\r\nfunction extentOf(slots: readonly Slot[], sizes: readonly Size2D[], focal: number): Size2D {\r\n let halfWidth = 0\r\n let halfHeight = 0\r\n for (let i = 0; i < slots.length; i++) {\r\n const s = slots[i]\r\n const size = sizes[i]\r\n const rad = (s.rotation * Math.PI) / 180\r\n const cos = Math.abs(Math.cos(rad))\r\n const sin = Math.abs(Math.sin(rad))\r\n // What the camera does to a slot at depth, so a sphere hugs its front.\r\n const lens = focal > 0 && focal - s.depth > 1 ? focal / (focal - s.depth) : 1\r\n const w = ((size.width * cos + size.height * sin) / 2) * s.scale * lens\r\n const h = ((size.width * sin + size.height * cos) / 2) * s.scale * lens\r\n halfWidth = Math.max(halfWidth, Math.abs(s.x) * lens + w)\r\n halfHeight = Math.max(halfHeight, Math.abs(s.y) * lens + h)\r\n }\r\n return { width: halfWidth * 2, height: halfHeight * 2 }\r\n}\r\n\r\nfunction rotateClockwise(x: number, y: number, degrees: number): { x: number; y: number } {\r\n if (degrees === 0) return { x, y }\r\n const rad = (degrees * Math.PI) / 180\r\n const cos = Math.cos(rad)\r\n const sin = Math.sin(rad)\r\n return { x: x * cos + y * sin, y: -x * sin + y * cos }\r\n}\r\n\r\nfunction sameSize(a: Size2D, b: Size2D): boolean {\r\n return Math.abs(a.width - b.width) < 1e-6 && Math.abs(a.height - b.height) < 1e-6\r\n}\r\n\r\nfunction lerp(a: number, b: number, t: number): number {\r\n return a + (b - a) * t\r\n}\r\n"]}
|
package/dist/nodes.d.ts
CHANGED
|
@@ -6,10 +6,15 @@ import { SphereGrid } from "./sphere-grid/index.js";
|
|
|
6
6
|
* Every node type this package publishes.
|
|
7
7
|
*
|
|
8
8
|
* A host registers these by handing the array to an engine —
|
|
9
|
-
* `new Engine(platform, { nodes: NODES })` — which reads each
|
|
10
|
-
*
|
|
9
|
+
* `new Engine(platform, { nodes: NODES })` — which reads each component's key.
|
|
10
|
+
* Defining a component only *declares* that key: nothing is registered by
|
|
11
|
+
* importing a module, so a registry holds exactly what its owner asked for.
|
|
12
|
+
*
|
|
13
|
+
* Listing the component **values** is also what survives bundling: this package
|
|
11
14
|
* declares `sideEffects: false`, and a document names a node type by string, so
|
|
12
15
|
* an import kept only for its side effect is exactly what gets shaken out.
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
type KitNode = typeof RectangularGrid | typeof RadialGrid | typeof PathGrid | typeof SphereGrid;
|
|
18
|
+
export declare const NODES: KitNode[];
|
|
19
|
+
export {};
|
|
15
20
|
//# sourceMappingURL=nodes.d.ts.map
|
package/dist/nodes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C;;;;;;;;;;;GAWG;AAEH,KAAK,OAAO,GACR,OAAO,eAAe,GACtB,OAAO,UAAU,GACjB,OAAO,QAAQ,GACf,OAAO,UAAU,CAAA;AAErB,eAAO,MAAM,KAAK,EAAE,OAAO,EAK1B,CAAA"}
|
package/dist/nodes.js
CHANGED
|
@@ -2,14 +2,10 @@ import { PathGrid } from "./path-grid/index.js";
|
|
|
2
2
|
import { RadialGrid } from "./radial-grid/index.js";
|
|
3
3
|
import { RectangularGrid } from "./rectangular-grid/index.js";
|
|
4
4
|
import { SphereGrid } from "./sphere-grid/index.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* declares `sideEffects: false`, and a document names a node type by string, so
|
|
12
|
-
* an import kept only for its side effect is exactly what gets shaken out.
|
|
13
|
-
*/
|
|
14
|
-
export const NODES = [RectangularGrid, RadialGrid, PathGrid, SphereGrid];
|
|
5
|
+
export const NODES = [
|
|
6
|
+
RectangularGrid,
|
|
7
|
+
RadialGrid,
|
|
8
|
+
PathGrid,
|
|
9
|
+
SphereGrid,
|
|
10
|
+
];
|
|
15
11
|
//# sourceMappingURL=nodes.js.map
|
package/dist/nodes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAqB1C,MAAM,CAAC,MAAM,KAAK,GAAc;IAC9B,eAAe;IACf,UAAU;IACV,QAAQ;IACR,UAAU;CACX,CAAA","sourcesContent":["import { PathGrid } from \"./path-grid\"\r\nimport { RadialGrid } from \"./radial-grid\"\r\nimport { RectangularGrid } from \"./rectangular-grid\"\r\nimport { SphereGrid } from \"./sphere-grid\"\r\n\r\n/**\r\n * Every node type this package publishes.\r\n *\r\n * A host registers these by handing the array to an engine —\r\n * `new Engine(platform, { nodes: NODES })` — which reads each component's key.\r\n * Defining a component only *declares* that key: nothing is registered by\r\n * importing a module, so a registry holds exactly what its owner asked for.\r\n *\r\n * Listing the component **values** is also what survives bundling: this package\r\n * declares `sideEffects: false`, and a document names a node type by string, so\r\n * an import kept only for its side effect is exactly what gets shaken out.\r\n */\r\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\r\ntype KitNode =\r\n | typeof RectangularGrid\r\n | typeof RadialGrid\r\n | typeof PathGrid\r\n | typeof SphereGrid\r\n\r\nexport const NODES: KitNode[] = [\r\n RectangularGrid,\r\n RadialGrid,\r\n PathGrid,\r\n SphereGrid,\r\n]\r\n"]}
|
|
@@ -1,82 +1,196 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { ItemGrid
|
|
3
|
-
/** A template, or `custom` for the grid's own
|
|
1
|
+
import { type NodeOf, type NodeView, type PathData, type Node2D as _Node2D, type Node2DProps as _Node2DProps } from "@motionscript/sdk";
|
|
2
|
+
import { ItemGrid } from "../kit/index.js";
|
|
3
|
+
/** A template, or `custom` for the grid's own `path`. */
|
|
4
4
|
export declare const PATH_GRID_SHAPES: readonly ["circle", "square", "star", "heart", "infinity", "wave", "spiral", "arc", "line", "custom"];
|
|
5
5
|
export type PathGridShape = (typeof PATH_GRID_SHAPES)[number];
|
|
6
|
-
export interface PathGridProps extends ItemGridProps {
|
|
7
|
-
shape: PathGridShape;
|
|
8
|
-
path: PathData;
|
|
9
|
-
pathNode: string;
|
|
10
|
-
spacing: PathSpacing;
|
|
11
|
-
spacingDistance: number;
|
|
12
|
-
offset: number;
|
|
13
|
-
flowSpeed: number;
|
|
14
|
-
trimStart: number;
|
|
15
|
-
trimEnd: number;
|
|
16
|
-
alignToPath: boolean;
|
|
17
|
-
}
|
|
18
6
|
/**
|
|
19
7
|
* Children along a path: one of the templates drawn to fill the node's box,
|
|
20
|
-
* a path of the grid's own, or a
|
|
8
|
+
* a path of the grid's own, or a path node elsewhere in the scene, followed
|
|
21
9
|
* wherever it is.
|
|
22
10
|
*
|
|
23
11
|
* Items are spaced by distance along the curve, so they sit evenly on a tight
|
|
24
|
-
* bend and a straight alike. Animating
|
|
25
|
-
*
|
|
12
|
+
* bend and a straight alike. Animating `offset` moves them along it — on a
|
|
13
|
+
* closed path they come round again, which is a conveyor belt for free.
|
|
26
14
|
*/
|
|
27
|
-
export declare
|
|
28
|
-
shape:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
trimTo
|
|
51
|
-
trimStart
|
|
52
|
-
trimEnd
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
15
|
+
export declare const PathGrid: import("@motionscript/sdk").Component<"pathGrid", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
16
|
+
readonly shape: import("@motionscript/sdk").Type<"circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", "circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", false>;
|
|
17
|
+
readonly path: import("@motionscript/sdk").Attribute<PathData, PathData>;
|
|
18
|
+
readonly pathNode: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
19
|
+
readonly spacing: import("@motionscript/sdk").Type<"distribute" | "fixed", "distribute" | "fixed", false>;
|
|
20
|
+
readonly spacingDistance: import("@motionscript/sdk").Type<number, number, false>;
|
|
21
|
+
readonly offset: import("@motionscript/sdk").Type<number, number, false>;
|
|
22
|
+
readonly flowSpeed: import("@motionscript/sdk").Type<number, number, false>;
|
|
23
|
+
readonly trimStart: import("@motionscript/sdk").Type<number, number, false>;
|
|
24
|
+
readonly trimEnd: import("@motionscript/sdk").Type<number, number, false>;
|
|
25
|
+
readonly alignToPath: boolean;
|
|
26
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
27
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
28
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
29
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
30
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
31
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
32
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
33
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
34
|
+
}>, {
|
|
35
|
+
readonly flow: {
|
|
36
|
+
readonly loops: import("@motionscript/sdk").Type<number, number, false>;
|
|
37
|
+
};
|
|
38
|
+
readonly trimTo: {
|
|
39
|
+
readonly trimStart: import("@motionscript/sdk").Type<0.25 | undefined, 0.25 | undefined, false>;
|
|
40
|
+
readonly trimEnd: import("@motionscript/sdk").Type<0.75 | undefined, 0.75 | undefined, false>;
|
|
41
|
+
};
|
|
42
|
+
readonly setPath: {
|
|
43
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
44
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
45
|
+
readonly shape: import("@motionscript/sdk").Type<"heart" | undefined, "heart" | undefined, false>;
|
|
46
|
+
readonly pathNode: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
47
|
+
};
|
|
48
|
+
readonly reveal: {
|
|
49
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
50
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
51
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
52
|
+
};
|
|
53
|
+
readonly conceal: {
|
|
54
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
55
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
56
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
57
|
+
};
|
|
58
|
+
readonly wave: {
|
|
59
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
60
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
61
|
+
readonly style: import("@motionscript/sdk").Type<"scale" | "fade" | "spin" | "lift", "scale" | "fade" | "spin" | "lift", false>;
|
|
62
|
+
readonly amount: import("@motionscript/sdk").Type<number, number, false>;
|
|
63
|
+
};
|
|
64
|
+
readonly focus: {
|
|
65
|
+
readonly item: import("@motionscript/sdk").Type<number, number, false>;
|
|
66
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
67
|
+
readonly grow: import("@motionscript/sdk").Type<number, number, false>;
|
|
68
|
+
};
|
|
69
|
+
readonly unfocus: unknown;
|
|
70
|
+
readonly spreadTo: {
|
|
71
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
72
|
+
};
|
|
73
|
+
readonly shuffle: {
|
|
74
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
75
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
76
|
+
readonly seed: import("@motionscript/sdk").Type<number, number, false>;
|
|
77
|
+
};
|
|
78
|
+
readonly swap: {
|
|
79
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
80
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
81
|
+
readonly first: import("@motionscript/sdk").Type<number, number, false>;
|
|
82
|
+
readonly second: import("@motionscript/sdk").Type<number, number, false>;
|
|
83
|
+
};
|
|
84
|
+
readonly reorder: {
|
|
85
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
86
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
87
|
+
readonly order: import("@motionscript/sdk").Type<string, string, false>;
|
|
88
|
+
};
|
|
89
|
+
readonly morphInto: {
|
|
90
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
91
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
92
|
+
readonly target: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
93
|
+
};
|
|
94
|
+
}, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
95
|
+
readonly shape: import("@motionscript/sdk").Type<"circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", "circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", false>;
|
|
96
|
+
readonly path: import("@motionscript/sdk").Attribute<PathData, PathData>;
|
|
97
|
+
readonly pathNode: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
98
|
+
readonly spacing: import("@motionscript/sdk").Type<"distribute" | "fixed", "distribute" | "fixed", false>;
|
|
99
|
+
readonly spacingDistance: import("@motionscript/sdk").Type<number, number, false>;
|
|
100
|
+
readonly offset: import("@motionscript/sdk").Type<number, number, false>;
|
|
101
|
+
readonly flowSpeed: import("@motionscript/sdk").Type<number, number, false>;
|
|
102
|
+
readonly trimStart: import("@motionscript/sdk").Type<number, number, false>;
|
|
103
|
+
readonly trimEnd: import("@motionscript/sdk").Type<number, number, false>;
|
|
104
|
+
readonly alignToPath: boolean;
|
|
105
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
106
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
107
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
108
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
109
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
110
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
111
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
112
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
113
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
114
|
+
readonly shape: import("@motionscript/sdk").Type<"circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", "circle" | "square" | "star" | "heart" | "infinity" | "wave" | "spiral" | "arc" | "line" | "custom", false>;
|
|
115
|
+
readonly path: import("@motionscript/sdk").Attribute<PathData, PathData>;
|
|
116
|
+
readonly pathNode: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
117
|
+
readonly spacing: import("@motionscript/sdk").Type<"distribute" | "fixed", "distribute" | "fixed", false>;
|
|
118
|
+
readonly spacingDistance: import("@motionscript/sdk").Type<number, number, false>;
|
|
119
|
+
readonly offset: import("@motionscript/sdk").Type<number, number, false>;
|
|
120
|
+
readonly flowSpeed: import("@motionscript/sdk").Type<number, number, false>;
|
|
121
|
+
readonly trimStart: import("@motionscript/sdk").Type<number, number, false>;
|
|
122
|
+
readonly trimEnd: import("@motionscript/sdk").Type<number, number, false>;
|
|
123
|
+
readonly alignToPath: boolean;
|
|
124
|
+
readonly order: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
125
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
126
|
+
readonly arrangeLike: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
|
|
127
|
+
readonly revealState: import("@motionscript/sdk").Type<import("../index.js").RevealState | null | undefined, import("../index.js").RevealState | null | undefined, false>;
|
|
128
|
+
readonly waveState: import("@motionscript/sdk").Type<import("../index.js").WaveState | null | undefined, import("../index.js").WaveState | null | undefined, false>;
|
|
129
|
+
readonly focusState: import("@motionscript/sdk").Type<import("../index.js").FocusState | null | undefined, import("../index.js").FocusState | null | undefined, false>;
|
|
130
|
+
readonly transition: import("@motionscript/sdk").Type<ItemGrid.GridTransition | null | undefined, ItemGrid.GridTransition | null | undefined, false>;
|
|
131
|
+
readonly transitionSource: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
|
|
132
|
+
}>, {
|
|
133
|
+
readonly flow: {
|
|
134
|
+
readonly loops: import("@motionscript/sdk").Type<number, number, false>;
|
|
135
|
+
};
|
|
136
|
+
readonly trimTo: {
|
|
137
|
+
readonly trimStart: import("@motionscript/sdk").Type<0.25 | undefined, 0.25 | undefined, false>;
|
|
138
|
+
readonly trimEnd: import("@motionscript/sdk").Type<0.75 | undefined, 0.75 | undefined, false>;
|
|
139
|
+
};
|
|
140
|
+
readonly setPath: {
|
|
141
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
142
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
143
|
+
readonly shape: import("@motionscript/sdk").Type<"heart" | undefined, "heart" | undefined, false>;
|
|
144
|
+
readonly pathNode: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
145
|
+
};
|
|
146
|
+
readonly reveal: {
|
|
147
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
148
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
149
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
150
|
+
};
|
|
151
|
+
readonly conceal: {
|
|
152
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
153
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
154
|
+
readonly style: import("@motionscript/sdk").Type<"center" | "scale" | "fade" | "rise" | "flip" | "spin", "center" | "scale" | "fade" | "rise" | "flip" | "spin", false>;
|
|
155
|
+
};
|
|
156
|
+
readonly wave: {
|
|
157
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
158
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
159
|
+
readonly style: import("@motionscript/sdk").Type<"scale" | "fade" | "spin" | "lift", "scale" | "fade" | "spin" | "lift", false>;
|
|
160
|
+
readonly amount: import("@motionscript/sdk").Type<number, number, false>;
|
|
161
|
+
};
|
|
162
|
+
readonly focus: {
|
|
163
|
+
readonly item: import("@motionscript/sdk").Type<number, number, false>;
|
|
164
|
+
readonly dim: import("@motionscript/sdk").Type<number, number, false>;
|
|
165
|
+
readonly grow: import("@motionscript/sdk").Type<number, number, false>;
|
|
166
|
+
};
|
|
167
|
+
readonly unfocus: unknown;
|
|
168
|
+
readonly spreadTo: {
|
|
169
|
+
readonly spread: import("@motionscript/sdk").Type<number, number, false>;
|
|
170
|
+
};
|
|
171
|
+
readonly shuffle: {
|
|
172
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
173
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
174
|
+
readonly seed: import("@motionscript/sdk").Type<number, number, false>;
|
|
175
|
+
};
|
|
176
|
+
readonly swap: {
|
|
177
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
178
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
179
|
+
readonly first: import("@motionscript/sdk").Type<number, number, false>;
|
|
180
|
+
readonly second: import("@motionscript/sdk").Type<number, number, false>;
|
|
181
|
+
};
|
|
182
|
+
readonly reorder: {
|
|
183
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
184
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
185
|
+
readonly order: import("@motionscript/sdk").Type<string, string, false>;
|
|
186
|
+
};
|
|
187
|
+
readonly morphInto: {
|
|
188
|
+
readonly staggerOrder: import("@motionscript/sdk").Type<"path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", "path" | "row" | "column" | "angle" | "depth" | "index" | "reverse" | "random" | "centerOut" | "edgesIn", false>;
|
|
189
|
+
readonly stagger: import("@motionscript/sdk").Type<number, number, false>;
|
|
190
|
+
readonly target: import("@motionscript/sdk").Type<string | undefined, string | undefined, false>;
|
|
191
|
+
};
|
|
192
|
+
}, _Node2D<_Node2DProps>>>>;
|
|
193
|
+
export type PathGrid = NodeOf<typeof PathGrid>;
|
|
194
|
+
/** What a call or a document row may set. */
|
|
195
|
+
export type PathGridProps = NonNullable<Parameters<typeof PathGrid>[0]>;
|
|
82
196
|
//# sourceMappingURL=path-grid.d.ts.map
|