@archbee/app-widget 1.1.28 → 1.1.30

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
@@ -95,20 +95,21 @@ ReactDOM.render(<App />, appElement);
95
95
 
96
96
  ## Component Props
97
97
 
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
- | `anchor` | `string` | `optional` | You can provide your `class`, `id` or `path` to a DOM element where you would like the widget to anchor and instantiate. The container provided should have `position: relative` as the widget will be displayed based on the first relative parent found. |
110
- | `onWidgetOpen` | `void` | `optional` | Callback that is called after widget opens. |
111
- | `onWidgetClose` | `void` | `optional` | Callback that is called after widget closes. |
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
+ | `anchor` | `string` | `optional` | You can provide your `class`, `id` or `path` to a DOM element where you would like the widget to anchor and instantiate. The container provided should have `position: relative` as the widget will be displayed based on the first relative parent found. |
110
+ | `onWidgetOpen` | `void` | `optional` | Callback that is called after widget opens. |
111
+ | `onWidgetClose` | `void` | `optional` | Callback that is called after widget closes. |
112
+ | `hideNavbar` | `boolean` | `optional` | Default value is `false`. It hides the header navbar from the modal. |
112
113
 
113
114
  ## Bubble
114
115
 
package/index.esm.js CHANGED
@@ -321,7 +321,9 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
321
321
  source: 'https://github.com/zloirock/core-js'
322
322
  });
323
323
 
324
- var store$2 = sharedStore.exports;
324
+ var sharedStoreExports = sharedStore.exports;
325
+
326
+ var store$2 = sharedStoreExports;
325
327
 
326
328
  var shared$3 = function (key, value) {
327
329
  return store$2[key] || (store$2[key] = value || {});
@@ -563,7 +565,7 @@ var functionName = {
563
565
 
564
566
  var uncurryThis$5 = functionUncurryThis;
565
567
  var isCallable$6 = isCallable$c;
566
- var store$1 = sharedStore.exports;
568
+ var store$1 = sharedStoreExports;
567
569
 
568
570
  var functionToString = uncurryThis$5(Function.toString);
569
571
 
@@ -599,7 +601,7 @@ var global$3 = global$b;
599
601
  var isObject$2 = isObject$7;
600
602
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
601
603
  var hasOwn$6 = hasOwnProperty_1;
602
- var shared = sharedStore.exports;
604
+ var shared = sharedStoreExports;
603
605
  var sharedKey$2 = sharedKey$3;
604
606
  var hiddenKeys$3 = hiddenKeys$4;
605
607
 
@@ -720,9 +722,11 @@ Function.prototype.toString = makeBuiltIn$1(function toString() {
720
722
  return isCallable$4(this) && getInternalState(this).source || inspectSource(this);
721
723
  }, 'toString');
722
724
 
725
+ var makeBuiltInExports = makeBuiltIn$2.exports;
726
+
723
727
  var isCallable$3 = isCallable$c;
724
728
  var definePropertyModule$3 = objectDefineProperty;
725
- var makeBuiltIn = makeBuiltIn$2.exports;
729
+ var makeBuiltIn = makeBuiltInExports;
726
730
  var defineGlobalProperty$1 = defineGlobalProperty$3;
727
731
 
728
732
  var defineBuiltIn$1 = function (O, key, value, options) {
@@ -1173,6 +1177,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1173
1177
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1174
1178
  PERFORMANCE OF THIS SOFTWARE.
1175
1179
  ***************************************************************************** */
1180
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1181
+
1176
1182
 
1177
1183
  function __rest(s, e) {
1178
1184
  var t = {};
@@ -1212,7 +1218,7 @@ const initJsScripts = loadingStrategy => {
1212
1218
  const script = document.getElementsByTagName('script')[0];
1213
1219
  (_a = script === null || script === void 0 ? void 0 : script.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(scripttag, script);
1214
1220
  };
1215
- const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', bubblePlaceholder, anchor, showNavbar = true) => {
1221
+ const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', bubblePlaceholder, anchor, hideNavbar = true) => {
1216
1222
  if (!window._archbee) {
1217
1223
  window._archbee = window._archbee || {
1218
1224
  queue: [],
@@ -1228,7 +1234,7 @@ const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'la
1228
1234
  bubble,
1229
1235
  bubblePlaceholder,
1230
1236
  anchor,
1231
- showNavbar
1237
+ hideNavbar
1232
1238
  });
1233
1239
  initJsScripts(loadingStrategy);
1234
1240
  }
@@ -1713,8 +1719,8 @@ const iterateProxy = (proxy, component) => {
1713
1719
  } else {
1714
1720
  window._archbee.widget.widgetType = 'docs';
1715
1721
  }
1716
- if (Object.keys(event).includes('showNavbar')) {
1717
- window._archbee.widget.showNavbar = event.showNavbar;
1722
+ if (Object.keys(event).includes('hideNavbar')) {
1723
+ window._archbee.widget.hideNavbar = event.hideNavbar;
1718
1724
  }
1719
1725
  window.dispatchEvent(showWidgetEvent());
1720
1726
  }
@@ -1739,7 +1745,7 @@ const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1739
1745
  blockId,
1740
1746
  widgetType = 'docs',
1741
1747
  loadingStrategy = 'lazy',
1742
- showNavbar = true,
1748
+ hideNavbar = false,
1743
1749
  onWidgetOpen,
1744
1750
  onWidgetClose,
1745
1751
  bubble,
@@ -1747,12 +1753,12 @@ const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1747
1753
  anchor,
1748
1754
  children
1749
1755
  } = _a,
1750
- rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "showNavbar", "onWidgetOpen", "onWidgetClose", "bubble", "bubblePlaceholder", "anchor", "children"]);
1756
+ rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "hideNavbar", "onWidgetOpen", "onWidgetClose", "bubble", "bubblePlaceholder", "anchor", "children"]);
1751
1757
  const elementRef = useRef(null);
1752
1758
  const widgetInstance = useMemo(() => {
1753
1759
  if (typeof window === 'undefined') return;
1754
- return createArchbeeWidget(spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, showNavbar);
1755
- }, [spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, showNavbar]);
1760
+ return createArchbeeWidget(spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar);
1761
+ }, [spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar]);
1756
1762
  useImperativeHandle(ref, () => {
1757
1763
  return {
1758
1764
  open: onOpenWidget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archbee/app-widget",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "author": {
@@ -37,5 +37,6 @@
37
37
  },
38
38
  "module": "./index.esm.js",
39
39
  "type": "module",
40
- "main": "./index.esm.js"
41
- }
40
+ "main": "./index.esm.js",
41
+ "types": "./index.esm.d.ts"
42
+ }
package/src/lib/main.d.ts CHANGED
@@ -4,16 +4,16 @@ type CommonWidgetData = Omit<AbWidgetData, 'spaceId' | 'isOpen' | 'eventType' |
4
4
  export declare const ArchbeeAppWidget: import("react").ForwardRefExoticComponent<{
5
5
  spaceId: string;
6
6
  user?: {
7
- [key: string]: any;
8
7
  id: string;
9
- email?: string | undefined;
10
- first_name?: string | undefined;
11
- last_name?: string | undefined;
12
- profile_image_url?: string | undefined;
13
- } | undefined;
14
- onWidgetOpen?: Function | undefined;
15
- onWidgetClose?: Function | undefined;
8
+ email?: string;
9
+ first_name?: string;
10
+ last_name?: string;
11
+ profile_image_url?: string;
12
+ [key: string]: any;
13
+ };
14
+ onWidgetOpen?: Function;
15
+ onWidgetClose?: Function;
16
16
  } & CommonWidgetData & HTMLAttributes<HTMLDivElement> & {
17
- children?: import("react").ReactNode;
17
+ children?: import("react").ReactNode | undefined;
18
18
  } & import("react").RefAttributes<AbWidgetRef>>;
19
19
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { BubbleType, LoadingStrategy } from '../types';
2
2
  export declare const initScripts: () => void;
3
3
  export declare const initJsScripts: (loadingStrategy: LoadingStrategy) => void;
4
- export declare const createArchbeeWidget: (spaceId: string, jwt?: string, shareableToken?: string, loadingStrategy?: LoadingStrategy, bubble?: BubbleType, bubblePlaceholder?: string, anchor?: string, showNavbar?: boolean) => any;
4
+ export declare const createArchbeeWidget: (spaceId: string, jwt?: string, shareableToken?: string, loadingStrategy?: LoadingStrategy, bubble?: BubbleType, bubblePlaceholder?: string, anchor?: string, hideNavbar?: boolean) => any;
@@ -24,7 +24,7 @@ export interface AbWidgetData {
24
24
  shareableToken?: string;
25
25
  widgetType?: WidgetType;
26
26
  bubble?: BubbleType;
27
- showNavbar?: boolean;
27
+ hideNavbar?: boolean;
28
28
  bubblePlaceholder?: string;
29
29
  anchor?: string;
30
30
  loadingStrategy?: LoadingStrategy;