@kajoo-ai/sitecore-react 21.0.3 → 21.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/dist/cjs/components/button.d.ts +7 -12
- package/dist/cjs/components/check-box.d.ts +3 -8
- package/dist/cjs/components/container.d.ts +10 -14
- package/dist/cjs/components/drop-down/drop-down.d.ts +3 -4
- package/dist/cjs/components/drop-down/index.d.ts +1 -1
- package/dist/cjs/components/header.d.ts +8 -4
- package/dist/cjs/components/image.d.ts +10 -19
- package/dist/cjs/components/kajoo-component/index.d.ts +1 -1
- package/dist/cjs/components/kajoo-component/kajoo-component.d.ts +46 -40
- package/dist/cjs/components/kajoo-component/services.d.ts +8 -8
- package/dist/cjs/components/label.d.ts +8 -4
- package/dist/cjs/components/linebreak.d.ts +3 -5
- package/dist/cjs/components/link.d.ts +9 -14
- package/dist/cjs/components/list.d.ts +3 -4
- package/dist/cjs/components/paragraph.d.ts +8 -4
- package/dist/cjs/components/progress-bar.d.ts +5 -7
- package/dist/cjs/components/radio-button.d.ts +3 -7
- package/dist/cjs/components/repeater.d.ts +3 -4
- package/dist/cjs/components/rich-text.d.ts +8 -4
- package/dist/cjs/components/slider.d.ts +5 -7
- package/dist/cjs/components/text-area.d.ts +3 -5
- package/dist/cjs/components/text-input.d.ts +3 -5
- package/dist/cjs/components/text.d.ts +9 -12
- package/dist/cjs/components/toggle/index.d.ts +1 -1
- package/dist/cjs/components/toggle/toggle.d.ts +5 -4
- package/dist/cjs/components/type-form/index.d.ts +1 -1
- package/dist/cjs/components/type-form/type-form.d.ts +3 -4
- package/dist/cjs/components/video.d.ts +8 -4
- package/dist/cjs/factories/KajooLayoutFactory.d.ts +12 -13
- package/dist/cjs/index.d.ts +37 -37
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/toObject.d.ts +2 -2
- package/dist/cjs/types.d.ts +3 -4
- package/dist/cjs/utils.d.ts +6 -6
- package/dist/esm/components/button.d.ts +7 -12
- package/dist/esm/components/check-box.d.ts +3 -8
- package/dist/esm/components/container.d.ts +10 -14
- package/dist/esm/components/drop-down/drop-down.d.ts +3 -4
- package/dist/esm/components/drop-down/index.d.ts +1 -1
- package/dist/esm/components/header.d.ts +8 -4
- package/dist/esm/components/image.d.ts +10 -19
- package/dist/esm/components/kajoo-component/index.d.ts +1 -1
- package/dist/esm/components/kajoo-component/kajoo-component.d.ts +46 -40
- package/dist/esm/components/kajoo-component/services.d.ts +8 -8
- package/dist/esm/components/label.d.ts +8 -4
- package/dist/esm/components/linebreak.d.ts +3 -5
- package/dist/esm/components/link.d.ts +9 -14
- package/dist/esm/components/list.d.ts +3 -4
- package/dist/esm/components/paragraph.d.ts +8 -4
- package/dist/esm/components/progress-bar.d.ts +5 -7
- package/dist/esm/components/radio-button.d.ts +3 -7
- package/dist/esm/components/repeater.d.ts +3 -4
- package/dist/esm/components/rich-text.d.ts +8 -4
- package/dist/esm/components/slider.d.ts +5 -7
- package/dist/esm/components/text-area.d.ts +3 -5
- package/dist/esm/components/text-input.d.ts +3 -5
- package/dist/esm/components/text.d.ts +9 -12
- package/dist/esm/components/toggle/index.d.ts +1 -1
- package/dist/esm/components/toggle/toggle.d.ts +5 -4
- package/dist/esm/components/type-form/index.d.ts +1 -1
- package/dist/esm/components/type-form/type-form.d.ts +3 -4
- package/dist/esm/components/video.d.ts +8 -4
- package/dist/esm/factories/KajooLayoutFactory.d.ts +12 -13
- package/dist/esm/index.d.ts +37 -37
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/toObject.d.ts +2 -2
- package/dist/esm/types.d.ts +3 -4
- package/dist/esm/utils.d.ts +6 -6
- package/dist/index.d.ts +139 -138
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -56
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { Text, Field } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
type IScText = ComponentProps<typeof Text>;
|
|
4
|
+
export interface IProps extends Omit<IScText, 'field'> {
|
|
5
|
+
text?: Field<string> | string;
|
|
6
|
+
}
|
|
7
|
+
declare const Label: ({ text, ...rest }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Label;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
declare const Linebreak: FC<IProps>;
|
|
5
|
-
export default Linebreak;
|
|
1
|
+
export type IProps = JSX.IntrinsicElements["hr"];
|
|
2
|
+
declare const Linebreak: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Linebreak;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
text?: ITextField | string;
|
|
11
|
-
href: ISitecoreLink["field"] | string;
|
|
12
|
-
}
|
|
13
|
-
declare const Link: FC<ILink>;
|
|
14
|
-
export default Link;
|
|
1
|
+
import { Link as SitecoreLink, Field } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
type ISitecoreLink = Parameters<typeof SitecoreLink>[0];
|
|
3
|
+
interface ILink extends Omit<ISitecoreLink, "field" | "href"> {
|
|
4
|
+
text?: Field<string> | string;
|
|
5
|
+
href: ISitecoreLink["field"] | string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
declare const Link: (props: ILink) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Link;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default List;
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
declare const List: FC<any>;
|
|
3
|
+
export default List;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { RichText, Field } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
type IScRichText = ComponentProps<typeof RichText>;
|
|
4
|
+
export interface IProps extends Omit<IScRichText, 'field'> {
|
|
5
|
+
text?: Field<string> | string;
|
|
6
|
+
}
|
|
7
|
+
declare const Paragraph: ({ tag, text, ...rest }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Paragraph;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const ProgressBar: FC<IProps>;
|
|
7
|
-
export default ProgressBar;
|
|
1
|
+
export interface IProps {
|
|
2
|
+
className: string;
|
|
3
|
+
}
|
|
4
|
+
declare const ProgressBar: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default ProgressBar;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
className: string;
|
|
5
|
-
}
|
|
6
|
-
declare const Radiobutton: FC<IProps>;
|
|
7
|
-
export default Radiobutton;
|
|
1
|
+
export type IProps = Omit<JSX.IntrinsicElements["input"], "type" | 'name'>;
|
|
2
|
+
declare const Radiobutton: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Radiobutton;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default Repeater;
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
declare const Repeater: FC<any>;
|
|
3
|
+
export default Repeater;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { Field, RichText as SitecoreRichText } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
type ScRichTextProps = ComponentProps<typeof SitecoreRichText>;
|
|
4
|
+
export interface IProps extends Omit<ScRichTextProps, 'field'> {
|
|
5
|
+
value?: Field<string> | string;
|
|
6
|
+
}
|
|
7
|
+
declare const RichText: ({ value, tag, ...rest }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default RichText;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const Slider: FC<IProps>;
|
|
7
|
-
export default Slider;
|
|
1
|
+
export interface IProps {
|
|
2
|
+
className: string;
|
|
3
|
+
}
|
|
4
|
+
declare const Slider: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default Slider;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
declare const Textarea: FC<IProps>;
|
|
5
|
-
export default Textarea;
|
|
1
|
+
export type IProps = JSX.IntrinsicElements["textarea"];
|
|
2
|
+
declare const Textarea: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Textarea;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
declare const Textinput: FC<IProps>;
|
|
5
|
-
export default Textinput;
|
|
1
|
+
export type IProps = Omit<JSX.IntrinsicElements["input"], "type">;
|
|
2
|
+
declare const Textinput: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Textinput;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
declare const Text: FC<IProps>;
|
|
12
|
-
export default Text;
|
|
1
|
+
import { Text as SitecoreText, Field } from '@sitecore-jss/sitecore-jss-react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type IScText = ComponentProps<typeof SitecoreText>;
|
|
4
|
+
export interface IProps extends Omit<IScText, 'field' | 'tag'> {
|
|
5
|
+
text?: Field<string> | string;
|
|
6
|
+
tag?: keyof JSX.IntrinsicElements;
|
|
7
|
+
}
|
|
8
|
+
declare const Text: ({ text, children, tag, ...rest }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './toggle';
|
|
1
|
+
export { default } from './toggle';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface IProps extends Omit<JSX.IntrinsicElements["input"], "type"> {
|
|
2
|
+
slider?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const Toggle: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default Toggle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './type-form';
|
|
1
|
+
export { default } from './type-form';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default TypeForm;
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
declare const TypeForm: FC<any>;
|
|
3
|
+
export default TypeForm;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Field } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
import { VideoHTMLAttributes } from "react";
|
|
3
|
+
export interface IProps extends Omit<VideoHTMLAttributes<HTMLVideoElement>, 'src' | 'muted'> {
|
|
4
|
+
src?: Field<string> | string;
|
|
5
|
+
muted?: boolean | string;
|
|
6
|
+
}
|
|
7
|
+
declare const Video: ({ src, ...rest }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Video;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export default KajooLayoutFactory;
|
|
1
|
+
import { RouteData, LayoutServiceData } from "@sitecore-jss/sitecore-jss-react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface ILayoutProps extends RouteData {
|
|
4
|
+
layoutData: LayoutServiceData;
|
|
5
|
+
}
|
|
6
|
+
type ILayout = React.FC<ILayoutProps>;
|
|
7
|
+
export declare class KajooLayoutFactory {
|
|
8
|
+
private static readonly layoutsByName;
|
|
9
|
+
static getLayout: (route: RouteData) => ILayout;
|
|
10
|
+
static registerLayout: (name: string, layout: ILayout) => void;
|
|
11
|
+
}
|
|
12
|
+
export default KajooLayoutFactory;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exported Components
|
|
3
|
-
*/
|
|
4
|
-
export { default as Button } from "./components/button";
|
|
5
|
-
export { default as Checkbox } from "./components/check-box";
|
|
6
|
-
export { default as Container } from "./components/container";
|
|
7
|
-
export { default as Dropdown } from "./components/drop-down";
|
|
8
|
-
export { default as Header } from "./components/header";
|
|
9
|
-
export { default as Image } from "./components/image";
|
|
10
|
-
export { default as Label } from "./components/label";
|
|
11
|
-
export { default as Linebreak } from "./components/linebreak";
|
|
12
|
-
export { default as Link } from "./components/link";
|
|
13
|
-
export { default as List } from "./components/list";
|
|
14
|
-
export { default as Paragraph } from "./components/paragraph";
|
|
15
|
-
export { default as ProgressBar } from "./components/progress-bar";
|
|
16
|
-
export { default as Radiobutton } from "./components/radio-button";
|
|
17
|
-
export { default as Slider } from "./components/slider";
|
|
18
|
-
export { default as Textarea } from "./components/text-area";
|
|
19
|
-
export { default as Textinput } from "./components/text-input";
|
|
20
|
-
export { default as Toggle } from "./components/toggle";
|
|
21
|
-
export { default as TypeForm } from "./components/type-form";
|
|
22
|
-
export { default as Video } from "./components/video";
|
|
23
|
-
export { default as Text } from "./components/text";
|
|
24
|
-
export { default as RichText } from "./components/rich-text";
|
|
25
|
-
export { default as Repeater } from "./components/repeater";
|
|
26
|
-
export { default as KajooComponent } from "./components/kajoo-component";
|
|
27
|
-
export { default as KajooLayoutFactory } from "./factories/KajooLayoutFactory";
|
|
28
|
-
/**
|
|
29
|
-
* Exported Types
|
|
30
|
-
*/
|
|
31
|
-
export type { IProps as CheckboxProps } from "./components/check-box";
|
|
32
|
-
export type { IProps as LinebreakProps } from "./components/linebreak";
|
|
33
|
-
export type { IProps as RadiobuttonProps } from "./components/radio-button";
|
|
34
|
-
export type { IProps as SliderProps } from "./components/slider";
|
|
35
|
-
export type { IProps as TextareaProps } from "./components/text-area";
|
|
36
|
-
export type { IProps as TextinputProps } from "./components/text-input";
|
|
37
|
-
export type { IProps as KajooComponentProps } from "./components/kajoo-component/kajoo-component";
|
|
1
|
+
/**
|
|
2
|
+
* Exported Components
|
|
3
|
+
*/
|
|
4
|
+
export { default as Button } from "./components/button";
|
|
5
|
+
export { default as Checkbox } from "./components/check-box";
|
|
6
|
+
export { default as Container } from "./components/container";
|
|
7
|
+
export { default as Dropdown } from "./components/drop-down";
|
|
8
|
+
export { default as Header } from "./components/header";
|
|
9
|
+
export { default as Image } from "./components/image";
|
|
10
|
+
export { default as Label } from "./components/label";
|
|
11
|
+
export { default as Linebreak } from "./components/linebreak";
|
|
12
|
+
export { default as Link } from "./components/link";
|
|
13
|
+
export { default as List } from "./components/list";
|
|
14
|
+
export { default as Paragraph } from "./components/paragraph";
|
|
15
|
+
export { default as ProgressBar } from "./components/progress-bar";
|
|
16
|
+
export { default as Radiobutton } from "./components/radio-button";
|
|
17
|
+
export { default as Slider } from "./components/slider";
|
|
18
|
+
export { default as Textarea } from "./components/text-area";
|
|
19
|
+
export { default as Textinput } from "./components/text-input";
|
|
20
|
+
export { default as Toggle } from "./components/toggle";
|
|
21
|
+
export { default as TypeForm } from "./components/type-form";
|
|
22
|
+
export { default as Video } from "./components/video";
|
|
23
|
+
export { default as Text } from "./components/text";
|
|
24
|
+
export { default as RichText } from "./components/rich-text";
|
|
25
|
+
export { default as Repeater } from "./components/repeater";
|
|
26
|
+
export { default as KajooComponent } from "./components/kajoo-component";
|
|
27
|
+
export { default as KajooLayoutFactory } from "./factories/KajooLayoutFactory";
|
|
28
|
+
/**
|
|
29
|
+
* Exported Types
|
|
30
|
+
*/
|
|
31
|
+
export type { IProps as CheckboxProps } from "./components/check-box";
|
|
32
|
+
export type { IProps as LinebreakProps } from "./components/linebreak";
|
|
33
|
+
export type { IProps as RadiobuttonProps } from "./components/radio-button";
|
|
34
|
+
export type { IProps as SliderProps } from "./components/slider";
|
|
35
|
+
export type { IProps as TextareaProps } from "./components/text-area";
|
|
36
|
+
export type { IProps as TextinputProps } from "./components/text-input";
|
|
37
|
+
export type { IProps as KajooComponentProps } from "./components/kajoo-component/kajoo-component";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Text as n,Image as r,Link as o,RichText as i,isEditorActive as a}from"@sitecore-jss/sitecore-jss-react";import{PopupButton as l,Sidetab as c,Widget as d,SliderButton as u}from"@typeform/embed-react";import s from"react";import p from"contentstack";var f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};function m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function h(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}c((r=r.apply(e,t||[])).next())}))}function v(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}"function"==typeof SuppressedError&&SuppressedError;var g=function(e){var t;try{t="object"==typeof e?e:{value:JSON.parse('"'.concat(e,'"'))}}catch(n){t={value:e}}return t},y=function(r){var o=r.text,i=void 0===o?"":o,a=r.children,l=m(r,["text","children"]),c=g(i);return e("button",f({},l,{children:[t(n,{field:c}),Array.isArray(a)?a:[a]]}))},_=function(e){return t("input",f({},e,{type:"checkbox"}))},b=function(e){void 0===e&&(e="{}");try{return JSON.parse(e)}catch(e){return{}}},x=function(e){var n,r=e.bgImage,o=e.style,i=void 0===o?{}:o,a=e.tag,l=void 0===a?"div":a,c=e.children,d=m(e,["bgImage","style","tag","children"]),u=(null===(n=null==r?void 0:r.value)||void 0===n?void 0:n.src)||(null==r?void 0:r.value)||r,s=function(e){return void 0===e&&(e={}),"string"==typeof e?b(e):"object"==typeof e?e:{}}(i),p=f(f({},s),u?{backgroundImage:"url(".concat(u,")")}:{});return t(l,f({},d,{style:p},{children:Array.isArray(c)?c:[c]}))};function w(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var k="drop-down-module_dropbtn__6RDCs",C="drop-down-module_dropdown__UKh7X",S="drop-down-module_dropdownContent__YSmXE";w(".drop-down-module_dropbtn__6RDCs{cursor:pointer}.drop-down-module_dropdown__UKh7X{display:inline-block;position:relative}.drop-down-module_dropdownContent__YSmXE{background-color:#f9f9f9;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;position:absolute;z-index:1}.drop-down-module_dropdownContent__YSmXE span{color:#000;display:block;padding:12px 16px;text-decoration:none}.drop-down-module_dropdownContent__YSmXE span:hover{background-color:#f1f1f1}.drop-down-module_dropdown__UKh7X:hover .drop-down-module_dropdownContent__YSmXE{display:block}");var N=function(r){return e("div",f({className:"".concat(r.className," ").concat(C)},{children:[t("button",f({className:k,style:{width:"100%",height:"100%"}},{children:t(n,{field:r.text,editable:!0,encode:!0})})),t("div",f({className:S},{children:t("div",{children:r.list&&r.list.map((function(e,n){return t("div",{children:t("span",{children:e.name})},"listItem-"+n)}))})}))]}))},O=function(e){var r=e.text,o=m(e,["text"]);return t(n,f({tag:"h2"},o,{field:r}))},T=function(e){var n=e.src,o=e.alt,i=e.srcSet,a=void 0===i?"":i,l=m(e,["src","alt","srcSet"]),c="string"==typeof n?{value:{src:n,alt:"string"==typeof o?o:""}}:n,d=E(a);return t(r,f({},l,{field:c},d.length?{srcSet:d}:{}))},E=function(e){return"string"!=typeof e?e:e.split(", ").map((function(e){var t=e.split(" ");t[0];var n=t[1];return{w:(null==n?void 0:n.includes("w"))?parseInt(n):null}})).filter((function(e){return!!e.w}))},j=function(e){var r=e.text,o=m(e,["text"]),i=g(r);return t(n,f({tag:"label"},o,{field:i}))},I=function(e){return t("hr",f({},e))},A=function(e){var n=e.href,r=void 0===n?"#":n,i=e.text,a=void 0===i?"":i,l=m(e,["href","text"]),c=g(a),d="string"==typeof r?{value:{href:r,text:c.value}}:r;return t(o,f({},l,{field:d}))},B=function(e){var n=e.list,r=m(e,["list"]);return n?t("ul",f({},r,{children:null==n?void 0:n.map((function(e,n){return t("li",{children:t("span",{children:e.name||e.displayName})},"listItem-".concat(n))}))})):null},X=function(e){var n=e.tag,r=e.text,o=m(e,["tag","text"]);return t(i,f({},o,{tag:n||"p",field:r}))},R=function(n){return t("div",f({className:n.className,style:P},{children:t("div",f({style:U},{children:e("span",f({style:J},{children:[z,"%"]}))}))}))},z=45,P={height:20,width:"100%",backgroundColor:"#e0e0de",borderRadius:50,margin:50},U={height:"100%",width:"".concat(z,"%"),backgroundColor:"orange",borderRadius:"inherit",textAlign:"right"},J={padding:5,color:"white",fontWeight:"bold"},M=function(e){var n=e.className;return t("div",f({className:n},{children:t("input",{type:"radio",name:"radio"})}))},V=function(e){var n=e.className;return t("div",f({className:n},{children:t("input",{style:{padding:"0px"},type:"range",min:"1",max:"100",value:"50",className:"slider",id:"myRange"})}))},Y=function(e){return t("textarea",f({},e))},q=function(e){return t("input",f({},e,{type:"text"}))},K="toggle-module_switch__VMi8c",G="toggle-module_input__wSn48",L="toggle-module_round__qn6ng";w('.toggle-module_switch__VMi8c{background-color:#888;display:inline-block;position:relative}.toggle-module_switch__VMi8c .toggle-module_input__wSn48{height:0;opacity:0;width:0}.toggle-module_slider__TOxdr{background-color:#444;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-transition:.4s;transition:.4s}.toggle-module_slider__TOxdr:before{background-color:#fff;bottom:5%;content:"";height:90%;left:5%;position:absolute;transition:.4s;width:50%}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr{background-color:#545454}.toggle-module_input__wSn48:focus+.toggle-module_slider__TOxdr{box-shadow:0 0 1px #545454}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr:before{transform:translateX(80%)}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng{border-radius:34px}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng:before{border-radius:50%}');var D=function(n){return e("label",f({className:"".concat(n.className," ").concat(K)},{children:[t("input",{type:"checkbox",className:G}),t("span",{className:"".concat(n.slider," ").concat(L)})]}))},H="type-form-module_errorContainer__dgVGi",W="type-form-module_errorMessage__z4AgA",$="type-form-module_modeContainer__zJRuI",F="type-form-module_mode__Ond9E";w(".type-form-module_errorContainer__dgVGi p{margin:0}.type-form-module_errorMessage__z4AgA{background-color:rgba(252,132,3,.6);border-radius:6px;margin-bottom:8px;padding:8px}.type-form-module_modeContainer__zJRuI{padding:8px}.type-form-module_mode__Ond9E{border-bottom:1px solid #000;padding-left:8px;padding-right:8px}");var Q=["popupButton","sliderButton","widget","popover"],Z=function(r){var o=r.formId.value,i=r.mode,s=void 0===i?{}:i,p=r.buttonText,h=m(r,["formId","mode","buttonText"]),v=s.value;return!Q.includes(v)&&a()?e("div",f({className:H},{children:[e("div",f({className:W},{children:[t("p",{children:"Please enter a valid mode for type form and click on save."}),t("p",{children:'Type one of "'.concat(Q.join('", "'),'"')})]})),e("p",f({className:$},{children:["mode: ",t(n,{field:s,tag:"span",className:F})]}))]})):"popupButton"===v?t(l,f({id:o},h,{children:t(n,{field:p||"click to open"})})):"popover"===v?t(c,f({id:o},h,{buttonText:(null==p?void 0:p.value)||"click to open"})):"widget"===v?t(d,f({id:o},h)):"sliderButton"===v?t(u,f({id:o},h,{children:t(n,{field:p||"click to open"})})):null},ee=function(e){var n=e.src,r=m(e,["src"]),o=r.muted,i=void 0===o?"true":o,a=m(r,["muted"]);return t("video",f({controls:!0},a,{muted:"true"===i},{children:t("source",{src:null==n?void 0:n.url})}))},te=function(r){var o=r.text,i=r.children,a=r.tag,l=void 0===a?"span":a,c=m(r,["text","children","tag"]),d=g(o);return i?e(l,f({},c,{children:[t(n,{field:d,tag:l}),Array.isArray(i)?i:[i]]})):t(n,f({},c,{field:d,tag:l}))},ne=function(e){var n=e.value,r=e.tag,o=void 0===r?"div":r,a=m(e,["value","tag"]),l=g(n);return t(i,f({},a,{field:l,tag:o}))},re=function(e){var n=e.columns,r=void 0===n?3:n,o=e.style,i=void 0===o?{}:o,a=e.children,l=m(e,["columns","style","children"]),c=f(f({},i),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))")});return t("div",f({},l,{style:c},{children:a}))},oe=function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,l,c;return v(this,(function(d){return t=e.apiKey,n=e.deliveryToken,r=e.environment,o=e.branch,i=e.hostUrl,a=e.contentTypeUid,l=e.entryUid,c=p.Stack({api_key:t,delivery_token:n,environment:r,branch:o}),i&&c.setHost(i),[2,c.ContentType(a).Entry(l).fetch().then((function(e){return e.toJSON()})).catch((function(e){console.log(e)}))]}))}))},ie=function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o;return v(this,(function(i){switch(i.label){case 0:t=null===(o=e.hostUrl)||void 0===o?void 0:o.replace(/\/$/,""),n={method:"POST",body:JSON.stringify({componentCodes:[e.componentCode],context:{}}),headers:{Authorization:"Bearer ".concat(e.apiToken),"X-Customer-Code":e.customerCode,"X-Environment-Code":e.environment,"Content-Type":"application/json"}},i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(t,"/experience/components/_query"),n)];case 2:return[4,i.sent().json()];case 3:return[2,i.sent()];case 4:return r=i.sent(),console.log(r),[3,5];case 5:return[2]}}))}))},ae=function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o,i,a;return v(this,(function(l){switch(l.label){case 0:t="https://deliver.kontent.ai/".concat(e.environmentId,"/items/").concat(e.contentItemCodename),n={Authorization:"Bearer ".concat(e.deliveryApiToken)},l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch(t,{headers:n})];case 2:if(!(r=l.sent()).ok)throw new Error("Error fetching content item: ".concat(r.statusText));return[4,r.json()];case 3:return o=l.sent(),[2,null===(a=o.item)||void 0===a?void 0:a.elements];case 4:throw i=l.sent(),console.error("Error in getContentItem:",i),i;case 5:return[2]}}))}))},le=function(e){var n=e.component,r=e.datasource,o=e.loadingComponent,i=e.errorComponent,a=e.emptyComponent,l=e.children,c=s.useState(null),d=c[0],u=c[1],p=s.useState(!1),m=p[0],g=p[1],y=s.useState(!1),_=y[0],b=y[1];return s.useEffect((function(){if("conscia.ai"===r.provider){h(void 0,void 0,void 0,(function(){var e,t;return v(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),g(!0),[4,ie(r)];case 1:return e=n.sent(),u(e),b(!1),[3,4];case 2:return t=n.sent(),b(!0),console.log(t),[3,4];case 3:return g(!1),[7];case 4:return[2]}}))}))}if("contentstack"===r.provider){h(void 0,void 0,void 0,(function(){var e,t;return v(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),g(!0),[4,oe(r)];case 1:return e=n.sent(),u(e),b(!1),[3,4];case 2:return t=n.sent(),b(!0),console.log(t),[3,4];case 3:return g(!1),[7];case 4:return[2]}}))}))}if("kontent.ai"===r.provider){h(void 0,void 0,void 0,(function(){var e,t;return v(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),g(!0),[4,ae(r)];case 1:return e=n.sent(),u(e),b(!1),[3,4];case 2:return t=n.sent(),b(!0),console.log(t),[3,4];case 3:return g(!1),[7];case 4:return[2]}}))}))}}),[n,r]),m?o||null:_?i||null:d?t(n,f({fields:d},{children:l})):a||null},ce=function(){function e(){}return e.layoutsByName={},e.getLayout=function(t){return e.layoutsByName[t.name]},e.registerLayout=function(t,n){e.layoutsByName[t]=n},e}();export{y as Button,_ as Checkbox,x as Container,N as Dropdown,O as Header,T as Image,le as KajooComponent,ce as KajooLayoutFactory,j as Label,I as Linebreak,A as Link,B as List,X as Paragraph,R as ProgressBar,M as Radiobutton,re as Repeater,ne as RichText,V as Slider,te as Text,Y as Textarea,q as Textinput,D as Toggle,Z as TypeForm,ee as Video};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Text as n,Image as o,Link as r,RichText as i,isEditorActive as a}from"@sitecore-jss/sitecore-jss-react";import{PopupButton as l,Sidetab as c,Widget as d,SliderButton as u}from"@typeform/embed-react";import s from"react";import p from"contentstack";var f=function(){return f=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},f.apply(this,arguments)};function m(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function v(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function l(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}c((o=o.apply(e,t||[])).next())})}function h(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}"function"==typeof SuppressedError&&SuppressedError;var g=function(e){var t;try{t="object"==typeof e?e:{value:JSON.parse('"'.concat(e,'"'))}}catch(n){t={value:e}}return t},y=function(o){var r=o.text,i=void 0===r?"":r,a=o.children,l=m(o,["text","children"]),c=g(i);return e("button",f({},l,{children:[t(n,{field:c}),a]}))},_=function(e){return t("input",f({},e,{type:"checkbox"}))},b=function(e){void 0===e&&(e="{}");try{return JSON.parse(e)}catch(e){return{}}},x=function(e){var n=e.bgImage,o=e.style,r=void 0===o?{}:o,i=e.tag,a=void 0===i?"div":i,l=e.children,c=m(e,["bgImage","style","tag","children"]),d=w(n),u=function(e){return void 0===e&&(e={}),"string"==typeof e?b(e):"object"==typeof e?e:{}}(r),s=f(f({},u),d?{backgroundImage:"url(".concat(d,")")}:{});return t(a,f({},c,{style:s,children:null!=l?l:null}))},w=function(e){return"string"==typeof e?e:e&&"object"==typeof e?e.value&&"object"==typeof e.value&&"src"in e.value&&"string"==typeof e.value.src?e.value.src:"value"in e&&"string"==typeof e.value?e.value:"src"in e&&"string"==typeof e.src?e.src:void 0:void 0};function k(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var C="drop-down-module_dropbtn__6RDCs",N="drop-down-module_dropdown__UKh7X",S="drop-down-module_dropdownContent__YSmXE";k(".drop-down-module_dropbtn__6RDCs{cursor:pointer}.drop-down-module_dropdown__UKh7X{display:inline-block;position:relative}.drop-down-module_dropdownContent__YSmXE{background-color:#f9f9f9;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;position:absolute;z-index:1}.drop-down-module_dropdownContent__YSmXE span{color:#000;display:block;padding:12px 16px;text-decoration:none}.drop-down-module_dropdownContent__YSmXE span:hover{background-color:#f1f1f1}.drop-down-module_dropdown__UKh7X:hover .drop-down-module_dropdownContent__YSmXE{display:block}");var O=function(o){return e("div",{className:"".concat(o.className," ").concat(N),children:[t("button",{className:C,style:{width:"100%",height:"100%"},children:t(n,{field:o.text,editable:!0,encode:!0})}),t("div",{className:S,children:t("div",{children:o.list&&o.list.map(function(e,n){return t("div",{children:t("span",{children:e.name})},"listItem-"+n)})})})]})},T=function(e){var o=e.text,r=m(e,["text"]),i=g(o);return t(n,f({tag:"h2"},r,{field:i}))},j=function(e){var n=e.src,r=e.alt,i=e.srcSet,a=void 0===i?"":i,l=m(e,["src","alt","srcSet"]),c="string"==typeof n?{value:{src:n,alt:"string"==typeof r?r:""}}:n,d=E(a);return t(o,f({},l,{field:c},d.length?{srcSet:d}:{}))},E=function(e){return"string"!=typeof e?e:e.split(", ").map(function(e){var t=e.split(" ");t[0];var n=t[1];return{w:(null==n?void 0:n.includes("w"))?parseInt(n):null}}).filter(function(e){return!!e.w})},I=function(e){var o=e.text,r=m(e,["text"]),i=g(o);return t(n,f({tag:"label"},r,{field:i}))},A=function(e){return t("hr",f({},e))},B=function(e){var n=e.href,o=void 0===n?"#":n,i=e.text,a=void 0===i?"":i,l=m(e,["href","text"]),c=g(a),d="string"==typeof o?{value:{href:o,text:c.value}}:o;return t(r,f({},l,{field:d}))},X=function(e){var n=e.list,o=m(e,["list"]);return n?t("ul",f({},o,{children:null==n?void 0:n.map(function(e,n){return t("li",{children:t("span",{children:e.name||e.displayName})},"listItem-".concat(n))})})):null},R=function(e){var n=e.tag,o=e.text,r=m(e,["tag","text"]),a=g(o);return t(i,f({},r,{tag:n||"p",field:a}))},z=function(n){return t("div",{className:n.className,style:U,children:t("div",{style:J,children:e("span",{style:M,children:[P,"%"]})})})},P=45,U={height:20,width:"100%",backgroundColor:"#e0e0de",borderRadius:50,margin:50},J={height:"100%",width:"".concat(P,"%"),backgroundColor:"orange",borderRadius:"inherit",textAlign:"right"},M={padding:5,color:"white",fontWeight:"bold"},V=function(e){var n=e.className;return t("div",{className:n,children:t("input",{type:"radio",name:"radio"})})},Y=function(e){var n=e.className;return t("div",{className:n,children:t("input",{style:{padding:"0px"},type:"range",min:"1",max:"100",value:"50",className:"slider",id:"myRange"})})},q=function(e){return t("textarea",f({},e))},K=function(e){return t("input",f({},e,{type:"text"}))},G="toggle-module_switch__VMi8c",L="toggle-module_input__wSn48",D="toggle-module_round__qn6ng";k('.toggle-module_switch__VMi8c{background-color:#888;display:inline-block;position:relative}.toggle-module_switch__VMi8c .toggle-module_input__wSn48{height:0;opacity:0;width:0}.toggle-module_slider__TOxdr{background-color:#444;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-transition:.4s;transition:.4s}.toggle-module_slider__TOxdr:before{background-color:#fff;bottom:5%;content:"";height:90%;left:5%;position:absolute;transition:.4s;width:50%}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr{background-color:#545454}.toggle-module_input__wSn48:focus+.toggle-module_slider__TOxdr{box-shadow:0 0 1px #545454}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr:before{transform:translateX(80%)}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng{border-radius:34px}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng:before{border-radius:50%}');var H=function(n){return e("label",{className:"".concat(n.className," ").concat(G),children:[t("input",{type:"checkbox",className:L}),t("span",{className:"".concat(n.slider," ").concat(D)})]})},W="type-form-module_errorContainer__dgVGi",$="type-form-module_errorMessage__z4AgA",F="type-form-module_modeContainer__zJRuI",Q="type-form-module_mode__Ond9E";k(".type-form-module_errorContainer__dgVGi p{margin:0}.type-form-module_errorMessage__z4AgA{background-color:rgba(252,132,3,.6);border-radius:6px;margin-bottom:8px;padding:8px}.type-form-module_modeContainer__zJRuI{padding:8px}.type-form-module_mode__Ond9E{border-bottom:1px solid #000;padding-left:8px;padding-right:8px}");var Z=["popupButton","sliderButton","widget","popover"],ee=function(o){var r=o.formId.value,i=o.mode,s=void 0===i?{}:i,p=o.buttonText,v=m(o,["formId","mode","buttonText"]),h=s.value;return!Z.includes(h)&&a()?e("div",{className:W,children:[e("div",{className:$,children:[t("p",{children:"Please enter a valid mode for type form and click on save."}),t("p",{children:'Type one of "'.concat(Z.join('", "'),'"')})]}),e("p",{className:F,children:["mode: ",t(n,{field:s,tag:"span",className:Q})]})]}):"popupButton"===h?t(l,f({id:r},v,{children:t(n,{field:p||"click to open"})})):"popover"===h?t(c,f({id:r},v,{buttonText:(null==p?void 0:p.value)||"click to open"})):"widget"===h?t(d,f({id:r},v)):"sliderButton"===h?t(u,f({id:r},v,{children:t(n,{field:p||"click to open"})})):null},te=function(e){var n,o=e.src,r=m(e,["src"]),i=r.muted,a=void 0===i?"true":i,l=m(r,["muted"]),c="string"==typeof o?o:(null===(n=null==o?void 0:o.value)||void 0===n?void 0:n.toString())||"";return t("video",f({controls:!0},l,{muted:"string"==typeof a?"true"===a:a,children:t("source",{src:c})}))},ne=function(o){var r=o.text,i=o.children,a=o.tag,l=void 0===a?"span":a,c=m(o,["text","children","tag"]),d=g(r);return i?e(l,f({},c,{children:[t(n,{field:d,tag:l}),Array.isArray(i)?i:[i]]})):t(n,f({},c,{field:d,tag:l}))},oe=function(e){var n=e.value,o=e.tag,r=void 0===o?"div":o,a=m(e,["value","tag"]),l=g(n);return t(i,f({},a,{field:l,tag:r}))},re=function(e){var n=e.columns,o=void 0===n?3:n,r=e.style,i=void 0===r?{}:r,a=e.children,l=m(e,["columns","style","children"]),c=f(f({},i),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(o,", minmax(0, 1fr))")});return t("div",f({},l,{style:c,children:a}))},ie=function(e){return v(void 0,void 0,void 0,function(){var t,n,o,r,i,a,l,c;return h(this,function(d){return t=e.apiKey,n=e.deliveryToken,o=e.environment,r=e.branch,i=e.hostUrl,a=e.contentTypeUid,l=e.entryUid,c=p.Stack({api_key:t,delivery_token:n,environment:o,branch:r}),i&&c.setHost(i),[2,c.ContentType(a).Entry(l).fetch().then(function(e){return e.toJSON()}).catch(function(e){console.log(e)})]})})},ae=function(e){return v(void 0,void 0,void 0,function(){var t,n,o,r;return h(this,function(i){switch(i.label){case 0:t=null===(r=e.hostUrl)||void 0===r?void 0:r.replace(/\/$/,""),n={method:"POST",body:JSON.stringify({componentCodes:[e.componentCode],context:{}}),headers:{Authorization:"Bearer ".concat(e.apiToken),"X-Customer-Code":e.customerCode,"X-Environment-Code":e.environment,"Content-Type":"application/json"}},i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(t,"/experience/components/_query"),n)];case 2:return[4,i.sent().json()];case 3:return[2,i.sent()];case 4:return o=i.sent(),console.log(o),[3,5];case 5:return[2]}})})},le=function(e){return v(void 0,void 0,void 0,function(){var t,n,o,r,i,a;return h(this,function(l){switch(l.label){case 0:t="https://deliver.kontent.ai/".concat(e.environmentId,"/items/").concat(e.contentItemCodename),n={Authorization:"Bearer ".concat(e.deliveryApiToken)},l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch(t,{headers:n})];case 2:if(!(o=l.sent()).ok)throw new Error("Error fetching content item: ".concat(o.statusText));return[4,o.json()];case 3:return r=l.sent(),[2,null===(a=r.item)||void 0===a?void 0:a.elements];case 4:throw i=l.sent(),console.error("Error in getContentItem:",i),i;case 5:return[2]}})})},ce=function(e){var n=e.component,o=e.rootClassName,r=void 0===o?"":o,i=e.datasource,a=e.loadingComponent,l=e.errorComponent,c=e.emptyComponent,d=e.children,u=s.useState(null),p=u[0],f=u[1],m=s.useState(!1),g=m[0],y=m[1],_=s.useState(!1),b=_[0],x=_[1];return s.useEffect(function(){if("conscia.ai"===i.provider){v(void 0,void 0,void 0,function(){var e,t;return h(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),y(!0),[4,ae(i)];case 1:return e=n.sent(),f(e),x(!1),[3,4];case 2:return t=n.sent(),x(!0),console.log(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}})})}if("contentstack"===i.provider){v(void 0,void 0,void 0,function(){var e,t;return h(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),y(!0),[4,ie(i)];case 1:return e=n.sent(),f(e),x(!1),[3,4];case 2:return t=n.sent(),x(!0),console.log(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}})})}if("kontent.ai"===i.provider){v(void 0,void 0,void 0,function(){var e,t;return h(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),y(!0),[4,le(i)];case 1:return e=n.sent(),f(e),x(!1),[3,4];case 2:return t=n.sent(),x(!0),console.log(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}})})}},[n,i]),g?a||null:b?l||null:p?t(n,{rootClassName:r,fields:p,children:d}):c||null},de=function(){function e(){}return e.layoutsByName={},e.getLayout=function(t){return e.layoutsByName[t.name]},e.registerLayout=function(t,n){e.layoutsByName[t]=n},e}();export{y as Button,_ as Checkbox,x as Container,O as Dropdown,T as Header,j as Image,ce as KajooComponent,de as KajooLayoutFactory,I as Label,A as Linebreak,B as Link,X as List,R as Paragraph,z as ProgressBar,V as Radiobutton,re as Repeater,oe as RichText,Y as Slider,ne as Text,q as Textarea,K as Textinput,H as Toggle,ee as TypeForm,te as Video};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|