-
Notifications
You must be signed in to change notification settings - Fork 2
Differences between blocks and components
Content in Google Drive or SharePoint documents can be either added as default content (such as text, headings, and links) or as blocks. Blocks are implemented within the document as a table, featuring a headline cell that specifies the block's name and potentially additional cells containing further markup.
Blocks have corresponding SCSS and TypeScript files, responsible for styling the block and modifying its markup if necessary. These files are stored within the "src/blocks/{blockname}" directory. The name of the block serves as both the folder name and the filename for the SCSS and TypeScript files.
To utilise blocks, a default function is invoked with a block parameter, containing the generated markup of the block defined within the Google Drive or SharePoint document. This markup can either be retained as is, allowing for styling and functionality enhancements, or the data can be extracted from the markup and employed to create new markup as needed.
Components are not maintained in Google Drive or SharePoint. Instead, they can either be used within a block, which acts as a container, or added programmatically during the DOM building process.