Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

835 B
Raw Blame
import type { CanvasStackForests } from '@workbench/canvas-engine/contracts';

import type { CanvasNodeInsertionAnchor } from './insertionAnchors';
import type { LayerStackKind } from './layerStacks';

import { EMPTY_STACKS } from './documentTree';
import { captureInsertionAnchor } from './insertionAnchors';

export const stackTopAnchor = (projectId: string, stack: LayerStackKind = 'raster'): CanvasNodeInsertionAnchor => ({
  afterId: null,
  beforeId: null,
  capturedEditRevision: 0,
  parentPath: [],
  projectId,
  stack,
});

export const createTestInsertionAnchorCapture =
  (projectId: string, getStacks: () => CanvasStackForests = () => EMPTY_STACKS) =>
  (stack: LayerStackKind, aboveId: string | null): CanvasNodeInsertionAnchor =>
    captureInsertionAnchor(getStacks(), { aboveId, editRevision: 0, projectId, stack });