@guideify/react 0.1.0 → 0.2.0
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.cjs +6 -2
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +6 -2
- package/package.json +1 -6
package/dist/index.cjs
CHANGED
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
|
+
// ../shared/src/paths.ts
|
|
8
|
+
var DEFAULT_CDN_HOST = "https://cdn.guideify.in";
|
|
9
|
+
var LOADER_PATH = "/v1/loader.js";
|
|
10
|
+
|
|
7
11
|
// ../snippet/src/index.ts
|
|
8
|
-
var DEFAULT_CDN =
|
|
12
|
+
var DEFAULT_CDN = DEFAULT_CDN_HOST;
|
|
9
13
|
function isCore(candidate) {
|
|
10
14
|
return typeof candidate?.on === "function";
|
|
11
15
|
}
|
|
@@ -23,7 +27,7 @@ function installLoader(options) {
|
|
|
23
27
|
const cdn = options.cdnHost ?? DEFAULT_CDN;
|
|
24
28
|
const tag = document.createElement("script");
|
|
25
29
|
tag.async = true;
|
|
26
|
-
tag.src = `${cdn}
|
|
30
|
+
tag.src = `${cdn}${LOADER_PATH}`;
|
|
27
31
|
tag.setAttribute("data-guideify-key", options.apiKey);
|
|
28
32
|
if (options.cdnHost) tag.setAttribute("data-cdn", options.cdnHost);
|
|
29
33
|
if (options.ingestHost) tag.setAttribute("data-ingest", options.ingestHost);
|
package/dist/index.d.cts
CHANGED
|
@@ -297,7 +297,15 @@ interface SnippetOptions extends Pick<InitOptions, 'apiKey'> {
|
|
|
297
297
|
*/
|
|
298
298
|
nonce?: string | undefined;
|
|
299
299
|
}
|
|
300
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Where the loader lives when nothing says otherwise.
|
|
302
|
+
*
|
|
303
|
+
* Re-exported under this package's own name rather than renamed at the call
|
|
304
|
+
* site, because `@guideify/react` and `@guideify/vue` both re-export it again
|
|
305
|
+
* and it is public API in three places. The value is `@guideify/shared`'s —
|
|
306
|
+
* this used to say *mirrors `loader.ts`*, and a mirror is the thing T-110 was
|
|
307
|
+
* filed about.
|
|
308
|
+
*/
|
|
301
309
|
declare const DEFAULT_CDN = "https://cdn.guideify.in";
|
|
302
310
|
|
|
303
311
|
interface GuideifyProviderProps extends SnippetOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -297,7 +297,15 @@ interface SnippetOptions extends Pick<InitOptions, 'apiKey'> {
|
|
|
297
297
|
*/
|
|
298
298
|
nonce?: string | undefined;
|
|
299
299
|
}
|
|
300
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Where the loader lives when nothing says otherwise.
|
|
302
|
+
*
|
|
303
|
+
* Re-exported under this package's own name rather than renamed at the call
|
|
304
|
+
* site, because `@guideify/react` and `@guideify/vue` both re-export it again
|
|
305
|
+
* and it is public API in three places. The value is `@guideify/shared`'s —
|
|
306
|
+
* this used to say *mirrors `loader.ts`*, and a mirror is the thing T-110 was
|
|
307
|
+
* filed about.
|
|
308
|
+
*/
|
|
301
309
|
declare const DEFAULT_CDN = "https://cdn.guideify.in";
|
|
302
310
|
|
|
303
311
|
interface GuideifyProviderProps extends SnippetOptions {
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import { createContext, useContext, useMemo, useState, useEffect, isValidElement, cloneElement } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
// ../shared/src/paths.ts
|
|
6
|
+
var DEFAULT_CDN_HOST = "https://cdn.guideify.in";
|
|
7
|
+
var LOADER_PATH = "/v1/loader.js";
|
|
8
|
+
|
|
5
9
|
// ../snippet/src/index.ts
|
|
6
|
-
var DEFAULT_CDN =
|
|
10
|
+
var DEFAULT_CDN = DEFAULT_CDN_HOST;
|
|
7
11
|
function isCore(candidate) {
|
|
8
12
|
return typeof candidate?.on === "function";
|
|
9
13
|
}
|
|
@@ -21,7 +25,7 @@ function installLoader(options) {
|
|
|
21
25
|
const cdn = options.cdnHost ?? DEFAULT_CDN;
|
|
22
26
|
const tag = document.createElement("script");
|
|
23
27
|
tag.async = true;
|
|
24
|
-
tag.src = `${cdn}
|
|
28
|
+
tag.src = `${cdn}${LOADER_PATH}`;
|
|
25
29
|
tag.setAttribute("data-guideify-key", options.apiKey);
|
|
26
30
|
if (options.cdnHost) tag.setAttribute("data-cdn", options.cdnHost);
|
|
27
31
|
if (options.ingestHost) tag.setAttribute("data-ingest", options.ingestHost);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guideify/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -40,10 +40,5 @@
|
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
|
-
},
|
|
44
|
-
"repository": {
|
|
45
|
-
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/vikasOzark/guidely.git",
|
|
47
|
-
"directory": "packages/react"
|
|
48
43
|
}
|
|
49
44
|
}
|