@washingtonpost/subs-de-inputs 0.5.7 → 1.0.0-react18.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.
@@ -1 +1 @@
1
- {"version":3,"file":"subs-de-inputs.esm.js","sources":["../src/interfaces/index.ts","../src/utils/hasRequiredPrivacyCookies.ts","../src/services/getAttributes.ts","../src/services/sendToGA.ts","../src/services/ingest.ts","../src/utils/isAnonymousWebview.ts","../src/utils/push.ts","../src/components/DESelect/Dropdown.tsx","../src/components/DESelect/index.tsx","../src/components/DEDisclosure/utils/getConfig.ts","../src/components/DEDisclosure/utils/hydrateLinks.tsx","../src/components/DEDisclosure/utils/checkCookie.ts","../src/components/DEDisclosure/hooks/useOnetrustAlertBoxClosedPromise.ts","../src/components/DEDisclosure/index.tsx","../src/constants/IngestDataTypes.ts"],"sourcesContent":["import { ResponseStatusType } from '@washingtonpost/subs-sdk';\n\nexport type AttributeValue = {\n name: string;\n date_created: Number;\n last_modified_date: Number;\n archived: boolean;\n order: number;\n};\n\nexport const CollectionBehaviors = {\n COLLECT: 'COLLECT',\n DO_NOT_COLLECT: 'DO_NOT_COLLECT',\n} as const;\n\nexport type Attribute = {\n name: string;\n approved_for_use?: boolean;\n collection_behavior?: (typeof CollectionBehaviors)[keyof typeof CollectionBehaviors];\n datatype: string;\n explicit: boolean;\n multiple_value: boolean;\n last_modified_date: Number;\n date_created: Number;\n values: AttributeValue[] | Readonly<AttributeValue[]>;\n};\n\nexport const AttributesState = {\n SUCCESS: '100',\n} as const;\n\nexport const DeleteAttributeState = {\n SUCCESS: '150',\n SYSTEM_ERROR: '151',\n INVALID_ATTRIBUTE_NAME: '152',\n INVALID_ATTRIBUTE_NOT_EXISTS: '153',\n} as const;\n\nexport const IngestType = {\n EXPLICIT: 'explicit',\n IMPLICIT: 'implicit',\n} as const;\n\nexport const IngestResponseState = {\n SUCCESS: '100',\n SYSTEM_ERROR: '101',\n INVALID_TYPE: '102',\n INVALID_IDENTIFIER: '103',\n INVALID_DATA: '104',\n INVALID_ATTRIBUTE_DEFINITION: '105',\n INVALID_META_DEFINITION: '106',\n UNAUTHENTICATED: '107',\n MISMATCHED_IDENTIFIER: '108',\n DISABLED_ATTRIBUTE_DEFINITION: '109',\n DO_NOT_COLLECT: '110',\n} as const;\n\nexport interface IProfileResponse {\n status: ResponseStatusType;\n state: typeof AttributesState;\n attributes: {\n [key: string]: {\n attribute_name: string;\n value: string | null;\n date_created: number;\n last_modified_date: number;\n };\n };\n}\n","import { WPGeo, getCookie } from '@washingtonpost/subs-sdk';\n\nexport const hasRequiredPrivacyCookies = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n const wp_usp = getCookie('wp_usp');\n\n const countryCode = WPGeo()?.country_code;\n\n return !!(wp_usp && countryCode === 'US');\n};\n","import {\n ENDPOINTS,\n ResponseStatus,\n JSON_HEADERS,\n} from '@washingtonpost/subs-sdk';\nimport { Attribute } from '../interfaces';\n\nconst base = `${ENDPOINTS.base}/de/v1`;\n\nconst attributesCache: Record<string, any> = {};\nexport const getAttributes: GetAttributesType = async ({\n fieldName,\n}: {\n fieldName: string;\n}) => {\n if (attributesCache[fieldName]) {\n return attributesCache[fieldName];\n }\n\n const fieldNames = [fieldName];\n\n try {\n const url = new URL(`${base}/attributes`);\n url.searchParams.set('attributes', fieldNames.join(','));\n\n const data = await fetch(url.toString(), {\n credentials: 'include',\n headers: JSON_HEADERS,\n });\n const json = await data.json();\n\n if (data.ok && json.status === ResponseStatus.SUCCESS) {\n const attributes = json.attributes || [];\n attributesCache[fieldName] = attributes;\n return attributes;\n } else {\n return [];\n }\n } catch (e) {\n console.debug(e);\n return [];\n }\n};\n\ntype GetAttributesType = ({\n fieldName,\n}: {\n fieldName: string;\n}) => Promise<Attribute[]>;\n","const sendGAEvent = (props: {\n event: string;\n category: string;\n action: string;\n label: string;\n 'de-label': string;\n [key: string]: undefined | string | string[];\n}): void => {\n if (typeof window === 'undefined') {\n if (__DEV__) console.warn('NO WINDOW');\n return;\n }\n // Initialize dataLayer if needed\n window.dataLayer = window.dataLayer || [];\n\n const eventData: Record<string, any> = {\n ...props,\n };\n window.dataLayer.push(eventData);\n};\n\nexport const sendToGA: SendToGaType = async ({\n submitData: { fieldName, value },\n source,\n}) => {\n sendGAEvent({\n event: 'site-onpage-click',\n action: 'site-onpage-click',\n category: 'profile',\n\n label: fieldName,\n 'de-label': fieldName,\n [fieldName]: value,\n\n section: 'profile',\n subsection: source,\n });\n\n return true;\n};\n\ntype SendToGaType = ({\n submitData: { fieldName, value },\n source,\n}: {\n submitData: {\n fieldName: string;\n value: string;\n };\n source: string;\n}) => Promise<true>;\n","import {\n ENDPOINTS,\n ResponseStatus,\n JSON_HEADERS,\n getCookie,\n} from '@washingtonpost/subs-sdk';\nimport { IngestResponseState, IngestType } from '../interfaces';\n\nconst base = `${ENDPOINTS.base}/de/v1`;\n\nexport const ingest: IngestType = async ({\n submitData: { fieldName, value },\n source,\n}) => {\n const url = `${base}/ingest`;\n\n const wapo_login_id = getCookie('wapo_login_id');\n\n const jucid = localStorage.getItem('uuid');\n const ga = getCookie('_ga');\n\n const payload = {\n jucid,\n ga,\n type: IngestType.EXPLICIT,\n wapo_login_id, // TODO: move this to BE to read from cookie headers\n data: {\n [fieldName]: [value],\n },\n metadata: { source },\n };\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n credentials: 'include',\n headers: JSON_HEADERS,\n body: JSON.stringify(payload),\n });\n\n const json = await response.json();\n\n return json;\n } catch (e) {\n console.debug(e);\n return null;\n }\n};\n\ntype IngestType = ({\n submitData: { fieldName, value },\n source,\n}: {\n submitData: {\n fieldName: string;\n value: string;\n };\n source: string;\n}) => Promise<{\n status: ResponseStatus;\n state: (typeof IngestResponseState)[keyof typeof IngestResponseState];\n} | null>;\n","import { getCookie, isLoggedIn } from '@washingtonpost/subs-sdk';\n\nexport const isAnonymousWebview = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n const wp_wv = getCookie('wp_wv');\n\n return !!(wp_wv && !isLoggedIn());\n};\n","import {\n CollectionBehaviors,\n IngestResponseState,\n IngestType,\n} from '../interfaces';\nimport { getAttributes } from '../services/getAttributes';\nimport { sendToGA } from '../services/sendToGA';\nimport { hasRequiredPrivacyCookies } from './hasRequiredPrivacyCookies';\nimport { ResponseStatus } from '@washingtonpost/subs-sdk';\nimport { ingest } from '../services/ingest';\nimport { isAnonymousWebview } from './isAnonymousWebview';\n\nexport const push: PushType = async ({ submitData, source }) => {\n if (!hasRequiredPrivacyCookies()) {\n throw new Error('does not satisfy cookie check');\n }\n\n if (isAnonymousWebview()) {\n throw new Error('does not satisfy cookie check');\n }\n\n const { fieldName } = submitData;\n\n const attributeInfo = await getAttributes({\n fieldName,\n });\n\n if (\n attributeInfo[0] &&\n attributeInfo[0].name === fieldName &&\n attributeInfo[0].collection_behavior === CollectionBehaviors.DO_NOT_COLLECT\n ) {\n throw new Error('do not collect');\n }\n\n const type =\n attributeInfo[0] && attributeInfo[0].explicit === true\n ? IngestType.EXPLICIT\n : IngestType.IMPLICIT;\n\n if (!attributeInfo[0] && __DEV__) {\n console.warn(`no attribute info found for ${fieldName}, assuming implicit`);\n }\n\n if (type === IngestType.EXPLICIT) {\n return ingest({ submitData, source });\n } else {\n return sendToGA({ submitData, source });\n }\n};\n\ntype PushType = ({\n submitData: { fieldName, value },\n source,\n}: {\n submitData: {\n fieldName: string;\n value: string;\n };\n source: string;\n}) => Promise<\n | {\n status: ResponseStatus;\n state: (typeof IngestResponseState)[keyof typeof IngestResponseState];\n }\n | null\n | true\n>;\n","import React, { useEffect, useState } from 'react';\nimport { Icon, Select, styled, theme } from '@washingtonpost/wpds-ui-kit';\nimport { useWindowSize } from '@washingtonpost/subs-hooks';\nimport { ChevronDown } from '@washingtonpost/wpds-assets';\n\ninterface IDropdownProps {\n id: string;\n label: string;\n values: Array<string>;\n required?: boolean;\n defaultValue?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n}\n\nconst StyledMobileSelect = styled('select', {\n padding: '12px 16px 12px 6px',\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n backgroundColor: '$secondary',\n color: '$primary',\n fontFamily: '$meta',\n fontSize: '$100',\n fontWeight: '$light',\n lineHeight: '$125',\n paddingBlockRight: '$125',\n textOverflow: 'ellipsis',\n position: 'relative',\n borderColor: 'transparent',\n borderRightWidth: '10px',\n borderRightColor: 'transparent',\n appearance: 'none',\n '-webkit-appearance': 'none',\n '&:disabled': {\n backgroundColor: theme.colors.disabled,\n borderColor: theme.colors.disabled,\n color: theme.colors.onDisabled,\n cursor: 'not-allowed',\n },\n});\n\nconst StyledSelectWrapper = styled('div', {\n width: '100%',\n maxWidth: '380px',\n borderRadius: '$012',\n borderColor: '$subtle',\n borderStyle: 'solid',\n borderWidth: '1px',\n backgroundColor: '$secondary',\n position: 'relative',\n});\n\nconst StyledMobileOption = styled('option', {\n fontFamily: 'inherit',\n fontSize: 'inherit',\n color: 'inherit',\n});\n\n/**\n * Dropdown component. Uses wpds-ui-kit on desktop and native select on mobile.\n * @param {IDropdownProps} props The props.\n * @returns {React.ReactElement} The dropdown.\n */\nexport const Dropdown = ({\n id,\n label,\n values,\n required = false,\n defaultValue,\n onChange = () => {},\n disabled = false,\n}: IDropdownProps) => {\n const [answer, setAnswer] = useState<string>();\n const { isMobileSize } = useWindowSize();\n\n useEffect(() => {\n if (answer) onChange(answer);\n }, [answer]);\n\n const disabledProp = disabled ? { disabled: true } : {};\n\n // helps maintain state between WPDS and native dropdowns\n const defaultValueProp = answer\n ? { defaultValue: answer }\n : defaultValue\n ? { defaultValue }\n : {};\n\n const defaultValuePropMobile = (value: string) => {\n if (answer) {\n return value === answer ? { selected: true } : {};\n }\n return value === defaultValue ? { selected: true } : {};\n };\n\n return isMobileSize ? (\n <StyledSelectWrapper>\n <StyledMobileSelect\n id=\"\"\n required={required}\n onChange={(e) => setAnswer(e.target.value)}\n placeholder={label}\n {...disabledProp}\n >\n <label>{label}</label>\n <StyledMobileOption\n value=\"\"\n disabled\n selected\n style={{ color: '#666666' }}\n >\n {label}\n </StyledMobileOption>\n {values.map((value) => (\n <StyledMobileOption\n value={value}\n key={value}\n {...defaultValuePropMobile(value)}\n >\n {value}\n </StyledMobileOption>\n ))}\n </StyledMobileSelect>\n <Icon\n label=\"\"\n size=\"100\"\n fill={theme.colors['gray80']}\n style={{\n pointerEvents: 'none',\n position: 'absolute',\n right: '10px',\n top: '50%',\n transform: 'translateY(-50%)',\n }}\n >\n <ChevronDown style={{ position: 'absolute', right: '10px' }} />\n </Icon>\n </StyledSelectWrapper>\n ) : (\n <Select.Root\n onValueChange={(e) => setAnswer(e)}\n required={required}\n {...defaultValueProp}\n {...disabledProp}\n >\n <Select.Trigger data-test-id={`${id}-select-trigger`}>\n <Select.Label>{label}</Select.Label>\n <Select.Value />\n </Select.Trigger>\n <Select.Content\n css={{ zIndex: theme.zIndices.page }}\n data-test-id={`${id}-select-content`}\n >\n {values.map((value) => (\n <Select.Item value={value} key={value}>\n {value}\n </Select.Item>\n ))}\n </Select.Content>\n </Select.Root>\n );\n};\n","import React, { useState, useEffect } from 'react';\nimport { Select, styled } from '@washingtonpost/wpds-ui-kit';\nimport { Attribute, AttributeValue } from '../../interfaces';\nimport { ENDPOINTS, ResponseStatus } from '@washingtonpost/subs-sdk';\nimport { useScript, ScriptStatus } from '@washingtonpost/subs-hooks';\nimport { Dropdown } from './Dropdown';\n\ninterface DESelectProps {\n source: string;\n fieldName: string;\n label?: string;\n dataDictionaryConfig?: Attribute | Readonly<Attribute>;\n defaultValue?: string;\n disabled?: boolean;\n submit: boolean;\n onChange?: ({ value }: { value: string }) => void;\n onFinished?: ({\n isFinished,\n isError,\n }: {\n isFinished: boolean;\n isError: boolean;\n }) => void;\n valuesFilter?: (value: AttributeValue) => boolean;\n selectProps?: {\n root?: any;\n trigger?: any;\n label?: any;\n value?: any;\n content?: any;\n item?: any;\n };\n children?: React.ReactNode;\n}\n\nconst scriptSrc = `${\n ENDPOINTS.staticAssets === 'https://subscribe.washingtonpost.com/static'\n ? 'https://www.washingtonpost.com/subscribe/static/'\n : ENDPOINTS.staticAssets\n}/de-utils/twpdeu.min.js`;\n\nexport const DESelect: React.FC<DESelectProps> = ({\n source,\n fieldName,\n label,\n dataDictionaryConfig,\n defaultValue,\n disabled,\n submit,\n onChange = () => {},\n onFinished = () => {},\n valuesFilter = () => true,\n children,\n}) => {\n const [config, setConfig] = useState(dataDictionaryConfig);\n\n const [selected, setSelected] = useState('');\n\n const scriptStatus = useScript(scriptSrc);\n\n useEffect(() => {\n const fetchConfig = async () => {\n try {\n const config = await window?.__twpdeu?.getFieldConfigs({ fieldName });\n if (config) {\n setConfig(config[0]);\n } else {\n console.error('unable to get config', fieldName);\n }\n } catch (e) {\n console.warn('unable to get config', fieldName, e);\n }\n };\n\n if (scriptStatus === ScriptStatus.READY && !(children || config)) {\n fetchConfig();\n }\n }, [scriptStatus]);\n\n useEffect(() => {\n const submitSelected = async () => {\n try {\n const result = await window?.__twpdeu?.push({\n submitData: { fieldName, value: selected },\n source,\n });\n\n const isError =\n result === true\n ? false\n : result\n ? result.status !== ResponseStatus.SUCCESS\n : true;\n\n onFinished({\n isFinished: true,\n isError,\n });\n } catch (e) {\n onFinished({\n isFinished: false,\n isError: true,\n });\n }\n };\n\n if (scriptStatus === ScriptStatus.READY && submit && selected) {\n submitSelected();\n }\n }, [scriptStatus, submit]);\n\n const defaultValueProp = defaultValue && config ? { defaultValue } : {};\n\n const isLoading = !(children || config);\n\n const disabledProp = disabled || isLoading ? { disabled: true } : {};\n\n // sort and filter out archived values\n // Note: config.values may be readonly\n const values = config\n ? [...config.values]\n .sort((a, b) => a.order - b.order)\n .filter((value) => value.archived !== true)\n .filter(valuesFilter)\n : [];\n\n return (\n <SelectWrapper>\n {children && (\n <Select.Root\n onValueChange={(e) => {\n setSelected(e);\n onChange({ value: e });\n }}\n {...defaultValueProp}\n {...disabledProp}\n >\n {children}\n </Select.Root>\n )}\n {!children && !config && (\n <Dropdown\n id={'loading'}\n label={'Loading...'}\n values={[]}\n disabled={true}\n />\n )}\n {!children && config && (\n <Dropdown\n id={config.name}\n label={label || config.name}\n onChange={(e) => {\n setSelected(e);\n onChange({ value: e });\n }}\n values={values.map((value) => value.name)}\n defaultValue={defaultValue}\n disabled={disabled}\n />\n )}\n </SelectWrapper>\n );\n};\n\nconst SelectWrapper = styled('div', {\n boxSizing: 'border-box',\n display: 'flex',\n marginBottom: '$100',\n flexDirection: 'column',\n '& button': {\n padding: '1px 6px',\n },\n '& *': { boxSizing: 'border-box' },\n});\n","import { ENDPOINTS, WPGeo } from '@washingtonpost/subs-sdk';\nimport {\n DisclosureConfig,\n DisclosureConfigValue,\n} from '../../../interfaces/disclosure';\n\nconst configSrc = `${\n ENDPOINTS.base === 'https://subscribe.washingtonpost.com'\n ? 'https://www.washingtonpost.com/subscribe'\n : ENDPOINTS.base\n}/config/de/disclosure.json`;\n\nexport const getConfig = async () => {\n let myConfig: DisclosureConfigValue | undefined = undefined;\n\n // step 1: fetch config\n const response = await fetch(configSrc);\n const remoteConfig: DisclosureConfig = await response.json();\n\n // step 2: figure out which part of the config to use\n\n // if country- or region-specific config found, use that\n const { country_code, intl_region } = WPGeo();\n Object.keys(remoteConfig).forEach((configKey) => {\n if (\n country_code &&\n configKey.split('|').includes(country_code.toLowerCase())\n ) {\n myConfig = remoteConfig[configKey];\n } else if (intl_region === 'EEA' && configKey === 'eea') {\n myConfig = remoteConfig[configKey];\n }\n });\n\n // TODO: Check for billing country also\n\n // else if no country-specific config, use the default config\n if (typeof myConfig === 'undefined' && remoteConfig['_']) {\n myConfig = remoteConfig['_'];\n }\n\n return myConfig;\n};\n","import React from 'react';\n\ntype hydrateLinksType = (str: string) => string | JSX.Element;\n\nexport const hydrateLinks: hydrateLinksType = (str: string) => {\n const array = str.split(/({{PRIVACY_POLICY}})/g);\n const chunks = array.map((str) => {\n if (str === '{{PRIVACY_POLICY}}') {\n return (\n <a\n target=\"_blank\"\n style={{ color: 'inherit' }}\n className=\"underline\"\n href=\"https://www.washingtonpost.com/privacy-policy/\"\n >\n Privacy Policy\n </a>\n );\n }\n return str;\n });\n\n const toReturn = chunks.reduce(\n (prev, current) => (\n <>\n {prev}\n {current}\n </>\n ),\n <></>\n );\n\n return toReturn;\n};\n","import { getCookie } from '@washingtonpost/subs-sdk';\n\nconst COOKIE = 'OptanonAlertBoxClosed';\n\nexport const checkCookie = () => {\n const value = getCookie(COOKIE) || '';\n // Wed May 15 2024 06:29:23 GMT-0500 (Central Daylight Time)\n // \"Invalid date\" is 12 characters long\n return value.length > 12;\n};\n","import { useState, useEffect } from 'react';\nimport {\n listenToCookieStore as listenToCookieStoreUtil,\n ICookieStore,\n} from '@washingtonpost/subs-sdk';\nimport { checkCookie } from '../utils/checkCookie';\n\nconst COOKIE = 'OptanonAlertBoxClosed';\n\ninterface TCData {\n eventStatus: 'tcloaded' | 'cmpuishown' | 'useractioncomplete';\n listenerId: number;\n [key: string]: any;\n}\n\ntype TCFAPIAddListener = (\n command: 'addEventListener',\n version: number,\n callback: (tcData: TCData, success: boolean) => void\n) => void;\n\ntype TCFAPIRmListener = (\n command: 'removeEventListener',\n version: number,\n callback: (success: boolean) => void,\n listenerId: number\n) => void;\n\ntype TCFAPIPing = (\n command: 'ping',\n version: number,\n callback: (pingReturn: any, success: boolean) => void\n) => void;\n\ndeclare global {\n interface Window {\n cookieStore?: ICookieStore;\n __tcfapi?: TCFAPIAddListener & TCFAPIRmListener & TCFAPIPing;\n }\n}\n\nexport const useOneTrustAlertBoxClosed = ({\n allowCookieStore,\n}: {\n allowCookieStore: boolean;\n}) => {\n const [alertBoxClosed, setAlertBoxClosed] = useState<boolean | undefined>();\n\n const [listenToCookieStore, setListenToCookieStore] = useState(false);\n const [listenToTcfApi, setListenToTcfApi] = useState(false);\n\n useEffect(() => {\n if (checkCookie()) {\n setAlertBoxClosed(true);\n return;\n }\n\n if (!window.__tcfapi) {\n console.warn('warning: __tcfapi not found');\n }\n\n if (window?.cookieStore && allowCookieStore) {\n setListenToCookieStore(true);\n } else if (window.__tcfapi) {\n setListenToTcfApi(true);\n } else {\n console.warn('warning: neither cookieStore nor __tcfapi found');\n }\n }, []);\n\n useEffect(() => {\n let cleanupFn: (() => void) | null = () => {};\n if (listenToCookieStore && window.cookieStore) {\n cleanupFn = listenToCookieStoreUtil(COOKIE, () => {\n if (checkCookie()) {\n setAlertBoxClosed(true);\n } else {\n setAlertBoxClosed(false);\n }\n });\n }\n return cleanupFn || (() => {});\n }, [listenToCookieStore]);\n\n useEffect(() => {\n let listenerId: number;\n if (listenToTcfApi && window.__tcfapi) {\n const callback = (_tcData: TCData, success: boolean) => {\n if (success) {\n listenerId = _tcData.listenerId;\n\n // tcData.eventStatus can be:\n // tcloaded means user has made a choice and we’re ready to check it\n // cmpuishown means the banner is shown\n // useractioncomplete means the user has interacted with the banner\n\n // but actually if the result for any of these is true, we just use the value of the cookie\n if (checkCookie()) {\n setAlertBoxClosed(true);\n }\n }\n };\n\n window.__tcfapi('addEventListener', 2, callback);\n }\n\n // cleanup fn\n return () => {\n if (window.__tcfapi && listenerId)\n window.__tcfapi(\n 'removeEventListener',\n 2,\n (success) => {\n console.debug(success);\n },\n listenerId\n );\n };\n }, [listenToTcfApi]);\n\n return { alertBoxClosed, listenToCookieStore, listenToTcfApi };\n};\n","import React, { useState, useEffect } from 'react';\nimport { DisclosureConfigValue } from '../../interfaces/disclosure';\nimport { getConfig } from './utils/getConfig';\nimport { hydrateLinks } from './utils/hydrateLinks';\nimport { useOneTrustAlertBoxClosed } from './hooks/useOnetrustAlertBoxClosedPromise';\n\ninterface DisclosureProps {\n /** callback function to be called when the disclosure is finished loading */\n onFinished?: ({\n isFinished,\n isError,\n }: {\n isFinished: boolean;\n isError: boolean;\n }) => void;\n\n /** ability to turn off cookiestore listener, primarily for testing purposes */\n allowCookieStore?: boolean;\n}\n\nexport const DEDisclosure: React.FC<DisclosureProps> = ({\n onFinished = () => {},\n allowCookieStore = true,\n}) => {\n const [disclosure, setDisclosure] = useState<string[] | null>(null);\n const [disclosureRendering, setDisclosureRendering] =\n useState<JSX.Element | null>(null);\n const [myConfig, setMyConfig] = useState<DisclosureConfigValue>();\n const { alertBoxClosed } = useOneTrustAlertBoxClosed({ allowCookieStore });\n\n useEffect(() => {\n (async () => {\n const config = await getConfig();\n setMyConfig(config);\n\n if (!config) {\n console.error('No config found');\n }\n })();\n }, []);\n\n useEffect(() => {\n if (myConfig) {\n // step 3: set disclosure based on config\n\n // if config says to check onetrust, check onetrust\n if ('checkBannerStatus' in myConfig && myConfig.checkBannerStatus) {\n // check if onetrust is closed\n // if it is, show the after banner disclosure\n // if it is not, show the before banner disclosure\n if (alertBoxClosed) {\n setDisclosure(myConfig.disclosure_afterbanner);\n } else {\n setDisclosure(myConfig.disclosure_beforebanner);\n }\n } else if ('disclosure' in myConfig) {\n setDisclosure(myConfig.disclosure);\n } else {\n console.error('Invalid config');\n }\n }\n }, [myConfig, alertBoxClosed]);\n\n useEffect(() => {\n if (disclosure && Array.isArray(disclosure)) {\n setDisclosureRendering(\n disclosure.reduce((prev, current) => {\n return (\n <>\n {prev}\n <p>{hydrateLinks(current)}</p>\n </>\n );\n }, <></>)\n );\n\n // Is it ok to fire `onFinished` if still waiting for onetrust to load on the page?\n onFinished({\n isFinished: true,\n isError: false,\n });\n }\n }, [disclosure]);\n\n return disclosure === null ? (\n <div data-test-id=\"de-disclosure-loading\"></div>\n ) : (\n <div data-test-id=\"de-disclosure\">{disclosureRendering}</div>\n );\n};\n","export const FirstPartyIngestDataTypes = {\n JOB_LEVEL: 'profile_job_level',\n JOB_INDUSTRY: 'profile_job_industry',\n JOB_TITLE: 'profile_job_title',\n PERSONAL_GOALS: 'personal_goals',\n HOBBIES: 'hobbies',\n PROFESSIONAL_GOALS: 'professional_goals',\n INDUSTRY: 'industry',\n NEWS_LOCATION: 'news_location',\n NY_PERSONAL_GOALS: 'new_year_personal_goals',\n NY_HOBBIES: 'new_year_hobbies',\n NY_PROFESSIONAL_GOALS: 'new_year_professional_goals',\n NY_INDUSTRY: 'new_year_industry',\n NY_NEWS_LOCATION: 'new_year_news_location',\n} as const;\n"],"names":["CollectionBehaviors","COLLECT","DO_NOT_COLLECT","AttributesState","SUCCESS","DeleteAttributeState","SYSTEM_ERROR","INVALID_ATTRIBUTE_NAME","INVALID_ATTRIBUTE_NOT_EXISTS","IngestType","EXPLICIT","IMPLICIT","IngestResponseState","INVALID_TYPE","INVALID_IDENTIFIER","INVALID_DATA","INVALID_ATTRIBUTE_DEFINITION","INVALID_META_DEFINITION","UNAUTHENTICATED","MISMATCHED_IDENTIFIER","DISABLED_ATTRIBUTE_DEFINITION","hasRequiredPrivacyCookies","window","wp_usp","getCookie","countryCode","_WPGeo","WPGeo","country_code","base","ENDPOINTS","attributesCache","getAttributes","_ref","fieldName","fieldNames","url","URL","searchParams","set","join","data","fetch","toString","credentials","headers","JSON_HEADERS","json","ok","status","ResponseStatus","attributes","e","console","debug","sendGAEvent","props","process","env","NODE_ENV","warn","dataLayer","eventData","push","sendToGA","submitData","value","source","event","action","category","label","section","subsection","ingest","wapo_login_id","jucid","localStorage","getItem","ga","payload","type","metadata","response","method","body","JSON","stringify","isAnonymousWebview","wp_wv","isLoggedIn","Error","attributeInfo","name","collection_behavior","explicit","StyledMobileSelect","styled","padding","display","justifyContent","width","backgroundColor","color","fontFamily","fontSize","fontWeight","lineHeight","paddingBlockRight","textOverflow","position","borderColor","borderRightWidth","borderRightColor","appearance","theme","colors","disabled","onDisabled","cursor","StyledSelectWrapper","maxWidth","borderRadius","borderStyle","borderWidth","StyledMobileOption","Dropdown","id","values","required","defaultValue","onChange","answer","setAnswer","useState","isMobileSize","useWindowSize","useEffect","disabledProp","defaultValueProp","defaultValuePropMobile","selected","React","target","placeholder","style","map","key","Icon","size","fill","pointerEvents","right","top","transform","ChevronDown","Select","Root","onValueChange","Trigger","Label","Value","Content","css","zIndex","zIndices","page","Item","scriptSrc","staticAssets","DESelect","dataDictionaryConfig","submit","onFinished","valuesFilter","children","config","setConfig","setSelected","scriptStatus","useScript","fetchConfig","_window","__twpdeu","getFieldConfigs","error","ScriptStatus","READY","submitSelected","_window2","result","isError","isFinished","isLoading","sort","a","b","order","filter","archived","SelectWrapper","boxSizing","marginBottom","flexDirection","configSrc","getConfig","myConfig","undefined","remoteConfig","intl_region","Object","keys","forEach","configKey","split","includes","toLowerCase","hydrateLinks","str","array","chunks","className","href","toReturn","reduce","prev","current","COOKIE","checkCookie","length","useOneTrustAlertBoxClosed","allowCookieStore","alertBoxClosed","setAlertBoxClosed","listenToCookieStore","setListenToCookieStore","listenToTcfApi","setListenToTcfApi","__tcfapi","cookieStore","cleanupFn","listenToCookieStoreUtil","listenerId","callback","_tcData","success","DEDisclosure","disclosure","setDisclosure","disclosureRendering","setDisclosureRendering","setMyConfig","checkBannerStatus","disclosure_afterbanner","disclosure_beforebanner","Array","isArray","FirstPartyIngestDataTypes","JOB_LEVEL","JOB_INDUSTRY","JOB_TITLE","PERSONAL_GOALS","HOBBIES","PROFESSIONAL_GOALS","INDUSTRY","NEWS_LOCATION","NY_PERSONAL_GOALS","NY_HOBBIES","NY_PROFESSIONAL_GOALS","NY_INDUSTRY","NY_NEWS_LOCATION"],"mappings":";;;;;;MAUaA,mBAAmB,GAAG;EACjCC,OAAO,EAAE,SAAS;EAClBC,cAAc,EAAE;;MAeLC,eAAe,GAAG;EAC7BC,OAAO,EAAE;;MAGEC,oBAAoB,GAAG;EAClCD,OAAO,EAAE,KAAK;EACdE,YAAY,EAAE,KAAK;EACnBC,sBAAsB,EAAE,KAAK;EAC7BC,4BAA4B,EAAE;;MAGnBC,UAAU,GAAG;EACxBC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE;;MAGCC,mBAAmB,GAAG;EACjCR,OAAO,EAAE,KAAK;EACdE,YAAY,EAAE,KAAK;EACnBO,YAAY,EAAE,KAAK;EACnBC,kBAAkB,EAAE,KAAK;EACzBC,YAAY,EAAE,KAAK;EACnBC,4BAA4B,EAAE,KAAK;EACnC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;;;;"}
1
+ {"version":3,"file":"subs-de-inputs.esm.js","sources":["../src/interfaces/index.ts","../src/utils/hasRequiredPrivacyCookies.ts","../src/services/dataEnrichment.ts","../src/components/DESelect/Dropdown.tsx","../src/components/DESelect/index.tsx"],"sourcesContent":["export type AttributeValue = {\n name: string;\n date_created: Number;\n last_modified_date: Number;\n archived: boolean;\n order: number;\n};\n\nexport const CollectionBehaviors = {\n COLLECT: 'COLLECT',\n DO_NOT_COLLECT: 'DO_NOT_COLLECT',\n} as const;\n\nexport type Attribute = {\n name: string;\n approved_for_use?: boolean;\n collection_behavior?: (typeof CollectionBehaviors)[keyof typeof CollectionBehaviors];\n datatype: 'string';\n explicit: boolean;\n multiple_value: boolean;\n last_modified_date: Number;\n date_created: Number;\n values: Array<AttributeValue>;\n};\n\nexport const AttributesState = {\n SUCCESS: '100',\n} as const;\n\nexport const IngestType = {\n EXPLICIT: 'explicit',\n IMPLICIT: 'implicit',\n} as const;\n\nexport const IngestResponseState = {\n SUCCESS: '100',\n SYSTEM_ERROR: '101',\n INVALID_TYPE: '102',\n INVALID_IDENTIFIER: '103',\n INVALID_DATA: '104',\n INVALID_ATTRIBUTE_DEFINITION: '105',\n INVALID_META_DEFINITION: '106',\n UNAUTHENTICATED: '107',\n MISMATCHED_IDENTIFIER: '108',\n DISABLED_ATTRIBUTE_DEFINITION: '109',\n DO_NOT_COLLECT: '110',\n} as const;\n","import { WPGeo, getCookie } from '@washingtonpost/subs-sdk';\n\nexport const hasRequiredPrivacyCookies = () => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n const wp_usp = getCookie('wp_usp');\n\n const countryCode = WPGeo()?.country_code;\n\n return !!(wp_usp && countryCode === 'US');\n};\n","import {\n ENDPOINTS,\n ResponseStatus,\n JSON_HEADERS,\n getCookie,\n} from '@washingtonpost/subs-sdk';\nimport {\n Attribute,\n CollectionBehaviors,\n IngestResponseState,\n IngestType,\n} from '../interfaces';\nimport { hasRequiredPrivacyCookies } from '../utils/hasRequiredPrivacyCookies';\n\nconst base = `${ENDPOINTS.base}/de/v1`;\n\nconst attributesCache: Record<string, any> = {};\nexport const getAttributes: GetAttributesType = async ({\n fieldName,\n}: {\n fieldName: string;\n}) => {\n if (attributesCache[fieldName]) {\n return attributesCache[fieldName];\n }\n\n const fieldNames = [fieldName];\n\n try {\n const url = new URL(`${base}/attributes`);\n url.searchParams.set('attributes', fieldNames.join(','));\n\n const data = await fetch(url.toString(), {\n credentials: 'include',\n headers: JSON_HEADERS,\n });\n const json = await data.json();\n\n if (data.ok && json.status === ResponseStatus.SUCCESS) {\n const attributes = json.attributes || [];\n attributesCache[fieldName] = attributes;\n return attributes;\n } else {\n return [];\n }\n } catch (e) {\n console.debug(e);\n return [];\n }\n};\n\ntype GetAttributesType = ({\n fieldName,\n}: {\n fieldName: string;\n}) => Promise<Attribute[]>;\n\nexport const ingest: IngestType = async ({\n submitData: { fieldName, value },\n type = IngestType.IMPLICIT,\n source,\n}) => {\n const url = `${base}/ingest`;\n\n const wapo_login_id = getCookie('wapo_login_id');\n\n if (!hasRequiredPrivacyCookies()) {\n throw new Error('does not satisfy cookie check');\n }\n\n let attributeInfo = attributesCache[fieldName];\n if (!attributeInfo) {\n attributeInfo = await getAttributes({ fieldName });\n }\n\n if (\n attributeInfo[0] &&\n attributeInfo[0].name === fieldName &&\n attributeInfo[0].collection_behavior === CollectionBehaviors.DO_NOT_COLLECT\n ) {\n throw new Error('do not collect');\n }\n\n const jucid = localStorage.getItem('uuid');\n const ga = getCookie('_ga');\n\n const payload = {\n jucid,\n ga,\n type,\n wapo_login_id, // TODO: move this to BE to read from cookie headers\n data: {\n [fieldName]: [value],\n },\n metadata: { source },\n };\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n credentials: 'include',\n headers: JSON_HEADERS,\n body: JSON.stringify(payload),\n });\n\n const json = await response.json();\n\n return json;\n } catch (e) {\n console.debug(e);\n return null;\n }\n};\n\ntype IngestType = ({\n submitData: { fieldName, value },\n source,\n}: {\n submitData: {\n fieldName: string;\n value: string;\n };\n type?: (typeof IngestType)[keyof typeof IngestType];\n source: string;\n}) => Promise<{\n status: ResponseStatus;\n state: (typeof IngestResponseState)[keyof typeof IngestResponseState];\n} | null>;\n","import React, { useEffect, useState } from 'react';\nimport { Icon, Select, styled, theme } from '@washingtonpost/wpds-ui-kit';\nimport { useWindowSize } from '@washingtonpost/subs-hooks';\nimport { ChevronDown } from '@washingtonpost/wpds-assets';\n\ninterface IDropdownProps {\n id: string;\n label: string;\n values: Array<string>;\n required?: boolean;\n defaultValue?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n}\n\nconst StyledMobileSelect = styled('select', {\n padding: '12px 16px 12px 6px',\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n backgroundColor: '$secondary',\n color: '$primary',\n fontFamily: '$meta',\n fontSize: '$100',\n fontWeight: '$light',\n lineHeight: '$125',\n paddingBlockRight: '$125',\n textOverflow: 'ellipsis',\n position: 'relative',\n borderColor: 'transparent',\n borderRightWidth: '10px',\n borderRightColor: 'transparent',\n appearance: 'none',\n '-webkit-appearance': 'none',\n '&:disabled': {\n backgroundColor: theme.colors.disabled,\n borderColor: theme.colors.disabled,\n color: theme.colors.onDisabled,\n cursor: 'not-allowed',\n },\n});\n\nconst StyledSelectWrapper = styled('div', {\n width: '100%',\n maxWidth: '380px',\n borderRadius: '$012',\n borderColor: '$subtle',\n borderStyle: 'solid',\n borderWidth: '1px',\n backgroundColor: '$secondary',\n position: 'relative',\n});\n\nconst StyledMobileOption = styled('option', {\n fontFamily: 'inherit',\n fontSize: 'inherit',\n color: 'inherit',\n});\n\n/**\n * Dropdown component. Uses wpds-ui-kit on desktop and native select on mobile.\n * @param {IDropdownProps} props The props.\n * @returns {React.ReactElement} The dropdown.\n */\nexport const Dropdown = ({\n id,\n label,\n values,\n required = false,\n defaultValue,\n onChange = () => {},\n disabled = false,\n}: IDropdownProps) => {\n const [answer, setAnswer] = useState<string>();\n const { isMobileSize } = useWindowSize();\n\n useEffect(() => {\n if (answer) onChange(answer);\n }, [answer]);\n\n const disabledProp = disabled ? { disabled: true } : {};\n\n // helps maintain state between WPDS and native dropdowns\n const defaultValueProp = answer\n ? { defaultValue: answer }\n : defaultValue\n ? { defaultValue }\n : {};\n\n const defaultValuePropMobile = (value: string) => {\n if (answer) {\n return value === answer ? { selected: true } : {};\n }\n return value === defaultValue ? { selected: true } : {};\n };\n\n return isMobileSize ? (\n <StyledSelectWrapper>\n <StyledMobileSelect\n id=\"\"\n required={required}\n onChange={(e) => setAnswer(e.target.value)}\n {...disabledProp}\n >\n <label>{label}</label>\n <StyledMobileOption\n value=\"\"\n disabled\n selected\n style={{ color: '#666666' }}\n >\n {label}\n </StyledMobileOption>\n {values.map((value) => (\n <StyledMobileOption\n value={value}\n key={value}\n {...defaultValuePropMobile(value)}\n >\n {value}\n </StyledMobileOption>\n ))}\n </StyledMobileSelect>\n <Icon\n label=\"\"\n size=\"100\"\n fill={theme.colors.gray80}\n style={{\n pointerEvents: 'none',\n position: 'absolute',\n right: '10px',\n top: '50%',\n transform: 'translateY(-50%)',\n }}\n >\n <ChevronDown style={{ position: 'absolute', right: '10px' }} />\n </Icon>\n </StyledSelectWrapper>\n ) : (\n <Select.Root\n onValueChange={(e) => setAnswer(e)}\n required={required}\n {...defaultValueProp}\n {...disabledProp}\n >\n <Select.Trigger data-test-id={`${id}-select-trigger`}>\n <Select.Label>{label}</Select.Label>\n <Select.Value />\n </Select.Trigger>\n <Select.Content\n css={{ zIndex: theme.zIndices.page }}\n data-test-id={`${id}-select-content`}\n >\n {values.map((value) => (\n <Select.Item value={value} key={value}>\n {value}\n </Select.Item>\n ))}\n </Select.Content>\n </Select.Root>\n );\n};\n","import React, { useState, useEffect } from 'react';\nimport { Select, styled } from '@washingtonpost/wpds-ui-kit';\nimport { ENDPOINTS, ResponseStatus } from '@washingtonpost/subs-sdk';\nimport { useScript, ScriptStatus } from '@washingtonpost/subs-hooks';\nimport { Attribute, AttributeValue, IngestType } from '../../interfaces';\nimport { Dropdown } from './Dropdown';\n\ninterface DESelectProps {\n source: string;\n fieldName: string;\n label?: string;\n dataDictionaryConfig?: Attribute;\n defaultValue?: string;\n disabled?: boolean;\n submit: boolean;\n onChange?: ({ value }: { value: string }) => void;\n onFinished?: ({\n isFinished,\n isError,\n }: {\n isFinished: boolean;\n isError: boolean;\n }) => void;\n valuesFilter?: (value: AttributeValue) => boolean;\n selectProps?: {\n root?: any;\n trigger?: any;\n label?: any;\n value?: any;\n content?: any;\n item?: any;\n };\n children?: React.ReactNode;\n}\n\nconst scriptSrc = `${\n ENDPOINTS.staticAssets === 'https://subscribe.washingtonpost.com/static'\n ? 'https://www.washingtonpost.com/subscribe/static/'\n : ENDPOINTS.staticAssets\n}/de-utils/twpdeu.min.js`;\n\nexport const DESelect: React.FC<DESelectProps> = ({\n source,\n fieldName,\n label,\n dataDictionaryConfig,\n defaultValue,\n disabled,\n submit,\n onChange = () => {},\n onFinished = () => {},\n valuesFilter = () => true,\n children,\n}) => {\n const [config, setConfig] = useState(dataDictionaryConfig);\n\n const [selected, setSelected] = useState('');\n\n const scriptStatus = useScript(scriptSrc);\n\n useEffect(() => {\n const fetchConfig = async () => {\n try {\n const config = await window?.__twpdeu?.getFieldConfigs({ fieldName });\n if (config) {\n setConfig(config[0]);\n } else {\n console.error('unable to get config', fieldName);\n }\n } catch (e) {\n console.warn('unable to get config', fieldName, e);\n }\n };\n\n if (scriptStatus === ScriptStatus.READY && !(children || config)) {\n fetchConfig();\n }\n }, [scriptStatus]);\n\n useEffect(() => {\n const submitSelected = async () => {\n try {\n // TODO: Log to GA?\n\n const result = await window?.__twpdeu?.push({\n submitData: { fieldName, value: selected },\n type: config?.explicit ? IngestType.EXPLICIT : IngestType.IMPLICIT,\n source,\n });\n\n const isError = result\n ? result.status !== ResponseStatus.SUCCESS\n : true;\n\n onFinished({\n isFinished: true,\n isError,\n });\n } catch (e) {\n onFinished({\n isFinished: false,\n isError: true,\n });\n }\n };\n\n if (scriptStatus === ScriptStatus.READY && submit && selected) {\n submitSelected();\n }\n }, [scriptStatus, submit]);\n\n const defaultValueProp = defaultValue && config ? { defaultValue } : {};\n\n const isLoading = !(children || config);\n\n const disabledProp = disabled || isLoading ? { disabled: true } : {};\n\n // sort and filter out archived values\n const values = config\n ? config.values\n .sort((a, b) => a.order - b.order)\n .filter((value) => value.archived !== true)\n .filter(valuesFilter)\n : [];\n\n return (\n <SelectWrapper>\n {children && (\n <Select.Root\n onValueChange={(e) => {\n setSelected(e);\n onChange({ value: e });\n }}\n {...defaultValueProp}\n {...disabledProp}\n >\n {children}\n </Select.Root>\n )}\n {!children && !config && (\n <Dropdown\n id={'loading'}\n label={'Loading...'}\n values={[]}\n disabled={true}\n />\n )}\n {!children && config && (\n <Dropdown\n id={config.name}\n label={label || config.name}\n onChange={(e) => {\n setSelected(e);\n onChange({ value: e });\n }}\n values={values.map((value) => value.name)}\n defaultValue={defaultValue}\n disabled={disabled}\n />\n )}\n </SelectWrapper>\n );\n};\n\nconst SelectWrapper = styled('div', {\n boxSizing: 'border-box',\n display: 'flex',\n marginBottom: '$100',\n flexDirection: 'column',\n '& button': {\n padding: '1px 6px',\n },\n '& *': { boxSizing: 'border-box' },\n});\n"],"names":["CollectionBehaviors","COLLECT","DO_NOT_COLLECT","AttributesState","SUCCESS","IngestType","EXPLICIT","IMPLICIT","IngestResponseState","SYSTEM_ERROR","INVALID_TYPE","INVALID_IDENTIFIER","INVALID_DATA","INVALID_ATTRIBUTE_DEFINITION","INVALID_META_DEFINITION","UNAUTHENTICATED","MISMATCHED_IDENTIFIER","DISABLED_ATTRIBUTE_DEFINITION","hasRequiredPrivacyCookies","_WPGeo","window","wp_usp","getCookie","countryCode","WPGeo","country_code","base","ENDPOINTS","attributesCache","getAttributes","fieldName","fieldNames","url","URL","searchParams","set","join","data","fetch","toString","credentials","headers","JSON_HEADERS","json","ok","status","ResponseStatus","attributes","e","console","debug","ingest","submitData","value","type","source","wapo_login_id","Error","attributeInfo","name","collection_behavior","jucid","localStorage","getItem","ga","payload","metadata","response","method","body","JSON","stringify","StyledMobileSelect","styled","padding","display","justifyContent","width","backgroundColor","color","fontFamily","fontSize","fontWeight","lineHeight","paddingBlockRight","textOverflow","position","borderColor","borderRightWidth","borderRightColor","appearance","theme","colors","disabled","onDisabled","cursor","StyledSelectWrapper","maxWidth","borderRadius","borderStyle","borderWidth","StyledMobileOption","Dropdown","id","label","values","required","defaultValue","onChange","answer","setAnswer","useState","isMobileSize","useWindowSize","useEffect","disabledProp","defaultValueProp","defaultValuePropMobile","selected","React","createElement","target","style","map","key","Icon","size","fill","gray80","pointerEvents","right","top","transform","ChevronDown","Select","Root","onValueChange","Trigger","Label","Value","Content","css","zIndex","zIndices","page","Item","scriptSrc","staticAssets","DESelect","dataDictionaryConfig","submit","onFinished","valuesFilter","children","config","setConfig","setSelected","scriptStatus","useScript","fetchConfig","_window","__twpdeu","getFieldConfigs","error","warn","ScriptStatus","READY","submitSelected","_window2","result","push","explicit","isError","isFinished","isLoading","sort","a","b","order","filter","archived","SelectWrapper","boxSizing","marginBottom","flexDirection"],"mappings":";;;;;;AAQO,MAAMA,mBAAmB,GAAG;AACjCC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,cAAc,EAAE,gBAAA;EACR;AAcH,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,KAAA;EACD;AAEH,MAAMC,UAAU,GAAG;AACxBC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,QAAQ,EAAE,UAAA;EACF;AAEH,MAAMC,mBAAmB,GAAG;AACjCJ,EAAAA,OAAO,EAAE,KAAK;AACdK,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,kBAAkB,EAAE,KAAK;AACzBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,4BAA4B,EAAE,KAAK;AACnCC,EAAAA,uBAAuB,EAAE,KAAK;AAC9BC,EAAAA,eAAe,EAAE,KA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,IAAA;AAAI,GAAA,CAEjB,EACA,CAAC4D,QAAQ,IAAIC,MAAM,IAClBnC,KAAC,CAAAC,aAAA,CAAAlB,QAAQ,EACP;IAAAC,EAAE,EAAEmD,MAAM,CAAC/F,IAAI;AACf6C,IAAAA,KAAK,EAAEA,KAAK,IAAIkD,MAAM,CAAC/F,IAAI;IAC3BiD,QAAQ,EAAG5D,CAAC,IAAI;MACd4G,WAAW,CAAC5G,CAAC,CAAC,CAAA;AACd4D,MAAAA,QAAQ,CAAC;AAAEvD,QAAAA,KAAK,EAAEL,CAAAA;AAAC,OAAE,CAAC,CAAA;KACvB;IACDyD,MAAM,EAAEA,MAAM,CAACkB,GAAG,CAAEtE,KAAK,IAAKA,KAAK,CAACM,IAAI,CAAC;AACzCgD,IAAAA,YAAY,EAAEA,YAAY;AAC1Bd,IAAAA,QAAQ,EAAEA,QAAAA;AACV,GAAA,CACH,CACa,CAAA;AAEpB,EAAC;AAED,MAAMwF,aAAa,gBAAG5G,MAAM,CAAC,KAAK,EAAE;AAClC6G,EAAAA,SAAS,EAAE,YAAY;AACvB3G,EAAAA,OAAO,EAAE,MAAM;AACf4G,EAAAA,YAAY,EAAE,MAAM;AACpBC,EAAAA,aAAa,EAAE,QAAQ;AACvB,EAAA,UAAU,EAAE;AACV9G,IAAAA,OAAO,EAAE,SAAA;GACV;AACD,EAAA,KAAK,EAAE;AAAE4G,IAAAA,SAAS,EAAE,YAAA;AAAc,GAAA;AACnC,CAAA,CAAC;;;;"}
@@ -1 +1 @@
1
- export declare const hasRequiredPrivacyCookies: () => boolean;
1
+ export declare const hasRequiredPrivacyCookies: () => boolean;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.7",
2
+ "version": "1.0.0-react18.1",
3
3
  "license": "UNLICENSED",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -8,24 +8,23 @@
8
8
  "README.md"
9
9
  ],
10
10
  "scripts": {
11
- "start": "tsdx watch --verbose --noClean",
12
- "build": "tsdx build",
13
- "test": "APP_ENV=test tsdx test",
14
- "lint": "tsdx lint",
11
+ "start": "dts watch --verbose --noClean",
12
+ "build": "dts build",
13
+ "test": "APP_ENV=test dts test",
14
+ "lint": "dts lint",
15
15
  "size": "NODE_OPTIONS=--openssl-legacy-provider size-limit",
16
16
  "analyze": "size-limit --why",
17
17
  "prettier-check": "prettier \"**/*.{js,jsx,tsx,ts}\" --list-different --write",
18
- "prepare": "tsdx build",
19
- "prepublishOnly": "yarn run build && yarn run size",
20
- "pre-commit": "tsdx test --onlyChanged",
21
- "pre-push": "yarn run prepublishOnly"
18
+ "prepublishOnly": "npm run build && yarn run size",
19
+ "pre-commit": "dts test --onlyChanged",
20
+ "pre-push": "npm run prepublishOnly"
22
21
  },
23
22
  "peerDependencies": {
24
- "@washingtonpost/subs-sdk": ">=1.15.12",
25
- "@washingtonpost/subs-hooks": ">=0.22.2",
26
- "@washingtonpost/wpds-ui-kit": "^1.10.0",
27
- "react": ">=17.0.2",
28
- "react-dom": ">=17.0.2"
23
+ "@washingtonpost/subs-sdk": "2.0.0-react18.13",
24
+ "@washingtonpost/subs-hooks": "1.0.0-react18.16",
25
+ "@washingtonpost/wpds-ui-kit": "2.1.2",
26
+ "react": ">=18.2.0",
27
+ "react-dom": ">=18.2.0"
29
28
  },
30
29
  "name": "@washingtonpost/subs-de-inputs",
31
30
  "author": "Subs FE",
@@ -35,7 +34,7 @@
35
34
  {
36
35
  "name": "de-inputs: utils",
37
36
  "path": "dist/subs-de-inputs.esm.js",
38
- "import": "{ getAttributes, push }",
37
+ "import": "{ getAttributes, ingest }",
39
38
  "limit": "1.5 KB"
40
39
  },
41
40
  {
@@ -43,33 +42,25 @@
43
42
  "path": "dist/subs-de-inputs.esm.js",
44
43
  "import": "{ DESelect }",
45
44
  "limit": "2.5 KB"
46
- },
47
- {
48
- "name": "de-inputs: DEDisclosure",
49
- "path": "dist/subs-de-inputs.esm.js",
50
- "import": "{ DEDisclosure }",
51
- "limit": "1.5 KB"
52
45
  }
53
46
  ],
54
47
  "devDependencies": {
55
- "@babel/core": "^7.12.3",
48
+ "@babel/core": "^7.22.17",
56
49
  "@babel/plugin-transform-optional-chaining": "^7.24.1",
57
- "@size-limit/preset-small-lib": "^4.10.2",
58
- "@testing-library/react-hooks": "^5.0.0",
59
- "@types/enzyme": "^3.10.7",
60
- "@types/jest": "^26.0.14",
50
+ "@size-limit/preset-small-lib": "^11.0.2",
51
+ "@testing-library/react-hooks": "^7.0.2",
52
+ "@types/enzyme": "^3.10.18",
53
+ "@types/jest": "^29.5.11",
61
54
  "@types/lodash": "^4.14.170",
62
55
  "@types/mocha": "^8.0.3",
63
- "@types/styled-components": "^5.1.10",
64
- "@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
65
- "babel-loader": "^8.1.0",
56
+ "@cfaester/enzyme-adapter-react-18": "^0.7.1",
57
+ "babel-loader": "^9.1.3",
66
58
  "enzyme": "^3.11.0",
67
- "enzyme-to-json": "^3.6.1",
59
+ "enzyme-to-json": "^3.6.2",
68
60
  "isomorphic-fetch": "^3.0.0",
69
- "jest-environment-jsdom": "26.6",
61
+ "jest-environment-jsdom": "^29.7.0",
70
62
  "nock": "^13.0.5",
71
- "react-test-renderer": "^17.0.1",
72
- "tslib": "^2.0.3"
63
+ "tslib": "^2.6.2"
73
64
  },
74
65
  "browserslist": [
75
66
  "last 2 Chrome versions",
package/CHANGELOG.md DELETED
@@ -1,69 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file. See
4
- [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- **[0.5.7 - 2024-10-16]**:
7
- * Add `DeleteAttributeState`
8
-
9
- **[0.5.6 - 2024-10-14]**:
10
- * export interface `IProfileResponse`
11
-
12
- **[0.5.5 - 2024-10-11]**:
13
- * Add `FirstPartyIngestDataTypes.JOB_TITLE`
14
-
15
- **[0.5.4 - 2024-09-19]**:
16
- * Version bump only to validate release process
17
-
18
- **[0.5.3 - 2024-07-09]**:
19
- * Add `FirstPartyIngestDataTypes` constant
20
-
21
- **[0.5.2 - 2024-07-05]**:
22
- * Fix for cookie thing
23
-
24
- **[0.5.1 - 2024-06-03]**:
25
- * Fix for multi paragraph disclosures
26
- * Support hydration for Privacy Policy link
27
-
28
- **[0.5.0 - 2024-05-30]**:
29
- * Added Disclosure component
30
-
31
- **[0.4.2 - 2024-05-10]**:
32
- * Fix exception from `<DESelect />` if `dataDictionaryConfig` prop is readonly (such as in redux toolkit)
33
- * Don't submit data if wp_wv cookie and anonymous user (feedback from ERD)
34
-
35
- **[0.4.1 - 2024-05-07]**:
36
- * Set the correct `type` for ingest() API
37
-
38
- **[0.4.0 - 2024-05-07]**:
39
- * Support for `implicit` collection via GA
40
-
41
- **[0.3.0 - 2024-05-06]**:
42
- * Uses the native `<select />` element in smaller viewport sizes for better UX
43
-
44
- **[0.2.2 - 2024-05-03]**:
45
- * use `window.__twpdeu.push()` for submitting
46
- * Better loading state when fetching config over the wire
47
- * Prevent extra calls to `ingest` API if user changes value after clicking submit
48
- * Fix `ingest()` function to send the right format (again)
49
-
50
- **[0.2.1 - 2024-05-02]**:
51
- * Revert "ESM build only"
52
- * `ingest()` function throws error if `submitData.value` is not an array (required by BE)
53
-
54
- **[0.2.0 - 2024-05-01]**:
55
- * Adds `ingest()` function
56
- * ESM build only
57
- * Babel config to target recent browsers only
58
-
59
- **[0.1.1 - 2024-04-30]**:
60
- * Fix build by removing unused file
61
-
62
- **[0.1.0 - 2024-04-25]**:
63
- * Add initial `<DESelect />` component
64
-
65
- **[0.0.2 - 2024-04-24]**:
66
- * Fix build error
67
-
68
- **[0.0.1 - 2024-04-09]**:
69
- * Initial setup
@@ -1,23 +0,0 @@
1
- import { ICookieStore } from '@washingtonpost/subs-sdk';
2
- interface TCData {
3
- eventStatus: 'tcloaded' | 'cmpuishown' | 'useractioncomplete';
4
- listenerId: number;
5
- [key: string]: any;
6
- }
7
- declare type TCFAPIAddListener = (command: 'addEventListener', version: number, callback: (tcData: TCData, success: boolean) => void) => void;
8
- declare type TCFAPIRmListener = (command: 'removeEventListener', version: number, callback: (success: boolean) => void, listenerId: number) => void;
9
- declare type TCFAPIPing = (command: 'ping', version: number, callback: (pingReturn: any, success: boolean) => void) => void;
10
- declare global {
11
- interface Window {
12
- cookieStore?: ICookieStore;
13
- __tcfapi?: TCFAPIAddListener & TCFAPIRmListener & TCFAPIPing;
14
- }
15
- }
16
- export declare const useOneTrustAlertBoxClosed: ({ allowCookieStore, }: {
17
- allowCookieStore: boolean;
18
- }) => {
19
- alertBoxClosed: boolean | undefined;
20
- listenToCookieStore: boolean;
21
- listenToTcfApi: boolean;
22
- };
23
- export {};
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- interface DisclosureProps {
3
- /** callback function to be called when the disclosure is finished loading */
4
- onFinished?: ({ isFinished, isError, }: {
5
- isFinished: boolean;
6
- isError: boolean;
7
- }) => void;
8
- /** ability to turn off cookiestore listener, primarily for testing purposes */
9
- allowCookieStore?: boolean;
10
- }
11
- export declare const DEDisclosure: React.FC<DisclosureProps>;
12
- export {};
@@ -1 +0,0 @@
1
- export declare const checkCookie: () => boolean;
@@ -1,2 +0,0 @@
1
- import { DisclosureConfigValue } from '../../../interfaces/disclosure';
2
- export declare const getConfig: () => Promise<DisclosureConfigValue | undefined>;
@@ -1,3 +0,0 @@
1
- declare type hydrateLinksType = (str: string) => string | JSX.Element;
2
- export declare const hydrateLinks: hydrateLinksType;
3
- export {};
@@ -1,15 +0,0 @@
1
- export declare const FirstPartyIngestDataTypes: {
2
- readonly JOB_LEVEL: "profile_job_level";
3
- readonly JOB_INDUSTRY: "profile_job_industry";
4
- readonly JOB_TITLE: "profile_job_title";
5
- readonly PERSONAL_GOALS: "personal_goals";
6
- readonly HOBBIES: "hobbies";
7
- readonly PROFESSIONAL_GOALS: "professional_goals";
8
- readonly INDUSTRY: "industry";
9
- readonly NEWS_LOCATION: "news_location";
10
- readonly NY_PERSONAL_GOALS: "new_year_personal_goals";
11
- readonly NY_HOBBIES: "new_year_hobbies";
12
- readonly NY_PROFESSIONAL_GOALS: "new_year_professional_goals";
13
- readonly NY_INDUSTRY: "new_year_industry";
14
- readonly NY_NEWS_LOCATION: "new_year_news_location";
15
- };
@@ -1,8 +0,0 @@
1
- export declare type DisclosureConfigValue = {
2
- disclosure: string[];
3
- } & {
4
- checkBannerStatus: boolean;
5
- disclosure_beforebanner: string[];
6
- disclosure_afterbanner: string[];
7
- };
8
- export declare type DisclosureConfig = Record<string, DisclosureConfigValue>;
@@ -1,6 +0,0 @@
1
- import { Attribute } from '../interfaces';
2
- export declare const getAttributes: GetAttributesType;
3
- declare type GetAttributesType = ({ fieldName, }: {
4
- fieldName: string;
5
- }) => Promise<Attribute[]>;
6
- export {};
@@ -1,14 +0,0 @@
1
- import { ResponseStatus } from '@washingtonpost/subs-sdk';
2
- import { IngestResponseState, IngestType } from '../interfaces';
3
- export declare const ingest: IngestType;
4
- declare type IngestType = ({ submitData: { fieldName, value }, source, }: {
5
- submitData: {
6
- fieldName: string;
7
- value: string;
8
- };
9
- source: string;
10
- }) => Promise<{
11
- status: ResponseStatus;
12
- state: (typeof IngestResponseState)[keyof typeof IngestResponseState];
13
- } | null>;
14
- export {};
@@ -1,9 +0,0 @@
1
- export declare const sendToGA: SendToGaType;
2
- declare type SendToGaType = ({ submitData: { fieldName, value }, source, }: {
3
- submitData: {
4
- fieldName: string;
5
- value: string;
6
- };
7
- source: string;
8
- }) => Promise<true>;
9
- export {};
@@ -1 +0,0 @@
1
- export declare const isAnonymousWebview: () => boolean;
@@ -1,14 +0,0 @@
1
- import { IngestResponseState } from '../interfaces';
2
- import { ResponseStatus } from '@washingtonpost/subs-sdk';
3
- export declare const push: PushType;
4
- declare type PushType = ({ submitData: { fieldName, value }, source, }: {
5
- submitData: {
6
- fieldName: string;
7
- value: string;
8
- };
9
- source: string;
10
- }) => Promise<{
11
- status: ResponseStatus;
12
- state: (typeof IngestResponseState)[keyof typeof IngestResponseState];
13
- } | null | true>;
14
- export {};