optimized-react-component-library-xyz123 0.1.94 → 0.1.95
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 +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +46 -0
- package/dist/index.mjs +45 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -446,6 +446,19 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
446
446
|
};
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
interface CookieConsentConfig {
|
|
450
|
+
cookieName: string;
|
|
451
|
+
choiceKey: string;
|
|
452
|
+
expiryYears?: number;
|
|
453
|
+
}
|
|
454
|
+
declare const createCookieConsent: (config: CookieConsentConfig) => {
|
|
455
|
+
acceptCookies: () => void;
|
|
456
|
+
rejectCookies: () => void;
|
|
457
|
+
areCookiesAccepted: () => boolean;
|
|
458
|
+
hasChoiceBeenMade: () => boolean;
|
|
459
|
+
clearChoiceFromSession: () => void;
|
|
460
|
+
};
|
|
461
|
+
|
|
449
462
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
450
463
|
|
|
451
464
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -552,4 +565,4 @@ interface CookieBannerProps {
|
|
|
552
565
|
|
|
553
566
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
554
567
|
|
|
555
|
-
export { AddFiles as AddFilesStandard, CookieBanner, 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, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -446,6 +446,19 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
446
446
|
};
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
interface CookieConsentConfig {
|
|
450
|
+
cookieName: string;
|
|
451
|
+
choiceKey: string;
|
|
452
|
+
expiryYears?: number;
|
|
453
|
+
}
|
|
454
|
+
declare const createCookieConsent: (config: CookieConsentConfig) => {
|
|
455
|
+
acceptCookies: () => void;
|
|
456
|
+
rejectCookies: () => void;
|
|
457
|
+
areCookiesAccepted: () => boolean;
|
|
458
|
+
hasChoiceBeenMade: () => boolean;
|
|
459
|
+
clearChoiceFromSession: () => void;
|
|
460
|
+
};
|
|
461
|
+
|
|
449
462
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
450
463
|
|
|
451
464
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -552,4 +565,4 @@ interface CookieBannerProps {
|
|
|
552
565
|
|
|
553
566
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
554
567
|
|
|
555
|
-
export { AddFiles as AddFilesStandard, CookieBanner, 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, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ __export(index_exports, {
|
|
|
60
60
|
TextHeadlineAndBodyStandard: () => TextHeadlineAndBodyStandard_default,
|
|
61
61
|
ValidationCheckAllVisibleQuestion: () => ValidationCheckAllVisibleQuestion_default,
|
|
62
62
|
ValidationErrorSummaryList: () => ValidationErrorSummaryList_default,
|
|
63
|
+
createCookieConsent: () => createCookieConsent,
|
|
63
64
|
createLanguageSlice: () => createLanguageSlice,
|
|
64
65
|
createQuestionsSlice: () => createQuestionsSlice,
|
|
65
66
|
makeLanguageSelectors: () => makeLanguageSelectors,
|
|
@@ -1820,6 +1821,50 @@ var makeQuestionsSelectors = (selectSlice) => {
|
|
|
1820
1821
|
};
|
|
1821
1822
|
};
|
|
1822
1823
|
|
|
1824
|
+
// src/NewHelpMethodsStandard/CookieHandler/cookieHandler.ts
|
|
1825
|
+
var getCookie = (name) => {
|
|
1826
|
+
const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
|
|
1827
|
+
return match ? match[2] : null;
|
|
1828
|
+
};
|
|
1829
|
+
var setCookie = (name, value, expirationDate) => {
|
|
1830
|
+
let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
|
|
1831
|
+
if (expirationDate) {
|
|
1832
|
+
cookieString += `; expires=${expirationDate.toUTCString()}`;
|
|
1833
|
+
}
|
|
1834
|
+
if (window.location.protocol === "https:") {
|
|
1835
|
+
cookieString += "; Secure";
|
|
1836
|
+
}
|
|
1837
|
+
document.cookie = cookieString;
|
|
1838
|
+
};
|
|
1839
|
+
var removeCookie = (name) => {
|
|
1840
|
+
const pastDate = /* @__PURE__ */ new Date(0);
|
|
1841
|
+
setCookie(name, "", pastDate);
|
|
1842
|
+
};
|
|
1843
|
+
var createCookieConsent = (config) => {
|
|
1844
|
+
const { cookieName, choiceKey, expiryYears = 1 } = config;
|
|
1845
|
+
const acceptCookies = () => {
|
|
1846
|
+
const expires = /* @__PURE__ */ new Date();
|
|
1847
|
+
expires.setFullYear(expires.getFullYear() + expiryYears);
|
|
1848
|
+
setCookie(cookieName, "true", expires);
|
|
1849
|
+
localStorage.setItem(cookieName, "true");
|
|
1850
|
+
};
|
|
1851
|
+
const rejectCookies = () => {
|
|
1852
|
+
removeCookie(cookieName);
|
|
1853
|
+
localStorage.removeItem(cookieName);
|
|
1854
|
+
sessionStorage.setItem(choiceKey, "true");
|
|
1855
|
+
};
|
|
1856
|
+
const areCookiesAccepted = () => getCookie(cookieName) === "true";
|
|
1857
|
+
const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === "true";
|
|
1858
|
+
const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
|
|
1859
|
+
return {
|
|
1860
|
+
acceptCookies,
|
|
1861
|
+
rejectCookies,
|
|
1862
|
+
areCookiesAccepted,
|
|
1863
|
+
hasChoiceBeenMade,
|
|
1864
|
+
clearChoiceFromSession
|
|
1865
|
+
};
|
|
1866
|
+
};
|
|
1867
|
+
|
|
1823
1868
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1824
1869
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1825
1870
|
var RenderQuestion = ({
|
|
@@ -3110,6 +3155,7 @@ var CookieBanner_default = CookieBanner;
|
|
|
3110
3155
|
TextHeadlineAndBodyStandard,
|
|
3111
3156
|
ValidationCheckAllVisibleQuestion,
|
|
3112
3157
|
ValidationErrorSummaryList,
|
|
3158
|
+
createCookieConsent,
|
|
3113
3159
|
createLanguageSlice,
|
|
3114
3160
|
createQuestionsSlice,
|
|
3115
3161
|
makeLanguageSelectors,
|
package/dist/index.mjs
CHANGED
|
@@ -1754,6 +1754,50 @@ var makeQuestionsSelectors = (selectSlice) => {
|
|
|
1754
1754
|
};
|
|
1755
1755
|
};
|
|
1756
1756
|
|
|
1757
|
+
// src/NewHelpMethodsStandard/CookieHandler/cookieHandler.ts
|
|
1758
|
+
var getCookie = (name) => {
|
|
1759
|
+
const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
|
|
1760
|
+
return match ? match[2] : null;
|
|
1761
|
+
};
|
|
1762
|
+
var setCookie = (name, value, expirationDate) => {
|
|
1763
|
+
let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
|
|
1764
|
+
if (expirationDate) {
|
|
1765
|
+
cookieString += `; expires=${expirationDate.toUTCString()}`;
|
|
1766
|
+
}
|
|
1767
|
+
if (window.location.protocol === "https:") {
|
|
1768
|
+
cookieString += "; Secure";
|
|
1769
|
+
}
|
|
1770
|
+
document.cookie = cookieString;
|
|
1771
|
+
};
|
|
1772
|
+
var removeCookie = (name) => {
|
|
1773
|
+
const pastDate = /* @__PURE__ */ new Date(0);
|
|
1774
|
+
setCookie(name, "", pastDate);
|
|
1775
|
+
};
|
|
1776
|
+
var createCookieConsent = (config) => {
|
|
1777
|
+
const { cookieName, choiceKey, expiryYears = 1 } = config;
|
|
1778
|
+
const acceptCookies = () => {
|
|
1779
|
+
const expires = /* @__PURE__ */ new Date();
|
|
1780
|
+
expires.setFullYear(expires.getFullYear() + expiryYears);
|
|
1781
|
+
setCookie(cookieName, "true", expires);
|
|
1782
|
+
localStorage.setItem(cookieName, "true");
|
|
1783
|
+
};
|
|
1784
|
+
const rejectCookies = () => {
|
|
1785
|
+
removeCookie(cookieName);
|
|
1786
|
+
localStorage.removeItem(cookieName);
|
|
1787
|
+
sessionStorage.setItem(choiceKey, "true");
|
|
1788
|
+
};
|
|
1789
|
+
const areCookiesAccepted = () => getCookie(cookieName) === "true";
|
|
1790
|
+
const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === "true";
|
|
1791
|
+
const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
|
|
1792
|
+
return {
|
|
1793
|
+
acceptCookies,
|
|
1794
|
+
rejectCookies,
|
|
1795
|
+
areCookiesAccepted,
|
|
1796
|
+
hasChoiceBeenMade,
|
|
1797
|
+
clearChoiceFromSession
|
|
1798
|
+
};
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1757
1801
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1758
1802
|
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1759
1803
|
var RenderQuestion = ({
|
|
@@ -3043,6 +3087,7 @@ export {
|
|
|
3043
3087
|
TextHeadlineAndBodyStandard_default as TextHeadlineAndBodyStandard,
|
|
3044
3088
|
ValidationCheckAllVisibleQuestion_default as ValidationCheckAllVisibleQuestion,
|
|
3045
3089
|
ValidationErrorSummaryList_default as ValidationErrorSummaryList,
|
|
3090
|
+
createCookieConsent,
|
|
3046
3091
|
createLanguageSlice,
|
|
3047
3092
|
createQuestionsSlice,
|
|
3048
3093
|
makeLanguageSelectors,
|
package/package.json
CHANGED