@qrvey/utils 1.16.0-21 → 1.16.0-23
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/cjs/globalization/interfaces/filters/II18nFilterPanel.d.ts +2 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER_PANEL.js +2 -0
- package/dist/cjs/themes/helpers/loadDefaultQrveyFonts.d.ts +9 -0
- package/dist/cjs/themes/helpers/loadDefaultQrveyFonts.js +28 -0
- package/dist/globalization/interfaces/filters/II18nFilterPanel.d.ts +2 -0
- package/dist/globalization/labels/filters/I18N_FILTER_PANEL.js +2 -0
- package/dist/themes/helpers/loadDefaultQrveyFonts.d.ts +9 -0
- package/dist/themes/helpers/loadDefaultQrveyFonts.js +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Load default qrvey fonts
|
|
3
|
+
* @param domain Qrvey domain
|
|
4
|
+
* @param root0 Optional parameters
|
|
5
|
+
* @param root0.styleId Optional styleId for the style tag
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadDefaultQrveyFonts(domain: string, { styleId: _styleId }?: {
|
|
8
|
+
styleId?: string;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadDefaultQrveyFonts = void 0;
|
|
4
|
+
// TODO: update this function to add the NONCE when the NONCE dev is ready
|
|
5
|
+
/**
|
|
6
|
+
* @description Load default qrvey fonts
|
|
7
|
+
* @param domain Qrvey domain
|
|
8
|
+
* @param root0 Optional parameters
|
|
9
|
+
* @param root0.styleId Optional styleId for the style tag
|
|
10
|
+
*/
|
|
11
|
+
function loadDefaultQrveyFonts(domain, { styleId: _styleId } = {}) {
|
|
12
|
+
if (!domain)
|
|
13
|
+
return;
|
|
14
|
+
const styleId = _styleId !== null && _styleId !== void 0 ? _styleId : "qrvey-font-styles";
|
|
15
|
+
// If style exists dont import them again
|
|
16
|
+
const existingStyle = document.getElementById(styleId);
|
|
17
|
+
if (existingStyle)
|
|
18
|
+
return;
|
|
19
|
+
// Import new styles
|
|
20
|
+
const style = document.createElement("style");
|
|
21
|
+
style.id = styleId;
|
|
22
|
+
style.textContent = `
|
|
23
|
+
@import url('${domain}/cdn/fonts/Roboto/roboto.css');
|
|
24
|
+
@import url('${domain}/cdn/fonts/Inter/inter.css');
|
|
25
|
+
`;
|
|
26
|
+
document.head.appendChild(style);
|
|
27
|
+
}
|
|
28
|
+
exports.loadDefaultQrveyFonts = loadDefaultQrveyFonts;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Load default qrvey fonts
|
|
3
|
+
* @param domain Qrvey domain
|
|
4
|
+
* @param root0 Optional parameters
|
|
5
|
+
* @param root0.styleId Optional styleId for the style tag
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadDefaultQrveyFonts(domain: string, { styleId: _styleId }?: {
|
|
8
|
+
styleId?: string;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// TODO: update this function to add the NONCE when the NONCE dev is ready
|
|
2
|
+
/**
|
|
3
|
+
* @description Load default qrvey fonts
|
|
4
|
+
* @param domain Qrvey domain
|
|
5
|
+
* @param root0 Optional parameters
|
|
6
|
+
* @param root0.styleId Optional styleId for the style tag
|
|
7
|
+
*/
|
|
8
|
+
export function loadDefaultQrveyFonts(domain, { styleId: _styleId } = {}) {
|
|
9
|
+
if (!domain)
|
|
10
|
+
return;
|
|
11
|
+
const styleId = _styleId !== null && _styleId !== void 0 ? _styleId : "qrvey-font-styles";
|
|
12
|
+
// If style exists dont import them again
|
|
13
|
+
const existingStyle = document.getElementById(styleId);
|
|
14
|
+
if (existingStyle)
|
|
15
|
+
return;
|
|
16
|
+
// Import new styles
|
|
17
|
+
const style = document.createElement("style");
|
|
18
|
+
style.id = styleId;
|
|
19
|
+
style.textContent = `
|
|
20
|
+
@import url('${domain}/cdn/fonts/Roboto/roboto.css');
|
|
21
|
+
@import url('${domain}/cdn/fonts/Inter/inter.css');
|
|
22
|
+
`;
|
|
23
|
+
document.head.appendChild(style);
|
|
24
|
+
}
|