@archbee/app-widget 1.1.1 → 1.1.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/README.md +2 -5
- package/package.json +1 -1
- package/types.d.ts +2 -2
package/README.md
CHANGED
|
@@ -53,10 +53,10 @@ Can also be used with ref for a more programmatic approach:
|
|
|
53
53
|
|
|
54
54
|
```tsx
|
|
55
55
|
import React from 'react';
|
|
56
|
-
import { ArchbeeAppWidget,
|
|
56
|
+
import { ArchbeeAppWidget, AbWidgetRef } from '@archbee/app-widget'
|
|
57
57
|
|
|
58
58
|
function App() {
|
|
59
|
-
const widgetRef = useRef<
|
|
59
|
+
const widgetRef = useRef<AbWidgetRef>(null);
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<div>
|
|
@@ -96,9 +96,6 @@ ReactDOM.render(<App />, appElement);
|
|
|
96
96
|
|
|
97
97
|
If `ref` is not passed to `ArchbeeAppWidget`, the children will automatically open the modal popup upon click.
|
|
98
98
|
|
|
99
|
-
You can find more examples in the `examples` directory, which you can run in a
|
|
100
|
-
local development server using `npm start` or `yarn run start`.
|
|
101
|
-
|
|
102
99
|
## Demos
|
|
103
100
|
|
|
104
101
|
Down below is a demo setup in [CodePen](https://codepen.io), which
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface AbWidgetData {
|
|
|
31
31
|
widgetType?: ScreenType;
|
|
32
32
|
}
|
|
33
33
|
type ScreenType = 'docs' | 'search';
|
|
34
|
-
export interface
|
|
34
|
+
export interface AbWidgetRef {
|
|
35
35
|
open: () => void;
|
|
36
36
|
close: () => void;
|
|
37
37
|
instance: () => ArchbeeWidgetInstance;
|
|
@@ -57,4 +57,4 @@ type Props = {
|
|
|
57
57
|
};
|
|
58
58
|
export const ArchbeeAppWidget: React.ForwardRefExoticComponent<Props & {
|
|
59
59
|
children?: React.ReactNode;
|
|
60
|
-
} & React.RefAttributes<
|
|
60
|
+
} & React.RefAttributes<AbWidgetRef>>;
|