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