@sirendesign/markup 1.0.1 → 1.0.3
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.esm.js +19 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -37512,6 +37512,16 @@ const useFirebaseSync = () => {
|
|
|
37512
37512
|
const MarkupWidget = ({ config: userConfig, }) => {
|
|
37513
37513
|
var _a;
|
|
37514
37514
|
const { isOpen, setIsOpen, activeTab, setActiveTab, selectedFeedback, setSelectedFeedback, feedbackItems, addFeedbackItem, config, setConfig, reset, isAuthenticated, currentUser, } = useMarkupStore();
|
|
37515
|
+
// Initialize Firebase BEFORE the sync hook runs (if config provided)
|
|
37516
|
+
if ((userConfig === null || userConfig === void 0 ? void 0 : userConfig.firebaseConfig) && getApps().length === 0) {
|
|
37517
|
+
try {
|
|
37518
|
+
initializeFirebase(userConfig.firebaseConfig);
|
|
37519
|
+
console.log('Firebase initialized from MarkupWidget config');
|
|
37520
|
+
}
|
|
37521
|
+
catch (error) {
|
|
37522
|
+
console.error('Failed to initialize Firebase:', error);
|
|
37523
|
+
}
|
|
37524
|
+
}
|
|
37515
37525
|
// Initialize Firebase sync
|
|
37516
37526
|
useFirebaseSync();
|
|
37517
37527
|
useEffect(() => {
|
|
@@ -37522,15 +37532,15 @@ const MarkupWidget = ({ config: userConfig, }) => {
|
|
|
37522
37532
|
useEffect(() => {
|
|
37523
37533
|
const handleKeyDown = (e) => {
|
|
37524
37534
|
const shortcut = config.shortcut || "ctrl+shift+m";
|
|
37525
|
-
const
|
|
37526
|
-
const
|
|
37527
|
-
const
|
|
37528
|
-
const
|
|
37529
|
-
const key =
|
|
37530
|
-
if (
|
|
37531
|
-
|
|
37532
|
-
|
|
37533
|
-
e.
|
|
37535
|
+
const keys = shortcut.split("+").map((k) => k.trim().toLowerCase());
|
|
37536
|
+
const ctrl = keys.includes("ctrl");
|
|
37537
|
+
const shift = keys.includes("shift");
|
|
37538
|
+
const alt = keys.includes("alt");
|
|
37539
|
+
const key = keys[keys.length - 1];
|
|
37540
|
+
if (e.key.toLowerCase() === key &&
|
|
37541
|
+
e.ctrlKey === ctrl &&
|
|
37542
|
+
e.shiftKey === shift &&
|
|
37543
|
+
e.altKey === alt) {
|
|
37534
37544
|
e.preventDefault();
|
|
37535
37545
|
setIsOpen(!isOpen);
|
|
37536
37546
|
}
|