Skip to content

Commit

Permalink
BC-5565 - bump ckeditor5 (#2923)
Browse files Browse the repository at this point in the history
* Bump custom ckeditor to 1.0.0

* Add prop for editor type
  • Loading branch information
christian-darsow authored Nov 28, 2023
1 parent a2cc466 commit d6a27d0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@braintree/sanitize-url": "^6.0.4",
"@ckeditor/ckeditor5-vue2": "^3.0.1",
"@hpi-schul-cloud/ckeditor": "0.4.0",
"@hpi-schul-cloud/ckeditor": "^1.0.0",
"@lumieducation/h5p-webcomponents": "^9.2.2",
"@mdi/js": "^7.3.67",
"@types/vuelidate": "^0.7.21",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:placeholder="
$t('components.cardElement.richTextElement.placeholder').toString()
"
type="balloon"
mode="simple"
@update:value="onUpdateValue"
@focus="onFocus"
Expand Down
13 changes: 12 additions & 1 deletion src/components/feature-editor/CKEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<ckeditor
ref="ck"
v-model="modelValue"
:editor="editor"
:config="config"
:editor="CustomCKEditor"
data-testid="ckeditor"
:disabled="disabled"
@blur="handleBlur"
Expand Down Expand Up @@ -39,6 +39,11 @@ export default defineComponent({
type: String,
default: "",
},
type: {
type: String,
validator: (value) => ["classic", "balloon"].includes(value),
default: "classic",
},
mode: {
type: String,
validator: (value) => ["simple", "regular"].includes(value),
Expand All @@ -56,6 +61,11 @@ export default defineComponent({
const ck = ref(null);
const modelValue = useVModel(props, "value", emit);
const editor = computed(() => {
return props.type === "classic"
? CustomCKEditor.ClassicEditor
: CustomCKEditor.BalloonEditor;
});
const language = i18n.locale;
const charCount = ref(0);
Expand Down Expand Up @@ -263,6 +273,7 @@ export default defineComponent({
return {
ck,
editor,
modelValue,
CustomCKEditor,
config,
Expand Down

0 comments on commit d6a27d0

Please sign in to comment.