@graphiql/react
Advanced tools
Comparing version 0.22.2-canary-0dd016c7.0 to 0.23.0-canary-1fdb7e38.0
@@ -1,2 +0,2 @@ | ||
"use strict";var l=Object.defineProperty;var n=(e,o)=>l(e,"name",{value:o,configurable:!0});const s=require("./codemirror.cjs2.js"),g=require("./dialog.cjs2.js");function u(e,o){for(var i=0;i<o.length;i++){const r=o[i];if(typeof r!="string"&&!Array.isArray(r)){for(const t in r)if(t!=="default"&&!(t in e)){const a=Object.getOwnPropertyDescriptor(r,t);a&&Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>r[t]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}n(u,"_mergeNamespaces");var c=g.requireDialog();const f=s.getDefaultExportFromCjs(c),d=u({__proto__:null,default:f},[c]);exports.dialog=d; | ||
"use strict";var E=Object.defineProperty;var g=(v,m)=>E(v,"name",{value:m,configurable:!0});const b=require("./codemirror.cjs2.js");function O(v,m){for(var n=0;n<m.length;n++){const r=m[n];if(typeof r!="string"&&!Array.isArray(r)){for(const c in r)if(c!=="default"&&!(c in v)){const u=Object.getOwnPropertyDescriptor(r,c);u&&Object.defineProperty(v,c,u.get?u:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}g(O,"_mergeNamespaces");var T={exports:{}};(function(v,m){(function(n){n(b.requireCodemirror())})(function(n){function r(u,f,e){var a=u.getWrapperElement(),l;return l=a.appendChild(document.createElement("div")),e?l.className="CodeMirror-dialog CodeMirror-dialog-bottom":l.className="CodeMirror-dialog CodeMirror-dialog-top",typeof f=="string"?l.innerHTML=f:l.appendChild(f),n.addClass(a,"dialog-opened"),l}g(r,"dialogDiv");function c(u,f){u.state.currentNotificationClose&&u.state.currentNotificationClose(),u.state.currentNotificationClose=f}g(c,"closeNotification"),n.defineExtension("openDialog",function(u,f,e){e||(e={}),c(this,null);var a=r(this,u,e.bottom),l=!1,s=this;function i(t){if(typeof t=="string")o.value=t;else{if(l)return;l=!0,n.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),s.focus(),e.onClose&&e.onClose(a)}}g(i,"close");var o=a.getElementsByTagName("input")[0],d;return o?(o.focus(),e.value&&(o.value=e.value,e.selectValueOnOpen!==!1&&o.select()),e.onInput&&n.on(o,"input",function(t){e.onInput(t,o.value,i)}),e.onKeyUp&&n.on(o,"keyup",function(t){e.onKeyUp(t,o.value,i)}),n.on(o,"keydown",function(t){e&&e.onKeyDown&&e.onKeyDown(t,o.value,i)||((t.keyCode==27||e.closeOnEnter!==!1&&t.keyCode==13)&&(o.blur(),n.e_stop(t),i()),t.keyCode==13&&f(o.value,t))}),e.closeOnBlur!==!1&&n.on(a,"focusout",function(t){t.relatedTarget!==null&&i()})):(d=a.getElementsByTagName("button")[0])&&(n.on(d,"click",function(){i(),s.focus()}),e.closeOnBlur!==!1&&n.on(d,"blur",i),d.focus()),i}),n.defineExtension("openConfirm",function(u,f,e){c(this,null);var a=r(this,u,e&&e.bottom),l=a.getElementsByTagName("button"),s=!1,i=this,o=1;function d(){s||(s=!0,n.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),i.focus())}g(d,"close"),l[0].focus();for(var t=0;t<l.length;++t){var p=l[t];(function(N){n.on(p,"click",function(h){n.e_preventDefault(h),d(),N&&N(i)})})(f[t]),n.on(p,"blur",function(){--o,setTimeout(function(){o<=0&&d()},200)}),n.on(p,"focus",function(){++o})}}),n.defineExtension("openNotification",function(u,f){c(this,i);var e=r(this,u,f&&f.bottom),a=!1,l,s=f&&typeof f.duration<"u"?f.duration:5e3;function i(){a||(a=!0,clearTimeout(l),n.rmClass(e.parentNode,"dialog-opened"),e.parentNode.removeChild(e))}return g(i,"close"),n.on(e,"click",function(o){n.e_preventDefault(o),i()}),s&&(l=setTimeout(i,s)),i})})})();var y=T.exports;const x=b.getDefaultExportFromCjs(y),k=O({__proto__:null,default:x},[y]);exports.dialog=k;exports.dialogExports=y; | ||
//# sourceMappingURL=dialog.cjs.js.map |
@@ -1,15 +0,14 @@ | ||
var s = Object.defineProperty; | ||
var n = (e, o) => s(e, "name", { value: o, configurable: !0 }); | ||
import { g } from "./codemirror.es2.js"; | ||
import { r as l } from "./dialog.es2.js"; | ||
function c(e, o) { | ||
for (var a = 0; a < o.length; a++) { | ||
const r = o[a]; | ||
var h = Object.defineProperty; | ||
var g = (m, v) => h(m, "name", { value: v, configurable: !0 }); | ||
import { g as E, r as O } from "./codemirror.es2.js"; | ||
function T(m, v) { | ||
for (var n = 0; n < v.length; n++) { | ||
const r = v[n]; | ||
if (typeof r != "string" && !Array.isArray(r)) { | ||
for (const t in r) | ||
if (t !== "default" && !(t in e)) { | ||
const i = Object.getOwnPropertyDescriptor(r, t); | ||
i && Object.defineProperty(e, t, i.get ? i : { | ||
for (const c in r) | ||
if (c !== "default" && !(c in m)) { | ||
const i = Object.getOwnPropertyDescriptor(r, c); | ||
i && Object.defineProperty(m, c, i.get ? i : { | ||
enumerable: !0, | ||
get: () => r[t] | ||
get: () => r[c] | ||
}); | ||
@@ -19,13 +18,85 @@ } | ||
} | ||
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" })); | ||
return Object.freeze(Object.defineProperty(m, Symbol.toStringTag, { value: "Module" })); | ||
} | ||
n(c, "_mergeNamespaces"); | ||
var f = l(); | ||
const p = /* @__PURE__ */ g(f), y = /* @__PURE__ */ c({ | ||
g(T, "_mergeNamespaces"); | ||
var x = { exports: {} }; | ||
(function(m, v) { | ||
(function(n) { | ||
n(O()); | ||
})(function(n) { | ||
function r(i, f, e) { | ||
var o = i.getWrapperElement(), l; | ||
return l = o.appendChild(document.createElement("div")), e ? l.className = "CodeMirror-dialog CodeMirror-dialog-bottom" : l.className = "CodeMirror-dialog CodeMirror-dialog-top", typeof f == "string" ? l.innerHTML = f : l.appendChild(f), n.addClass(o, "dialog-opened"), l; | ||
} | ||
g(r, "dialogDiv"); | ||
function c(i, f) { | ||
i.state.currentNotificationClose && i.state.currentNotificationClose(), i.state.currentNotificationClose = f; | ||
} | ||
g(c, "closeNotification"), n.defineExtension("openDialog", function(i, f, e) { | ||
e || (e = {}), c(this, null); | ||
var o = r(this, i, e.bottom), l = !1, s = this; | ||
function u(t) { | ||
if (typeof t == "string") | ||
a.value = t; | ||
else { | ||
if (l) | ||
return; | ||
l = !0, n.rmClass(o.parentNode, "dialog-opened"), o.parentNode.removeChild(o), s.focus(), e.onClose && e.onClose(o); | ||
} | ||
} | ||
g(u, "close"); | ||
var a = o.getElementsByTagName("input")[0], d; | ||
return a ? (a.focus(), e.value && (a.value = e.value, e.selectValueOnOpen !== !1 && a.select()), e.onInput && n.on(a, "input", function(t) { | ||
e.onInput(t, a.value, u); | ||
}), e.onKeyUp && n.on(a, "keyup", function(t) { | ||
e.onKeyUp(t, a.value, u); | ||
}), n.on(a, "keydown", function(t) { | ||
e && e.onKeyDown && e.onKeyDown(t, a.value, u) || ((t.keyCode == 27 || e.closeOnEnter !== !1 && t.keyCode == 13) && (a.blur(), n.e_stop(t), u()), t.keyCode == 13 && f(a.value, t)); | ||
}), e.closeOnBlur !== !1 && n.on(o, "focusout", function(t) { | ||
t.relatedTarget !== null && u(); | ||
})) : (d = o.getElementsByTagName("button")[0]) && (n.on(d, "click", function() { | ||
u(), s.focus(); | ||
}), e.closeOnBlur !== !1 && n.on(d, "blur", u), d.focus()), u; | ||
}), n.defineExtension("openConfirm", function(i, f, e) { | ||
c(this, null); | ||
var o = r(this, i, e && e.bottom), l = o.getElementsByTagName("button"), s = !1, u = this, a = 1; | ||
function d() { | ||
s || (s = !0, n.rmClass(o.parentNode, "dialog-opened"), o.parentNode.removeChild(o), u.focus()); | ||
} | ||
g(d, "close"), l[0].focus(); | ||
for (var t = 0; t < l.length; ++t) { | ||
var p = l[t]; | ||
(function(y) { | ||
n.on(p, "click", function(b) { | ||
n.e_preventDefault(b), d(), y && y(u); | ||
}); | ||
})(f[t]), n.on(p, "blur", function() { | ||
--a, setTimeout(function() { | ||
a <= 0 && d(); | ||
}, 200); | ||
}), n.on(p, "focus", function() { | ||
++a; | ||
}); | ||
} | ||
}), n.defineExtension("openNotification", function(i, f) { | ||
c(this, u); | ||
var e = r(this, i, f && f.bottom), o = !1, l, s = f && typeof f.duration < "u" ? f.duration : 5e3; | ||
function u() { | ||
o || (o = !0, clearTimeout(l), n.rmClass(e.parentNode, "dialog-opened"), e.parentNode.removeChild(e)); | ||
} | ||
return g(u, "close"), n.on(e, "click", function(a) { | ||
n.e_preventDefault(a), u(); | ||
}), s && (l = setTimeout(u, s)), u; | ||
}); | ||
}); | ||
})(); | ||
var N = x.exports; | ||
const k = /* @__PURE__ */ E(N), j = /* @__PURE__ */ T({ | ||
__proto__: null, | ||
default: p | ||
}, [f]); | ||
default: k | ||
}, [N]); | ||
export { | ||
y as d | ||
N as a, | ||
j as d | ||
}; | ||
//# sourceMappingURL=dialog.es.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";var m=Object.defineProperty;var c=(u,p)=>m(u,"name",{value:p,configurable:!0});const f=require("./codemirror.cjs2.js"),g=require("./dialog.cjs2.js");function h(u,p){for(var o=0;o<p.length;o++){const s=p[o];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in u)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(u,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}c(h,"_mergeNamespaces");var b={exports:{}};(function(u,p){(function(o){o(f.requireCodemirror(),g.requireDialog())})(function(o){o.defineOption("search",{bottom:!1});function s(e,t,n,r,l){e.openDialog?e.openDialog(t,l,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):l(prompt(n,r))}c(s,"dialog");function i(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}c(i,"getJumpDialog");function a(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}c(a,"interpretLine"),o.commands.jumpToLine=function(e){var t=e.getCursor();s(e,i(e),e.phrase("Jump to line:"),t.line+1+":"+t.ch,function(n){if(n){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n))e.setCursor(a(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)){var l=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(l=t.line+l+1),e.setCursor(l-1,t.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n))&&e.setCursor(a(e,r[1]),t.ch)}})},o.keyMap.default["Alt-G"]="jumpToLine"})})();var d=b.exports;const j=f.getDefaultExportFromCjs(d),y=h({__proto__:null,default:j},[d]);exports.jumpToLine=y; | ||
"use strict";var m=Object.defineProperty;var c=(u,p)=>m(u,"name",{value:p,configurable:!0});const f=require("./codemirror.cjs2.js"),g=require("./dialog.cjs.js");function h(u,p){for(var o=0;o<p.length;o++){const s=p[o];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in u)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(u,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}c(h,"_mergeNamespaces");var b={exports:{}};(function(u,p){(function(o){o(f.requireCodemirror(),g.dialogExports)})(function(o){o.defineOption("search",{bottom:!1});function s(e,r,n,t,l){e.openDialog?e.openDialog(r,l,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):l(prompt(n,t))}c(s,"dialog");function i(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}c(i,"getJumpDialog");function a(e,r){var n=Number(r);return/^[-+]/.test(r)?e.getCursor().line+n:n-1}c(a,"interpretLine"),o.commands.jumpToLine=function(e){var r=e.getCursor();s(e,i(e),e.phrase("Jump to line:"),r.line+1+":"+r.ch,function(n){if(n){var t;if(t=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n))e.setCursor(a(e,t[1]),Number(t[2]));else if(t=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)){var l=Math.round(e.lineCount()*Number(t[1])/100);/^[-+]/.test(t[1])&&(l=r.line+l+1),e.setCursor(l-1,r.ch)}else(t=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n))&&e.setCursor(a(e,t[1]),r.ch)}})},o.keyMap.default["Alt-G"]="jumpToLine"})})();var d=b.exports;const j=f.getDefaultExportFromCjs(d),y=h({__proto__:null,default:j},[d]);exports.jumpToLine=y; | ||
//# sourceMappingURL=jump-to-line.cjs.js.map |
@@ -1,5 +0,5 @@ | ||
var m = Object.defineProperty; | ||
var f = (u, p) => m(u, "name", { value: p, configurable: !0 }); | ||
import { g as d, r as g } from "./codemirror.es2.js"; | ||
import { r as h } from "./dialog.es2.js"; | ||
var d = Object.defineProperty; | ||
var f = (u, p) => d(u, "name", { value: p, configurable: !0 }); | ||
import { g as m, r as g } from "./codemirror.es2.js"; | ||
import { a as h } from "./dialog.es.js"; | ||
function b(u, p) { | ||
@@ -25,7 +25,7 @@ for (var o = 0; o < p.length; o++) { | ||
(function(o) { | ||
o(g(), h()); | ||
o(g(), h); | ||
})(function(o) { | ||
o.defineOption("search", { bottom: !1 }); | ||
function s(e, t, n, r, l) { | ||
e.openDialog ? e.openDialog(t, l, { value: r, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : l(prompt(n, r)); | ||
function s(e, r, n, t, l) { | ||
e.openDialog ? e.openDialog(r, l, { value: t, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : l(prompt(n, t)); | ||
} | ||
@@ -37,18 +37,18 @@ f(s, "dialog"); | ||
f(i, "getJumpDialog"); | ||
function a(e, t) { | ||
var n = Number(t); | ||
return /^[-+]/.test(t) ? e.getCursor().line + n : n - 1; | ||
function a(e, r) { | ||
var n = Number(r); | ||
return /^[-+]/.test(r) ? e.getCursor().line + n : n - 1; | ||
} | ||
f(a, "interpretLine"), o.commands.jumpToLine = function(e) { | ||
var t = e.getCursor(); | ||
s(e, i(e), e.phrase("Jump to line:"), t.line + 1 + ":" + t.ch, function(n) { | ||
var r = e.getCursor(); | ||
s(e, i(e), e.phrase("Jump to line:"), r.line + 1 + ":" + r.ch, function(n) { | ||
if (n) { | ||
var r; | ||
if (r = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) | ||
e.setCursor(a(e, r[1]), Number(r[2])); | ||
else if (r = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { | ||
var l = Math.round(e.lineCount() * Number(r[1]) / 100); | ||
/^[-+]/.test(r[1]) && (l = t.line + l + 1), e.setCursor(l - 1, t.ch); | ||
var t; | ||
if (t = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) | ||
e.setCursor(a(e, t[1]), Number(t[2])); | ||
else if (t = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { | ||
var l = Math.round(e.lineCount() * Number(t[1]) / 100); | ||
/^[-+]/.test(t[1]) && (l = r.line + l + 1), e.setCursor(l - 1, r.ch); | ||
} else | ||
(r = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, r[1]), t.ch); | ||
(t = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, t[1]), r.ch); | ||
} | ||
@@ -60,5 +60,5 @@ }); | ||
var c = j.exports; | ||
const y = /* @__PURE__ */ d(c), O = /* @__PURE__ */ b({ | ||
const x = /* @__PURE__ */ m(c), O = /* @__PURE__ */ b({ | ||
__proto__: null, | ||
default: y | ||
default: x | ||
}, [c]); | ||
@@ -65,0 +65,0 @@ export { |
@@ -1,3 +0,3 @@ | ||
"use strict";var K=Object.defineProperty;var a=(S,O)=>K(S,"name",{value:O,configurable:!0});const Q=require("./codemirror.cjs2.js"),L=require("./searchcursor.cjs2.js"),z=require("./dialog.cjs2.js");function U(S,O){for(var i=0;i<O.length;i++){const y=O[i];if(typeof y!="string"&&!Array.isArray(y)){for(const v in y)if(v!=="default"&&!(v in S)){const h=Object.getOwnPropertyDescriptor(y,v);h&&Object.defineProperty(S,v,h.get?h:{enumerable:!0,get:()=>y[v]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}a(U,"_mergeNamespaces");var B={exports:{}};(function(S,O){(function(i){i(Q.requireCodemirror(),L.requireSearchcursor(),z.requireDialog())})(function(i){i.defineOption("search",{bottom:!1});function y(e,n){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var o=e.exec(t.string);if(o&&o.index==t.pos)return t.pos+=o[0].length||1,"searching";o?t.pos=o.index:t.skipToEnd()}}}a(y,"searchOverlay");function v(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}a(v,"SearchState");function h(e){return e.state.search||(e.state.search=new v)}a(h,"getSearchState");function m(e){return typeof e=="string"&&e==e.toLowerCase()}a(m,"queryCaseInsensitive");function N(e,n,t){return e.getSearchCursor(n,t,{caseFold:m(n),multiline:!0})}a(N,"getSearchCursor");function j(e,n,t,o,r){e.openDialog(n,o,{value:t,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){w(e)},onKeyDown:r,bottom:e.options.search.bottom})}a(j,"persistentDialog");function R(e,n,t,o,r){e.openDialog?e.openDialog(n,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(t,o))}a(R,"dialog");function k(e,n,t,o){e.openConfirm?e.openConfirm(n,o):confirm(t)&&o[0]()}a(k,"confirmDialog");function C(e){return e.replace(/\\([nrt\\])/g,function(n,t){return t=="n"?` | ||
`:t=="r"?"\r":t=="t"?" ":t=="\\"?"\\":n})}a(C,"parseString");function T(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],n[2].indexOf("i")==-1?"":"i")}catch{}else e=C(e);return(typeof e=="string"?e=="":e.test(""))&&(e=/x^/),e}a(T,"parseQuery");function D(e,n,t){n.queryText=t,n.query=T(t),e.removeOverlay(n.overlay,m(n.query)),n.overlay=y(n.query,m(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,m(n.query)))}a(D,"startSearch");function b(e,n,t,o){var r=h(e);if(r.query)return P(e,n);var s=e.getSelection()||r.lastQuery;if(s instanceof RegExp&&s.source=="x^"&&(s=null),t&&e.openDialog){var c=null,u=a(function(f,x){i.e_stop(x),f&&(f!=r.queryText&&(D(e,r,f),r.posFrom=r.posTo=e.getCursor()),c&&(c.style.opacity=1),P(e,x.shiftKey,function(d,g){var p;g.line<3&&document.querySelector&&(p=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&p.getBoundingClientRect().bottom-4>e.cursorCoords(g,"window").top&&((c=p).style.opacity=.4)}))},"searchNext");j(e,_(e),s,u,function(f,x){var d=i.keyName(f),g=e.getOption("extraKeys"),p=g&&g[d]||i.keyMap[e.getOption("keyMap")][d];p=="findNext"||p=="findPrev"||p=="findPersistentNext"||p=="findPersistentPrev"?(i.e_stop(f),D(e,h(e),x),e.execCommand(p)):(p=="find"||p=="findPersistent")&&(i.e_stop(f),u(x,f))}),o&&s&&(D(e,r,s),P(e,n))}else R(e,_(e),"Search for:",s,function(f){f&&!r.query&&e.operation(function(){D(e,r,f),r.posFrom=r.posTo=e.getCursor(),P(e,n)})})}a(b,"doSearch");function P(e,n,t){e.operation(function(){var o=h(e),r=N(e,o.query,n?o.posFrom:o.posTo);!r.find(n)&&(r=N(e,o.query,n?i.Pos(e.lastLine()):i.Pos(e.firstLine(),0)),!r.find(n))||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()},20),o.posFrom=r.from(),o.posTo=r.to(),t&&t(r.from(),r.to()))})}a(P,"findNext");function w(e){e.operation(function(){var n=h(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))})}a(w,"clearSearch");function l(e,n){var t=e?document.createElement(e):document.createDocumentFragment();for(var o in n)t[o]=n[o];for(var r=2;r<arguments.length;r++){var s=arguments[r];t.appendChild(typeof s=="string"?document.createTextNode(s):s)}return t}a(l,"el");function _(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Search:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}a(_,"getQueryDialog");function A(e){return l("",null," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}a(A,"getReplaceQueryDialog");function I(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}a(I,"getReplacementQueryDialog");function V(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",l("button",{},e.phrase("Yes"))," ",l("button",{},e.phrase("No"))," ",l("button",{},e.phrase("All"))," ",l("button",{},e.phrase("Stop")))}a(V,"getDoReplaceConfirm");function E(e,n,t){e.operation(function(){for(var o=N(e,n);o.findNext();)if(typeof n!="string"){var r=e.getRange(o.from(),o.to()).match(n);o.replace(t.replace(/\$(\d)/g,function(s,c){return r[c]}))}else o.replace(t)})}a(E,"replaceAll");function F(e,n){if(!e.getOption("readOnly")){var t=e.getSelection()||h(e).lastQuery,o=n?e.phrase("Replace all:"):e.phrase("Replace:"),r=l("",null,l("span",{className:"CodeMirror-search-label"},o),A(e));R(e,r,o,t,function(s){s&&(s=T(s),R(e,I(e),e.phrase("Replace with:"),"",function(c){if(c=C(c),n)E(e,s,c);else{w(e);var u=N(e,s,e.getCursor("from")),f=a(function(){var d=u.from(),g;!(g=u.findNext())&&(u=N(e,s),!(g=u.findNext())||d&&u.from().line==d.line&&u.from().ch==d.ch)||(e.setSelection(u.from(),u.to()),e.scrollIntoView({from:u.from(),to:u.to()}),k(e,V(e),e.phrase("Replace?"),[function(){x(g)},f,function(){E(e,s,c)}]))},"advance"),x=a(function(d){u.replace(typeof s=="string"?c:c.replace(/\$(\d)/g,function(g,p){return d[p]})),f()},"doReplace");f()}}))})}}a(F,"replace"),i.commands.find=function(e){w(e),b(e)},i.commands.findPersistent=function(e){w(e),b(e,!1,!0)},i.commands.findPersistentNext=function(e){b(e,!1,!0,!0)},i.commands.findPersistentPrev=function(e){b(e,!0,!0,!0)},i.commands.findNext=b,i.commands.findPrev=function(e){b(e,!0)},i.commands.clearSearch=w,i.commands.replace=F,i.commands.replaceAll=function(e){F(e,!0)}})})();var $=B.exports;const W=Q.getDefaultExportFromCjs($),Y=U({__proto__:null,default:W},[$]);exports.search=Y; | ||
"use strict";var K=Object.defineProperty;var a=(S,O)=>K(S,"name",{value:O,configurable:!0});const Q=require("./codemirror.cjs2.js"),L=require("./searchcursor.cjs2.js"),z=require("./dialog.cjs.js");function U(S,O){for(var i=0;i<O.length;i++){const y=O[i];if(typeof y!="string"&&!Array.isArray(y)){for(const v in y)if(v!=="default"&&!(v in S)){const h=Object.getOwnPropertyDescriptor(y,v);h&&Object.defineProperty(S,v,h.get?h:{enumerable:!0,get:()=>y[v]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}a(U,"_mergeNamespaces");var B={exports:{}};(function(S,O){(function(i){i(Q.requireCodemirror(),L.requireSearchcursor(),z.dialogExports)})(function(i){i.defineOption("search",{bottom:!1});function y(e,n){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var o=e.exec(t.string);if(o&&o.index==t.pos)return t.pos+=o[0].length||1,"searching";o?t.pos=o.index:t.skipToEnd()}}}a(y,"searchOverlay");function v(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}a(v,"SearchState");function h(e){return e.state.search||(e.state.search=new v)}a(h,"getSearchState");function m(e){return typeof e=="string"&&e==e.toLowerCase()}a(m,"queryCaseInsensitive");function N(e,n,t){return e.getSearchCursor(n,t,{caseFold:m(n),multiline:!0})}a(N,"getSearchCursor");function j(e,n,t,o,r){e.openDialog(n,o,{value:t,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){w(e)},onKeyDown:r,bottom:e.options.search.bottom})}a(j,"persistentDialog");function D(e,n,t,o,r){e.openDialog?e.openDialog(n,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(t,o))}a(D,"dialog");function k(e,n,t,o){e.openConfirm?e.openConfirm(n,o):confirm(t)&&o[0]()}a(k,"confirmDialog");function C(e){return e.replace(/\\([nrt\\])/g,function(n,t){return t=="n"?` | ||
`:t=="r"?"\r":t=="t"?" ":t=="\\"?"\\":n})}a(C,"parseString");function T(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],n[2].indexOf("i")==-1?"":"i")}catch{}else e=C(e);return(typeof e=="string"?e=="":e.test(""))&&(e=/x^/),e}a(T,"parseQuery");function P(e,n,t){n.queryText=t,n.query=T(t),e.removeOverlay(n.overlay,m(n.query)),n.overlay=y(n.query,m(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,m(n.query)))}a(P,"startSearch");function b(e,n,t,o){var r=h(e);if(r.query)return R(e,n);var s=e.getSelection()||r.lastQuery;if(s instanceof RegExp&&s.source=="x^"&&(s=null),t&&e.openDialog){var c=null,u=a(function(f,x){i.e_stop(x),f&&(f!=r.queryText&&(P(e,r,f),r.posFrom=r.posTo=e.getCursor()),c&&(c.style.opacity=1),R(e,x.shiftKey,function(d,g){var p;g.line<3&&document.querySelector&&(p=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&p.getBoundingClientRect().bottom-4>e.cursorCoords(g,"window").top&&((c=p).style.opacity=.4)}))},"searchNext");j(e,E(e),s,u,function(f,x){var d=i.keyName(f),g=e.getOption("extraKeys"),p=g&&g[d]||i.keyMap[e.getOption("keyMap")][d];p=="findNext"||p=="findPrev"||p=="findPersistentNext"||p=="findPersistentPrev"?(i.e_stop(f),P(e,h(e),x),e.execCommand(p)):(p=="find"||p=="findPersistent")&&(i.e_stop(f),u(x,f))}),o&&s&&(P(e,r,s),R(e,n))}else D(e,E(e),"Search for:",s,function(f){f&&!r.query&&e.operation(function(){P(e,r,f),r.posFrom=r.posTo=e.getCursor(),R(e,n)})})}a(b,"doSearch");function R(e,n,t){e.operation(function(){var o=h(e),r=N(e,o.query,n?o.posFrom:o.posTo);!r.find(n)&&(r=N(e,o.query,n?i.Pos(e.lastLine()):i.Pos(e.firstLine(),0)),!r.find(n))||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()},20),o.posFrom=r.from(),o.posTo=r.to(),t&&t(r.from(),r.to()))})}a(R,"findNext");function w(e){e.operation(function(){var n=h(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))})}a(w,"clearSearch");function l(e,n){var t=e?document.createElement(e):document.createDocumentFragment();for(var o in n)t[o]=n[o];for(var r=2;r<arguments.length;r++){var s=arguments[r];t.appendChild(typeof s=="string"?document.createTextNode(s):s)}return t}a(l,"el");function E(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Search:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}a(E,"getQueryDialog");function A(e){return l("",null," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",l("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}a(A,"getReplaceQueryDialog");function I(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",l("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}a(I,"getReplacementQueryDialog");function V(e){return l("",null,l("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",l("button",{},e.phrase("Yes"))," ",l("button",{},e.phrase("No"))," ",l("button",{},e.phrase("All"))," ",l("button",{},e.phrase("Stop")))}a(V,"getDoReplaceConfirm");function _(e,n,t){e.operation(function(){for(var o=N(e,n);o.findNext();)if(typeof n!="string"){var r=e.getRange(o.from(),o.to()).match(n);o.replace(t.replace(/\$(\d)/g,function(s,c){return r[c]}))}else o.replace(t)})}a(_,"replaceAll");function F(e,n){if(!e.getOption("readOnly")){var t=e.getSelection()||h(e).lastQuery,o=n?e.phrase("Replace all:"):e.phrase("Replace:"),r=l("",null,l("span",{className:"CodeMirror-search-label"},o),A(e));D(e,r,o,t,function(s){s&&(s=T(s),D(e,I(e),e.phrase("Replace with:"),"",function(c){if(c=C(c),n)_(e,s,c);else{w(e);var u=N(e,s,e.getCursor("from")),f=a(function(){var d=u.from(),g;!(g=u.findNext())&&(u=N(e,s),!(g=u.findNext())||d&&u.from().line==d.line&&u.from().ch==d.ch)||(e.setSelection(u.from(),u.to()),e.scrollIntoView({from:u.from(),to:u.to()}),k(e,V(e),e.phrase("Replace?"),[function(){x(g)},f,function(){_(e,s,c)}]))},"advance"),x=a(function(d){u.replace(typeof s=="string"?c:c.replace(/\$(\d)/g,function(g,p){return d[p]})),f()},"doReplace");f()}}))})}}a(F,"replace"),i.commands.find=function(e){w(e),b(e)},i.commands.findPersistent=function(e){w(e),b(e,!1,!0)},i.commands.findPersistentNext=function(e){b(e,!1,!0,!0)},i.commands.findPersistentPrev=function(e){b(e,!0,!0,!0)},i.commands.findNext=b,i.commands.findPrev=function(e){b(e,!0)},i.commands.clearSearch=w,i.commands.replace=F,i.commands.replaceAll=function(e){F(e,!0)}})})();var $=B.exports;const W=Q.getDefaultExportFromCjs($),Y=U({__proto__:null,default:W},[$]);exports.search=Y; | ||
//# sourceMappingURL=search.cjs.js.map |
@@ -5,3 +5,3 @@ var V = Object.defineProperty; | ||
import { r as z } from "./searchcursor.es2.js"; | ||
import { r as U } from "./dialog.es2.js"; | ||
import { a as U } from "./dialog.es.js"; | ||
function B(S, O) { | ||
@@ -27,3 +27,3 @@ for (var i = 0; i < O.length; i++) { | ||
(function(i) { | ||
i(L(), z(), U()); | ||
i(L(), z(), U); | ||
})(function(i) { | ||
@@ -70,6 +70,6 @@ i.defineOption("search", { bottom: !1 }); | ||
a($, "persistentDialog"); | ||
function R(e, n, t, r, o) { | ||
function D(e, n, t, r, o) { | ||
e.openDialog ? e.openDialog(n, o, { value: r, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : o(prompt(t, r)); | ||
} | ||
a(R, "dialog"); | ||
a(D, "dialog"); | ||
function j(e, n, t, r) { | ||
@@ -98,14 +98,14 @@ e.openConfirm ? e.openConfirm(n, r) : confirm(t) && r[0](); | ||
a(T, "parseQuery"); | ||
function D(e, n, t) { | ||
function P(e, n, t) { | ||
n.queryText = t, n.query = T(t), e.removeOverlay(n.overlay, w(n.query)), n.overlay = y(n.query, w(n.query)), e.addOverlay(n.overlay), e.showMatchesOnScrollbar && (n.annotate && (n.annotate.clear(), n.annotate = null), n.annotate = e.showMatchesOnScrollbar(n.query, w(n.query))); | ||
} | ||
a(D, "startSearch"); | ||
a(P, "startSearch"); | ||
function b(e, n, t, r) { | ||
var o = h(e); | ||
if (o.query) | ||
return P(e, n); | ||
return R(e, n); | ||
var s = e.getSelection() || o.lastQuery; | ||
if (s instanceof RegExp && s.source == "x^" && (s = null), t && e.openDialog) { | ||
var c = null, p = /* @__PURE__ */ a(function(f, x) { | ||
i.e_stop(x), f && (f != o.queryText && (D(e, o, f), o.posFrom = o.posTo = e.getCursor()), c && (c.style.opacity = 1), P(e, x.shiftKey, function(d, g) { | ||
i.e_stop(x), f && (f != o.queryText && (P(e, o, f), o.posFrom = o.posTo = e.getCursor()), c && (c.style.opacity = 1), R(e, x.shiftKey, function(d, g) { | ||
var u; | ||
@@ -115,10 +115,10 @@ g.line < 3 && document.querySelector && (u = e.display.wrapper.querySelector(".CodeMirror-dialog")) && u.getBoundingClientRect().bottom - 4 > e.cursorCoords(g, "window").top && ((c = u).style.opacity = 0.4); | ||
}, "searchNext"); | ||
$(e, _(e), s, p, function(f, x) { | ||
$(e, E(e), s, p, function(f, x) { | ||
var d = i.keyName(f), g = e.getOption("extraKeys"), u = g && g[d] || i.keyMap[e.getOption("keyMap")][d]; | ||
u == "findNext" || u == "findPrev" || u == "findPersistentNext" || u == "findPersistentPrev" ? (i.e_stop(f), D(e, h(e), x), e.execCommand(u)) : (u == "find" || u == "findPersistent") && (i.e_stop(f), p(x, f)); | ||
}), r && s && (D(e, o, s), P(e, n)); | ||
u == "findNext" || u == "findPrev" || u == "findPersistentNext" || u == "findPersistentPrev" ? (i.e_stop(f), P(e, h(e), x), e.execCommand(u)) : (u == "find" || u == "findPersistent") && (i.e_stop(f), p(x, f)); | ||
}), r && s && (P(e, o, s), R(e, n)); | ||
} else | ||
R(e, _(e), "Search for:", s, function(f) { | ||
D(e, E(e), "Search for:", s, function(f) { | ||
f && !o.query && e.operation(function() { | ||
D(e, o, f), o.posFrom = o.posTo = e.getCursor(), P(e, n); | ||
P(e, o, f), o.posFrom = o.posTo = e.getCursor(), R(e, n); | ||
}); | ||
@@ -128,3 +128,3 @@ }); | ||
a(b, "doSearch"); | ||
function P(e, n, t) { | ||
function R(e, n, t) { | ||
e.operation(function() { | ||
@@ -135,3 +135,3 @@ var r = h(e), o = m(e, r.query, n ? r.posFrom : r.posTo); | ||
} | ||
a(P, "findNext"); | ||
a(R, "findNext"); | ||
function N(e) { | ||
@@ -155,3 +155,3 @@ e.operation(function() { | ||
a(l, "el"); | ||
function _(e) { | ||
function E(e) { | ||
return l( | ||
@@ -171,3 +171,3 @@ "", | ||
} | ||
a(_, "getQueryDialog"); | ||
a(E, "getQueryDialog"); | ||
function k(e) { | ||
@@ -214,3 +214,3 @@ return l( | ||
a(I, "getDoReplaceConfirm"); | ||
function E(e, n, t) { | ||
function _(e, n, t) { | ||
e.operation(function() { | ||
@@ -227,3 +227,3 @@ for (var r = m(e, n); r.findNext(); ) | ||
} | ||
a(E, "replaceAll"); | ||
a(_, "replaceAll"); | ||
function F(e, n) { | ||
@@ -237,6 +237,6 @@ if (!e.getOption("readOnly")) { | ||
); | ||
R(e, o, r, t, function(s) { | ||
s && (s = T(s), R(e, A(e), e.phrase("Replace with:"), "", function(c) { | ||
D(e, o, r, t, function(s) { | ||
s && (s = T(s), D(e, A(e), e.phrase("Replace with:"), "", function(c) { | ||
if (c = C(c), n) | ||
E(e, s, c); | ||
_(e, s, c); | ||
else { | ||
@@ -256,3 +256,3 @@ N(e); | ||
function() { | ||
E(e, s, c); | ||
_(e, s, c); | ||
} | ||
@@ -259,0 +259,0 @@ ] |
{ | ||
"name": "@graphiql/react", | ||
"version": "0.22.2-canary-0dd016c7.0", | ||
"version": "0.23.0-canary-1fdb7e38.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
export { HeaderEditor } from './header-editor'; | ||
export { ImagePreview } from './image-preview'; | ||
export { IncrementsEditors } from './increments-editors'; | ||
export { QueryEditor } from './query-editor'; | ||
export { ResponseEditor } from './response-editor'; | ||
export { VariableEditor } from './variable-editor'; | ||
export type { IncrementsEditorsProps } from './increments-editors'; |
export { | ||
HeaderEditor, | ||
ImagePreview, | ||
IncrementsEditors, | ||
QueryEditor, | ||
@@ -29,2 +30,3 @@ ResponseEditor, | ||
export type { IncrementsEditorsProps } from './components'; | ||
export type { EditorContextType, EditorContextProviderProps } from './context'; | ||
@@ -37,5 +39,5 @@ export type { UseHeaderEditorArgs } from './header-editor'; | ||
} from './response-editor'; | ||
export type { TabsState } from './tabs'; | ||
export type { IncrementalPayload, TabsState } from './tabs'; | ||
export type { UseVariableEditorArgs } from './variable-editor'; | ||
export type { CommonEditorProps, KeyMap, WriteableEditorProps } from './types'; |
import { StorageAPI } from '@graphiql/toolkit'; | ||
import { ExecutionResult } from 'graphql'; | ||
import { useCallback, useMemo } from 'react'; | ||
import debounce from '../utility/debounce'; | ||
import { IncrementalResult } from '../utility/incremental'; | ||
import { CodeMirrorEditorWithOperationFacts } from './context'; | ||
@@ -50,4 +52,25 @@ import { CodeMirrorEditor } from './types'; | ||
response: string | null; | ||
/** | ||
* While being subscribed to a multi-part request (subscription, defer, | ||
* stream, etc.) this list will accumulate all incremental results received | ||
* from the server, including a client-generated timestamp for when the | ||
* increment was received. Each time a new request starts to run, this list | ||
* will be cleared. | ||
*/ | ||
incrementalPayloads?: IncrementalPayload[] | null; | ||
}; | ||
export type IncrementalPayload = { | ||
/** | ||
* The number of milliseconds that went by between sending the request and | ||
* receiving this increment. | ||
*/ | ||
timing: number; | ||
/** | ||
* The execution result (for subscriptions), or the list of incremental | ||
* results (for @defer/@stream). | ||
*/ | ||
payload: ExecutionResult | IncrementalResult[]; | ||
}; | ||
/** | ||
@@ -129,2 +152,3 @@ * This object describes the state of all tabs. | ||
response: null, | ||
incrementalPayloads: [], | ||
}); | ||
@@ -177,3 +201,4 @@ parsed.activeTabIndex = parsed.tabs.length - 1; | ||
hasStringOrNullKey(obj, 'operationName') && | ||
hasStringOrNullKey(obj, 'response') | ||
hasStringOrNullKey(obj, 'response') && | ||
hasIncrementalPayloads(obj) | ||
); | ||
@@ -194,2 +219,27 @@ } | ||
function hasIncrementalPayloads(obj: Record<string, any>) { | ||
const { incrementalPayloads } = obj; | ||
// Not having any values is fine | ||
if (incrementalPayloads === undefined || incrementalPayloads === null) { | ||
return true; | ||
} | ||
// Anything other than an array is bad | ||
if (!Array.isArray(incrementalPayloads)) { | ||
return false; | ||
} | ||
return incrementalPayloads.every( | ||
item => | ||
item && | ||
typeof item === 'object' && | ||
'timing' in item && | ||
typeof item.timing === 'number' && | ||
'payload' in item && | ||
item.payload && | ||
typeof item.payload === 'object', | ||
); | ||
} | ||
export function useSynchronizeActiveTabValues({ | ||
@@ -232,2 +282,3 @@ queryEditor, | ||
key === 'response' || | ||
key === 'incrementalPayloads' || | ||
(!shouldPersistHeaders && key === 'headers') | ||
@@ -307,2 +358,3 @@ ? null | ||
response: null, | ||
incrementalPayloads: [], | ||
}; | ||
@@ -309,0 +361,0 @@ } |
@@ -8,2 +8,3 @@ import './style/root.css'; | ||
ImagePreview, | ||
IncrementsEditors, | ||
QueryEditor, | ||
@@ -84,2 +85,4 @@ ResponseEditor, | ||
EditorContextType, | ||
IncrementalPayload, | ||
IncrementsEditorsProps, | ||
KeyMap, | ||
@@ -121,1 +124,2 @@ ResponseTooltipType, | ||
export type { Theme } from './theme'; | ||
export type { IncrementalResult } from './utility/incremental'; |
export { HeaderEditor } from './header-editor'; | ||
export { ImagePreview } from './image-preview'; | ||
export { IncrementsEditors } from './increments-editors'; | ||
export { QueryEditor } from './query-editor'; | ||
export { ResponseEditor } from './response-editor'; | ||
export { VariableEditor } from './variable-editor'; | ||
export type { IncrementsEditorsProps } from './increments-editors'; |
@@ -1,2 +0,2 @@ | ||
export { HeaderEditor, ImagePreview, QueryEditor, ResponseEditor, VariableEditor, } from './components'; | ||
export { HeaderEditor, ImagePreview, IncrementsEditors, QueryEditor, ResponseEditor, VariableEditor, } from './components'; | ||
export { EditorContext, EditorContextProvider, useEditorContext, } from './context'; | ||
@@ -8,2 +8,3 @@ export { useHeaderEditor } from './header-editor'; | ||
export { useVariableEditor } from './variable-editor'; | ||
export type { IncrementsEditorsProps } from './components'; | ||
export type { EditorContextType, EditorContextProviderProps } from './context'; | ||
@@ -13,4 +14,4 @@ export type { UseHeaderEditorArgs } from './header-editor'; | ||
export type { ResponseTooltipType, UseResponseEditorArgs, } from './response-editor'; | ||
export type { TabsState } from './tabs'; | ||
export type { IncrementalPayload, TabsState } from './tabs'; | ||
export type { UseVariableEditorArgs } from './variable-editor'; | ||
export type { CommonEditorProps, KeyMap, WriteableEditorProps } from './types'; |
import { StorageAPI } from '@graphiql/toolkit'; | ||
import { ExecutionResult } from 'graphql'; | ||
import { IncrementalResult } from '../utility/incremental'; | ||
import { CodeMirrorEditorWithOperationFacts } from './context'; | ||
@@ -45,3 +47,23 @@ import { CodeMirrorEditor } from './types'; | ||
response: string | null; | ||
/** | ||
* While being subscribed to a multi-part request (subscription, defer, | ||
* stream, etc.) this list will accumulate all incremental results received | ||
* from the server, including a client-generated timestamp for when the | ||
* increment was received. Each time a new request starts to run, this list | ||
* will be cleared. | ||
*/ | ||
incrementalPayloads?: IncrementalPayload[] | null; | ||
}; | ||
export declare type IncrementalPayload = { | ||
/** | ||
* The number of milliseconds that went by between sending the request and | ||
* receiving this increment. | ||
*/ | ||
timing: number; | ||
/** | ||
* The execution result (for subscriptions), or the list of incremental | ||
* results (for @defer/@stream). | ||
*/ | ||
payload: ExecutionResult | IncrementalResult[]; | ||
}; | ||
/** | ||
@@ -48,0 +70,0 @@ * This object describes the state of all tabs. |
@@ -13,4 +13,5 @@ import { Fetcher } from '@graphiql/toolkit'; | ||
* If there is currently a GraphQL request in-flight. For multi-part | ||
* requests like subscriptions, this will be `true` until the last batch | ||
* has been fetched or the connection is closed from the client. | ||
* requests (subscriptions, defer, stream, etc.), this will be `true` until | ||
* the last batch has been fetched or the connection is closed from the | ||
* client. | ||
*/ | ||
@@ -17,0 +18,0 @@ isSubscribed: boolean; |
import './style/root.css'; | ||
export { EditorContext, EditorContextProvider, HeaderEditor, ImagePreview, QueryEditor, ResponseEditor, useAutoCompleteLeafs, useCopyQuery, useEditorContext, useHeaderEditor, useMergeQuery, usePrettifyEditors, useQueryEditor, useResponseEditor, useVariableEditor, useEditorState, useOperationsEditorState, useOptimisticState, useVariablesEditorState, useHeadersEditorState, VariableEditor, } from './editor'; | ||
export { EditorContext, EditorContextProvider, HeaderEditor, ImagePreview, IncrementsEditors, QueryEditor, ResponseEditor, useAutoCompleteLeafs, useCopyQuery, useEditorContext, useHeaderEditor, useMergeQuery, usePrettifyEditors, useQueryEditor, useResponseEditor, useVariableEditor, useEditorState, useOperationsEditorState, useOptimisticState, useVariablesEditorState, useHeadersEditorState, VariableEditor, } from './editor'; | ||
export { ExecutionContext, ExecutionContextProvider, useExecutionContext, } from './execution'; | ||
@@ -15,3 +15,3 @@ export { Argument, DefaultValue, DeprecationReason, Directive, DocExplorer, ExplorerContext, ExplorerContextProvider, ExplorerSection, FieldDocumentation, FieldLink, SchemaDocumentation, Search, TypeDocumentation, TypeLink, useExplorerContext, } from './explorer'; | ||
export * from './toolbar'; | ||
export type { CommonEditorProps, EditorContextProviderProps, EditorContextType, KeyMap, ResponseTooltipType, TabsState, UseHeaderEditorArgs, UseQueryEditorArgs, UseResponseEditorArgs, UseVariableEditorArgs, WriteableEditorProps, } from './editor'; | ||
export type { CommonEditorProps, EditorContextProviderProps, EditorContextType, IncrementalPayload, IncrementsEditorsProps, KeyMap, ResponseTooltipType, TabsState, UseHeaderEditorArgs, UseQueryEditorArgs, UseResponseEditorArgs, UseVariableEditorArgs, WriteableEditorProps, } from './editor'; | ||
export type { ExecutionContextProviderProps, ExecutionContextType, } from './execution'; | ||
@@ -25,1 +25,2 @@ export type { ExplorerContextProviderProps, ExplorerContextType, ExplorerFieldDef, ExplorerNavStack, ExplorerNavStackItem, } from './explorer'; | ||
export type { Theme } from './theme'; | ||
export type { IncrementalResult } from './utility/incremental'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
4659885
341
28872
29