pub.leaflet.pages.canvas

leaflet.pub

Documentation

main object

No description available.

Properties

background ref #background Optional

No description available.

blocks array of ref#block Required

No description available.

height integer Optional

Fixed canvas height in canvas px; see width.

id string Optional

No description available.

lockViewerZoom boolean Optional

Viewers cannot zoom the canvas or scroll it sideways: no wheel, pinch, double-tap or zoom controls, and the initial framing (see mobileView) stays. Vertical scrolling is unaffected.

mobileView string Optional

How a narrow viewport frames the canvas: the whole canvas scaled to fit the width (unconstrained, the default), or a phone-width area anchored to the canvas's left edge or centered on it, shown at up to 1:1.

Known values: unconstrained, left, center
pattern string Optional

The guide pattern drawn over the canvas's background, under its blocks. Absent, a canvas that grows with its content shows the grid and a fixed-size canvas is plain.

Known values: grid, dot, plain
width integer Optional

Fixed canvas width in canvas px. With height, bounds the canvas: blocks are clipped to the area. Absent, the canvas grows with its content and is 1272px wide, or as wide as the inside of the publication's page (its theme's pageWidth) when it is one of a publication's pages.

View raw schema
{
  "properties": {
    "background": {
      "ref": "#background",
      "type": "ref"
    },
    "blocks": {
      "items": {
        "ref": "#block",
        "type": "ref"
      },
      "type": "array"
    },
    "height": {
      "description": "Fixed canvas height in canvas px; see width.",
      "type": "integer"
    },
    "id": {
      "type": "string"
    },
    "lockViewerZoom": {
      "description": "Viewers cannot zoom the canvas or scroll it sideways: no wheel, pinch, double-tap or zoom controls, and the initial framing (see mobileView) stays. Vertical scrolling is unaffected.",
      "type": "boolean"
    },
    "mobileView": {
      "description": "How a narrow viewport frames the canvas: the whole canvas scaled to fit the width (unconstrained, the default), or a phone-width area anchored to the canvas's left edge or centered on it, shown at up to 1:1.",
      "knownValues": [
        "unconstrained",
        "left",
        "center"
      ],
      "type": "string"
    },
    "pattern": {
      "description": "The guide pattern drawn over the canvas's background, under its blocks. Absent, a canvas that grows with its content shows the grid and a fixed-size canvas is plain.",
      "knownValues": [
        "grid",
        "dot",
        "plain"
      ],
      "type": "string"
    },
    "theme": {
      "ref": "pub.leaflet.theme.page",
      "type": "ref"
    },
    "width": {
      "description": "Fixed canvas width in canvas px. With height, bounds the canvas: blocks are clipped to the area. Absent, the canvas grows with its content and is 1272px wide, or as wide as the inside of the publication's page (its theme's pageWidth) when it is one of a publication's pages.",
      "type": "integer"
    }
  },
  "required": [
    "blocks"
  ],
  "type": "object"
}
background object

An image tiled across the canvas, under its guide pattern and blocks.

Properties

image blob Required

No description available.

maxSize: 1.0 MB
opacity integer Optional

Opacity of the image as a percentage. Defaults to 100.

minimum: 0maximum: 100
width integer Optional

Width of each tile in canvas px. Defaults to 500.

View raw schema
{
  "description": "An image tiled across the canvas, under its guide pattern and blocks.",
  "properties": {
    "image": {
      "accept": [
        "image/*"
      ],
      "maxSize": 1000000,
      "type": "blob"
    },
    "opacity": {
      "description": "Opacity of the image as a percentage. Defaults to 100.",
      "maximum": 100,
      "minimum": 0,
      "type": "integer"
    },
    "width": {
      "description": "Width of each tile in canvas px. Defaults to 500.",
      "type": "integer"
    }
  },
  "required": [
    "image"
  ],
  "type": "object"
}
block object

No description available.

Properties

alignment string Optional

Alignment of a single block's content. A linear document's blocks carry their own.

Known values: lex:pub.leaflet.pages.linearDocument#textAlignLeft, lex:pub.leaflet.pages.linearDocument#textAlignCenter, lex:pub.leaflet.pages.linearDocument#textAlignRight, lex:pub.leaflet.pages.linearDocument#textAlignJustify
block union Required
height integer Optional

No description available.

rotation integer Optional

The rotation of the block in degrees

stackOrder string Optional

Fractional index ordering this block against its siblings on the z axis. Blocks without one stack below every block with one, ordered by position.

width integer Required

No description available.

x integer Required

No description available.

y integer Required

No description available.

View raw schema
{
  "properties": {
    "alignment": {
      "description": "Alignment of a single block's content. A linear document's blocks carry their own.",
      "knownValues": [
        "lex:pub.leaflet.pages.linearDocument#textAlignLeft",
        "lex:pub.leaflet.pages.linearDocument#textAlignCenter",
        "lex:pub.leaflet.pages.linearDocument#textAlignRight",
        "lex:pub.leaflet.pages.linearDocument#textAlignJustify"
      ],
      "type": "string"
    },
    "block": {
      "description": "A single block, or a linear document: blocks grouped in reading order that are positioned, sized and rotated on the canvas as one.",
      "refs": [
        "pub.leaflet.blocks.iframe",
        "pub.leaflet.blocks.html",
        "pub.leaflet.blocks.text",
        "pub.leaflet.blocks.blockquote",
        "pub.leaflet.blocks.header",
        "pub.leaflet.blocks.image",
        "pub.leaflet.blocks.imageGallery",
        "pub.leaflet.blocks.unorderedList",
        "pub.leaflet.blocks.orderedList",
        "pub.leaflet.blocks.website",
        "pub.leaflet.blocks.math",
        "pub.leaflet.blocks.code",
        "pub.leaflet.blocks.horizontalRule",
        "pub.leaflet.blocks.bskyPost",
        "pub.leaflet.blocks.standardSitePost",
        "pub.leaflet.blocks.standardSitePublication",
        "pub.leaflet.blocks.page",
        "pub.leaflet.blocks.embeddedCanvas",
        "pub.leaflet.blocks.poll",
        "pub.leaflet.blocks.button",
        "pub.leaflet.blocks.postsList",
        "pub.leaflet.blocks.signup",
        "pub.leaflet.blocks.recommendedPubs",
        "pub.leaflet.blocks.reply",
        "pub.leaflet.blocks.questions",
        "pub.leaflet.blocks.membersOnlyDelimiter",
        "pub.leaflet.blocks.postHeader",
        "pub.leaflet.blocks.drawing",
        "pub.leaflet.pages.linearDocument"
      ],
      "type": "union"
    },
    "height": {
      "type": "integer"
    },
    "rotation": {
      "description": "The rotation of the block in degrees",
      "type": "integer"
    },
    "stackOrder": {
      "description": "Fractional index ordering this block against its siblings on the z axis. Blocks without one stack below every block with one, ordered by position.",
      "type": "string"
    },
    "width": {
      "type": "integer"
    },
    "x": {
      "type": "integer"
    },
    "y": {
      "type": "integer"
    }
  },
  "required": [
    "block",
    "x",
    "y",
    "width"
  ],
  "type": "object"
}
position object

No description available.

Properties

block array of integer Required

No description available.

offset integer Required

No description available.

View raw schema
{
  "properties": {
    "block": {
      "items": {
        "type": "integer"
      },
      "type": "array"
    },
    "offset": {
      "type": "integer"
    }
  },
  "required": [
    "block",
    "offset"
  ],
  "type": "object"
}
quote object

No description available.

Properties

end ref #position Required

No description available.

start ref #position Required

No description available.

View raw schema
{
  "properties": {
    "end": {
      "ref": "#position",
      "type": "ref"
    },
    "start": {
      "ref": "#position",
      "type": "ref"
    }
  },
  "required": [
    "start",
    "end"
  ],
  "type": "object"
}
textAlignCenter token

No description available.

Referencepub.leaflet.pages.canvas#textAlignCenter

Tokens have no data representation. Use the reference string as a value.

View raw schema
{
  "type": "token"
}
textAlignLeft token

No description available.

Referencepub.leaflet.pages.canvas#textAlignLeft

Tokens have no data representation. Use the reference string as a value.

View raw schema
{
  "type": "token"
}
textAlignRight token

No description available.

Referencepub.leaflet.pages.canvas#textAlignRight

Tokens have no data representation. Use the reference string as a value.

View raw schema
{
  "type": "token"
}

Lexicon Garden

@