@uniformdev/canvas 19.69.0 → 19.73.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.esm.js CHANGED
@@ -1826,7 +1826,7 @@ var createCanvasChannel = ({
1826
1826
  };
1827
1827
  postMessage(message);
1828
1828
  };
1829
- const ready = () => {
1829
+ const ready = (options) => {
1830
1830
  var _a, _b;
1831
1831
  if (typeof window === "undefined") {
1832
1832
  return;
@@ -1836,7 +1836,8 @@ var createCanvasChannel = ({
1836
1836
  const message = {
1837
1837
  type: "ready",
1838
1838
  framework,
1839
- version
1839
+ version,
1840
+ rsc: options == null ? void 0 : options.rsc
1840
1841
  };
1841
1842
  postMessage(message);
1842
1843
  };
@@ -2096,27 +2097,20 @@ function subscribeToComposition({
2096
2097
 
2097
2098
  // src/PromptClient.ts
2098
2099
  import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
2099
- var PromptUrl = "/api/v1/prompt";
2100
2100
  var PromptsUrl = "/api/v1/prompts";
2101
2101
  var PromptClient = class extends ApiClient7 {
2102
2102
  constructor(options) {
2103
2103
  super(options);
2104
2104
  }
2105
- /** Fetches all Prompts for a project */
2105
+ /** Fetches Prompts for a project */
2106
2106
  async get(options) {
2107
- const { projectId } = this.options;
2108
- const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
2109
- return await this.apiClient(fetchUri);
2110
- }
2111
- /** Fetches all Prompts for a project */
2112
- async getList(options) {
2113
2107
  const { projectId } = this.options;
2114
2108
  const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
2115
2109
  return await this.apiClient(fetchUri);
2116
2110
  }
2117
2111
  /** Updates or creates (based on id) a Prompt */
2118
2112
  async upsert(body) {
2119
- const fetchUri = this.createUrl(PromptUrl);
2113
+ const fetchUri = this.createUrl(PromptsUrl);
2120
2114
  await this.apiClient(fetchUri, {
2121
2115
  method: "PUT",
2122
2116
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2125,7 +2119,7 @@ var PromptClient = class extends ApiClient7 {
2125
2119
  }
2126
2120
  /** Deletes a Prompt */
2127
2121
  async remove(body) {
2128
- const fetchUri = this.createUrl(PromptUrl);
2122
+ const fetchUri = this.createUrl(PromptsUrl);
2129
2123
  await this.apiClient(fetchUri, {
2130
2124
  method: "DELETE",
2131
2125
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2253,6 +2247,9 @@ var isComponentPlaceholderId = (id) => {
2253
2247
  if (id === PLACEHOLDER_ID) {
2254
2248
  return true;
2255
2249
  }
2250
+ if (typeof id !== "string") {
2251
+ return false;
2252
+ }
2256
2253
  return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
2257
2254
  };
2258
2255
  var generateComponentPlaceholderId = (randomId, sdkVersion) => {
package/dist/index.js CHANGED
@@ -1938,7 +1938,7 @@ var createCanvasChannel = ({
1938
1938
  };
1939
1939
  postMessage(message);
1940
1940
  };
1941
- const ready = () => {
1941
+ const ready = (options) => {
1942
1942
  var _a, _b;
1943
1943
  if (typeof window === "undefined") {
1944
1944
  return;
@@ -1948,7 +1948,8 @@ var createCanvasChannel = ({
1948
1948
  const message = {
1949
1949
  type: "ready",
1950
1950
  framework,
1951
- version
1951
+ version,
1952
+ rsc: options == null ? void 0 : options.rsc
1952
1953
  };
1953
1954
  postMessage(message);
1954
1955
  };
@@ -2208,27 +2209,20 @@ function subscribeToComposition({
2208
2209
 
2209
2210
  // src/PromptClient.ts
2210
2211
  var import_api8 = require("@uniformdev/context/api");
2211
- var PromptUrl = "/api/v1/prompt";
2212
2212
  var PromptsUrl = "/api/v1/prompts";
2213
2213
  var PromptClient = class extends import_api8.ApiClient {
2214
2214
  constructor(options) {
2215
2215
  super(options);
2216
2216
  }
2217
- /** Fetches all Prompts for a project */
2217
+ /** Fetches Prompts for a project */
2218
2218
  async get(options) {
2219
- const { projectId } = this.options;
2220
- const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
2221
- return await this.apiClient(fetchUri);
2222
- }
2223
- /** Fetches all Prompts for a project */
2224
- async getList(options) {
2225
2219
  const { projectId } = this.options;
2226
2220
  const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
2227
2221
  return await this.apiClient(fetchUri);
2228
2222
  }
2229
2223
  /** Updates or creates (based on id) a Prompt */
2230
2224
  async upsert(body) {
2231
- const fetchUri = this.createUrl(PromptUrl);
2225
+ const fetchUri = this.createUrl(PromptsUrl);
2232
2226
  await this.apiClient(fetchUri, {
2233
2227
  method: "PUT",
2234
2228
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2237,7 +2231,7 @@ var PromptClient = class extends import_api8.ApiClient {
2237
2231
  }
2238
2232
  /** Deletes a Prompt */
2239
2233
  async remove(body) {
2240
- const fetchUri = this.createUrl(PromptUrl);
2234
+ const fetchUri = this.createUrl(PromptsUrl);
2241
2235
  await this.apiClient(fetchUri, {
2242
2236
  method: "DELETE",
2243
2237
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2365,6 +2359,9 @@ var isComponentPlaceholderId = (id) => {
2365
2359
  if (id === PLACEHOLDER_ID) {
2366
2360
  return true;
2367
2361
  }
2362
+ if (typeof id !== "string") {
2363
+ return false;
2364
+ }
2368
2365
  return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
2369
2366
  };
2370
2367
  var generateComponentPlaceholderId = (randomId, sdkVersion) => {
package/dist/index.mjs CHANGED
@@ -1826,7 +1826,7 @@ var createCanvasChannel = ({
1826
1826
  };
1827
1827
  postMessage(message);
1828
1828
  };
1829
- const ready = () => {
1829
+ const ready = (options) => {
1830
1830
  var _a, _b;
1831
1831
  if (typeof window === "undefined") {
1832
1832
  return;
@@ -1836,7 +1836,8 @@ var createCanvasChannel = ({
1836
1836
  const message = {
1837
1837
  type: "ready",
1838
1838
  framework,
1839
- version
1839
+ version,
1840
+ rsc: options == null ? void 0 : options.rsc
1840
1841
  };
1841
1842
  postMessage(message);
1842
1843
  };
@@ -2096,27 +2097,20 @@ function subscribeToComposition({
2096
2097
 
2097
2098
  // src/PromptClient.ts
2098
2099
  import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
2099
- var PromptUrl = "/api/v1/prompt";
2100
2100
  var PromptsUrl = "/api/v1/prompts";
2101
2101
  var PromptClient = class extends ApiClient7 {
2102
2102
  constructor(options) {
2103
2103
  super(options);
2104
2104
  }
2105
- /** Fetches all Prompts for a project */
2105
+ /** Fetches Prompts for a project */
2106
2106
  async get(options) {
2107
- const { projectId } = this.options;
2108
- const fetchUri = this.createUrl(PromptUrl, { ...options, projectId });
2109
- return await this.apiClient(fetchUri);
2110
- }
2111
- /** Fetches all Prompts for a project */
2112
- async getList(options) {
2113
2107
  const { projectId } = this.options;
2114
2108
  const fetchUri = this.createUrl(PromptsUrl, { ...options, projectId });
2115
2109
  return await this.apiClient(fetchUri);
2116
2110
  }
2117
2111
  /** Updates or creates (based on id) a Prompt */
2118
2112
  async upsert(body) {
2119
- const fetchUri = this.createUrl(PromptUrl);
2113
+ const fetchUri = this.createUrl(PromptsUrl);
2120
2114
  await this.apiClient(fetchUri, {
2121
2115
  method: "PUT",
2122
2116
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2125,7 +2119,7 @@ var PromptClient = class extends ApiClient7 {
2125
2119
  }
2126
2120
  /** Deletes a Prompt */
2127
2121
  async remove(body) {
2128
- const fetchUri = this.createUrl(PromptUrl);
2122
+ const fetchUri = this.createUrl(PromptsUrl);
2129
2123
  await this.apiClient(fetchUri, {
2130
2124
  method: "DELETE",
2131
2125
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -2253,6 +2247,9 @@ var isComponentPlaceholderId = (id) => {
2253
2247
  if (id === PLACEHOLDER_ID) {
2254
2248
  return true;
2255
2249
  }
2250
+ if (typeof id !== "string") {
2251
+ return false;
2252
+ }
2256
2253
  return id == null ? void 0 : id.startsWith(PLACEHOLDER_ID);
2257
2254
  };
2258
2255
  var generateComponentPlaceholderId = (randomId, sdkVersion) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.69.0",
3
+ "version": "19.73.0",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,8 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.69.0",
42
- "@uniformdev/context": "19.69.0",
41
+ "@uniformdev/assets": "19.73.0",
42
+ "@uniformdev/context": "19.73.0",
43
43
  "immer": "9.0.21"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "327658d8c6e5735499845ebb29d74906f2a43dad"
51
+ "gitHead": "1376a707cf81b8ff1d032cfc5c927c8eb213e713"
52
52
  }