@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.
- package/dist/components/DESelect/Dropdown.d.ts +17 -16
- package/dist/components/DESelect/index.d.ts +30 -30
- package/dist/index.d.ts +5 -8
- package/dist/interfaces/index.d.ts +42 -61
- package/dist/interfaces/twpdeu.d.ts +11 -12
- package/dist/services/dataEnrichment.d.ts +19 -0
- package/dist/subs-de-inputs.cjs.development.js +70 -353
- package/dist/subs-de-inputs.cjs.development.js.map +1 -1
- package/dist/subs-de-inputs.cjs.production.min.js +1 -1
- package/dist/subs-de-inputs.cjs.production.min.js.map +1 -1
- package/dist/subs-de-inputs.esm.js +59 -336
- package/dist/subs-de-inputs.esm.js.map +1 -1
- package/dist/utils/hasRequiredPrivacyCookies.d.ts +1 -1
- package/package.json +24 -33
- package/CHANGELOG.md +0 -69
- package/dist/components/DEDisclosure/hooks/useOnetrustAlertBoxClosedPromise.d.ts +0 -23
- package/dist/components/DEDisclosure/index.d.ts +0 -12
- package/dist/components/DEDisclosure/utils/checkCookie.d.ts +0 -1
- package/dist/components/DEDisclosure/utils/getConfig.d.ts +0 -2
- package/dist/components/DEDisclosure/utils/hydrateLinks.d.ts +0 -3
- package/dist/constants/IngestDataTypes.d.ts +0 -15
- package/dist/interfaces/disclosure.d.ts +0 -8
- package/dist/services/getAttributes.d.ts +0 -6
- package/dist/services/ingest.d.ts +0 -14
- package/dist/services/sendToGA.d.ts +0 -9
- package/dist/utils/isAnonymousWebview.d.ts +0 -1
- package/dist/utils/push.d.ts +0 -14
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IDropdownProps {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
values: Array<string>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Dropdown component. Uses wpds-ui-kit on desktop and native select on mobile.
|
|
13
|
+
* @param {IDropdownProps} props The props.
|
|
14
|
+
* @returns {React.ReactElement} The dropdown.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Dropdown: ({ id, label, values, required, defaultValue, onChange, disabled, }: IDropdownProps) => React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Attribute, AttributeValue } from '../../interfaces';
|
|
3
|
-
interface DESelectProps {
|
|
4
|
-
source: string;
|
|
5
|
-
fieldName: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
dataDictionaryConfig?: Attribute
|
|
8
|
-
defaultValue?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
submit: boolean;
|
|
11
|
-
onChange?: ({ value }: {
|
|
12
|
-
value: string;
|
|
13
|
-
}) => void;
|
|
14
|
-
onFinished?: ({ isFinished, isError, }: {
|
|
15
|
-
isFinished: boolean;
|
|
16
|
-
isError: boolean;
|
|
17
|
-
}) => void;
|
|
18
|
-
valuesFilter?: (value: AttributeValue) => boolean;
|
|
19
|
-
selectProps?: {
|
|
20
|
-
root?: any;
|
|
21
|
-
trigger?: any;
|
|
22
|
-
label?: any;
|
|
23
|
-
value?: any;
|
|
24
|
-
content?: any;
|
|
25
|
-
item?: any;
|
|
26
|
-
};
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
}
|
|
29
|
-
export declare const DESelect: React.FC<DESelectProps>;
|
|
30
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Attribute, AttributeValue } from '../../interfaces';
|
|
3
|
+
interface DESelectProps {
|
|
4
|
+
source: string;
|
|
5
|
+
fieldName: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
dataDictionaryConfig?: Attribute;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
submit: boolean;
|
|
11
|
+
onChange?: ({ value }: {
|
|
12
|
+
value: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
onFinished?: ({ isFinished, isError, }: {
|
|
15
|
+
isFinished: boolean;
|
|
16
|
+
isError: boolean;
|
|
17
|
+
}) => void;
|
|
18
|
+
valuesFilter?: (value: AttributeValue) => boolean;
|
|
19
|
+
selectProps?: {
|
|
20
|
+
root?: any;
|
|
21
|
+
trigger?: any;
|
|
22
|
+
label?: any;
|
|
23
|
+
value?: any;
|
|
24
|
+
content?: any;
|
|
25
|
+
item?: any;
|
|
26
|
+
};
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const DESelect: React.FC<DESelectProps>;
|
|
30
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
export * from './interfaces/index';
|
|
2
|
-
export * from './interfaces/twpdeu';
|
|
3
|
-
export * from './utils/hasRequiredPrivacyCookies';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './components/DESelect';
|
|
7
|
-
export * from './components/DEDisclosure';
|
|
8
|
-
export { FirstPartyIngestDataTypes } from './constants/IngestDataTypes';
|
|
1
|
+
export * from './interfaces/index';
|
|
2
|
+
export * from './interfaces/twpdeu';
|
|
3
|
+
export * from './utils/hasRequiredPrivacyCookies';
|
|
4
|
+
export * from './services/dataEnrichment';
|
|
5
|
+
export * from './components/DESelect';
|
|
@@ -1,61 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readonly
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
|
|
43
|
-
readonly INVALID_ATTRIBUTE_DEFINITION: "105";
|
|
44
|
-
readonly INVALID_META_DEFINITION: "106";
|
|
45
|
-
readonly UNAUTHENTICATED: "107";
|
|
46
|
-
readonly MISMATCHED_IDENTIFIER: "108";
|
|
47
|
-
readonly DISABLED_ATTRIBUTE_DEFINITION: "109";
|
|
48
|
-
readonly DO_NOT_COLLECT: "110";
|
|
49
|
-
};
|
|
50
|
-
export interface IProfileResponse {
|
|
51
|
-
status: ResponseStatusType;
|
|
52
|
-
state: typeof AttributesState;
|
|
53
|
-
attributes: {
|
|
54
|
-
[key: string]: {
|
|
55
|
-
attribute_name: string;
|
|
56
|
-
value: string | null;
|
|
57
|
-
date_created: number;
|
|
58
|
-
last_modified_date: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}
|
|
1
|
+
export type AttributeValue = {
|
|
2
|
+
name: string;
|
|
3
|
+
date_created: Number;
|
|
4
|
+
last_modified_date: Number;
|
|
5
|
+
archived: boolean;
|
|
6
|
+
order: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const CollectionBehaviors: {
|
|
9
|
+
readonly COLLECT: "COLLECT";
|
|
10
|
+
readonly DO_NOT_COLLECT: "DO_NOT_COLLECT";
|
|
11
|
+
};
|
|
12
|
+
export type Attribute = {
|
|
13
|
+
name: string;
|
|
14
|
+
approved_for_use?: boolean;
|
|
15
|
+
collection_behavior?: (typeof CollectionBehaviors)[keyof typeof CollectionBehaviors];
|
|
16
|
+
datatype: 'string';
|
|
17
|
+
explicit: boolean;
|
|
18
|
+
multiple_value: boolean;
|
|
19
|
+
last_modified_date: Number;
|
|
20
|
+
date_created: Number;
|
|
21
|
+
values: Array<AttributeValue>;
|
|
22
|
+
};
|
|
23
|
+
export declare const AttributesState: {
|
|
24
|
+
readonly SUCCESS: "100";
|
|
25
|
+
};
|
|
26
|
+
export declare const IngestType: {
|
|
27
|
+
readonly EXPLICIT: "explicit";
|
|
28
|
+
readonly IMPLICIT: "implicit";
|
|
29
|
+
};
|
|
30
|
+
export declare const IngestResponseState: {
|
|
31
|
+
readonly SUCCESS: "100";
|
|
32
|
+
readonly SYSTEM_ERROR: "101";
|
|
33
|
+
readonly INVALID_TYPE: "102";
|
|
34
|
+
readonly INVALID_IDENTIFIER: "103";
|
|
35
|
+
readonly INVALID_DATA: "104";
|
|
36
|
+
readonly INVALID_ATTRIBUTE_DEFINITION: "105";
|
|
37
|
+
readonly INVALID_META_DEFINITION: "106";
|
|
38
|
+
readonly UNAUTHENTICATED: "107";
|
|
39
|
+
readonly MISMATCHED_IDENTIFIER: "108";
|
|
40
|
+
readonly DISABLED_ATTRIBUTE_DEFINITION: "109";
|
|
41
|
+
readonly DO_NOT_COLLECT: "110";
|
|
42
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { getAttributes } from '../services/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
1
|
+
import { getAttributes, ingest } from '../services/dataEnrichment';
|
|
2
|
+
export type TWPDEU = {
|
|
3
|
+
getFieldConfigs: typeof getAttributes;
|
|
4
|
+
push: typeof ingest;
|
|
5
|
+
version?: string;
|
|
6
|
+
};
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
__twpdeu?: TWPDEU;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResponseStatus } from '@washingtonpost/subs-sdk';
|
|
2
|
+
import { Attribute, IngestResponseState, IngestType } from '../interfaces';
|
|
3
|
+
export declare const getAttributes: GetAttributesType;
|
|
4
|
+
type GetAttributesType = ({ fieldName, }: {
|
|
5
|
+
fieldName: string;
|
|
6
|
+
}) => Promise<Attribute[]>;
|
|
7
|
+
export declare const ingest: IngestType;
|
|
8
|
+
type IngestType = ({ submitData: { fieldName, value }, source, }: {
|
|
9
|
+
submitData: {
|
|
10
|
+
fieldName: string;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
type?: (typeof IngestType)[keyof typeof IngestType];
|
|
14
|
+
source: string;
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
status: ResponseStatus;
|
|
17
|
+
state: (typeof IngestResponseState)[keyof typeof IngestResponseState];
|
|
18
|
+
} | null>;
|
|
19
|
+
export {};
|