@operato/app 1.5.50 → 1.5.52
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/CHANGELOG.md +18 -0
- package/dist/src/input/ox-input-graphql.d.ts +0 -3
- package/dist/src/input/ox-input-graphql.js +9 -70
- package/dist/src/input/ox-input-graphql.js.map +1 -1
- package/dist/src/property-editor/ox-property-editor-graphql.js +1 -1
- package/dist/src/property-editor/ox-property-editor-graphql.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/input/ox-input-graphql.ts +8 -79
- package/src/property-editor/ox-property-editor-graphql.ts +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/app",
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "1.5.
|
|
5
|
+
"version": "1.5.52",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -136,15 +136,15 @@
|
|
|
136
136
|
"@material/mwc-button": "^0.27.0",
|
|
137
137
|
"@material/mwc-icon": "^0.27.0",
|
|
138
138
|
"@material/mwc-icon-button": "^0.27.0",
|
|
139
|
-
"@operato/attachment": "^1.5.
|
|
140
|
-
"@operato/data-grist": "^1.5.
|
|
141
|
-
"@operato/font": "^1.5.
|
|
139
|
+
"@operato/attachment": "^1.5.52",
|
|
140
|
+
"@operato/data-grist": "^1.5.52",
|
|
141
|
+
"@operato/font": "^1.5.52",
|
|
142
142
|
"@operato/form": "^1.5.44",
|
|
143
143
|
"@operato/graphql": "^1.4.76",
|
|
144
144
|
"@operato/i18n": "^1.5.14",
|
|
145
|
-
"@operato/input": "^1.5.
|
|
145
|
+
"@operato/input": "^1.5.52",
|
|
146
146
|
"@operato/layout": "^1.5.48",
|
|
147
|
-
"@operato/property-editor": "^1.5.
|
|
147
|
+
"@operato/property-editor": "^1.5.52",
|
|
148
148
|
"@operato/shell": "^1.5.48",
|
|
149
149
|
"@operato/styles": "^1.5.48",
|
|
150
150
|
"@operato/utils": "^1.5.44",
|
|
@@ -189,5 +189,5 @@
|
|
|
189
189
|
"prettier --write"
|
|
190
190
|
]
|
|
191
191
|
},
|
|
192
|
-
"gitHead": "
|
|
192
|
+
"gitHead": "07f692c2e5ffc3045add9bfcebc94516dad187fc"
|
|
193
193
|
}
|
|
@@ -9,8 +9,6 @@ import { customElement, property, query } from 'lit/decorators.js'
|
|
|
9
9
|
import { graphql } from 'cm6-graphql'
|
|
10
10
|
|
|
11
11
|
import { history, historyKeymap, indentWithTab } from '@codemirror/commands'
|
|
12
|
-
import { javascript } from '@codemirror/lang-javascript'
|
|
13
|
-
import { EditorState } from '@codemirror/state'
|
|
14
12
|
import { autocompletion, closeBrackets } from '@codemirror/autocomplete'
|
|
15
13
|
import { bracketMatching, syntaxHighlighting } from '@codemirror/language'
|
|
16
14
|
import { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark'
|
|
@@ -38,6 +36,7 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
38
36
|
flex-direction: column;
|
|
39
37
|
position: relative;
|
|
40
38
|
background: white;
|
|
39
|
+
overflow: auto;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
.cm-editor {
|
|
@@ -52,10 +51,7 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
52
51
|
@property({ type: String }) value?: string
|
|
53
52
|
@property({ type: String }) link?: string
|
|
54
53
|
|
|
55
|
-
@query('textarea') textarea!: HTMLTextAreaElement
|
|
56
|
-
|
|
57
54
|
private _self_changing: boolean = false
|
|
58
|
-
private _changed: boolean = false
|
|
59
55
|
private _editor?: EditorView
|
|
60
56
|
|
|
61
57
|
async updated(changes: PropertyValues<this>) {
|
|
@@ -68,10 +64,6 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
render() {
|
|
72
|
-
return html` <textarea></textarea> `
|
|
73
|
-
}
|
|
74
|
-
|
|
75
67
|
async getSchema() {
|
|
76
68
|
const executor = async ({ document, variables }: any) => {
|
|
77
69
|
const query = print(document)
|
|
@@ -121,17 +113,7 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
121
113
|
}),
|
|
122
114
|
highlightActiveLine(),
|
|
123
115
|
history(),
|
|
124
|
-
keymap.of([
|
|
125
|
-
...historyKeymap,
|
|
126
|
-
indentWithTab,
|
|
127
|
-
{
|
|
128
|
-
key: 'Escape',
|
|
129
|
-
run: (view: EditorView) => {
|
|
130
|
-
togglefullscreen(this)
|
|
131
|
-
return true
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
]),
|
|
116
|
+
keymap.of([...historyKeymap, indentWithTab]),
|
|
135
117
|
EditorView.updateListener.of(v => {
|
|
136
118
|
if (v.docChanged) {
|
|
137
119
|
this._self_changing = true
|
|
@@ -147,65 +129,12 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
147
129
|
})
|
|
148
130
|
}
|
|
149
131
|
|
|
132
|
+
this._editor.contentDOM.addEventListener('keydown', event => {
|
|
133
|
+
if (event.key === 'Escape') {
|
|
134
|
+
togglefullscreen(this._editor!.contentDOM)
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
150
138
|
return this._editor
|
|
151
139
|
}
|
|
152
|
-
|
|
153
|
-
// async getEditor() {
|
|
154
|
-
// if (!this._editor) {
|
|
155
|
-
// try {
|
|
156
|
-
// var schema = await this.getSchema()
|
|
157
|
-
// } catch (err) {
|
|
158
|
-
// console.error(err)
|
|
159
|
-
// }
|
|
160
|
-
|
|
161
|
-
// if (this.textarea) {
|
|
162
|
-
// this._editor = CodeMirror.fromTextArea(this.textarea, {
|
|
163
|
-
// value: this.value,
|
|
164
|
-
// mode: 'graphql',
|
|
165
|
-
// lint: {
|
|
166
|
-
// //@ts-ignore
|
|
167
|
-
// schema
|
|
168
|
-
// },
|
|
169
|
-
// hintOptions: {
|
|
170
|
-
// //@ts-ignore
|
|
171
|
-
// schema
|
|
172
|
-
// },
|
|
173
|
-
// tabSize: 2,
|
|
174
|
-
// lineNumbers: false,
|
|
175
|
-
// showCursorWhenSelecting: true,
|
|
176
|
-
// theme: 'night',
|
|
177
|
-
// extraKeys: {
|
|
178
|
-
// F11: function (cm) {
|
|
179
|
-
// cm.setOption('fullScreen', !cm.getOption('fullScreen'))
|
|
180
|
-
// },
|
|
181
|
-
// Esc: function (cm) {
|
|
182
|
-
// cm.setOption('fullScreen', !cm.getOption('fullScreen'))
|
|
183
|
-
// }
|
|
184
|
-
// },
|
|
185
|
-
// autoRefresh: {
|
|
186
|
-
// delay: 500
|
|
187
|
-
// }
|
|
188
|
-
// })
|
|
189
|
-
|
|
190
|
-
// this._editor.on('blur', (editor: CodeMirror.Editor, e: FocusEvent) => {
|
|
191
|
-
// if (!this._changed) return
|
|
192
|
-
|
|
193
|
-
// this.value = editor.getValue()
|
|
194
|
-
// this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
195
|
-
// })
|
|
196
|
-
|
|
197
|
-
// this._editor.on('change', async (editor: CodeMirror.Editor, changeObj: CodeMirror.EditorChange) => {
|
|
198
|
-
// this._self_changing = true
|
|
199
|
-
|
|
200
|
-
// this._changed = true
|
|
201
|
-
|
|
202
|
-
// await this.requestUpdate()
|
|
203
|
-
|
|
204
|
-
// this._self_changing = false
|
|
205
|
-
// })
|
|
206
|
-
// }
|
|
207
|
-
// }
|
|
208
|
-
|
|
209
|
-
// return this._editor
|
|
210
|
-
// }
|
|
211
140
|
}
|
|
@@ -8,6 +8,6 @@ import { OxPropertyEditor, PropertySpec } from '@operato/property-editor'
|
|
|
8
8
|
@customElement('ox-property-editor-graphql')
|
|
9
9
|
export class OxPropertyEditorGraphQL extends OxPropertyEditor {
|
|
10
10
|
editorTemplate(value: any, spec: PropertySpec): TemplateResult {
|
|
11
|
-
return html` <ox-input-graphql id="editor" .value=${value} fullwidth> </ox-input-graphql> `
|
|
11
|
+
return html` <ox-input-graphql class="multiline-input" id="editor" .value=${value} fullwidth> </ox-input-graphql> `
|
|
12
12
|
}
|
|
13
13
|
}
|