@sirendesign/markup 1.0.28 → 1.0.32

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,6 +1,7 @@
1
1
  import React from "react";
2
2
  export interface IconProps extends React.SVGProps<SVGSVGElement> {
3
3
  className?: string;
4
+ title?: string;
4
5
  }
5
6
  export declare const MessageIcon: React.FC<IconProps>;
6
7
  export declare const CloseIcon: React.FC<IconProps>;
package/dist/index.esm.js CHANGED
@@ -39804,6 +39804,10 @@ const deleteFeedback = async (feedbackId) => {
39804
39804
  };
39805
39805
  const subscribeFeedback = (projectId, callback) => {
39806
39806
  const db = getFirebaseDb();
39807
+ if (!db) {
39808
+ console.warn('Firestore is not available. subscribeFeedback will be a no-op.');
39809
+ return () => { };
39810
+ }
39807
39811
  const q = query(collection(db, COLLECTION_NAME), where('projectId', '==', projectId), orderBy('createdAt', 'desc'));
39808
39812
  return onSnapshot(q, (snapshot) => {
39809
39813
  console.log('Firestore snapshot received:', snapshot.size, 'documents');
@@ -39832,8 +39836,8 @@ const subscribeFeedback = (projectId, callback) => {
39832
39836
  timestamp: new Date().toISOString(),
39833
39837
  deviceType: 'desktop',
39834
39838
  },
39835
- createdAt: ((_c = (_b = (_a = data.createdAt) === null || _a === void 0 ? void 0 : _a.toDate) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.toISOString()) || new Date().toISOString(),
39836
- updatedAt: ((_f = (_e = (_d = data.updatedAt) === null || _d === void 0 ? void 0 : _d.toDate) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.toISOString()) || ((_j = (_h = (_g = data.createdAt) === null || _g === void 0 ? void 0 : _g.toDate) === null || _h === void 0 ? void 0 : _h.call(_g)) === null || _j === void 0 ? void 0 : _j.toISOString()) || new Date().toISOString(),
39839
+ createdAt: ((_c = (_b = (_a = data.createdAt) === null || _a === void 0 ? void 0 : _a.toDate) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.toISOString()) || data.createdAt || new Date().toISOString(),
39840
+ updatedAt: ((_f = (_e = (_d = data.updatedAt) === null || _d === void 0 ? void 0 : _d.toDate) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.toISOString()) || ((_j = (_h = (_g = data.createdAt) === null || _g === void 0 ? void 0 : _g.toDate) === null || _h === void 0 ? void 0 : _h.call(_g)) === null || _j === void 0 ? void 0 : _j.toISOString()) || data.createdAt || new Date().toISOString(),
39837
39841
  createdBy: data.createdBy || {
39838
39842
  id: data.userId,
39839
39843
  name: 'User',
@@ -40413,8 +40417,13 @@ const FeedbackPins = ({ onPinClick }) => {
40413
40417
  hover:scale-110
40414
40418
  `, children: jsx(MessageIcon, { className: "w-4 h-4 text-white" }) }), jsxs("div", { className: "\n absolute bottom-full left-1/2 -translate-x-1/2 mb-2\n opacity-0 group-hover:opacity-100\n pointer-events-none\n transition-opacity duration-200\n bg-gray-900 text-white text-xs rounded-lg py-2 px-3\n whitespace-nowrap shadow-xl\n max-w-[200px]\n ", children: [jsx("div", { className: "font-semibold truncate", children: feedback.title || 'Feedback' }), jsx("div", { className: "text-gray-300 text-[10px] mt-0.5", children: "Click to view" }), jsx("div", { className: "\n absolute top-full left-1/2 -translate-x-1/2\n w-0 h-0\n border-l-4 border-l-transparent\n border-r-4 border-r-transparent\n border-t-4 border-t-gray-900\n " })] })] }) }, feedback.id));
40415
40419
  }
40416
- finally { }
40420
+ catch (e) {
40421
+ // If anything goes wrong measuring/positioning, skip this pin
40422
+ return null;
40423
+ }
40417
40424
  }
40425
+ // If we didn't render a pin above, return null so map callback returns consistently
40426
+ return null;
40418
40427
  }) }));
40419
40428
  };
40420
40429
 
@@ -40698,6 +40707,7 @@ const MarkupWidget = ({ config: userConfig, }) => {
40698
40707
  body.style.background = '';
40699
40708
  };
40700
40709
  }
40710
+ return undefined;
40701
40711
  }, [viewportMode]);
40702
40712
  useEffect(() => {
40703
40713
  if (userConfig) {