@prodigio-io/sdk 2.0.0 → 2.0.1
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/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,9 @@ interface ProdigioInitConfig {
|
|
|
8
8
|
baseUrl?: string;
|
|
9
9
|
badge?: {
|
|
10
10
|
position?: 'bottom-right' | 'bottom-left';
|
|
11
|
+
/** Only inject the badge when the current page path starts with one of these strings.
|
|
12
|
+
* e.g. ['/careers'] — badge appears on /careers and /careers/job-id but not on / or /about */
|
|
13
|
+
paths?: string[];
|
|
11
14
|
};
|
|
12
15
|
}
|
|
13
16
|
interface SalaryRange {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ interface ProdigioInitConfig {
|
|
|
8
8
|
baseUrl?: string;
|
|
9
9
|
badge?: {
|
|
10
10
|
position?: 'bottom-right' | 'bottom-left';
|
|
11
|
+
/** Only inject the badge when the current page path starts with one of these strings.
|
|
12
|
+
* e.g. ['/careers'] — badge appears on /careers and /careers/job-id but not on / or /about */
|
|
13
|
+
paths?: string[];
|
|
11
14
|
};
|
|
12
15
|
}
|
|
13
16
|
interface SalaryRange {
|
package/dist/index.js
CHANGED
|
@@ -132,7 +132,7 @@ function injectBadge(position = "bottom-right") {
|
|
|
132
132
|
<path d="M7 7h5.5a3.5 3.5 0 0 1 0 7H7V7z" fill="#fff"/>
|
|
133
133
|
<path d="M7 14h6a3 3 0 0 1 0 6H7v-6z" fill="#fff" opacity="0.6"/>
|
|
134
134
|
</svg>
|
|
135
|
-
<span>Hiring by Prodigio</span>
|
|
135
|
+
<span>Hiring powered by Prodigio</span>
|
|
136
136
|
`;
|
|
137
137
|
el.addEventListener("mouseenter", () => {
|
|
138
138
|
el.style.boxShadow = "0 4px 12px rgba(0,0,0,0.12)";
|
|
@@ -260,6 +260,13 @@ var _Prodigio = class _Prodigio {
|
|
|
260
260
|
if (typeof window === "undefined") return;
|
|
261
261
|
const { key, badgeToken, baseUrl = DEFAULT_BASE_URL, badge: badgeConfig } = config;
|
|
262
262
|
const position = (_a = badgeConfig == null ? void 0 : badgeConfig.position) != null ? _a : "bottom-right";
|
|
263
|
+
const paths = badgeConfig == null ? void 0 : badgeConfig.paths;
|
|
264
|
+
if (paths && paths.length > 0) {
|
|
265
|
+
const currentPath = window.location.pathname;
|
|
266
|
+
if (!paths.some((p) => currentPath === p || currentPath.startsWith(p + "/"))) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
263
270
|
const hostname = window.location.hostname;
|
|
264
271
|
const cached = getCachedToken(key);
|
|
265
272
|
let bestToken = null;
|
package/dist/index.mjs
CHANGED
|
@@ -106,7 +106,7 @@ function injectBadge(position = "bottom-right") {
|
|
|
106
106
|
<path d="M7 7h5.5a3.5 3.5 0 0 1 0 7H7V7z" fill="#fff"/>
|
|
107
107
|
<path d="M7 14h6a3 3 0 0 1 0 6H7v-6z" fill="#fff" opacity="0.6"/>
|
|
108
108
|
</svg>
|
|
109
|
-
<span>Hiring by Prodigio</span>
|
|
109
|
+
<span>Hiring powered by Prodigio</span>
|
|
110
110
|
`;
|
|
111
111
|
el.addEventListener("mouseenter", () => {
|
|
112
112
|
el.style.boxShadow = "0 4px 12px rgba(0,0,0,0.12)";
|
|
@@ -234,6 +234,13 @@ var _Prodigio = class _Prodigio {
|
|
|
234
234
|
if (typeof window === "undefined") return;
|
|
235
235
|
const { key, badgeToken, baseUrl = DEFAULT_BASE_URL, badge: badgeConfig } = config;
|
|
236
236
|
const position = (_a = badgeConfig == null ? void 0 : badgeConfig.position) != null ? _a : "bottom-right";
|
|
237
|
+
const paths = badgeConfig == null ? void 0 : badgeConfig.paths;
|
|
238
|
+
if (paths && paths.length > 0) {
|
|
239
|
+
const currentPath = window.location.pathname;
|
|
240
|
+
if (!paths.some((p) => currentPath === p || currentPath.startsWith(p + "/"))) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
237
244
|
const hostname = window.location.hostname;
|
|
238
245
|
const cached = getCachedToken(key);
|
|
239
246
|
let bestToken = null;
|