@se-studio/core-ui 1.0.14 → 1.0.16
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 +87 -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.d.ts.map +1 -1
- package/dist/components/ClientMonitor.js +40 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnusedChecker.js","sourceRoot":"","sources":["../../src/utils/UnusedChecker.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"UnusedChecker.js","sourceRoot":"","sources":["../../src/utils/UnusedChecker.tsx"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,eAAe;IACf,gBAAgB;IAChB,IAAI;IACJ,MAAM;IACN,MAAM;IACN,OAAO;IACP,aAAa;IACb,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,eAAe;IACf,kBAAkB;IAClB,YAAY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AY,EAAE,CAAC;QAChG,OAAO,4BAAG,QAAQ,GAAI,CAAC;IACzB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,CAAC,SAAS,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;IAErF,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CACL,8BACE,eACE,KAAK,EAAE;wBACL,eAAe,EAAE,QAAQ;wBACzB,OAAO,EAAE,MAAM;wBACf,MAAM,EAAE,QAAQ;qBACjB,aAED,aACE,KAAK,EAAE;gCACL,QAAQ,EAAE,MAAM;gCAChB,KAAK,EAAE,OAAO;gCACd,MAAM,EAAE,YAAY;6BACrB,mCAEkB,aAAa,IAC9B,EACJ,aAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,gCACzC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IACrC,IACA,EACL,QAAQ,IACR,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,11 +1,56 @@
|
|
|
1
1
|
import type { IBaseModel } from '@se-studio/core-data-types';
|
|
2
2
|
import type { Metadata, ResolvingMetadata } from 'next';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for building page metadata.
|
|
5
|
+
*/
|
|
3
6
|
export interface IBuildInformation {
|
|
7
|
+
/** Base URL for the site (e.g., 'https://example.com') */
|
|
4
8
|
baseUrl: string;
|
|
9
|
+
/** Whether the site is in production mode */
|
|
5
10
|
isProduction: boolean;
|
|
11
|
+
/** Whether the site is in development mode */
|
|
6
12
|
isDevelopment: boolean;
|
|
13
|
+
/** Customer/client name for metadata */
|
|
7
14
|
customerName: string;
|
|
15
|
+
/** Optional application name (defaults to customerName) */
|
|
8
16
|
applicationName?: string;
|
|
9
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds Next.js metadata object from CMS page model.
|
|
20
|
+
*
|
|
21
|
+
* Generates comprehensive SEO metadata including:
|
|
22
|
+
* - Title and description
|
|
23
|
+
* - Open Graph tags for social sharing
|
|
24
|
+
* - Twitter Card metadata
|
|
25
|
+
* - Canonical URL
|
|
26
|
+
* - Robots directives (index/follow based on production mode)
|
|
27
|
+
* - Featured image for OG/Twitter
|
|
28
|
+
*
|
|
29
|
+
* @param model - Page model from CMS (must include title, description, featuredImage, indexed)
|
|
30
|
+
* @param path - URL path for the page (e.g., '/about-us')
|
|
31
|
+
* @param buildInfo - Build configuration (baseUrl, environment flags, customer info)
|
|
32
|
+
* @param _parent - Next.js parent metadata resolver (unused, for API compatibility)
|
|
33
|
+
* @returns Next.js Metadata object ready for use in page metadata exports
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* import { buildPageMetadata } from '@se-studio/core-ui';
|
|
38
|
+
*
|
|
39
|
+
* export async function generateMetadata({ params }): Promise<Metadata> {
|
|
40
|
+
* const page = await contentfulPageRest(config, params.slug);
|
|
41
|
+
* return buildPageMetadata(
|
|
42
|
+
* page,
|
|
43
|
+
* `/${params.slug}`,
|
|
44
|
+
* {
|
|
45
|
+
* baseUrl: process.env.NEXT_PUBLIC_BASE_URL!,
|
|
46
|
+
* isProduction: process.env.NODE_ENV === 'production',
|
|
47
|
+
* isDevelopment: process.env.NODE_ENV === 'development',
|
|
48
|
+
* customerName: 'My Company',
|
|
49
|
+
* },
|
|
50
|
+
* undefined
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
10
55
|
export declare function buildPageMetadata(model: Omit<IBaseModel, 'textColour' | 'backgroundColour'>, path: string, { baseUrl, isProduction, customerName, applicationName }: IBuildInformation, _parent: ResolvingMetadata): Metadata;
|
|
11
56
|
//# sourceMappingURL=buildPageMetadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPageMetadata.d.ts","sourceRoot":"","sources":["../../src/utils/buildPageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,kBAAkB,CAAC,EAC1D,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,iBAAiB,EAC3E,OAAO,EAAE,iBAAiB,GACzB,QAAQ,CA8CV"}
|
|
1
|
+
{"version":3,"file":"buildPageMetadata.d.ts","sourceRoot":"","sources":["../../src/utils/buildPageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,YAAY,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,kBAAkB,CAAC,EAC1D,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,iBAAiB,EAC3E,OAAO,EAAE,iBAAiB,GACzB,QAAQ,CA8CV"}
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds Next.js metadata object from CMS page model.
|
|
3
|
+
*
|
|
4
|
+
* Generates comprehensive SEO metadata including:
|
|
5
|
+
* - Title and description
|
|
6
|
+
* - Open Graph tags for social sharing
|
|
7
|
+
* - Twitter Card metadata
|
|
8
|
+
* - Canonical URL
|
|
9
|
+
* - Robots directives (index/follow based on production mode)
|
|
10
|
+
* - Featured image for OG/Twitter
|
|
11
|
+
*
|
|
12
|
+
* @param model - Page model from CMS (must include title, description, featuredImage, indexed)
|
|
13
|
+
* @param path - URL path for the page (e.g., '/about-us')
|
|
14
|
+
* @param buildInfo - Build configuration (baseUrl, environment flags, customer info)
|
|
15
|
+
* @param _parent - Next.js parent metadata resolver (unused, for API compatibility)
|
|
16
|
+
* @returns Next.js Metadata object ready for use in page metadata exports
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { buildPageMetadata } from '@se-studio/core-ui';
|
|
21
|
+
*
|
|
22
|
+
* export async function generateMetadata({ params }): Promise<Metadata> {
|
|
23
|
+
* const page = await contentfulPageRest(config, params.slug);
|
|
24
|
+
* return buildPageMetadata(
|
|
25
|
+
* page,
|
|
26
|
+
* `/${params.slug}`,
|
|
27
|
+
* {
|
|
28
|
+
* baseUrl: process.env.NEXT_PUBLIC_BASE_URL!,
|
|
29
|
+
* isProduction: process.env.NODE_ENV === 'production',
|
|
30
|
+
* isDevelopment: process.env.NODE_ENV === 'development',
|
|
31
|
+
* customerName: 'My Company',
|
|
32
|
+
* },
|
|
33
|
+
* undefined
|
|
34
|
+
* );
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
1
38
|
export function buildPageMetadata(model, path, { baseUrl, isProduction, customerName, applicationName }, _parent) {
|
|
2
39
|
const { title, description, featuredImage } = model;
|
|
3
40
|
const indexed = isProduction ? model.indexed : false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPageMetadata.js","sourceRoot":"","sources":["../../src/utils/buildPageMetadata.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildPageMetadata.js","sourceRoot":"","sources":["../../src/utils/buildPageMetadata.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAA0D,EAC1D,IAAY,EACZ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAqB,EAC3E,OAA0B;IAE1B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACpD,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAErD,MAAM,eAAe,GAAG,aAAa,EAAE,EAAE,CAAC;IAC1C,MAAM,iBAAiB,GAAG,eAAe,CAAC,CAAC,CAAC,OAAO,eAAe,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAErF,MAAM,MAAM,GAAa;QACvB,YAAY,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC;QAC9B,eAAe,EAAE,eAAe,IAAI,YAAY;QAChD,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,OAAO,EAAE;YACpC,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,uBAAuB,EAAE;SACzD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,eAAe,IAAI,YAAY;SACvC;QACD,UAAU,EAAE;YACV,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,OAAO,IAAI,KAAK;YACvB,MAAM,EAAE,OAAO,IAAI,KAAK;SACzB;QACD,KAAK;QACL,WAAW;QACX,OAAO,EAAE;YACP,IAAI,EAAE,qBAAqB;YAC3B,KAAK;YACL,WAAW,EAAE,WAAW,IAAI,SAAS;YACrC,MAAM,EAAE,iBAAiB;SAC1B;QACD,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,IAAI;YACT,KAAK;YACL,WAAW,EAAE,WAAW,IAAI,SAAS;YACrC,MAAM,EAAE,iBAAiB;SAC1B;QACD,KAAK,EAAE;YACL,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,YAAY;SAC7C;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/utils/cn.d.ts
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function for merging Tailwind CSS classes.
|
|
4
|
+
*
|
|
5
|
+
* Combines clsx for conditional class names with tailwind-merge to intelligently
|
|
6
|
+
* merge Tailwind classes, resolving conflicts by keeping the last conflicting class.
|
|
7
|
+
*
|
|
8
|
+
* @param inputs - Variable number of class name inputs (strings, objects, arrays)
|
|
9
|
+
* @returns Merged class name string
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { cn } from '@se-studio/core-ui';
|
|
14
|
+
*
|
|
15
|
+
* // Basic usage
|
|
16
|
+
* cn('text-lg', 'font-bold') // 'text-lg font-bold'
|
|
17
|
+
*
|
|
18
|
+
* // Conditional classes
|
|
19
|
+
* cn('text-lg', isActive && 'text-blue-500') // 'text-lg text-blue-500' or 'text-lg'
|
|
20
|
+
*
|
|
21
|
+
* // Resolving conflicts
|
|
22
|
+
* cn('text-lg', 'text-sm') // 'text-sm' (last one wins)
|
|
23
|
+
*
|
|
24
|
+
* // With Tailwind classes
|
|
25
|
+
* cn('p-4', 'p-2') // 'p-2' (conflict resolved)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
2
28
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
29
|
//# sourceMappingURL=cn.d.ts.map
|
package/dist/utils/cn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/dist/utils/cn.js
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* Utility function for merging Tailwind CSS classes.
|
|
5
|
+
*
|
|
6
|
+
* Combines clsx for conditional class names with tailwind-merge to intelligently
|
|
7
|
+
* merge Tailwind classes, resolving conflicts by keeping the last conflicting class.
|
|
8
|
+
*
|
|
9
|
+
* @param inputs - Variable number of class name inputs (strings, objects, arrays)
|
|
10
|
+
* @returns Merged class name string
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { cn } from '@se-studio/core-ui';
|
|
15
|
+
*
|
|
16
|
+
* // Basic usage
|
|
17
|
+
* cn('text-lg', 'font-bold') // 'text-lg font-bold'
|
|
18
|
+
*
|
|
19
|
+
* // Conditional classes
|
|
20
|
+
* cn('text-lg', isActive && 'text-blue-500') // 'text-lg text-blue-500' or 'text-lg'
|
|
21
|
+
*
|
|
22
|
+
* // Resolving conflicts
|
|
23
|
+
* cn('text-lg', 'text-sm') // 'text-sm' (last one wins)
|
|
24
|
+
*
|
|
25
|
+
* // With Tailwind classes
|
|
26
|
+
* cn('p-4', 'p-2') // 'p-2' (conflict resolved)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
3
29
|
export function cn(...inputs) {
|
|
4
30
|
return twMerge(clsx(inputs));
|
|
5
31
|
}
|
package/dist/utils/cn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -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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,IAAI,CACzD,KAAK,EAAE,gCAAgC,CAAC,CAAC,CAAC,KACvC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,IAAI,CAC3D,KAAK,EAAE,iCAAiC,CAAC,CAAC,CAAC,KACxC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;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,CAClC,WAA2B,EAC3B,IAAsB;IAEtB,MAAM,MAAM,GAAG,EAA6B,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAA4B,EAC5B,IAAsB;IAEtB,MAAM,MAAM,GAAG,EAA8B,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAChC,WAAyB,EACzB,IAAsB;IAEtB,MAAM,MAAM,GAAG,EAA2B,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AA8CD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAS,EACT,WAA2B,EAC3B,WAAyB,EACzB,eAAsC;IAEtC,MAAM,cAAc,GAAG,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAE1E,OAAO;QACL,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,MAA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AG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CACpF,YAAY,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;oBACjC,iEAAiE;oBACjE,eAAc,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,YACxC,IAAI,IADI,CAAC,CAEL,CACR,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CACF,GACI,KAbM,KAAK,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"}
|