@fayz-ai/pos 0.24.4 → 0.24.6

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/index.js CHANGED
@@ -4912,7 +4912,9 @@ var ORIGEM = {
4912
4912
  ifood: "iFood",
4913
4913
  opendelivery: "OpenDelivery / 99",
4914
4914
  whatsapp: "WhatsApp",
4915
- digital_menu: "Card\xE1pio digital"
4915
+ digital_menu: "Card\xE1pio digital",
4916
+ // The store's own storefront (shop 0134).
4917
+ site: "Site"
4916
4918
  };
4917
4919
  function deliveryOriginLabel(source) {
4918
4920
  return ORIGEM[source ?? ""] ?? (source || "Delivery pr\xF3prio");
@@ -4939,7 +4941,7 @@ function lateness(p, now) {
4939
4941
  return Math.floor((now - new Date(p.dueAt).getTime()) / 6e4);
4940
4942
  }
4941
4943
  var GHOST_MS = 300;
4942
- function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, historyOpen, onToggleHistory }) {
4944
+ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, historyOpen, onToggleHistory, loading }) {
4943
4945
  const seen = useRef({});
4944
4946
  const [ghosts, setGhosts] = useState([]);
4945
4947
  useEffect(() => {
@@ -4959,7 +4961,7 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
4959
4961
  return () => window.clearTimeout(t);
4960
4962
  }, [orders]);
4961
4963
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4962
- orders.length === 0 && channelsConnected === false && /* @__PURE__ */ jsx(
4964
+ !loading && orders.length === 0 && channelsConnected === false && /* @__PURE__ */ jsx(
4963
4965
  EmptyState,
4964
4966
  {
4965
4967
  title: "Nenhum canal de delivery conectado",
@@ -4993,7 +4995,7 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
4993
4995
  /* @__PURE__ */ jsxs("header", { className: "pos-col__head", children: [
4994
4996
  /* @__PURE__ */ jsx(Icon, { size: 15, strokeWidth: 2.2, "aria-hidden": true }),
4995
4997
  /* @__PURE__ */ jsx("span", { className: "pos-col__t", children: name }),
4996
- /* @__PURE__ */ jsx("span", { className: "pos-col__n pos-num", children: column.length })
4998
+ /* @__PURE__ */ jsx("span", { className: "pos-col__n pos-num", children: loading && column.length === 0 ? "" : column.length })
4997
4999
  ] }),
4998
5000
  /* @__PURE__ */ jsxs("div", { className: "pos-col__body", children: [
4999
5001
  column.map((o) => {
@@ -5043,7 +5045,11 @@ function DeliveryBoard({ orders, activeId, onSelect, now, channelsConnected, his
5043
5045
  );
5044
5046
  }),
5045
5047
  ghosts.filter((g) => deliveryColumnOf(g.from)?.name === name).map((g) => /* @__PURE__ */ jsx("span", { className: "pos-card pos-card--ghost", "aria-hidden": true }, `ghost-${g.id}`)),
5046
- column.length === 0 && ghosts.every((g) => deliveryColumnOf(g.from)?.name !== name) && /* @__PURE__ */ jsx("p", { className: "pos-col__empty", children: "Nenhum" })
5048
+ loading && column.length === 0 ? [0, 1].map((i) => /* @__PURE__ */ jsxs("span", { className: "pos-card pos-skel", "aria-hidden": true, style: { display: "grid", gap: 8 }, children: [
5049
+ /* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: "40%", height: 14 } }),
5050
+ /* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: `${70 - i * 15}%`, height: 12 } }),
5051
+ /* @__PURE__ */ jsx("span", { className: "pos-skel__b", style: { width: "30%", height: 12 } })
5052
+ ] }, `skel-${i}`)) : column.length === 0 && ghosts.every((g) => deliveryColumnOf(g.from)?.name !== name) && /* @__PURE__ */ jsx("p", { className: "pos-col__empty", children: "Nenhum" })
5047
5053
  ] })
5048
5054
  ]
5049
5055
  },
@@ -8795,6 +8801,7 @@ function PosScreen({
8795
8801
  activeId: activePositionId,
8796
8802
  onSelect: selectPosition,
8797
8803
  now,
8804
+ loading,
8798
8805
  historyOpen: deliveryHistory && !activePosition,
8799
8806
  onToggleHistory: activePosition ? void 0 : () => setDeliveryHistory((v) => !v)
8800
8807
  }