@uniformdev/canvas-next-rsc-client 19.55.2-alpha.28 → 19.55.2-alpha.34

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.esm.js CHANGED
@@ -84,7 +84,11 @@ var TestClient = (props) => {
84
84
  };
85
85
 
86
86
  // src/components/UniformScriptClient.tsx
87
- import { createCanvasChannel, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
87
+ import {
88
+ createCanvasChannel,
89
+ IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
90
+ isAllowedReferrer
91
+ } from "@uniformdev/canvas";
88
92
  import { useRouter, useSearchParams } from "next/navigation";
89
93
  import { useEffect as useEffect3, useMemo as useMemo3 } from "react";
90
94
  import { Fragment as Fragment3, jsx } from "react/jsx-runtime";
@@ -121,9 +125,13 @@ var UniformScript = () => {
121
125
  const existing = document.getElementById("uniform-script");
122
126
  if (enabled) {
123
127
  if (!existing) {
128
+ const textHost = isAllowedReferrer(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
129
+ const bundleHost = new URL(textHost);
130
+ bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
124
131
  const script = document.createElement("script");
125
132
  script.id = "uniform-script";
126
- script.src = `https://uniform.app/files/canvas-in-context-embed/index.js`;
133
+ script.setAttribute("data-rsc", "true");
134
+ script.src = bundleHost.toString();
127
135
  script.async = true;
128
136
  document.head.appendChild(script);
129
137
  }
package/dist/index.js CHANGED
@@ -151,9 +151,13 @@ var UniformScript = () => {
151
151
  const existing = document.getElementById("uniform-script");
152
152
  if (enabled) {
153
153
  if (!existing) {
154
+ const textHost = (0, import_canvas3.isAllowedReferrer)(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
155
+ const bundleHost = new URL(textHost);
156
+ bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
154
157
  const script = document.createElement("script");
155
158
  script.id = "uniform-script";
156
- script.src = `https://uniform.app/files/canvas-in-context-embed/index.js`;
159
+ script.setAttribute("data-rsc", "true");
160
+ script.src = bundleHost.toString();
157
161
  script.async = true;
158
162
  document.head.appendChild(script);
159
163
  }
package/dist/index.mjs CHANGED
@@ -84,7 +84,11 @@ var TestClient = (props) => {
84
84
  };
85
85
 
86
86
  // src/components/UniformScriptClient.tsx
87
- import { createCanvasChannel, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
87
+ import {
88
+ createCanvasChannel,
89
+ IN_CONTEXT_EDITOR_QUERY_STRING_PARAM,
90
+ isAllowedReferrer
91
+ } from "@uniformdev/canvas";
88
92
  import { useRouter, useSearchParams } from "next/navigation";
89
93
  import { useEffect as useEffect3, useMemo as useMemo3 } from "react";
90
94
  import { Fragment as Fragment3, jsx } from "react/jsx-runtime";
@@ -121,9 +125,13 @@ var UniformScript = () => {
121
125
  const existing = document.getElementById("uniform-script");
122
126
  if (enabled) {
123
127
  if (!existing) {
128
+ const textHost = isAllowedReferrer(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
129
+ const bundleHost = new URL(textHost);
130
+ bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
124
131
  const script = document.createElement("script");
125
132
  script.id = "uniform-script";
126
- script.src = `https://uniform.app/files/canvas-in-context-embed/index.js`;
133
+ script.setAttribute("data-rsc", "true");
134
+ script.src = bundleHost.toString();
127
135
  script.async = true;
128
136
  document.head.appendChild(script);
129
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-client",
3
- "version": "19.55.2-alpha.28+2ac0494ad",
3
+ "version": "19.55.2-alpha.34+8aefcd7df",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -32,8 +32,8 @@
32
32
  "react-dom": "18.2.0"
33
33
  },
34
34
  "dependencies": {
35
- "@uniformdev/canvas": "19.55.2-alpha.28+2ac0494ad",
36
- "@uniformdev/canvas-next-rsc-shared": "^19.55.2-alpha.28+2ac0494ad"
35
+ "@uniformdev/canvas": "19.55.2-alpha.34+8aefcd7df",
36
+ "@uniformdev/canvas-next-rsc-shared": "^19.55.2-alpha.34+8aefcd7df"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=16.14.0"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "2ac0494ad92320b4a314433b89df24f45bdf0f00"
49
+ "gitHead": "8aefcd7df66f58e0ffa59360ae2b518eb485386a"
50
50
  }