chore: merge hoppscotch/patch into hoppscotch/next

This commit is contained in:
Andrew Bastin
2024-06-24 16:09:12 +05:30
6 changed files with 18 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@hoppscotch/cli", "name": "@hoppscotch/cli",
"version": "0.8.0", "version": "0.8.1",
"description": "A CLI to run Hoppscotch test scripts in CI environments.", "description": "A CLI to run Hoppscotch test scripts in CI environments.",
"homepage": "https://hoppscotch.io", "homepage": "https://hoppscotch.io",
"type": "module", "type": "module",

View File

@@ -119,10 +119,11 @@
/> />
</div> </div>
</div> </div>
<div class="h-full"> <div class="h-full relative overflow-auto">
<div <div
ref="jsonResponse" ref="jsonResponse"
:class="toggleFilter ? 'responseToggleOn' : 'responseToggleOff'" :class="toggleFilter ? 'responseToggleOn' : 'responseToggleOff'"
class="absolute inset-0 h-full"
></div> ></div>
</div> </div>
<div <div

View File

@@ -35,8 +35,8 @@
/> />
</div> </div>
</div> </div>
<div class="h-full"> <div class="h-full relative overflow-auto">
<div ref="rawResponse" class="flex flex-1 flex-col"></div> <div ref="rawResponse" class="absolute inset-0"></div>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -330,7 +330,10 @@ export function useCodemirror(
), ),
EditorView.domEventHandlers({ EditorView.domEventHandlers({
scroll(event) { scroll(event, view) {
// HACK: This is a workaround to fix the issue in CodeMirror where the content doesn't load when the editor is not in view.
view.requestMeasure()
if (event.target && options.contextMenuEnabled) { if (event.target && options.contextMenuEnabled) {
// Debounce to make the performance better // Debounce to make the performance better
debouncedTextSelection(30)() debouncedTextSelection(30)()

View File

@@ -59,6 +59,7 @@ export const baseTheme = EditorView.theme({
backgroundColor: "var(--accent-dark-color)", backgroundColor: "var(--accent-dark-color)",
color: "var(--accent-contrast-color)", color: "var(--accent-contrast-color)",
borderRadius: "2px", borderRadius: "2px",
opacity: "0.4",
}, },
".cm-panels": { ".cm-panels": {
backgroundColor: "var(--primary-light-color)", backgroundColor: "var(--primary-light-color)",

View File

@@ -48,8 +48,13 @@ const parseInsomniaDoc = (content: string) =>
const replacePathVarTemplating = (expression: string) => const replacePathVarTemplating = (expression: string) =>
expression.replaceAll(/:([^/]+)/g, "<<$1>>") expression.replaceAll(/:([^/]+)/g, "<<$1>>")
const replaceVarTemplating = (expression: string) => const replaceVarTemplating = (expression: string, pathVar = false) => {
pipe(expression, replacePathVarTemplating, replaceInsomniaTemplating) return pipe(
expression,
pathVar ? replacePathVarTemplating : (x) => x,
replaceInsomniaTemplating
)
}
const getFoldersIn = ( const getFoldersIn = (
folder: InsomniaFolderResource | null, folder: InsomniaFolderResource | null,
@@ -208,7 +213,7 @@ const getHoppRequest = (req: InsomniaRequestResource): HoppRESTRequest =>
makeRESTRequest({ makeRESTRequest({
name: req.name ?? "Untitled Request", name: req.name ?? "Untitled Request",
method: req.method?.toUpperCase() ?? "GET", method: req.method?.toUpperCase() ?? "GET",
endpoint: replaceVarTemplating(req.url ?? ""), endpoint: replaceVarTemplating(req.url ?? "", true),
auth: getHoppReqAuth(req), auth: getHoppReqAuth(req),
body: getHoppReqBody(req), body: getHoppReqBody(req),
headers: getHoppReqHeaders(req), headers: getHoppReqHeaders(req),