{
  "version": 3,
  "sources": ["../../src/shapes/TLFrameShape.ts"],
  "sourcesContent": ["import { T } from '@tldraw/validate'\nimport { createShapePropsMigrationIds, createShapePropsMigrationSequence } from '../records/TLShape'\nimport { RecordProps } from '../recordsWithProps'\nimport { DefaultColorStyle, TLDefaultColorStyle } from '../styles/TLColorStyle'\nimport { TLBaseShape } from './TLBaseShape'\n\n/**\n * Properties for the frame shape, which provides a container for organizing other shapes.\n *\n * @public\n */\nexport interface TLFrameShapeProps {\n\t/** Width of the frame in pixels */\n\tw: number\n\t/** Height of the frame in pixels */\n\th: number\n\t/** Display name for the frame (shown in UI) */\n\tname: string\n\t/** Color style for the frame border and label */\n\tcolor: TLDefaultColorStyle\n}\n\n/**\n * A frame shape provides a container for organizing and grouping other shapes.\n * Frames can be used to create sections, organize content, or define specific areas.\n *\n * @public\n * @example\n * ```ts\n * const frameShape: TLFrameShape = {\n *   id: createShapeId(),\n *   typeName: 'shape',\n *   type: 'frame',\n *   x: 0,\n *   y: 0,\n *   rotation: 0,\n *   index: 'a1',\n *   parentId: 'page:page1',\n *   isLocked: false,\n *   opacity: 1,\n *   props: {\n *     w: 400,\n *     h: 300,\n *     name: 'Header Section',\n *     color: 'blue'\n *   },\n *   meta: {}\n * }\n * ```\n */\nexport type TLFrameShape = TLBaseShape<'frame', TLFrameShapeProps>\n\n/**\n * Validation schema for frame shape properties.\n *\n * @public\n * @example\n * ```ts\n * // Validate frame properties\n * const isValidName = frameShapeProps.name.isValid('My Frame')\n * const isValidColor = frameShapeProps.color.isValid('red')\n * ```\n */\nexport const frameShapeProps: RecordProps<TLFrameShape> = {\n\tw: T.nonZeroNumber,\n\th: T.nonZeroNumber,\n\tname: T.string,\n\t// because shape colors are an option, we don't want them to be picked up by the editor as a\n\t// style prop by default, so instead of a proper style we just supply an equivalent validator.\n\t// Check `FrameShapeUtil.configure` for how we replace this with the original\n\t// `DefaultColorStyle` style when the option is turned on.\n\tcolor: T.literalEnum(...DefaultColorStyle.values),\n}\n\nconst Versions = createShapePropsMigrationIds('frame', {\n\tAddColorProp: 1,\n})\n\n/**\n * Version identifiers for frame shape migrations.\n *\n * @public\n */\nexport { Versions as frameShapeVersions }\n\n/**\n * Migration sequence for frame shape properties across different schema versions.\n * Handles adding color properties to existing frame shapes.\n *\n * @public\n */\nexport const frameShapeMigrations = createShapePropsMigrationSequence({\n\tsequence: [\n\t\t{\n\t\t\tid: Versions.AddColorProp,\n\t\t\tup: (props) => {\n\t\t\t\tprops.color = 'black'\n\t\t\t},\n\t\t\tdown: (props) => {\n\t\t\t\tdelete props.color\n\t\t\t},\n\t\t},\n\t],\n})\n"],
  "mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,8BAA8B,yCAAyC;AAEhF,SAAS,yBAA8C;AA4DhD,MAAM,kBAA6C;AAAA,EACzD,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,MAAM,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,EAKR,OAAO,EAAE,YAAY,GAAG,kBAAkB,MAAM;AACjD;AAEA,MAAM,WAAW,6BAA6B,SAAS;AAAA,EACtD,cAAc;AACf,CAAC;AAeM,MAAM,uBAAuB,kCAAkC;AAAA,EACrE,UAAU;AAAA,IACT;AAAA,MACC,IAAI,SAAS;AAAA,MACb,IAAI,CAAC,UAAU;AACd,cAAM,QAAQ;AAAA,MACf;AAAA,MACA,MAAM,CAAC,UAAU;AAChB,eAAO,MAAM;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD,CAAC;",
  "names": []
}
