@things-factory/id-rule-base 6.2.54 → 6.2.58
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/id-rule-base",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.58",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,14 +24,11 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@operato/data-grist": "^1.
|
|
27
|
+
"@operato/data-grist": "^1.5.49",
|
|
28
|
+
"@operato/input": "^1.5.49",
|
|
28
29
|
"@things-factory/i18n-base": "^6.2.52",
|
|
29
30
|
"@things-factory/setting-base": "^6.2.54",
|
|
30
|
-
"@things-factory/shell": "^6.2.52"
|
|
31
|
-
"codemirror": "^5.64.0"
|
|
31
|
+
"@things-factory/shell": "^6.2.52"
|
|
32
32
|
},
|
|
33
|
-
"
|
|
34
|
-
"@types/codemirror": "^5.60.5"
|
|
35
|
-
},
|
|
36
|
-
"gitHead": "db6b9a9109a090c4dd705058949fce624f15b0ef"
|
|
33
|
+
"gitHead": "decd44e000e44941409b829d72e99c49cb1829bf"
|
|
37
34
|
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css, unsafeCSS } from 'lit'
|
|
2
|
-
|
|
3
|
-
import CodeMirrorStyle from '!!text-loader!codemirror/lib/codemirror.css'
|
|
4
|
-
import FullScreenStyle from '!!text-loader!codemirror/addon/display/fullscreen.css'
|
|
5
|
-
import NightThemeStyle from '!!text-loader!codemirror/theme/night.css'
|
|
6
|
-
|
|
7
|
-
import CodeMirror from 'codemirror'
|
|
8
|
-
import 'codemirror/mode/javascript/javascript'
|
|
9
|
-
import 'codemirror/addon/display/fullscreen'
|
|
10
|
-
import 'codemirror/addon/display/autorefresh'
|
|
11
|
-
|
|
12
|
-
export default class EditorCode extends LitElement {
|
|
13
|
-
static get is() {
|
|
14
|
-
return 'editor-code'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static get properties() {
|
|
18
|
-
return {
|
|
19
|
-
/**
|
|
20
|
-
* `value`는 에디터에서 작성중인 contents이다.
|
|
21
|
-
*/
|
|
22
|
-
value: String,
|
|
23
|
-
mode: String
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get styles() {
|
|
28
|
-
return [
|
|
29
|
-
css`
|
|
30
|
-
${unsafeCSS(CodeMirrorStyle)}
|
|
31
|
-
${unsafeCSS(FullScreenStyle)}
|
|
32
|
-
${unsafeCSS(NightThemeStyle)}
|
|
33
|
-
`,
|
|
34
|
-
css`
|
|
35
|
-
:host {
|
|
36
|
-
display: block;
|
|
37
|
-
position: relative;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#wrapper {
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 0;
|
|
45
|
-
right: 0;
|
|
46
|
-
bottom: 0;
|
|
47
|
-
top: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
textarea {
|
|
51
|
-
display: block;
|
|
52
|
-
height: 100%;
|
|
53
|
-
width: 100%;
|
|
54
|
-
resize: none;
|
|
55
|
-
font-size: 16px;
|
|
56
|
-
line-height: 20px;
|
|
57
|
-
border: 0px;
|
|
58
|
-
padding: 0px;
|
|
59
|
-
}
|
|
60
|
-
`
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
updated(change) {
|
|
64
|
-
this._outside_changing = true
|
|
65
|
-
if (change.has('value') && this.editor && !this._self_changing) {
|
|
66
|
-
this.editor.setValue(this.value === undefined ? '' : String(this.value))
|
|
67
|
-
this.editor.refresh()
|
|
68
|
-
}
|
|
69
|
-
this._outside_changing = false
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
render() {
|
|
73
|
-
return html`
|
|
74
|
-
<div id="wrapper">
|
|
75
|
-
<textarea></textarea>
|
|
76
|
-
</div>
|
|
77
|
-
`
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
get editor() {
|
|
81
|
-
if (!this._editor) {
|
|
82
|
-
let textarea = this.shadowRoot.querySelector('textarea')
|
|
83
|
-
let mode = this.mode || 'javascript'
|
|
84
|
-
let lint = this.lint
|
|
85
|
-
let hintOptions = this.hintOptions
|
|
86
|
-
if (textarea) {
|
|
87
|
-
this._editor = CodeMirror.fromTextArea(textarea, {
|
|
88
|
-
value: this.value,
|
|
89
|
-
mode,
|
|
90
|
-
lint,
|
|
91
|
-
hintOptions,
|
|
92
|
-
tabSize: 2,
|
|
93
|
-
lineNumbers: true,
|
|
94
|
-
showCursorWhenSelecting: true,
|
|
95
|
-
theme: 'night',
|
|
96
|
-
extraKeys: {
|
|
97
|
-
F11: function (cm) {
|
|
98
|
-
cm.setOption('fullScreen', !cm.getOption('fullScreen'))
|
|
99
|
-
},
|
|
100
|
-
Esc: function (cm) {
|
|
101
|
-
cm.setOption('fullScreen', !cm.getOption('fullScreen'))
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
autoRefresh: {
|
|
105
|
-
delay: 500
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
this._editor.on('blur', e => {
|
|
110
|
-
if (!this._changed) return
|
|
111
|
-
|
|
112
|
-
this.value = e.getValue()
|
|
113
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
this._editor.on('change', async e => {
|
|
117
|
-
this._self_changing = true
|
|
118
|
-
|
|
119
|
-
this._changed = true
|
|
120
|
-
|
|
121
|
-
await this.renderComplete
|
|
122
|
-
this._self_changing = false
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
this._editor.setSize('100%', '100%')
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return this._editor
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
customElements.define(EditorCode.is, EditorCode)
|