@cntrl-site/components 1.0.96 → 1.0.97-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/ClickGallerie/ClickGallerie.d.ts +3 -2
- package/dist/Components/ControlSlider/ControlSlider.d.ts +1 -1
- package/dist/Components/Helix/Helix.d.ts +1 -1
- package/dist/Components/Hive/Hive.d.ts +1 -1
- package/dist/Components/Hive/HiveComponent.d.ts +3 -1
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +3 -2
- package/dist/Components/Lightbox/Lightbox.d.ts +2 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -1
- package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +5 -2
- package/dist/Components/LightboxJournal/utils.d.ts +1 -1
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -1
- package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +5 -2
- package/dist/Components/List/List.d.ts +3 -2
- package/dist/Components/Marquee/Marquee.d.ts +3 -2
- package/dist/Components/MarqueeText/MarqueeText.d.ts +3 -2
- package/dist/Components/Mercury/Mercury.d.ts +1 -1
- package/dist/Components/Scale/Scale.d.ts +1 -1
- package/dist/Components/Slider20/Slider20.d.ts +1 -1
- package/dist/Components/TestimonialGrid/TestimonialGrid.d.ts +1 -1
- package/dist/Components/TestimonialSingle/TestimonialSingle.d.ts +1 -1
- package/dist/Components/Waterfall/WaterfallComponent.d.ts +3 -1
- package/dist/Components/Waterfall/WaterfallLightbox.d.ts +1 -1
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +2 -0
- package/dist/Components/utils/LinkWrapper.d.ts +16 -0
- package/dist/Components/utils/index.d.ts +2 -0
- package/dist/LinkWrapper-CM1Wd42k.js +1 -0
- package/dist/LinkWrapper-D4d13mZT.mjs +137 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +394 -338
- package/dist/index.mjs +9179 -9000
- package/dist/types/SchemaV1.d.ts +53 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +11 -10
- package/package.json +1 -1
- package/dist/panelAvailability-CgSic84c.mjs +0 -126
- package/dist/panelAvailability-D8c7cdbu.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
type ClickGallerieItem = {
|
|
3
4
|
image: {
|
|
4
|
-
|
|
5
|
+
assetId: string;
|
|
5
6
|
name: string;
|
|
6
7
|
};
|
|
7
|
-
link
|
|
8
|
+
link?: ContentLink;
|
|
8
9
|
};
|
|
9
10
|
type ImageSizeSettings = {
|
|
10
11
|
sizeType: 'custom' | 'as is' | 'random';
|
|
@@ -9,7 +9,7 @@ type SliderProps = {
|
|
|
9
9
|
export declare function ControlSlider({ settings, content, styles: sliderStyles, isEditor }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
type SliderItem = {
|
|
11
11
|
image: {
|
|
12
|
-
|
|
12
|
+
assetId: string;
|
|
13
13
|
name?: string;
|
|
14
14
|
objectFit?: 'cover' | 'contain';
|
|
15
15
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContentLink } from '../utils/index';
|
|
1
2
|
interface ImageRevealSliderProps {
|
|
2
3
|
settings: ImageRevealSliderSettings;
|
|
3
4
|
content: ImageRevealSliderItem[];
|
|
@@ -31,10 +32,10 @@ type ImageRevealSliderSettings = {
|
|
|
31
32
|
};
|
|
32
33
|
type ImageRevealSliderItem = {
|
|
33
34
|
image: {
|
|
34
|
-
|
|
35
|
+
assetId: string;
|
|
35
36
|
name: string;
|
|
36
37
|
};
|
|
37
|
-
link
|
|
38
|
+
link?: ContentLink;
|
|
38
39
|
};
|
|
39
40
|
export declare function ImageRevealSlider({ settings, content, isEditor }: ImageRevealSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
40
41
|
export {};
|
|
@@ -12,7 +12,7 @@ type LightboxGalleryProps = {
|
|
|
12
12
|
export declare const LightboxGallery: ({ settings, content, styles, portalId, activeEvent, isEditor, isPreviewMode }: LightboxGalleryProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
type LightboxImage = {
|
|
14
14
|
image: {
|
|
15
|
-
|
|
15
|
+
assetId: string;
|
|
16
16
|
name?: string;
|
|
17
17
|
objectFit?: 'cover' | 'contain';
|
|
18
18
|
};
|
|
@@ -47,7 +47,7 @@ type Triggers = {
|
|
|
47
47
|
type LightboxSettings = {
|
|
48
48
|
thumbnailBlock: {
|
|
49
49
|
cover: {
|
|
50
|
-
|
|
50
|
+
assetId: string;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
lightboxBlock: {
|
|
@@ -2,7 +2,7 @@ import { CommonComponentProps } from '../props';
|
|
|
2
2
|
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
3
|
import { ImageRatioFit } from '../utils/imageFitStyles';
|
|
4
4
|
export type LightboxJournalImage = {
|
|
5
|
-
|
|
5
|
+
assetId: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
objectFit?: 'cover' | 'contain';
|
|
8
8
|
};
|
|
@@ -34,10 +34,13 @@ export declare const LightboxJournalComponent: {
|
|
|
34
34
|
path: string;
|
|
35
35
|
placeholderEnabled: boolean;
|
|
36
36
|
}[];
|
|
37
|
-
parameters: {
|
|
37
|
+
parameters: ({
|
|
38
38
|
path: string;
|
|
39
39
|
placeholderEnabled: boolean;
|
|
40
|
-
}
|
|
40
|
+
} | {
|
|
41
|
+
path: string;
|
|
42
|
+
placeholderEnabled?: undefined;
|
|
43
|
+
})[];
|
|
41
44
|
};
|
|
42
45
|
fontSettingsPaths: {
|
|
43
46
|
content: never[];
|
|
@@ -2,7 +2,7 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
3
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4
4
|
type JournalImage = {
|
|
5
|
-
|
|
5
|
+
assetId: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
objectFit?: 'cover' | 'contain';
|
|
8
8
|
};
|
|
@@ -5,7 +5,7 @@ export { createStripTextStylePanelTab, createStripTextStyleTabContentItems, extr
|
|
|
5
5
|
export type { StripGlobalTextStyleKey, StripTextStylePrefix, StripTitleWidthKey, } from './utils';
|
|
6
6
|
export type LightboxStripItem = {
|
|
7
7
|
image: {
|
|
8
|
-
|
|
8
|
+
assetId: string;
|
|
9
9
|
name?: string;
|
|
10
10
|
objectFit?: 'cover' | 'contain';
|
|
11
11
|
};
|
|
@@ -34,10 +34,13 @@ export declare const LightboxStripComponent: {
|
|
|
34
34
|
path: string;
|
|
35
35
|
placeholderEnabled: boolean;
|
|
36
36
|
}[];
|
|
37
|
-
parameters: {
|
|
37
|
+
parameters: ({
|
|
38
38
|
path: string;
|
|
39
39
|
placeholderEnabled: boolean;
|
|
40
|
-
}
|
|
40
|
+
} | {
|
|
41
|
+
path: string;
|
|
42
|
+
placeholderEnabled?: undefined;
|
|
43
|
+
})[];
|
|
41
44
|
};
|
|
42
45
|
fontSettingsPaths: {
|
|
43
46
|
content: never[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
4
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4
5
|
type ListFontSettings = {
|
|
@@ -118,7 +119,7 @@ export type ListSettings = {
|
|
|
118
119
|
} & ListColumnTextStyleOverrides;
|
|
119
120
|
type ListMedia = {
|
|
120
121
|
objectFit?: 'cover' | 'contain';
|
|
121
|
-
|
|
122
|
+
assetId: string;
|
|
122
123
|
name: string;
|
|
123
124
|
type?: 'image' | 'video';
|
|
124
125
|
};
|
|
@@ -129,7 +130,7 @@ type ListContentItem = {
|
|
|
129
130
|
DColumnWidth?: string;
|
|
130
131
|
EColumnWidth?: string;
|
|
131
132
|
image?: ListMedia;
|
|
132
|
-
link?:
|
|
133
|
+
link?: ContentLink;
|
|
133
134
|
};
|
|
134
135
|
type ListProps = {
|
|
135
136
|
layoutId?: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
export declare const Marquee: ({ settings, content, isEditor, isPreviewMode, isEditMode }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export type MarqueeItem = {
|
|
4
5
|
image?: {
|
|
5
|
-
|
|
6
|
+
assetId?: string;
|
|
6
7
|
name?: string;
|
|
7
8
|
type?: 'image' | 'video';
|
|
8
9
|
};
|
|
9
|
-
link?:
|
|
10
|
+
link?: ContentLink;
|
|
10
11
|
};
|
|
11
12
|
export type MarqueeSettings = {
|
|
12
13
|
speed: number;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
export declare const MarqueeText: ({ settings, content, isEditor, isPreviewMode }: MarqueeTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export type MarqueeTextItem = {
|
|
4
5
|
text: string;
|
|
5
6
|
image?: {
|
|
6
|
-
|
|
7
|
+
assetId?: string;
|
|
7
8
|
name?: string;
|
|
8
9
|
};
|
|
9
|
-
link?:
|
|
10
|
+
link?: ContentLink;
|
|
10
11
|
};
|
|
11
12
|
export type MarqueeTextSettings = {
|
|
12
13
|
speed: number;
|
|
@@ -9,7 +9,7 @@ type TestimonialsProps = {
|
|
|
9
9
|
export declare const TestimonialGrid: ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export type TestimonialsItem = {
|
|
11
11
|
logo?: {
|
|
12
|
-
|
|
12
|
+
assetId?: string;
|
|
13
13
|
name?: string;
|
|
14
14
|
objectFit?: 'cover' | 'contain';
|
|
15
15
|
};
|
|
@@ -9,7 +9,7 @@ type TestimonialsProps = {
|
|
|
9
9
|
export declare const TestimonialSingle: ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export type TestimonialsItem = {
|
|
11
11
|
image?: {
|
|
12
|
-
|
|
12
|
+
assetId?: string;
|
|
13
13
|
name?: string;
|
|
14
14
|
objectFit?: 'cover' | 'contain';
|
|
15
15
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* A content link or a rich text link node: both keep the url in `value` and `blank` or `self`
|
|
5
|
+
* in `target` (`_blank` is taken too).
|
|
6
|
+
*/
|
|
7
|
+
link?: {
|
|
8
|
+
value: string;
|
|
9
|
+
target?: string;
|
|
10
|
+
};
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const LinkWrapper: FC<Props>;
|
|
16
|
+
export {};
|
|
@@ -9,3 +9,5 @@ export type { CommonComponentProps } from '../props';
|
|
|
9
9
|
export { readTestimonialTextMeasure } from './readTestimonialTextMeasure';
|
|
10
10
|
export { getAvailableStatePanels, getUnavailableStates, isPanelAvailable, } from './panelAvailability';
|
|
11
11
|
export type { PanelAvailabilityContext } from './panelAvailability';
|
|
12
|
+
export { LinkWrapper } from './LinkWrapper';
|
|
13
|
+
export type { ContentLink } from '../../types/SchemaV1';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("react"),u=require("react/jsx-runtime");function v(t,e=!1){return e?`calc(var(--cntrl-article-width) * ${t})`:`${t*100}vw`}const x=(t,e,r,a,n)=>{const i={};for(const[s,l]of Object.entries(r))i[`--${t}-${l}`]=e[s];const o=new Set(a);if(n)for(const s of Object.keys(n))o.add(s);for(const s of o){const l=n==null?void 0:n[s];if(l)for(const[h,b]of Object.entries(r)){const c=l[h];c!==void 0&&(i[`--${t}-${s}-${b}`]=c)}}return i};function S(t){const e=t.trim();if(!e||e==="none")return 1;if(e.endsWith("%")){const a=parseFloat(e);return Number.isFinite(a)?a/100:1}const r=parseFloat(e);return Number.isFinite(r)?r:1}function F(t){const e=t.lastIndexOf("/");if(e!==-1)return S(t.slice(e+1))}function $(t){const e=t.trim().toLowerCase();if(!e||e==="transparent")return 0;const r=e.match(/^(?:oklch|oklab|rgba?|hsla?|hwb|lab|lch|color)\((.+)\)$/);if(r){const n=r[1],i=F(n);if(i!==void 0)return i;if(/^(?:rgba|hsla)$/.test(e.slice(0,4))){const o=n.split(",").map(s=>parseFloat(s.trim()));if(o.length===4&&Number.isFinite(o[3]))return o[3]}return 1}const a=e.match(/^#([0-9a-f]{4}|[0-9a-f]{8})$/);if(a){const n=a[1],i=n.length===4?n[3]+n[3]:n.slice(6,8);return parseInt(i,16)/255}return 1}const A=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,f=t=>A.test(t.trim()),d=t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15},y=(t,e)=>{var r;for(const a of t){const n=((r=e[a.name])==null?void 0:r.trim())??"";if(n){if(a.type==="email"&&!f(n))return"Please enter a valid email address.";if(a.type==="phone"&&!d(n))return"Please enter a valid phone number."}}return null};function P(){const e=`cf-${m.useId().replace(/:/g,"")}`;return{prefix:e,cls:r=>`${e}-${r}`}}const V=(t,e)=>{const r=Array.from(t.querySelectorAll('[data-testimonial-measure="text"]')).reduce((n,i)=>Math.max(n,i.getBoundingClientRect().height),0),a=Array.from(t.querySelectorAll('[data-testimonial-measure="caption"]')).reduce((n,i)=>Math.max(n,i.getBoundingClientRect().height),0);e({maxTextPx:r,maxCaptionPx:a})};function g(t,e){const r=t==null?void 0:t.availableWhen;return r?Object.entries(r).every(([a,n])=>{if(!(n!=null&&n.length))return!0;const i=e[a];return i===void 0?!0:n.includes(i)}):!0}function p(t,e){const r=t==null?void 0:t.statePanels;return r!=null&&r.length?r.filter(a=>{var i;const n=(i=t==null?void 0:t.panels)==null?void 0:i.find(o=>o.id===a);return g(n,e)}):null}function E(t,e){const r=t==null?void 0:t.statePanels;if(!(r!=null&&r.length))return[];const a=new Set(p(t,e)??[]);return r.filter(n=>!a.has(n))}const j=["http://","https://","/","mailto:","tel:","file:","ftp:","javascript","#"];function C(t){return j.some(e=>t.startsWith(e))?t:`//${t}`}const I=({link:t,className:e,style:r,children:a})=>{if(!(t!=null&&t.value))return u.jsx(u.Fragment,{children:a});const n=t.target==="blank"||t.target==="_blank"?{target:"_blank",rel:"noreferrer"}:{};return u.jsx("a",{href:C(t.value),className:e,style:r,...n,children:a})};exports.LinkWrapper=I;exports.buildColorVars=x;exports.getAvailableStatePanels=p;exports.getColorAlpha=$;exports.getFormFieldValidationError=y;exports.getUnavailableStates=E;exports.isPanelAvailable=g;exports.isValidEmailFormat=f;exports.isValidPhoneFormat=d;exports.readTestimonialTextMeasure=V;exports.scalingValue=v;exports.useScopedStyles=P;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { useId as g } from "react";
|
|
2
|
+
import { jsx as c, Fragment as d } from "react/jsx-runtime";
|
|
3
|
+
function E(t, e = !1) {
|
|
4
|
+
return e ? `calc(var(--cntrl-article-width) * ${t})` : `${t * 100}vw`;
|
|
5
|
+
}
|
|
6
|
+
const I = (t, e, r, a, n) => {
|
|
7
|
+
const i = {};
|
|
8
|
+
for (const [s, l] of Object.entries(r))
|
|
9
|
+
i[`--${t}-${l}`] = e[s];
|
|
10
|
+
const o = new Set(a);
|
|
11
|
+
if (n)
|
|
12
|
+
for (const s of Object.keys(n))
|
|
13
|
+
o.add(s);
|
|
14
|
+
for (const s of o) {
|
|
15
|
+
const l = n == null ? void 0 : n[s];
|
|
16
|
+
if (l)
|
|
17
|
+
for (const [f, p] of Object.entries(r)) {
|
|
18
|
+
const u = l[f];
|
|
19
|
+
u !== void 0 && (i[`--${t}-${s}-${p}`] = u);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return i;
|
|
23
|
+
};
|
|
24
|
+
function h(t) {
|
|
25
|
+
const e = t.trim();
|
|
26
|
+
if (!e || e === "none") return 1;
|
|
27
|
+
if (e.endsWith("%")) {
|
|
28
|
+
const a = parseFloat(e);
|
|
29
|
+
return Number.isFinite(a) ? a / 100 : 1;
|
|
30
|
+
}
|
|
31
|
+
const r = parseFloat(e);
|
|
32
|
+
return Number.isFinite(r) ? r : 1;
|
|
33
|
+
}
|
|
34
|
+
function m(t) {
|
|
35
|
+
const e = t.lastIndexOf("/");
|
|
36
|
+
if (e !== -1)
|
|
37
|
+
return h(t.slice(e + 1));
|
|
38
|
+
}
|
|
39
|
+
function j(t) {
|
|
40
|
+
const e = t.trim().toLowerCase();
|
|
41
|
+
if (!e || e === "transparent") return 0;
|
|
42
|
+
const r = e.match(/^(?:oklch|oklab|rgba?|hsla?|hwb|lab|lch|color)\((.+)\)$/);
|
|
43
|
+
if (r) {
|
|
44
|
+
const n = r[1], i = m(n);
|
|
45
|
+
if (i !== void 0) return i;
|
|
46
|
+
if (/^(?:rgba|hsla)$/.test(e.slice(0, 4))) {
|
|
47
|
+
const o = n.split(",").map((s) => parseFloat(s.trim()));
|
|
48
|
+
if (o.length === 4 && Number.isFinite(o[3]))
|
|
49
|
+
return o[3];
|
|
50
|
+
}
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
const a = e.match(/^#([0-9a-f]{4}|[0-9a-f]{8})$/);
|
|
54
|
+
if (a) {
|
|
55
|
+
const n = a[1], i = n.length === 4 ? n[3] + n[3] : n.slice(6, 8);
|
|
56
|
+
return parseInt(i, 16) / 255;
|
|
57
|
+
}
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
const b = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, v = (t) => b.test(t.trim()), x = (t) => {
|
|
61
|
+
const e = t.replace(/\D/g, "");
|
|
62
|
+
return e.length >= 7 && e.length <= 15;
|
|
63
|
+
}, C = (t, e) => {
|
|
64
|
+
var r;
|
|
65
|
+
for (const a of t) {
|
|
66
|
+
const n = ((r = e[a.name]) == null ? void 0 : r.trim()) ?? "";
|
|
67
|
+
if (n) {
|
|
68
|
+
if (a.type === "email" && !v(n))
|
|
69
|
+
return "Please enter a valid email address.";
|
|
70
|
+
if (a.type === "phone" && !x(n))
|
|
71
|
+
return "Please enter a valid phone number.";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
function L() {
|
|
77
|
+
const e = `cf-${g().replace(/:/g, "")}`;
|
|
78
|
+
return {
|
|
79
|
+
prefix: e,
|
|
80
|
+
cls: (r) => `${e}-${r}`
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const M = (t, e) => {
|
|
84
|
+
const r = Array.from(t.querySelectorAll('[data-testimonial-measure="text"]')).reduce(
|
|
85
|
+
(n, i) => Math.max(n, i.getBoundingClientRect().height),
|
|
86
|
+
0
|
|
87
|
+
), a = Array.from(t.querySelectorAll('[data-testimonial-measure="caption"]')).reduce(
|
|
88
|
+
(n, i) => Math.max(n, i.getBoundingClientRect().height),
|
|
89
|
+
0
|
|
90
|
+
);
|
|
91
|
+
e({ maxTextPx: r, maxCaptionPx: a });
|
|
92
|
+
};
|
|
93
|
+
function $(t, e) {
|
|
94
|
+
const r = t == null ? void 0 : t.availableWhen;
|
|
95
|
+
return r ? Object.entries(r).every(([a, n]) => {
|
|
96
|
+
if (!(n != null && n.length)) return !0;
|
|
97
|
+
const i = e[a];
|
|
98
|
+
return i === void 0 ? !0 : n.includes(i);
|
|
99
|
+
}) : !0;
|
|
100
|
+
}
|
|
101
|
+
function S(t, e) {
|
|
102
|
+
const r = t == null ? void 0 : t.statePanels;
|
|
103
|
+
return r != null && r.length ? r.filter((a) => {
|
|
104
|
+
var i;
|
|
105
|
+
const n = (i = t == null ? void 0 : t.panels) == null ? void 0 : i.find((o) => o.id === a);
|
|
106
|
+
return $(n, e);
|
|
107
|
+
}) : null;
|
|
108
|
+
}
|
|
109
|
+
function R(t, e) {
|
|
110
|
+
const r = t == null ? void 0 : t.statePanels;
|
|
111
|
+
if (!(r != null && r.length)) return [];
|
|
112
|
+
const a = new Set(S(t, e) ?? []);
|
|
113
|
+
return r.filter((n) => !a.has(n));
|
|
114
|
+
}
|
|
115
|
+
const F = ["http://", "https://", "/", "mailto:", "tel:", "file:", "ftp:", "javascript", "#"];
|
|
116
|
+
function y(t) {
|
|
117
|
+
return F.some((e) => t.startsWith(e)) ? t : `//${t}`;
|
|
118
|
+
}
|
|
119
|
+
const V = ({ link: t, className: e, style: r, children: a }) => {
|
|
120
|
+
if (!(t != null && t.value)) return /* @__PURE__ */ c(d, { children: a });
|
|
121
|
+
const n = t.target === "blank" || t.target === "_blank" ? { target: "_blank", rel: "noreferrer" } : {};
|
|
122
|
+
return /* @__PURE__ */ c("a", { href: y(t.value), className: e, style: r, ...n, children: a });
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
V as L,
|
|
126
|
+
C as a,
|
|
127
|
+
I as b,
|
|
128
|
+
x as c,
|
|
129
|
+
S as d,
|
|
130
|
+
R as e,
|
|
131
|
+
$ as f,
|
|
132
|
+
j as g,
|
|
133
|
+
v as i,
|
|
134
|
+
M as r,
|
|
135
|
+
E as s,
|
|
136
|
+
L as u
|
|
137
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type Breakpoint, type Component, type ComponentDefaultSize, type ComponentDefaultNavigationPosition, type ComponentNavigationPosition, type ComponentSize, isSchemaV1 } from './types/Component';
|
|
2
|
-
export type { ComponentSchemaV1, SchemaProperty, PropertyScope, LayoutItem, LayoutRow, LayoutGroup, LayoutSwitcher, LayoutTab, SchemaSection, SchemaPanel, SchemaPanelAvailability, SchemaDisplay } from './types/SchemaV1';
|
|
2
|
+
export type { ComponentSchemaV1, ComponentContentSchema, ComponentContentSettings, ComponentContentProperty, ContentKey, ContentLink, SchemaProperty, PropertyScope, LayoutItem, LayoutRow, LayoutGroup, LayoutSwitcher, LayoutTab, SchemaSection, SchemaPanel, SchemaPanelAvailability, SchemaDisplay } from './types/SchemaV1';
|
|
3
3
|
export { components } from './Components/components';
|
|
4
4
|
export { getAvailableStatePanels, getUnavailableStates, isPanelAvailable, } from './Components/utils/panelAvailability';
|
|
5
5
|
export type { PanelAvailabilityContext } from './Components/utils/panelAvailability';
|