@propeller-commerce/propeller-v2-react-ui 0.26.0 → 0.27.0

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/pure.js CHANGED
@@ -245,6 +245,28 @@ function ItemStock(props) {
245
245
  ) }) : null });
246
246
  }
247
247
  var ItemStock_default = React.memo(ItemStock);
248
+ var warnedOnce = /* @__PURE__ */ new Set();
249
+ function warnOnce(key, message) {
250
+ if (warnedOnce.has(key)) return;
251
+ warnedOnce.add(key);
252
+ console.warn(message);
253
+ }
254
+ function warnMissingProps(props) {
255
+ if (process.env.NODE_ENV === "production") return;
256
+ if (!props.language) {
257
+ warnOnce(
258
+ "language",
259
+ "[OrderItemCard] No `language` prop: product names resolve in the default catalogue language, whatever page they are on. This component reads no context (it ships from the RSC-safe /pure entry), so the host must pass it."
260
+ );
261
+ }
262
+ const linkable = props.titleLinkable !== void 0 ? props.titleLinkable : true;
263
+ if (linkable && !props.configuration?.urls) {
264
+ warnOnce(
265
+ "urls",
266
+ "[OrderItemCard] Title is linkable but no `configuration.urls` was passed: links fall back to a literal /product/:id/:slug and lose the locale prefix. Pass the url builders from the host, or set titleLinkable={false}."
267
+ );
268
+ }
269
+ }
248
270
  function getProductName(orderItem, language) {
249
271
  return getLocalizedValue(orderItem?.product?.names, language, "") || orderItem?.name || "Unknown Product";
250
272
  }
@@ -268,6 +290,7 @@ function getProductUrl(orderItem, language, urls) {
268
290
  function OrderItemCard(props) {
269
291
  const item = props.orderItem;
270
292
  const isChildItem = props.isChildItem || false;
293
+ warnMissingProps(props);
271
294
  const titleLinkable = props.titleLinkable !== void 0 ? props.titleLinkable : true;
272
295
  const showImage = isChildItem ? false : props.showImage !== void 0 ? props.showImage : true;
273
296
  const showSku = isChildItem ? false : props.showSku !== void 0 ? props.showSku : true;