Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-indent

Package Overview
Dependencies
Maintainers
1
Versions
688
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-indent - npm Package Compare versions

Comparing version 29.1.0 to 29.2.0

build/translations/az.js

2

build/indent.js

@@ -5,2 +5,2 @@ /*!

*/
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.indent=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){t.exports=n(1)("./src/core.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,n){t.exports=n(1)("./src/ui.js")},function(t,e,n){t.exports=n(1)("./src/engine.js")},function(t,e,n){t.exports=n(1)("./src/utils.js")},function(t,e,n){"use strict";n.r(e),n.d(e,"Indent",(function(){return a})),n.d(e,"IndentEditing",(function(){return s})),n.d(e,"IndentUI",(function(){return c})),n.d(e,"IndentBlock",(function(){return b}));var i=n(0);class s extends i.Plugin{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new i.MultiCommand(t)),t.commands.add("outdent",new i.MultiCommand(t))}}var o=n(2),r='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',d='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class c extends i.Plugin{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?r:d,s="ltr"==e.uiLanguageDirection?d:r;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),s)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,s=>{const r=i.commands.get(t),d=new o.ButtonView(s);return d.set({label:e,icon:n,tooltip:!0}),d.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(d,"execute",()=>{i.execute(t),i.editing.view.focus()}),d})}}class a extends i.Plugin{static get pluginName(){return"Indent"}static get requires(){return[s,c]}}var u=n(3),l=n(4);class h extends i.Command{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=Object(l.first)(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,n=t.schema;return Array.from(e.getSelectedBlocks()).filter(t=>n.checkAttribute(t,"blockIndent"))}(t);t.change(t=>{for(const n of e){const e=n.getAttribute("blockIndent"),i=this._indentBehavior.getNextIndent(e);i?t.setAttribute("blockIndent",i,n):t.removeAttribute("blockIndent",n)}})}}class g{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class f{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e<this.classes.length-1:e>=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const m=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class b extends i.Plugin{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),n=!e.classes||!e.classes.length,i=Object.assign({direction:"forward"},e),s=Object.assign({direction:"backward"},e);n?(t.data.addStyleProcessorRules(u.addMarginRules),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new h(t,new g(i))),t.commands.add("outdentBlock",new h(t,new g(s)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new h(t,new f(i))),t.commands.add("outdentBlock",new h(t,new f(s))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),i=t.commands.get("outdent"),s=t.config.get("heading.options");(s&&s.map(t=>t.model)||m).forEach(t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})}),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),i.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}}]);
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Decrease indent":"Decrease indent","Increase indent":"Increase indent"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window.CKEditor5=window.CKEditor5||{},window.CKEditor5.indent=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){t.exports=n(1)("./src/core.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,n){t.exports=n(1)("./src/ui.js")},function(t,e,n){t.exports=n(1)("./src/engine.js")},function(t,e,n){t.exports=n(1)("./src/utils.js")},function(t,e,n){"use strict";n.r(e),n.d(e,"Indent",(function(){return a})),n.d(e,"IndentEditing",(function(){return s})),n.d(e,"IndentUI",(function(){return c})),n.d(e,"IndentBlock",(function(){return b}));var i=n(0);class s extends i.Plugin{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new i.MultiCommand(t)),t.commands.add("outdent",new i.MultiCommand(t))}}var o=n(2),r='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',d='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class c extends i.Plugin{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i="ltr"==e.uiLanguageDirection?r:d,s="ltr"==e.uiLanguageDirection?d:r;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),s)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,s=>{const r=i.commands.get(t),d=new o.ButtonView(s);return d.set({label:e,icon:n,tooltip:!0}),d.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(d,"execute",()=>{i.execute(t),i.editing.view.focus()}),d})}}class a extends i.Plugin{static get pluginName(){return"Indent"}static get requires(){return[s,c]}}var u=n(3),l=n(4);class h extends i.Command{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=Object(l.first)(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,n=t.schema;return Array.from(e.getSelectedBlocks()).filter(t=>n.checkAttribute(t,"blockIndent"))}(t);t.change(t=>{for(const n of e){const e=n.getAttribute("blockIndent"),i=this._indentBehavior.getNextIndent(e);i?t.setAttribute("blockIndent",i,n):t.removeAttribute("blockIndent",n)}})}}class g{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const n=e+(this.isForward?this.offset:-this.offset);return n>0?n+this.unit:void 0}}class f{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e<this.classes.length-1:e>=0}getNextIndent(t){const e=this.classes.indexOf(t),n=this.isForward?1:-1;return this.classes[e+n]}}const m=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class b extends i.Plugin{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),n=!e.classes||!e.classes.length,i=Object.assign({direction:"forward"},e),s=Object.assign({direction:"backward"},e);n?(t.data.addStyleProcessorRules(u.addMarginRules),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new h(t,new g(i))),t.commands.add("outdentBlock",new h(t,new g(s)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new h(t,new f(i))),t.commands.add("outdentBlock",new h(t,new f(s))))}afterInit(){const t=this.editor,e=t.model.schema,n=t.commands.get("indent"),i=t.commands.get("outdent"),s=t.config.get("heading.options");(s&&s.map(t=>t.model)||m).forEach(t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})}),e.setAttributeProperties("blockIndent",{isFormatting:!0}),n.registerChildCommand(t.commands.get("indentBlock")),i.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t)e.model.values.push(n),e.view[n]={key:"class",value:[n]};this.editor.conversion.attributeToAttribute(e)}}}]);
{
"name": "@ckeditor/ckeditor5-indent",
"version": "29.1.0",
"version": "29.2.0",
"description": "Block indentation feature for CKEditor 5.",

@@ -15,13 +15,13 @@ "keywords": [

"dependencies": {
"ckeditor5": "^29.1.0"
"ckeditor5": "^29.2.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-core": "^29.1.0",
"@ckeditor/ckeditor5-dev-utils": "^25.3.0",
"@ckeditor/ckeditor5-editor-classic": "^29.1.0",
"@ckeditor/ckeditor5-engine": "^29.1.0",
"@ckeditor/ckeditor5-heading": "^29.1.0",
"@ckeditor/ckeditor5-paragraph": "^29.1.0",
"@ckeditor/ckeditor5-theme-lark": "^29.1.0",
"@ckeditor/ckeditor5-ui": "^29.1.0",
"@ckeditor/ckeditor5-core": "^29.2.0",
"@ckeditor/ckeditor5-dev-utils": "^25.4.0",
"@ckeditor/ckeditor5-editor-classic": "^29.2.0",
"@ckeditor/ckeditor5-engine": "^29.2.0",
"@ckeditor/ckeditor5-heading": "^29.2.0",
"@ckeditor/ckeditor5-paragraph": "^29.2.0",
"@ckeditor/ckeditor5-theme-lark": "^29.2.0",
"@ckeditor/ckeditor5-ui": "^29.2.0",
"webpack": "^4.43.0",

@@ -28,0 +28,0 @@ "webpack-cli": "^3.3.11"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc