optimized-react-component-library-xyz123 0.1.95 → 0.1.96
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.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +41 -2
- package/dist/index.mjs +37 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -459,6 +459,14 @@ declare const createCookieConsent: (config: CookieConsentConfig) => {
|
|
|
459
459
|
clearChoiceFromSession: () => void;
|
|
460
460
|
};
|
|
461
461
|
|
|
462
|
+
declare const toggleScriptByConsent: (consent: boolean, options: {
|
|
463
|
+
id: string;
|
|
464
|
+
src: string;
|
|
465
|
+
attributes?: Record<string, string>;
|
|
466
|
+
}) => void;
|
|
467
|
+
declare const isScriptLoaded: (id: string) => boolean;
|
|
468
|
+
declare const removeScriptById: (id: string) => void;
|
|
469
|
+
|
|
462
470
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
463
471
|
|
|
464
472
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -565,4 +573,4 @@ interface CookieBannerProps {
|
|
|
565
573
|
|
|
566
574
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
567
575
|
|
|
568
|
-
export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
|
|
576
|
+
export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
package/dist/index.d.ts
CHANGED
|
@@ -459,6 +459,14 @@ declare const createCookieConsent: (config: CookieConsentConfig) => {
|
|
|
459
459
|
clearChoiceFromSession: () => void;
|
|
460
460
|
};
|
|
461
461
|
|
|
462
|
+
declare const toggleScriptByConsent: (consent: boolean, options: {
|
|
463
|
+
id: string;
|
|
464
|
+
src: string;
|
|
465
|
+
attributes?: Record<string, string>;
|
|
466
|
+
}) => void;
|
|
467
|
+
declare const isScriptLoaded: (id: string) => boolean;
|
|
468
|
+
declare const removeScriptById: (id: string) => void;
|
|
469
|
+
|
|
462
470
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
463
471
|
|
|
464
472
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -565,4 +573,4 @@ interface CookieBannerProps {
|
|
|
565
573
|
|
|
566
574
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
567
575
|
|
|
568
|
-
export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
|
|
576
|
+
export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
package/dist/index.js
CHANGED
|
@@ -63,8 +63,11 @@ __export(index_exports, {
|
|
|
63
63
|
createCookieConsent: () => createCookieConsent,
|
|
64
64
|
createLanguageSlice: () => createLanguageSlice,
|
|
65
65
|
createQuestionsSlice: () => createQuestionsSlice,
|
|
66
|
+
isScriptLoaded: () => isScriptLoaded,
|
|
66
67
|
makeLanguageSelectors: () => makeLanguageSelectors,
|
|
67
|
-
makeQuestionsSelectors: () => makeQuestionsSelectors
|
|
68
|
+
makeQuestionsSelectors: () => makeQuestionsSelectors,
|
|
69
|
+
removeScriptById: () => removeScriptById,
|
|
70
|
+
toggleScriptByConsent: () => toggleScriptByConsent
|
|
68
71
|
});
|
|
69
72
|
module.exports = __toCommonJS(index_exports);
|
|
70
73
|
|
|
@@ -1865,6 +1868,39 @@ var createCookieConsent = (config) => {
|
|
|
1865
1868
|
};
|
|
1866
1869
|
};
|
|
1867
1870
|
|
|
1871
|
+
// src/NewHelpMethodsStandard/ScriptHandler/scriptHandler.ts
|
|
1872
|
+
var toggleScriptByConsent = (consent, options) => {
|
|
1873
|
+
if (typeof document === "undefined") return;
|
|
1874
|
+
const existingScript = document.getElementById(options.id);
|
|
1875
|
+
if (consent) {
|
|
1876
|
+
if (!existingScript) {
|
|
1877
|
+
const script = document.createElement("script");
|
|
1878
|
+
script.id = options.id;
|
|
1879
|
+
script.async = true;
|
|
1880
|
+
script.src = options.src;
|
|
1881
|
+
if (options.attributes) {
|
|
1882
|
+
Object.entries(options.attributes).forEach(
|
|
1883
|
+
([key, value]) => script.setAttribute(key, value)
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
document.body.appendChild(script);
|
|
1887
|
+
}
|
|
1888
|
+
} else {
|
|
1889
|
+
if (existingScript) {
|
|
1890
|
+
existingScript.remove();
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
var isScriptLoaded = (id) => {
|
|
1895
|
+
if (typeof document === "undefined") return false;
|
|
1896
|
+
return !!document.getElementById(id);
|
|
1897
|
+
};
|
|
1898
|
+
var removeScriptById = (id) => {
|
|
1899
|
+
if (typeof document === "undefined") return;
|
|
1900
|
+
const el = document.getElementById(id);
|
|
1901
|
+
if (el) el.remove();
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1868
1904
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1869
1905
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1870
1906
|
var RenderQuestion = ({
|
|
@@ -3158,6 +3194,9 @@ var CookieBanner_default = CookieBanner;
|
|
|
3158
3194
|
createCookieConsent,
|
|
3159
3195
|
createLanguageSlice,
|
|
3160
3196
|
createQuestionsSlice,
|
|
3197
|
+
isScriptLoaded,
|
|
3161
3198
|
makeLanguageSelectors,
|
|
3162
|
-
makeQuestionsSelectors
|
|
3199
|
+
makeQuestionsSelectors,
|
|
3200
|
+
removeScriptById,
|
|
3201
|
+
toggleScriptByConsent
|
|
3163
3202
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1798,6 +1798,39 @@ var createCookieConsent = (config) => {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
};
|
|
1800
1800
|
|
|
1801
|
+
// src/NewHelpMethodsStandard/ScriptHandler/scriptHandler.ts
|
|
1802
|
+
var toggleScriptByConsent = (consent, options) => {
|
|
1803
|
+
if (typeof document === "undefined") return;
|
|
1804
|
+
const existingScript = document.getElementById(options.id);
|
|
1805
|
+
if (consent) {
|
|
1806
|
+
if (!existingScript) {
|
|
1807
|
+
const script = document.createElement("script");
|
|
1808
|
+
script.id = options.id;
|
|
1809
|
+
script.async = true;
|
|
1810
|
+
script.src = options.src;
|
|
1811
|
+
if (options.attributes) {
|
|
1812
|
+
Object.entries(options.attributes).forEach(
|
|
1813
|
+
([key, value]) => script.setAttribute(key, value)
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1816
|
+
document.body.appendChild(script);
|
|
1817
|
+
}
|
|
1818
|
+
} else {
|
|
1819
|
+
if (existingScript) {
|
|
1820
|
+
existingScript.remove();
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
var isScriptLoaded = (id) => {
|
|
1825
|
+
if (typeof document === "undefined") return false;
|
|
1826
|
+
return !!document.getElementById(id);
|
|
1827
|
+
};
|
|
1828
|
+
var removeScriptById = (id) => {
|
|
1829
|
+
if (typeof document === "undefined") return;
|
|
1830
|
+
const el = document.getElementById(id);
|
|
1831
|
+
if (el) el.remove();
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1801
1834
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1802
1835
|
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1803
1836
|
var RenderQuestion = ({
|
|
@@ -3090,6 +3123,9 @@ export {
|
|
|
3090
3123
|
createCookieConsent,
|
|
3091
3124
|
createLanguageSlice,
|
|
3092
3125
|
createQuestionsSlice,
|
|
3126
|
+
isScriptLoaded,
|
|
3093
3127
|
makeLanguageSelectors,
|
|
3094
|
-
makeQuestionsSelectors
|
|
3128
|
+
makeQuestionsSelectors,
|
|
3129
|
+
removeScriptById,
|
|
3130
|
+
toggleScriptByConsent
|
|
3095
3131
|
};
|
package/package.json
CHANGED