@fayz-ai/plugin-shop 0.17.1 → 0.18.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.
@@ -1,10 +1,10 @@
1
- import { errorMessage, listProductsDetailed, invalidateProductLists, shopCustomerLookup, buildStockLocationsRegistry, listProductsCached, resolveTerm, candidateMeta } from './chunk-6DRDPROL.js';
1
+ import { errorMessage, shopCustomerLookup, listProductsDetailed, invalidateProductLists, buildStockLocationsRegistry, listProductsCached, resolveTerm, candidateMeta } from './chunk-6DRDPROL.js';
2
2
  import * as React2 from 'react';
3
- import React2__default, { useState, useEffect, useMemo, useCallback, useRef } from 'react';
4
- import { Button, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, formatPhone, toast, DataTable, ConfirmDialog, SearchSelect, ModalPortal, ModalOverlay, ModalBody, Skeleton } from '@fayz-ai/ui';
5
- import { RotateCcw, QrCode, Pencil, Archive, Ban, CreditCard, XCircle, ShoppingBag, Package, Wallet, Plus, WandSparkles, X, MapPin, Link2, HandCoins, Check, Copy, Share2, MessageCircle, CheckCircle2, Printer, RefreshCw, ExternalLink, Truck, AlertTriangle, Loader2 } from 'lucide-react';
6
- import { CHARGEABLE_PROVIDERS, supportsPaymentLink, getShopProvider, formatDocument, resolveShippingLabelProvider, isValidDocument, documentDigits } from '@fayz-ai/shop';
7
- import { useAdminPath, adminNavigateTo, OrderFormBlock, OrderCreateScreen, useOrderReceivable, OrderDetailSkeleton, PageActions, OrderDetailBlock, OrderDetailRow, toOrderDetailReceivable, PersonLink, OrderDetailView as OrderDetailView$1, OrderListView, askAI, useConnectors, CrudRecordModal, useAgentSurface, ClientOrdersTab, createClientOrdersProvider, duplicateWrite } from '@fayz-ai/admin';
3
+ import React2__default, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
4
+ import { Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, Button, formatPhone, toast, DataTable, ConfirmDialog, Skeleton, ModalPortal, ModalOverlay, ModalBody, SearchSelect } from '@fayz-ai/ui';
5
+ import { RotateCcw, QrCode, Pencil, Archive, Ban, CreditCard, XCircle, ShoppingBag, Package, Wallet, Plus, WandSparkles, CheckCircle2, Printer, RefreshCw, ExternalLink, Truck, AlertTriangle, Loader2, Check, Copy, Link2, HandCoins, Share2, MessageCircle, X, MapPin } from 'lucide-react';
6
+ import { formatDocument, getShopProvider, CHARGEABLE_PROVIDERS, supportsPaymentLink, resolveShippingLabelProvider, documentDigits, isValidDocument } from '@fayz-ai/shop';
7
+ import { useAdminPath, adminNavigateTo, useOrderReceivable, OrderDetailSkeleton, PageActions, OrderDetailBlock, OrderDetailRow, toOrderDetailReceivable, PersonLink, OrderDetailView as OrderDetailView$1, OrderFormBlock, OrderCreateScreen, OrderListView, askAI, useConnectors, CrudRecordModal, useAgentSurface, ClientOrdersTab, createClientOrdersProvider, duplicateWrite } from '@fayz-ai/admin';
8
8
  import { ReceivePaymentModal } from '@fayz-ai/plugin-financial';
9
9
  import { usePluginRuntimeOptional, getSupabaseClientOptional } from '@fayz-ai/core';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1510,7 +1510,7 @@ function fromSession(session) {
1510
1510
  };
1511
1511
  }
1512
1512
  var shopShipmentsCache = /* @__PURE__ */ new Map();
1513
- function OrderDetailView({ orderId, provider, onBack }) {
1513
+ function OrderDetailView({ orderId, provider, onBack, fallback }) {
1514
1514
  const runtime = usePluginRuntimeOptional();
1515
1515
  const hasFinancial = (runtime?.activePlugins ?? []).some(
1516
1516
  (p) => p.routes?.some((r) => r.path === "/financial")
@@ -1612,7 +1612,7 @@ function OrderDetailView({ orderId, provider, onBack }) {
1612
1612
  /* @__PURE__ */ jsx("p", { className: "mt-1 text-red-700", children: error })
1613
1613
  ] });
1614
1614
  }
1615
- if (!order) return /* @__PURE__ */ jsx("div", { className: "py-12 text-center text-sm text-muted-foreground", children: "Pedido n\xE3o encontrado." });
1615
+ if (!order) return fallback ?? /* @__PURE__ */ jsx("div", { className: "py-12 text-center text-sm text-muted-foreground", children: "Pedido n\xE3o encontrado." });
1616
1616
  const cur = order.currency;
1617
1617
  const delivery = deliveryFromNotes(order.notes);
1618
1618
  const addr = order.shippingAddress;
@@ -3575,6 +3575,17 @@ var statusColors = {
3575
3575
  function resolveShopProvider(provider) {
3576
3576
  return typeof provider === "function" ? provider() : provider ?? getShopProvider();
3577
3577
  }
3578
+ function ShopOrderDetailSlot({ orderId, onBack, fallback, provider }) {
3579
+ return /* @__PURE__ */ jsx("div", { className: "max-w-7xl", children: /* @__PURE__ */ jsx(
3580
+ OrderDetailView,
3581
+ {
3582
+ orderId,
3583
+ provider: () => resolveShopProvider(provider),
3584
+ onBack,
3585
+ fallback
3586
+ }
3587
+ ) });
3588
+ }
3578
3589
  function useShopList(load, deps) {
3579
3590
  const [items, setItems] = useState([]);
3580
3591
  const [loading, setLoading] = useState(true);
@@ -4101,6 +4112,6 @@ var ShopPage = ({ provider, section }) => {
4101
4112
  };
4102
4113
  ShopPage.displayName = "ShopPage";
4103
4114
 
4104
- export { ShopPage };
4105
- //# sourceMappingURL=ShopPage-4B2NPTRT.js.map
4106
- //# sourceMappingURL=ShopPage-4B2NPTRT.js.map
4115
+ export { ShopOrderDetailSlot, ShopPage };
4116
+ //# sourceMappingURL=ShopPage-J34V43NW.js.map
4117
+ //# sourceMappingURL=ShopPage-J34V43NW.js.map