@xylabs/react-portal 3.4.0 → 3.4.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/browser/components/Portal/Portal.d.cts +1 -1
- package/dist/browser/components/Portal/Portal.d.mts +1 -1
- package/dist/browser/components/Portal/Portal.d.ts +1 -1
- package/dist/browser/components/Portal/index.d.cts +2 -2
- package/dist/browser/components/Portal/index.d.mts +2 -2
- package/dist/browser/components/Portal/index.d.ts +2 -2
- package/dist/browser/components/index.d.cts +1 -1
- package/dist/browser/components/index.d.mts +1 -1
- package/dist/browser/components/index.d.ts +1 -1
- package/dist/browser/index.cjs +8 -4
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.mts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/{index.js → index.mjs} +11 -5
- package/dist/browser/index.mjs.map +1 -0
- package/dist/neutral/components/Portal/Portal.d.cts +1 -1
- package/dist/neutral/components/Portal/Portal.d.mts +1 -1
- package/dist/neutral/components/Portal/Portal.d.ts +1 -1
- package/dist/neutral/components/Portal/index.d.cts +2 -2
- package/dist/neutral/components/Portal/index.d.mts +2 -2
- package/dist/neutral/components/Portal/index.d.ts +2 -2
- package/dist/neutral/components/index.d.cts +1 -1
- package/dist/neutral/components/index.d.mts +1 -1
- package/dist/neutral/components/index.d.ts +1 -1
- package/dist/neutral/index.cjs +8 -4
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +1 -1
- package/dist/neutral/index.d.mts +1 -1
- package/dist/neutral/index.d.ts +1 -1
- package/dist/neutral/{index.js → index.mjs} +11 -5
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/node/components/Portal/Portal.d.cts +1 -1
- package/dist/node/components/Portal/Portal.d.mts +1 -1
- package/dist/node/components/Portal/Portal.d.ts +1 -1
- package/dist/node/components/Portal/index.d.cts +2 -2
- package/dist/node/components/Portal/index.d.mts +2 -2
- package/dist/node/components/Portal/index.d.ts +2 -2
- package/dist/node/components/index.d.cts +1 -1
- package/dist/node/components/index.d.mts +1 -1
- package/dist/node/components/index.d.ts +1 -1
- package/dist/node/index.cjs +8 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/{index.js → index.mjs} +11 -5
- package/dist/node/index.mjs.map +1 -0
- package/package.json +8 -8
- package/src/components/Portal/Portal.tsx +1 -1
- package/src/components/Portal/index.ts +2 -2
- package/src/components/index.ts +1 -1
- package/src/index.ts +1 -1
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,7 +28,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
27
28
|
// src/components/Portal/Portal.tsx
|
|
28
29
|
var import_react = require("react");
|
|
29
30
|
var import_react_dom = require("react-dom");
|
|
30
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
31
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
31
32
|
const [container] = (0, import_react.useState)(document.createElement(el));
|
|
32
33
|
if (className) {
|
|
33
34
|
container.classList.add(className);
|
|
@@ -41,7 +42,10 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
41
42
|
return () => {
|
|
42
43
|
container.remove();
|
|
43
44
|
};
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}, [
|
|
46
|
+
container,
|
|
47
|
+
target
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ (0, import_react_dom.createPortal)(children, container);
|
|
50
|
+
}, "Portal");
|
|
47
51
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.ts'\n","import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACAA,mBAAoC;AACpC,uBAA6B;AAItB,IAAMA,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,QAAaC,uBAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,8BAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mBAAeI,OAAOX,SAAAA;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,mDAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/components/Portal/Portal.tsx
|
|
2
5
|
import { useEffect, useState } from "react";
|
|
3
6
|
import { createPortal } from "react-dom";
|
|
4
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
7
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
5
8
|
const [container] = useState(document.createElement(el));
|
|
6
9
|
if (className) {
|
|
7
10
|
container.classList.add(className);
|
|
@@ -15,10 +18,13 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
15
18
|
return () => {
|
|
16
19
|
container.remove();
|
|
17
20
|
};
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
}, [
|
|
22
|
+
container,
|
|
23
|
+
target
|
|
24
|
+
]);
|
|
25
|
+
return /* @__PURE__ */ createPortal(children, container);
|
|
26
|
+
}, "Portal");
|
|
21
27
|
export {
|
|
22
28
|
Portal
|
|
23
29
|
};
|
|
24
|
-
//# sourceMappingURL=index.
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;AAAA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,oBAAoB;AAItB,IAAMC,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,IAAaC,SAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,YAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mBAAeI,OAAOX,SAAAA;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,6BAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["useEffect","useState","createPortal","Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,7 +28,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
27
28
|
// src/components/Portal/Portal.tsx
|
|
28
29
|
var import_react = require("react");
|
|
29
30
|
var import_react_dom = require("react-dom");
|
|
30
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
31
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
31
32
|
const [container] = (0, import_react.useState)(document.createElement(el));
|
|
32
33
|
if (className) {
|
|
33
34
|
container.classList.add(className);
|
|
@@ -41,7 +42,10 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
41
42
|
return () => {
|
|
42
43
|
container.remove();
|
|
43
44
|
};
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}, [
|
|
46
|
+
container,
|
|
47
|
+
target
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ (0, import_react_dom.createPortal)(children, container);
|
|
50
|
+
}, "Portal");
|
|
47
51
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.ts'\n","import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACAA,mBAAoC;AACpC,uBAA6B;AAItB,IAAMA,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,QAAaC,uBAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,8BAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mBAAeI,OAAOX,SAAAA;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,mDAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
package/dist/neutral/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/components/Portal/Portal.tsx
|
|
2
5
|
import { useEffect, useState } from "react";
|
|
3
6
|
import { createPortal } from "react-dom";
|
|
4
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
7
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
5
8
|
const [container] = useState(document.createElement(el));
|
|
6
9
|
if (className) {
|
|
7
10
|
container.classList.add(className);
|
|
@@ -15,10 +18,13 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
15
18
|
return () => {
|
|
16
19
|
container.remove();
|
|
17
20
|
};
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
}, [
|
|
22
|
+
container,
|
|
23
|
+
target
|
|
24
|
+
]);
|
|
25
|
+
return /* @__PURE__ */ createPortal(children, container);
|
|
26
|
+
}, "Portal");
|
|
21
27
|
export {
|
|
22
28
|
Portal
|
|
23
29
|
};
|
|
24
|
-
//# sourceMappingURL=index.
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;AAAA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,oBAAoB;AAItB,IAAMC,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,IAAaC,SAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,YAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mBAAeI,OAAOX,SAAAA;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,6BAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["useEffect","useState","createPortal","Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx';
|
|
2
|
+
export * from './PortalProps.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,7 +28,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
27
28
|
// src/components/Portal/Portal.tsx
|
|
28
29
|
var import_react = require("react");
|
|
29
30
|
var import_react_dom = require("react-dom");
|
|
30
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
31
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
31
32
|
const [container] = (0, import_react.useState)(document.createElement(el));
|
|
32
33
|
if (className) {
|
|
33
34
|
container.classList.add(className);
|
|
@@ -41,9 +42,12 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
41
42
|
return () => {
|
|
42
43
|
container.remove();
|
|
43
44
|
};
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}, [
|
|
46
|
+
container,
|
|
47
|
+
target
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ (0, import_react_dom.createPortal)(children, container);
|
|
50
|
+
}, "Portal");
|
|
47
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
52
|
0 && (module.exports = {
|
|
49
53
|
Portal
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/Portal/Portal.tsx"],"sourcesContent":["export * from './components/index.ts'\n","import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACAA,mBAAoC;AACpC,uBAA6B;AAItB,IAAMA,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,QAAaC,uBAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,8BAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mDAAeI,OAAOX;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,mDAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/components/Portal/Portal.tsx
|
|
2
5
|
import { useEffect, useState } from "react";
|
|
3
6
|
import { createPortal } from "react-dom";
|
|
4
|
-
var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
7
|
+
var Portal = /* @__PURE__ */ __name(({ children, className, el = "div", target = "body" }) => {
|
|
5
8
|
const [container] = useState(document.createElement(el));
|
|
6
9
|
if (className) {
|
|
7
10
|
container.classList.add(className);
|
|
@@ -15,10 +18,13 @@ var Portal = ({ children, className, el = "div", target = "body" }) => {
|
|
|
15
18
|
return () => {
|
|
16
19
|
container.remove();
|
|
17
20
|
};
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
}, [
|
|
22
|
+
container,
|
|
23
|
+
target
|
|
24
|
+
]);
|
|
25
|
+
return /* @__PURE__ */ createPortal(children, container);
|
|
26
|
+
}, "Portal");
|
|
21
27
|
export {
|
|
22
28
|
Portal
|
|
23
29
|
};
|
|
24
|
-
//# sourceMappingURL=index.
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.ts'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";;;;AAAA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,oBAAoB;AAItB,IAAMC,SAAgC,wBAAC,EAAEC,UAAUC,WAAWC,KAAK,OAAOC,SAAS,OAAM,MAAe;AAC7G,QAAM,CAACC,SAAAA,IAAaC,SAASC,SAASC,cAAcL,EAAAA,CAAAA;AACpD,MAAID,WAAW;AACbG,cAAUI,UAAUC,IAAIR,SAAAA;EAC1B;AACAS,YAAU,MAAA;AACR,UAAMC,gBAAgBL,SAASM,cAAcT,MAAAA;AAC7C,QAAI,CAACQ,eAAe;AAClBE,cAAQC,KAAK,kCAAkCX,MAAAA,EAAQ;IACzD;AACAQ,mDAAeI,OAAOX;AACtB,WAAO,MAAA;AACLA,gBAAUY,OAAM;IAClB;EACF,GAAG;IAACZ;IAAWD;GAAO;AAEtB,SAAOc,6BAAajB,UAAUI,SAAAA;AAChC,GAjB6C;","names":["useEffect","useState","createPortal","Portal","children","className","el","target","container","useState","document","createElement","classList","add","useEffect","targetElement","querySelector","console","warn","append","remove","createPortal"]}
|
package/package.json
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/react": "^18.3.3",
|
|
18
18
|
"@types/react-dom": "^18.3.0",
|
|
19
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
20
|
-
"@xylabs/tsconfig-react": "^3.
|
|
19
|
+
"@xylabs/ts-scripts-yarn3": "^3.15.16",
|
|
20
|
+
"@xylabs/tsconfig-react": "^3.15.16",
|
|
21
21
|
"react": "^18.3.1",
|
|
22
22
|
"react-dom": "^18.3.1",
|
|
23
|
-
"typescript": "^5.5.
|
|
23
|
+
"typescript": "^5.5.4"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^18",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"node": {
|
|
32
32
|
"import": {
|
|
33
33
|
"types": "./dist/node/index.d.mts",
|
|
34
|
-
"default": "./dist/node/index.
|
|
34
|
+
"default": "./dist/node/index.mjs"
|
|
35
35
|
},
|
|
36
36
|
"require": {
|
|
37
37
|
"types": "./dist/node/index.d.cts",
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"browser": {
|
|
42
42
|
"import": {
|
|
43
43
|
"types": "./dist/browser/index.d.mts",
|
|
44
|
-
"default": "./dist/browser/index.
|
|
44
|
+
"default": "./dist/browser/index.mjs"
|
|
45
45
|
},
|
|
46
46
|
"require": {
|
|
47
47
|
"types": "./dist/browser/index.d.cts",
|
|
48
48
|
"default": "./dist/browser/index.cjs"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"default": "./dist/browser/index.
|
|
51
|
+
"default": "./dist/browser/index.mjs"
|
|
52
52
|
},
|
|
53
53
|
"./package.json": "./package.json"
|
|
54
54
|
},
|
|
55
55
|
"types": "dist/browser/index.d.ts",
|
|
56
56
|
"main": "./dist/browser/index.cjs",
|
|
57
|
-
"module": "./dist/browser/index.
|
|
57
|
+
"module": "./dist/browser/index.mjs",
|
|
58
58
|
"homepage": "https://xylabs.com",
|
|
59
59
|
"keywords": [
|
|
60
60
|
"utility",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "https://github.com/xylabs/sdk-react.git"
|
|
71
71
|
},
|
|
72
72
|
"sideEffects": false,
|
|
73
|
-
"version": "3.4.
|
|
73
|
+
"version": "3.4.2",
|
|
74
74
|
"type": "module"
|
|
75
75
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
import { createPortal } from 'react-dom'
|
|
3
3
|
|
|
4
|
-
import { PortalProps } from './PortalProps.
|
|
4
|
+
import { PortalProps } from './PortalProps.ts'
|
|
5
5
|
|
|
6
6
|
export const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {
|
|
7
7
|
const [container] = useState(document.createElement(el))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Portal.
|
|
2
|
-
export * from './PortalProps.
|
|
1
|
+
export * from './Portal.tsx'
|
|
2
|
+
export * from './PortalProps.ts'
|
package/src/components/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Portal/index.
|
|
1
|
+
export * from './Portal/index.ts'
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components/index.
|
|
1
|
+
export * from './components/index.ts'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.js'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,oBAAoB;AAItB,IAAM,SAAgC,CAAC,EAAE,UAAU,WAAW,KAAK,OAAO,SAAS,OAAO,MAAmB;AAClH,QAAM,CAAC,SAAS,IAAI,SAAS,SAAS,cAAc,EAAE,CAAC;AACvD,MAAI,WAAW;AACb,cAAU,UAAU,IAAI,SAAS;AAAA,EACnC;AACA,YAAU,MAAM;AACd,UAAM,gBAAgB,SAAS,cAAc,MAAM;AACnD,QAAI,CAAC,eAAe;AAClB,cAAQ,KAAK,kCAAkC,MAAM,EAAE;AAAA,IACzD;AACA,mBAAe,OAAO,SAAS;AAC/B,WAAO,MAAM;AACX,gBAAU,OAAO;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtB,SAAO,aAAa,UAAU,SAAS;AACzC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.js'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,oBAAoB;AAItB,IAAM,SAAgC,CAAC,EAAE,UAAU,WAAW,KAAK,OAAO,SAAS,OAAO,MAAmB;AAClH,QAAM,CAAC,SAAS,IAAI,SAAS,SAAS,cAAc,EAAE,CAAC;AACvD,MAAI,WAAW;AACb,cAAU,UAAU,IAAI,SAAS;AAAA,EACnC;AACA,YAAU,MAAM;AACd,UAAM,gBAAgB,SAAS,cAAc,MAAM;AACnD,QAAI,CAAC,eAAe;AAClB,cAAQ,KAAK,kCAAkC,MAAM,EAAE;AAAA,IACzD;AACA,mBAAe,OAAO,SAAS;AAC/B,WAAO,MAAM;AACX,gBAAU,OAAO;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtB,SAAO,aAAa,UAAU,SAAS;AACzC;","names":[]}
|
package/dist/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps.js'\n\nexport const Portal: React.FC<PortalProps> = ({ children, className, el = 'div', target = 'body' }: PortalProps) => {\n const [container] = useState(document.createElement(el))\n if (className) {\n container.classList.add(className)\n }\n useEffect(() => {\n const targetElement = document.querySelector(target)\n if (!targetElement) {\n console.warn(`Unable to find target element: ${target}`)\n }\n targetElement?.append(container)\n return () => {\n container.remove()\n }\n }, [container, target])\n\n return createPortal(children, container)\n}\n"],"mappings":";AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,oBAAoB;AAItB,IAAM,SAAgC,CAAC,EAAE,UAAU,WAAW,KAAK,OAAO,SAAS,OAAO,MAAmB;AAClH,QAAM,CAAC,SAAS,IAAI,SAAS,SAAS,cAAc,EAAE,CAAC;AACvD,MAAI,WAAW;AACb,cAAU,UAAU,IAAI,SAAS;AAAA,EACnC;AACA,YAAU,MAAM;AACd,UAAM,gBAAgB,SAAS,cAAc,MAAM;AACnD,QAAI,CAAC,eAAe;AAClB,cAAQ,KAAK,kCAAkC,MAAM,EAAE;AAAA,IACzD;AACA,mDAAe,OAAO;AACtB,WAAO,MAAM;AACX,gBAAU,OAAO;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,WAAW,MAAM,CAAC;AAEtB,SAAO,aAAa,UAAU,SAAS;AACzC;","names":[]}
|