@overlastic/react 0.8.3 → 0.8.8
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.cjs +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.global.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +2 -4
package/dist/index.cjs
CHANGED
|
@@ -59,7 +59,7 @@ function OverlaysProvider(props) {
|
|
|
59
59
|
setInstances((instances2) => [...instances2, { Instance, props: props2 }]);
|
|
60
60
|
}
|
|
61
61
|
function vanish(instance) {
|
|
62
|
-
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance !== Instance)]);
|
|
62
|
+
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance.name !== Instance.name)]);
|
|
63
63
|
}
|
|
64
64
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InstancesContext.Provider, { value: { render, vanish }, children: [
|
|
65
65
|
instances.map(({ Instance, props: props2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Instance, { ...props2 }, index)),
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode, Dispatch, SetStateAction, FC } from 'react';
|
|
3
3
|
import { MountOptions, ImperativeOverlay, GlobalMountOptions } from '@overlastic/core';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface OverlaysProviderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function OverlaysProvider(props: OverlaysProviderProps): react_jsx_runtime.JSX.Element;
|
|
6
9
|
|
|
7
10
|
type PropsWithOverlays<P = unknown, V = void> = P & {
|
|
8
11
|
visible?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode, Dispatch, SetStateAction, FC } from 'react';
|
|
3
3
|
import { MountOptions, ImperativeOverlay, GlobalMountOptions } from '@overlastic/core';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface OverlaysProviderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function OverlaysProvider(props: OverlaysProviderProps): react_jsx_runtime.JSX.Element;
|
|
6
9
|
|
|
7
10
|
type PropsWithOverlays<P = unknown, V = void> = P & {
|
|
8
11
|
visible?: boolean;
|
package/dist/index.global.js
CHANGED
|
@@ -31753,8 +31753,8 @@ var OverlaysReact = (() => {
|
|
|
31753
31753
|
const deferred = createDeferred();
|
|
31754
31754
|
const name = defineName(options3.id, options3.autoIncrement);
|
|
31755
31755
|
const index = getIndex(options3.id);
|
|
31756
|
-
const root =
|
|
31757
|
-
const container = defineGlobalElement(name, root);
|
|
31756
|
+
const root = options3.root ? options3.root : document.body;
|
|
31757
|
+
const container = globalContainer !== false ? defineGlobalElement(name, root) : void 0;
|
|
31758
31758
|
mount(instance, props, Object.assign(options3, {
|
|
31759
31759
|
position: context.position,
|
|
31760
31760
|
id: name,
|
|
@@ -31819,7 +31819,7 @@ var OverlaysReact = (() => {
|
|
|
31819
31819
|
setInstances((instances2) => [...instances2, { Instance, props: props2 }]);
|
|
31820
31820
|
}
|
|
31821
31821
|
function vanish(instance) {
|
|
31822
|
-
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance !== Instance)]);
|
|
31822
|
+
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance.name !== Instance.name)]);
|
|
31823
31823
|
}
|
|
31824
31824
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InstancesContext.Provider, { value: { render, vanish }, children: [
|
|
31825
31825
|
instances.map(({ Instance, props: props2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Instance, { ...props2 }, index)),
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ function OverlaysProvider(props) {
|
|
|
29
29
|
setInstances((instances2) => [...instances2, { Instance, props: props2 }]);
|
|
30
30
|
}
|
|
31
31
|
function vanish(instance) {
|
|
32
|
-
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance !== Instance)]);
|
|
32
|
+
setInstances((instances2) => [...instances2.filter(({ Instance }) => instance.name !== Instance.name)]);
|
|
33
33
|
}
|
|
34
34
|
return /* @__PURE__ */ jsxs(InstancesContext.Provider, { value: { render, vanish }, children: [
|
|
35
35
|
instances.map(({ Instance, props: props2 }, index) => /* @__PURE__ */ jsx(Instance, { ...props2 }, index)),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overlastic/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/hairyf/overlastic#readme",
|
|
7
7
|
"repository": {
|
|
@@ -30,9 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"pascal-case": "3.1.2",
|
|
33
|
-
"
|
|
34
|
-
"react-dom": "^18.3.1",
|
|
35
|
-
"@overlastic/core": "^0.8.3"
|
|
33
|
+
"@overlastic/core": "^0.8.8"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
36
|
"@types/react": "^18.3.20",
|