@scalar/api-client 3.13.7 → 3.14.0

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -1
  3. package/dist/style.css +98 -83
  4. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  5. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +6 -6
  6. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  8. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  9. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +72 -11
  10. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts +19 -0
  12. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.d.ts.map +1 -0
  13. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js +7 -0
  14. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.js.map +1 -0
  15. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js +81 -0
  16. package/dist/v2/blocks/request-block/components/RequestBodyStructured.vue.script.js.map +1 -0
  17. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts +13 -0
  18. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.d.ts.map +1 -0
  19. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js +7 -0
  20. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.js.map +1 -0
  21. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js +34 -0
  22. package/dist/v2/blocks/request-block/components/RequestBodyViewToggle.vue.script.js.map +1 -0
  23. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  25. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +8 -2
  26. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  27. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.d.ts +17 -0
  28. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.d.ts.map +1 -0
  29. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js +33 -0
  30. package/dist/v2/blocks/request-block/helpers/fold-structured-body-rows.js.map +1 -0
  31. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +28 -0
  32. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  33. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +2 -2
  34. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
  35. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.d.ts +13 -0
  36. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.d.ts.map +1 -0
  37. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js +39 -0
  38. package/dist/v2/blocks/request-block/helpers/get-structured-body-rows.js.map +1 -0
  39. package/dist/v2/blocks/request-block/helpers/structured-body-codec.d.ts +15 -0
  40. package/dist/v2/blocks/request-block/helpers/structured-body-codec.d.ts.map +1 -0
  41. package/dist/v2/blocks/request-block/helpers/structured-body-codec.js +33 -0
  42. package/dist/v2/blocks/request-block/helpers/structured-body-codec.js.map +1 -0
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -2
  45. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +18 -13
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +6 -2
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js.map +1 -1
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js +16 -8
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.script.js.map +1 -1
  54. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +7 -3
  55. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  56. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  57. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +338 -25
  58. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +7 -11
  61. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  62. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.d.ts +42 -0
  63. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.d.ts.map +1 -0
  64. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js +60 -0
  65. package/dist/v2/blocks/scalar-auth-selector-block/helpers/run-oauth2-authorize.js.map +1 -0
  66. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +17 -1
  67. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  68. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +33 -1
  69. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js.map +1 -1
  70. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +2 -0
  71. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  72. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  73. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js +8 -2
  74. package/dist/v2/components/data-table/DataTableCheckbox.vue.script.js.map +1 -1
  75. package/dist/v2/constants.js +1 -1
  76. package/dist/vue-styles.css +1 -1
  77. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"security-scheme.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"sourcesContent":["import { generateHash } from '@scalar/helpers/string/generate-hash'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n ComponentsObject,\n OpenApiDocument,\n SecurityRequirementObject,\n SecuritySchemeObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { authOptions } from '@/v2/blocks/scalar-auth-selector-block/helpers/auth-options'\n\n/** A single security scheme option used in the auth dropdown */\nexport type SecuritySchemeOption = {\n id: string\n label: string\n value: SecurityRequirementObject\n isDeletable?: boolean\n payload?: SecuritySchemeObject\n}\n\n/** A group of security scheme options used in the auth dropdown */\nexport type SecuritySchemeGroup = {\n label: string\n options: SecuritySchemeOption[]\n}\n\nconst requirementSignature = (requirement: SecurityRequirementObject): string =>\n JSON.stringify(Object.keys(requirement))\n\n/**\n * Format a scheme object into a display object\n *\n * We also add a hash to the id to ensure it is unique across\n * multiple requirements of the same scheme with different scopes\n */\nexport const formatScheme = ({ name, value }: { name: string; value: SecurityRequirementObject }) => ({\n id: generateHash(JSON.stringify(value)),\n label: name,\n value,\n isDeletable: true,\n})\n\n/** Formats complex security schemes */\nexport const formatComplexScheme = (scheme: NonNullable<OpenApiDocument['security']>[number]) =>\n formatScheme({\n name: Object.keys(scheme).join(' & '),\n value: scheme,\n })\n\n/**\n * Formats a security requirement into a SecuritySchemeOption.\n * Handles both simple (single key) and complex (multiple keys) auth schemes.\n */\nconst formatSecurityRequirement = (\n requirement: SecurityRequirementObject,\n securitySchemes: NonNullable<ComponentsObject['securitySchemes']>,\n): SecuritySchemeOption | undefined => {\n const keys = Object.keys(requirement)\n\n // Complex auth (multiple keys)\n if (keys.length > 1) {\n return formatComplexScheme(requirement)\n }\n\n // Simple auth (single key)\n if (keys[0]) {\n const scheme = getResolvedRef(securitySchemes[keys[0]])\n if (!scheme) {\n return undefined\n }\n return formatScheme({ name: keys[0], value: requirement })\n }\n\n return undefined\n}\n\n/**\n * Generates the options for the security scheme combobox\n *\n * Contains either a flat list, or different groups of required, available, and add new\n */\nexport const getSecuritySchemeOptions = (\n security: NonNullable<OpenApiDocument['security']>,\n securitySchemes: NonNullable<ComponentsObject['securitySchemes']>,\n /** We need to add the selected schemes if they do not already exist in the calculated options */\n selectedSchemes: SecurityRequirementObject[],\n /** Allows adding authentication which is not in the document */\n canAddNewAuth = false,\n): SecuritySchemeOption[] | SecuritySchemeGroup[] => {\n const selectedByRequirement = new Map(\n selectedSchemes.map((selectedScheme) => [requirementSignature(selectedScheme), selectedScheme]),\n )\n\n /**\n * Build required schemes formatted as options and track scheme names in a single pass.\n * We use names (not full IDs) because we want to exclude any scheme that is already\n * required, regardless of its specific scopes or hash.\n */\n const { requiredFormatted, requiredSchemeNames, existingIds } = security.reduce(\n (acc, requirement) => {\n // If a required requirement is selected with scopes, use that selected value to\n // keep a single option entry and avoid a phantom duplicate.\n const requirementValue = selectedByRequirement.get(requirementSignature(requirement)) ?? requirement\n const formatted = formatSecurityRequirement(requirementValue, securitySchemes)\n if (formatted) {\n acc.requiredFormatted.push(formatted)\n acc.existingIds.add(formatted.id)\n }\n for (const name of Object.keys(requirement)) {\n acc.requiredSchemeNames.add(name)\n }\n return acc\n },\n {\n requiredFormatted: [] as SecuritySchemeOption[],\n requiredSchemeNames: new Set<string>(),\n existingIds: new Set<string>(),\n },\n )\n\n // Build available schemes (excluding schemes that are in the required list)\n const availableFormatted: SecuritySchemeOption[] = []\n for (const [name, schemeRef] of Object.entries(securitySchemes)) {\n if (requiredSchemeNames.has(name)) {\n continue\n }\n\n const scheme = getResolvedRef(schemeRef)\n if (scheme) {\n const formatted = formatScheme({ name, value: { [name]: [] } })\n availableFormatted.push(formatted)\n existingIds.add(formatted.id)\n }\n }\n\n /**\n * Add selected schemes to available if they do not already exist\n * This ensures that selected schemes with specific scopes are always available as options\n */\n for (const selectedScheme of selectedSchemes) {\n const formatted = formatSecurityRequirement(selectedScheme, securitySchemes)\n if (formatted && !existingIds.has(formatted.id)) {\n availableFormatted.push(formatted)\n existingIds.add(formatted.id)\n }\n }\n\n const options = [\n { label: 'Required authentication', options: requiredFormatted },\n { label: 'Available authentication', options: availableFormatted },\n ]\n\n // We don't return the groups if we don't have any required schemes\n if (!canAddNewAuth) {\n return requiredFormatted.length ? options : availableFormatted\n }\n\n // Add new authentication options (unless explicitly hidden)\n options.push({\n label: 'Add new authentication',\n options: Object.entries(authOptions).map(([key, value]) => ({\n id: key,\n label: value.label,\n value: { [key]: [] },\n payload: value.payload,\n isDeletable: false,\n })),\n })\n\n return options\n}\n"],"mappings":";;;;AA0BA,IAAM,wBAAwB,gBAC5B,KAAK,UAAU,OAAO,KAAK,YAAY,CAAC;;;;;;;AAQ1C,IAAa,gBAAgB,EAAE,MAAM,aAAiE;CACpG,IAAI,aAAa,KAAK,UAAU,MAAM,CAAC;CACvC,OAAO;CACP;CACA,aAAa;CACd;;AAGD,IAAa,uBAAuB,WAClC,aAAa;CACX,MAAM,OAAO,KAAK,OAAO,CAAC,KAAK,MAAM;CACrC,OAAO;CACR,CAAC;;;;;AAMJ,IAAM,6BACJ,aACA,oBACqC;CACrC,MAAM,OAAO,OAAO,KAAK,YAAY;AAGrC,KAAI,KAAK,SAAS,EAChB,QAAO,o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CAIjC,MAAM,UAAU,CACd;EAAE,OAAO;EAA2B,SAAS;EAAmB,EAChE;EAAE,OAAO;EAA4B,SAAS;EAAoB,CACnE;AAGD,KAAI,CAAC,cACH,QAAO,kBAAkB,SAAS,UAAU;AAI9C,SAAQ,KAAK;EACX,OAAO;EACP,SAAS,OAAO,QAAQ,YAAY,CAAC,KAAK,CAAC,KAAK,YAAY;GAC1D,IAAI;GACJ,OAAO,MAAM;GACb,OAAO,GAAG,MAAM,EAAE,EAAE;GACpB,SAAS,MAAM;GACf,aAAa;GACd,EAAE;EACJ,CAAC;AAEF,QAAO"}
1
+ {"version":3,"file":"security-scheme.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"sourcesContent":["import { generateHash } from '@scalar/helpers/string/generate-hash'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MergedSecuritySchemes, OAuthFlowsObjectSecret } from '@scalar/workspace-store/request-example'\nimport type {\n ComponentsObject,\n OpenApiDocument,\n SecurityRequirementObject,\n SecuritySchemeObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { authOptions } from '@/v2/blocks/scalar-auth-selector-block/helpers/auth-options'\n\n/** A single security scheme option used in the auth dropdown */\nexport type SecuritySchemeOption = {\n id: string\n label: string\n value: SecurityRequirementObject\n isDeletable?: boolean\n payload?: SecuritySchemeObject\n}\n\n/** A group of security scheme options used in the auth dropdown */\nexport type SecuritySchemeGroup = {\n label: string\n options: SecuritySchemeOption[]\n}\n\nconst requirementSignature = (requirement: SecurityRequirementObject): string =>\n JSON.stringify(Object.keys(requirement))\n\n/**\n * Format a scheme object into a display object\n *\n * We also add a hash to the id to ensure it is unique across\n * multiple requirements of the same scheme with different scopes\n */\nexport const formatScheme = ({ name, value }: { name: string; value: SecurityRequirementObject }) => ({\n id: generateHash(JSON.stringify(value)),\n label: name,\n value,\n isDeletable: true,\n})\n\n/** Formats complex security schemes */\nexport const formatComplexScheme = (scheme: NonNullable<OpenApiDocument['security']>[number]) =>\n formatScheme({\n name: Object.keys(scheme).join(' & '),\n value: scheme,\n })\n\n/**\n * Formats a security requirement into a SecuritySchemeOption.\n * Handles both simple (single key) and complex (multiple keys) auth schemes.\n */\nconst formatSecurityRequirement = (\n requirement: SecurityRequirementObject,\n securitySchemes: NonNullable<ComponentsObject['securitySchemes']> | MergedSecuritySchemes,\n): SecuritySchemeOption | undefined => {\n const keys = Object.keys(requirement)\n\n // Complex auth (multiple keys)\n if (keys.length > 1) {\n return formatComplexScheme(requirement)\n }\n\n // Simple auth (single key)\n if (keys[0]) {\n const scheme = getResolvedRef(securitySchemes[keys[0]])\n if (!scheme) {\n return undefined\n }\n return formatScheme({ name: keys[0], value: requirement })\n }\n\n return undefined\n}\n\n/**\n * Finds the oauth2 scheme best suited to power a bearer scheme's \"Authorize via OAuth2\" shortcut:\n * the first scheme with an interactive grant (authorization code / implicit), the kind that sends\n * a user to an IdP login. Prefers the authorization-code grant (which can refresh) over one\n * offering only implicit, so the more capable flow wins even when it is declared later.\n *\n * This only surfaces a convenience shortcut on the bearer form — it never hides the oauth2 scheme,\n * which stays independently selectable in the auth dropdown.\n */\nexport const getOauth2AcquisitionTarget = (\n securitySchemes: NonNullable<ComponentsObject['securitySchemes']> | MergedSecuritySchemes,\n): {\n name: string\n flows: OAuthFlowsObjectSecret\n flowType: 'authorizationCode' | 'implicit'\n scopes: string[]\n} | null => {\n let implicitFallback: {\n name: string\n flows: OAuthFlowsObjectSecret\n flowType: 'implicit'\n scopes: string[]\n } | null = null\n\n for (const [name, schemeRef] of Object.entries(securitySchemes)) {\n const scheme = getResolvedRef(schemeRef)\n if (scheme?.type !== 'oauth2') {\n continue\n }\n const flows = scheme.flows as OAuthFlowsObjectSecret | undefined\n if (!flows) {\n continue\n }\n const scopes = (scheme as { 'x-default-scopes'?: string[] })['x-default-scopes'] ?? []\n\n // Authorization code can refresh, so it wins outright the moment we find one.\n if (flows.authorizationCode) {\n return { name, flows, flowType: 'authorizationCode', scopes }\n }\n // Otherwise remember the first implicit-only scheme in case no auth-code flow turns up.\n if (flows.implicit && !implicitFallback) {\n implicitFallback = { name, flows, flowType: 'implicit', scopes }\n }\n }\n\n return implicitFallback\n}\n\n/**\n * Generates the options for the security scheme combobox\n *\n * Contains either a flat list, or different groups of required, available, and add new\n */\nexport const getSecuritySchemeOptions = (\n security: NonNullable<OpenApiDocument['security']>,\n securitySchemes: NonNullable<ComponentsObject['securitySchemes']> | MergedSecuritySchemes,\n /** We need to add the selected schemes if they do not already exist in the calculated options */\n selectedSchemes: SecurityRequirementObject[],\n /** Allows adding authentication which is not in the document */\n canAddNewAuth = false,\n): SecuritySchemeOption[] | SecuritySchemeGroup[] => {\n const selectedByRequirement = new Map(\n selectedSchemes.map((selectedScheme) => [requirementSignature(selectedScheme), selectedScheme]),\n )\n\n /**\n * Build required schemes formatted as options and track scheme names in a single pass.\n * We use names (not full IDs) because we want to exclude any scheme that is already\n * required, regardless of its specific scopes or hash.\n */\n const { requiredFormatted, requiredSchemeNames, existingIds } = security.reduce(\n (acc, requirement) => {\n // If a required requirement is selected with scopes, use that selected value to\n // keep a single option entry and avoid a phantom duplicate.\n const requirementValue = selectedByRequirement.get(requirementSignature(requirement)) ?? requirement\n const formatted = formatSecurityRequirement(requirementValue, securitySchemes)\n if (formatted) {\n acc.requiredFormatted.push(formatted)\n acc.existingIds.add(formatted.id)\n }\n for (const name of Object.keys(requirement)) {\n acc.requiredSchemeNames.add(name)\n }\n return acc\n },\n {\n requiredFormatted: [] as SecuritySchemeOption[],\n requiredSchemeNames: new Set<string>(),\n existingIds: new Set<string>(),\n },\n )\n\n // Build available schemes (excluding schemes that are in the required list)\n const availableFormatted: SecuritySchemeOption[] = []\n for (const [name, schemeRef] of Object.entries(securitySchemes)) {\n if (requiredSchemeNames.has(name)) {\n continue\n }\n\n const scheme = getResolvedRef(schemeRef)\n if (scheme) {\n const formatted = formatScheme({ name, value: { [name]: [] } })\n availableFormatted.push(formatted)\n existingIds.add(formatted.id)\n }\n }\n\n /**\n * Add selected schemes to available if they do not already exist\n * This ensures that selected schemes with specific scopes are always available as options\n */\n for (const selectedScheme of selectedSchemes) {\n const formatted = formatSecurityRequirement(selectedScheme, securitySchemes)\n if (formatted && !existingIds.has(formatted.id)) {\n availableFormatted.push(formatted)\n existingIds.add(formatted.id)\n }\n }\n\n const options = [\n { label: 'Required authentication', options: requiredFormatted },\n { label: 'Available authentication', options: availableFormatted },\n ]\n\n // We don't return the groups if we don't have any required schemes\n if (!canAddNewAuth) {\n return requiredFormatted.length ? options : availableFormatted\n }\n\n // Add new authentication options (unless explicitly hidden)\n options.push({\n label: 'Add new authentication',\n options: Object.entries(authOptions).map(([key, value]) => ({\n id: key,\n label: value.label,\n value: { [key]: [] },\n payload: value.payload,\n isDeletable: false,\n })),\n })\n\n return options\n}\n"],"mappings":";;;;AA2BA,IAAM,wBAAwB,gBAC5B,KAAK,UAAU,OAAO,KAAK,YAAY,CAAC;;;;;;;AAQ1C,IAAa,gBAAgB,EAAE,MAAM,aAAiE;CACpG,IAAI,aAAa,KAAK,UAAU,MAAM,CAAC;CACvC,OAAO;CACP;CACA,aAAa;CACd;;AAGD,IAAa,uBAAuB,WAClC,aAAa;CACX,MAAM,OAAO,KAAK,OAAO,CAAC,KAAK,MAAM;CACrC,OAAO;CACR,CAAC;;;;;AAMJ,IAAM,6BACJ,aACA,oBACqC;CACrC,MAAM,OAAO,OAAO,KAAK,YAAY;AAGrC,KAAI,KAAK,SAAS,EAChB,QAAO,oBAAoB,YAAY;AAIzC,KAAI,KAAK,IAAI;AAEX,MAAI,CADW,eAAe,gBAAgB,KAAK,IAAI,CAErD;AAEF,SAAO,aAAa;GAAE,MAAM,KAAK;GAAI,OAAO;GAAa,CAAC;;;;;;;;;;;;AAe9D,IAAa,8BACX,oBAMU;CACV,IAAI,mBAKO;AAEX,MAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,gBAAgB,EAAE;EAC/D,M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EAC5C,MAAM,YAAY,0BAA0B,gBAAgB,gBAAgB;AAC5E,MAAI,aAAa,CAAC,YAAY,IAAI,UAAU,GAAG,EAAE;AAC/C,sBAAmB,KAAK,UAAU;AAClC,eAAY,IAAI,UAAU,GAAG;;;CAIjC,MAAM,UAAU,CACd;EAAE,OAAO;EAA2B,SAAS;EAAmB,EAChE;EAAE,OAAO;EAA4B,SAAS;EAAoB,CACnE;AAGD,KAAI,CAAC,cACH,QAAO,kBAAkB,SAAS,UAAU;AAI9C,SAAQ,KAAK;EACX,OAAO;EACP,SAAS,OAAO,QAAQ,YAAY,CAAC,KAAK,CAAC,KAAK,YAAY;GAC1D,IAAI;GACJ,OAAO,MAAM;GACb,OAAO,GAAG,MAAM,EAAE,EAAE;GACpB,SAAS,MAAM;GACf,aAAa;GACd,EAAE;EACJ,CAAC;AAEF,QAAO"}
@@ -2,6 +2,7 @@ type __VLS_Props = {
2
2
  modelValue: boolean;
3
3
  disabled?: boolean;
4
4
  align?: 'left' | 'center';
5
+ ariaLabel?: string;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
8
  "update:modelValue": (v: boolean) => any;
@@ -9,6 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
9
10
  "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
10
11
  }>, {
11
12
  align: "left" | "center";
13
+ ariaLabel: string;
12
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
15
  declare const _default: typeof __VLS_export;
14
16
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"names":[],"mappings":"AA6DA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAC1B,CAAC;AA+GJ,QAAA,MAAM,YAAY;;;;;WAhHN,MAAM,GAAG,QAAQ;6EAoH3B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DataTableCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"names":[],"mappings":"AAgEA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAkHJ,QAAA,MAAM,YAAY;;;;;WApHN,MAAM,GAAG,QAAQ;eACb,MAAM;6EAuHpB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCheckbox.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n }>(),\n {\n align: 'center',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DataTableCheckbox.vue.js","names":[],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n ariaLabel: 'Toggle',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-label=\"ariaLabel\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":""}
@@ -3,13 +3,18 @@ import { createBlock, createElementVNode, createVNode, defineComponent, normaliz
3
3
  import { cva } from "@scalar/use-hooks/useBindCx";
4
4
  import { ScalarIcon } from "@scalar/components/icon";
5
5
  //#region src/v2/components/data-table/DataTableCheckbox.vue?vue&type=script&setup=true&lang.ts
6
- var _hoisted_1 = ["checked", "disabled"];
6
+ var _hoisted_1 = [
7
+ "aria-label",
8
+ "checked",
9
+ "disabled"
10
+ ];
7
11
  var DataTableCheckbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
8
12
  __name: "DataTableCheckbox",
9
13
  props: {
10
14
  modelValue: { type: Boolean },
11
15
  disabled: { type: Boolean },
12
- align: { default: "center" }
16
+ align: { default: "center" },
17
+ ariaLabel: { default: "Toggle" }
13
18
  },
14
19
  emits: ["update:modelValue"],
15
20
  setup(__props) {
@@ -23,6 +28,7 @@ var DataTableCheckbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
23
28
  return (_ctx, _cache) => {
24
29
  return openBlock(), createBlock(DataTableCell_default, { class: "group/cell relative flex min-w-8" }, {
25
30
  default: withCtx(() => [createElementVNode("input", {
31
+ "aria-label": __props.ariaLabel,
26
32
  checked: __props.modelValue,
27
33
  class: "peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default",
28
34
  disabled: Boolean(__props.disabled),
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCheckbox.vue.script.js","names":["$emit"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n }>(),\n {\n align: 'center',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAqBA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,OAAO;IACL,MAAM;IACN,QAAQ;IACT,EACF;GACF,CAAA;;uBAGC,YAmBgB,uBAAA,EAnBD,OAAM,oCAAkC,EAAA;2BAMkB,CALvE,mBAKuE,SAAA;KAJpE,SAAS,QAAA;KACV,OAAM;KACL,UAAU,QAAQ,QAAA,SAAQ;KAC3B,MAAK;KACJ,UAAM,OAAA,OAAA,OAAA,MAAG,MAAWA,KAAAA,MAAK,qBAAsB,EAAE,OAAO,QAAO;8BAClE,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,OAAG,QAAA,OAAK,CAAA,CAAA,EAAA,EAAA,CAC3B,mBAKM,OAAA,EAJJ,OAAK,eAAA,CAAC,2DAAA,CACc,QAAA,YAAA,sHAAA,CAAA,EAAA,EAAA,MAAA,EAAA,EAItB,YAGoB,MAAA,WAAA,EAAA;KAFlB,MAAK;KACL,MAAK;KACL,WAAU"}
1
+ {"version":3,"file":"DataTableCheckbox.vue.script.js","names":["$emit"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n ariaLabel: 'Toggle',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-label=\"ariaLabel\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,OAAO;IACL,MAAM;IACN,QAAQ;IACT,EACF;GACF,CAAA;;uBAGC,YAoBgB,uBAAA,EApBD,OAAM,oCAAkC,EAAA;2BAOkB,CANvE,mBAMuE,SAAA;KALpE,cAAY,QAAA;KACZ,SAAS,QAAA;KACV,OAAM;KACL,UAAU,QAAQ,QAAA,SAAQ;KAC3B,MAAK;KACJ,UAAM,OAAA,OAAA,OAAA,MAAG,MAAWA,KAAAA,MAAK,qBAAsB,EAAE,OAAO,QAAO;8BAClE,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,OAAG,QAAA,OAAK,CAAA,CAAA,EAAA,EAAA,CAC3B,mBAKM,OAAA,EAJJ,OAAK,eAAA,CAAC,2DAAA,CACc,QAAA,YAAA,sHAAA,CAAA,EAAA,EAAA,MAAA,EAAA,EAItB,YAGoB,MAAA,WAAA,EAAA;KAFlB,MAAK;KACL,MAAK;KACL,WAAU"}
@@ -1,6 +1,6 @@
1
1
  //#region src/v2/constants.ts
2
2
  /** The version number taken from the package.json. Consumers can override at build time via define (e.g. OVERRIDE_PACKAGE_VERSION: JSON.stringify('1.2.3')). */
3
- var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.13.7";
3
+ var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.14.0";
4
4
  //#endregion
5
5
  export { APP_VERSION };
6
6
 
@@ -533,7 +533,7 @@ to {
533
533
  );
534
534
  }
535
535
 
536
- [data-v-aff33ea6] .cm-content {
536
+ [data-v-dcc3af8c] .cm-content {
537
537
  font-size: var(--scalar-small);
538
538
  }
539
539
 
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "3.13.7",
21
+ "version": "3.14.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -309,20 +309,20 @@
309
309
  "vue": "^3.5.30",
310
310
  "yaml": "^2.8.3",
311
311
  "zod": "^4.3.5",
312
- "@scalar/blocks": "0.1.8",
313
- "@scalar/components": "0.27.9",
314
312
  "@scalar/icons": "0.7.5",
313
+ "@scalar/blocks": "0.1.9",
315
314
  "@scalar/helpers": "0.9.2",
316
- "@scalar/oas-utils": "0.19.8",
317
- "@scalar/sidebar": "0.9.33",
318
- "@scalar/openapi-types": "0.9.3",
319
- "@scalar/snippetz": "0.9.23",
320
- "@scalar/types": "0.16.4",
321
- "@scalar/themes": "0.17.1",
315
+ "@scalar/oas-utils": "0.19.9",
316
+ "@scalar/components": "0.27.10",
317
+ "@scalar/openapi-types": "0.9.4",
318
+ "@scalar/sidebar": "0.9.34",
319
+ "@scalar/snippetz": "0.9.24",
320
+ "@scalar/themes": "0.17.2",
321
+ "@scalar/types": "0.17.0",
322
322
  "@scalar/use-codemirror": "0.14.14",
323
323
  "@scalar/use-hooks": "0.4.9",
324
324
  "@scalar/use-toasts": "0.10.4",
325
- "@scalar/workspace-store": "0.55.6"
325
+ "@scalar/workspace-store": "0.56.0"
326
326
  },
327
327
  "devDependencies": {
328
328
  "@tailwindcss/cli": "^4.2.4",