Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@burst/frontend-editing
Advanced tools
@burst/frontend-editing
This package is used for editing content in the frontend.
!! This package assumes the preview mode module is already installed and working.
!! TODO: write documentation for this.
First you need to install the package, you do this by running the following command:
npm install @burst/frontend-editing
You can use this module in the paragraphmapper
import { PreviewData } from '@misc/preview'
import Editable from '@burst/frontend-editing'
import { getCmsUrl } from '@misc/environments'
import { previewModeEnabled } from '@misc/helpers'
interface props {
paragraph: ParagraphsFragment
preview: PreviewData | null
}
export default function ParagraphMapper (props: Props): JSX.Element | null {
const component = (): JSX.Element | null => {
//all paragraph switches
}
if (props.preview == null) return component()
return previewModeEnabled(props.preview)
? (
<Editable
id = {props.paragraph.id.toString()}
type = 'paragraph'
cmsUrl = {getCmsUrl()}
token = {props.preview?.token ?? null}
color = '#000' //defaults to gray, overwrite it with this value.
absolute = false
>
{component()}
</Editable>
)
}
import { PreviewData } from '@misc/preview'
interface props{
preview: PreviewData | null
}
export const getStaticProps: GetStaticProps<Props, { slug: string }, PreviewData> = async (ctx) => {
return {
props: {
preview: ctx.preview ?? null
}
}
}
function BasicPage ({ preview }: Props): JSX.Element | null {
return (
<ProjectDetail>
<ParagraphMapper preview={preview} />
</ProjectDetail>
)
}
the function getCmsUrl is placed in environment.ts.
export function getCmsUrl (): string {
return (
process.env.CMS_URL ??
process.env.NEXT_PUBLIC_CMS_URL ??
'https://www.domain.com'
)
}
the function previewModeEnabled is placed in helper.ts.
export function previewModeEnabled (preview?: PreviewData): boolean {
if (typeof window !== 'undefined') {
return (
window.location === window.parent.location && hasValue(preview)
)
}
return false
}
the function previewdata is placed in preview.ts.
export interface PreviewData {
token: string
}
FAQs
Package to allow front-end editing
The npm package @burst/frontend-editing receives a total of 0 weekly downloads. As such, @burst/frontend-editing popularity was classified as not popular.
We found that @burst/frontend-editing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.