@studiocms/wysiwyg
Introducción
Sección titulada «Introducción»¡Este complemento agrega un editor WYSIWYG a tu proyecto StudioCMS con facilidad!
Instalación
Sección titulada «Instalación»-
Instala el paquete usando el siguiente comando:
Ventana de terminal npm run studiocms add @studiocms/wysiwygVentana de terminal pnpm run studiocms add @studiocms/wysiwygVentana de terminal yarn run studiocms add @studiocms/wysiwyg -
Tu configuración de StudioCMS ahora debe incluir
@studiocms/wysiwyg
:studiocms.config.mjs import {defineStudioCMSConfig } from 'studiocms/config';function defineStudioCMSConfig(config: StudioCMSOptions): {plugins?: StudioCMSPlugin[] | undefined;logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;dbStartPage?: boolean | undefined;verbose?: boolean | undefined;componentRegistry?: Record<string, string> | undefined;locale?: {dateLocale?: string | undefined;dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;} | undefined;features?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;robotsTXT?: boolean | {host?: string | boolean | undefined;sitemap?: string | boolean | string[] | undefined;policy?: {userAgent?: "360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" ...A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is
studiocms.config.mjs
. And it should be adjacent to the Astro project'sastro.config.mjs
file.StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.
importwysiwyg from '@studiocms/wysiwyg';function wysiwyg(opts?: WYSIWYGSchemaOptions): StudioCMSPluginCreates and configures the StudioCMS WYSIWYG Editor plugin.
This plugin integrates a WYSIWYG editor into the StudioCMS environment, registering custom routes, rendering components, and handling configuration hooks.
export defaultdefineStudioCMSConfig({function defineStudioCMSConfig(config: StudioCMSOptions): {plugins?: StudioCMSPlugin[] | undefined;logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;dbStartPage?: boolean | undefined;verbose?: boolean | undefined;componentRegistry?: Record<string, string> | undefined;locale?: {dateLocale?: string | undefined;dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;} | undefined;features?: {sdk?: boolean | {cacheConfig?: boolean | {lifetime?: string | undefined;} | undefined;} | undefined;robotsTXT?: boolean | {host?: string | boolean | undefined;sitemap?: string | boolean | string[] | undefined;policy?: {userAgent?: "360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" ...A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is
studiocms.config.mjs
. And it should be adjacent to the Astro project'sastro.config.mjs
file.StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.
plugins: [plugins?: StudioCMSPlugin[] | undefinedwysiwyg(),function wysiwyg(opts?: WYSIWYGSchemaOptions): StudioCMSPluginCreates and configures the StudioCMS WYSIWYG Editor plugin.
This plugin integrates a WYSIWYG editor into the StudioCMS environment, registering custom routes, rendering components, and handling configuration hooks.
],});