@archbee/app-widget 1.1.24 → 1.1.25

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
@@ -2,18 +2,17 @@
2
2
 
3
3
  ## Table of Contents
4
4
 
5
- * [Installation](#installation)
6
- * [API documentation](#api-documentation)
7
- * [Examples](#examples)
5
+ - [Installation](#installation)
6
+ - [API documentation](#api-documentation)
7
+ - [Examples](#examples)
8
8
 
9
9
  ## Installation
10
10
 
11
11
  To install, you can use [npm](https://npmjs.org/) or [yarn](https://yarnpkg.com):
12
12
 
13
-
14
13
  $ npm install --save @archbee/app-widget
15
14
  $ yarn add @archbee/app-widget
16
-
15
+
17
16
  If you need to install Archbee Contextual Widget SDK, you can find more details [here](https://docs.archbee.com/app-widget).
18
17
 
19
18
  ## API documentation
@@ -24,29 +23,29 @@ and gives examples of its usage.
24
23
 
25
24
  ## Examples
26
25
 
27
- Here is a simple example of Archbee React widget being used in an app with some action variations:
26
+ Here is a simple example of Archbee React widget being used in an app with some action variations:
28
27
 
29
28
  ```tsx
30
- import React from 'react';
29
+ import React from 'react'
31
30
  import { ArchbeeAppWidget } from '@archbee/app-widget'
32
31
 
33
32
  function App() {
34
33
  return (
35
34
  <div>
36
- <ArchbeeAppWidget
37
- spaceId={ /** published space id **/ }
38
- onWidgetOpen={() => { /** ... **/ }} // callback function called after widget has open
39
- // onWidgetClose={() => { /** ... **/ }} // callback function called after widget has open
35
+ <ArchbeeAppWidget
36
+ spaceId={/** published space id **/}
37
+ onWidgetOpen={() => {
38
+ /** ... **/
39
+ }} // callback function called after widget has open
40
+ // onWidgetClose={() => { /** ... **/ }} // callback function called after widget has open
40
41
  >
41
- <button type='button'>
42
- Open
43
- </button>
42
+ <button type="button">Open</button>
44
43
  </ArchbeeAppWidget>
45
44
  </div>
46
- );
45
+ )
47
46
  }
48
47
 
49
- ReactDOM.render(<App />, appElement);
48
+ ReactDOM.render(<App />, appElement)
50
49
  ```
51
50
 
52
51
  Can also be used with ref for a more programmatic approach:
@@ -72,14 +71,14 @@ const widgetRef = useRef<AbWidgetRef>(null);
72
71
  }}>
73
72
  Open
74
73
  </button>
75
-
74
+
76
75
  <button type='button' onClick={() => {
77
76
  <!-- Closes widget -->
78
77
  widgetRef.current?.close();
79
78
  }}>
80
79
  Close
81
80
  </button>
82
-
81
+
83
82
  <button type='button' onClick={() => {
84
83
  <!-- Gets the instance of the widget if needed for various event manipulations. -->
85
84
  widgetRef.current?.instance();
@@ -96,20 +95,20 @@ ReactDOM.render(<App />, appElement);
96
95
 
97
96
  ## Component Props
98
97
 
99
- | Property | Type | Required | Description |
100
- |-------------------|------------------|------------|-----------------|
101
- | `spaceId` | `string` | `required` | Pass the desired id to load your docs.
102
- | `docId` | `string` | `optional` | The doc where you want to open the widget docs. If `docId` is passed, `widgetType` is ignored, it will open in docs mode regardless of prop passed.
103
- | `blockId` | `string` | `optional` | The block where you want to scroll, after a certain document was open.
104
- | `jwt` | `string` | `optional` | Pass the jwt token in order to see jwt protected docs.
105
- | `shareableToken` | `string` | `optional` | Pass the shareableToken from your private links to protect your docs.
106
- | `className` | `string` | `optional` | Pass CSS classes to the `div` wrapper
107
- | `widgetType` | `docs \| search` | `optional` | Default value is `docs`. This opens the widget with the desired behaviour. `docs`` type will open the widget with the default behaviour, `search` will open a search widget bar that shows a search bar with AI support (if included in your subscription)
108
- | `bubble` | `ask \| invisible` | `optional` | Default value is `invisible`. This prop will display an ask bubble in the bottom-right of your screen. Whenever someone clicks on it, the search widget will open.
109
- | `loadingStrategy` | `eager \| lazy` | `optional` | Default value is `lazy`. While `lazy` loading delays the initialization of a resource, `eager` loading initializes or loads the widget as soon as the code is executed.
110
- | `onWidgetOpen` | `void` | `optional` | Callback that is called after widget opens.
111
- | `onWidgetClose` | `void` | `optional` | Callback that is called after widget closes.
112
-
98
+ | Property | Type | Required | Description |
99
+ | ----------------- | ------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
100
+ | `spaceId` | `string` | `required` | Pass the desired id to load your docs. |
101
+ | `docId` | `string` | `optional` | The doc where you want to open the widget docs. If `docId` is passed, `widgetType` is ignored, it will open in docs mode regardless of prop passed. |
102
+ | `blockId` | `string` | `optional` | The block where you want to scroll, after a certain document was open. |
103
+ | `jwt` | `string` | `optional` | Pass the jwt token in order to see jwt protected docs. |
104
+ | `shareableToken` | `string` | `optional` | Pass the shareableToken from your private links to protect your docs. |
105
+ | `className` | `string` | `optional` | Pass CSS classes to the `div` wrapper |
106
+ | `widgetType` | `docs \| search` | `optional` | Default value is `docs`. This opens the widget with the desired behaviour. ` docs`` type will open the widget with the default behaviour, `search` will open a search widget bar that shows a search bar with AI support (if included in your subscription) |
107
+ | `bubble` | `ask \| invisible` | `optional` | Default value is `invisible`. This prop will display an ask bubble in the bottom-right of your screen. Whenever someone clicks on it, the search widget will open. |
108
+ | `loadingStrategy` | `eager \| lazy` | `optional` | Default value is `lazy`. While `lazy` loading delays the initialization of a resource, `eager` loading initializes or loads the widget as soon as the code is executed. |
109
+ | `onWidgetOpen` | `void` | `optional` | Callback that is called after widget opens. |
110
+ | `onWidgetClose` | `void` | `optional` | Callback that is called after widget closes. |
111
+
113
112
  ## Bubble
114
113
 
115
114
  Use `bubble` prop whenever you want an easy search button to browse your entire documentation.
@@ -118,17 +117,17 @@ Use `bubble` prop whenever you want an easy search button to browse your entire
118
117
 
119
118
  ## Ref Methods
120
119
 
121
- If `ref` is not passed to `ArchbeeAppWidget`, the children will automatically open the modal popup upon click.
120
+ If `ref` is not passed to `ArchbeeAppWidget`, the children will automatically open the modal popup upon click.
122
121
 
123
- | Property | Type | Description |
124
- |------------|----------|-----------------|
125
- | `open` | `method` | Opens widget programatically.
126
- | `close` | `method` | Closes widget programatically.
127
- | `instance` | `method` | Returns the instance of the widget.
122
+ | Property | Type | Description |
123
+ | ---------- | -------- | ----------------------------------- |
124
+ | `open` | `method` | Opens widget programatically. |
125
+ | `close` | `method` | Closes widget programatically. |
126
+ | `instance` | `method` | Returns the instance of the widget. |
128
127
 
129
128
  ## Demos
130
129
 
131
130
  Down below is a demo setup in [CodeSandbox](https://codesandbox.io/), which
132
131
  demonstrate various features of archbee-app:
133
132
 
134
- * [Demo](https://codesandbox.io/s/funny-austin-gndp8w?file=/src/App.tsx)
133
+ - [Demo](https://codesandbox.io/s/funny-austin-gndp8w?file=/src/App.tsx)
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";