@alpaca-headless/alpaca-headless-editor-preview
Advanced tools
Comparing version 1.0.332 to 1.0.333
@@ -17,3 +17,3 @@ import "server-only"; | ||
}; | ||
export declare function Placeholder({ name, content, tag, className, mapComponent, getComponentProps, context, }: { | ||
export declare function Placeholder({ name, content, tag, className, description, mapComponent, getComponentProps, context, }: { | ||
name: string; | ||
@@ -31,2 +31,2 @@ description?: string; | ||
}): Promise<JSX.Element | undefined>; | ||
export declare function renderPlaceholder(wrap: (children: JSX.Element) => JSX.Element, componentsWithProps: PlaceholderComponent[], placeholderData: PlaceholderData, context: ServerRenderContext): JSX.Element; | ||
export declare function renderPlaceholder(wrap: (children: JSX.Element) => JSX.Element, componentsWithProps: PlaceholderComponent[], placeholderData: PlaceholderData, context: ServerRenderContext, description?: string): JSX.Element; |
@@ -9,5 +9,3 @@ import { createElement as _createElement } from "react"; | ||
import { ErrorFallback } from "./Error"; | ||
export async function Placeholder({ name, content, tag, className, | ||
//description, | ||
mapComponent, getComponentProps, context, }) { | ||
export async function Placeholder({ name, content, tag, className, description, mapComponent, getComponentProps, context, }) { | ||
const parentData = content; | ||
@@ -108,6 +106,6 @@ if (!name) | ||
// } | ||
return renderPlaceholder(wrap, componentsWithProps, placeholderData, context); | ||
return renderPlaceholder(wrap, componentsWithProps, placeholderData, context, description); | ||
} | ||
export function renderPlaceholder(wrap, componentsWithProps, placeholderData, context) { | ||
return wrap(_jsxs(_Fragment, { children: [context.isEditing && (_jsx("script", { "data-placeholder-start": placeholderData.key })), componentsWithProps.map(({ Component, data, props }) => { | ||
export function renderPlaceholder(wrap, componentsWithProps, placeholderData, context, description) { | ||
return wrap(_jsxs(_Fragment, { children: [context.isEditing && (_jsx("script", { "data-placeholder-start": placeholderData.key, "data-description": description })), componentsWithProps.map(({ Component, data, props }) => { | ||
var _a; | ||
@@ -114,0 +112,0 @@ return (_jsx(_Fragment, { children: _jsxs(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [context.isEditing && _jsx("script", { "data-component-start": data.id }), _createElement(Component, Object.assign({}, props, { key: data.id })), context.isEditing && _jsx("script", { "data-component-end": data.id })] }, "EB" + data.id + ((_a = data.rendering) === null || _a === void 0 ? void 0 : _a.revision)) })); |
@@ -20,3 +20,3 @@ import "server-only"; | ||
status: error.response.status, | ||
error: error.response.data, | ||
error: error.response.statusText, | ||
headers: convertAxiosHeaders(error.response.headers), | ||
@@ -66,3 +66,3 @@ }; | ||
status: error.response.status, | ||
error: error.response.data, | ||
error: error.response.statusText, | ||
headers: convertAxiosHeaders(error.response.headers), | ||
@@ -69,0 +69,0 @@ }; |
{ | ||
"name": "@alpaca-headless/alpaca-headless-editor-preview", | ||
"version": "1.0.332", | ||
"version": "1.0.333", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Alpaca Headless", |
@@ -44,3 +44,3 @@ import "server-only"; | ||
status: error.response.status, | ||
error: error.response.data, | ||
error: error.response.statusText, | ||
headers: convertAxiosHeaders(error.response.headers), | ||
@@ -100,3 +100,3 @@ }; | ||
status: error.response.status, | ||
error: error.response.data, | ||
error: error.response.statusText, | ||
headers: convertAxiosHeaders(error.response.headers), | ||
@@ -103,0 +103,0 @@ }; |
Sorry, the diff of this file is not supported yet
115938
3593