{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-list/src/liststyleui.js"],"names":["ListStyleUI","editor","this","t","locale","ui","componentFactory","add","getSplitButtonCreator","parentCommandName","buttonLabel","buttonIcon","bulletedListIcon","toolbarAriaLabel","styleDefinitions","label","tooltip","type","icon","listStyleDiscIcon","listStyleCircleIcon","listStyleSquareIcon","numberedListIcon","listStyleDecimalIcon","listStyleDecimalWithLeadingZeroIcon","listStyleLowerRomanIcon","listStyleUpperRomanIcon","listStyleLowerLatinIcon","listStyleUpperLatinIcon","Plugin","_ref","parentCommand","commands","get","listStyleCommand","dropdownView","createDropdown","SplitButtonView","splitButtonView","buttonView","styleButtonCreator","getStyleButtonCreator","addToolbarToDropdown","map","bind","to","toolbarView","ariaLabel","class","on","execute","editing","view","focus","set","isToggleable","value","_ref2","_ref3","button","ButtonView","isOn","_defaultType","model","change"],"mappings":";;;;OAoCqBA,2JAQpB,WACC,IAAMC,EAASC,KAAKD,OACdE,EAAIF,EAAOG,OAAOD,EAExBF,EAAOI,GAAGC,iBAAiBC,IAAK,eAAgBC,GAC/CP,SACAQ,kBAAmB,eACnBC,YAAaP,EAAG,iBAChBQ,WAAYC,IACZC,iBAAkBV,EAAG,gCACrBW,mBAEEC,MAAOZ,EAAG,8BACVa,QAASb,EAAG,QACZc,KAAM,OACNC,KAAMC,MAGNJ,MAAOZ,EAAG,gCACVa,QAASb,EAAG,UACZc,KAAM,SACNC,KAAME,MAGNL,MAAOZ,EAAG,gCACVa,QAASb,EAAG,UACZc,KAAM,SACNC,KAAMG,SAKTpB,EAAOI,GAAGC,iBAAiBC,IAAK,eAAgBC,GAC/CP,SACAQ,kBAAmB,eACnBC,YAAaP,EAAG,iBAChBQ,WAAYW,IACZT,iBAAkBV,EAAG,gCACrBW,mBAEEC,MAAOZ,EAAG,iCACVa,QAASb,EAAG,WACZc,KAAM,UACNC,KAAMK,MAGNR,MAAOZ,EAAG,mDACVa,QAASb,EAAG,6BACZc,KAAM,uBACNC,K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EAAO+B,SAASC,IAAKxB,GAO3C,OAAO,SAAAiD,GAAsC,IAAlC3C,EAAkC2C,EAAlC3C,MAAOE,EAA2ByC,EAA3BzC,KAAMC,EAAqBwC,EAArBxC,KAAMF,EAAe0C,EAAf1C,QACvB2C,EAAS,IAAIC,OAAYxD,GAgC/B,OA9BAuD,EAAOL,KAAOvC,QAAOG,OAAMF,YAE3BkB,EAAiBe,GAAI,eAAgB,WACpCU,EAAOE,KAAO3B,EAAiBsB,QAAUvC,IAG1C0C,EAAOV,GAAI,UAAW,WAEhBlB,EAAcyB,MAGbtB,EAAiBsB,QAAUvC,EAC/BhB,EAAOiD,QAAS,aAAejC,SAI/BhB,EAAOiD,QAAS,aAAejC,KAAMiB,EAAiB4B,eAKvD7D,EAAO8D,MAAMC,OAAQ,WACpB/D,EAAOiD,QAASzC,GAChBR,EAAOiD,QAAS,aAAejC,WAIjChB,EAAOkD,QAAQC,KAAKC,UAGdM","file":"js/chunk-2d209171.61516964.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module list/liststyleui\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, SplitButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';\n\nimport bulletedListIcon from '../theme/icons/bulletedlist.svg';\nimport numberedListIcon from '../theme/icons/numberedlist.svg';\n\nimport listStyleDiscIcon from '../theme/icons/liststyledisc.svg';\nimport listStyleCircleIcon from '../theme/icons/liststylecircle.svg';\nimport listStyleSquareIcon from '../theme/icons/liststylesquare.svg';\nimport listStyleDecimalIcon from '../theme/icons/liststyledecimal.svg';\nimport listStyleDecimalWithLeadingZeroIcon from '../theme/icons/liststyledecimalleadingzero.svg';\nimport listStyleLowerRomanIcon from '../theme/icons/liststylelowerroman.svg';\nimport listStyleUpperRomanIcon from '../theme/icons/liststyleupperroman.svg';\nimport listStyleLowerLatinIcon from '../theme/icons/liststylelowerlatin.svg';\nimport listStyleUpperLatinIcon from '../theme/icons/liststyleupperlatin.svg';\n\nimport '../theme/liststyles.css';\n\n/**\n * The list style UI plugin. It introduces the extended `'bulletedList'` and `'numberedList'` toolbar\n * buttons that allow users to change styles of individual lists in the content.\n *\n * **Note**: Buttons introduced by this plugin override implementations from the {@link module:list/listui~ListUI}\n * (because they share the same names).\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class ListStyleUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'ListStyleUI';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.locale.t;\n\n\t\teditor.ui.componentFactory.add( 'bulletedList', getSplitButtonCreator( {\n\t\t\teditor,\n\t\t\tparentCommandName: 'bulletedList',\n\t\t\tbuttonLabel: t( 'Bulleted List' ),\n\t\t\tbuttonIcon: bulletedListIcon,\n\t\t\ttoolbarAriaLabel: t( 'Bulleted list styles toolbar' ),\n\t\t\tstyleDefinitions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the disc list style' ),\n\t\t\t\t\ttooltip: t( 'Disc' ),\n\t\t\t\t\ttype: 'disc',\n\t\t\t\t\ticon: listStyleDiscIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the circle list style' ),\n\t\t\t\t\ttooltip: t( 'Circle' ),\n\t\t\t\t\ttype: 'circle',\n\t\t\t\t\ticon: listStyleCircleIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the square list style' ),\n\t\t\t\t\ttooltip: t( 'Square' ),\n\t\t\t\t\ttype: 'square',\n\t\t\t\t\ticon: listStyleSquareIcon\n\t\t\t\t}\n\t\t\t]\n\t\t} ) );\n\n\t\teditor.ui.componentFactory.add( 'numberedList', getSplitButtonCreator( {\n\t\t\teditor,\n\t\t\tparentCommandName: 'numberedList',\n\t\t\tbuttonLabel: t( 'Numbered List' ),\n\t\t\tbuttonIcon: numberedListIcon,\n\t\t\ttoolbarAriaLabel: t( 'Numbered list styles toolbar' ),\n\t\t\tstyleDefinitions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the decimal list style' ),\n\t\t\t\t\ttooltip: t( 'Decimal' ),\n\t\t\t\t\ttype: 'decimal',\n\t\t\t\t\ticon: listStyleDecimalIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the decimal with leading zero list style' ),\n\t\t\t\t\ttooltip: t( 'Decimal with leading zero' ),\n\t\t\t\t\ttype: 'decimal-leading-zero',\n\t\t\t\t\ticon: listStyleDecimalWithLeadingZeroIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the lower–roman list style' ),\n\t\t\t\t\ttooltip: t( 'Lower–roman' ),\n\t\t\t\t\ttype: 'lower-roman',\n\t\t\t\t\ticon: listStyleLowerRomanIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the upper–roman list style' ),\n\t\t\t\t\ttooltip: t( 'Upper-roman' ),\n\t\t\t\t\ttype: 'upper-roman',\n\t\t\t\t\ticon: listStyleUpperRomanIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the lower–latin list style' ),\n\t\t\t\t\ttooltip: t( 'Lower-latin' ),\n\t\t\t\t\ttype: 'lower-latin',\n\t\t\t\t\ticon: listStyleLowerLatinIcon\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: t( 'Toggle the upper–latin list style' ),\n\t\t\t\t\ttooltip: t( 'Upper-latin' ),\n\t\t\t\t\ttype: 'upper-latin',\n\t\t\t\t\ticon: listStyleUpperLatinIcon\n\t\t\t\t}\n\t\t\t]\n\t\t} ) );\n\t}\n}\n\n// A helper that returns a function that creates a split button with a toolbar in the dropdown,\n// which in turn contains buttons allowing users to change list styles in the context of the current selection.\n//\n// @param {Object} options\n// @param {module:core/editor/editor~Editor} options.editor\n// @param {'bulletedList'|'numberedList'} options.parentCommandName The name of the higher-order editor command associated with\n// the set of particular list styles (e.g. \"bulletedList\" for \"disc\", \"circle\", and \"square\" styles).\n// @param {String} options.buttonLabel Label of the main part of the split button.\n// @param {String} options.buttonIcon The SVG string of an icon for the main part of the split button.\n// @param {String} options.toolbarAriaLabel The ARIA label for the toolbar in the split button dropdown.\n// @param {Object} options.styleDefinitions Definitions of the style buttons.\n// @returns {Function} A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.\nfunction getSplitButtonCreator( { editor, parentCommandName, buttonLabel, buttonIcon, toolbarAriaLabel, styleDefinitions } ) {\n\tconst parentCommand = editor.commands.get( parentCommandName );\n\tconst listStyleCommand = editor.commands.get( 'listStyle' );\n\n\t// @param {module:utils/locale~Locale} locale\n\t// @returns {module:ui/dropdown/dropdownview~DropdownView}\n\treturn locale => {\n\t\tconst dropdownView = createDropdown( locale, SplitButtonView );\n\t\tconst splitButtonView = dropdownView.buttonView;\n\t\tconst styleButtonCreator = getStyleButtonCreator( { editor, parentCommandName, listStyleCommand } );\n\n\t\taddToolbarToDropdown( dropdownView, styleDefinitions.map( styleButtonCreator ) );\n\n\t\tdropdownView.bind( 'isEnabled' ).to( parentCommand );\n\t\tdropdownView.toolbarView.ariaLabel = toolbarAriaLabel;\n\t\tdropdownView.class = 'ck-list-styles-dropdown';\n\n\t\tsplitButtonView.on( 'execute', () => {\n\t\t\teditor.execute( parentCommandName );\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\tsplitButtonView.set( {\n\t\t\tlabel: buttonLabel,\n\t\t\ticon: buttonIcon,\n\t\t\ttooltip: true,\n\t\t\tisToggleable: true\n\t\t} );\n\n\t\tsplitButtonView.bind( 'isOn' ).to( parentCommand, 'value', value => !!value );\n\n\t\treturn dropdownView;\n\t};\n}\n\n// A helper that returns a function (factory) that creates individual buttons used by users to change styles\n// of lists.\n//\n// @param {Object} options\n// @param {module:core/editor/editor~Editor} options.editor\n// @param {module:list/liststylecommand~ListStylesCommand} options.listStyleCommand The instance of the `ListStylesCommand` class.\n// @param {'bulletedList'|'numberedList'} options.parentCommandName The name of the higher-order command associated with a\n// particular list style (e.g. \"bulletedList\" is associated with \"square\" and \"numberedList\" is associated with \"roman\").\n// @returns {Function} A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.\nfunction getStyleButtonCreator( { editor, listStyleCommand, parentCommandName } ) {\n\tconst locale = editor.locale;\n\tconst parentCommand = editor.commands.get( parentCommandName );\n\n\t// @param {String} label The label of the style button.\n\t// @param {String} type The type of the style button (e.g. \"roman\" or \"circle\").\n\t// @param {String} icon The SVG string of an icon of the style button.\n\t// @param {String} tooltip The tooltip text of the button (shorter than verbose label).\n\t// @returns {module:ui/button/buttonview~ButtonView}\n\treturn ( { label, type, icon, tooltip } ) => {\n\t\tconst button = new ButtonView( locale );\n\n\t\tbutton.set( { label, icon, tooltip } );\n\n\t\tlistStyleCommand.on( 'change:value', () => {\n\t\t\tbutton.isOn = listStyleCommand.value === type;\n\t\t} );\n\n\t\tbutton.on( 'execute', () => {\n\t\t\t// If the content the selection is anchored to is a list, let's change its style.\n\t\t\tif ( parentCommand.value ) {\n\t\t\t\t// If the current list style is not set in the model or the style is different than the\n\t\t\t\t// one to be applied, simply apply the new style.\n\t\t\t\tif ( listStyleCommand.value !== type ) {\n\t\t\t\t\teditor.execute( 'listStyle', { type } );\n\t\t\t\t}\n\t\t\t\t// If the style was the same, remove it (the button works as an off toggle).\n\t\t\t\telse {\n\t\t\t\t\teditor.execute( 'listStyle', { type: listStyleCommand._defaultType } );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If the content the selection is anchored to is not a list, let's create a list of a desired style.\n\t\t\telse {\n\t\t\t\teditor.model.change( () => {\n\t\t\t\t\teditor.execute( parentCommandName );\n\t\t\t\t\teditor.execute( 'listStyle', { type } );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\teditor.editing.view.focus();\n\t\t} );\n\n\t\treturn button;\n\t};\n}\n"],"sourceRoot":""}