@starlightcms/react-sdk 2.3.0 → 3.0.0-beta.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/cjs/ResponsiveImage/index.d.ts.map +1 -1
- package/dist/cjs/ResponsiveImage/index.js +18 -8
- package/dist/cjs/ResponsiveImage/index.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/HTML/index.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/HTML/index.js +2 -4
- package/dist/cjs/VisualContent/blocks/HTML/index.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/Header.d.ts +0 -1
- package/dist/cjs/VisualContent/blocks/Header.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/Header.js +1 -2
- package/dist/cjs/VisualContent/blocks/Header.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/Image/index.d.ts +1 -1
- package/dist/cjs/VisualContent/blocks/Image/index.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/Image/index.js +47 -12
- package/dist/cjs/VisualContent/blocks/Image/index.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/List/index.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/List/index.js +3 -5
- package/dist/cjs/VisualContent/blocks/List/index.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/Paragraph.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/Paragraph.js +2 -3
- package/dist/cjs/VisualContent/blocks/Paragraph.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/Quote.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/Quote.js +1 -2
- package/dist/cjs/VisualContent/blocks/Quote.js.map +1 -1
- package/dist/cjs/VisualContent/blocks/Video/index.d.ts.map +1 -1
- package/dist/cjs/VisualContent/blocks/Video/index.js +3 -5
- package/dist/cjs/VisualContent/blocks/Video/index.js.map +1 -1
- package/dist/cjs/VisualContent/index.d.ts +0 -1
- package/dist/cjs/VisualContent/index.d.ts.map +1 -1
- package/dist/cjs/VisualContent/index.js +18 -9
- package/dist/cjs/VisualContent/index.js.map +1 -1
- package/dist/cjs/VisualContent/types.d.ts +1 -1
- package/dist/cjs/VisualContent/types.d.ts.map +1 -1
- package/dist/esm/ResponsiveImage/index.d.ts.map +1 -1
- package/dist/esm/ResponsiveImage/index.js +1 -1
- package/dist/esm/ResponsiveImage/index.js.map +1 -1
- package/dist/esm/VisualContent/blocks/HTML/index.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/HTML/index.js +2 -4
- package/dist/esm/VisualContent/blocks/HTML/index.js.map +1 -1
- package/dist/esm/VisualContent/blocks/Header.d.ts +0 -1
- package/dist/esm/VisualContent/blocks/Header.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/Header.js +1 -2
- package/dist/esm/VisualContent/blocks/Header.js.map +1 -1
- package/dist/esm/VisualContent/blocks/Image/index.d.ts +1 -1
- package/dist/esm/VisualContent/blocks/Image/index.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/Image/index.js +30 -5
- package/dist/esm/VisualContent/blocks/Image/index.js.map +1 -1
- package/dist/esm/VisualContent/blocks/List/index.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/List/index.js +3 -5
- package/dist/esm/VisualContent/blocks/List/index.js.map +1 -1
- package/dist/esm/VisualContent/blocks/Paragraph.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/Paragraph.js +2 -3
- package/dist/esm/VisualContent/blocks/Paragraph.js.map +1 -1
- package/dist/esm/VisualContent/blocks/Quote.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/Quote.js +1 -2
- package/dist/esm/VisualContent/blocks/Quote.js.map +1 -1
- package/dist/esm/VisualContent/blocks/Video/index.d.ts.map +1 -1
- package/dist/esm/VisualContent/blocks/Video/index.js +3 -5
- package/dist/esm/VisualContent/blocks/Video/index.js.map +1 -1
- package/dist/esm/VisualContent/index.d.ts +0 -1
- package/dist/esm/VisualContent/index.d.ts.map +1 -1
- package/dist/esm/VisualContent/index.js +1 -2
- package/dist/esm/VisualContent/index.js.map +1 -1
- package/dist/esm/VisualContent/types.d.ts +1 -1
- package/dist/esm/VisualContent/types.d.ts.map +1 -1
- package/dist/styles.css +130 -0
- package/dist/styles.css.map +1 -0
- package/package.json +16 -17
- package/dist/cjs/VisualContent/blocks/HTML/styles.d.ts +0 -6
- package/dist/cjs/VisualContent/blocks/HTML/styles.d.ts.map +0 -1
- package/dist/cjs/VisualContent/blocks/HTML/styles.js +0 -13
- package/dist/cjs/VisualContent/blocks/HTML/styles.js.map +0 -1
- package/dist/cjs/VisualContent/blocks/Image/styles.d.ts +0 -19
- package/dist/cjs/VisualContent/blocks/Image/styles.d.ts.map +0 -1
- package/dist/cjs/VisualContent/blocks/Image/styles.js +0 -41
- package/dist/cjs/VisualContent/blocks/Image/styles.js.map +0 -1
- package/dist/cjs/VisualContent/blocks/List/styles.d.ts +0 -6
- package/dist/cjs/VisualContent/blocks/List/styles.d.ts.map +0 -1
- package/dist/cjs/VisualContent/blocks/List/styles.js +0 -21
- package/dist/cjs/VisualContent/blocks/List/styles.js.map +0 -1
- package/dist/cjs/VisualContent/blocks/Video/styles.d.ts +0 -14
- package/dist/cjs/VisualContent/blocks/Video/styles.d.ts.map +0 -1
- package/dist/cjs/VisualContent/blocks/Video/styles.js +0 -41
- package/dist/cjs/VisualContent/blocks/Video/styles.js.map +0 -1
- package/dist/cjs/VisualContent/styles.d.ts +0 -14
- package/dist/cjs/VisualContent/styles.d.ts.map +0 -1
- package/dist/cjs/VisualContent/styles.js +0 -89
- package/dist/cjs/VisualContent/styles.js.map +0 -1
- package/dist/esm/VisualContent/blocks/HTML/styles.d.ts +0 -6
- package/dist/esm/VisualContent/blocks/HTML/styles.d.ts.map +0 -1
- package/dist/esm/VisualContent/blocks/HTML/styles.js +0 -7
- package/dist/esm/VisualContent/blocks/HTML/styles.js.map +0 -1
- package/dist/esm/VisualContent/blocks/Image/styles.d.ts +0 -19
- package/dist/esm/VisualContent/blocks/Image/styles.d.ts.map +0 -1
- package/dist/esm/VisualContent/blocks/Image/styles.js +0 -35
- package/dist/esm/VisualContent/blocks/Image/styles.js.map +0 -1
- package/dist/esm/VisualContent/blocks/List/styles.d.ts +0 -6
- package/dist/esm/VisualContent/blocks/List/styles.d.ts.map +0 -1
- package/dist/esm/VisualContent/blocks/List/styles.js +0 -15
- package/dist/esm/VisualContent/blocks/List/styles.js.map +0 -1
- package/dist/esm/VisualContent/blocks/Video/styles.d.ts +0 -14
- package/dist/esm/VisualContent/blocks/Video/styles.d.ts.map +0 -1
- package/dist/esm/VisualContent/blocks/Video/styles.js +0 -35
- package/dist/esm/VisualContent/blocks/Video/styles.js.map +0 -1
- package/dist/esm/VisualContent/styles.d.ts +0 -14
- package/dist/esm/VisualContent/styles.d.ts.map +0 -1
- package/dist/esm/VisualContent/styles.js +0 -83
- package/dist/esm/VisualContent/styles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ResponsiveImage/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAK9C;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ResponsiveImage/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAK9C;;;;;;;;;GASG;AAEH,eAAO,MAAM,oBAAoB,QAAO,SAMvC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,eAAe,GAAI,oFAS7B,oBAAoB,KAAG,GAAG,CAAC,OA2G7B,CAAA;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -137,7 +137,7 @@ export const ResponsiveImage = ({ className = '', image, sizes = '', alt = typeo
|
|
|
137
137
|
};
|
|
138
138
|
}, [source]);
|
|
139
139
|
return (React.createElement(React.Fragment, null,
|
|
140
|
-
React.createElement("img", { ref: imageRef, className: 'sl-lazyload ' + className, style: imageStyle, src: canLoad ? (source === null || source === void 0 ? void 0 : source.path) || image : transparentImage, srcSet: canLoad ? (sourceSet ? sourceSet : undefined) : undefined, sizes: canLoad ? (sourceSet ? sizes : undefined) : undefined, alt: alt }),
|
|
140
|
+
React.createElement("img", { ref: imageRef, className: 'sl-lazyload sl-responsive-image ' + className, style: imageStyle, src: canLoad ? (source === null || source === void 0 ? void 0 : source.path) || image : transparentImage, srcSet: canLoad ? (sourceSet ? sourceSet : undefined) : undefined, sizes: canLoad ? (sourceSet ? sizes : undefined) : undefined, alt: alt }),
|
|
141
141
|
React.createElement("noscript", null,
|
|
142
142
|
React.createElement("img", { src: (source && source.path) || image, alt: alt }))));
|
|
143
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ResponsiveImage/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAI9E,MAAM,gBAAgB,GACpB,4EAA4E,CAAA;AAE9E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAc,EAAE;IAClD,OAAO,CACL;QACE,mCAAQ,iCAAiC,CAAS,CACzC,CACZ,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,GAAG,EAAE,EACd,KAAK,EACL,KAAK,GAAG,EAAE,EACV,GAAG,GAAG,OA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N,MAAM,uBAAN,MAAM,CAAE,IAAI,KAAK,KAAgB,CAAC,CAAC,CAAC,gBAAgB,EACnE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EACjE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5D,GAAG,EAAE,GAAG,GACR;QACF;YACE,6BAAK,GAAG,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAK,KAAgB,EAAE,GAAG,EAAE,GAAG,GAAI,CAC3D,CACV,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["'use client'\n\nimport React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { MediaObject } from '@starlightcms/js-sdk'\nimport { ResponsiveImageProps } from './types'\n\nconst transparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='\n\n/**\n * Renders a `<style>` tag with a rule that disables lazy-loading when JavaScript\n * is disabled in the browser. This is useful to web crawlers that don't run\n * JS files, which is important for SEO.\n *\n * You only need to render this component once in your application,\n * preferably in the `<head>` section.\n *\n * @group ResponsiveImage\n */\nexport const GlobalLazyloadStyles = (): ReactNode => {\n return (\n <noscript>\n <style>{'img.sl-lazyload{display: none;}'}</style>\n </noscript>\n )\n}\n\n/**\n * Renders an image from a given Starlight media object. The Starlight\n * optimized image will be rendered by default if no `variation` prop is passed.\n *\n * If the `sizes` prop is passed, a responsive image will be rendered by\n * generating a \"src-set\" property.\n *\n * The image will be lazy-loaded, which means that it should only load\n * when the browser viewport gets near the image.\n *\n * @example Requesting an entry and rendering an image.\n *\n * Assume we created a \"Posts\" model with a slug of `posts`, and placed a Media\n * File field with a key of `featured_image` on it.\n *\n * ```jsx\n * import Starlight, { ResponsiveImage } from '@starlightcms/react-sdk'\n *\n * const EntryComponent = ({ slug }) => {\n * const [entry, setEntry] = useState(null)\n *\n * useEffect(async () => {\n * // This is just an example, you could fetch\n * // the entry any way you want.\n * const response = await Starlight.posts.entries.get(slug)\n *\n * setEntry(response.data)\n * }, [ slug ])\n *\n * // After fetching, the image will be on the `entry.data.featured_image` property.\n * return (\n * entry ? (\n * <article>\n * <h1>{entry.title}</h1>\n * <ResponsiveImage image={entry.data.featured_image} />\n * </article>\n * ) : (\n * <div>Loading...</div>\n * )\n * )\n * }\n *\n * ```\n *\n * @param props Component props. See {@link ResponsiveImageProps} to see the\n * available options.\n * @group ResponsiveImage\n */\nexport const ResponsiveImage = ({\n className = '',\n image,\n sizes = '',\n alt = typeof image === 'string' ? '' : image.alt,\n variation = 'optimized',\n background = '',\n lazyRoot,\n lazyRootMargin = '200px',\n}: ResponsiveImageProps): JSX.Element => {\n const imageRef = useRef<HTMLImageElement>(null)\n\n // When true, the image may load normally\n const [canLoad, setCanLoad] = useState(false)\n\n // When true, the image has been successfully loaded by the browser\n const [hasLoaded, setHasLoaded] = useState(false)\n\n // Get the optimized variation if available\n const source = useMemo(() => {\n // If the given image was a string, simply return it\n if (typeof image === 'string' || !image.files) return\n\n const chosenVariation = image.files.find(\n (file) => file.variation === variation\n )\n\n return chosenVariation\n ? chosenVariation\n : image.files.find((file) => file.variation === 'original')\n }, [image, variation])\n\n // Create a srcset\n const sourceSet = useMemo(() => {\n if (!source) return\n\n // source is only defined if image is a MediaObject, so we assert it as one\n const img = image as MediaObject\n\n const sets = []\n const large = img.files.find((file) => file.variation === 'large')\n const medium = img.files.find((file) => file.variation === 'medium')\n const thumbnail = img.files.find((file) => file.variation === 'thumbnail')\n\n if (thumbnail)\n sets.push(`${encodeURI(thumbnail.path)} ${thumbnail.meta?.width}w`)\n if (medium) sets.push(`${encodeURI(medium.path)} 600w`)\n if (large) sets.push(`${encodeURI(large.path)} 1200w`)\n sets.push(`${encodeURI(source.path)} ${source.meta?.width}w`)\n\n return sets.join(',')\n }, [source, image])\n\n const imageStyle = useMemo(() => {\n return {\n backgroundColor:\n background || hasLoaded || typeof image === 'string'\n ? 'transparent'\n : `#${source?.background_color ?? 'transparent'}`,\n }\n }, [background, source, hasLoaded, image])\n\n useEffect(() => {\n let ref: HTMLImageElement | null = null\n const observer = new IntersectionObserver(\n (entries, observer) => {\n if (entries[0].intersectionRatio > 0) {\n // Image entered the viewport, set it as loadable\n setCanLoad(true)\n\n // Stop observing the image\n observer.unobserve(ref as HTMLImageElement)\n }\n },\n {\n root: lazyRoot?.current,\n rootMargin: lazyRootMargin,\n }\n )\n\n if (imageRef.current) {\n ref = imageRef.current\n observer.observe(ref)\n }\n\n const loadHandler = () => {\n // After loading the image, the \"hasLoaded\" flag is used to hide the background color\n setHasLoaded(true)\n }\n\n ref?.addEventListener('load', loadHandler)\n\n return () => {\n if (ref) {\n observer.unobserve(ref)\n ref.removeEventListener('load', loadHandler)\n }\n }\n }, [source])\n\n return (\n <>\n <img\n ref={imageRef}\n className={'sl-lazyload ' + className}\n style={imageStyle}\n src={canLoad ? source?.path || (image as string) : transparentImage}\n srcSet={canLoad ? (sourceSet ? sourceSet : undefined) : undefined}\n sizes={canLoad ? (sourceSet ? sizes : undefined) : undefined}\n alt={alt}\n />\n <noscript>\n <img src={(source && source.path) || (image as string)} alt={alt} />\n </noscript>\n </>\n )\n}\n\nexport type { ResponsiveImageProps }\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ResponsiveImage/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAI9E,MAAM,gBAAgB,GACpB,4EAA4E,CAAA;AAE9E;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAc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AA;gBACvB,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;YAC9C,CAAC;QACH,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,CACL;QACE,6BACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,kCAAkC,GAAG,SAAS,EACzD,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,KAAK,KAAgB,CAAC,CAAC,CAAC,gBAAgB,EACnE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EACjE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5D,GAAG,EAAE,GAAG,GACR;QACF;YACE,6BAAK,GAAG,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAK,KAAgB,EAAE,GAAG,EAAE,GAAG,GAAI,CAC3D,CACV,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["'use client'\n\nimport React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { MediaObject } from '@starlightcms/js-sdk'\nimport { ResponsiveImageProps } from './types'\n\nconst transparentImage =\n 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='\n\n/**\n * Renders a `<style>` tag with a rule that disables lazy-loading when JavaScript\n * is disabled in the browser. This is useful to web crawlers that don't run\n * JS files, which is important for SEO.\n *\n * You only need to render this component once in your application,\n * preferably in the `<head>` section.\n *\n * @group ResponsiveImage\n */\n\nexport const GlobalLazyloadStyles = (): ReactNode => {\n return (\n <noscript>\n <style>{'img.sl-lazyload{display: none;}'}</style>\n </noscript>\n )\n}\n\n/**\n * Renders an image from a given Starlight media object. The Starlight\n * optimized image will be rendered by default if no `variation` prop is passed.\n *\n * If the `sizes` prop is passed, a responsive image will be rendered by\n * generating a \"src-set\" property.\n *\n * The image will be lazy-loaded, which means that it should only load\n * when the browser viewport gets near the image.\n *\n * @example Requesting an entry and rendering an image.\n *\n * Assume we created a \"Posts\" model with a slug of `posts`, and placed a Media\n * File field with a key of `featured_image` on it.\n *\n * ```jsx\n * import Starlight, { ResponsiveImage } from '@starlightcms/react-sdk'\n *\n * const EntryComponent = ({ slug }) => {\n * const [entry, setEntry] = useState(null)\n *\n * useEffect(async () => {\n * // This is just an example, you could fetch\n * // the entry any way you want.\n * const response = await Starlight.posts.entries.get(slug)\n *\n * setEntry(response.data)\n * }, [ slug ])\n *\n * // After fetching, the image will be on the `entry.data.featured_image` property.\n * return (\n * entry ? (\n * <article>\n * <h1>{entry.title}</h1>\n * <ResponsiveImage image={entry.data.featured_image} />\n * </article>\n * ) : (\n * <div>Loading...</div>\n * )\n * )\n * }\n *\n * ```\n *\n * @param props Component props. See {@link ResponsiveImageProps} to see the\n * available options.\n * @group ResponsiveImage\n */\nexport const ResponsiveImage = ({\n className = '',\n image,\n sizes = '',\n alt = typeof image === 'string' ? '' : image.alt,\n variation = 'optimized',\n background = '',\n lazyRoot,\n lazyRootMargin = '200px',\n}: ResponsiveImageProps): JSX.Element => {\n const imageRef = useRef<HTMLImageElement>(null)\n\n // When true, the image may load normally\n const [canLoad, setCanLoad] = useState(false)\n\n // When true, the image has been successfully loaded by the browser\n const [hasLoaded, setHasLoaded] = useState(false)\n\n // Get the optimized variation if available\n const source = useMemo(() => {\n // If the given image was a string, simply return it\n if (typeof image === 'string' || !image.files) return\n\n const chosenVariation = image.files.find(\n (file) => file.variation === variation\n )\n\n return chosenVariation\n ? chosenVariation\n : image.files.find((file) => file.variation === 'original')\n }, [image, variation])\n\n // Create a srcset\n const sourceSet = useMemo(() => {\n if (!source) return\n\n // source is only defined if image is a MediaObject, so we assert it as one\n const img = image as MediaObject\n\n const sets = []\n const large = img.files.find((file) => file.variation === 'large')\n const medium = img.files.find((file) => file.variation === 'medium')\n const thumbnail = img.files.find((file) => file.variation === 'thumbnail')\n\n if (thumbnail)\n sets.push(`${encodeURI(thumbnail.path)} ${thumbnail.meta?.width}w`)\n if (medium) sets.push(`${encodeURI(medium.path)} 600w`)\n if (large) sets.push(`${encodeURI(large.path)} 1200w`)\n sets.push(`${encodeURI(source.path)} ${source.meta?.width}w`)\n\n return sets.join(',')\n }, [source, image])\n\n const imageStyle = useMemo(() => {\n return {\n backgroundColor:\n background || hasLoaded || typeof image === 'string'\n ? 'transparent'\n : `#${source?.background_color ?? 'transparent'}`,\n }\n }, [background, source, hasLoaded, image])\n\n useEffect(() => {\n let ref: HTMLImageElement | null = null\n const observer = new IntersectionObserver(\n (entries, observer) => {\n if (entries[0].intersectionRatio > 0) {\n // Image entered the viewport, set it as loadable\n setCanLoad(true)\n\n // Stop observing the image\n observer.unobserve(ref as HTMLImageElement)\n }\n },\n {\n root: lazyRoot?.current,\n rootMargin: lazyRootMargin,\n }\n )\n\n if (imageRef.current) {\n ref = imageRef.current\n observer.observe(ref)\n }\n\n const loadHandler = () => {\n // After loading the image, the \"hasLoaded\" flag is used to hide the background color\n setHasLoaded(true)\n }\n\n ref?.addEventListener('load', loadHandler)\n\n return () => {\n if (ref) {\n observer.unobserve(ref)\n ref.removeEventListener('load', loadHandler)\n }\n }\n }, [source])\n\n return (\n <>\n <img\n ref={imageRef}\n className={'sl-lazyload sl-responsive-image ' + className}\n style={imageStyle}\n src={canLoad ? source?.path || (image as string) : transparentImage}\n srcSet={canLoad ? (sourceSet ? sourceSet : undefined) : undefined}\n sizes={canLoad ? (sourceSet ? sizes : undefined) : undefined}\n alt={alt}\n />\n <noscript>\n <img src={(source && source.path) || (image as string)} alt={alt} />\n </noscript>\n </>\n )\n}\n\nexport type { ResponsiveImageProps }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/HTML/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/HTML/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CASxC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../../styles';
|
|
2
|
-
import { HTMLWrapper } from './styles';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
/**
|
|
5
3
|
* VisualContent renderer component that renders `raw` type blocks
|
|
@@ -13,8 +11,8 @@ import React from 'react';
|
|
|
13
11
|
* @group VisualContent Renderers
|
|
14
12
|
*/
|
|
15
13
|
const HTML = ({ data }) => {
|
|
16
|
-
return (React.createElement(
|
|
17
|
-
React.createElement(
|
|
14
|
+
return (React.createElement("div", { className: "sl-content-block sl-html" },
|
|
15
|
+
React.createElement("div", { className: "sl-html__root", dangerouslySetInnerHTML: { __html: data.html } })));
|
|
18
16
|
};
|
|
19
17
|
export default HTML;
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/HTML/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/HTML/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,IAAI,GAAmC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACxD,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B;QACvC,6BACE,SAAS,EAAC,eAAe,EACzB,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAC9C,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,IAAI,CAAA","sourcesContent":["import { HTMLBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC } from 'react'\n\n/**\n * VisualContent renderer component that renders `raw` type blocks\n * as inline HTML inside a `div` element.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link HTMLBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst HTML: FC<VisualDataBlock<HTMLBlock>> = ({ data }) => {\n return (\n <div className=\"sl-content-block sl-html\">\n <div\n className=\"sl-html__root\"\n dangerouslySetInnerHTML={{ __html: data.html }}\n />\n </div>\n )\n}\n\nexport default HTML\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGnE;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,GAAI,UAAU,eAAe,CAAC,WAAW,CAAC,KAAG,GAAG,CAAC,OAQ5D,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../styles';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* VisualContent renderer component that renders `header` type blocks
|
|
@@ -13,7 +12,7 @@ import React from 'react';
|
|
|
13
12
|
*/
|
|
14
13
|
const Header = ({ data }) => {
|
|
15
14
|
const HeaderComponent = `h${data.level}`;
|
|
16
|
-
return (React.createElement(
|
|
15
|
+
return (React.createElement("div", { className: "sl-content-block sl-header" },
|
|
17
16
|
React.createElement(HeaderComponent, { dangerouslySetInnerHTML: { __html: data.text } })));
|
|
18
17
|
};
|
|
19
18
|
export default Header;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Header.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAgC,EAAe,EAAE;IACrE,MAAM,eAAe,GAAG,IAAI,IAAI,CAAC,KAAK,EAAU,CAAA;IAEhD,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;QACzC,oBAAC,eAAe,IAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAAI,CAC/D,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA","sourcesContent":["import { HeaderBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React from 'react'\n\n/**\n * VisualContent renderer component that renders `header` type blocks\n * as HTML heading elements, like `<h1>`, `<h2>`, and so on.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link HeaderBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst Header = ({ data }: VisualDataBlock<HeaderBlock>): JSX.Element => {\n const HeaderComponent = `h${data.level}` as 'h1'\n\n return (\n <div className=\"sl-content-block sl-header\">\n <HeaderComponent dangerouslySetInnerHTML={{ __html: data.text }} />\n </div>\n )\n}\n\nexport default Header\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,YAAY,CA4FzD,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { ImageWrapper, SelectedImage } from './styles';
|
|
3
|
-
import { BlockWrapper } from '../../styles';
|
|
4
2
|
/**
|
|
5
3
|
* VisualContent renderer component that renders `image` type blocks
|
|
6
4
|
* as a responsive image along with its caption (if defined). Optionally
|
|
@@ -23,6 +21,30 @@ const Image = ({ data, sizes = '(max-width: 480px) 90vw, 70vw', }) => {
|
|
|
23
21
|
const widthType = ['auto', 'justify', 'max'].includes(width) ? width : 'fixed';
|
|
24
22
|
const [target, setTarget] = useState('_self');
|
|
25
23
|
const [originalWidth, setOriginalWidth] = useState(undefined);
|
|
24
|
+
const calculatedWidth = useMemo(() => {
|
|
25
|
+
switch (width) {
|
|
26
|
+
case 'auto':
|
|
27
|
+
return 'auto';
|
|
28
|
+
case 'justify':
|
|
29
|
+
case 'max':
|
|
30
|
+
return '100%';
|
|
31
|
+
default:
|
|
32
|
+
return width;
|
|
33
|
+
}
|
|
34
|
+
}, [width]);
|
|
35
|
+
const calculatedMaxWidth = useMemo(() => {
|
|
36
|
+
if (responsive && originalWidth && width === 'auto')
|
|
37
|
+
return originalWidth;
|
|
38
|
+
switch (width) {
|
|
39
|
+
case 'auto':
|
|
40
|
+
return '100%';
|
|
41
|
+
case 'justify':
|
|
42
|
+
case 'max':
|
|
43
|
+
return 'initial';
|
|
44
|
+
default:
|
|
45
|
+
return originalWidth;
|
|
46
|
+
}
|
|
47
|
+
}, [width, responsive, originalWidth]);
|
|
26
48
|
const srcSet = useMemo(() => {
|
|
27
49
|
return data.files.map((file) => `${file.url} ${file.width}w`).join(', ');
|
|
28
50
|
}, [data]);
|
|
@@ -35,10 +57,13 @@ const Image = ({ data, sizes = '(max-width: 480px) 90vw, 70vw', }) => {
|
|
|
35
57
|
const optimizedFile = files.find((f) => f.variation === 'optimized');
|
|
36
58
|
setOriginalWidth(optimizedFile ? optimizedFile.width.toString() + 'px' : undefined);
|
|
37
59
|
}, []);
|
|
38
|
-
return (React.createElement(
|
|
39
|
-
React.createElement(
|
|
60
|
+
return (React.createElement("div", { className: `sl-content-block sl-image sl-width-${widthType}` },
|
|
61
|
+
React.createElement("figure", { className: "sl-figure", style: {
|
|
62
|
+
width: calculatedWidth,
|
|
63
|
+
maxWidth: calculatedMaxWidth,
|
|
64
|
+
} },
|
|
40
65
|
href ? (React.createElement("a", { href: href, target: target },
|
|
41
|
-
React.createElement(
|
|
66
|
+
React.createElement("img", { className: "sl-image__img", src: url, alt: alt, srcSet: srcSet, sizes: responsive ? sizes : undefined }))) : (React.createElement("img", { className: "sl-image__img", src: url, alt: alt, srcSet: srcSet, sizes: responsive ? sizes : undefined })),
|
|
42
67
|
caption && (React.createElement("figcaption", { dangerouslySetInnerHTML: { __html: caption } })))));
|
|
43
68
|
};
|
|
44
69
|
export default Image;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Image/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAM,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Image/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAM,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAS/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,KAAK,GAAmD,CAAC,EAC7D,IAAI,EACJ,KAAK,GAAG,+BAA+B,GACxC,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAEvE,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;IAE9E,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC7C,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAChD,SAAS,CACV,CAAA;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,MAAM;gBACT,OAAO,MAAM,CAAA;YACf,KAAK,SAAS,CAAC;YACf,KAAK,K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,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAClE,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,6BAAK,SAAS,EAAE,sCAAsC,SAAS,EAAE;QAC/D,gCACE,SAAS,EAAC,WAAW,EACrB,KAAK,EAAE;gBACL,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,kBAAkB;aAC7B;YAEA,IAAI,CAAC,CAAC,CAAC,CACN,2BAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;gBAC3B,6BACE,SAAS,EAAC,eAAe,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,GACrC,CACA,CACL,CAAC,CAAC,CAAC,CACF,6BACE,SAAS,EAAC,eAAe,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,GACrC,CACH;YACA,OAAO,IAAI,CACV,oCAAY,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,CAC7D,CACM,CACL,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA","sourcesContent":["import { ImageBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC, useEffect, useMemo, useState } from 'react'\n\n/**\n * Type used by {@link ImageComponent} to accept a `sizes` prop.\n */\nexport type ImageOptions = {\n sizes?: string\n}\n\n/**\n * VisualContent renderer component that renders `image` type blocks\n * as a responsive image along with its caption (if defined). Optionally\n * wraps the image in an anchor if a link is defined in the content.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * This component also supports an optional `sizes` prop to provide better image\n * responsiveness, see {@doclink components/VisualContent/#responsive-images | the guide page on responsive images}\n * to learn more.\n *\n * @param props VisualDataBlock object. See {@link ImageBlock} to learn the\n * type of data this component receives. Also accepts\n * an optional `sizes` string prop.\n * @group VisualContent Renderers\n */\nconst Image: FC<VisualDataBlock<ImageBlock> & ImageOptions> = ({\n data,\n sizes = '(max-width: 480px) 90vw, 70vw',\n}) => {\n const { url, alt = '', files, caption, width, href, responsive } = data\n\n const widthType = ['auto', 'justify', 'max'].includes(width) ? width : 'fixed'\n\n const [target, setTarget] = useState('_self')\n const [originalWidth, setOriginalWidth] = useState<string | undefined>(\n undefined\n )\n\n const calculatedWidth = useMemo(() => {\n switch (width) {\n case 'auto':\n return 'auto'\n case 'justify':\n case 'max':\n return '100%'\n default:\n return width\n }\n }, [width])\n\n const calculatedMaxWidth = useMemo(() => {\n if (responsive && originalWidth && width === 'auto') return originalWidth\n\n switch (width) {\n case 'auto':\n return '100%'\n case 'justify':\n case 'max':\n return 'initial'\n default:\n return originalWidth\n }\n }, [width, responsive, originalWidth])\n\n const srcSet = useMemo(() => {\n return data.files.map((file) => `${file.url} ${file.width}w`).join(', ')\n }, [data])\n\n useEffect(() => {\n if (!href) return\n\n setTarget(\n new URL(href).origin === window.location.origin ? '_self' : '_blank'\n )\n }, [href])\n\n useEffect(() => {\n const optimizedFile = files.find((f) => f.variation === 'optimized')\n setOriginalWidth(\n optimizedFile ? optimizedFile.width.toString() + 'px' : undefined\n )\n }, [])\n\n return (\n <div className={`sl-content-block sl-image sl-width-${widthType}`}>\n <figure\n className=\"sl-figure\"\n style={{\n width: calculatedWidth,\n maxWidth: calculatedMaxWidth,\n }}\n >\n {href ? (\n <a href={href} target={target}>\n <img\n className=\"sl-image__img\"\n src={url}\n alt={alt}\n srcSet={srcSet}\n sizes={responsive ? sizes : undefined}\n />\n </a>\n ) : (\n <img\n className=\"sl-image__img\"\n src={url}\n alt={alt}\n srcSet={srcSet}\n sizes={responsive ? sizes : undefined}\n />\n )}\n {caption && (\n <figcaption dangerouslySetInnerHTML={{ __html: caption }} />\n )}\n </figure>\n </div>\n )\n}\n\nexport default Image\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/List/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/List/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAuBjC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAYxC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../../styles';
|
|
2
|
-
import { ListWrapper } from './styles';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
const SubList = ({ item, Wrapper }) => {
|
|
5
3
|
return (React.createElement("li", null,
|
|
@@ -19,9 +17,9 @@ const SubList = ({ item, Wrapper }) => {
|
|
|
19
17
|
* @group VisualContent Renderers
|
|
20
18
|
*/
|
|
21
19
|
const List = ({ data }) => {
|
|
22
|
-
const
|
|
23
|
-
return (React.createElement(
|
|
24
|
-
React.createElement(ListWrapper, {
|
|
20
|
+
const ListWrapper = data.style === 'ordered' ? 'ol' : 'ul';
|
|
21
|
+
return (React.createElement("div", { className: "sl-content-block sl-list" },
|
|
22
|
+
React.createElement(ListWrapper, { className: "sl-list__root" }, data.items.map((item, index) => (React.createElement(SubList, { key: index, item: item, Wrapper: ListWrapper }))))));
|
|
25
23
|
};
|
|
26
24
|
export default List;
|
|
27
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/List/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/List/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAOjC,MAAM,OAAO,GAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACtD,OAAO,CACL;QACE,8BAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,GAAI;QAC1D,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACjC,oBAAC,OAAO,QACL,IAAI,CAAC,KAAK;YACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,oBAAC,OAAO,IAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,CACzD,CAAC,CACI,CACX,CAAC,CAAC,CAAC,IAAI,CACL,CACN,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,IAAI,GAAmC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACxD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAE1D,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B;QACvC,oBAAC,WAAW,IAAC,SAAS,EAAC,eAAe,IACnC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,oBAAC,OAAO,IAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,GAAI,CAC1D,CAAC,CACU,CACV,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,IAAI,CAAA","sourcesContent":["import { ListBlock, ListItem, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC } from 'react'\n\ntype SubListProps = {\n item: ListItem\n Wrapper: 'ul' | 'ol'\n}\n\nconst SubList: FC<SubListProps> = ({ item, Wrapper }) => {\n return (\n <li>\n <span dangerouslySetInnerHTML={{ __html: item.content }} />\n {item.items && item.items.length ? (\n <Wrapper>\n {item.items &&\n item.items.map((subItem, index) => (\n <SubList key={index} item={subItem} Wrapper={Wrapper} />\n ))}\n </Wrapper>\n ) : null}\n </li>\n )\n}\n\n/**\n * VisualContent renderer component that renders `list` type blocks\n * as `<ul>` or `<ol>` elements, depending on the list style.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link ListBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst List: FC<VisualDataBlock<ListBlock>> = ({ data }) => {\n const ListWrapper = data.style === 'ordered' ? 'ol' : 'ul'\n\n return (\n <div className=\"sl-content-block sl-list\">\n <ListWrapper className=\"sl-list__root\">\n {data.items.map((item, index) => (\n <SubList key={index} item={item} Wrapper={ListWrapper} />\n ))}\n </ListWrapper>\n </div>\n )\n}\n\nexport default List\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Paragraph.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC,CAelD,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../styles';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* VisualContent renderer component that renders `paragraph` type blocks
|
|
@@ -14,10 +13,10 @@ import React from 'react';
|
|
|
14
13
|
*/
|
|
15
14
|
const Paragraph = ({ data }) => {
|
|
16
15
|
if (!data.text)
|
|
17
|
-
return (React.createElement(
|
|
16
|
+
return (React.createElement("div", { className: "sl-content-block sl-paragraph empty", "aria-hidden": true },
|
|
18
17
|
React.createElement("p", null,
|
|
19
18
|
React.createElement("br", null))));
|
|
20
|
-
return (React.createElement(
|
|
19
|
+
return (React.createElement("div", { className: "sl-content-block sl-paragraph" },
|
|
21
20
|
React.createElement("p", { dangerouslySetInnerHTML: { __html: data.text } })));
|
|
22
21
|
};
|
|
23
22
|
export default Paragraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Paragraph.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Paragraph.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Paragraph.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;;GAWG;AACH,MAAM,SAAS,GAAwC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,IAAI,CAAC,IAAI,CAAC,IAAI;QACZ,OAAO,CACL,6BAAK,SAAS,EAAC,qCAAqC;YAClD;gBACE,+BAAM,CACJ,CACA,CACP,CAAA;IAEH,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,2BAAG,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAAI,CACjD,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA","sourcesContent":["import { ParagraphBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC } from 'react'\n\n/**\n * VisualContent renderer component that renders `paragraph` type blocks\n * as `<p>` elements. Empty paragraph blocks (generally used to break\n * lines) will have an `empty` class added to them.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link ParagraphBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst Paragraph: FC<VisualDataBlock<ParagraphBlock>> = ({ data }) => {\n if (!data.text)\n return (\n <div className=\"sl-content-block sl-paragraph empty\" aria-hidden>\n <p>\n <br />\n </p>\n </div>\n )\n\n return (\n <div className=\"sl-content-block sl-paragraph\">\n <p dangerouslySetInnerHTML={{ __html: data.text }} />\n </div>\n )\n}\n\nexport default Paragraph\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Quote.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Quote.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAM1C,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../styles';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* VisualContent renderer component that renders `quote` type blocks
|
|
@@ -12,7 +11,7 @@ import React from 'react';
|
|
|
12
11
|
* @group VisualContent Renderers
|
|
13
12
|
*/
|
|
14
13
|
const Quote = ({ data }) => {
|
|
15
|
-
return (React.createElement(
|
|
14
|
+
return (React.createElement("div", { className: "sl-content-block sl-quote" },
|
|
16
15
|
React.createElement("blockquote", null, data.text)));
|
|
17
16
|
};
|
|
18
17
|
export default Quote;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quote.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Quote.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Quote.js","sourceRoot":"","sources":["../../../../src/VisualContent/blocks/Quote.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,KAAK,GAAoC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC1D,OAAO,CACL,6BAAK,SAAS,EAAC,2BAA2B;QACxC,wCAAa,IAAI,CAAC,IAAI,CAAc,CAChC,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA","sourcesContent":["import { QuoteBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC } from 'react'\n\n/**\n * VisualContent renderer component that renders `quote` type blocks\n * as `<blockquote>` elements.\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link QuoteBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst Quote: FC<VisualDataBlock<QuoteBlock>> = ({ data }) => {\n return (\n <div className=\"sl-content-block sl-quote\">\n <blockquote>{data.text}</blockquote>\n </div>\n )\n}\n\nexport default Quote\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Video/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Video/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAmB1C,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BlockWrapper } from '../../styles';
|
|
2
|
-
import { VideoWrapper } from './styles';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
/**
|
|
5
3
|
* VisualContent renderer component that renders `video` type blocks
|
|
@@ -15,9 +13,9 @@ import React from 'react';
|
|
|
15
13
|
const Video = ({ data }) => {
|
|
16
14
|
const { html, width, caption } = data;
|
|
17
15
|
const widthType = ['auto', 'justify', 'max'].includes(width) ? width : 'fixed';
|
|
18
|
-
return (React.createElement(
|
|
19
|
-
React.createElement(
|
|
20
|
-
React.createElement("div", { dangerouslySetInnerHTML: { __html: html } }),
|
|
16
|
+
return (React.createElement("div", { className: `sl-content-block sl-video sl-width-${widthType}` },
|
|
17
|
+
React.createElement("figure", { className: "sl-figure" },
|
|
18
|
+
React.createElement("div", { dangerouslySetInnerHTML: { __html: html }, style: { maxWidth: widthType === 'fixed' ? `${width}` : undefined } }),
|
|
21
19
|
caption && (React.createElement("figcaption", { dangerouslySetInnerHTML: { __html: caption } })))));
|
|
22
20
|
};
|
|
23
21
|
export default Video;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Video/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/VisualContent/blocks/Video/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,KAAK,GAAoC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC1D,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAErC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;IAE9E,OAAO,CACL,6BAAK,SAAS,EAAE,sCAAsC,SAAS,EAAE;QAC/D,gCAAQ,SAAS,EAAC,WAAW;YAC3B,6BACE,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EACzC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,GACnE;YAED,OAAO,IAAI,CACV,oCAAY,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,CAC7D,CACM,CACL,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA","sourcesContent":["import { VideoBlock, VisualDataBlock } from '@starlightcms/js-sdk'\nimport React, { FC } from 'react'\n\n/**\n * VisualContent renderer component that renders `video` type blocks\n * as a responsive video along with its caption (if defined).\n *\n * See {@doclink components/VisualContent/#customizing-components | the guide page on the VisualContent component}\n * to learn how to customize block renderer components like this one.\n *\n * @param props VisualDataBlock object. See {@link VideoBlock} to learn the\n * type of data this component receives.\n * @group VisualContent Renderers\n */\nconst Video: FC<VisualDataBlock<VideoBlock>> = ({ data }) => {\n const { html, width, caption } = data\n\n const widthType = ['auto', 'justify', 'max'].includes(width) ? width : 'fixed'\n\n return (\n <div className={`sl-content-block sl-video sl-width-${widthType}`}>\n <figure className=\"sl-figure\">\n <div\n dangerouslySetInnerHTML={{ __html: html }}\n style={{ maxWidth: widthType === 'fixed' ? `${width}` : undefined }}\n />\n\n {caption && (\n <figcaption dangerouslySetInnerHTML={{ __html: caption }} />\n )}\n </figure>\n </div>\n )\n}\n\nexport default Video\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/VisualContent/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/VisualContent/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAYlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,eAAO,MAAM,aAAa,GAAI,kDAK3B,kBAAkB,KAAG,GAAG,CAAC,OAmD3B,CAAA;AAED,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,MAAM,IAAI,eAAe,EACzB,KAAK,IAAI,cAAc,EACvB,KAAK,IAAI,cAAc,EACvB,IAAI,IAAI,aAAa,EACrB,IAAI,IAAI,aAAa,EACrB,KAAK,IAAI,cAAc,GACxB,CAAA;AAED,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import Image from './blocks/Image';
|
|
3
3
|
import Paragraph from './blocks/Paragraph';
|
|
4
|
-
import { OuterWrapper } from './styles';
|
|
5
4
|
import React, { useMemo } from 'react';
|
|
6
5
|
import Header from './blocks/Header';
|
|
7
6
|
import Quote from './blocks/Quote';
|
|
@@ -84,7 +83,7 @@ export const VisualContent = ({ content, components = {}, excerpt = false, excer
|
|
|
84
83
|
const Component = componentList.paragraph;
|
|
85
84
|
return (React.createElement(Component, { key: block.id, id: block.id, type: block.type, data: { text: excerptText } }));
|
|
86
85
|
}
|
|
87
|
-
return (React.createElement(
|
|
86
|
+
return (React.createElement("div", { className: "sl-visual-content" }, content.blocks.map((block) => {
|
|
88
87
|
const Component = componentList[block.type];
|
|
89
88
|
if (!Component)
|
|
90
89
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/VisualContent/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAIZ,OAAO,KAAuB,MAAM,gBAAgB,CAAA;AACpD,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/VisualContent/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAIZ,OAAO,KAAuB,MAAM,gBAAgB,CAAA;AACpD,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAElC,MAAM,iBAAiB,GAAoB;IACzC,SAAS,EAAE,SAA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C,EAAE,EACb,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAC3B,CACH,CAAA;IACH,CAAC;IACD,OAAO,CACL,6BAAK,SAAS,EAAC,mBAAmB,IAC/B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE3C,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAA;QAE3B,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,KAAK,CAAC,EAAE,EACb,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,KAAK,CAAC,IAAa,GACzB,CACH,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,MAAM,IAAI,eAAe,EACzB,KAAK,IAAI,cAAc,EACvB,KAAK,IAAI,cAAc,EACvB,IAAI,IAAI,aAAa,EACrB,IAAI,IAAI,aAAa,EACrB,KAAK,IAAI,cAAc,GACxB,CAAA","sourcesContent":["'use client'\n\nimport { VisualDataBlock, ParagraphBlock } from '@starlightcms/js-sdk'\nimport { BlockComponents, VisualContentProps } from './types'\nimport Image, { ImageOptions } from './blocks/Image'\nimport Paragraph from './blocks/Paragraph'\nimport React, { useMemo } from 'react'\nimport Header from './blocks/Header'\nimport Quote from './blocks/Quote'\nimport HTML from './blocks/HTML'\nimport List from './blocks/List'\nimport Video from './blocks/Video'\n\nconst defaultComponents: BlockComponents = {\n paragraph: Paragraph,\n header: Header,\n quote: Quote,\n image: Image,\n raw: HTML,\n list: List,\n video: Video,\n}\n\n/**\n * Renders HTML content from data returned by a Visual Editor field on Starlight.\n *\n * The only required prop is `content`, which is the data returned by a Visual\n * Editor field. Additionally, you can provide custom components to render each\n * data block type.\n *\n * You can also pass the `excerpt` boolean prop to only render a portion of the\n * content, which is useful to summarize the content in lists.\n *\n * To learn how to customize the rendered content, take a look at the\n * [Customizing the output](#) guide page.\n *\n * @example Requesting an entry and rendering its content.\n *\n * Assume we created a \"Posts\" model with a slug of `posts`, and placed a Visual\n * Editor field with a key of `post_content` on it.\n *\n * ```jsx\n * import Starlight, { VisualContent } from '@starlightcms/react-sdk'\n *\n * const EntryComponent = ({ slug }) => {\n * const [entry, setEntry] = useState(null)\n *\n * // This is just an example, you could fetch\n * // the entry any way you want.\n * useEffect(async () => {\n * const response = await Starlight.posts.entries.get(slug)\n *\n * setEntry(response.data)\n * }, [ slug ])\n *\n * // After fetching, content will be on the `entry.data.post_content` property.\n * return (\n * entry ? (\n * <article>\n * <h1>{entry.title}</h1>\n * <VisualContent content={entry.data.post_content} />\n * </article>\n * ) : (\n * <div>Loading...</div>\n * )\n * )\n * }\n *\n * ```\n *\n * @param props Component props. See {@link VisualContentProps} to see the\n * available options.\n * @group VisualContent\n */\nexport const VisualContent = ({\n content,\n components = {},\n excerpt = false,\n excerptLength = 40,\n}: VisualContentProps): JSX.Element => {\n const componentList = useMemo(\n () => ({ ...defaultComponents, ...components }),\n [components]\n )\n\n if (!content) {\n return null as unknown as JSX.Element\n }\n\n if (excerpt) {\n const block = content.blocks.find((block) => block.type === 'paragraph') as\n | VisualDataBlock<ParagraphBlock>\n | undefined\n\n if (!block || !block.data.text) return null as unknown as JSX.Element\n\n const text = block.data.text.split(' ')\n const excerptText =\n text.length > excerptLength\n ? text.splice(0, excerptLength).join(' ') + '...'\n : text.join(' ')\n const Component = componentList.paragraph\n\n return (\n <Component\n key={block.id}\n id={block.id}\n type={block.type}\n data={{ text: excerptText }}\n />\n )\n }\n return (\n <div className=\"sl-visual-content\">\n {content.blocks.map((block) => {\n const Component = componentList[block.type]\n\n if (!Component) return null\n\n return (\n <Component\n key={block.id}\n id={block.id}\n type={block.type}\n data={block.data as never}\n />\n )\n })}\n </div>\n )\n}\n\nexport {\n Paragraph as ParagraphComponent,\n Header as HeaderComponent,\n Quote as QuoteComponent,\n Image as ImageComponent,\n HTML as HTMLComponent,\n List as ListComponent,\n Video as VideoComponent,\n}\n\nexport type { VisualContentProps, ImageOptions }\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { HeaderBlock, ImageBlock, ParagraphBlock, QuoteBlock, VisualData, VisualDataBlock, BlockType, HTMLBlock, ListBlock, VideoBlock } from '@starlightcms/js-sdk';
|
|
3
|
-
|
|
3
|
+
type Implements<T, U extends T> = Record<string, unknown>;
|
|
4
4
|
export interface BlockComponents extends Implements<Record<BlockType, unknown>, BlockComponents> {
|
|
5
5
|
paragraph: ComponentType<VisualDataBlock<ParagraphBlock>>;
|
|
6
6
|
header: ComponentType<VisualDataBlock<HeaderBlock>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/VisualContent/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EACL,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,sBAAsB,CAAA;AAG7B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/VisualContent/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EACL,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,sBAAsB,CAAA;AAG7B,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAA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