ngx-quill
Version:
Angular components for the easy use of the QuillJS richt text editor.
1 lines • 7.47 kB
Source Map (JSON)
{"version":3,"file":"ngx-quill-config.mjs","sources":["../../../projects/ngx-quill/config/src/quill-defaults.ts","../../../projects/ngx-quill/config/src/quill-editor.interfaces.ts","../../../projects/ngx-quill/config/src/quill-config.module.ts","../../../projects/ngx-quill/config/src/provide-quill-config.ts","../../../projects/ngx-quill/config/src/public_api.ts","../../../projects/ngx-quill/config/src/ngx-quill-config.ts"],"sourcesContent":["export const defaultModules = {\n toolbar: [\n ['bold', 'italic', 'underline', 'strike'], // toggled buttons\n ['blockquote', 'code-block'],\n\n [{ header: 1 }, { header: 2 }], // custom button values\n [{ list: 'ordered' }, { list: 'bullet' }],\n [{ script: 'sub' }, { script: 'super' }], // superscript/subscript\n [{ indent: '-1' }, { indent: '+1' }], // outdent/indent\n [{ direction: 'rtl' }], // text direction\n\n [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\n\n [\n { color: [] },\n { background: [] }\n ], // dropdown with defaults from theme\n [{ font: [] }],\n [{ align: [] }],\n\n ['clean'], // remove formatting button\n\n ['link', 'image', 'video'], // link and image, video\n\n ['table']\n ]\n}\n","import { InjectionToken } from '@angular/core'\nimport type { QuillOptions } from 'quill'\nimport type { Observable } from 'rxjs'\n\nimport { defaultModules } from './quill-defaults'\n\nexport interface CustomOption {\n import: string\n whitelist: any[]\n}\n\nexport interface CustomModule {\n // The `implementation` may be a custom module constructor or an Observable that resolves to\n // a custom module constructor (in case you'd want to load your custom module lazily).\n // For instance, these options are applicable:\n // import BlotFormatter from 'quill-blot-formatter';\n // customModules = [\n // { path: 'modules/blotFormatter', implementation: BlotFormatter }\n // ];\n // Or:\n // const BlotFormatter$ = defer(() => import('quill-blot-formatter').then(m => m.default))\n // customModules = [\n // { path: 'modules/blotFormatter', implementation: BlotFormatter$ }\n // ];\n implementation: any\n path: string\n}\n\nexport type QuillToolbarConfig = (string | {\n indent?: string\n list?: string\n direction?: string\n header?: number | (boolean | number)[]\n color?: string[] | string\n background?: string[] | string\n align?: string[] | string\n script?: string\n font?: string[] | string\n size?: (boolean | string)[]\n} | Record<string, string | number | boolean | (boolean | string | number)[]>)[][]\n\nexport interface QuillModules {\n [key: string]: any\n clipboard?: {\n matchers?: any[]\n matchVisual?: boolean\n } | boolean\n history?: {\n delay?: number\n maxStack?: number\n userOnly?: boolean\n } | boolean\n keyboard?: {\n bindings?: any\n } | boolean\n syntax?: boolean | { hljs: any }\n table?: boolean | Record<string, unknown>\n toolbar?: QuillToolbarConfig | string | {\n container?: string | string[] | QuillToolbarConfig\n handlers?: Record<string, any>\n } | boolean\n}\n\nexport type QuillFormat = 'object' | 'json' | 'html' | 'text'\n\nexport type QuillBeforeRender = (() => Promise<any>) | (() => Observable<any>)\n\nexport interface QuillConfig {\n bounds?: HTMLElement | string\n customModules?: CustomModule[]\n customOptions?: CustomOption[]\n suppressGlobalRegisterWarning?: boolean\n debug?: 'error' | 'warn' | 'log' | false\n format?: QuillFormat\n formats?: string[]\n modules?: QuillModules\n placeholder?: string\n readOnly?: boolean\n registry?: QuillOptions['registry'] // added in quill2 result of const registry = new Parchment.Registry();\n theme?: string\n // Custom Config to track all changes or only changes by 'user'\n trackChanges?: 'user' | 'all'\n // provide default empty value\n defaultEmptyValue?: any\n sanitize?: boolean\n // A function, which is executed before the Quill editor is rendered, this might be useful\n // for lazy-loading CSS.\n beforeRender?: QuillBeforeRender\n}\n\nexport const QUILL_CONFIG_TOKEN = new InjectionToken<QuillConfig>('config', {\n providedIn: 'root',\n factory: () => ({ modules: defaultModules })\n})\n","import { ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { QuillConfig, QUILL_CONFIG_TOKEN } from './quill-editor.interfaces'\n\n/**\n * This `NgModule` provides a global Quill config on the root level, e.g., in `AppModule`.\n * But this eliminates the need to import the entire `ngx-quill` library into the main bundle.\n * The `quill-editor` itself may be rendered in any lazy-loaded module, but importing `QuillModule`\n * into the `AppModule` will bundle the `ngx-quill` into the vendor.\n */\n@NgModule()\nexport class QuillConfigModule {\n static forRoot(config: QuillConfig): ModuleWithProviders<QuillConfigModule> {\n return {\n ngModule: QuillConfigModule,\n providers: [{ provide: QUILL_CONFIG_TOKEN,\nuseValue: config }],\n }\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'\n\nimport { QUILL_CONFIG_TOKEN, QuillConfig } from './quill-editor.interfaces'\n\n/**\n * Provides Quill configuration at the root level:\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideQuillConfig(...)]\n * });\n * ```\n */\nexport const provideQuillConfig = (config: QuillConfig): EnvironmentProviders =>\n makeEnvironmentProviders([{ provide: QUILL_CONFIG_TOKEN,\nuseValue: config }])\n","/*\n * Public API Surface of ngx-quill/config\n */\n\nexport * from './quill-defaults'\nexport * from './quill-config.module'\nexport * from './quill-editor.interfaces'\nexport * from './provide-quill-config'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAAa,MAAA,cAAc,GAAG;AAC5B,IAAA,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC;QACzC,CAAC,YAAY,EAAE,YAAY,CAAC;AAE5B,QAAA,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC9B,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACzC,QAAA,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACxC,QAAA,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACpC,QAAA,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAEtB,QAAA,CAAC,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