@fragmentsx/render-web 0.1.0 → 0.1.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.cjs.js CHANGED
@@ -2104,13 +2104,18 @@ const getAreaListQuery = (areaCodes) => {
2104
2104
  };
2105
2105
  };
2106
2106
  const fetchPlugin = (state) => {
2107
- var _a, _b, _c;
2107
+ var _a, _b, _c, _d;
2108
2108
  const isSelf = ((_a = state == null ? void 0 : state.env) == null ? void 0 : _a.isSelf) ?? false;
2109
2109
  const url = (_b = state == null ? void 0 : state.env) == null ? void 0 : _b.backendEndpoint;
2110
2110
  const apiToken = (_c = state == null ? void 0 : state.env) == null ? void 0 : _c.apiToken;
2111
- const fetcher = createFetcher(url, {
2111
+ const referer = (_d = state == null ? void 0 : state.env) == null ? void 0 : _d.referer;
2112
+ let headers = {
2112
2113
  Authorization: `Bearer ${apiToken}`
2113
- });
2114
+ };
2115
+ if (referer) {
2116
+ headers.Referer = referer;
2117
+ }
2118
+ const fetcher = createFetcher(url, headers);
2114
2119
  const beaconFetcher = fetchBeacon();
2115
2120
  const queryFragment = async (fragmentId) => {
2116
2121
  var _a2;
@@ -2736,8 +2741,9 @@ const createFragmentsClient = (options) => {
2736
2741
  (state) => {
2737
2742
  state.env = {
2738
2743
  isSelf: (options == null ? void 0 : options.isSelf) ?? false,
2739
- backendEndpoint: BACKEND_TARGET,
2740
- apiToken: options == null ? void 0 : options.apiToken
2744
+ backendEndpoint: (options == null ? void 0 : options.backendEndpoint) ?? BACKEND_TARGET,
2745
+ apiToken: options == null ? void 0 : options.apiToken,
2746
+ referer: options == null ? void 0 : options.referer
2741
2747
  };
2742
2748
  },
2743
2749
  fetchPlugin,
package/dist/index.es.js CHANGED
@@ -2103,13 +2103,18 @@ const getAreaListQuery = (areaCodes) => {
2103
2103
  };
2104
2104
  };
2105
2105
  const fetchPlugin = (state) => {
2106
- var _a, _b, _c;
2106
+ var _a, _b, _c, _d;
2107
2107
  const isSelf = ((_a = state == null ? void 0 : state.env) == null ? void 0 : _a.isSelf) ?? false;
2108
2108
  const url = (_b = state == null ? void 0 : state.env) == null ? void 0 : _b.backendEndpoint;
2109
2109
  const apiToken = (_c = state == null ? void 0 : state.env) == null ? void 0 : _c.apiToken;
2110
- const fetcher = createFetcher(url, {
2110
+ const referer = (_d = state == null ? void 0 : state.env) == null ? void 0 : _d.referer;
2111
+ let headers = {
2111
2112
  Authorization: `Bearer ${apiToken}`
2112
- });
2113
+ };
2114
+ if (referer) {
2115
+ headers.Referer = referer;
2116
+ }
2117
+ const fetcher = createFetcher(url, headers);
2113
2118
  const beaconFetcher = fetchBeacon();
2114
2119
  const queryFragment = async (fragmentId) => {
2115
2120
  var _a2;
@@ -2735,8 +2740,9 @@ const createFragmentsClient = (options) => {
2735
2740
  (state) => {
2736
2741
  state.env = {
2737
2742
  isSelf: (options == null ? void 0 : options.isSelf) ?? false,
2738
- backendEndpoint: BACKEND_TARGET,
2739
- apiToken: options == null ? void 0 : options.apiToken
2743
+ backendEndpoint: (options == null ? void 0 : options.backendEndpoint) ?? BACKEND_TARGET,
2744
+ apiToken: options == null ? void 0 : options.apiToken,
2745
+ referer: options == null ? void 0 : options.referer
2740
2746
  };
2741
2747
  },
2742
2748
  fetchPlugin,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fragmentsx/render-web",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -24,10 +24,10 @@
24
24
  "dependencies": {
25
25
  "@graph-state/checkers": "^0.1.2",
26
26
  "@graph-state/core": "^0.13.0",
27
- "@fragmentsx/definition": "0.1.0",
27
+ "@fragmentsx/client-core": "0.1.1",
28
28
  "@fragmentsx/render-core": "0.1.0",
29
- "@fragmentsx/utils": "0.1.0",
30
- "@fragmentsx/client-core": "0.1.0"
29
+ "@fragmentsx/definition": "0.1.0",
30
+ "@fragmentsx/utils": "0.1.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@graph-state/plugin-logger": "^0.3.0",