Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@okam/directus-flexible-content
Advanced tools
## Exports - FlexibleEditorContent (Component) - TRenderingNodes (Type) - JSONContent (Type)
name | type | description |
---|---|---|
jsonContent | JSONContent | This prop takes in the json data returned from the flexible editor in directus. |
editorNodes | EditorNodes[] | undefined | null | This prop takes in the editor nodes data from directus. |
serializers | Extensions | undefined | This prop takes in the different tiptap extensions that the flexible editor uses. There are already a bunch pre-installed in the package (see 'src/lib/components/FlexibleEditorContent/extensions') |
config | TBlockSerializerConfig | undefined | This takes in a BlockDispatcher config object for relation blocks placed in the flexible editor. |
nodes | TRenderingNodes | undefined | This takes in a config object for remapping default HTML semantic tags to React Components. |
remappedAttributes | Record<string, string> | undefined | This allows to remap HTML attributes to fix warnings or errors made by tiptap. |
Adding blocks to the flexible editor options : the related blocks are handled in the Editor Nodes field beside the flexible editor field. You can add more collections by going in the relationship menu of the editor nodes and selecting additional collections in the associated collections section.
https://github.com/user-attachments/assets/576bdb52-f9bc-4835-ab2a-4c59995ae77f
Most of the time, if you want to insert blocks inside the flexible editor, you will need to follow the With relation nodes and exisiting items
tutorial. Note that it is important to prefix related blocks for selection with related_
so that a related block would look like related_{block-collection}
so if you have a block_faqs
your related collection key should be related_block_faqs
.
IMPORTANT: when configuring the many to many relation inside your related_{block-collection}
collection. The key of the field should always be blocks
.
Here is an example of what querying should look like :
flexible_editor
editor_nodes {
id
collection
item {
... on related_block_quote {
id
blocks {
id # id should always be present in the query for the blocks otherwise the block will not be displayed.
item: block_quote_id { # You should always rename `block_[x]_id` to item
...BlockQuote
}
}
}
... on related_block_button {
id
blocks {
id
item: block_button_id {
...BlockButton
}
}
}
... on related_block_faqs {
id
blocks {
id
item: block_faqs_id {
...BlockFaqs
}
}
}
}
}
FAQs
## Exports - FlexibleEditorContent (Component) - TRenderingNodes (Type) - JSONContent (Type)
We found that @okam/directus-flexible-content demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.