@operato/app 1.5.50 → 1.5.51
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 +9 -0
- package/dist/src/input/ox-input-graphql.d.ts +0 -3
- package/dist/src/input/ox-input-graphql.js +8 -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 +7 -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.51",
|
|
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.51",
|
|
140
|
+
"@operato/data-grist": "^1.5.51",
|
|
141
|
+
"@operato/font": "^1.5.51",
|
|
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.51",
|
|
146
146
|
"@operato/layout": "^1.5.48",
|
|
147
|
-
"@operato/property-editor": "^1.5.
|
|
147
|
+
"@operato/property-editor": "^1.5.51",
|
|
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": "35850ad26ab8c395d6f6791daf76549ffda3d404"
|
|
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'
|
|
@@ -52,10 +50,7 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
52
50
|
@property({ type: String }) value?: string
|
|
53
51
|
@property({ type: String }) link?: string
|
|
54
52
|
|
|
55
|
-
@query('textarea') textarea!: HTMLTextAreaElement
|
|
56
|
-
|
|
57
53
|
private _self_changing: boolean = false
|
|
58
|
-
private _changed: boolean = false
|
|
59
54
|
private _editor?: EditorView
|
|
60
55
|
|
|
61
56
|
async updated(changes: PropertyValues<this>) {
|
|
@@ -68,10 +63,6 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
65
|
|
|
71
|
-
render() {
|
|
72
|
-
return html` <textarea></textarea> `
|
|
73
|
-
}
|
|
74
|
-
|
|
75
66
|
async getSchema() {
|
|
76
67
|
const executor = async ({ document, variables }: any) => {
|
|
77
68
|
const query = print(document)
|
|
@@ -121,17 +112,7 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
121
112
|
}),
|
|
122
113
|
highlightActiveLine(),
|
|
123
114
|
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
|
-
]),
|
|
115
|
+
keymap.of([...historyKeymap, indentWithTab]),
|
|
135
116
|
EditorView.updateListener.of(v => {
|
|
136
117
|
if (v.docChanged) {
|
|
137
118
|
this._self_changing = true
|
|
@@ -147,65 +128,12 @@ export default class OxInputGraphql extends OxFormField {
|
|
|
147
128
|
})
|
|
148
129
|
}
|
|
149
130
|
|
|
131
|
+
this._editor.contentDOM.addEventListener('keydown', event => {
|
|
132
|
+
if (event.key === 'Escape') {
|
|
133
|
+
togglefullscreen(this._editor!.contentDOM)
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
|
|
150
137
|
return this._editor
|
|
151
138
|
}
|
|
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
139
|
}
|
|
@@ -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
|
}
|