@widlarzgroup/docusaurus-ui 0.1.2 → 0.1.3

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.
@@ -8,10 +8,10 @@ const Link_1 = __importDefault(require("@docusaurus/Link"));
8
8
  const router_1 = require("@docusaurus/router");
9
9
  const ProFeature_module_css_1 = __importDefault(require("./ProFeature.module.css"));
10
10
  const ProBadge_1 = __importDefault(require("../../components/ProBadge/ProBadge"));
11
- const ProFeature = ({ title = 'Pro Player Feature', description = 'This feature is available exclusively in Pro Player. To access this functionality, please contact us.', }) => {
11
+ const ProFeature = ({ title = "Pro Player Feature", description = "This feature is available exclusively in Pro Player. To access this functionality, please contact us.", }) => {
12
12
  const location = (0, router_1.useLocation)();
13
13
  const utmContent = encodeURIComponent(location.pathname);
14
- const contactUrl = `https://thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}#Contact`;
14
+ const contactUrl = `https://sdk.thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}&contact=true`;
15
15
  const learnMoreUrl = `https://sdk.thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}`;
16
16
  return ((0, jsx_runtime_1.jsx)("div", { className: ProFeature_module_css_1.default.container, children: (0, jsx_runtime_1.jsxs)("div", { className: ProFeature_module_css_1.default.content, children: [(0, jsx_runtime_1.jsx)("div", { className: ProFeature_module_css_1.default.header, children: (0, jsx_runtime_1.jsxs)("div", { className: ProFeature_module_css_1.default.badge, children: [(0, jsx_runtime_1.jsx)(ProBadge_1.default, {}), (0, jsx_runtime_1.jsx)("span", { className: ProFeature_module_css_1.default.badgeText, children: title })] }) }), (0, jsx_runtime_1.jsx)("p", { className: ProFeature_module_css_1.default.description, children: description }), (0, jsx_runtime_1.jsxs)("div", { className: ProFeature_module_css_1.default.actions, children: [(0, jsx_runtime_1.jsx)(Link_1.default, { to: contactUrl, className: ProFeature_module_css_1.default.primaryButton, children: "Contact Us" }), (0, jsx_runtime_1.jsx)(Link_1.default, { to: learnMoreUrl, className: ProFeature_module_css_1.default.secondaryButton, children: "Learn More" })] })] }) }));
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ProFeature.js","sourceRoot":"","sources":["../../../src/components/ProFeature/ProFeature.tsx"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,+CAA+C;AAC/C,oFAA6C;AAC7C,8EAAsD;AAOtD,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,GAAG,oBAAoB,EAC5B,WAAW,GAAG,uGAAuG,GACrG,EAAE,EAAE;IACpB,MAAM,QAAQ,GAAG,IAAA,oBAAW,GAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEzD,MAAM,UAAU,GAAG,2GAA2G,UAAU,UAAU,CAAC;IACnJ,MAAM,YAAY,GAAG,+GAA+G,UAAU,EAAE,CAAC;IAEjJ,OAAO,CACL,gCAAK,SAAS,EAAE,+BAAM,CAAC,SAAS,YAC9B,iCAAK,SAAS,EAAE,+BAAM,CAAC,OAAO,aAC5B,gCAAK,SAAS,EAAE,+BAAM,CAAC,MAAM,YAC3B,iCAAK,SAAS,EAAE,+BAAM,CAAC,KAAK,aAC1B,uBAAC,kBAAQ,KAAG,EACZ,iCAAM,SAAS,EAAE,+BAAM,CAAC,SAAS,YAAG,KAAK,GAAQ,IAC7C,GACF,EACN,8BAAG,SAAS,EAAE,+BAAM,CAAC,WAAW,YAAG,WAAW,GAAK,EACnD,iCAAK,SAAS,EAAE,+BAAM,CAAC,OAAO,aAC5B,uBAAC,cAAI,IAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,+BAAM,CAAC,aAAa,2BAE9C,EACP,uBAAC,cAAI,IAAC,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,+BAAM,CAAC,eAAe,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":3,"file":"TWGBadge.d.ts","sourceRoot":"","sources":["../../../src/components/TWGBadge/TWGBadge.tsx"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,QAAQ,uBAAwB,aAAa,4CAkBlD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TWGBadge.d.ts","sourceRoot":"","sources":["../../../src/components/TWGBadge/TWGBadge.tsx"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,QAAQ,uBAAwB,aAAa,4CA2BlD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -4,12 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useDocVersion_1 = require("../../hooks/useDocVersion");
7
8
  const TWGBadge_module_css_1 = __importDefault(require("./TWGBadge.module.css"));
8
9
  const TWGBadge = ({ visibleOnLarge }) => {
10
+ const version = (0, useDocVersion_1.useDocVersion)();
9
11
  const visibilityClass = visibleOnLarge
10
12
  ? TWGBadge_module_css_1.default.visibleOnLarge
11
13
  : TWGBadge_module_css_1.default.visibleOnSmall;
12
- return ((0, jsx_runtime_1.jsxs)("div", { className: [TWGBadge_module_css_1.default.extraContainer, visibilityClass].join(' '), children: [(0, jsx_runtime_1.jsx)("span", { className: TWGBadge_module_css_1.default.extraText, children: "We are TheWidlarzGroup" }), (0, jsx_runtime_1.jsx)("a", { target: "_blank", href: "https://www.thewidlarzgroup.com/?utm_source=rnv&utm_medium=docs&utm_campaign=badge&utm_id=enterprise#Contact", className: TWGBadge_module_css_1.default.extraButton, rel: "noreferrer", children: "Premium support \u2192" })] }));
14
+ const href = version === "v7"
15
+ ? "/react-native-video/docs/v7/offer"
16
+ : "https://sdk.thewidlarzgroup.com/?utm_source=rnv&utm_medium=docs&utm_campaign=badge&utm_id=enterprise&contact=true";
17
+ const isExternal = version !== "v7";
18
+ return ((0, jsx_runtime_1.jsxs)("div", { className: [TWGBadge_module_css_1.default.extraContainer, visibilityClass].join(" "), children: [(0, jsx_runtime_1.jsx)("span", { className: TWGBadge_module_css_1.default.extraText, children: "We are TheWidlarzGroup" }), (0, jsx_runtime_1.jsx)("a", { target: isExternal ? "_blank" : undefined, href: href, className: TWGBadge_module_css_1.default.extraButton, rel: isExternal ? "noreferrer" : undefined, children: "Premium support \u2192" })] }));
13
19
  };
14
20
  exports.default = TWGBadge;
15
21
  //# sourceMappingURL=TWGBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TWGBadge.js","sourceRoot":"","sources":["../../../src/components/TWGBadge/TWGBadge.tsx"],"names":[],"mappings":";;;;;;AAAA,gFAA2C;AAM3C,MAAM,QAAQ,GAAG,CAAC,EAAE,cAAc,EAAiB,EAAE,EAAE;IACrD,MAAM,eAAe,GAAG,cAAc;QACpC,CAAC,CAAC,6BAAM,CAAC,cAAc;QACvB,CAAC,CAAC,6BAAM,CAAC,cAAc,CAAC;IAE1B,OAAO,CACL,iCAAK,SAAS,EAAE,CAAC,6BAAM,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAChE,iCAAM,SAAS,EAAE,6BAAM,CAAC,SAAS,uCAA+B,EAChE,8BACE,MAAM,EAAC,QAAQ,EACf,IAAI,EAAC,8GAA8G,EACnH,SAAS,EAAE,6BAAM,CAAC,WAAW,EAC7B,GAAG,EAAC,YAAY,uCAGd,IACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TWGBadge.js","sourceRoot":"","sources":["../../../src/components/TWGBadge/TWGBadge.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAAsD;AACtD,gFAA2C;AAM3C,MAAM,QAAQ,GAAG,CAAC,EAAE,cAAc,EAAiB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,IAAA,6BAAa,GAAE,CAAC;IAEhC,MAAM,eAAe,GAAG,cAAc;QACpC,CAAC,CAAC,6BAAM,CAAC,cAAc;QACvB,CAAC,CAAC,6BAAM,CAAC,cAAc,CAAC;IAE1B,MAAM,IAAI,GACR,OAAO,KAAK,IAAI;QACd,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,mHAAmH,CAAC;IAE1H,MAAM,UAAU,GAAG,OAAO,KAAK,IAAI,CAAC;IAEpC,OAAO,CACL,iCAAK,SAAS,EAAE,CAAC,6BAAM,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAChE,iCAAM,SAAS,EAAE,6BAAM,CAAC,SAAS,uCAA+B,EAChE,8BACE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACzC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,6BAAM,CAAC,WAAW,EAC7B,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,uCAGxC,IACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,14 @@
1
+ type DocVersion = "v6" | "v7" | null;
2
+ /**
3
+ * Hook that detects the documentation version (v6 or v7) from the current URL.
4
+ *
5
+ * @example
6
+ * // URL: /react-native-video/docs/v7/offer
7
+ * const version = useDocVersion(); // returns "v7"
8
+ *
9
+ * // URL: /react-native-video/docs/v6/basics
10
+ * const version = useDocVersion(); // returns "v6"
11
+ */
12
+ export declare function useDocVersion(): DocVersion;
13
+ export {};
14
+ //# sourceMappingURL=useDocVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocVersion.d.ts","sourceRoot":"","sources":["../../src/hooks/useDocVersion.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAa1C"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDocVersion = useDocVersion;
4
+ const router_1 = require("@docusaurus/router");
5
+ /**
6
+ * Hook that detects the documentation version (v6 or v7) from the current URL.
7
+ *
8
+ * @example
9
+ * // URL: /react-native-video/docs/v7/offer
10
+ * const version = useDocVersion(); // returns "v7"
11
+ *
12
+ * // URL: /react-native-video/docs/v6/basics
13
+ * const version = useDocVersion(); // returns "v6"
14
+ */
15
+ function useDocVersion() {
16
+ const location = (0, router_1.useLocation)();
17
+ const pathname = location.pathname;
18
+ if (pathname.includes("/v7/")) {
19
+ return "v7";
20
+ }
21
+ if (pathname.includes("/v6/")) {
22
+ return "v6";
23
+ }
24
+ return null;
25
+ }
26
+ //# sourceMappingURL=useDocVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocVersion.js","sourceRoot":"","sources":["../../src/hooks/useDocVersion.ts"],"names":[],"mappings":";;AAcA,sCAaC;AA3BD,+CAAiD;AAIjD;;;;;;;;;GASG;AACH,SAAgB,aAAa;IAC3B,MAAM,QAAQ,GAAG,IAAA,oBAAW,GAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAEnC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widlarzgroup/docusaurus-ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,7 +1,7 @@
1
- import Link from '@docusaurus/Link';
2
- import {useLocation} from '@docusaurus/router';
3
- import styles from './ProFeature.module.css';
4
- import ProBadge from '@/components/ProBadge/ProBadge';
1
+ import Link from "@docusaurus/Link";
2
+ import { useLocation } from "@docusaurus/router";
3
+ import styles from "./ProFeature.module.css";
4
+ import ProBadge from "@/components/ProBadge/ProBadge";
5
5
 
6
6
  interface ProFeatureProps {
7
7
  title?: string;
@@ -9,13 +9,13 @@ interface ProFeatureProps {
9
9
  }
10
10
 
11
11
  const ProFeature = ({
12
- title = 'Pro Player Feature',
13
- description = 'This feature is available exclusively in Pro Player. To access this functionality, please contact us.',
12
+ title = "Pro Player Feature",
13
+ description = "This feature is available exclusively in Pro Player. To access this functionality, please contact us.",
14
14
  }: ProFeatureProps) => {
15
15
  const location = useLocation();
16
16
  const utmContent = encodeURIComponent(location.pathname);
17
-
18
- const contactUrl = `https://thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}#Contact`;
17
+
18
+ const contactUrl = `https://sdk.thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}&contact=true`;
19
19
  const learnMoreUrl = `https://sdk.thewidlarzgroup.com/?utm_source=docs&utm_medium=pro-feature&utm_campaign=pro-player&utm_content=${utmContent}`;
20
20
 
21
21
  return (
@@ -1,22 +1,32 @@
1
- import styles from './TWGBadge.module.css';
1
+ import { useDocVersion } from "@/hooks/useDocVersion";
2
+ import styles from "./TWGBadge.module.css";
2
3
 
3
4
  interface TWGBadgeProps {
4
5
  visibleOnLarge?: boolean;
5
6
  }
6
7
 
7
8
  const TWGBadge = ({ visibleOnLarge }: TWGBadgeProps) => {
9
+ const version = useDocVersion();
10
+
8
11
  const visibilityClass = visibleOnLarge
9
12
  ? styles.visibleOnLarge
10
13
  : styles.visibleOnSmall;
11
14
 
15
+ const href =
16
+ version === "v7"
17
+ ? "/react-native-video/docs/v7/offer"
18
+ : "https://sdk.thewidlarzgroup.com/?utm_source=rnv&utm_medium=docs&utm_campaign=badge&utm_id=enterprise&contact=true";
19
+
20
+ const isExternal = version !== "v7";
21
+
12
22
  return (
13
- <div className={[styles.extraContainer, visibilityClass].join(' ')}>
23
+ <div className={[styles.extraContainer, visibilityClass].join(" ")}>
14
24
  <span className={styles.extraText}>We are TheWidlarzGroup</span>
15
25
  <a
16
- target="_blank"
17
- href="https://www.thewidlarzgroup.com/?utm_source=rnv&utm_medium=docs&utm_campaign=badge&utm_id=enterprise#Contact"
26
+ target={isExternal ? "_blank" : undefined}
27
+ href={href}
18
28
  className={styles.extraButton}
19
- rel="noreferrer"
29
+ rel={isExternal ? "noreferrer" : undefined}
20
30
  >
21
31
  Premium support →
22
32
  </a>
@@ -0,0 +1,28 @@
1
+ import { useLocation } from "@docusaurus/router";
2
+
3
+ type DocVersion = "v6" | "v7" | null;
4
+
5
+ /**
6
+ * Hook that detects the documentation version (v6 or v7) from the current URL.
7
+ *
8
+ * @example
9
+ * // URL: /react-native-video/docs/v7/offer
10
+ * const version = useDocVersion(); // returns "v7"
11
+ *
12
+ * // URL: /react-native-video/docs/v6/basics
13
+ * const version = useDocVersion(); // returns "v6"
14
+ */
15
+ export function useDocVersion(): DocVersion {
16
+ const location = useLocation();
17
+ const pathname = location.pathname;
18
+
19
+ if (pathname.includes("/v7/")) {
20
+ return "v7";
21
+ }
22
+
23
+ if (pathname.includes("/v6/")) {
24
+ return "v6";
25
+ }
26
+
27
+ return null;
28
+ }