@sirendesign/markup 1.0.0 → 1.0.2
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 +10 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -0
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import require$$0, { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
3
4
|
import { createPortal } from 'react-dom';
|
|
@@ -37516,6 +37517,15 @@ const MarkupWidget = ({ config: userConfig, }) => {
|
|
|
37516
37517
|
useEffect(() => {
|
|
37517
37518
|
if (userConfig) {
|
|
37518
37519
|
setConfig(userConfig);
|
|
37520
|
+
// Auto-initialize Firebase if config provided and not already initialized
|
|
37521
|
+
if (userConfig.firebaseConfig && getApps().length === 0) {
|
|
37522
|
+
try {
|
|
37523
|
+
initializeFirebase(userConfig.firebaseConfig);
|
|
37524
|
+
}
|
|
37525
|
+
catch (error) {
|
|
37526
|
+
console.error('Failed to initialize Firebase:', error);
|
|
37527
|
+
}
|
|
37528
|
+
}
|
|
37519
37529
|
}
|
|
37520
37530
|
}, [userConfig, setConfig]);
|
|
37521
37531
|
useEffect(() => {
|