@xyo-network/react-advertising 6.1.3 → 6.2.0
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/browser/index.d.ts +2 -51
- package/package.json +11 -11
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Utm } from '@xyo-network/advertising-payload-plugins';
|
|
4
|
-
import * as _xyo_network_archivist_model from '@xyo-network/archivist-model';
|
|
5
|
-
import * as _xyo_network_archivist_storage from '@xyo-network/archivist-storage';
|
|
6
|
-
import { StorageArchivist } from '@xyo-network/archivist-storage';
|
|
7
|
-
|
|
8
|
-
declare const useCaptureUtmLocation: (removeAfterCapture?: boolean) => {
|
|
9
|
-
utmPayload: _xyo_network_payload_model.Payload<Utm, void> | null;
|
|
10
|
-
error: Error | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type PageStateKeys = ReadonlyArray<string>;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Find or create a single instance of the UtmStorageArchivist
|
|
17
|
-
* @returns Archivist instance
|
|
18
|
-
*/
|
|
19
|
-
declare const UtmStorageArchivist: () => Promise<StorageArchivist<_xyo_network_archivist_storage.StorageArchivistParams, _xyo_network_archivist_model.ArchivistModuleEventData>>;
|
|
20
|
-
declare const LatestUtmPayload: () => Promise<PayloadWithOptionalSources<Utm> | undefined>;
|
|
21
|
-
|
|
22
|
-
interface DefaultPageStateParams<TQueryParams extends PageStateKeys = PageStateKeys> {
|
|
23
|
-
queryParams: TQueryParams;
|
|
24
|
-
}
|
|
25
|
-
type DefaultPageStateReturn<TPageStateKeys extends PageStateKeys = PageStateKeys> = [
|
|
26
|
-
Record<TPageStateKeys[number], string>,
|
|
27
|
-
(source: keyof DefaultPageStateParams, key: TPageStateKeys[number], value: string) => void
|
|
28
|
-
];
|
|
29
|
-
/**
|
|
30
|
-
* Hook to get default page state as key value pairs from various sources. It provides a convenient abstraction over free form
|
|
31
|
-
* page state like query params by narrowing the used params and centralizing their logic.
|
|
32
|
-
*
|
|
33
|
-
* Future work could include adding support for localStorage, sessionStorage, and precedence of sources.
|
|
34
|
-
* @param defaultPageStateParams various sources of default page state (i.e. queryParams, localStorage, etc.)
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
declare const useDefaultPageState: <TQueryParams extends PageStateKeys = PageStateKeys>({ queryParams }: DefaultPageStateParams<TQueryParams>) => DefaultPageStateReturn<TQueryParams>;
|
|
38
|
-
|
|
39
|
-
declare const UtmQueryParamStrings: {
|
|
40
|
-
readonly utmCampaign: "utm_campaign";
|
|
41
|
-
readonly utmContent: "utm_content";
|
|
42
|
-
readonly utmMedium: "utm_medium";
|
|
43
|
-
readonly utmSource: "utm_source";
|
|
44
|
-
readonly utmTerm: "utm_term";
|
|
45
|
-
};
|
|
46
|
-
type UtmQueryParams = typeof UtmQueryParamStrings[keyof typeof UtmQueryParamStrings];
|
|
47
|
-
/** Get the default page state for utm values from specific query params */
|
|
48
|
-
declare const useDefaultUtmPageState: () => DefaultPageStateReturn<UtmQueryParams[]>;
|
|
49
|
-
|
|
50
|
-
export { LatestUtmPayload, UtmQueryParamStrings, UtmStorageArchivist, useCaptureUtmLocation, useDefaultPageState, useDefaultUtmPageState };
|
|
51
|
-
export type { DefaultPageStateParams, DefaultPageStateReturn, PageStateKeys, UtmQueryParams };
|
|
1
|
+
export * from './utm/index.ts';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-advertising",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"module": "dist/browser/index.mjs",
|
|
40
40
|
"types": "dist/browser/index.d.ts",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@xylabs/react-promise": "^6.
|
|
43
|
-
"@xyo-network/advertising-payload-plugins": "^4.1.
|
|
44
|
-
"@xyo-network/archivist-storage": "^4.
|
|
45
|
-
"@xyo-network/payload-model": "^4.
|
|
42
|
+
"@xylabs/react-promise": "^6.4.0",
|
|
43
|
+
"@xyo-network/advertising-payload-plugins": "^4.1.1",
|
|
44
|
+
"@xyo-network/archivist-storage": "^4.3.0",
|
|
45
|
+
"@xyo-network/payload-model": "^4.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@mui/material": "^7.2.0",
|
|
49
|
-
"@storybook/react-vite": "^9.0.
|
|
49
|
+
"@storybook/react-vite": "^9.0.18",
|
|
50
50
|
"@types/react": "^19.1.8",
|
|
51
|
-
"@xylabs/ts-scripts-yarn3": "
|
|
52
|
-
"@xylabs/tsconfig-react": "
|
|
53
|
-
"react": "^19.1.
|
|
54
|
-
"react-dom": "^19.1.
|
|
55
|
-
"storybook": "^9.0.
|
|
51
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.1",
|
|
52
|
+
"@xylabs/tsconfig-react": "^7.0.1",
|
|
53
|
+
"react": "^19.1.1",
|
|
54
|
+
"react-dom": "^19.1.1",
|
|
55
|
+
"storybook": "^9.0.18",
|
|
56
56
|
"typescript": "^5.8.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|