@scalar/pre-post-request-scripts 0.4.12 → 0.4.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 +34 -0
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.d.ts.map +1 -1
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.js.map +1 -1
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.script.js +2 -2
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.script.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @scalar/scripts
|
|
2
2
|
|
|
3
|
+
## 0.4.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: optimize layout for mobile
|
|
8
|
+
- Hide the document breadcrumb on small screens and surface workspace
|
|
9
|
+
switching from the menu instead, so the top bar stays uncluttered.
|
|
10
|
+
- Convert the document save / discard / pull / push / publish buttons to
|
|
11
|
+
header-button styling and only render the trailing divider when there
|
|
12
|
+
are actual cluster buttons next to it.
|
|
13
|
+
- Stack the address bar onto two rows on small screens so the URL and
|
|
14
|
+
the action cluster (copy / history / send) each get a full row.
|
|
15
|
+
- Hide the "Log in" affordance from the small-screen top bar (the menu
|
|
16
|
+
still owns it) and keep only the primary "Register" CTA there.
|
|
17
|
+
- Give the pre-request and post-response script editors proper vertical
|
|
18
|
+
padding so the help text no longer clips when it wraps.
|
|
19
|
+
|
|
20
|
+
## 0.4.13
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [#9135](https://github.com/scalar/scalar/pull/9135): feat: optimize layout for mobile
|
|
25
|
+
- Hide the document breadcrumb on small screens and surface workspace
|
|
26
|
+
switching from the menu instead, so the top bar stays uncluttered.
|
|
27
|
+
- Convert the document save / discard / pull / push / publish buttons to
|
|
28
|
+
header-button styling and only render the trailing divider when there
|
|
29
|
+
are actual cluster buttons next to it.
|
|
30
|
+
- Stack the address bar onto two rows on small screens so the URL and
|
|
31
|
+
the action cluster (copy / history / send) each get a full row.
|
|
32
|
+
- Hide the "Log in" affordance from the small-screen top bar (the menu
|
|
33
|
+
still owns it) and keep only the primary "Register" CTA there.
|
|
34
|
+
- Give the pre-request and post-response script editors proper vertical
|
|
35
|
+
padding so the help text no longer clips when it wraps.
|
|
36
|
+
|
|
3
37
|
## 0.4.12
|
|
4
38
|
|
|
5
39
|
## 0.4.11
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptsSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScriptsSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAOnG,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,iBAAiB,CAAC,CAAA;CACvE,CAAC;AA6KF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptsSection.vue.js","names":[],"sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ScriptEditor from '@/components/ScriptEditor.vue'\nimport { ViewLayoutCollapse } from '@/components/ViewLayout'\nimport ExampleScripts from '@/plugins/request-scripts/components/ExampleScripts.vue'\n\nconst { operation } = defineProps<{\n operation?: Pick<OperationObject, 'x-pre-request' | 'x-post-response'>\n}>()\n\nconst emit = defineEmits<{\n (e: 'operation:update:extension', payload: any): void\n}>()\n\nconst preRequestScript = computed(\n () => (operation?.['x-pre-request'] as string) ?? '',\n)\nconst postResponseScript = computed(\n () => (operation?.['x-post-response'] as string) ?? '',\n)\n\nconst hasAnyScript = computed(\n () =>\n preRequestScript.value.length > 0 || postResponseScript.value.length > 0,\n)\n\nconst updatePreRequestScript = (value: string) => {\n emit('operation:update:extension', { 'x-pre-request': value })\n}\nconst updatePostResponseScript = (value: string) => {\n emit('operation:update:extension', { 'x-post-response': value })\n}\n</script>\n\n<template>\n <div class=\"w-full\">\n <ViewLayoutCollapse\n class=\"w-full\"\n :defaultOpen=\"true\">\n <template #title>Scripts</template>\n <template #suffix>\n <!-- Show an indicator whether we have a script -->\n <div class=\"mr-2\">\n <div\n v-if=\"hasAnyScript\"\n class=\"bg-green h-2 w-2 rounded-full\" />\n </div>\n </template>\n\n <!-- Pre-request -->\n <div
|
|
1
|
+
{"version":3,"file":"ScriptsSection.vue.js","names":[],"sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ScriptEditor from '@/components/ScriptEditor.vue'\nimport { ViewLayoutCollapse } from '@/components/ViewLayout'\nimport ExampleScripts from '@/plugins/request-scripts/components/ExampleScripts.vue'\n\nconst { operation } = defineProps<{\n operation?: Pick<OperationObject, 'x-pre-request' | 'x-post-response'>\n}>()\n\nconst emit = defineEmits<{\n (e: 'operation:update:extension', payload: any): void\n}>()\n\nconst preRequestScript = computed(\n () => (operation?.['x-pre-request'] as string) ?? '',\n)\nconst postResponseScript = computed(\n () => (operation?.['x-post-response'] as string) ?? '',\n)\n\nconst hasAnyScript = computed(\n () =>\n preRequestScript.value.length > 0 || postResponseScript.value.length > 0,\n)\n\nconst updatePreRequestScript = (value: string) => {\n emit('operation:update:extension', { 'x-pre-request': value })\n}\nconst updatePostResponseScript = (value: string) => {\n emit('operation:update:extension', { 'x-post-response': value })\n}\n</script>\n\n<template>\n <div class=\"w-full\">\n <ViewLayoutCollapse\n class=\"w-full\"\n :defaultOpen=\"true\">\n <template #title>Scripts</template>\n <template #suffix>\n <!-- Show an indicator whether we have a script -->\n <div class=\"mr-2\">\n <div\n v-if=\"hasAnyScript\"\n class=\"bg-green h-2 w-2 rounded-full\" />\n </div>\n </template>\n\n <!-- Pre-request -->\n <div\n class=\"text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm\">\n Pre-request — run before the request is sent (e.g. set variables,\n headers).\n </div>\n <ScriptEditor\n :modelValue=\"preRequestScript\"\n @update:modelValue=\"updatePreRequestScript\" />\n\n <!-- Post-response -->\n <div\n class=\"text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm\">\n Post-response — run after the response is received (e.g. tests,\n assertions).\n </div>\n <ScriptEditor\n :modelValue=\"postResponseScript\"\n @update:modelValue=\"updatePostResponseScript\" />\n <div class=\"border-y p-3\">\n <ExampleScripts\n :modelValue=\"postResponseScript\"\n @update:modelValue=\"updatePostResponseScript\" />\n </div>\n </ViewLayoutCollapse>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -33,12 +33,12 @@ var ScriptsSection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
33
33
|
title: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Scripts", -1)])]),
|
|
34
34
|
suffix: withCtx(() => [createElementVNode("div", _hoisted_2, [hasAnyScript.value ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)])]),
|
|
35
35
|
default: withCtx(() => [
|
|
36
|
-
_cache[1] || (_cache[1] = createElementVNode("div", { class: "text-c-3 flex h-8 items-center border-y px-3 text-sm" }, " Pre-request — run before the request is sent (e.g. set variables, headers). ", -1)),
|
|
36
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm" }, " Pre-request — run before the request is sent (e.g. set variables, headers). ", -1)),
|
|
37
37
|
createVNode(ScriptEditor_default, {
|
|
38
38
|
modelValue: preRequestScript.value,
|
|
39
39
|
"onUpdate:modelValue": updatePreRequestScript
|
|
40
40
|
}, null, 8, ["modelValue"]),
|
|
41
|
-
_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-c-3 flex h-8 items-center border-y px-3 text-sm" }, " Post-response — run after the response is received (e.g. tests, assertions). ", -1)),
|
|
41
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm" }, " Post-response — run after the response is received (e.g. tests, assertions). ", -1)),
|
|
42
42
|
createVNode(ScriptEditor_default, {
|
|
43
43
|
modelValue: postResponseScript.value,
|
|
44
44
|
"onUpdate:modelValue": updatePostResponseScript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptsSection.vue.script.js","names":[],"sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ScriptEditor from '@/components/ScriptEditor.vue'\nimport { ViewLayoutCollapse } from '@/components/ViewLayout'\nimport ExampleScripts from '@/plugins/request-scripts/components/ExampleScripts.vue'\n\nconst { operation } = defineProps<{\n operation?: Pick<OperationObject, 'x-pre-request' | 'x-post-response'>\n}>()\n\nconst emit = defineEmits<{\n (e: 'operation:update:extension', payload: any): void\n}>()\n\nconst preRequestScript = computed(\n () => (operation?.['x-pre-request'] as string) ?? '',\n)\nconst postResponseScript = computed(\n () => (operation?.['x-post-response'] as string) ?? '',\n)\n\nconst hasAnyScript = computed(\n () =>\n preRequestScript.value.length > 0 || postResponseScript.value.length > 0,\n)\n\nconst updatePreRequestScript = (value: string) => {\n emit('operation:update:extension', { 'x-pre-request': value })\n}\nconst updatePostResponseScript = (value: string) => {\n emit('operation:update:extension', { 'x-post-response': value })\n}\n</script>\n\n<template>\n <div class=\"w-full\">\n <ViewLayoutCollapse\n class=\"w-full\"\n :defaultOpen=\"true\">\n <template #title>Scripts</template>\n <template #suffix>\n <!-- Show an indicator whether we have a script -->\n <div class=\"mr-2\">\n <div\n v-if=\"hasAnyScript\"\n class=\"bg-green h-2 w-2 rounded-full\" />\n </div>\n </template>\n\n <!-- Pre-request -->\n <div
|
|
1
|
+
{"version":3,"file":"ScriptsSection.vue.script.js","names":[],"sources":["../../../../src/plugins/request-scripts/components/ScriptsSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport ScriptEditor from '@/components/ScriptEditor.vue'\nimport { ViewLayoutCollapse } from '@/components/ViewLayout'\nimport ExampleScripts from '@/plugins/request-scripts/components/ExampleScripts.vue'\n\nconst { operation } = defineProps<{\n operation?: Pick<OperationObject, 'x-pre-request' | 'x-post-response'>\n}>()\n\nconst emit = defineEmits<{\n (e: 'operation:update:extension', payload: any): void\n}>()\n\nconst preRequestScript = computed(\n () => (operation?.['x-pre-request'] as string) ?? '',\n)\nconst postResponseScript = computed(\n () => (operation?.['x-post-response'] as string) ?? '',\n)\n\nconst hasAnyScript = computed(\n () =>\n preRequestScript.value.length > 0 || postResponseScript.value.length > 0,\n)\n\nconst updatePreRequestScript = (value: string) => {\n emit('operation:update:extension', { 'x-pre-request': value })\n}\nconst updatePostResponseScript = (value: string) => {\n emit('operation:update:extension', { 'x-post-response': value })\n}\n</script>\n\n<template>\n <div class=\"w-full\">\n <ViewLayoutCollapse\n class=\"w-full\"\n :defaultOpen=\"true\">\n <template #title>Scripts</template>\n <template #suffix>\n <!-- Show an indicator whether we have a script -->\n <div class=\"mr-2\">\n <div\n v-if=\"hasAnyScript\"\n class=\"bg-green h-2 w-2 rounded-full\" />\n </div>\n </template>\n\n <!-- Pre-request -->\n <div\n class=\"text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm\">\n Pre-request — run before the request is sent (e.g. set variables,\n headers).\n </div>\n <ScriptEditor\n :modelValue=\"preRequestScript\"\n @update:modelValue=\"updatePreRequestScript\" />\n\n <!-- Post-response -->\n <div\n class=\"text-c-3 flex min-h-8 items-center border-y px-3 py-2 text-sm\">\n Post-response — run after the response is received (e.g. tests,\n assertions).\n </div>\n <ScriptEditor\n :modelValue=\"postResponseScript\"\n @update:modelValue=\"updatePostResponseScript\" />\n <div class=\"border-y p-3\">\n <ExampleScripts\n :modelValue=\"postResponseScript\"\n @update:modelValue=\"updatePostResponseScript\" />\n </div>\n </ViewLayoutCollapse>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAYA,MAAM,OAAO;EAIb,MAAM,mBAAmB,eAChB,QAAA,YAAY,oBAA+B,GACpD;EACA,MAAM,qBAAqB,eAClB,QAAA,YAAY,sBAAiC,GACtD;EAEA,MAAM,eAAe,eAEjB,iBAAiB,MAAM,SAAS,KAAK,mBAAmB,MAAM,SAAS,EAC3E;EAEA,MAAM,0BAA0B,UAAkB;AAChD,QAAK,8BAA8B,EAAE,iBAAiB,OAAO,CAAA;;EAE/D,MAAM,4BAA4B,UAAkB;AAClD,QAAK,8BAA8B,EAAE,mBAAmB,OAAO,CAAA;;;uBAK/D,mBAuCM,OAvCN,YAuCM,CAtCJ,YAqCqB,MAAA,2BAAA,EAAA;IApCnB,OAAM;IACL,aAAa;;IACH,OAAK,cAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAP,WAAO,GAAA,CAAA,EAAA,CAAA;IACb,QAAM,cAMT,CAJN,mBAIM,OAJN,YAIM,CAFI,aAAA,SAAA,WAAA,EADR,mBAE0C,OAF1C,WAE0C,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,CAAA,CAAA;2BASxC;+BAJN,mBAIM,OAAA,EAHJ,OAAM,iEAA+D,EAAC,iFAGxE,GAAA;KACA,YAEgD,sBAAA;MAD7C,YAAY,iBAAA;MACZ,uBAAmB;;+BAGtB,mBAIM,OAAA,EAHJ,OAAM,iEAA+D,EAAC,kFAGxE,GAAA;KACA,YAEkD,sBAAA;MAD/C,YAAY,mBAAA;MACZ,uBAAmB;;KACtB,mBAIM,OAJN,YAIM,CAHJ,YAEkD,wBAAA;MAD/C,YAAY,mBAAA;MACZ,uBAAmB"}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"post-response scripts",
|
|
20
20
|
"api client"
|
|
21
21
|
],
|
|
22
|
-
"version": "0.4.
|
|
22
|
+
"version": "0.4.14",
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=22"
|
|
25
25
|
},
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"postman-collection": "^5.3.0",
|
|
55
55
|
"postman-sandbox": "^6.6.1",
|
|
56
56
|
"vue": "^3.5.30",
|
|
57
|
-
"@scalar/components": "0.24.
|
|
57
|
+
"@scalar/components": "0.24.4",
|
|
58
|
+
"@scalar/oas-utils": "0.17.0",
|
|
58
59
|
"@scalar/use-codemirror": "0.14.11",
|
|
59
|
-
"@scalar/
|
|
60
|
-
"@scalar/workspace-store": "0.49.3"
|
|
60
|
+
"@scalar/workspace-store": "0.51.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@vitejs/plugin-vue": "^6.0.3",
|