@sparkvault/sdk-js 16.9.0 → 16.10.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/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +11 -8
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/types.d.ts +4 -0
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -18942,8 +18942,9 @@ function refusalCopy(refusal, maxBytes) {
|
|
|
18942
18942
|
/**
|
|
18943
18943
|
* A tenant's brand color and the WCAG contrast rules that decide how it may be
|
|
18944
18944
|
* used: the one hex rule the server stores, the console checks and the portal
|
|
18945
|
-
* paints, the one contrast reading the console's readouts
|
|
18946
|
-
* accent
|
|
18945
|
+
* paints, the one contrast reading the console's readouts, the portal's
|
|
18946
|
+
* accent and the portal's reading of a help center's ground share, and the
|
|
18947
|
+
* one way a readout writes that reading.
|
|
18947
18948
|
*
|
|
18948
18949
|
* A brand color is tenant-controlled, so it is used only when it is a
|
|
18949
18950
|
* six-digit hex color, read case-insensitively and held in lowercase; anything
|
|
@@ -18985,13 +18986,15 @@ const CANVAS_COLOR = '#f7fafb';
|
|
|
18985
18986
|
*/
|
|
18986
18987
|
const INK_COLOR = '#0d1a20';
|
|
18987
18988
|
|
|
18989
|
+
/** Relative luminance (WCAG 2) of an sRGB color's red, green and blue channels, each from 0 to 1. */
|
|
18990
|
+
function channelLuminance(channels) {
|
|
18991
|
+
const [red, green, blue] = channels.map((channel) => (channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4));
|
|
18992
|
+
return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
18993
|
+
}
|
|
18994
|
+
|
|
18988
18995
|
/** Relative luminance (WCAG 2) of a validated `#rrggbb` color. */
|
|
18989
18996
|
function relativeLuminance(color) {
|
|
18990
|
-
|
|
18991
|
-
const channel = Number.parseInt(color.slice(offset, offset + 2), 16) / 255;
|
|
18992
|
-
return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;
|
|
18993
|
-
});
|
|
18994
|
-
return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
18997
|
+
return channelLuminance([1, 3, 5].map((offset) => Number.parseInt(color.slice(offset, offset + 2), 16) / 255));
|
|
18995
18998
|
}
|
|
18996
18999
|
|
|
18997
19000
|
/** The contrast ratio of two relative luminances. */
|
|
@@ -31002,7 +31005,7 @@ class SparkVault {
|
|
|
31002
31005
|
}
|
|
31003
31006
|
/** Get the SDK version */
|
|
31004
31007
|
static get version() {
|
|
31005
|
-
return '16.
|
|
31008
|
+
return '16.10.1';
|
|
31006
31009
|
}
|
|
31007
31010
|
}
|
|
31008
31011
|
if (typeof window !== 'undefined') {
|