@alpaca-headless/alpaca-headless 1.0.3819 → 1.0.3822

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.
@@ -1,4 +1,3 @@
1
- import { createElement as _createElement } from "react";
2
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
2
  import "server-only";
4
3
  import Slot from "./Slot";
@@ -107,10 +106,10 @@ export async function Placeholder({ name, content, tag, className, description,
107
106
  }
108
107
  export function renderPlaceholder(wrap, componentsWithProps, placeholderData, context, description) {
109
108
  const renderMarkers = context.isEditing || context.isPreview;
110
- return wrap(_jsxs(_Fragment, { children: [renderMarkers && (_jsx("script", { "data-placeholder-start": placeholderData.key, "data-description": description })), componentsWithProps.map(({ Component, data, props }) => {
111
- var _a, _b, _c, _d, _e, _f, _g;
112
- return (_jsx(_Fragment, { children: _jsxs(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [renderMarkers && (_jsx("script", { "data-component-start": data.id, "data-itemid": ((_b = (_a = data._editor) === null || _a === void 0 ? void 0 : _a.linkedComponentItem) === null || _b === void 0 ? void 0 : _b.id) ||
113
- data.id, "data-typeid": data.templateId, "data-version": (_d = (_c = data._editor) === null || _c === void 0 ? void 0 : _c.linkedComponentItem) === null || _d === void 0 ? void 0 : _d.version, "data-layoutid": (_f = (_e = data._editor) === null || _e === void 0 ? void 0 : _e.hostingPageItem) === null || _f === void 0 ? void 0 : _f.id })), _createElement(Component, Object.assign({}, props, { key: data.id })), renderMarkers && _jsx("script", { "data-component-end": data.id })] }, "EB" + data.id + ((_g = data.rendering) === null || _g === void 0 ? void 0 : _g.revision)) }));
109
+ return wrap(_jsxs(_Fragment, { children: [renderMarkers && (_jsx("script", { "data-placeholder-start": placeholderData.key, "data-description": description })), componentsWithProps.map(({ Component, data, props }, index) => {
110
+ var _a, _b, _c, _d, _e, _f;
111
+ return (_jsx(React.Fragment, { children: _jsxs(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [renderMarkers && (_jsx("script", { "data-component-start": data.id, "data-itemid": ((_b = (_a = data._editor) === null || _a === void 0 ? void 0 : _a.linkedComponentItem) === null || _b === void 0 ? void 0 : _b.id) ||
112
+ data.id, "data-typeid": data.templateId, "data-version": (_d = (_c = data._editor) === null || _c === void 0 ? void 0 : _c.linkedComponentItem) === null || _d === void 0 ? void 0 : _d.version, "data-layoutid": (_f = (_e = data._editor) === null || _e === void 0 ? void 0 : _e.hostingPageItem) === null || _f === void 0 ? void 0 : _f.id })), _jsx(Component, Object.assign({}, props)), renderMarkers && _jsx("script", { "data-component-end": data.id })] }) }, index));
114
113
  }), placeholderData.hasMore && (_jsx(Suspense, { children: _jsx(LazyPlaceholder, { placeholder: placeholderData, context: context }) })), renderMarkers && _jsx("script", { "data-placeholder-end": placeholderData.key })] }));
115
114
  }
116
115
  function ComponentNotFound({ component }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-headless/alpaca-headless",
3
- "version": "1.0.3819",
3
+ "version": "1.0.3822",
4
4
  "type": "module",
5
5
  "description": "Alpaca Headless",
6
6
  "main": "dist/index.js",
@@ -209,12 +209,11 @@ export function renderPlaceholder(
209
209
  />
210
210
  )}
211
211
 
212
- {componentsWithProps.map(({ Component, data, props }) => {
212
+ {componentsWithProps.map(({ Component, data, props }, index) => {
213
213
  return (
214
- <>
214
+ <React.Fragment key={index}>
215
215
  <ErrorBoundary
216
216
  FallbackComponent={ErrorFallback}
217
- key={"EB" + data.id + (data as ComponentData).rendering?.revision}
218
217
  >
219
218
  {renderMarkers && (
220
219
  <script
@@ -233,10 +232,10 @@ export function renderPlaceholder(
233
232
  }
234
233
  />
235
234
  )}
236
- <Component {...props} key={data.id} />
235
+ <Component {...props} />
237
236
  {renderMarkers && <script data-component-end={data.id}></script>}
238
237
  </ErrorBoundary>
239
- </>
238
+ </React.Fragment>
240
239
  );
241
240
  })}
242
241
  {placeholderData.hasMore && (