Skip to content

Commit

Permalink
Update yarn.
Browse files Browse the repository at this point in the history
Fixed Invalid prop error.
  • Loading branch information
logue committed Feb 3, 2024
1 parent 9bbab37 commit be2bd4a
Show file tree
Hide file tree
Showing 6 changed files with 1,062 additions and 1,079 deletions.
672 changes: 336 additions & 336 deletions .yarn/releases/yarn-4.0.2.cjs → .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "vue-codemirror6",
"version": "1.2.4",
"version": "1.2.5",
"license": "MIT",
"description": "CodeMirror6 Component for vue2 and vue3.",
"keywords": [
Expand Down Expand Up @@ -55,7 +55,7 @@
"engines": {
"yarn": ">=1.22.19"
},
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.1.0",
"sideEffects": false,
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -84,8 +84,8 @@
"@codemirror/lang-markdown": "^6.2.4",
"@codemirror/lang-vue": "0.1.2",
"@tsconfig/node-lts": "^20.1.1",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@types/node": "^20.11.16",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/compiler-sfc": "^3.4.15",
"@vue/eslint-config-prettier": "^9.0.0",
Expand All @@ -105,8 +105,8 @@
"eslint-plugin-vue": "latest",
"eslint-plugin-vuejs-accessibility": "^2.2.1",
"eslint-plugin-yaml": "^0.5.0",
"husky": "^9.0.6",
"lint-staged": "^15.2.0",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
Expand All @@ -115,11 +115,11 @@
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-dts": "^3.7.2",
"vue": "^3.4.15",
"vue-eslint-parser": "^9.4.2",
"vue-markdown-wasm": "^0.4.0",
"vue-markdown-wasm": "^0.3.14",
"vue-tsc": "^1.8.27"
},
"husky": {
Expand All @@ -133,7 +133,6 @@
},
"resolutions": {
"json5": "^2.2.3",
"lodash": ">4.17.21",
"postcss": "^8.4.31",
"semver": "^7.5.3",
"yaml": "^2.3.2",
Expand Down
8 changes: 4 additions & 4 deletions src/components/CodeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default defineComponent({
/** Emits */
emits: {
/** Model Update */
'update:modelValue': (value: string | Text) => true,
'update:modelValue': (value: string | Text = '') => true,
/** CodeMirror ViewUpdate */
update: (value: ViewUpdate) => true,
/** CodeMirror onReady */
Expand Down Expand Up @@ -364,8 +364,9 @@ export default defineComponent({
EditorView.updateListener.of((update: ViewUpdate): void => {
// Emit focus status
context.emit('focus', view.value.hasFocus);

// Update count
length.value = view.value.state.doc.length;
length.value = view.value.state.doc?.length;

if (update.changes.empty || !update.docChanged) {
// Suppress event firing if no change
Expand Down Expand Up @@ -478,15 +479,14 @@ export default defineComponent({
state: EditorState.create({ doc: value, extensions: extensions.value }),
dispatch: (tr: Transaction) => {
view.value.update([tr]);

if (tr.changes.empty || !tr.docChanged) {
// if not change value, no fire emit event
return;
}

// console.log(view.state.doc.toString(), tr);
// state.toString() is not defined, so use toJSON and toText function to convert string.
context.emit('update:modelValue', tr.state.doc);
context.emit('update:modelValue', tr.state.doc.toString() ?? '');
// Emit EditorState
context.emit('change', tr.state);
},
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineConfig(({ mode, command }): UserConfig => {
*
* @description ${pkg.description}
* @author ${pkg.author.name} <${pkg.author.email}>
* @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
* @copyright 2022-2024 By Masashi Yoshikawa All rights reserved.
* @license ${pkg.license}
* @version ${pkg.version}
* @see {@link ${pkg.homepage}}
Expand Down
Loading

0 comments on commit be2bd4a

Please sign in to comment.