2022-09-12 07:13:52 +00:00
|
|
|
const EditorProps = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'modelValue',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Value of the content.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'placeholder',
|
|
|
|
type: 'string',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Placeholder text to show when editor is empty.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'readonly',
|
|
|
|
type: 'boolean',
|
|
|
|
default: 'false',
|
|
|
|
description: 'Whether to instantiate the editor to readonly mode.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'formats',
|
|
|
|
type: 'string[]',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Whitelist of formats to display.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'editorStyle',
|
|
|
|
type: 'any',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Inline style of the container.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'modules',
|
|
|
|
type: 'object',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Modules configuration, see <a href="http://quilljs.com/docs/modules/">here</a> for available options.'
|
2023-05-05 10:15:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'pt',
|
|
|
|
type: 'any',
|
|
|
|
default: 'null',
|
|
|
|
description: 'Uses to pass attributes to DOM elements inside the component.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const EditorEvents = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'text-change',
|
|
|
|
description: 'Callback to invoke when text of editor changes.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.delta',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Representation of the change.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.source',
|
|
|
|
type: 'string',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Source of change. Will be either "user" or "api".'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.htmlValue',
|
|
|
|
type: 'string',
|
|
|
|
description: 'Current value as html.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.textValue',
|
|
|
|
type: 'string',
|
|
|
|
description: 'Current value as text.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.instance',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Text editor instance.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'selection-change',
|
|
|
|
description: 'Callback to invoke when selection of the text changes.',
|
2022-09-12 07:13:52 +00:00
|
|
|
arguments: [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.range',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Representation of the selection boundaries.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.oldRange',
|
|
|
|
type: 'string',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Representation of the previous selection boundaries.'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.source',
|
|
|
|
type: 'string',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: 'Source of change. Will be either "user" or "api".'
|
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.htmlValue',
|
|
|
|
type: 'string',
|
|
|
|
description: 'Current value as html.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.textValue',
|
|
|
|
type: 'string',
|
|
|
|
description: 'Current value as text.'
|
2022-09-12 07:13:52 +00:00
|
|
|
},
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'event.instance',
|
|
|
|
type: 'object',
|
|
|
|
description: 'Text editor instance.'
|
2022-09-12 07:13:52 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'load',
|
|
|
|
description: 'Callback to invoke when the quill modules are loaded.',
|
|
|
|
arguments: [
|
|
|
|
{
|
|
|
|
name: 'event.instance',
|
|
|
|
type: 'any',
|
|
|
|
description: 'Quill instance'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const EditorSlots = [
|
|
|
|
{
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'toolbar',
|
2022-09-12 07:13:52 +00:00
|
|
|
description: "Custom content for the component's toolbar"
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
editor: {
|
2022-09-14 14:26:41 +00:00
|
|
|
name: 'Editor',
|
|
|
|
description: 'Editor is rich text editor component based on Quill.',
|
2022-09-12 07:13:52 +00:00
|
|
|
props: EditorProps,
|
|
|
|
events: EditorEvents,
|
|
|
|
slots: EditorSlots
|
|
|
|
}
|
|
|
|
};
|