@scalar/sidebar 0.11.6 → 0.11.8
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/dist/components/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod.vue.js.map +1 -1
- package/dist/components/HttpMethod.vue.script.js +9 -5
- package/dist/components/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/components/SidebarHttpBadge.vue.js +1 -1
- package/dist/components/SidebarHttpBadge.vue.js.map +1 -1
- package/dist/components/SidebarHttpBadge.vue.script.js.map +1 -1
- package/dist/style.css +1 -2
- package/dist/vue-styles.css +1 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../src/components/HttpMethod.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../src/components/HttpMethod.vue"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAE9C,KAAK,WAAW,GAAG;IACjB,2DAA2D;IAC3D,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACvB,2GAA2G;IAC3G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,8BAA8B;IAC9B,MAAM,EAAE,UAAU,GAAG,MAAM,CAAA;CAC5B,CAAC;AAwDF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.js","names":[],"sources":["../../src/components/HttpMethod.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport {
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.js","names":[],"sources":["../../src/components/HttpMethod.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { computed, type Component } from 'vue'\n\nconst props = defineProps<{\n /** The type of element to render as, defaults to `span` */\n as?: Component | string\n /** The css style property or variable that will be set to the request method color, defaults to `color` */\n property?: string\n /** Whether or not to abbreviated the slot content */\n short?: boolean\n /** The HTTP method to show */\n method: HttpMethod | string\n}>()\n\n/** Grabs the method info object which contains abbreviation, color, and background color etc */\nconst httpMethodInfo = computed(() =>\n getHttpMethodInfo(String(props.method || '')),\n)\n\n/** Full method name */\nconst normalized = computed(() => {\n if (typeof props.method !== 'string' || !props.method.trim()) {\n return 'get'\n }\n const method = props.method.trim()\n return isHttpMethod(method.toLowerCase()) ? method.toLowerCase() : method\n})\n</script>\n\n<template>\n <component\n :is=\"as ?? 'span'\"\n :class=\"{ uppercase: isHttpMethod(normalized) }\"\n :style=\"{ [property || 'color']: httpMethodInfo.colorVar }\">\n <slot />\n {{ short ? httpMethodInfo.short : normalized }}\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed, createBlock, createTextVNode, defineComponent, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
|
|
1
|
+
import { computed, createBlock, createTextVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
|
|
2
2
|
import { getHttpMethodInfo } from "@scalar/helpers/http/http-info";
|
|
3
|
-
import {
|
|
3
|
+
import { isHttpMethod } from "@scalar/helpers/http/is-http-method";
|
|
4
4
|
//#region src/components/HttpMethod.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var HttpMethod_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "HttpMethod",
|
|
@@ -15,15 +15,19 @@ var HttpMethod_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
15
15
|
/** Grabs the method info object which contains abbreviation, color, and background color etc */
|
|
16
16
|
const httpMethodInfo = computed(() => getHttpMethodInfo(String(props.method || "")));
|
|
17
17
|
/** Full method name */
|
|
18
|
-
const normalized = computed(() =>
|
|
18
|
+
const normalized = computed(() => {
|
|
19
|
+
if (typeof props.method !== "string" || !props.method.trim()) return "get";
|
|
20
|
+
const method = props.method.trim();
|
|
21
|
+
return isHttpMethod(method.toLowerCase()) ? method.toLowerCase() : method;
|
|
22
|
+
});
|
|
19
23
|
return (_ctx, _cache) => {
|
|
20
24
|
return openBlock(), createBlock(resolveDynamicComponent(__props.as ?? "span"), {
|
|
21
|
-
class:
|
|
25
|
+
class: normalizeClass({ uppercase: unref(isHttpMethod)(normalized.value) }),
|
|
22
26
|
style: normalizeStyle({ [__props.property || "color"]: httpMethodInfo.value.colorVar })
|
|
23
27
|
}, {
|
|
24
28
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default"), createTextVNode(" " + toDisplayString(__props.short ? httpMethodInfo.value.short : normalized.value), 1)]),
|
|
25
29
|
_: 3
|
|
26
|
-
}, 8, ["style"]);
|
|
30
|
+
}, 8, ["class", "style"]);
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.script.js","names":[],"sources":["../../src/components/HttpMethod.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport {
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.script.js","names":[],"sources":["../../src/components/HttpMethod.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { isHttpMethod } from '@scalar/helpers/http/is-http-method'\nimport { computed, type Component } from 'vue'\n\nconst props = defineProps<{\n /** The type of element to render as, defaults to `span` */\n as?: Component | string\n /** The css style property or variable that will be set to the request method color, defaults to `color` */\n property?: string\n /** Whether or not to abbreviated the slot content */\n short?: boolean\n /** The HTTP method to show */\n method: HttpMethod | string\n}>()\n\n/** Grabs the method info object which contains abbreviation, color, and background color etc */\nconst httpMethodInfo = computed(() =>\n getHttpMethodInfo(String(props.method || '')),\n)\n\n/** Full method name */\nconst normalized = computed(() => {\n if (typeof props.method !== 'string' || !props.method.trim()) {\n return 'get'\n }\n const method = props.method.trim()\n return isHttpMethod(method.toLowerCase()) ? method.toLowerCase() : method\n})\n</script>\n\n<template>\n <component\n :is=\"as ?? 'span'\"\n :class=\"{ uppercase: isHttpMethod(normalized) }\"\n :style=\"{ [property || 'color']: httpMethodInfo.colorVar }\">\n <slot />\n {{ short ? httpMethodInfo.short : normalized }}\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMA,MAAM,QAAQ;;EAYd,MAAM,iBAAiB,eACrB,kBAAkB,OAAO,MAAM,UAAU,EAAE,CAAC,CAC9C;;EAGA,MAAM,aAAa,eAAe;GAChC,IAAI,OAAO,MAAM,WAAW,YAAY,CAAC,MAAM,OAAO,KAAK,GACzD,OAAO;GAET,MAAM,SAAS,MAAM,OAAO,KAAK;GACjC,OAAO,aAAa,OAAO,YAAY,CAAC,IAAI,OAAO,YAAY,IAAI;EACrE,CAAC;;uBAIC,YAMY,wBALL,QAAA,MAAE,MAAA,GAAA;IACN,OAAK,eAAA,EAAA,WAAe,MAAA,YAAA,CAAY,CAAC,WAAA,KAAU,EAAA,CAAA;IAC3C,OAAK,eAAA,GAAK,QAAA,YAAQ,UAAc,eAAA,MAAe,SAAQ,CAAA;;2BAChD,CAAR,WAAQ,KAAA,QAAA,SAAA,GAAA,gBAAA,MACR,gBAAG,QAAA,QAAQ,eAAA,MAAe,QAAQ,WAAA,KAAU,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarHttpBadge.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarHttpBadge.vue"],"names":[],"mappings":"AA0DA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AA8EF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-he
|
|
|
2
2
|
import SidebarHttpBadge_vue_vue_type_script_setup_true_lang_default from "./SidebarHttpBadge.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/SidebarHttpBadge.vue
|
|
5
|
-
var SidebarHttpBadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SidebarHttpBadge_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var SidebarHttpBadge_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SidebarHttpBadge_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5edae08d"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SidebarHttpBadge_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHttpBadge.vue.js","names":[],"sources":["../../src/components/SidebarHttpBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\n\nimport HttpMethod from './HttpMethod.vue'\n\ndefineProps<{\n method: string\n active?: boolean\n label?: string\n webhook?: boolean\n}>()\n</script>\n<template>\n <HttpMethod\n :class=\"[\n 'sidebar-heading-type',\n `sidebar-heading-type--${method.toLowerCase()}`,\n { 'sidebar-heading-type-active': active },\n ]\"\n :method=\"method\"\n property=\"--method-color\"\n short>\n <span class=\"sr-only\">{{ label ?? 'HTTP Method' }}: </span>\n <slot>\n <ScalarIconWebhooksLogo\n v-if=\"webhook\"\n :style=\"{\n color: getHttpMethodInfo(method).colorVar,\n }\"\n weight=\"bold\" />\n </slot>\n </HttpMethod>\n</template>\n\n<style scoped>\n.sidebar-heading-type {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n overflow: hidden;\n line-height: 14px;\n flex-shrink: 0;\n
|
|
1
|
+
{"version":3,"file":"SidebarHttpBadge.vue.js","names":[],"sources":["../../src/components/SidebarHttpBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\n\nimport HttpMethod from './HttpMethod.vue'\n\ndefineProps<{\n method: string\n active?: boolean\n label?: string\n webhook?: boolean\n}>()\n</script>\n<template>\n <HttpMethod\n :class=\"[\n 'sidebar-heading-type',\n `sidebar-heading-type--${method.toLowerCase()}`,\n { 'sidebar-heading-type-active': active },\n ]\"\n :method=\"method\"\n property=\"--method-color\"\n short>\n <span class=\"sr-only\">{{ label ?? 'HTTP Method' }}: </span>\n <slot>\n <ScalarIconWebhooksLogo\n v-if=\"webhook\"\n :style=\"{\n color: getHttpMethodInfo(method).colorVar,\n }\"\n weight=\"bold\" />\n </slot>\n </HttpMethod>\n</template>\n\n<style scoped>\n.sidebar-heading-type {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n overflow: hidden;\n line-height: 14px;\n flex-shrink: 0;\n color: var(--method-color, var(--scalar-color-1));\n font-size: 10px;\n font-weight: var(--scalar-bold);\n font-family: var(--scalar-font-code);\n white-space: nowrap;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHttpBadge.vue.script.js","names":[],"sources":["../../src/components/SidebarHttpBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\n\nimport HttpMethod from './HttpMethod.vue'\n\ndefineProps<{\n method: string\n active?: boolean\n label?: string\n webhook?: boolean\n}>()\n</script>\n<template>\n <HttpMethod\n :class=\"[\n 'sidebar-heading-type',\n `sidebar-heading-type--${method.toLowerCase()}`,\n { 'sidebar-heading-type-active': active },\n ]\"\n :method=\"method\"\n property=\"--method-color\"\n short>\n <span class=\"sr-only\">{{ label ?? 'HTTP Method' }}: </span>\n <slot>\n <ScalarIconWebhooksLogo\n v-if=\"webhook\"\n :style=\"{\n color: getHttpMethodInfo(method).colorVar,\n }\"\n weight=\"bold\" />\n </slot>\n </HttpMethod>\n</template>\n\n<style scoped>\n.sidebar-heading-type {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n overflow: hidden;\n line-height: 14px;\n flex-shrink: 0;\n
|
|
1
|
+
{"version":3,"file":"SidebarHttpBadge.vue.script.js","names":[],"sources":["../../src/components/SidebarHttpBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getHttpMethodInfo } from '@scalar/helpers/http/http-info'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\n\nimport HttpMethod from './HttpMethod.vue'\n\ndefineProps<{\n method: string\n active?: boolean\n label?: string\n webhook?: boolean\n}>()\n</script>\n<template>\n <HttpMethod\n :class=\"[\n 'sidebar-heading-type',\n `sidebar-heading-type--${method.toLowerCase()}`,\n { 'sidebar-heading-type-active': active },\n ]\"\n :method=\"method\"\n property=\"--method-color\"\n short>\n <span class=\"sr-only\">{{ label ?? 'HTTP Method' }}: </span>\n <slot>\n <ScalarIconWebhooksLogo\n v-if=\"webhook\"\n :style=\"{\n color: getHttpMethodInfo(method).colorVar,\n }\"\n weight=\"bold\" />\n </slot>\n </HttpMethod>\n</template>\n\n<style scoped>\n.sidebar-heading-type {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n overflow: hidden;\n line-height: 14px;\n flex-shrink: 0;\n color: var(--method-color, var(--scalar-color-1));\n font-size: 10px;\n font-weight: var(--scalar-bold);\n font-family: var(--scalar-font-code);\n white-space: nowrap;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;uBAcE,YAkBa,oBAAA;IAjBV,OAAK,eAAA;;8BAAiE,QAAA,OAAO,YAAW;sCAA6C,QAAA,OAAM;;IAK3I,QAAQ,QAAA;IACT,UAAS;IACT,OAAA;;2BACgE,CAAhE,mBAAgE,QAAhE,YAAgE,gBAAvC,QAAA,SAAK,aAAA,IAAoB,SAAO,CAAA,GACzD,WAOO,KAAA,QAAA,WAAA,CAAA,SAAA,CALG,QAAA,WAAA,UAAA,GADR,YAKkB,MAAA,sBAAA,GAAA;;KAHf,OAAK,eAAA,EAAA,OAAqB,MAAA,iBAAA,CAAiB,CAAC,QAAA,MAAM,CAAA,CAAE,SAAA,CAAA;KAGrD,QAAO"}
|
package/dist/style.css
CHANGED
|
@@ -4544,14 +4544,13 @@
|
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
4546
|
|
|
4547
|
-
.sidebar-heading-type[data-v-
|
|
4547
|
+
.sidebar-heading-type[data-v-5edae08d] {
|
|
4548
4548
|
display: inline-flex;
|
|
4549
4549
|
align-items: center;
|
|
4550
4550
|
gap: 4px;
|
|
4551
4551
|
overflow: hidden;
|
|
4552
4552
|
line-height: 14px;
|
|
4553
4553
|
flex-shrink: 0;
|
|
4554
|
-
text-transform: uppercase;
|
|
4555
4554
|
color: var(--method-color, var(--scalar-color-1));
|
|
4556
4555
|
font-size: 10px;
|
|
4557
4556
|
font-weight: var(--scalar-bold);
|
package/dist/vue-styles.css
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
.sidebar-heading-type[data-v-
|
|
2
|
+
.sidebar-heading-type[data-v-5edae08d] {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
gap: 4px;
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
line-height: 14px;
|
|
8
8
|
flex-shrink: 0;
|
|
9
|
-
text-transform: uppercase;
|
|
10
9
|
color: var(--method-color, var(--scalar-color-1));
|
|
11
10
|
font-size: 10px;
|
|
12
11
|
font-weight: var(--scalar-bold);
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "git+https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/sidebar"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.11.
|
|
13
|
+
"version": "0.11.8",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=22"
|
|
16
16
|
},
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@scalar/components": "0.30.
|
|
36
|
-
"@scalar/helpers": "0.
|
|
35
|
+
"@scalar/components": "0.30.3",
|
|
36
|
+
"@scalar/helpers": "0.15.0",
|
|
37
37
|
"@scalar/icons": "0.7.6",
|
|
38
38
|
"@scalar/themes": "0.18.0",
|
|
39
|
-
"@scalar/use-hooks": "0.4.
|
|
40
|
-
"@scalar/workspace-store": "0.
|
|
39
|
+
"@scalar/use-hooks": "0.4.15",
|
|
40
|
+
"@scalar/workspace-store": "0.67.0",
|
|
41
41
|
"vue": "^3.5.40"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|