@remkoj/optimizely-cms-react 1.0.3

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.
Files changed (59) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +2 -0
  3. package/dist/browser/context.d.ts +6 -0
  4. package/dist/browser/context.js +15 -0
  5. package/dist/browser/context.js.map +1 -0
  6. package/dist/browser/index.d.ts +1 -0
  7. package/dist/browser/index.js +2 -0
  8. package/dist/browser/index.js.map +1 -0
  9. package/dist/errors.d.ts +5 -0
  10. package/dist/errors.js +11 -0
  11. package/dist/errors.js.map +1 -0
  12. package/dist/factory.d.ts +30 -0
  13. package/dist/factory.js +65 -0
  14. package/dist/factory.js.map +1 -0
  15. package/dist/index.d.ts +8 -0
  16. package/dist/index.js +10 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/server/components/cms-content-area.d.ts +14 -0
  19. package/dist/server/components/cms-content-area.js +101 -0
  20. package/dist/server/components/cms-content-area.js.map +1 -0
  21. package/dist/server/components/cms-content.d.ts +12 -0
  22. package/dist/server/components/cms-content.js +106 -0
  23. package/dist/server/components/cms-content.js.map +1 -0
  24. package/dist/server/components/get-content-type.d.ts +12 -0
  25. package/dist/server/components/get-content-type.js +55 -0
  26. package/dist/server/components/get-content-type.js.map +1 -0
  27. package/dist/server/components/index.d.ts +2 -0
  28. package/dist/server/components/index.js +3 -0
  29. package/dist/server/components/index.js.map +1 -0
  30. package/dist/server/components/queries.d.ts +19 -0
  31. package/dist/server/components/queries.js +142 -0
  32. package/dist/server/components/queries.js.map +1 -0
  33. package/dist/server/components/types.d.ts +176 -0
  34. package/dist/server/components/types.js +2 -0
  35. package/dist/server/components/types.js.map +1 -0
  36. package/dist/server/components/utils.d.ts +10 -0
  37. package/dist/server/components/utils.js +28 -0
  38. package/dist/server/context.d.ts +35 -0
  39. package/dist/server/context.js +82 -0
  40. package/dist/server/context.js.map +1 -0
  41. package/dist/server/factory.d.ts +10 -0
  42. package/dist/server/factory.js +18 -0
  43. package/dist/server/factory.js.map +1 -0
  44. package/dist/server/index.d.ts +6 -0
  45. package/dist/server/index.js +6 -0
  46. package/dist/server/index.js.map +1 -0
  47. package/dist/server/is-debug.d.ts +3 -0
  48. package/dist/server/is-debug.js +19 -0
  49. package/dist/server/is-debug.js.map +1 -0
  50. package/dist/server/type-utils.d.ts +31 -0
  51. package/dist/server/type-utils.js +2 -0
  52. package/dist/server/type-utils.js.map +1 -0
  53. package/dist/types.d.ts +100 -0
  54. package/dist/types.js +2 -0
  55. package/dist/types.js.map +1 -0
  56. package/dist/utilities.d.ts +29 -0
  57. package/dist/utilities.js +98 -0
  58. package/dist/utilities.js.map +1 -0
  59. package/package.json +69 -0
@@ -0,0 +1,100 @@
1
+ import type { PropsWithChildren, ComponentType as ReactComponentType } from "react";
2
+ import type { DocumentNode } from "graphql";
3
+ import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
+ import type { IOptiGraphClient } from "@remkoj/optimizely-graph-client";
5
+ export type ContentType = string[];
6
+ export type ContentLink = {
7
+ id: number;
8
+ workId?: number | null;
9
+ guidValue?: string | null;
10
+ } | {
11
+ id?: number | null;
12
+ workId?: number | null;
13
+ guidValue: string;
14
+ };
15
+ export type InlineContentLink = {
16
+ id: 0;
17
+ workId?: 0 | null;
18
+ guidValue?: null | "";
19
+ } | {
20
+ id?: 0 | null;
21
+ workId?: 0 | null;
22
+ guidValue: "";
23
+ };
24
+ export type ContentLinkWithLocale = ContentLink & {
25
+ locale?: string;
26
+ };
27
+ export type CmsComponentProps<T> = PropsWithChildren<{
28
+ /**
29
+ * The identifier of the content item
30
+ */
31
+ contentLink: ContentLinkWithLocale;
32
+ /**
33
+ * The data already pre-fetched for the this component
34
+ */
35
+ data: T;
36
+ /**
37
+ * Use the Server/Client context instead if you need this information
38
+ *
39
+ * @deprecated
40
+ */
41
+ inEditMode?: boolean;
42
+ /**
43
+ * Use the Server/Client context instead if you need this information
44
+ *
45
+ * @deprecated
46
+ */
47
+ client?: IOptiGraphClient;
48
+ }>;
49
+ export type ContentQueryProps = ContentLinkWithLocale;
50
+ /**
51
+ * Extract the data type from a GraphQL Query
52
+ */
53
+ export type ResponseDataType<T extends DocumentNode> = T extends TypedDocumentNode<infer DataType> ? DataType : {
54
+ [key: string]: any;
55
+ };
56
+ export type GetDataQuery<T> = () => TypedDocumentNode<T, ContentQueryProps> | DocumentNode;
57
+ export type GetDataFragment<T> = () => [string, TypedDocumentNode<T, never> | DocumentNode];
58
+ export type WithGqlFragment<BaseComponent, DataType> = BaseComponent & {
59
+ getDataFragment: GetDataFragment<DataType>;
60
+ validateFragment?: (data: any) => data is DataType;
61
+ };
62
+ export type WithGqlQuery<B, T> = B & {
63
+ getDataQuery: GetDataQuery<T>;
64
+ };
65
+ export type BaseCmsComponent<T = {}> = T extends never | TypedDocumentNode | DocumentNode ? DynamicCmsComponent<T> : ReactComponentType<CmsComponentProps<T>>;
66
+ export type DynamicCmsComponent<T extends TypedDocumentNode | DocumentNode = DocumentNode> = ReactComponentType<CmsComponentProps<ResponseDataType<T>>>;
67
+ export type GraphQLFragmentBase = {
68
+ ' $fragmentName'?: string;
69
+ };
70
+ export type GraphQLQueryBase = {
71
+ __typename?: 'Query';
72
+ };
73
+ export type CmsComponentWithFragment<T = DocumentNode> = BaseCmsComponent<T> & WithGqlFragment<{}, T>;
74
+ export type CmsComponentWithQuery<T = DocumentNode> = BaseCmsComponent<T> & WithGqlQuery<{}, T>;
75
+ export type CmsComponentWithOptionalQuery<T = DocumentNode> = BaseCmsComponent<T> & Partial<WithGqlQuery<{}, T>>;
76
+ /**
77
+ * A generic Optimizely CMS Component that will change the static surface based upon the
78
+ * provided data type for the component. It will detect automatically whether the component
79
+ * requires a query or fragment to load the data and allows typechecking of the required
80
+ * getDataFragement / getDataQuery methods are valid.
81
+ *
82
+ * When a type is provided that cannot be resolved to either the output of a Query or a Fragment,
83
+ * it will assume an optional getDataQuery method.
84
+ */
85
+ export type CmsComponent<T = DocumentNode> = T extends TypedDocumentNode<infer R, any> ? CmsComponentWithQuery<R> : T extends DocumentNode ? CmsComponentWithQuery<{
86
+ [key: string]: any;
87
+ }> : T extends GraphQLFragmentBase ? CmsComponentWithFragment<T> : T extends GraphQLQueryBase ? CmsComponentWithQuery<T> : CmsComponentWithOptionalQuery<T>;
88
+ import type { createElement } from 'react';
89
+ export type ComponentType = Parameters<typeof createElement>[0];
90
+ export type ComponentTypeHandle = string | string[];
91
+ export type ComponentTypeDictionary = {
92
+ type: ComponentTypeHandle;
93
+ component: ComponentType;
94
+ }[];
95
+ export interface ComponentFactory {
96
+ has(type: ComponentTypeHandle): boolean;
97
+ register(type: ComponentTypeHandle, componentType: ComponentType): void;
98
+ registerAll(components: ComponentTypeDictionary): void;
99
+ resolve(type: ComponentTypeHandle): ComponentType | undefined;
100
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { ComponentType } from 'react';
2
+ import type * as Types from './types';
3
+ import type { DocumentNode } from 'graphql';
4
+ export declare function isContentLink(toTest: any): toTest is Types.ContentLink;
5
+ export declare function isContentLinkWithLocale(toTest: any): toTest is Types.ContentLinkWithLocale;
6
+ export declare function isNonEmptyString(toTest: any): toTest is string;
7
+ export declare function isNotNullOrUndefined<T>(toTest?: T | null): toTest is T;
8
+ export declare function isContentType(toTest: any): toTest is Types.ContentType;
9
+ export declare function normalizeContentType(toNormalize: (string | null)[] | null | undefined): Types.ContentType | undefined;
10
+ export declare function normalizeContentLink(toNormalize?: {
11
+ id?: null | number;
12
+ workId?: null | number;
13
+ guidValue?: null | string;
14
+ } | null): Types.ContentLink | undefined;
15
+ export declare function normalizeContentLinkWithLocale(toNormalize?: {
16
+ id?: null | number;
17
+ workId?: null | number;
18
+ guidValue?: null | string;
19
+ locale?: string | null;
20
+ } | null): Types.ContentLinkWithLocale | undefined;
21
+ export declare function isCmsComponentWithDataQuery<T = DocumentNode>(toTest?: Types.BaseCmsComponent<T>): toTest is Types.CmsComponentWithQuery<T>;
22
+ export declare function isCmsComponentWithFragment<T = DocumentNode>(toTest?: Types.BaseCmsComponent<T>): toTest is Types.CmsComponentWithFragment<T>;
23
+ export declare function validatesFragment<T extends ComponentType<any>>(toTest?: T): toTest is T & Pick<Required<Types.WithGqlFragment<T, any>>, "validateFragment">;
24
+ export declare function contentLocaleToGraphLocale<T>(contentLocale?: T): T extends string ? string : undefined;
25
+ export declare function contentLinkToRequestVariables(contentLink: Types.ContentLinkWithLocale): Types.ContentQueryProps;
26
+ export declare function isInlineContentLink(contentLink: Types.ContentLink): contentLink is Types.InlineContentLink;
27
+ export declare function contentLinkToString(contentLink: Types.ContentLink): string;
28
+ export declare function toUniqueValues<R extends any>(value: R, index: number, array: Array<R>): value is R;
29
+ export declare function trim<T extends string | null | undefined>(valueToTrim: T): T;
@@ -0,0 +1,98 @@
1
+ export function isContentLink(toTest) {
2
+ // It must be an object
3
+ if (typeof (toTest) != 'object' || toTest == null)
4
+ return false;
5
+ // The object must have an Id (numeric, >= 0) or GuidValue (string, minimum 1 character)
6
+ return (typeof (toTest.id) == 'number' && toTest.id >= 0) ||
7
+ (typeof (toTest.guidValue) == 'string' && toTest.guidValue.length > 0);
8
+ }
9
+ export function isContentLinkWithLocale(toTest) {
10
+ if (!isContentLink(toTest))
11
+ return false;
12
+ const locale = toTest.locale;
13
+ return locale == undefined || (typeof (locale) == 'string' && locale.length >= 2 && locale.length <= 5);
14
+ }
15
+ export function isNonEmptyString(toTest) {
16
+ return typeof (toTest) == 'string' && toTest.length > 0;
17
+ }
18
+ export function isNotNullOrUndefined(toTest) {
19
+ return !(toTest == null || toTest == undefined);
20
+ }
21
+ export function isContentType(toTest) {
22
+ if (!Array.isArray(toTest))
23
+ return false;
24
+ return toTest.every(isNonEmptyString);
25
+ }
26
+ export function normalizeContentType(toNormalize) {
27
+ if (!Array.isArray(toNormalize))
28
+ return undefined;
29
+ const filtered = toNormalize.filter(isNonEmptyString);
30
+ return filtered.length > 0 ? filtered : undefined;
31
+ }
32
+ export function normalizeContentLink(toNormalize) {
33
+ if (typeof (toNormalize) != 'object' || toNormalize == null)
34
+ return undefined;
35
+ if (toNormalize.id == null)
36
+ toNormalize.id = 0; // Change the 'null' identifier and turn it into a 'zero'
37
+ if (toNormalize.guidValue == null || toNormalize.guidValue == "")
38
+ delete toNormalize.guidValue; // Remove an empty or null guid value
39
+ if ((toNormalize.id ?? -1) >= 0 || (toNormalize.guidValue ?? "").length > 0)
40
+ return toNormalize;
41
+ return undefined;
42
+ }
43
+ export function normalizeContentLinkWithLocale(toNormalize) {
44
+ const normalized = normalizeContentLink(toNormalize);
45
+ if (normalized.locale != undefined && !(typeof (normalized.locale) == 'string' && normalized.locale.length >= 1 && normalized.locale.length <= 5))
46
+ delete normalized.locale;
47
+ return normalized;
48
+ }
49
+ export function isCmsComponentWithDataQuery(toTest) {
50
+ const toTestType = typeof (toTest);
51
+ if ((toTestType == 'function' || toTestType == 'object') && toTest != null) {
52
+ return toTest.getDataQuery && typeof (toTest.getDataQuery) == 'function' ? true : false;
53
+ }
54
+ return false;
55
+ }
56
+ export function isCmsComponentWithFragment(toTest) {
57
+ const toTestType = typeof (toTest);
58
+ if ((toTestType == 'function' || toTestType == 'object') && toTest != null)
59
+ return toTest.getDataFragment && typeof (toTest.getDataFragment) == 'function' ? true : false;
60
+ return false;
61
+ }
62
+ export function validatesFragment(toTest) {
63
+ const toTestType = typeof (toTest);
64
+ if ((toTestType == 'function' || toTestType == 'object') && toTest != null)
65
+ return toTest.validateFragment && typeof (toTest.validateFragment) == 'function' ? true : false;
66
+ return false;
67
+ }
68
+ export function contentLocaleToGraphLocale(contentLocale) {
69
+ if (typeof (contentLocale) == 'string' && contentLocale.length >= 2 && contentLocale.length <= 5)
70
+ return contentLocale?.replaceAll('-', '_');
71
+ return undefined;
72
+ }
73
+ export function contentLinkToRequestVariables(contentLink) {
74
+ const variables = {
75
+ id: contentLink.id ?? 0,
76
+ workId: contentLink.workId,
77
+ guidValue: contentLink.guidValue ?? null,
78
+ locale: contentLocaleToGraphLocale(contentLink.locale)
79
+ };
80
+ if (variables.workId == undefined || variables.workId <= 0)
81
+ variables.workId = null;
82
+ return variables;
83
+ }
84
+ export function isInlineContentLink(contentLink) {
85
+ return !contentLink.id && !contentLink.guidValue;
86
+ }
87
+ export function contentLinkToString(contentLink) {
88
+ return `${contentLink.id ?? 0}_${contentLink.workId ?? 0}#${contentLink.guidValue ?? ''}\$${contentLink.locale ?? ''}`;
89
+ }
90
+ export function toUniqueValues(value, index, array) {
91
+ return array.indexOf(value) == index;
92
+ }
93
+ export function trim(valueToTrim) {
94
+ if (typeof (valueToTrim) == 'string')
95
+ return valueToTrim.trim();
96
+ return valueToTrim;
97
+ }
98
+ //# sourceMappingURL=utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,aAAa,CAAC,MAAW;IAErC,uBAAuB;IACvB,IAAI,OAAM,CAAC,MAAM,CAAC,IAAI,QAAQ,IAAI,MAAM,IAAI,IAAI;QAC5C,OAAO,KAAK,CAAA;IAEhB,wFAAwF;IACxF,OAAO,CAAC,OAAM,CAAE,MAA4B,CAAC,EAAE,CAAC,IAAI,QAAQ,IAAM,MAA4B,CAAC,EAAa,IAAI,CAAC,CAAC;QAC9G,CAAC,OAAM,CAAE,MAA4B,CAAC,SAAS,CAAC,IAAI,QAAQ,IAAM,MAA4B,CAAC,SAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AACvI,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAW;IAE/C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QACtB,OAAO,KAAK,CAAA;IAEhB,MAAM,MAAM,GAAI,MAAsC,CAAC,MAAM,CAA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AAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAE9D,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA8B;IAE9D,OAAO,GAAG,WAAW,CAAC,EAAE,IAAI,CAAC,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,IAAK,WAAW,CAAC,SAAS,IAAI,EAAE,KAAO,WAA2C,CAAC,MAAM,IAAI,EAAE,EAAE,CAAA;AAC7J,CAAC;AAED,MAAM,UAAU,cAAc,CAAgB,KAAQ,EAAE,KAAa,EAAE,KAAe;IAElF,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAA;AACxC,CAAC;AAED,MAAM,UAAU,IAAI,CAAsC,WAAc;IAEpE,IAAI,OAAM,CAAC,WAAW,CAAC,IAAI,QAAQ;QAC/B,OAAO,WAAW,CAAC,IAAI,EAAO,CAAA;IAClC,OAAO,WAAW,CAAA;AACtB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@remkoj/optimizely-cms-react",
3
+ "license": "Apache-2.0",
4
+ "version": "1.0.3",
5
+ "packageManager": "yarn@4.1.1",
6
+ "repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
7
+ "author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
8
+ "homepage": "https://github.com/remkoj/optimizely-dxp-clients",
9
+ "type": "module",
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "./dist"
14
+ ],
15
+ "exports": {
16
+ ".": "./dist/index.js",
17
+ "./browser": "./dist/browser/index.js",
18
+ "./rsc": "./dist/server/index.js",
19
+ "./rsc/cms-content": "./dist/server/components/cms-content.js",
20
+ "./rsc/cms-content-area": "./dist/server/components/cms-content-area.js"
21
+ },
22
+ "typesVersions": {
23
+ "*": {
24
+ "browser": [
25
+ "dist/browser/index.d.ts"
26
+ ],
27
+ "rsc": [
28
+ "dist/server/index.d.ts"
29
+ ],
30
+ "rsc/cms-content": [
31
+ "dist/server/components/cms-content.d.ts"
32
+ ],
33
+ "rsc/cms-content-area": [
34
+ "dist/server/components/cms-content-area.d.ts"
35
+ ]
36
+ }
37
+ },
38
+ "devDependencies": {
39
+ "@remkoj/optimizely-graph-client": "1.0.3",
40
+ "@types/crypto-js": "^4.2.2",
41
+ "@types/node": "^20.12.4",
42
+ "@types/react": "^18.2.74",
43
+ "@types/react-dom": "18.2.24",
44
+ "graphql": "^16.8.1",
45
+ "graphql-request": "^6.1.0",
46
+ "prop-types": "^15.8.1",
47
+ "react": "^18.2.0",
48
+ "react-dom": "^18.2.0",
49
+ "scheduler": "^0.23.0",
50
+ "typescript": "^5.4.3"
51
+ },
52
+ "dependencies": {
53
+ "@graphql-typed-document-node/core": "^3.2.0",
54
+ "crypto-js": "^4.2.0"
55
+ },
56
+ "peerDependencies": {
57
+ "@remkoj/optimizely-graph-client": "1.0.3",
58
+ "graphql": "*",
59
+ "graphql-request": "*",
60
+ "react": "*",
61
+ "react-dom": "*"
62
+ },
63
+ "scripts": {
64
+ "clean": "tsc --build --clean",
65
+ "prepare": "tsc --build",
66
+ "watch": "tsc --watch",
67
+ "recompile": "tsc --build --clean && tsc --build --force"
68
+ }
69
+ }