@senyao-design-system/editor 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,10 @@ export interface BaseEditorProps {
59
59
  * 占位文本
60
60
  */
61
61
  placeholder?: string;
62
+ /**
63
+ * 是否显示行号,默认为 true
64
+ */
65
+ showLineNumbers?: boolean;
62
66
  /**
63
67
  * 编辑器视图创建后的回调
64
68
  */
@@ -103,7 +107,8 @@ export interface JSONEditorProps extends BaseEditorProps {
103
107
  */
104
108
  extensions?: Extension[];
105
109
  /**
106
- * 是否启用格式化功能
110
+ * 是否启用JSON格式化功能
111
+ * 当为true时,初始加载和按下Alt+F (Mac上为Cmd+Alt+F) 时会自动格式化
107
112
  */
108
113
  enableFormatting?: boolean;
109
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senyao-design-system/editor",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "A flexible editor component based on CodeMirror",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,7 +25,8 @@
25
25
  "@codemirror/lint": "^6.4.2",
26
26
  "@codemirror/state": "^6.4.0",
27
27
  "@codemirror/view": "^6.22.3",
28
- "@emotion/react": "^11.11.0"
28
+ "@emotion/react": "^11.11.0",
29
+ "@lezer/highlight": "^1.2.0"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@emotion/babel-plugin": "^11.11.0",
package/dist/index.css DELETED
@@ -1 +0,0 @@
1
- .senyao-editor{width:100%;border:1px solid #ddd;border-radius:4px;overflow:hidden;font-family:Menlo,Monaco,Courier New,monospace}.senyao-editor:focus-within{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.senyao-editor .cm-editor{height:100%}.senyao-editor .cm-scroller{overflow:auto}.senyao-editor .cm-readonly{background-color:#f5f5f5}.senyao-editor .cm-readOnly{background-color:#0000000d;border-radius:2px;position:relative;pointer-events:all;transition:background-color .2s;border-left:2px solid rgba(0,0,0,.1);z-index:1}.senyao-editor .cm-readOnly:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;cursor:not-allowed!important;z-index:10;pointer-events:auto}.senyao-editor .cm-readOnly:hover:after{background-color:#00000005}.senyao-editor .cm-diagnosticError{text-decoration:wavy underline #ff4d4f;text-decoration-skip-ink:none}.senyao-editor .cm-diagnosticWarning{text-decoration:wavy underline #faad14;text-decoration-skip-ink:none}.senyao-editor .cm-keyword{color:#00f!important;z-index:2;position:relative;background-color:transparent!important}.senyao-editor .cb,.senyao-editor .cm-content span.cb,.senyao-editor span.cm-keyword{color:#00f;font-weight:700;position:relative;background-color:transparent}.senyao-editor .cm-operator{color:#777!important;z-index:2;position:relative}.senyao-editor .cm-number{color:#098658!important;z-index:2;position:relative}.senyao-editor .cm-string{color:#a31515!important;z-index:2;position:relative}.senyao-editor .cm-comment{color:green!important;z-index:2;position:relative}.senyao-editor .cm-propertyName{color:#0451a5!important;z-index:2;position:relative}.senyao-editor.disabled{opacity:.7;cursor:not-allowed}.senyao-editor.disabled .cm-content{cursor:not-allowed}.senyao-editor .cm-placeholder{color:#999}