@archbee/app-widget 1.1.28 → 1.1.29

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
@@ -1195,7 +1195,7 @@ const initScripts = () => {
1195
1195
  var _a;
1196
1196
  const widgetcsslink = document.createElement('link');
1197
1197
  const link = document.getElementsByTagName('link')[0];
1198
- const mainUrl = "https://widget.archbee.com/v1";
1198
+ const mainUrl = undefined;
1199
1199
  widgetcsslink['rel'] = 'stylesheet';
1200
1200
  widgetcsslink['href'] = `${mainUrl}/main.css`;
1201
1201
  if (!link) {
@@ -1205,14 +1205,14 @@ const initScripts = () => {
1205
1205
  };
1206
1206
  const initJsScripts = loadingStrategy => {
1207
1207
  var _a;
1208
- const mainUrl = "https://widget.archbee.com/v1";
1208
+ const mainUrl = undefined;
1209
1209
  let scripttag = document.createElement('script');
1210
1210
  scripttag['async'] = loadingStrategy === 'lazy';
1211
1211
  scripttag['src'] = `${mainUrl}/main.js`;
1212
1212
  const script = document.getElementsByTagName('script')[0];
1213
1213
  (_a = script === null || script === void 0 ? void 0 : script.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(scripttag, script);
1214
1214
  };
1215
- const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', bubblePlaceholder, anchor, showNavbar = true) => {
1215
+ const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', bubblePlaceholder, anchor, hideNavbar = true) => {
1216
1216
  if (!window._archbee) {
1217
1217
  window._archbee = window._archbee || {
1218
1218
  queue: [],
@@ -1228,7 +1228,7 @@ const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'la
1228
1228
  bubble,
1229
1229
  bubblePlaceholder,
1230
1230
  anchor,
1231
- showNavbar
1231
+ hideNavbar
1232
1232
  });
1233
1233
  initJsScripts(loadingStrategy);
1234
1234
  }
@@ -1713,8 +1713,8 @@ const iterateProxy = (proxy, component) => {
1713
1713
  } else {
1714
1714
  window._archbee.widget.widgetType = 'docs';
1715
1715
  }
1716
- if (Object.keys(event).includes('showNavbar')) {
1717
- window._archbee.widget.showNavbar = event.showNavbar;
1716
+ if (Object.keys(event).includes('hideNavbar')) {
1717
+ window._archbee.widget.hideNavbar = event.hideNavbar;
1718
1718
  }
1719
1719
  window.dispatchEvent(showWidgetEvent());
1720
1720
  }
@@ -1739,7 +1739,7 @@ const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1739
1739
  blockId,
1740
1740
  widgetType = 'docs',
1741
1741
  loadingStrategy = 'lazy',
1742
- showNavbar = true,
1742
+ hideNavbar = false,
1743
1743
  onWidgetOpen,
1744
1744
  onWidgetClose,
1745
1745
  bubble,
@@ -1747,12 +1747,12 @@ const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1747
1747
  anchor,
1748
1748
  children
1749
1749
  } = _a,
1750
- rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "showNavbar", "onWidgetOpen", "onWidgetClose", "bubble", "bubblePlaceholder", "anchor", "children"]);
1750
+ rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "hideNavbar", "onWidgetOpen", "onWidgetClose", "bubble", "bubblePlaceholder", "anchor", "children"]);
1751
1751
  const elementRef = useRef(null);
1752
1752
  const widgetInstance = useMemo(() => {
1753
1753
  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]);
1754
+ return createArchbeeWidget(spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar);
1755
+ }, [spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar]);
1756
1756
  useImperativeHandle(ref, () => {
1757
1757
  return {
1758
1758
  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.29",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "author": {
@@ -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;