@apify/docs-theme 1.0.84 → 1.0.86

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -19,9 +19,10 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@docusaurus/theme-common": "^2.3.1",
23
- "axios": "^1.3.1",
24
- "babel-loader": "^9.1.0",
22
+ "@docusaurus/theme-common": "^2.4.1",
23
+ "axios": "^1.4.0",
24
+ "babel-loader": "^9.1.2",
25
+ "docusaurus-gtm-plugin": "^0.0.2",
25
26
  "@stackql/docusaurus-plugin-hubspot": "^1.1.0",
26
27
  "prism-react-renderer": "^1.3.5"
27
28
  },
package/src/config.js CHANGED
@@ -256,18 +256,12 @@ const themeConfig = ({
256
256
 
257
257
  const plugins = [
258
258
  [
259
- '@docusaurus/plugin-google-gtag',
259
+ 'docusaurus-gtm-plugin',
260
260
  {
261
- trackingID: 'UA-67003981-4',
261
+ id: 'GTM-MNGXGGB',
262
262
  },
263
263
  ],
264
264
  '@stackql/docusaurus-plugin-hubspot',
265
- // [
266
- // 'docusaurus-gtm-plugin',
267
- // {
268
- // id: 'GTM-...',
269
- // },
270
- // ],
271
265
  ];
272
266
 
273
267
  module.exports = {
@@ -1,9 +1,8 @@
1
- /* eslint-disable operator-linebreak,import/no-extraneous-dependencies */
2
1
  import React, { useCallback, useMemo, useRef, useState } from 'react';
3
2
  import { DocSearchButton, useDocSearchKeyboardEvents } from '@docsearch/react';
4
3
  import Head from '@docusaurus/Head';
5
4
  import Link from '@docusaurus/Link';
6
- import { useSearchPage } from '@docusaurus/theme-common/internal';
5
+ import { useSearchLinkCreator } from '@docusaurus/theme-common/internal';
7
6
  import { useAlgoliaContextualFacetFilters } from '@docusaurus/theme-search-algolia/client';
8
7
  import { useActiveDocContext } from '@docusaurus/plugin-content-docs/client';
9
8
  import Translate from '@docusaurus/Translate';
@@ -43,7 +42,7 @@ function Hit({ hit, children }) {
43
42
  }
44
43
 
45
44
  function ResultsFooter({ state, onClose }) {
46
- const { generateSearchPageLink } = useSearchPage();
45
+ const generateSearchPageLink = useSearchLinkCreator();
47
46
  return (
48
47
  <A href={generateSearchPageLink(state.query)} onClick={onClose}>
49
48
  <Translate
@@ -65,10 +64,10 @@ function DocSearch({ contextualSearch, externalUrlRegex, ...props }) {
65
64
  const contextualSearchFacetFilters = useAlgoliaContextualFacetFilters();
66
65
  const configFacetFilters = props.searchParameters?.facetFilters ?? [];
67
66
  const facetFilters = contextualSearch
68
- ? // Merge contextual search filters with config filters
69
- mergeFacetFilters(contextualSearchFacetFilters, configFacetFilters)
70
- : // ... or use config facetFilters
71
- configFacetFilters;
67
+ // Merge contextual search filters with config filters
68
+ ? mergeFacetFilters(contextualSearchFacetFilters, configFacetFilters)
69
+ // ... or use config facetFilters
70
+ : configFacetFilters;
72
71
 
73
72
  const tags = facetFilters[facetFilters.length - 1];
74
73
  const docsPluginId = siteConfig.presets[0][1].docs.id ?? 'default';
@@ -139,9 +138,8 @@ function DocSearch({ contextualSearch, externalUrlRegex, ...props }) {
139
138
  return item;
140
139
  }))).current;
141
140
  const resultsFooterComponent = useMemo(
142
- () =>
143
- // eslint-disable-next-line react/no-unstable-nested-components,react/display-name,implicit-arrow-linebreak
144
- (footerProps) => <ResultsFooter {...footerProps} onClose={onClose}/>,
141
+ // eslint-disable-next-line react/display-name
142
+ () => (footerProps) => <ResultsFooter {...footerProps} onClose={onClose}/>,
145
143
  [onClose],
146
144
  );
147
145
  const transformSearchClient = useCallback(
@@ -12,7 +12,7 @@ import {
12
12
  usePluralForm,
13
13
  } from '@docusaurus/theme-common';
14
14
  import {
15
- useSearchPage,
15
+ useSearchQueryString,
16
16
  useTitleFormatter,
17
17
  } from '@docusaurus/theme-common/internal';
18
18
  import Translate, { translate } from '@docusaurus/Translate';
@@ -119,7 +119,7 @@ function SearchPageContent() {
119
119
  const processSearchResultUrl = useSearchResultUrlProcessor();
120
120
  const documentsFoundPlural = useDocumentsFoundPlural();
121
121
  const docsSearchVersionsHelpers = useDocsSearchVersionsHelpers();
122
- const { searchQuery, setSearchQuery } = useSearchPage();
122
+ const [searchQuery, setSearchQuery] = useSearchQueryString();
123
123
  const initialSearchResultState = {
124
124
  items: [],
125
125
  query: null,
@@ -401,7 +401,6 @@ function SearchPageContent() {
401
401
  key={index}
402
402
  className="breadcrumbs__item"
403
403
  // Developer provided the HTML, so assume it's safe.
404
- // eslint-disable-next-line react/no-danger
405
404
  dangerouslySetInnerHTML={{ __html: html }}
406
405
  />
407
406
  ))}
@@ -413,7 +412,6 @@ function SearchPageContent() {
413
412
  <p
414
413
  className={styles.searchResultItemSummary}
415
414
  // Developer provided the HTML, so assume it's safe.
416
- // eslint-disable-next-line react/no-danger
417
415
  dangerouslySetInnerHTML={{ __html: summary }}
418
416
  />
419
417
  )}