@se-studio/core-ui 1.0.14 → 1.0.15
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/README.md +33 -14
- package/dist/CmsRendererConfig.d.ts +122 -0
- package/dist/CmsRendererConfig.d.ts.map +1 -1
- package/dist/analytics/AnalyticsProvider.d.ts +7 -0
- package/dist/analytics/AnalyticsProvider.d.ts.map +1 -1
- package/dist/analytics/AnalyticsProvider.js +7 -0
- package/dist/analytics/AnalyticsProvider.js.map +1 -1
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.d.ts +4 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.d.ts.map +1 -1
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.js +5 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.js.map +1 -1
- package/dist/analytics/types.d.ts +23 -0
- package/dist/analytics/types.d.ts.map +1 -1
- package/dist/analytics/useAnalytics.d.ts +35 -0
- package/dist/analytics/useAnalytics.d.ts.map +1 -1
- package/dist/analytics/useAnalytics.js +35 -0
- package/dist/analytics/useAnalytics.js.map +1 -1
- package/dist/components/ClientMonitor.js +36 -0
- package/dist/components/ClientMonitor.js.map +1 -1
- package/dist/components/CmsCollection.d.ts +47 -0
- package/dist/components/CmsCollection.d.ts.map +1 -1
- package/dist/components/CmsCollection.js +7 -0
- package/dist/components/CmsCollection.js.map +1 -1
- package/dist/components/CmsComponent.d.ts +47 -0
- package/dist/components/CmsComponent.d.ts.map +1 -1
- package/dist/components/CmsComponent.js +7 -0
- package/dist/components/CmsComponent.js.map +1 -1
- package/dist/components/CmsContent.d.ts +62 -0
- package/dist/components/CmsContent.d.ts.map +1 -1
- package/dist/components/CmsContent.js +53 -0
- package/dist/components/CmsContent.js.map +1 -1
- package/dist/components/CmsConversionErrors.js +2 -0
- package/dist/components/CmsConversionErrors.js.map +1 -1
- package/dist/components/CmsEmbeddedContent.d.ts +3 -0
- package/dist/components/CmsEmbeddedContent.d.ts.map +1 -1
- package/dist/components/CmsEmbeddedContent.js +3 -0
- package/dist/components/CmsEmbeddedContent.js.map +1 -1
- package/dist/components/CmsExternalComponent.d.ts +44 -0
- package/dist/components/CmsExternalComponent.d.ts.map +1 -1
- package/dist/components/CmsExternalComponent.js +7 -0
- package/dist/components/CmsExternalComponent.js.map +1 -1
- package/dist/components/ImageKitClientVideo.js +1 -0
- package/dist/components/ImageKitClientVideo.js.map +1 -1
- package/dist/components/SvgComponent.js +3 -1
- package/dist/components/SvgComponent.js.map +1 -1
- package/dist/components/VisualComponent.d.ts +47 -0
- package/dist/components/VisualComponent.d.ts.map +1 -1
- package/dist/components/VisualComponent.js +47 -0
- package/dist/components/VisualComponent.js.map +1 -1
- package/dist/elements/TrackedLink.d.ts +8 -0
- package/dist/elements/TrackedLink.d.ts.map +1 -1
- package/dist/elements/TrackedLink.js +13 -0
- package/dist/elements/TrackedLink.js.map +1 -1
- package/dist/framework/BackgroundMedia.js +5 -1
- package/dist/framework/BackgroundMedia.js.map +1 -1
- package/dist/framework/ComponentErrorIndicator.js +7 -4
- package/dist/framework/ComponentErrorIndicator.js.map +1 -1
- package/dist/framework/componentErrors.d.ts +8 -0
- package/dist/framework/componentErrors.d.ts.map +1 -1
- package/dist/framework/componentErrors.js +10 -0
- package/dist/framework/componentErrors.js.map +1 -1
- package/dist/hooks/useClickTracking.d.ts +39 -0
- package/dist/hooks/useClickTracking.d.ts.map +1 -1
- package/dist/hooks/useClickTracking.js +29 -0
- package/dist/hooks/useClickTracking.js.map +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/dist/rtf/rtf.d.ts +41 -0
- package/dist/rtf/rtf.d.ts.map +1 -1
- package/dist/rtf/rtf.js +36 -0
- package/dist/rtf/rtf.js.map +1 -1
- package/dist/utils/UnsupportedWarning.d.ts +23 -0
- package/dist/utils/UnsupportedWarning.d.ts.map +1 -1
- package/dist/utils/UnsupportedWarning.js +24 -0
- package/dist/utils/UnsupportedWarning.js.map +1 -1
- package/dist/utils/UnusedChecker.d.ts +39 -0
- package/dist/utils/UnusedChecker.d.ts.map +1 -1
- package/dist/utils/UnusedChecker.js +47 -3
- package/dist/utils/UnusedChecker.js.map +1 -1
- package/dist/utils/buildPageMetadata.d.ts +45 -0
- package/dist/utils/buildPageMetadata.d.ts.map +1 -1
- package/dist/utils/buildPageMetadata.js +37 -0
- package/dist/utils/buildPageMetadata.js.map +1 -1
- package/dist/utils/cn.d.ts +26 -0
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +26 -0
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/componentUtils.d.ts +121 -0
- package/dist/utils/componentUtils.d.ts.map +1 -1
- package/dist/utils/componentUtils.js +80 -0
- package/dist/utils/componentUtils.js.map +1 -1
- package/dist/utils/convertText.js +10 -2
- package/dist/utils/convertText.js.map +1 -1
- package/dist/utils/errorHandling.d.ts +27 -0
- package/dist/utils/errorHandling.d.ts.map +1 -1
- package/dist/utils/errorHandling.js +33 -0
- package/dist/utils/errorHandling.js.map +1 -1
- package/dist/utils/previewUtils.js +2 -0
- package/dist/utils/previewUtils.js.map +1 -1
- package/package.json +17 -4
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { IBaseCollection, IBaseComponent, IPageContext } from '@se-studio/core-data-types';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
export type ArrayToUnion<T extends ReadonlyArray<unknown>> = T[number];
|
|
4
|
+
/**
|
|
5
|
+
* Since we've moved to non-generic base types, component utilities now work
|
|
6
|
+
* with the base types directly. Projects can extend these base types with
|
|
7
|
+
* additional properties and use type assertions at the component level.
|
|
8
|
+
*/
|
|
4
9
|
export interface ComponentConfig<TAdditional = Record<string, unknown>> {
|
|
5
10
|
componentProps: ReadonlyArray<keyof IBaseComponent>;
|
|
6
11
|
contextProps: ReadonlyArray<keyof IPageContext>;
|
|
@@ -16,11 +21,127 @@ export type CollectionPropsFromConfig<T extends CollectionConfig> = T['collectio
|
|
|
16
21
|
export type ContextPropsFromConfig<T extends ComponentConfig | CollectionConfig> = Pick<IPageContext, ArrayToUnion<T['contextProps']>>;
|
|
17
22
|
export type GeneratePropsFromComponentConfig<T extends ComponentConfig> = ComponentPropsFromConfig<T> & ContextPropsFromConfig<T> & (T['additionalProps'] extends Record<string, unknown> ? T['additionalProps'] : Record<string, never>);
|
|
18
23
|
export type GeneratePropsFromCollectionConfig<T extends CollectionConfig> = CollectionPropsFromConfig<T> & ContextPropsFromConfig<T> & (T['additionalProps'] extends Record<string, unknown> ? T['additionalProps'] : Record<string, never>);
|
|
24
|
+
/**
|
|
25
|
+
* Extract specific component information fields that a component needs.
|
|
26
|
+
* This is used when you only need a subset of the component fields.
|
|
27
|
+
*
|
|
28
|
+
* @param information - The full component information object
|
|
29
|
+
* @param keys - Array of keys to extract from the information object
|
|
30
|
+
* @returns Object with only the specified keys
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const props = extractComponentInfo(information, ['heading', 'body', 'links']);
|
|
35
|
+
* // props will have type { heading?: string | null, body?: unknown, links?: ReadonlyArray<ILinkProps> }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
19
38
|
export declare function extractComponentInfo<K extends keyof IBaseComponent>(information: IBaseComponent, keys: ReadonlyArray<K>): Pick<IBaseComponent, K>;
|
|
39
|
+
/**
|
|
40
|
+
* Extract specific collection information fields that a collection needs.
|
|
41
|
+
* This is used when you only need a subset of the collection fields.
|
|
42
|
+
*
|
|
43
|
+
* @param information - The full collection information object
|
|
44
|
+
* @param keys - Array of keys to extract from the information object
|
|
45
|
+
* @returns Object with only the specified keys
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* const props = extractCollectionInfo(information, ['heading', 'body', 'contents']);
|
|
50
|
+
* // props will have type { heading?: string | null, body?: unknown, contents?: ReadonlyArray<CollectionContent> }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
20
53
|
export declare function extractCollectionInfo<K extends keyof IBaseCollection>(information: IBaseCollection, keys: ReadonlyArray<K>): Pick<IBaseCollection, K>;
|
|
54
|
+
/**
|
|
55
|
+
* Extract specific page context fields that a component needs.
|
|
56
|
+
*
|
|
57
|
+
* @param pageContext - The full page context object
|
|
58
|
+
* @param keys - Array of keys to extract from the page context
|
|
59
|
+
* @returns Object with only the specified keys
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* const contextProps = extractPageContext(pageContext, ['articleLink', 'pageLink']);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
21
66
|
export declare function extractPageContext<K extends keyof IPageContext>(pageContext: IPageContext, keys: ReadonlyArray<K>): Pick<IPageContext, K>;
|
|
67
|
+
/**
|
|
68
|
+
* Helper type to create a component renderer function with specific prop requirements.
|
|
69
|
+
* This provides better type safety when defining component renderers.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* const config = {
|
|
74
|
+
* componentProps: ['heading', 'body', 'links'],
|
|
75
|
+
* contextProps: ['pageLink'],
|
|
76
|
+
* additionalProps: { theme: 'dark' as const }
|
|
77
|
+
* } as const satisfies ComponentConfig;
|
|
78
|
+
*
|
|
79
|
+
* const MyComponent: ComponentRenderer<typeof config> = ({ heading, body, links, pageLink, theme }) => {
|
|
80
|
+
* // All props are properly typed
|
|
81
|
+
* return <div>{heading}</div>;
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
22
85
|
export type ComponentRenderer<T extends ComponentConfig> = (props: GeneratePropsFromComponentConfig<T>) => React.ReactElement | null;
|
|
86
|
+
/**
|
|
87
|
+
* Helper type to create a collection renderer function with specific prop requirements.
|
|
88
|
+
* This provides better type safety when defining collection renderers.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* const config = {
|
|
93
|
+
* collectionProps: ['heading', 'body', 'contents'],
|
|
94
|
+
* contextProps: ['articleLink'],
|
|
95
|
+
* additionalProps: { layout: 'grid' as const }
|
|
96
|
+
* } as const satisfies CollectionConfig;
|
|
97
|
+
*
|
|
98
|
+
* const MyCollection: CollectionRenderer<typeof config> = ({ heading, body, contents, articleLink, layout }) => {
|
|
99
|
+
* // All props are properly typed
|
|
100
|
+
* return <div>{heading}</div>;
|
|
101
|
+
* };
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
23
104
|
export type CollectionRenderer<T extends CollectionConfig> = (props: GeneratePropsFromCollectionConfig<T>) => React.ReactElement | null;
|
|
105
|
+
/**
|
|
106
|
+
* Create props object for a component renderer from component information and page context.
|
|
107
|
+
* This function extracts the specified fields and combines them with additional props.
|
|
108
|
+
*
|
|
109
|
+
* @param config - Configuration specifying which props to extract
|
|
110
|
+
* @param information - The component information object
|
|
111
|
+
* @param pageContext - The page context object
|
|
112
|
+
* @param additionalProps - Additional props to include (optional)
|
|
113
|
+
* @returns Combined props object ready to pass to the component
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx
|
|
117
|
+
* const config = {
|
|
118
|
+
* componentProps: ['heading', 'body'],
|
|
119
|
+
* contextProps: ['pageLink'],
|
|
120
|
+
* } as const;
|
|
121
|
+
*
|
|
122
|
+
* const props = createComponentProps(config, information, pageContext);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
24
125
|
export declare function createComponentProps<T extends ComponentConfig>(config: T, information: IBaseComponent, pageContext: IPageContext, additionalProps?: T['additionalProps']): GeneratePropsFromComponentConfig<T>;
|
|
126
|
+
/**
|
|
127
|
+
* Create props object for a collection renderer from collection information and page context.
|
|
128
|
+
* This function extracts the specified fields and combines them with additional props.
|
|
129
|
+
*
|
|
130
|
+
* @param config - Configuration specifying which props to extract
|
|
131
|
+
* @param information - The collection information object
|
|
132
|
+
* @param pageContext - The page context object
|
|
133
|
+
* @param additionalProps - Additional props to include (optional)
|
|
134
|
+
* @returns Combined props object ready to pass to the collection
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```tsx
|
|
138
|
+
* const config = {
|
|
139
|
+
* collectionProps: ['heading', 'contents'],
|
|
140
|
+
* contextProps: ['articleLink'],
|
|
141
|
+
* } as const;
|
|
142
|
+
*
|
|
143
|
+
* const props = createCollectionProps(config, information, pageContext);
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
25
146
|
export declare function createCollectionProps<T extends CollectionConfig>(config: T, information: IBaseCollection, pageContext: IPageContext, additionalProps?: T['additionalProps']): GeneratePropsFromCollectionConfig<T>;
|
|
26
147
|
//# sourceMappingURL=componentUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentUtils.d.ts","sourceRoot":"","sources":["../../src/utils/componentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"componentUtils.d.ts","sourceRoot":"","sources":["../../src/utils/componentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;;;GAIG;AAGH,MAAM,WAAW,eAAe,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEpE,cAAc,EAAE,aAAa,CAAC,MAAM,cAAc,C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;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,eAAe,EAC5D,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,cAAc,EAC3B,WAAW,EAAE,YAAY,EACzB,eAAe,CAAC,EAAE,CAAC,CAAC,iBAAiB,CAAC,GACrC,gCAAgC,CAAC,CAAC,CAAC,CASrC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,gBAAgB,EAC9D,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,YAAY,EACzB,eAAe,CAAC,EAAE,CAAC,CAAC,iBAAiB,CAAC,GACrC,iCAAiC,CAAC,CAAC,CAAC,CAStC"}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract specific component information fields that a component needs.
|
|
3
|
+
* This is used when you only need a subset of the component fields.
|
|
4
|
+
*
|
|
5
|
+
* @param information - The full component information object
|
|
6
|
+
* @param keys - Array of keys to extract from the information object
|
|
7
|
+
* @returns Object with only the specified keys
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const props = extractComponentInfo(information, ['heading', 'body', 'links']);
|
|
12
|
+
* // props will have type { heading?: string | null, body?: unknown, links?: ReadonlyArray<ILinkProps> }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
1
15
|
export function extractComponentInfo(information, keys) {
|
|
2
16
|
const result = {};
|
|
3
17
|
for (const key of keys) {
|
|
@@ -7,6 +21,20 @@ export function extractComponentInfo(information, keys) {
|
|
|
7
21
|
}
|
|
8
22
|
return result;
|
|
9
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Extract specific collection information fields that a collection needs.
|
|
26
|
+
* This is used when you only need a subset of the collection fields.
|
|
27
|
+
*
|
|
28
|
+
* @param information - The full collection information object
|
|
29
|
+
* @param keys - Array of keys to extract from the information object
|
|
30
|
+
* @returns Object with only the specified keys
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const props = extractCollectionInfo(information, ['heading', 'body', 'contents']);
|
|
35
|
+
* // props will have type { heading?: string | null, body?: unknown, contents?: ReadonlyArray<CollectionContent> }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
10
38
|
export function extractCollectionInfo(information, keys) {
|
|
11
39
|
const result = {};
|
|
12
40
|
for (const key of keys) {
|
|
@@ -16,6 +44,18 @@ export function extractCollectionInfo(information, keys) {
|
|
|
16
44
|
}
|
|
17
45
|
return result;
|
|
18
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Extract specific page context fields that a component needs.
|
|
49
|
+
*
|
|
50
|
+
* @param pageContext - The full page context object
|
|
51
|
+
* @param keys - Array of keys to extract from the page context
|
|
52
|
+
* @returns Object with only the specified keys
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const contextProps = extractPageContext(pageContext, ['articleLink', 'pageLink']);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
19
59
|
export function extractPageContext(pageContext, keys) {
|
|
20
60
|
const result = {};
|
|
21
61
|
for (const key of keys) {
|
|
@@ -25,6 +65,26 @@ export function extractPageContext(pageContext, keys) {
|
|
|
25
65
|
}
|
|
26
66
|
return result;
|
|
27
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Create props object for a component renderer from component information and page context.
|
|
70
|
+
* This function extracts the specified fields and combines them with additional props.
|
|
71
|
+
*
|
|
72
|
+
* @param config - Configuration specifying which props to extract
|
|
73
|
+
* @param information - The component information object
|
|
74
|
+
* @param pageContext - The page context object
|
|
75
|
+
* @param additionalProps - Additional props to include (optional)
|
|
76
|
+
* @returns Combined props object ready to pass to the component
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const config = {
|
|
81
|
+
* componentProps: ['heading', 'body'],
|
|
82
|
+
* contextProps: ['pageLink'],
|
|
83
|
+
* } as const;
|
|
84
|
+
*
|
|
85
|
+
* const props = createComponentProps(config, information, pageContext);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
28
88
|
export function createComponentProps(config, information, pageContext, additionalProps) {
|
|
29
89
|
const componentProps = extractComponentInfo(information, config.componentProps);
|
|
30
90
|
const contextProps = extractPageContext(pageContext, config.contextProps);
|
|
@@ -34,6 +94,26 @@ export function createComponentProps(config, information, pageContext, additiona
|
|
|
34
94
|
...(additionalProps ?? {}),
|
|
35
95
|
};
|
|
36
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Create props object for a collection renderer from collection information and page context.
|
|
99
|
+
* This function extracts the specified fields and combines them with additional props.
|
|
100
|
+
*
|
|
101
|
+
* @param config - Configuration specifying which props to extract
|
|
102
|
+
* @param information - The collection information object
|
|
103
|
+
* @param pageContext - The page context object
|
|
104
|
+
* @param additionalProps - Additional props to include (optional)
|
|
105
|
+
* @returns Combined props object ready to pass to the collection
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* const config = {
|
|
110
|
+
* collectionProps: ['heading', 'contents'],
|
|
111
|
+
* contextProps: ['articleLink'],
|
|
112
|
+
* } as const;
|
|
113
|
+
*
|
|
114
|
+
* const props = createCollectionProps(config, information, pageContext);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
37
117
|
export function createCollectionProps(config, information, pageContext, additionalProps) {
|
|
38
118
|
const collectionProps = extractCollectionInfo(information, config.collectionProps);
|
|
39
119
|
const contextProps = extractPageContext(pageContext, config.contextProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentUtils.js","sourceRoot":"","sources":["../../src/utils/componentUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentUtils.js","sourceRoot":"","sources":["../../src/utils/componentUtils.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CACl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GAAG,cAAc;QACjB,GAAG,YAAY;QACf,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;KACuB,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAS,EACT,WAA4B,EAC5B,WAAyB,EACzB,eAAsC;IAEtC,MAAM,eAAe,GAAG,qBAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE1E,OAAO;QACL,GAAG,eAAe;QAClB,GAAG,YAAY;QACf,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;KACwB,CAAC;AACvD,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { decode } from 'html-entities';
|
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
4
|
const specialChars = {
|
|
5
5
|
'®': 'align-super text-[0.6em]',
|
|
6
|
+
// "©": "align-super p-sm",
|
|
7
|
+
// "℠": "align-super p-sm",
|
|
6
8
|
};
|
|
7
9
|
const pattern = new RegExp(`(${Object.keys(specialChars).join('|')})`, 'g');
|
|
8
10
|
export function convertText(text) {
|
|
@@ -18,14 +20,20 @@ export function convertText(text) {
|
|
|
18
20
|
if (special === undefined) {
|
|
19
21
|
return part;
|
|
20
22
|
}
|
|
21
|
-
return (
|
|
23
|
+
return (
|
|
24
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Index is ok here
|
|
25
|
+
_jsx("span", { className: special, children: part }, i));
|
|
22
26
|
});
|
|
23
27
|
if (result.length === 1) {
|
|
24
28
|
return result[0];
|
|
25
29
|
}
|
|
26
30
|
return result;
|
|
27
31
|
}
|
|
28
|
-
const mapped = split.map((s, index) => (
|
|
32
|
+
const mapped = split.map((s, index) => (
|
|
33
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Index is ok here
|
|
34
|
+
_jsxs(Fragment, { children: [index > 0 && _jsx("br", {}), _jsx("span", { children: s.split(new RegExp(`(${Object.keys(specialChars).join('|')})`, 'g')).map((part, i) => specialChars[part] !== undefined ? (
|
|
35
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Index is ok here
|
|
36
|
+
_jsx("span", { className: specialChars[part], children: part }, i)) : (part)) })] }, index)));
|
|
29
37
|
return mapped;
|
|
30
38
|
}
|
|
31
39
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertText.js","sourceRoot":"","sources":["../../src/utils/convertText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,YAAY,GAA2B;IAC3C,GAAG,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"convertText.js","sourceRoot":"","sources":["../../src/utils/convertText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,YAAY,GAA2B;IAC3C,GAAG,EAAE,0BAA0B;IAC/B,2BAA2B;IAC3B,2BAA2B;CAC5B,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAE5E,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEtF,IAAI,KAAK,CAAC,MAA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AK,CAcT,CACZ,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -5,6 +5,33 @@ interface ErrorContext {
|
|
|
5
5
|
preview?: boolean;
|
|
6
6
|
slug?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Handles CMS-related errors with appropriate error display or Next.js notFound.
|
|
10
|
+
*
|
|
11
|
+
* In production, returns Next.js notFound() to show 404 page.
|
|
12
|
+
* In development, returns an error component with detailed error information.
|
|
13
|
+
*
|
|
14
|
+
* @param error - The error that occurred (any type)
|
|
15
|
+
* @param context - Error context (type, params, preview, slug)
|
|
16
|
+
* @param buildInformation - Build configuration (isProduction, etc.)
|
|
17
|
+
* @returns Next.js notFound() in production, or error component in development
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { handleCmsError } from '@se-studio/core-ui';
|
|
22
|
+
*
|
|
23
|
+
* try {
|
|
24
|
+
* const page = await contentfulPageRest(config, slug);
|
|
25
|
+
* if (!page) throw new Error('Page not found');
|
|
26
|
+
* } catch (error) {
|
|
27
|
+
* return handleCmsError(error, {
|
|
28
|
+
* type: 'page',
|
|
29
|
+
* slug,
|
|
30
|
+
* preview: false,
|
|
31
|
+
* }, buildInfo);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
8
35
|
export declare function handleCmsError(error: unknown, context: ErrorContext, buildInformation: IBuildInformation): import("react/jsx-runtime").JSX.Element;
|
|
9
36
|
export {};
|
|
10
37
|
//# sourceMappingURL=errorHandling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAWD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,EACrB,gBAAgB,EAAE,iBAAiB,2CA2BpC"}
|
|
1
|
+
{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,EACrB,gBAAgB,EAAE,iBAAiB,2CA2BpC"}
|
|
@@ -1,27 +1,60 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { notFound } from 'next/navigation';
|
|
3
3
|
import { CmsDataError } from '../components/CmsDataError';
|
|
4
|
+
// Helper function to detect Next.js notFound errors
|
|
4
5
|
function isNotFoundError(error) {
|
|
5
6
|
return (error instanceof Error &&
|
|
6
7
|
(error.message === 'NEXT_HTTP_ERROR_FALLBACK;404' ||
|
|
7
8
|
error.digest === 'NEXT_HTTP_ERROR_FALLBACK;404'));
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Handles CMS-related errors with appropriate error display or Next.js notFound.
|
|
12
|
+
*
|
|
13
|
+
* In production, returns Next.js notFound() to show 404 page.
|
|
14
|
+
* In development, returns an error component with detailed error information.
|
|
15
|
+
*
|
|
16
|
+
* @param error - The error that occurred (any type)
|
|
17
|
+
* @param context - Error context (type, params, preview, slug)
|
|
18
|
+
* @param buildInformation - Build configuration (isProduction, etc.)
|
|
19
|
+
* @returns Next.js notFound() in production, or error component in development
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { handleCmsError } from '@se-studio/core-ui';
|
|
24
|
+
*
|
|
25
|
+
* try {
|
|
26
|
+
* const page = await contentfulPageRest(config, slug);
|
|
27
|
+
* if (!page) throw new Error('Page not found');
|
|
28
|
+
* } catch (error) {
|
|
29
|
+
* return handleCmsError(error, {
|
|
30
|
+
* type: 'page',
|
|
31
|
+
* slug,
|
|
32
|
+
* preview: false,
|
|
33
|
+
* }, buildInfo);
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
9
37
|
export function handleCmsError(error, context, buildInformation) {
|
|
38
|
+
// Re-throw notFound errors so Next.js can handle them properly
|
|
10
39
|
if (isNotFoundError(error)) {
|
|
11
40
|
throw error;
|
|
12
41
|
}
|
|
42
|
+
// Add timestamp to context
|
|
13
43
|
const enhancedContext = {
|
|
14
44
|
...context,
|
|
15
45
|
timestamp: new Date().toISOString(),
|
|
16
46
|
};
|
|
47
|
+
// Log error details
|
|
17
48
|
console.error('CMS Data Error:', {
|
|
18
49
|
error,
|
|
19
50
|
context: enhancedContext,
|
|
20
51
|
stack: error instanceof Error ? error.stack : undefined,
|
|
21
52
|
});
|
|
22
53
|
if (buildInformation.isProduction) {
|
|
54
|
+
// Send error to server for logging
|
|
23
55
|
return notFound();
|
|
24
56
|
}
|
|
57
|
+
// Return error component for non-production environments
|
|
25
58
|
return _jsx(CmsDataError, { error: error, context: enhancedContext });
|
|
26
59
|
}
|
|
27
60
|
//# sourceMappingURL=errorHandling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAU1D,oDAAoD;AACpD,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,CAAC,KAAK,CAAC,OAAO,KAAK,8BAA8B;YAC9C,KAA6B,CAAC,MAAM,KAAK,8BAA8B,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,OAAqB,EACrB,gBAAmC;IAEnC,+DAA+D;IAC/D,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,KAAK,CAAC;IACd,CAAC;IAED,2BAA2B;IAC3B,MAAM,eAAe,GAAG;QACtB,GAAG,OAAO;QACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;IAEF,oBAAoB;IACpB,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE;QAC/B,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KACxD,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,YAAY,EAAE,CAAC;QAClC,mCAAmC;QACnC,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,yDAAyD;IACzD,OAAO,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,GAAI,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewUtils.js","sourceRoot":"","sources":["../../src/utils/previewUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"previewUtils.js","sourceRoot":"","sources":["../../src/utils/previewUtils.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,8EAA8E;AAO9E,MAAM,UAAU,eAAe,CAC7B,EACE,OAAO,EACP,OAAO,EACP,OAAO,GAKR,EACD,SAAkB;IAElB,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IAEjC,OAAO;QACL,0BAA0B,EAAE,OAAO;QACnC,0BAA0B,EAAE,OAAO;QACnC,0BAA0B,EAAE,OAAO;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAW,EAAE,OAAgB,EAAE,SAAS,GAAG,KAAK;IACrF,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,SAAS,GAAG,KAAK;IACxE,OAAO,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,WAAwC,EAAE,SAAS,GAAG,KAAK;IAC/F,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IACnC,OAAO,eAAe,CACpB;QACE,OAAO,EAAE,WAAW,CAAC,QAAQ;QAC7B,OAAO,EAAE,WAAW,CAAC,aAAa;KACnC,EACD,SAAS,CACV,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/core-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,9 +25,22 @@
|
|
|
25
25
|
"components",
|
|
26
26
|
"ui",
|
|
27
27
|
"tailwind",
|
|
28
|
+
"tailwindcss",
|
|
28
29
|
"design-system",
|
|
29
|
-
"typescript"
|
|
30
|
+
"typescript",
|
|
31
|
+
"contentful",
|
|
32
|
+
"cms",
|
|
33
|
+
"nextjs",
|
|
34
|
+
"next.js",
|
|
35
|
+
"ui-library",
|
|
36
|
+
"component-library",
|
|
37
|
+
"rich-text",
|
|
38
|
+
"analytics"
|
|
30
39
|
],
|
|
40
|
+
"homepage": "https://github.com/Something-Else-Studio/se-core-product#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/Something-Else-Studio/se-core-product/issues"
|
|
43
|
+
},
|
|
31
44
|
"peerDependencies": {
|
|
32
45
|
"next": "^15.0.0",
|
|
33
46
|
"react": "^19.0.0",
|
|
@@ -43,8 +56,8 @@
|
|
|
43
56
|
"clsx": "^2.1.1",
|
|
44
57
|
"html-entities": "^2.6.0",
|
|
45
58
|
"tailwind-merge": "^3.4.0",
|
|
46
|
-
"@se-studio/contentful-rest-api": "1.0.
|
|
47
|
-
"@se-studio/core-data-types": "1.0.
|
|
59
|
+
"@se-studio/contentful-rest-api": "1.0.15",
|
|
60
|
+
"@se-studio/core-data-types": "1.0.15"
|
|
48
61
|
},
|
|
49
62
|
"devDependencies": {
|
|
50
63
|
"@biomejs/biome": "^2.3.7",
|