How to use the @sketch-hq/sketch-file-format-ts.FileFormat1.LayerListExpanded function in @sketch-hq/sketch-file-format-ts

To help you get started, we’ve selected a few @sketch-hq/sketch-file-format-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / react-sketchapp / src / jsonUtils / textLayers.ts View on Github external
const makeTextLayer = (
  frame: FileFormat.Rect,
  name: string,
  textNodes: TextNode[],
  _style: ViewStyle,
  resizingConstraint?: ResizeConstraints,
  shadows?: ViewStyle[],
): FileFormat.Text => ({
  _class: 'text',
  do_objectID: generateID(`text:${name}-${textNodes.map(node => node.content).join('')}`),
  frame,
  isFlippedHorizontal: false,
  isFlippedVertical: false,
  isLocked: false,
  isVisible: true,
  layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
  name,
  nameIsFixed: false,
  resizingConstraint: makeResizeConstraint(resizingConstraint),
  resizingType: FileFormat.ResizeType.Stretch,
  rotation: 0,
  shouldBreakMaskChain: false,
  attributedString: makeAttributedString(textNodes),
  style: makeTextStyle((textNodes[0] || { textStyles: {} }).textStyles, shadows),
  automaticallyDrawOnUnderlyingPath: false,
  dontSynchroniseWithSymbol: false,
  // NOTE(akp): I haven't fully figured out the meaning of glyphBounds
  glyphBounds: '',
  // glyphBounds: '{{0, 0}, {116, 17}}',
  lineSpacingBehaviour: FileFormat.LineSpacingBehaviour.ConsistentBaseline,
  textBehaviour: FileFormat.TextBehaviour.Fixed,
  booleanOperation: FileFormat.BooleanOperation.NA,
github airbnb / react-sketchapp / src / jsonUtils / shapeLayers.ts View on Github external
height: number,
  radii: Radii = [0, 0, 0, 0],
  resizingConstraint?: ResizeConstraints,
): FileFormat.Rectangle => {
  const fixedRadius = radii[0] || 0;
  const path = makeRectPath(radii);
  return {
    ...path,
    _class: 'rectangle',
    do_objectID: generateID(),
    frame: makeRect(x, y, width, height),
    isFlippedHorizontal: false,
    isFlippedVertical: false,
    isLocked: false,
    isVisible: true,
    layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
    name: 'Path',
    nameIsFixed: false,
    resizingConstraint: makeResizeConstraint(resizingConstraint),
    resizingType: FileFormat.ResizeType.Stretch,
    rotation: 0,
    shouldBreakMaskChain: false,
    booleanOperation: FileFormat.BooleanOperation.NA,
    edited: false,
    fixedRadius,
    hasConvertedToNewRoundCorners: true,
    isFixedToViewport: false,
    pointRadiusBehaviour: FileFormat.PointsRadiusBehaviour.Rounded,
    exportOptions: {
      _class: 'exportOptions',
      exportFormats: [],
      includedLayerIds: [],
github airbnb / react-sketchapp / src / jsonUtils / models.ts View on Github external
_class: 'symbolMaster',
  do_objectID: generateID(`symbolMaster:${name}`, !!name),
  nameIsFixed: true,
  isVisible: true,
  backgroundColor: makeColorFromCSS('white'),
  hasBackgroundColor: false,
  name,
  changeIdentifier: generateIdNumber(),
  symbolID,
  frame,
  booleanOperation: FileFormat.BooleanOperation.NA,
  isLocked: false,
  isFixedToViewport: false,
  isFlippedHorizontal: false,
  isFlippedVertical: false,
  layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
  resizingType: FileFormat.ResizeType.Stretch,
  rotation: 0,
  shouldBreakMaskChain: false,
  exportOptions: {
    _class: 'exportOptions',
    exportFormats: [],
    includedLayerIds: [],
    layerOptions: 0,
    shouldTrim: false,
  },
  resizingConstraint: makeResizeConstraint(),
  hasClickThrough: false,
  layers: [],
  horizontalRulerData: {
    _class: 'rulerData',
    base: 0,
github airbnb / react-sketchapp / src / jsonUtils / shapeLayers.ts View on Github external
layers,
  clippingMaskMode: 0,
  hasClippingMask: false,
  windingRule: FileFormat.WindingRule.EvenOdd,
  isFixedToViewport: false,
  exportOptions: {
    _class: 'exportOptions',
    exportFormats: [],
    includedLayerIds: [],
    layerOptions: 0,
    shouldTrim: false,
  },
  isFlippedHorizontal: false,
  isFlippedVertical: false,
  booleanOperation: FileFormat.BooleanOperation.NA,
  layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
});
github airbnb / react-sketchapp / src / renderers / ArtboardRenderer.ts View on Github external
...props.viewport,
        },
      }),
      isFlippedHorizontal: false,
      isFlippedVertical: false,
      isFixedToViewport: false,
      isLocked: false,
      booleanOperation: FileFormat.BooleanOperation.NA,
      exportOptions: {
        _class: 'exportOptions',
        exportFormats: [],
        includedLayerIds: [],
        layerOptions: 0,
        shouldTrim: false,
      },
      layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
      resizingType: FileFormat.ResizeType.Stretch,
      shouldBreakMaskChain: false,
      hasClickThrough: false,
      layers: [],
      includeInCloudUpload: true,
      includeBackgroundColorInExport: color !== undefined,
      horizontalRulerData: {
        _class: 'rulerData',
        base: 0,
        guides: [],
      },
      verticalRulerData: {
        _class: 'rulerData',
        base: 0,
        guides: [],
      },