Skip to content

Commit

Permalink
Update licenseKey handling (#17316)
Browse files Browse the repository at this point in the history
Other: Changes related to the introduction of self-service channel for CKEditor 5 Premium Features. See #17317.

MAJOR BREAKING CHANGE: `config.licenseKey` is now a required property in the editor configuration. Use `'GPL'` for installations under the GPL terms. See #17317.
  • Loading branch information
arkflpc authored Oct 24, 2024
1 parent 21c6f46 commit 5d0fe1e
Show file tree
Hide file tree
Showing 359 changed files with 11,038 additions and 2,940 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
],
rules: {
'ckeditor5-rules/ckeditor-imports': 'error',
'ckeditor5-rules/prevent-license-key-leak': 'error',
'ckeditor5-rules/license-header': [ 'error', {
headerLines: [
'/**',
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/balloon-block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ BalloonEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/balloon-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ BalloonEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
4 changes: 2 additions & 2 deletions docs/_snippets/examples/bottom-toolbar-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ DecoupledEditor
'mergeTableCells'
]
},

cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/classic-editor-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/classic-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/document-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ DecoupledEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
const toolbarContainer = document.querySelector( '.document-editor__toolbar' );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/inline-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Array.from( inlineInjectElements ).forEach( inlineElement => {
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
};

if ( inlineElement.tagName.toLowerCase() == 'header' ) {
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/examples/multi-root-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ MultiRootEditor
'|', 'link', 'uploadImage', 'insertTable', 'mediaEmbed',
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
}
},
licenseKey: 'GPL'
}
)
.then( editor => {
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/image-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/mathtype.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ ClassicEditor
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )

.then( editor => {
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ClassicEditor
top: window.getViewportTopOffsetConfig()
}
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/placeholder-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ ClassicEditor
top: window.getViewportTopOffsetConfig()
}
},
placeholder: 'Type some content here!'
placeholder: 'Type some content here!',
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ ClassicEditor
top: window.getViewportTopOffsetConfig()
}
},
placeholder: 'Type some content here!'
placeholder: 'Type some content here!',
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/read-only-hide-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/read-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ ClassicEditor
exportWord: {
fileName: 'export-word-demo.docx',
tokenUrl: false
}
},
licenseKey: 'GPL'
} )
.then( editor => {
const button = document.querySelector( '#snippet-read-only-toggle' );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/ui-language-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/ui-language-rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/ui-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/update-placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ClassicEditor
top: window.getViewportTopOffsetConfig()
}
},
placeholder: 'Type some content here!'
placeholder: 'Type some content here!',
licenseKey: 'GPL'
} )
.then( editor => {
const button = document.getElementById( 'update-placeholder-button' );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/wproofreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ ClassicEditor
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/development-tools/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/tutorials/block-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
console.log( 'Editor was initialized', editor );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/tutorials/external-data-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ class ExternalDataWidgetEditing extends Plugin {
ClassicEditor
.create( document.querySelector( '#snippet-external-data-widget' ), {
plugins: [ Essentials, Paragraph, Heading, List, Bold, Italic, ExternalDataWidget ],
toolbar: [ 'undo', 'redo', '|', 'external', '|', 'heading', '|', 'bold', 'italic', '|', 'numberedList', 'bulletedList' ]
toolbar: [ 'undo', 'redo', '|', 'external', '|', 'heading', '|', 'bold', 'italic', '|', 'numberedList', 'bulletedList' ],
licenseKey: 'GPL'
} )
.then( editor => {
console.log( 'Editor was initialized', editor );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/tutorials/inline-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
console.log( 'Editor was initialized', editor );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ <h3>Other deals</h3>
<ProductPreview id={id} {...product} />
);
}
}
},
licenseKey: 'GPL'
};

this.handleEditorDataChange = this.handleEditorDataChange.bind( this );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/ui/ui-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ document.querySelector( '.ui-button' ).append( toolbarButtons.element );

ClassicEditor
.create( document.querySelector( '#ui-button-editor' ), {
plugins: [ Essentials ]
plugins: [ Essentials ],
licenseKey: 'GPL'
} )
.then( editor => {
this.tooltipManager = new TooltipManager( editor );
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/ui/ui-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class MinimalisticDialog extends Plugin {
ClassicEditor
.create( document.querySelector( '#ui-dialog-editor' ), {
plugins: [ Essentials, Paragraph, Bold, Italic, Underline, MinimalisticDialog, Dialog ],
toolbar: [ 'bold', 'italic', 'underline', '|', 'showDialog' ]
toolbar: [ 'bold', 'italic', 'underline', '|', 'showDialog' ],
licenseKey: 'GPL'
} )
.then( editor => {
window.attachTourBalloon( {
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/framework/ui/ui-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class MinimalisticModal extends Plugin {
ClassicEditor
.create( document.querySelector( '#ui-modal-editor' ), {
plugins: [ Essentials, Paragraph, Bold, Italic, Underline, MinimalisticModal, Dialog ],
toolbar: [ 'bold', 'italic', 'underline', '|', 'showModal' ]
toolbar: [ 'bold', 'italic', 'underline', '|', 'showModal' ],
licenseKey: 'GPL'
} )
.then( editor => {
window.attachTourBalloon( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ ClassicEditor
viewportOffset: {
top: window.getViewportTopOffsetConfig()
}
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/blocktoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ ClassicEditor
'|',
'outdent', 'indent'
],
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editorBasic = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-breakpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ ClassicEditor
{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' }
]
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ ClassicEditor
{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' }
]
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-nested-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-nested-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-nested-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-nested-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-separator.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ClassicEditor
tokenUrl: TOKEN_URL,
forceDemoLabel: true,
allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ]
}
},
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/installation/setup/toolbar-wrapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ ClassicEditor
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ]
},
cloudServices: CS_CONFIG
cloudServices: CS_CONFIG,
licenseKey: 'GPL'
} )
.then( editor => {
window.editor = editor;
Expand Down
Loading

0 comments on commit 5d0fe1e

Please sign in to comment.