Skip to content

Commit 222b5c6

Browse files
committed
feat: use vue's built-in CSSProperties instead of csstype
1 parent 59d5fd8 commit 222b5c6

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
## CHANGELOG
22

3+
### v6.1.1 (2022-08-28)
4+
5+
- feat: use vue's built-in `CSSProperties` instead of `csstype`
6+
37
### v6.1.0 (2022-08-27)
48

59
- feat: add `phrases` prop [#166](https://github.com/surmon-china/vue-codemirror/pull/166)
610

711
### v6.0.2 (2022-07-27)
812

9-
- fix: Use the correct global component name [#161](https://github.com/surmon-china/vue-codemirror/discussions/161)
13+
- fix: use the correct global component name [#161](https://github.com/surmon-china/vue-codemirror/discussions/161)
1014

1115
### v6.0.1 (2022-07-22)
1216

libundler.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default defineConfig({
66
entry: './src/index.ts',
77
outDir: './dist',
88
targets: ['esm', 'cjs'],
9-
external: ['vue', 'csstype', 'codemirror', /@codemirror\/.*/],
9+
external: ['vue', 'codemirror', /@codemirror\/.*/],
1010
exports: 'named'
1111
})

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-codemirror",
33
"description": "CodeMirror code editor component for Vue",
4-
"version": "6.1.0",
4+
"version": "6.1.1",
55
"author": "Surmon",
66
"license": "MIT",
77
"keywords": [
@@ -47,8 +47,7 @@
4747
"@codemirror/commands": "6.x",
4848
"@codemirror/language": "6.x",
4949
"@codemirror/state": "6.x",
50-
"@codemirror/view": "6.x",
51-
"csstype": "^3.1.0"
50+
"@codemirror/view": "6.x"
5251
},
5352
"devDependencies": {
5453
"codemirror": "6.x",

src/codemirror.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as CSS from 'csstype'
1+
import type { CSSProperties } from 'vue'
22
import { EditorState, EditorStateConfig, Compartment, Extension, StateEffect } from '@codemirror/state'
33
import { EditorView, EditorViewConfig, ViewUpdate, keymap, placeholder } from '@codemirror/view'
44
import { indentWithTab } from '@codemirror/commands'
@@ -112,8 +112,8 @@ export const getEditorTools = (view: EditorView) => {
112112
// set style to editor element
113113
// https://codemirror.net/examples/styling/
114114
const { run: reStyle } = createEditorCompartment(view)
115-
const setStyle = (style: CSS.Properties = {}) => {
116-
reStyle(EditorView.theme({ '&': { ...style } }))
115+
const setStyle = (style: CSSProperties = {}) => {
116+
reStyle(EditorView.theme({ '&': { ...(style as any) } }))
117117
}
118118

119119
return {

src/props.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as CSS from 'csstype'
1+
import type { CSSProperties } from 'vue'
22
import { PropType, ExtractPropTypes } from 'vue'
33
import { EditorStateConfig } from '@codemirror/state'
44

@@ -14,7 +14,7 @@ export const configProps = {
1414
indentWithTab: NonDefaultBooleanType,
1515
tabSize: Number,
1616
placeholder: String,
17-
style: Object as PropType<CSS.Properties>,
17+
style: Object as PropType<CSSProperties>,
1818
autoDestroy: NonDefaultBooleanType,
1919
phrases: Object as PropType<Record<string, string>>,
2020
// codemirror options

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,11 +1603,6 @@ csstype@^2.6.8:
16031603
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.20.tgz#9229c65ea0b260cf4d3d997cb06288e36a8d6dda"
16041604
integrity sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==
16051605

1606-
csstype@^3.1.0:
1607-
version "3.1.0"
1608-
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2"
1609-
integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==
1610-
16111606
data-urls@^3.0.2:
16121607
version "3.0.2"
16131608
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143"

0 commit comments

Comments
 (0)