{"version":3,"file":"constants.min.mjs","names":[],"sources":["../../../../src/shapes/Text/constants.ts"],"sourcesContent":["import { FILL, LEFT, LTR, NORMAL, STROKE, reNewline } from '../../constants';\nimport type { TClassProperties } from '../../typedefs';\nimport type { FabricText } from './Text';\n\nexport const TEXT_DECORATION_THICKNESS = 'textDecorationThickness';\nexport const TEXT_DECORATION_COLOR = 'textDecorationColor';\n\nconst fontProperties = [\n  'fontSize',\n  'fontWeight',\n  'fontFamily',\n  'fontStyle',\n] as const;\n\nexport const textDecorationProperties = [\n  'underline',\n  'overline',\n  'linethrough',\n] as const;\n\nexport const textLayoutProperties: string[] = [\n  ...fontProperties,\n  'lineHeight',\n  'text',\n  'charSpacing',\n  'textAlign',\n  'styles',\n  'path',\n  'pathStartOffset',\n  'pathSide',\n  'pathAlign',\n];\n\nexport const additionalProps = [\n  ...textLayoutProperties,\n  ...textDecorationProperties,\n  'textBackgroundColor',\n  'direction',\n  TEXT_DECORATION_THICKNESS,\n  TEXT_DECORATION_COLOR,\n] as const;\n\nexport type StylePropertiesType =\n  | 'fill'\n  | 'stroke'\n  | 'strokeWidth'\n  | 'fontSize'\n  | 'fontFamily'\n  | 'fontWeight'\n  | 'fontStyle'\n  | 'textBackgroundColor'\n  | 'deltaY'\n  | 'overline'\n  | 'underline'\n  | 'linethrough'\n  | typeof TEXT_DECORATION_THICKNESS\n  | typeof TEXT_DECORATION_COLOR;\n\nexport const styleProperties: Readonly<StylePropertiesType[]> = [\n  ...fontProperties,\n  ...textDecorationProperties,\n  STROKE,\n  'strokeWidth',\n  FILL,\n  'deltaY',\n  'textBackgroundColor',\n  TEXT_DECORATION_THICKNESS,\n  TEXT_DECORATION_COLOR,\n] as const;\n\n// @TODO: Many things here are configuration related and shouldn't be on the class nor prototype\n// regexes, list of properties that are not suppose to change by instances, magic consts.\n// this will be a separated effort\nexport const textDefaultValues: Partial<TClassProperties<FabricText>> = {\n  _reNewline: reNewline,\n  _reSpacesAndTabs: /[ \\t\\r]/g,\n  _reSpaceAndTab: /[ \\t\\r]/,\n  _reWords: /\\S+/g,\n  fontSize: 40,\n  fontWeight: NORMAL,\n  fontFamily: 'Times New Roman',\n  underline: false,\n  overline: false,\n  linethrough: false,\n  textAlign: LEFT,\n  fontStyle: NORMAL,\n  lineHeight: 1.16,\n  textBackgroundColor: '',\n  stroke: null,\n  shadow: null,\n  path: undefined,\n  pathStartOffset: 0,\n  pathSide: LEFT,\n  pathAlign: 'baseline',\n  charSpacing: 0,\n  deltaY: 0,\n  direction: LTR,\n  CACHE_FONT_SIZE: 400,\n  MIN_TEXT_WIDTH: 2,\n  // Text magic numbers\n  superscript: {\n    size: 0.6, // fontSize factor\n    baseline: -0.35, // baseline-shift factor (upwards)\n  },\n  subscript: {\n    size: 0.6, // fontSize factor\n    baseline: 0.11, // baseline-shift factor (downwards)\n  },\n  _fontSizeFraction: 0.222,\n  offsets: {\n    underline: 0.1,\n    linethrough: -0.28167, // added 1/30 to original number\n    overline: -0.81333, // added 1/15 to original number\n  },\n  _fontSizeMult: 1.13,\n  [TEXT_DECORATION_THICKNESS]: 66.667, // before implementation was 1/15\n};\n\nexport const JUSTIFY = 'justify';\nexport const JUSTIFY_LEFT = 'justify-left';\nexport const JUSTIFY_RIGHT = 'justify-right';\nexport const JUSTIFY_CENTER = 'justify-center';\n"],"mappings":"gGAIA,MAAa,EAA4B,0BAC5B,EAAwB,sBAE/B,EAAiB,CACrB,WACA,aACA,aACA,YAAA,CAGW,EAA2B,CACtC,YACA,WACA,cAAA,CAGW,EAAiC,CAAA,GACzC,EACH,aACA,OACA,cACA,YACA,SACA,OACA,kBACA,WACA,YAAA,CAGW,EAAkB,CAAA,GAC1B,EAAA,GACA,EACH,sBACA,YACA,EACA,EAAA,CAmBW,EAAmD,CAAA,GAC3D,EAAA,GACA,EACH,EACA,cACA,EACA,SACA,sBACA,EACA,EAAA,CAMW,EAA2D,CACtE,WAAY,EACZ,iBAAkB,WAClB,eAAgB,UAChB,SAAU,OACV,SAAU,GACV,WAAY,EACZ,WAAY,kBACZ,UAAA,CAAW,EACX,SAAA,CAAU,EACV,YAAA,CAAa,EACb,UAAW,EACX,UAAW,EACX,WAAY,KACZ,oBAAqB,GACrB,OAAQ,KACR,OAAQ,KACR,KAAA,IAAM,GACN,gBAAiB,EACjB,SAAU,EACV,UAAW,WACX,YAAa,EACb,OAAQ,EACR,UAAA,MACA,gBAAiB,IACjB,eAAgB,EAEhB,YAAa,CACX,KAAM,GACN,SAAA,KAAU,CAEZ,UAAW,CACT,KAAM,GACN,SAAU,IAAA,CAEZ,kBAAmB,KACnB,QAAS,CACP,UAAW,GACX,YAAA,QACA,SAAA,QAAU,CAEZ,cAAe,MACd,GAA4B,OAAA,CAGlB,EAAU,UACV,EAAe,eACf,EAAgB,gBAChB,EAAiB,iBAAA,OAAA,KAAA,QAAA,KAAA,eAAA,KAAA,aAAA,KAAA,cAAA,KAAA,sBAAA,KAAA,0BAAA,KAAA,gBAAA,KAAA,gBAAA,KAAA,kBAAA,KAAA"}