@scalar/api-client 3.22.0 → 3.23.1
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 +25 -0
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +2 -2
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
- package/dist/hooks/use-file-dialog.js +1 -1
- package/dist/hooks/use-file-dialog.js.map +1 -1
- package/dist/style.css +190 -144
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.d.ts +3 -3
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js +4 -4
- package/dist/v2/blocks/operation-block/helpers/persist-response-cookies.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +13 -8
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +3 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +12 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js +132 -32
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +3 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js +13 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +6 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +10 -3
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js +10 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-rows.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +4 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +55 -16
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +20 -7
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +33 -27
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +2 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +4 -4
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +4 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +46 -15
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/localization/index.d.ts.map +1 -1
- package/dist/v2/features/localization/index.js +2 -0
- package/dist/v2/features/localization/index.js.map +1 -1
- package/dist/v2/features/localization/locales/ar.d.ts +3 -0
- package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/ar.js +3 -0
- package/dist/v2/features/localization/locales/ar.js.map +1 -1
- package/dist/v2/features/localization/locales/de.d.ts +3 -0
- package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/de.js +3 -0
- package/dist/v2/features/localization/locales/de.js.map +1 -1
- package/dist/v2/features/localization/locales/es.d.ts +3 -0
- package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/es.js +3 -0
- package/dist/v2/features/localization/locales/es.js.map +1 -1
- package/dist/v2/features/localization/locales/fr.d.ts +3 -0
- package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/fr.js +3 -0
- package/dist/v2/features/localization/locales/fr.js.map +1 -1
- package/dist/v2/features/localization/locales/pt.d.ts +3 -0
- package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/pt.js +3 -0
- package/dist/v2/features/localization/locales/pt.js.map +1 -1
- package/dist/v2/features/localization/locales/ru.d.ts +3 -0
- package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/ru.js +3 -0
- package/dist/v2/features/localization/locales/ru.js.map +1 -1
- package/dist/v2/features/localization/locales/zh-cn.d.ts +3 -0
- package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
- package/dist/v2/features/localization/locales/zh-cn.js +3 -0
- package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
- package/dist/v2/features/localization/locales/zh-tw.d.ts +398 -0
- package/dist/v2/features/localization/locales/zh-tw.d.ts.map +1 -0
- package/dist/v2/features/localization/locales/zh-tw.js +360 -0
- package/dist/v2/features/localization/locales/zh-tw.js.map +1 -0
- package/dist/v2/features/localization/translations.d.ts +3 -0
- package/dist/v2/features/localization/translations.d.ts.map +1 -1
- package/dist/v2/features/localization/translations.js +3 -0
- package/dist/v2/features/localization/translations.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js +1 -0
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/index.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/modal/modal-events.d.ts +3 -1
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/modal-events.js +2 -1
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +4 -1
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/workspace-events.d.ts +4 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +2 -2
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +51 -51
- package/package.json +14 -14
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +0 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +0 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +0 -8
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 3.23.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#10608](https://github.com/scalar/scalar/pull/10608): Keep shared component styles from overriding host page body backgrounds and margins, including hosts using CSS layers. Keep full-page body styling in the standalone bundles.
|
|
8
|
+
- [#10365](https://github.com/scalar/scalar/pull/10365): Preserve document-backed API key name edits for export, allow clearing configured names, and release configured overrides when their default name is restored.
|
|
9
|
+
- [#10626](https://github.com/scalar/scalar/pull/10626): Restrict OAuth authorization and desktop external links to HTTPS or HTTP for local development URLs before opening them.
|
|
10
|
+
- [#10614](https://github.com/scalar/scalar/pull/10614): Clean up lint warnings while preserving runtime behavior, and document intentional schema and type syntax.
|
|
11
|
+
|
|
12
|
+
## 3.23.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#10555](https://github.com/scalar/scalar/pull/10555): Show empty optional fields of expanded object query parameters in a searchable Add parameter picker.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#10551](https://github.com/scalar/scalar/pull/10551): Show **Reset to default** on authentication fields only when the field has a default that differs from its current value (the document or configured value, or the current page URL for the OAuth2 redirect URL). A cleared OAuth2 access token keeps the action so you can get back to the Authorize form. The show password toggle only appears once a field has a value, and an emptied field goes back to masked.
|
|
21
|
+
- [#10559](https://github.com/scalar/scalar/pull/10559): Clean up Biome warnings in package code and tests. Handle rejected debounced callbacks and await streaming writes.
|
|
22
|
+
- [#10555](https://github.com/scalar/scalar/pull/10555): Keep expanded query parameter checkboxes independent and preserve disabled field values while excluding them from requests.
|
|
23
|
+
- [#10506](https://github.com/scalar/scalar/pull/10506): Organize imports consistently with the checks enforced in CI.
|
|
24
|
+
- [#10534](https://github.com/scalar/scalar/pull/10534): Keep **Authorize via OAuth2** rightmost in the bearer token's "Get a token" row, with the settings gear to its left and **Refresh** in between, so the button never moves when Refresh appears.
|
|
25
|
+
- [#10547](https://github.com/scalar/scalar/pull/10547): Respect Max-Age precedence over Expires when persisting response cookies.
|
|
26
|
+
- [#10508](https://github.com/scalar/scalar/pull/10508): Add built-in Traditional Chinese (Taiwan) translations for `zh-TW`, including case and underscore variants, across API Reference, API Client, and schema blocks.
|
|
27
|
+
|
|
3
28
|
## 3.22.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import ScalarAsciiArt_vue_vue_type_script_setup_true_lang_default from "./ScalarAsciiArt.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/ScalarAsciiArt/ScalarAsciiArt.vue
|
|
5
|
-
var ScalarAsciiArt_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ScalarAsciiArt_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var ScalarAsciiArt_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ScalarAsciiArt_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4f827089"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ScalarAsciiArt_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarAsciiArt.vue.js","names":[],"sources":["../../../src/components/ScalarAsciiArt/ScalarAsciiArt.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type StyleValue } from 'vue'\n\nconst props = defineProps<{ art: string; animate?: boolean }>()\n\nconst BLINK = 500 // ms - Cursor blink speed\nconst PRINT = 100 // ms - Text print speed\n\nconst lines = computed<string[]>(() => props.art.split('\\n'))\n\nconst getLineAnimation = (chars: number, row: number): StyleValue => ({\n animationDuration: `${chars * PRINT}ms, ${BLINK}ms`,\n animationTimingFunction: `steps(${chars}), step-end`,\n animationDelay: `${row * PRINT}ms, 0ms`,\n animationIterationCount: `1, ${(((lines.value?.length ?? 0) + (lines.value?.[lines.value?.length - 1]?.length ?? 0) + 5) * PRINT) / BLINK}`,\n})\n</script>\n<template>\n <div\n aria-hidden=\"true\"\n class=\"ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]\"\n :class=\"{ 'ascii-art-animate': animate }\"\n role=\"presentation\"
|
|
1
|
+
{"version":3,"file":"ScalarAsciiArt.vue.js","names":[],"sources":["../../../src/components/ScalarAsciiArt/ScalarAsciiArt.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type StyleValue } from 'vue'\n\nconst props = defineProps<{ art: string; animate?: boolean }>()\n\nconst BLINK = 500 // ms - Cursor blink speed\nconst PRINT = 100 // ms - Text print speed\n\nconst lines = computed<string[]>(() => props.art.split('\\n'))\n\nconst getLineAnimation = (chars: number, row: number): StyleValue => ({\n animationDuration: `${chars * PRINT}ms, ${BLINK}ms`,\n animationTimingFunction: `steps(${chars}), step-end`,\n animationDelay: `${row * PRINT}ms, 0ms`,\n animationIterationCount: `1, ${(((lines.value?.length ?? 0) + (lines.value?.[lines.value?.length - 1]?.length ?? 0) + 5) * PRINT) / BLINK}`,\n})\n</script>\n<template>\n <div\n aria-hidden=\"true\"\n class=\"ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]\"\n :class=\"{ 'ascii-art-animate': animate }\"\n inert\n role=\"presentation\">\n <span\n v-for=\"(line, i) in lines\"\n :key=\"i\"\n class=\"inline-block\"\n :style=\"{ width: `calc(${line.length + 1}ch)` }\">\n <!-- prettier-ignore -->\n <span\nclass=\"inline-block whitespace-pre overflow-hidden\"\n:style=\"getLineAnimation(line.length, i)\">{{\n line\n }}</span>\n </span>\n </div>\n</template>\n<style scoped>\n.ascii-art-animate .ascii-art-line {\n border-right: 1ch solid transparent;\n animation:\n typewriter 4s steps(1) 1s 1 normal both,\n blinkTextCursor 500ms steps(1) infinite normal;\n}\n\n@keyframes typewriter {\n from {\n width: 0;\n }\n to {\n width: 100%;\n }\n}\n@keyframes blinkTextCursor {\n 0% {\n border-right-color: currentColor;\n }\n 50% {\n border-right-color: transparent;\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -21,8 +21,8 @@ var ScalarAsciiArt_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
21
21
|
return openBlock(), createElementBlock("div", {
|
|
22
22
|
"aria-hidden": "true",
|
|
23
23
|
class: normalizeClass(["ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]", { "ascii-art-animate": __props.animate }]),
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
inert: "",
|
|
25
|
+
role: "presentation"
|
|
26
26
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(lines.value, (line, i) => {
|
|
27
27
|
return openBlock(), createElementBlock("span", {
|
|
28
28
|
key: i,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarAsciiArt.vue.script.js","names":[],"sources":["../../../src/components/ScalarAsciiArt/ScalarAsciiArt.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type StyleValue } from 'vue'\n\nconst props = defineProps<{ art: string; animate?: boolean }>()\n\nconst BLINK = 500 // ms - Cursor blink speed\nconst PRINT = 100 // ms - Text print speed\n\nconst lines = computed<string[]>(() => props.art.split('\\n'))\n\nconst getLineAnimation = (chars: number, row: number): StyleValue => ({\n animationDuration: `${chars * PRINT}ms, ${BLINK}ms`,\n animationTimingFunction: `steps(${chars}), step-end`,\n animationDelay: `${row * PRINT}ms, 0ms`,\n animationIterationCount: `1, ${(((lines.value?.length ?? 0) + (lines.value?.[lines.value?.length - 1]?.length ?? 0) + 5) * PRINT) / BLINK}`,\n})\n</script>\n<template>\n <div\n aria-hidden=\"true\"\n class=\"ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]\"\n :class=\"{ 'ascii-art-animate': animate }\"\n role=\"presentation\"
|
|
1
|
+
{"version":3,"file":"ScalarAsciiArt.vue.script.js","names":[],"sources":["../../../src/components/ScalarAsciiArt/ScalarAsciiArt.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type StyleValue } from 'vue'\n\nconst props = defineProps<{ art: string; animate?: boolean }>()\n\nconst BLINK = 500 // ms - Cursor blink speed\nconst PRINT = 100 // ms - Text print speed\n\nconst lines = computed<string[]>(() => props.art.split('\\n'))\n\nconst getLineAnimation = (chars: number, row: number): StyleValue => ({\n animationDuration: `${chars * PRINT}ms, ${BLINK}ms`,\n animationTimingFunction: `steps(${chars}), step-end`,\n animationDelay: `${row * PRINT}ms, 0ms`,\n animationIterationCount: `1, ${(((lines.value?.length ?? 0) + (lines.value?.[lines.value?.length - 1]?.length ?? 0) + 5) * PRINT) / BLINK}`,\n})\n</script>\n<template>\n <div\n aria-hidden=\"true\"\n class=\"ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]\"\n :class=\"{ 'ascii-art-animate': animate }\"\n inert\n role=\"presentation\">\n <span\n v-for=\"(line, i) in lines\"\n :key=\"i\"\n class=\"inline-block\"\n :style=\"{ width: `calc(${line.length + 1}ch)` }\">\n <!-- prettier-ignore -->\n <span\nclass=\"inline-block whitespace-pre overflow-hidden\"\n:style=\"getLineAnimation(line.length, i)\">{{\n line\n }}</span>\n </span>\n </div>\n</template>\n<style scoped>\n.ascii-art-animate .ascii-art-line {\n border-right: 1ch solid transparent;\n animation:\n typewriter 4s steps(1) 1s 1 normal both,\n blinkTextCursor 500ms steps(1) infinite normal;\n}\n\n@keyframes typewriter {\n from {\n width: 0;\n }\n to {\n width: 100%;\n }\n}\n@keyframes blinkTextCursor {\n 0% {\n border-right-color: currentColor;\n }\n 50% {\n border-right-color: transparent;\n }\n}\n</style>\n"],"mappings":";;AAKA,IAAM,QAAQ;AACd,IAAM,QAAQ;;;;;;;;EAHd,MAAM,QAAQ;EAKd,MAAM,QAAQ,eAAyB,MAAM,IAAI,MAAM,IAAI,CAAC;EAE5D,MAAM,oBAAoB,OAAe,SAA6B;GACpE,mBAAmB,GAAG,QAAQ,MAAM,MAAM,MAAM;GAChD,yBAAyB,SAAS,MAAM;GACxC,gBAAgB,GAAG,MAAM,MAAM;GAC/B,yBAAyB,QAAS,MAAM,OAAO,UAAU,MAAM,MAAM,QAAQ,MAAM,OAAO,SAAS,EAAE,EAAE,UAAU,KAAK,KAAK,QAAS;EACtI;;uBAGE,mBAkBM,OAAA;IAjBJ,eAAY;IACZ,OAAK,eAAA,CAAC,0EAAwE,EAAA,qBAC/C,QAAA,QAAO,CAAA,CAAA;IACtC,OAAA;IACA,MAAK;yBACL,mBAWO,UAAA,MAAA,WAVe,MAAA,QAAZ,MAAM,MAAC;wBADjB,mBAWO,QAAA;KATJ,KAAK;KACN,OAAM;KACL,OAAK,eAAA,EAAA,OAAA,QAAmB,KAAK,SAAM,EAAA,KAAA,CAAA;QAEpC,mBAIS,QAAA;KAHf,OAAM;KACL,OAAK,eAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAA;uBAChC,IAAI,GAAA,CAAA,CAAA,GAAA,CAAA"}
|
|
@@ -14,7 +14,7 @@ function useFileDialog({ multiple, accept, onChange, onError } = {}) {
|
|
|
14
14
|
if (!(event.target instanceof HTMLInputElement)) return;
|
|
15
15
|
const result = event.target;
|
|
16
16
|
files.value = result.files;
|
|
17
|
-
onChange?.(files.value);
|
|
17
|
+
return onChange?.(files.value);
|
|
18
18
|
};
|
|
19
19
|
input.onerror = () => onError?.();
|
|
20
20
|
input.multiple = multiple;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-file-dialog.js","names":[],"sources":["../../src/hooks/use-file-dialog.ts"],"sourcesContent":["import { readonly, ref } from 'vue'\n\ntype UseFileDialogOptions = {\n multiple?: boolean\n /** @default '*' */\n accept?: string\n onChange?: (files: FileList | null) => void | Promise<void>\n onError?: () => void | Promise<void>\n}\n\n/**\n * Simplified interface for opening a file picker dialog\n * Derived from vueuse @see https://vueuse.org/useFileDialog\n */\nexport function useFileDialog({ multiple, accept, onChange, onError }: UseFileDialogOptions = {}) {\n const files = ref<FileList | null>(null)\n\n let input: HTMLInputElement | undefined\n if (typeof document !== 'undefined') {\n input = document.createElement('input')\n input.type = 'file'\n\n input.onchange = (event: Event) => {\n if (!(event.target instanceof HTMLInputElement)) {\n return\n }\n const result = event.target\n files.value = result.files\n onChange?.(files.value)\n }\n\n input.onerror = () => onError?.()\n\n input.multiple = multiple!\n input.accept = accept!\n }\n\n const open = () => {\n if (!input) {\n return onError?.()\n }\n\n input.click()\n }\n\n return {\n files: readonly(files),\n open,\n }\n}\n"],"mappings":";;;;;;AAcA,SAAgB,cAAc,EAAE,UAAU,QAAQ,UAAU,YAAkC,CAAC,GAAG;CAChG,MAAM,QAAQ,IAAqB,IAAI;CAEvC,IAAI;CACJ,IAAI,OAAO,aAAa,aAAa;EACnC,QAAQ,SAAS,cAAc,OAAO;EACtC,MAAM,OAAO;EAEb,MAAM,YAAY,UAAiB;GACjC,IAAI,EAAE,MAAM,kBAAkB,mBAC5B;GAEF,MAAM,SAAS,MAAM;GACrB,MAAM,QAAQ,OAAO;GACrB,WAAW,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"use-file-dialog.js","names":[],"sources":["../../src/hooks/use-file-dialog.ts"],"sourcesContent":["import { readonly, ref } from 'vue'\n\ntype UseFileDialogOptions = {\n multiple?: boolean\n /** @default '*' */\n accept?: string\n onChange?: (files: FileList | null) => void | Promise<void>\n onError?: () => void | Promise<void>\n}\n\n/**\n * Simplified interface for opening a file picker dialog\n * Derived from vueuse @see https://vueuse.org/useFileDialog\n */\nexport function useFileDialog({ multiple, accept, onChange, onError }: UseFileDialogOptions = {}) {\n const files = ref<FileList | null>(null)\n\n let input: HTMLInputElement | undefined\n if (typeof document !== 'undefined') {\n input = document.createElement('input')\n input.type = 'file'\n\n input.onchange = (event: Event) => {\n if (!(event.target instanceof HTMLInputElement)) {\n return\n }\n const result = event.target\n files.value = result.files\n return onChange?.(files.value)\n }\n\n input.onerror = () => onError?.()\n\n input.multiple = multiple!\n input.accept = accept!\n }\n\n const open = () => {\n if (!input) {\n return onError?.()\n }\n\n input.click()\n }\n\n return {\n files: readonly(files),\n open,\n }\n}\n"],"mappings":";;;;;;AAcA,SAAgB,cAAc,EAAE,UAAU,QAAQ,UAAU,YAAkC,CAAC,GAAG;CAChG,MAAM,QAAQ,IAAqB,IAAI;CAEvC,IAAI;CACJ,IAAI,OAAO,aAAa,aAAa;EACnC,QAAQ,SAAS,cAAc,OAAO;EACtC,MAAM,OAAO;EAEb,MAAM,YAAY,UAAiB;GACjC,IAAI,EAAE,MAAM,kBAAkB,mBAC5B;GAEF,MAAM,SAAS,MAAM;GACrB,MAAM,QAAQ,OAAO;GACrB,OAAO,WAAW,MAAM,KAAK;EAC/B;EAEA,MAAM,gBAAgB,UAAU;EAEhC,MAAM,WAAW;EACjB,MAAM,SAAS;CACjB;CAEA,MAAM,aAAa;EACjB,IAAI,CAAC,OACH,OAAO,UAAU;EAGnB,MAAM,MAAM;CACd;CAEA,OAAO;EACL,OAAO,SAAS,KAAK;EACrB;CACF;AACF"}
|