@overlastic/react 0.5.0 → 0.6.1

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/README.md CHANGED
@@ -1,183 +1,29 @@
1
- # @overlastic/react
1
+ <p align="center">
2
+ <a href="https://overlastic.vercel.app/" target="blank">
3
+ <img src="https://github.com/hairyf/overlastic/raw/master/docs/public/logo.svg" width="120" alt="Nest Logo" />
4
+ </a>
5
+ </p>
2
6
 
3
- @overlastic/react is used to define Overlay components in react and supports both imperative and declarative usage!
7
+ <p align="center">
8
+ A create modal | dialog | popup promise deferred library
9
+ </p>
4
10
 
5
- ## Install
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/@overlastic/react"><img src="https://img.shields.io/npm/v/@overlastic/react.svg" alt="NPM Version" /></a>
13
+ <a href="https://www.npmjs.com/@overlastic/react"><img src="https://img.shields.io/npm/l/@overlastic/react.svg" alt="Package License" /></a>
14
+ <a href="https://www.npmjs.com/@overlastic/react"><img src="https://img.shields.io/npm/dm/@overlastic/react.svg" alt="NPM Downloads" /></a>
15
+ </p>
6
16
 
7
- With pnpm:
8
- ```sh
9
- pnpm add @overlastic/react
10
- ```
11
-
12
- With yarn:
13
- ```sh
14
- yarn add @overlastic/react
15
- ```
16
-
17
- ## Usage
18
-
19
- ### Step 1: Define Component
20
-
21
- ```tsx
22
- // overlay.tsx
23
- export function Component(props) {
24
- const { visible, resolve, reject } = useOverlayDefine({
25
- // Duration of overlay duration, helps prevent premature component destruction
26
- duration: 200,
27
- })
28
-
29
- return (
30
- <div className={visible && 'is--visible'}>
31
- <span onClick={() => resolve(`${props.title}:confirmed`)}> Confirm </span>
32
- </div>
33
- )
34
- }
35
- ```
36
-
37
- ### Step 2: Create Overlay
38
-
39
- You can convert the component into a modal dialog box by using the `defineOverlay` method, which allows you to call it in Javascript / Typescript.
40
- ```ts
41
- import { defineOverlay } from '@overlastic/react'
42
- import { Component } from './overlay'
43
-
44
- // Convert to imperative callback
45
- const callback = defineOverlay(Component)
46
- // Call the component and get the resolve callback value
47
- const value = await callback({ title: 'callbackOverlay' })
48
- // value === "callbackOverlay:confirmed"
49
- ```
50
-
51
- You can also directly call the component through `renderOverlay`, bypassing the `defineOverlay` method.
52
-
53
- ```ts
54
- import { renderOverlay } from '@overlastic/react'
55
- import { Component } from './overlay'
56
-
57
- const value = await renderOverlay(Component, {
58
- title: 'useOverlayDefine'
59
- })
60
- // value === "useOverlayDefine:confirmed"
61
- ```
62
-
63
- ## Injection Holder
64
-
65
- In addition to using `defineOverlay` and `renderOverlay` to create popup components, you can also use useOverlayHolder to create popup components within a component and inherit the current context of the application.
66
-
67
- ```tsx
68
- import { useOverlayHolder } from '@overlastic/react'
69
- import { OverlayComponent } from './overlay'
70
-
71
- export function Main() {
72
- // Use useOverlayHolder(Component) to create a component holder that supports the current context.
73
- const [holder, overlayApi] = useOverlayHolder(OverlayComponent)
74
-
75
- function open() {
76
- // Open the popup component
77
- overlayApi()
78
- .then((result) => {})
79
- }
80
- return (
81
- <>
82
- <div onClick={open}> open </div>
83
- {/* Mount the holder */}
84
- {holder}
85
- </>
86
- )
87
- }
88
- ```
89
-
90
- ## Define Component
91
-
92
- Components created using `@overlastic/react` support both imperative and declarative methods of calling. In addition to imperative methods, these components can also be used in JSX.
17
+ ## Description
93
18
 
94
- > This is an optional option that is very useful when porting old components.
19
+ Create messages or dialog overlays using Overlastic in React APP.
95
20
 
96
- ```tsx
97
- // If using Typescript, use PropsWithOverlays to define props type
98
- import type { PropsWithOverlays } from '@overlastic/react'
99
- import { useOverlayDefine } from '@overlastic/react'
21
+ ## Installation
100
22
 
101
- export function Component(props: PropsWithOverlays<{ /* ...you props */ }>) {
102
- const { visible, resolve, reject } = useOverlayDefine({
103
- // pass props to useOverlayDefine for processing
104
- props
105
- })
106
-
107
- return (
108
- <div className={visible && 'is--visible'}>
109
- ...
110
- </div>
111
- )
112
- }
23
+ ```bash
24
+ $ npm install --save @overlastic/react
113
25
  ```
114
26
 
115
- Once the Overlay component has received props, the popup layer component can be used in JSX.
116
-
117
- ```tsx
118
- import { useState } from 'react'
119
- import { Component } from './overlay'
120
-
121
- export function Main() {
122
- const [visible, setVisible] = useState(false)
123
-
124
- function openOverlay() {
125
- setVisible(true)
126
- }
127
-
128
- function onResolve(value) {
129
- setVisible(false)
130
- }
131
-
132
- function onReject(value) {
133
- setVisible(false)
134
- }
135
-
136
- return (
137
- <Component visible={visible} onResolve={onResolve} onReject={onReject} />
138
- )
139
- }
140
- ```
27
+ ## Quick Start
141
28
 
142
- If you want to replace other fields and event names, you can do so using the `model` and `events` config of useOverlayDefine.
143
-
144
- ```jsx
145
- function Component(props: { onOn?: Function, onNook?: Function, open: boolean }) {
146
- const { visible, resolve, reject } = useOverlayDefine({
147
- events: { resolve: 'onOk', reject: 'onNook' },
148
- model: 'open',
149
- props,
150
- })
151
- // ...
152
- }
153
- ```
154
-
155
- ## Customized
156
-
157
- You can use `@overlastic/react` to modify existing components or component libraries
158
-
159
- Take [antd(drawer)](https://ant.design/components/drawer-cn) as an example:
160
-
161
- ```tsx
162
- import type { PropsWithOverlays } from '@overlastic/react'
163
- import { useOverlayDefine } from '@overlastic/react'
164
- import { Button, Drawer } from 'antd'
165
-
166
- function MyDrawer(props: PropsWithOverlays<{ title: string }>) {
167
- const { visible, resolve, reject } = useOverlayDefine({
168
- duration: 200,
169
- props,
170
- })
171
-
172
- return (
173
- <Drawer title={props.title} onClose={reject} open={visible}>
174
- {/* Custom contents.... */}
175
- <Button type="primary" onClick={() => resolve(`${props.title}:confirmed`)}>
176
- Confirm
177
- </Button>
178
- </Drawer>
179
- )
180
- }
181
-
182
- export default MyDrawer
183
- ```
29
+ [Overview & Tutorial](https://overlastic.vercel.app/react/)
package/dist/index.cjs CHANGED
@@ -23,9 +23,9 @@ __export(src_exports, {
23
23
  OverlayProvider: () => OverlayProvider,
24
24
  defineOverlay: () => defineOverlay,
25
25
  renderOverlay: () => renderOverlay,
26
- useOverlay: () => useOverlay,
27
- useOverlayDefine: () => useOverlayDefine,
28
- useOverlayHolder: () => useOverlayHolder
26
+ useDefineOverlay: () => useDefineOverlay,
27
+ useOverlayHolder: () => useOverlayHolder,
28
+ useOverlayInject: () => useOverlayInject
29
29
  });
30
30
  module.exports = __toCommonJS(src_exports);
31
31
 
@@ -54,7 +54,7 @@ function defineAnonymousComponent(component) {
54
54
  }
55
55
 
56
56
  // src/composable/define.ts
57
- function useOverlayDefine(options = {}) {
57
+ function useDefineOverlay(options = {}) {
58
58
  const { immediate = true, duration = 0, automatic = true } = options;
59
59
  const context = (0, import_react2.useContext)(ScriptsContext);
60
60
  const dec = Reflect.get(context, "in_dec");
@@ -123,14 +123,15 @@ var import_pascal_case = require("pascal-case");
123
123
  var import_react4 = require("react");
124
124
  var import_react_dom = require("react-dom");
125
125
  var import_jsx_runtime = require("react/jsx-runtime");
126
- function useOverlayHolder(Component, options = {}) {
126
+ function useOverlayHolder(component, options = {}) {
127
127
  const { callback, scripts, props, refresh } = useRefreshMetadata();
128
128
  const name = (0, import_core3.defineName)(options.id, options.autoIncrement);
129
129
  function render() {
130
130
  const root = options.root || (typeof document !== "undefined" ? document.body : void 0);
131
+ const Comp = component;
131
132
  const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id: name, children: [
132
133
  " ",
133
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...props }),
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...props }),
134
135
  " "
135
136
  ] });
136
137
  return options.root !== false && root ? (0, import_react_dom.createPortal)(content, root) : content;
@@ -173,7 +174,7 @@ function useRefreshMetadata() {
173
174
  return { callback, scripts, props, refresh };
174
175
  }
175
176
 
176
- // src/composable/overlay.tsx
177
+ // src/composable/inject.tsx
177
178
  var import_core4 = require("@overlastic/core");
178
179
  var import_react5 = require("react");
179
180
  var import_pascal_case2 = require("pascal-case");
@@ -196,7 +197,7 @@ var { define } = (0, import_core4.createConstructor)((Instance, props, options)
196
197
  }
197
198
  render(InstanceWithProvider, props);
198
199
  }, { container: false });
199
- function useOverlay(Instance) {
200
+ function useOverlayInject(Instance) {
200
201
  const { render, vanish } = (0, import_react5.useContext)(InstancesContext);
201
202
  return define(Instance, { render, vanish });
202
203
  }
@@ -254,7 +255,7 @@ function OverlayProvider(props) {
254
255
  OverlayProvider,
255
256
  defineOverlay,
256
257
  renderOverlay,
257
- useOverlay,
258
- useOverlayDefine,
259
- useOverlayHolder
258
+ useDefineOverlay,
259
+ useOverlayHolder,
260
+ useOverlayInject
260
261
  });
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import * as react from 'react';
2
1
  import { Dispatch, SetStateAction, FC, PropsWithChildren } from 'react';
3
2
  import * as _overlastic_core from '@overlastic/core';
4
3
  import { ImperativeOverlay, MountOptions } from '@overlastic/core';
4
+ import { GlobalMountOptions } from '@vue/test-utils/dist/types';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
 
7
7
  type PropsWidthOverlays<P = unknown> = P & {
@@ -24,7 +24,7 @@ interface PromptifyEvents {
24
24
  */
25
25
  resolve?: string;
26
26
  }
27
- interface OverlayDefineOptions {
27
+ interface DefineOverlayOptions {
28
28
  /** animation duration to avoid premature destruction of components */
29
29
  duration?: number;
30
30
  /** whether to set visible to true immediately */
@@ -50,13 +50,13 @@ interface OverlayDefineOptions {
50
50
  */
51
51
  automatic?: boolean;
52
52
  }
53
- interface ProgramsReturn {
53
+ interface DefineOverlayReturn {
54
54
  /** the notification reject, modify visible, and destroy it after the duration ends */
55
- reject: Function;
55
+ reject: (reason?: any) => void;
56
56
  /** the notification resolve, modify visible, and destroy it after the duration ends */
57
- resolve: Function;
57
+ resolve: (value?: any) => void;
58
58
  /** destroy the current instance (immediately) */
59
- vanish: Function;
59
+ vanish: () => void;
60
60
  /** visible control popup display and hide */
61
61
  visible: boolean;
62
62
  /** visible dispatch change */
@@ -64,20 +64,20 @@ interface ProgramsReturn {
64
64
  /** current deferred */
65
65
  deferred?: Promise<any>;
66
66
  }
67
- declare function useOverlayDefine(options?: OverlayDefineOptions): ProgramsReturn;
67
+ declare function useDefineOverlay(options?: DefineOverlayOptions): DefineOverlayReturn;
68
68
 
69
69
  type InjectionHolder<Props, Resolved> = [JSX.Element, ImperativeOverlay<Props, Resolved>];
70
- declare function useOverlayHolder<Props, Resolved = void>(Component: FC<Props>, options?: MountOptions): InjectionHolder<Props, Resolved>;
70
+ declare function useOverlayHolder<Props, Resolved = void>(component: FC<Props>, options?: MountOptions): InjectionHolder<Props, Resolved>;
71
71
 
72
72
  interface Options {
73
73
  render: (instance: FC, props: any) => void;
74
74
  vanish: (instance: FC) => void;
75
75
  }
76
- declare function useOverlay<Props, Resolved>(Instance: FC<Props>): _overlastic_core.ImperativeOverlay<Props, Resolved, Options>;
76
+ declare function useOverlayInject<Props, Resolved>(Instance: FC<Props>): _overlastic_core.ImperativeOverlay<Props, Resolved, Options>;
77
77
 
78
- declare const defineOverlay: <Props, Resolved = void>(instance: react.FC<any>, options?: _overlastic_core.GlobalMountOptions | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, unknown>;
79
- declare const renderOverlay: <Props, Resolved = void>(instance: react.FC<any>, props?: Props | undefined, options?: _overlastic_core.GlobalMountOptions | undefined) => Promise<Resolved>;
78
+ declare const defineOverlay: <Props, Resolved = void>(instance: React.FC<Props>, options?: GlobalMountOptions | undefined) => ImperativeOverlay<Props, Resolved, unknown>;
79
+ declare const renderOverlay: <Props, Resolved = void>(instance: React.FC<Props>, props?: Props | undefined, options?: GlobalMountOptions | undefined) => Promise<Resolved>;
80
80
 
81
81
  declare function OverlayProvider(props: PropsWithChildren): react_jsx_runtime.JSX.Element;
82
82
 
83
- export { type InjectionHolder, type OverlayDefineOptions, OverlayProvider, type ProgramsReturn, type PropsWidthOverlays, defineOverlay, renderOverlay, useOverlay, useOverlayDefine, useOverlayHolder };
83
+ export { type DefineOverlayOptions, type DefineOverlayReturn, type InjectionHolder, OverlayProvider, type PropsWidthOverlays, defineOverlay, renderOverlay, useDefineOverlay, useOverlayHolder, useOverlayInject };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import * as react from 'react';
2
1
  import { Dispatch, SetStateAction, FC, PropsWithChildren } from 'react';
3
2
  import * as _overlastic_core from '@overlastic/core';
4
3
  import { ImperativeOverlay, MountOptions } from '@overlastic/core';
4
+ import { GlobalMountOptions } from '@vue/test-utils/dist/types';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
 
7
7
  type PropsWidthOverlays<P = unknown> = P & {
@@ -24,7 +24,7 @@ interface PromptifyEvents {
24
24
  */
25
25
  resolve?: string;
26
26
  }
27
- interface OverlayDefineOptions {
27
+ interface DefineOverlayOptions {
28
28
  /** animation duration to avoid premature destruction of components */
29
29
  duration?: number;
30
30
  /** whether to set visible to true immediately */
@@ -50,13 +50,13 @@ interface OverlayDefineOptions {
50
50
  */
51
51
  automatic?: boolean;
52
52
  }
53
- interface ProgramsReturn {
53
+ interface DefineOverlayReturn {
54
54
  /** the notification reject, modify visible, and destroy it after the duration ends */
55
- reject: Function;
55
+ reject: (reason?: any) => void;
56
56
  /** the notification resolve, modify visible, and destroy it after the duration ends */
57
- resolve: Function;
57
+ resolve: (value?: any) => void;
58
58
  /** destroy the current instance (immediately) */
59
- vanish: Function;
59
+ vanish: () => void;
60
60
  /** visible control popup display and hide */
61
61
  visible: boolean;
62
62
  /** visible dispatch change */
@@ -64,20 +64,20 @@ interface ProgramsReturn {
64
64
  /** current deferred */
65
65
  deferred?: Promise<any>;
66
66
  }
67
- declare function useOverlayDefine(options?: OverlayDefineOptions): ProgramsReturn;
67
+ declare function useDefineOverlay(options?: DefineOverlayOptions): DefineOverlayReturn;
68
68
 
69
69
  type InjectionHolder<Props, Resolved> = [JSX.Element, ImperativeOverlay<Props, Resolved>];
70
- declare function useOverlayHolder<Props, Resolved = void>(Component: FC<Props>, options?: MountOptions): InjectionHolder<Props, Resolved>;
70
+ declare function useOverlayHolder<Props, Resolved = void>(component: FC<Props>, options?: MountOptions): InjectionHolder<Props, Resolved>;
71
71
 
72
72
  interface Options {
73
73
  render: (instance: FC, props: any) => void;
74
74
  vanish: (instance: FC) => void;
75
75
  }
76
- declare function useOverlay<Props, Resolved>(Instance: FC<Props>): _overlastic_core.ImperativeOverlay<Props, Resolved, Options>;
76
+ declare function useOverlayInject<Props, Resolved>(Instance: FC<Props>): _overlastic_core.ImperativeOverlay<Props, Resolved, Options>;
77
77
 
78
- declare const defineOverlay: <Props, Resolved = void>(instance: react.FC<any>, options?: _overlastic_core.GlobalMountOptions | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, unknown>;
79
- declare const renderOverlay: <Props, Resolved = void>(instance: react.FC<any>, props?: Props | undefined, options?: _overlastic_core.GlobalMountOptions | undefined) => Promise<Resolved>;
78
+ declare const defineOverlay: <Props, Resolved = void>(instance: React.FC<Props>, options?: GlobalMountOptions | undefined) => ImperativeOverlay<Props, Resolved, unknown>;
79
+ declare const renderOverlay: <Props, Resolved = void>(instance: React.FC<Props>, props?: Props | undefined, options?: GlobalMountOptions | undefined) => Promise<Resolved>;
80
80
 
81
81
  declare function OverlayProvider(props: PropsWithChildren): react_jsx_runtime.JSX.Element;
82
82
 
83
- export { type InjectionHolder, type OverlayDefineOptions, OverlayProvider, type ProgramsReturn, type PropsWidthOverlays, defineOverlay, renderOverlay, useOverlay, useOverlayDefine, useOverlayHolder };
83
+ export { type DefineOverlayOptions, type DefineOverlayReturn, type InjectionHolder, OverlayProvider, type PropsWidthOverlays, defineOverlay, renderOverlay, useDefineOverlay, useOverlayHolder, useOverlayInject };
@@ -32220,9 +32220,9 @@ var OverlaysReact = (() => {
32220
32220
  OverlayProvider: () => OverlayProvider,
32221
32221
  defineOverlay: () => defineOverlay,
32222
32222
  renderOverlay: () => renderOverlay,
32223
- useOverlay: () => useOverlay,
32224
- useOverlayDefine: () => useOverlayDefine,
32225
- useOverlayHolder: () => useOverlayHolder
32223
+ useDefineOverlay: () => useDefineOverlay,
32224
+ useOverlayHolder: () => useOverlayHolder,
32225
+ useOverlayInject: () => useOverlayInject
32226
32226
  });
32227
32227
 
32228
32228
  // ../@core/src/define/global.ts
@@ -32357,7 +32357,7 @@ var OverlaysReact = (() => {
32357
32357
  }
32358
32358
 
32359
32359
  // src/composable/define.ts
32360
- function useOverlayDefine(options = {}) {
32360
+ function useDefineOverlay(options = {}) {
32361
32361
  const { immediate = true, duration = 0, automatic = true } = options;
32362
32362
  const context2 = (0, import_react2.useContext)(ScriptsContext);
32363
32363
  const dec = Reflect.get(context2, "in_dec");
@@ -32484,14 +32484,15 @@ var OverlaysReact = (() => {
32484
32484
  var import_react4 = __toESM(require_react(), 1);
32485
32485
  var import_react_dom = __toESM(require_react_dom(), 1);
32486
32486
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
32487
- function useOverlayHolder(Component, options = {}) {
32487
+ function useOverlayHolder(component, options = {}) {
32488
32488
  const { callback, scripts, props, refresh } = useRefreshMetadata();
32489
32489
  const name = defineName(options.id, options.autoIncrement);
32490
32490
  function render() {
32491
32491
  const root = options.root || (typeof document !== "undefined" ? document.body : void 0);
32492
+ const Comp = component;
32492
32493
  const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id: name, children: [
32493
32494
  " ",
32494
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...props }),
32495
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...props }),
32495
32496
  " "
32496
32497
  ] });
32497
32498
  return options.root !== false && root ? (0, import_react_dom.createPortal)(content, root) : content;
@@ -32534,7 +32535,7 @@ var OverlaysReact = (() => {
32534
32535
  return { callback, scripts, props, refresh };
32535
32536
  }
32536
32537
 
32537
- // src/composable/overlay.tsx
32538
+ // src/composable/inject.tsx
32538
32539
  var import_react5 = __toESM(require_react(), 1);
32539
32540
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
32540
32541
  var { define } = createConstructor((Instance, props, options) => {
@@ -32555,7 +32556,7 @@ var OverlaysReact = (() => {
32555
32556
  }
32556
32557
  render(InstanceWithProvider, props);
32557
32558
  }, { container: false });
32558
- function useOverlay(Instance) {
32559
+ function useOverlayInject(Instance) {
32559
32560
  const { render, vanish } = (0, import_react5.useContext)(InstancesContext);
32560
32561
  return define(Instance, { render, vanish });
32561
32562
  }
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ function defineAnonymousComponent(component) {
23
23
  }
24
24
 
25
25
  // src/composable/define.ts
26
- function useOverlayDefine(options = {}) {
26
+ function useDefineOverlay(options = {}) {
27
27
  const { immediate = true, duration = 0, automatic = true } = options;
28
28
  const context = useContext(ScriptsContext);
29
29
  const dec = Reflect.get(context, "in_dec");
@@ -92,14 +92,15 @@ import { pascalCase } from "pascal-case";
92
92
  import { useRef, useState as useState2 } from "react";
93
93
  import { createPortal } from "react-dom";
94
94
  import { jsx, jsxs } from "react/jsx-runtime";
95
- function useOverlayHolder(Component, options = {}) {
95
+ function useOverlayHolder(component, options = {}) {
96
96
  const { callback, scripts, props, refresh } = useRefreshMetadata();
97
97
  const name = defineName(options.id, options.autoIncrement);
98
98
  function render() {
99
99
  const root = options.root || (typeof document !== "undefined" ? document.body : void 0);
100
+ const Comp = component;
100
101
  const content = /* @__PURE__ */ jsxs("div", { id: name, children: [
101
102
  " ",
102
- /* @__PURE__ */ jsx(Component, { ...props }),
103
+ /* @__PURE__ */ jsx(Comp, { ...props }),
103
104
  " "
104
105
  ] });
105
106
  return options.root !== false && root ? createPortal(content, root) : content;
@@ -142,7 +143,7 @@ function useRefreshMetadata() {
142
143
  return { callback, scripts, props, refresh };
143
144
  }
144
145
 
145
- // src/composable/overlay.tsx
146
+ // src/composable/inject.tsx
146
147
  import { createConstructor } from "@overlastic/core";
147
148
  import { useContext as useContext2 } from "react";
148
149
  import { pascalCase as pascalCase2 } from "pascal-case";
@@ -165,7 +166,7 @@ var { define } = createConstructor((Instance, props, options) => {
165
166
  }
166
167
  render(InstanceWithProvider, props);
167
168
  }, { container: false });
168
- function useOverlay(Instance) {
169
+ function useOverlayInject(Instance) {
169
170
  const { render, vanish } = useContext2(InstancesContext);
170
171
  return define(Instance, { render, vanish });
171
172
  }
@@ -222,7 +223,7 @@ export {
222
223
  OverlayProvider,
223
224
  defineOverlay,
224
225
  renderOverlay,
225
- useOverlay,
226
- useOverlayDefine,
227
- useOverlayHolder
226
+ useDefineOverlay,
227
+ useOverlayHolder,
228
+ useOverlayInject
228
229
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@overlastic/react",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.6.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/hairyf/overlastic#readme",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "pascal-case": "3.1.2",
33
33
  "react": "^18.3.1",
34
34
  "react-dom": "^18.3.1",
35
- "@overlastic/core": "^0.5.0"
35
+ "@overlastic/core": "^0.6.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "^18.3.2",