@se-studio/core-ui 1.0.13 → 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 +78 -14
- package/dist/CmsRendererConfig.d.ts +122 -0
- package/dist/CmsRendererConfig.d.ts.map +1 -1
- package/dist/analytics/AnalyticsProvider.d.ts +16 -0
- package/dist/analytics/AnalyticsProvider.d.ts.map +1 -0
- package/dist/analytics/AnalyticsProvider.js +22 -0
- package/dist/analytics/AnalyticsProvider.js.map +1 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.d.ts +12 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.d.ts.map +1 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.js +21 -0
- package/dist/analytics/adapters/ConsoleAnalyticsAdapter.js.map +1 -0
- package/dist/analytics/adapters/index.d.ts +2 -0
- package/dist/analytics/adapters/index.d.ts.map +1 -0
- package/dist/analytics/adapters/index.js +2 -0
- package/dist/analytics/adapters/index.js.map +1 -0
- package/dist/analytics/types.d.ts +41 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics/types.js +2 -0
- package/dist/analytics/types.js.map +1 -0
- package/dist/analytics/useAnalytics.d.ts +45 -0
- package/dist/analytics/useAnalytics.d.ts.map +1 -0
- package/dist/analytics/useAnalytics.js +70 -0
- package/dist/analytics/useAnalytics.js.map +1 -0
- package/dist/components/ClientMonitor.d.ts +1 -0
- package/dist/components/ClientMonitor.d.ts.map +1 -1
- package/dist/components/ClientMonitor.js +223 -18
- 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 +24 -0
- package/dist/elements/TrackedLink.d.ts.map +1 -0
- package/dist/elements/TrackedLink.js +76 -0
- package/dist/elements/TrackedLink.js.map +1 -0
- 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 +41 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -1
- 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 +22 -8
- package/dist/elements/UtmLinkOrDiv.d.ts +0 -5
- package/dist/elements/UtmLinkOrDiv.d.ts.map +0 -1
- package/dist/elements/UtmLinkOrDiv.js +0 -9
- package/dist/elements/UtmLinkOrDiv.js.map +0 -1
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
import type { IContentContext, IPageContext, ITyped, IVisual } from '@se-studio/core-data-types';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { CmsRendererConfig } from '../CmsRendererConfig';
|
|
4
|
+
/**
|
|
5
|
+
* Visual component renderer type
|
|
6
|
+
*/
|
|
4
7
|
export type VisualComponentRenderer = React.FC<{
|
|
5
8
|
information: IVisual;
|
|
6
9
|
contentContext: IContentContext;
|
|
7
10
|
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Internal link renderer type
|
|
13
|
+
*/
|
|
8
14
|
export type InternalLinkRenderer = React.FC<{
|
|
9
15
|
information: unknown;
|
|
10
16
|
contentContext: IContentContext;
|
|
11
17
|
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Additional props provided to embedded content renderers (collections, components, and external components)
|
|
20
|
+
* when they are rendered within rich text fields or other collections.
|
|
21
|
+
*
|
|
22
|
+
* These props allow embedded renderers to apply appropriate styling and track their position
|
|
23
|
+
* for analytics, animations, or other positional logic.
|
|
24
|
+
*
|
|
25
|
+
* @property positionClassName - CSS class name(s) for positioning the embedded content (e.g., "w-full col-span-full" for full-width grid items)
|
|
26
|
+
* @property embeddedIndex - Zero-based index of this embedded content among its siblings (e.g., 0 for the first embedded entry, 1 for the second)
|
|
27
|
+
* @property parentIndex - Index or depth of the parent container (e.g., 0 for root-level RTF content, higher values for nested collections)
|
|
28
|
+
*/
|
|
12
29
|
export type EmbeddedRendererProps = {
|
|
13
30
|
positionClassName: string;
|
|
14
31
|
embeddedIndex: number;
|
|
15
32
|
parentIndex: number;
|
|
16
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Error display component for rendering errors in development mode
|
|
36
|
+
*/
|
|
17
37
|
export declare const ContentError: ({ error, content, showInProduction, }: {
|
|
18
38
|
error: Error;
|
|
19
39
|
content: {
|
|
@@ -22,6 +42,48 @@ export declare const ContentError: ({ error, content, showInProduction, }: {
|
|
|
22
42
|
};
|
|
23
43
|
showInProduction?: boolean;
|
|
24
44
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
45
|
+
/**
|
|
46
|
+
* Main content renderer that renders an array of page content items.
|
|
47
|
+
*
|
|
48
|
+
* @example Basic usage
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import { createCmsRendererConfig } from "@se-studio/core-ui";
|
|
51
|
+
*
|
|
52
|
+
* const rendererConfig = createCmsRendererConfig<MyProjectConfig>({
|
|
53
|
+
* componentMap: {
|
|
54
|
+
* "Hero": HeroComponent,
|
|
55
|
+
* "CTA": CTAComponent,
|
|
56
|
+
* },
|
|
57
|
+
* collectionMap: {
|
|
58
|
+
* "FAQs": FAQCollection,
|
|
59
|
+
* },
|
|
60
|
+
* showUnknownTypeErrors: process.env.NODE_ENV === 'development',
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* <CmsContent
|
|
64
|
+
* rendererConfig={rendererConfig}
|
|
65
|
+
* pageContext={pageContext}
|
|
66
|
+
* contents={page.contents}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example With all renderer types
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const rendererConfig = createCmsRendererConfig<MyProjectConfig>({
|
|
73
|
+
* componentMap: { ... },
|
|
74
|
+
* collectionMap: { ... },
|
|
75
|
+
* externalComponentMap: { ... },
|
|
76
|
+
* visualComponentRenderer: VisualRenderer,
|
|
77
|
+
* internalLinkRenderer: InternalLinkRenderer,
|
|
78
|
+
* });
|
|
79
|
+
*
|
|
80
|
+
* <CmsContent
|
|
81
|
+
* rendererConfig={rendererConfig}
|
|
82
|
+
* pageContext={pageContext}
|
|
83
|
+
* contents={page.contents}
|
|
84
|
+
* />
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
25
87
|
export declare function CmsContent({ pageContext, contents, rendererConfig, }: {
|
|
26
88
|
pageContext: IPageContext;
|
|
27
89
|
contents?: ReadonlyArray<ITyped>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsContent.d.ts","sourceRoot":"","sources":["../../src/components/CmsContent.ts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yCG;AACH,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,QAAQ,EACR,cAAc,GACf,EAAE;IACD,WAAW,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,cAAc,EAAE,iBAAiB,CAAC;CACnC,kDAmBA"}
|
|
@@ -2,6 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { CmsCollection } from './CmsCollection';
|
|
3
3
|
import { CmsComponent } from './CmsComponent';
|
|
4
4
|
import { CmsExternalComponent } from './CmsExternalComponent';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a content context for a specific component with lazy evaluation
|
|
7
|
+
*/
|
|
5
8
|
function createContentContext(pageContext, components, currentIndex) {
|
|
6
9
|
const current = components[currentIndex];
|
|
7
10
|
if (!current) {
|
|
@@ -11,6 +14,9 @@ function createContentContext(pageContext, components, currentIndex) {
|
|
|
11
14
|
const nextContent = currentIndex === components.length - 1 ? undefined : components[currentIndex + 1];
|
|
12
15
|
return { pageContext, previousContent, current, nextContent };
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Error display component for rendering errors in development mode
|
|
19
|
+
*/
|
|
14
20
|
export const ContentError = ({ error, content, showInProduction = false, }) => {
|
|
15
21
|
if (!showInProduction && typeof process !== 'undefined' && process.env?.NODE_ENV === 'production')
|
|
16
22
|
return null;
|
|
@@ -29,6 +35,9 @@ export const ContentError = ({ error, content, showInProduction = false, }) => {
|
|
|
29
35
|
fontSize: '0.75rem',
|
|
30
36
|
}, children: error.message })] })] })] }));
|
|
31
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Single content item renderer that routes to the appropriate renderer based on type
|
|
40
|
+
*/
|
|
32
41
|
const SingleContent = ({ context, rendererConfig, }) => {
|
|
33
42
|
try {
|
|
34
43
|
const { current } = context;
|
|
@@ -68,12 +77,14 @@ const SingleContent = ({ context, rendererConfig, }) => {
|
|
|
68
77
|
}
|
|
69
78
|
break;
|
|
70
79
|
default: {
|
|
80
|
+
// Check if there's a custom content renderer for this type
|
|
71
81
|
const unknownContent = current;
|
|
72
82
|
const CustomRenderer = rendererConfig.customContentMap?.[unknownContent.type];
|
|
73
83
|
if (CustomRenderer) {
|
|
74
84
|
result = _jsx(CustomRenderer, { information: current, contentContext: context });
|
|
75
85
|
break;
|
|
76
86
|
}
|
|
87
|
+
// No custom renderer found - treat as unknown content
|
|
77
88
|
const error = new Error(`Unknown content type: ${unknownContent.type} (ID: ${unknownContent.id})`);
|
|
78
89
|
console.error(error);
|
|
79
90
|
if (rendererConfig.showRenderErrors ||
|
|
@@ -97,6 +108,48 @@ const SingleContent = ({ context, rendererConfig, }) => {
|
|
|
97
108
|
return null;
|
|
98
109
|
}
|
|
99
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* Main content renderer that renders an array of page content items.
|
|
113
|
+
*
|
|
114
|
+
* @example Basic usage
|
|
115
|
+
* ```tsx
|
|
116
|
+
* import { createCmsRendererConfig } from "@se-studio/core-ui";
|
|
117
|
+
*
|
|
118
|
+
* const rendererConfig = createCmsRendererConfig<MyProjectConfig>({
|
|
119
|
+
* componentMap: {
|
|
120
|
+
* "Hero": HeroComponent,
|
|
121
|
+
* "CTA": CTAComponent,
|
|
122
|
+
* },
|
|
123
|
+
* collectionMap: {
|
|
124
|
+
* "FAQs": FAQCollection,
|
|
125
|
+
* },
|
|
126
|
+
* showUnknownTypeErrors: process.env.NODE_ENV === 'development',
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* <CmsContent
|
|
130
|
+
* rendererConfig={rendererConfig}
|
|
131
|
+
* pageContext={pageContext}
|
|
132
|
+
* contents={page.contents}
|
|
133
|
+
* />
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @example With all renderer types
|
|
137
|
+
* ```tsx
|
|
138
|
+
* const rendererConfig = createCmsRendererConfig<MyProjectConfig>({
|
|
139
|
+
* componentMap: { ... },
|
|
140
|
+
* collectionMap: { ... },
|
|
141
|
+
* externalComponentMap: { ... },
|
|
142
|
+
* visualComponentRenderer: VisualRenderer,
|
|
143
|
+
* internalLinkRenderer: InternalLinkRenderer,
|
|
144
|
+
* });
|
|
145
|
+
*
|
|
146
|
+
* <CmsContent
|
|
147
|
+
* rendererConfig={rendererConfig}
|
|
148
|
+
* pageContext={pageContext}
|
|
149
|
+
* contents={page.contents}
|
|
150
|
+
* />
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
100
153
|
export function CmsContent({ pageContext, contents, rendererConfig, }) {
|
|
101
154
|
if (!contents || contents.length === 0) {
|
|
102
155
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsContent.js","sourceRoot":"","sources":["../../src/components/CmsContent.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"CmsContent.js","sourceRoot":"","sources":["../../src/components/CmsContent.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,SAAS,oBAAoB,CAC3B,WAAyB,EACzB,UAAiC,EACjC,YAAoB;IAEpB,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,4BAA4B,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,eAAe,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC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M;YACR,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QAEjD,IACE,cAAc,CAAC,gBAAgB;YAC/B,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,aAAa,CAAC,EAC3E,CAAC;YACD,OAAO,CACL,KAAC,YAAY,IACX,KAAK,EAAE,KAAc,EACrB,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,GACjD,CACH,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,WAAW,EACX,QAAQ,EACR,cAAc,GAKf;IACC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,4BACG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC/B,MAAM,OAAO,GAAG,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;YACnE,OAAO,CACL,KAAC,aAAa,IAEZ,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,IAFzB,GAAG,OAAO,CAAC,EAAE,IAAI,KAAK,EAAE,CAG7B,CACH,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -3,9 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
export function CmsConversionErrors({ errors, isProduction }) {
|
|
5
5
|
const [expanded, setExpanded] = useState(false);
|
|
6
|
+
// Don't render in production
|
|
6
7
|
if (isProduction || errors.length === 0) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
10
|
+
// Show first 5 errors by default, or all if expanded
|
|
9
11
|
const visibleErrors = expanded ? errors : errors.slice(0, 5);
|
|
10
12
|
const hasMoreErrors = errors.length > 5;
|
|
11
13
|
return (_jsx("div", { style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsConversionErrors.js","sourceRoot":"","sources":["../../src/components/CmsConversionErrors.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOjC,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,YAAY,EAA4B;IACpF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"CmsConversionErrors.js","sourceRoot":"","sources":["../../src/components/CmsConversionErrors.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOjC,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,YAAY,EAA4B;IACpF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,6BAA6B;IAC7B,IAAI,YAAY,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,qDAAqD;IACrD,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAExC,OAAO,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AAS;oEACnB,KAAK,EAAE,SAAS;oEAChB,eAAe,EAAE,SAAS;oEAC1B,OAAO,EAAE,gBAAgB;oEACzB,YAAY,EAAE,SAAS;iEACxB,YAEA,KAAK,CAAC,SAAS,GACX,CACR,IACG,EACN,YAAG,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,YACvE,KAAK,CAAC,OAAO,GACZ,IACA,GACF,IA7CD,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,EAAE,CA8C5B,CACP,CAAC,GACE,IACF,IACF,IACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,5 +2,8 @@ import { type EmbeddedCollectionRenderer } from './CmsCollection';
|
|
|
2
2
|
import { type EmbeddedComponentRenderer } from './CmsComponent';
|
|
3
3
|
import { type EmbeddedExternalComponentRenderer } from './CmsExternalComponent';
|
|
4
4
|
export type EmbeddedContentRenderer = EmbeddedComponentRenderer | EmbeddedCollectionRenderer | EmbeddedExternalComponentRenderer;
|
|
5
|
+
/**
|
|
6
|
+
* Single content item renderer that routes to the appropriate renderer based on type
|
|
7
|
+
*/
|
|
5
8
|
export declare const CmsEmbeddedContent: EmbeddedContentRenderer;
|
|
6
9
|
//# sourceMappingURL=CmsEmbeddedContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsEmbeddedContent.d.ts","sourceRoot":"","sources":["../../src/components/CmsEmbeddedContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAwB,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,uBAAuB,GAC/B,yBAAyB,GACzB,0BAA0B,GAC1B,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"CmsEmbeddedContent.d.ts","sourceRoot":"","sources":["../../src/components/CmsEmbeddedContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAwB,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,uBAAuB,GAC/B,yBAAyB,GACzB,0BAA0B,GAC1B,iCAAiC,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,uBAkDhC,CAAC"}
|
|
@@ -3,6 +3,9 @@ import { CmsEmbeddedCollection } from './CmsCollection';
|
|
|
3
3
|
import { CmsEmbeddedComponent } from './CmsComponent';
|
|
4
4
|
import { ContentError } from './CmsContent';
|
|
5
5
|
import { CmsEmbeddedExternalComponent, } from './CmsExternalComponent';
|
|
6
|
+
/**
|
|
7
|
+
* Single content item renderer that routes to the appropriate renderer based on type
|
|
8
|
+
*/
|
|
6
9
|
export const CmsEmbeddedContent = ({ information, ...props }) => {
|
|
7
10
|
try {
|
|
8
11
|
let result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsEmbeddedContent.js","sourceRoot":"","sources":["../../src/components/CmsEmbeddedContent.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,qBAAqB,EAAmC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAkC,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"CmsEmbeddedContent.js","sourceRoot":"","sources":["../../src/components/CmsEmbeddedContent.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,qBAAqB,EAAmC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE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pB,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,GACvD,CACH,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: Any is allowed */
|
|
1
2
|
import type { IBaseExternalComponent, IContentContext, ITyped } from '@se-studio/core-data-types';
|
|
2
3
|
import type { CmsRendererConfig } from '../CmsRendererConfig';
|
|
3
4
|
import type { EmbeddedRendererProps } from './CmsContent';
|
|
@@ -6,8 +7,51 @@ export type ExternalComponentRendererProps<TInformation extends ITyped> = {
|
|
|
6
7
|
contentContext: IContentContext;
|
|
7
8
|
rendererConfig: CmsRendererConfig;
|
|
8
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Standard external component renderer type for rendering external components in the main content flow.
|
|
12
|
+
* Used for external components (like third-party widgets or services) that appear as top-level page content.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const MyExternalComponentRenderer: ExternalComponentRenderer<IMyExternalComponent> = ({
|
|
17
|
+
* information,
|
|
18
|
+
* contentContext,
|
|
19
|
+
* rendererConfig
|
|
20
|
+
* }) => {
|
|
21
|
+
* return <div data-external-id={information.externalId}>{information.title}</div>;
|
|
22
|
+
* };
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
9
25
|
export type ExternalComponentRenderer<TInformation extends ITyped> = React.FC<ExternalComponentRendererProps<TInformation>>;
|
|
26
|
+
/**
|
|
27
|
+
* Embedded external component renderer type for rendering external components within rich text or collections.
|
|
28
|
+
* Includes additional props for positioning and tracking embedded content.
|
|
29
|
+
*
|
|
30
|
+
* Use this type when defining custom external component renderers that can be embedded within RTF fields
|
|
31
|
+
* or nested inside collections.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const MyEmbeddedExternalComponentRenderer: EmbeddedExternalComponentRenderer<IMyExternalComponent> = ({
|
|
36
|
+
* information,
|
|
37
|
+
* contentContext,
|
|
38
|
+
* rendererConfig,
|
|
39
|
+
* positionClassName,
|
|
40
|
+
* embeddedIndex,
|
|
41
|
+
* parentIndex
|
|
42
|
+
* }) => {
|
|
43
|
+
* return (
|
|
44
|
+
* <div className={positionClassName} data-position={embeddedIndex}>
|
|
45
|
+
* {information.title}
|
|
46
|
+
* </div>
|
|
47
|
+
* );
|
|
48
|
+
* };
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
10
51
|
export type EmbeddedExternalComponentRenderer<TInformation extends ITyped = ITyped> = React.FC<ExternalComponentRendererProps<TInformation> & EmbeddedRendererProps>;
|
|
52
|
+
/**
|
|
53
|
+
* Map of external component types to their renderers
|
|
54
|
+
*/
|
|
11
55
|
export type ExternalComponentMap<TKey extends string, TInformation extends ITyped> = Partial<Record<TKey, ExternalComponentRenderer<TInformation>>>;
|
|
12
56
|
export type EmbeddedExternalComponentMap<TKey extends string, TInformation extends ITyped> = Partial<Record<TKey, EmbeddedExternalComponentRenderer<TInformation>>>;
|
|
13
57
|
export declare const CmsExternalComponent: ExternalComponentRenderer<IBaseExternalComponent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsExternalComponent.d.ts","sourceRoot":"","sources":["../../src/components/CmsExternalComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CmsExternalComponent.d.ts","sourceRoot":"","sources":["../../src/components/CmsExternalComponent.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,8BAA8B,CAAC,YAAY,SAAS,MAAM,IAAI;IACxE,WAAW,EAAE,YAAY,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,EAAE,iBAAiB,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,yBAAyB,CAAC,YAAY,SAAS,MAAM,IAAI,KAAK,CAAC,EAAE,CAC3E,8BAA8B,CAAC,YAAY,CAAC,CAC7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,iCAAiC,CAAC,YAAY,SAAS,MAAM,GAAG,MAAM,IAAI,KAAK,CAAC,EAAE,CAC5F,8BAA8B,CAAC,YAAY,CAAC,GAAG,qBAAqB,CACrE,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,IAAI,SAAS,MAAM,EAAE,YAAY,SAAS,MAAM,IAAI,OAAO,CAC1F,MAAM,CAAC,IAAI,EAAE,yBAAyB,CAAC,YAAY,CAAC,CAAC,CACtD,CAAC;AAEF,MAAM,MAAM,4BAA4B,CACtC,IAAI,SAAS,MAAM,EACnB,YAAY,SAAS,MAAM,IACzB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,iCAAiC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AA8C3E,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,CAAC,sBAAsB,CA8ClF,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,iCAAiC,CAC1E,sBAAsB,CAqCvB,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Error component displayed in development/preview mode when an unknown collection type is encountered
|
|
4
|
+
*/
|
|
2
5
|
const ExternalComponentTypeError = ({ information, availableTypes, showInProduction = false, }) => {
|
|
3
6
|
if (!showInProduction && typeof process !== 'undefined' && process.env?.NODE_ENV === 'production')
|
|
4
7
|
return null;
|
|
@@ -17,8 +20,10 @@ export const CmsExternalComponent = ({ information, contentContext, rendererConf
|
|
|
17
20
|
const result = (_jsx(Element, { information: information, contentContext: contentContext, rendererConfig: rendererConfig }));
|
|
18
21
|
return result;
|
|
19
22
|
}
|
|
23
|
+
// Log unknown component type for monitoring
|
|
20
24
|
const availableTypes = Object.keys(externalComponentMap);
|
|
21
25
|
console.log(`Unknown external component type: ${String(information.externalType)} (ID: ${information.id}). Available types:`, availableTypes.join(','));
|
|
26
|
+
// Show warning in development/preview mode, use Generic fallback
|
|
22
27
|
const shouldShowError = showUnknownTypeErrors ||
|
|
23
28
|
(typeof process !== 'undefined' && process.env?.NODE_ENV === 'development');
|
|
24
29
|
const result = (_jsx(_Fragment, { children: shouldShowError && (_jsx(ExternalComponentTypeError, { information: information, availableTypes: availableTypes, showInProduction: showUnknownTypeErrors })) }));
|
|
@@ -31,8 +36,10 @@ export const CmsEmbeddedExternalComponent = ({ information, rendererConfig, ...p
|
|
|
31
36
|
const result = _jsx(Element, { information: information, rendererConfig: rendererConfig, ...props });
|
|
32
37
|
return result;
|
|
33
38
|
}
|
|
39
|
+
// Log unknown component type for monitoring
|
|
34
40
|
const availableTypes = Object.keys(embeddedExternalComponentMap);
|
|
35
41
|
console.log(`Unknown embedded external component type: ${String(information.externalType)} (ID: ${information.id}). Available types:`, availableTypes.join(','));
|
|
42
|
+
// Show warning in development/preview mode, use Generic fallback
|
|
36
43
|
const shouldShowError = showUnknownTypeErrors ||
|
|
37
44
|
(typeof process !== 'undefined' && process.env?.NODE_ENV === 'development');
|
|
38
45
|
const result = (_jsx(_Fragment, { children: shouldShowError && (_jsx(ExternalComponentTypeError, { information: information, availableTypes: availableTypes, showInProduction: showUnknownTypeErrors })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsExternalComponent.js","sourceRoot":"","sources":["../../src/components/CmsExternalComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CmsExternalComponent.js","sourceRoot":"","sources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CAA6C,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,WAAW,CAAC,EAAE,qBAAqB,EACzH,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CACzB,CAAC;IAEF,iEAAiE;IACjE,MAAM,eAAe,GACnB,qBAAqB;QACrB,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,aAAa,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAG,CACb,4BACG,eAAe,IAAI,CAClB,KAAC,0BAA0B,IACzB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,qBAAqB,GACvC,CACH,GACA,CACJ,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -9,6 +9,7 @@ const VideoSources = ({ baseSrc, videoPrefix, width, visualSizes }) => {
|
|
|
9
9
|
?.breakpoints?.filter((x) => !width || x.pixels < width)
|
|
10
10
|
.sort((a, b) => a.minWidth - b.minWidth);
|
|
11
11
|
return (_jsxs(_Fragment, { children: [sizes?.map(({ minWidth, pixels }, index, arr) => {
|
|
12
|
+
// For video sources, convert minWidth back to max-width media queries
|
|
12
13
|
const nextBreakpoint = arr[index + 1];
|
|
13
14
|
const maxWidth = nextBreakpoint ? nextBreakpoint.minWidth - 1 : undefined;
|
|
14
15
|
return maxWidth ? (_jsx("source", { src: `${videoPrefix}${baseSrc}?tr=w-${pixels}`, media: `(max-width: ${maxWidth}px)`, type: "video/mp4" }, minWidth)) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageKitClientVideo.js","sourceRoot":"","sources":["../../src/components/ImageKitClientVideo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyC,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,YAAY,GAKb,CAAC,EAAE,OAAO,EAA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x-runtime";
|
|
|
2
2
|
import { calculateCropDetails } from './Visual';
|
|
3
3
|
function SvgComponent({ image, className, style, ...other }) {
|
|
4
4
|
const cropProperties = calculateCropDetails(image);
|
|
5
|
-
return (_jsx("div", { className: className, style: { ...style, ...cropProperties },
|
|
5
|
+
return (_jsx("div", { className: className, style: { ...style, ...cropProperties },
|
|
6
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: Ok to set SVG inner HTML
|
|
7
|
+
dangerouslySetInnerHTML: { __html: image.data }, ...other }));
|
|
6
8
|
}
|
|
7
9
|
export default SvgComponent;
|
|
8
10
|
//# sourceMappingURL=SvgComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgComponent.js","sourceRoot":"","sources":["../../src/components/SvgComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AAElE,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACgE;IACxE,MAAM,cAAc,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"SvgComponent.js","sourceRoot":"","sources":["../../src/components/SvgComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AAElE,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACgE;IACxE,MAAM,cAAc,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,cAAc,EAAE;QACtC,iFAAiF;QACjF,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAC3C,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
import type { IVisual } from '@se-studio/core-data-types';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { IVisualProps } from './Visual';
|
|
4
|
+
/**
|
|
5
|
+
* Visual component for rendering images, videos, and animations.
|
|
6
|
+
*
|
|
7
|
+
* Automatically selects the appropriate renderer based on the visual type:
|
|
8
|
+
* - Animations (Lottie) are rendered via AnimationServer
|
|
9
|
+
* - Videos are rendered via VideoComponent with Next.js optimization
|
|
10
|
+
* - Images are rendered via ImageComponent with Next.js Image optimization
|
|
11
|
+
*
|
|
12
|
+
* @param visual - Visual data containing image, video, or animation
|
|
13
|
+
* @param muted - Whether video should be muted (default: false)
|
|
14
|
+
* @param controls - Whether video should show controls (default: false)
|
|
15
|
+
* @param autoPlay - Whether video/animation should autoplay (default: false)
|
|
16
|
+
* @param visualSizes - Responsive size configuration for the visual
|
|
17
|
+
* @param fullPlayer - Whether video should use full player mode (default: false)
|
|
18
|
+
* @param loop - Whether video/animation should loop (default: false)
|
|
19
|
+
* @param loopDelay - Delay between loops in milliseconds
|
|
20
|
+
* @param analyticsContext - Analytics context for tracking
|
|
21
|
+
* @param componentLabel - Label for analytics tracking
|
|
22
|
+
* @param className - Additional CSS classes
|
|
23
|
+
* @param style - Additional inline styles
|
|
24
|
+
*
|
|
25
|
+
* @example Basic image
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <Visual visual={imageVisual} className="w-full h-auto" />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example Video with autoplay
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Visual
|
|
33
|
+
* visual={videoVisual}
|
|
34
|
+
* autoPlay
|
|
35
|
+
* muted
|
|
36
|
+
* loop
|
|
37
|
+
* className="w-full"
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Animation with loop delay
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Visual
|
|
44
|
+
* visual={animationVisual}
|
|
45
|
+
* autoPlay
|
|
46
|
+
* loop
|
|
47
|
+
* loopDelay={1000}
|
|
48
|
+
* />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
4
51
|
export declare const Visual: React.FC<{
|
|
5
52
|
visual: IVisual;
|
|
6
53
|
} & IVisualProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualComponent.d.ts","sourceRoot":"","sources":["../../src/components/VisualComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAqD/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"VisualComponent.d.ts","sourceRoot":"","sources":["../../src/components/VisualComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAqD/D,CAAC"}
|
|
@@ -3,6 +3,53 @@ import { UnsupportedWarning } from '../utils/UnsupportedWarning';
|
|
|
3
3
|
import AnimationServer from './AnimationServer';
|
|
4
4
|
import ImageComponent from './ImageComponent';
|
|
5
5
|
import VideoComponent from './VideoComponent';
|
|
6
|
+
/**
|
|
7
|
+
* Visual component for rendering images, videos, and animations.
|
|
8
|
+
*
|
|
9
|
+
* Automatically selects the appropriate renderer based on the visual type:
|
|
10
|
+
* - Animations (Lottie) are rendered via AnimationServer
|
|
11
|
+
* - Videos are rendered via VideoComponent with Next.js optimization
|
|
12
|
+
* - Images are rendered via ImageComponent with Next.js Image optimization
|
|
13
|
+
*
|
|
14
|
+
* @param visual - Visual data containing image, video, or animation
|
|
15
|
+
* @param muted - Whether video should be muted (default: false)
|
|
16
|
+
* @param controls - Whether video should show controls (default: false)
|
|
17
|
+
* @param autoPlay - Whether video/animation should autoplay (default: false)
|
|
18
|
+
* @param visualSizes - Responsive size configuration for the visual
|
|
19
|
+
* @param fullPlayer - Whether video should use full player mode (default: false)
|
|
20
|
+
* @param loop - Whether video/animation should loop (default: false)
|
|
21
|
+
* @param loopDelay - Delay between loops in milliseconds
|
|
22
|
+
* @param analyticsContext - Analytics context for tracking
|
|
23
|
+
* @param componentLabel - Label for analytics tracking
|
|
24
|
+
* @param className - Additional CSS classes
|
|
25
|
+
* @param style - Additional inline styles
|
|
26
|
+
*
|
|
27
|
+
* @example Basic image
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Visual visual={imageVisual} className="w-full h-auto" />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Video with autoplay
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Visual
|
|
35
|
+
* visual={videoVisual}
|
|
36
|
+
* autoPlay
|
|
37
|
+
* muted
|
|
38
|
+
* loop
|
|
39
|
+
* className="w-full"
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Animation with loop delay
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <Visual
|
|
46
|
+
* visual={animationVisual}
|
|
47
|
+
* autoPlay
|
|
48
|
+
* loop
|
|
49
|
+
* loopDelay={1000}
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
6
53
|
export const Visual = ({ visual, muted, controls, autoPlay, visualSizes, fullPlayer, loop, loopDelay, analyticsContext, componentLabel, ...props }) => {
|
|
7
54
|
const { animation, image, video } = visual;
|
|
8
55
|
if (animation) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualComponent.js","sourceRoot":"","sources":["../../src/components/VisualComponent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,MAAM,GAAiD,CAAC,EACnE,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAC3C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,KAAC,eAAe,IACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,KAC1B,KAAK,GACT,CACH,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,KAC1B,KAAK,GACT,CACH,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,KAAM,KAAK,GAAI,CAAC;IAC/E,CAAC;IAED,OAAO,CACL,KAAC,kBAAkB,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,8CAE7C,CACtB,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VisualComponent.js","sourceRoot":"","sources":["../../src/components/VisualComponent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,MAAM,MAAM,GAAiD,CAAC,EACnE,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAC3C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,KAAC,eAAe,IACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,KAC1B,KAAK,GACT,CACH,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,KAC1B,KAAK,GACT,CACH,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,KAAM,KAAK,GAAI,CAAC;IAC/E,CAAC;IAED,OAAO,CACL,KAAC,kBAAkB,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,8CAE7C,CACtB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IAnalyticsContext } from '@se-studio/core-data-types';
|
|
2
|
+
import { type LinkProps } from 'next/link';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
export interface TrackedLinkProps extends Omit<LinkProps<string>, 'href'>, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps<string>> {
|
|
5
|
+
href?: string | null;
|
|
6
|
+
componentType?: string;
|
|
7
|
+
location?: string | null;
|
|
8
|
+
analyticsContext?: IAnalyticsContext;
|
|
9
|
+
linkText?: string;
|
|
10
|
+
appendUtmParams?: boolean;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
component?: React.ElementType;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Unified link component that handles:
|
|
17
|
+
* - All link types (internal, external, blank)
|
|
18
|
+
* - UTM parameter appending from URL search params
|
|
19
|
+
* - Click tracking integration
|
|
20
|
+
* - Uses Next.js Link for all URLs (handles absolute URLs correctly)
|
|
21
|
+
* - Uses href="#" for blank links
|
|
22
|
+
*/
|
|
23
|
+
export declare const TrackedLink: React.ForwardRefExoticComponent<TrackedLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
24
|
+
//# sourceMappingURL=TrackedLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackedLink.d.ts","sourceRoot":"","sources":["../../src/elements/TrackedLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,4FA+GtB,CAAC"}
|