
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@peckadesign/contenteditor
Advanced tools
 [](https://badge.fury.io/js/%40peckadesign%2Fcontenteditor)
Vlastní blokový editor obsahu, který bude kombinovat CKEditor4 společně s našimi vlastními widgety jako jsou výpis prodejen, paušálová kalkulačka, výpis produktových boxů atd.
Balíček obsahuje vyexportovanou komponentu ContentEditor.vue
. Ta obsahuje veškeré chování editoru a slouží jako vstup a výstup.
<template>
<ContentEditor :content.sync="content" :config="config" />
</template>
import ContentEditor from '@/components/ContentEditor.vue'
import Vue from 'vue'
import VueCompositionAPI, { defineComponent, ref } from '@vue/composition-api'
import { ContentBlockType } from '@/model/ContentBlock'
import { Content } from '@/model/Content'
import Config from '@/model/Config'
Vue.use(VueCompositionAPI)
export default defineComponent({
components: { ContentEditor },
setup() {
const content = ref<Content>(
new Content([
{
type: ContentBlockType.RichText,
value: { html: 'Hello world' }
}
])
)
const config: Config = {
richTextEditor: {
ckEditorConfig: {
extraConfig: {
libraryUrl:
'https://www.nay.sk/pdp/library-mod/library/browse?embedded=1&mode=ck'
}
}
}
}
return {
content,
config
}
}
})
</script>
config
příjmá konfigurační objekt, který umožňuje měnit nastavení jednotlivých bloků editorucontent
reprezentuje obsah content editoruupdate:content
je vyvolán při jakékoliv změně v rámci editoru a jako hodnotu nese aktuální stavReprezentaci content
objektu lze serializovat do JSONu pomocí metody Content.toJson()
viz.:
<template>
<div>
<ContentEditor :content.sync="content" :config="config" />
<pre>{{ content.toJson() }}</pre>
</div>
</template>
V objektu existuje atribut blocks
který reperezentuje kolekci jednotlivých bloků, seřazených podle toho jak určil uživatel.
Každý blok má svůj atribut type
, který určuje o jaký typ bloku se jedná. Hodnota bloku je v atributu value
a vždy
se jedná o objekt specifický pro daný editor. Nikdy by se zde neměla objevit přímo skalární hodnota.
Typy podporovaných bloků
Podrobnou deifinici jakých typů nabývají hodnoty jednotlivých bloků lze vidět v kódu.
{
"blocks": [
{
"type": "richText",
"value": {
"html": "<p>Hello world</p>\n"
}
},
{
"type": "storeBox",
"value": {
"storeId": 123
}
},
{
"type": "productBox",
"value": {
"type": "slim",
"basketButton": true,
"extId": "IPHONE11"
}
},
{
"type": "productBoxList",
"value": {
"basketButton": false,
"extIds": [
"IPHONE11",
"IPHONE12"
]
}
},
{
"type": "feeCalculator",
"value": {
"productType": "notebook"
}
},
{
"type": "accordeon",
"value": {
"title": "Titulek",
"body": "<p>Hello world</p>\n"
}
}
]
}
npm ci
npm run dev
npm run build
npm run build-bundle
npm run test:unit
npm run lint
FAQs
 [](https://badge.fury.io/js/%40peckadesign%2Fcontenteditor)
We found that @peckadesign/contenteditor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.