@uniformdev/canvas 19.83.0 → 19.85.1-alpha.13

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
@@ -2353,9 +2353,14 @@ function parseVariableExpression(serialized, onToken) {
2353
2353
  continue;
2354
2354
  }
2355
2355
  if (char === variableSuffix && state === "variable") {
2356
+ if (serialized[index - 1] === escapeCharacter) {
2357
+ bufferEndIndex++;
2358
+ continue;
2359
+ }
2356
2360
  state = "text";
2357
2361
  if (bufferEndIndex > bufferStartIndex) {
2358
- if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "variable") === false) {
2362
+ const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
2363
+ if (handleToken(unescapedVariableName, "variable") === false) {
2359
2364
  return tokenCount;
2360
2365
  }
2361
2366
  bufferStartIndex = bufferEndIndex + variableSuffix.length;
@@ -2415,7 +2420,7 @@ import { produce } from "immer";
2415
2420
 
2416
2421
  // src/utils/variables/createVariableReference.ts
2417
2422
  function createVariableReference(variableName) {
2418
- return `\${${variableName}}`;
2423
+ return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
2419
2424
  }
2420
2425
 
2421
2426
  // src/utils/variables/bindVariablesToObject.ts
package/dist/index.js CHANGED
@@ -2475,9 +2475,14 @@ function parseVariableExpression(serialized, onToken) {
2475
2475
  continue;
2476
2476
  }
2477
2477
  if (char === variableSuffix && state === "variable") {
2478
+ if (serialized[index - 1] === escapeCharacter) {
2479
+ bufferEndIndex++;
2480
+ continue;
2481
+ }
2478
2482
  state = "text";
2479
2483
  if (bufferEndIndex > bufferStartIndex) {
2480
- if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "variable") === false) {
2484
+ const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
2485
+ if (handleToken(unescapedVariableName, "variable") === false) {
2481
2486
  return tokenCount;
2482
2487
  }
2483
2488
  bufferStartIndex = bufferEndIndex + variableSuffix.length;
@@ -2537,7 +2542,7 @@ var import_immer = require("immer");
2537
2542
 
2538
2543
  // src/utils/variables/createVariableReference.ts
2539
2544
  function createVariableReference(variableName) {
2540
- return `\${${variableName}}`;
2545
+ return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
2541
2546
  }
2542
2547
 
2543
2548
  // src/utils/variables/bindVariablesToObject.ts
package/dist/index.mjs CHANGED
@@ -2353,9 +2353,14 @@ function parseVariableExpression(serialized, onToken) {
2353
2353
  continue;
2354
2354
  }
2355
2355
  if (char === variableSuffix && state === "variable") {
2356
+ if (serialized[index - 1] === escapeCharacter) {
2357
+ bufferEndIndex++;
2358
+ continue;
2359
+ }
2356
2360
  state = "text";
2357
2361
  if (bufferEndIndex > bufferStartIndex) {
2358
- if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "variable") === false) {
2362
+ const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
2363
+ if (handleToken(unescapedVariableName, "variable") === false) {
2359
2364
  return tokenCount;
2360
2365
  }
2361
2366
  bufferStartIndex = bufferEndIndex + variableSuffix.length;
@@ -2415,7 +2420,7 @@ import { produce } from "immer";
2415
2420
 
2416
2421
  // src/utils/variables/createVariableReference.ts
2417
2422
  function createVariableReference(variableName) {
2418
- return `\${${variableName}}`;
2423
+ return `\${${variableName.replace(/([${}])/g, "\\$1")}}`;
2419
2424
  }
2420
2425
 
2421
2426
  // src/utils/variables/bindVariablesToObject.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.83.0",
3
+ "version": "19.85.1-alpha.13+642f68468",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -31,16 +31,16 @@
31
31
  "document": "api-extractor run --local"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/retry": "0.12.1",
34
+ "@types/retry": "0.12.5",
35
35
  "lexical": "^0.12.0",
36
36
  "p-retry": "5.1.2",
37
37
  "p-throttle": "5.0.0",
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.83.0",
42
- "@uniformdev/context": "19.83.0",
43
- "immer": "9.0.21"
41
+ "@uniformdev/assets": "19.85.1-alpha.13+642f68468",
42
+ "@uniformdev/context": "19.85.1-alpha.13+642f68468",
43
+ "immer": "10.0.3"
44
44
  },
45
45
  "files": [
46
46
  "/dist"
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "bcadc9d652227a57ec901f94b4d2d166986fd5c0"
51
+ "gitHead": "642f684682fa3d0166b58e5ddc7548cfa18f21f3"
52
52
  }