@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.cjs CHANGED
@@ -267,6 +267,28 @@ function ItemStock(props) {
267
267
  ) }) : null });
268
268
  }
269
269
  var ItemStock_default = React__namespace.memo(ItemStock);
270
+ var warnedOnce = /* @__PURE__ */ new Set();
271
+ function warnOnce(key, message) {
272
+ if (warnedOnce.has(key)) return;
273
+ warnedOnce.add(key);
274
+ console.warn(message);
275
+ }
276
+ function warnMissingProps(props) {
277
+ if (process.env.NODE_ENV === "production") return;
278
+ if (!props.language) {
279
+ warnOnce(
280
+ "language",
281
+ "[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."
282
+ );
283
+ }
284
+ const linkable = props.titleLinkable !== void 0 ? props.titleLinkable : true;
285
+ if (linkable && !props.configuration?.urls) {
286
+ warnOnce(
287
+ "urls",
288
+ "[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}."
289
+ );
290
+ }
291
+ }
270
292
  function getProductName(orderItem, language) {
271
293
  return propellerV2CoreUi.getLocalizedValue(orderItem?.product?.names, language, "") || orderItem?.name || "Unknown Product";
272
294
  }
@@ -290,6 +312,7 @@ function getProductUrl(orderItem, language, urls) {
290
312
  function OrderItemCard(props) {
291
313
  const item = props.orderItem;
292
314
  const isChildItem = props.isChildItem || false;
315
+ warnMissingProps(props);
293
316
  const titleLinkable = props.titleLinkable !== void 0 ? props.titleLinkable : true;
294
317
  const showImage = isChildItem ? false : props.showImage !== void 0 ? props.showImage : true;
295
318
  const showSku = isChildItem ? false : props.showSku !== void 0 ? props.showSku : true;