Skip to content

Commit

Permalink
feat: update component provider name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr.Mao committed Jul 20, 2024
1 parent d4ae28d commit 3ab7db1
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 25 deletions.
6 changes: 3 additions & 3 deletions docs/react/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Obtaining the current node's context can be quite cumbersome when there is a Con
Therefore, we provide the following components and hooks support:

```tsx
import { OverlayProvider } from '@overlastic/react'
import { OverlaysProvider } from '@overlastic/react'

function Main() {
return (
<OverlayProvider>
<OverlaysProvider>
<App />
</OverlayProvider>
</OverlaysProvider>
)
}

Expand Down
6 changes: 3 additions & 3 deletions docs/vue/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Therefore, we provide the following components and hooks support:

```vue
<script setup>
import { OverlayProvider } from '@overlastic/react'
import { OverlaysProvider } from '@overlastic/react'
</script>
<template>
<OverlayProvider>
<OverlaysProvider>
<App />
</OverlayProvider>
</OverlaysProvider>
</template>
```

Expand Down
6 changes: 3 additions & 3 deletions docs/zh/react/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
所以我们提供了以下的组件与钩子支持:

```tsx
import { OverlayProvider } from '@overlastic/react'
import { OverlaysProvider } from '@overlastic/react'

function Main() {
return (
<OverlayProvider>
<OverlaysProvider>
<App />
</OverlayProvider>
</OverlaysProvider>
)
}
export default Main
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/vue/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

```vue
<script setup>
import { OverlayProvider } from '@overlastic/react'
import { OverlaysProvider } from '@overlastic/react'
</script>
<template>
<OverlayProvider>
<OverlaysProvider>
<App />
</OverlayProvider>
</OverlaysProvider>
</template>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Instance {
props: any
}

export function OverlayProvider(props: PropsWithChildren) {
export function OverlaysProvider(props: PropsWithChildren) {
const [instances, setInstances] = useState<Instance[]>([])

function render(Instance: FC<any>, props: any) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@react/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './OverlayProvider'
export * from './Provider'
2 changes: 1 addition & 1 deletion packages/@react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export {
useOverlayInject,
} from './composable'
export { defineOverlay, renderOverlay } from './define'
export { OverlayProvider } from './components'
export { OverlaysProvider } from './components'
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Instance {
props: any
}

export const OverlayProvider = defineComponent({
export const OverlaysProvider = defineComponent({
setup(_, { slots }) {
const instances = ref<Instance[]>([])
function render(Instance: Component, props: any) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './Field'
export * from './OverlayProvider'
export * from './Provider'
1 change: 0 additions & 1 deletion packages/@vue/src/composable/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export function useExtendOverlay(options: ExtendOverlayOptions = {}) {
vanish?.()
return Promise.resolve()
}

if (!dec && automatic)
deferred?.then(destroy).catch(destroy)
if (!dec && immediate)
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const unoverlay = { install }
export type { ExtendOverlayOptions, ExtendOverlayReturn, InjectionHolder } from './composable'
export { useExtendOverlay, useOverlayHolder, useOverlayInject } from './composable'
export { defineOverlay, renderOverlay } from './define'
export { Field, OverlayProvider } from './components'
export { Field, OverlaysProvider } from './components'
export { install }

export default unoverlay
6 changes: 3 additions & 3 deletions playgrounds/react/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { OverlayProvider } from '@overlastic/react'
import { OverlaysProvider } from '@overlastic/react'
import App from './App.tsx'
import './index.css'

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<OverlayProvider>
<OverlaysProvider>
<App />
</OverlayProvider>
</OverlaysProvider>
</React.StrictMode>,
)
6 changes: 3 additions & 3 deletions playgrounds/vue/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import { OverlayProvider } from '@overlastic/vue'
import { OverlaysProvider } from '@overlastic/vue'
import ProviderContainer from './components/provider-container.vue'
</script>

<template>
<OverlayProvider>
<OverlaysProvider>
<ProviderContainer :duration="300" />
</OverlayProvider>
</OverlaysProvider>
</template>

<style scoped>
Expand Down

0 comments on commit 3ab7db1

Please sign in to comment.