@operato/app 1.19.12 → 1.19.14
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
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.19.14](https://github.com/hatiolab/operato/compare/v1.19.13...v1.19.14) (2025-01-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* upgrade dependencies ([13e1652](https://github.com/hatiolab/operato/commit/13e16521eaa62af5afb76b9dad4191a36165a28a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.19.13](https://github.com/hatiolab/operato/compare/v1.19.12...v1.19.13) (2025-01-10)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* [@graphql-tools](https://github.com/graphql-tools) update for ox-input-graphql ([67af3db](https://github.com/hatiolab/operato/commit/67af3db7b25ff07a384531209c39fb7dbb431c81))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.19.12](https://github.com/hatiolab/operato/compare/v1.19.11...v1.19.12) (2024-10-22)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
|
-
import { fetch } from 'cross-fetch';
|
|
6
|
-
import { print } from 'graphql';
|
|
7
5
|
import { css } from 'lit';
|
|
8
6
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
7
|
import { graphql } from 'cm6-graphql';
|
|
@@ -12,7 +10,9 @@ import { autocompletion, closeBrackets } from '@codemirror/autocomplete';
|
|
|
12
10
|
import { bracketMatching, syntaxHighlighting } from '@codemirror/language';
|
|
13
11
|
import { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark';
|
|
14
12
|
import { EditorView, highlightActiveLine, keymap } from '@codemirror/view';
|
|
15
|
-
import {
|
|
13
|
+
import { makeExecutableSchema } from '@graphql-tools/schema';
|
|
14
|
+
import { loadSchema } from '@graphql-tools/load';
|
|
15
|
+
import { UrlLoader } from '@graphql-tools/url-loader';
|
|
16
16
|
import { GRAPHQL_URI } from '@operato/graphql';
|
|
17
17
|
import { OxFormField } from '@operato/input';
|
|
18
18
|
import { togglefullscreen } from '@operato/utils';
|
|
@@ -40,22 +40,14 @@ let OxInputGraphql = class OxInputGraphql extends OxFormField {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
async getSchema() {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'Content-Type': 'application/json'
|
|
50
|
-
},
|
|
51
|
-
body: JSON.stringify({ query, variables })
|
|
52
|
-
});
|
|
53
|
-
return fetchResult.json();
|
|
54
|
-
};
|
|
55
|
-
return await wrapSchema({
|
|
56
|
-
schema: await introspectSchema(executor),
|
|
57
|
-
executor
|
|
43
|
+
const uri = this.link || GRAPHQL_URI;
|
|
44
|
+
const schema = await loadSchema(uri, {
|
|
45
|
+
loaders: [new UrlLoader()],
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'application/json'
|
|
48
|
+
}
|
|
58
49
|
});
|
|
50
|
+
return makeExecutableSchema({ typeDefs: schema, resolvers: {} });
|
|
59
51
|
}
|
|
60
52
|
async getEditor() {
|
|
61
53
|
if (!this._editor) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-input-graphql.js","sourceRoot":"","sources":["../../../src/input/ox-input-graphql.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ox-input-graphql.js","sour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gBACnB,OAAM;YACR,CAAC;YAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;YAC/C,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACtG,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;;AA/GM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;KAYF;CACF,AAdY,CAcZ;AAK2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AArBtB,cAAc;IADlC,aAAa,CAAC,kBAAkB,CAAC;GACb,cAAc,CAiHlC;eAjHoB,cAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { graphql } from 'cm6-graphql'\n\nimport { history, historyKeymap, indentWithTab } from '@codemirror/commands'\nimport { autocompletion, closeBrackets } from '@codemirror/autocomplete'\nimport { bracketMatching, syntaxHighlighting } from '@codemirror/language'\nimport { oneDarkHighlightStyle, oneDark } from '@codemirror/theme-one-dark'\nimport { EditorView, highlightActiveLine, keymap } from '@codemirror/view'\n\nimport { makeExecutableSchema } from '@graphql-tools/schema'\nimport { loadSchema } from '@graphql-tools/load'\nimport { UrlLoader } from '@graphql-tools/url-loader'\nimport { GRAPHQL_URI } from '@operato/graphql'\nimport { OxFormField } from '@operato/input'\nimport { togglefullscreen } from '@operato/utils'\n\n/**\n WEB Component for code-mirror graphql editor.\n \n Example:\n \n <ox-input-graphql value=${text} link=${link}>\n </ox-input-graphql>\n */\n@customElement('ox-input-graphql')\nexport default class OxInputGraphql extends OxFormField {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n background: white;\n overflow: auto;\n }\n\n .cm-editor {\n flex: 1;\n }\n `\n ]\n\n /**\n * `value`는 에디터에서 작성중인 contents이다.\n */\n @property({ type: String }) value?: string\n @property({ type: String }) link?: string\n\n private _self_changing: boolean = false\n private _editor?: EditorView\n private _changed: boolean = false\n\n async updated(changes: PropertyValues<this>) {\n const editor = await this.getEditor()\n if (changes.has('value') && editor && !this._self_changing) {\n const to = editor.state.doc.toString().length\n editor.dispatch({\n changes: { from: 0, to, insert: this.value === undefined ? '' : String(this.value) }\n })\n }\n }\n\n async getSchema() {\n const uri = this.link || GRAPHQL_URI\n\n const schema = await loadSchema(uri, {\n loaders: [new UrlLoader()],\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n\n return makeExecutableSchema({ typeDefs: schema, resolvers: {} })\n }\n\n async getEditor() {\n if (!this._editor) {\n var schema\n try {\n schema = await this.getSchema()\n } catch (err) {\n console.error(err)\n }\n\n this._editor = new EditorView({\n doc: this.value,\n extensions: [\n bracketMatching(),\n closeBrackets(),\n history(),\n autocompletion(),\n oneDark,\n syntaxHighlighting(oneDarkHighlightStyle),\n graphql(schema, {\n onShowInDocs(field, type, parentType) {\n alert(`Showing in docs.: Field: ${field}, Type: ${type}, ParentType: ${parentType}`)\n },\n onFillAllFields(view, schema, _query, cursor, token) {\n alert(`Filling all fields. Token: ${token}`)\n }\n }),\n highlightActiveLine(),\n history(),\n keymap.of([...historyKeymap, indentWithTab]),\n EditorView.updateListener.of(async v => {\n if (v.docChanged) {\n this._self_changing = true\n this._changed = true\n\n await this.updateComplete\n\n this._self_changing = false\n }\n })\n ],\n parent: this.renderRoot\n })\n }\n\n this._editor.contentDOM.addEventListener('keydown', event => {\n event.stopPropagation()\n\n if (event.key === 'Escape') {\n togglefullscreen(this._editor!.contentDOM)\n }\n })\n\n this._editor.contentDOM.addEventListener('blur', e => {\n if (!this._changed) {\n return\n }\n\n this.value = this._editor!.state.doc.toString()\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n })\n\n return this._editor\n }\n}\n"]}
|