@builder.io/sdk-react 0.5.2 → 0.5.4

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.
Files changed (61) hide show
  1. package/README.md +4 -0
  2. package/dist/blocks/BaseText.d.ts +1 -0
  3. package/dist/blocks/button/button.d.ts +1 -0
  4. package/dist/blocks/button/button.js +2 -2
  5. package/dist/blocks/columns/columns.d.ts +1 -0
  6. package/dist/blocks/columns/columns.js +2 -2
  7. package/dist/blocks/custom-code/custom-code.d.ts +1 -0
  8. package/dist/blocks/embed/embed.d.ts +1 -0
  9. package/dist/blocks/form/form.d.ts +1 -0
  10. package/dist/blocks/fragment/fragment.d.ts +1 -0
  11. package/dist/blocks/image/image.d.ts +1 -0
  12. package/dist/blocks/img/img.d.ts +1 -0
  13. package/dist/blocks/img/img.js +1 -1
  14. package/dist/blocks/input/input.d.ts +1 -0
  15. package/dist/blocks/input/input.js +1 -1
  16. package/dist/blocks/raw-text/raw-text.d.ts +1 -0
  17. package/dist/blocks/section/section.d.ts +1 -0
  18. package/dist/blocks/section/section.js +1 -1
  19. package/dist/blocks/select/select.d.ts +1 -0
  20. package/dist/blocks/select/select.js +1 -1
  21. package/dist/blocks/submit-button/submit-button.d.ts +1 -0
  22. package/dist/blocks/submit-button/submit-button.js +1 -1
  23. package/dist/blocks/symbol/symbol.d.ts +1 -0
  24. package/dist/blocks/symbol/symbol.js +1 -1
  25. package/dist/blocks/text/text.d.ts +1 -0
  26. package/dist/blocks/text/text.js +1 -1
  27. package/dist/blocks/textarea/textarea.d.ts +1 -0
  28. package/dist/blocks/textarea/textarea.js +1 -1
  29. package/dist/blocks/video/video.d.ts +1 -0
  30. package/dist/components/block/block.d.ts +1 -0
  31. package/dist/components/block/components/block-styles.d.ts +1 -0
  32. package/dist/components/block/components/block-wrapper.d.ts +1 -0
  33. package/dist/components/block/components/component-ref/component-ref.d.ts +1 -0
  34. package/dist/components/block/components/interactive-element.d.ts +1 -0
  35. package/dist/components/block/components/repeated-block.d.ts +1 -0
  36. package/dist/components/blocks/blocks-wrapper.d.ts +1 -0
  37. package/dist/components/blocks/blocks-wrapper.js +1 -1
  38. package/dist/components/blocks/blocks.d.ts +1 -0
  39. package/dist/components/content/components/enable-editor.d.ts +1 -0
  40. package/dist/components/content/components/enable-editor.js +1 -1
  41. package/dist/components/content/components/styles.d.ts +1 -0
  42. package/dist/components/content/content.d.ts +1 -0
  43. package/dist/components/content/content.js +3 -1
  44. package/dist/components/content-variants/content-variants.d.ts +1 -0
  45. package/dist/components/content-variants/content-variants.js +12 -6
  46. package/dist/components/inlined-script.d.ts +1 -0
  47. package/dist/components/inlined-styles.d.ts +1 -0
  48. package/dist/constants/sdk-version.d.ts +1 -1
  49. package/dist/constants/sdk-version.js +1 -1
  50. package/dist/functions/evaluate/acorn-interpreter.js +3111 -0
  51. package/dist/functions/evaluate/evaluate.js +1 -1
  52. package/dist/functions/evaluate/non-node-runtime/index.d.ts +1 -0
  53. package/dist/functions/evaluate/non-node-runtime/index.js +2 -0
  54. package/dist/functions/evaluate/{non-node-runtime.d.ts → non-node-runtime/non-node-runtime.d.ts} +1 -1
  55. package/dist/functions/evaluate/{non-node-runtime.js → non-node-runtime/non-node-runtime.js} +3 -3
  56. package/dist/functions/evaluate/types.d.ts +1 -0
  57. package/package.json +9 -2
  58. package/dist/functions/evaluate/acorn.d.ts +0 -0
  59. package/dist/functions/evaluate/acorn.js +0 -2432
  60. package/dist/functions/evaluate/interpreter.js +0 -3853
  61. /package/dist/functions/evaluate/{interpreter.d.ts → acorn-interpreter.d.ts} +0 -0
@@ -2,7 +2,7 @@ import { logger } from '../../helpers/logger.js';
2
2
  import { isBrowser } from '../is-browser.js';
3
3
  import { isEditing } from '../is-editing.js';
4
4
  import { isNonNodeServer } from '../is-non-node-server.js';
5
- import { runInNonNode } from './non-node-runtime.js';
5
+ import { runInNonNode } from './non-node-runtime/index.js';
6
6
  export function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression = true }) {
7
7
  if (code === '') {
8
8
  logger.warn('Skipping evaluation of empty code block.');
@@ -0,0 +1 @@
1
+ export { runInNonNode } from './non-node-runtime.js';
@@ -0,0 +1,2 @@
1
+ // TEMPORARY FIX UNTIL we fix dynamic imports
2
+ export { runInNonNode } from './non-node-runtime.js';
@@ -1,2 +1,2 @@
1
- import type { ExecutorArgs } from './types';
1
+ import type { ExecutorArgs } from '../types';
2
2
  export declare const runInNonNode: ({ builder, context, event, rootState, localState, rootSetState, useCode }: ExecutorArgs) => any;
@@ -1,6 +1,6 @@
1
- import { logger } from '../../helpers/logger';
2
- import { set } from '../set';
3
- import Interpreter from './interpreter.js';
1
+ import { logger } from '../../../helpers/logger';
2
+ import { set } from '../../set';
3
+ import Interpreter from '../acorn-interpreter.js';
4
4
  const processCode = (code) => {
5
5
  return code.split('\n').map(line => {
6
6
  const trimmed = line.trim();
@@ -8,3 +8,4 @@ export type ExecutorArgs = Pick<BuilderContextInterface, 'localState' | 'context
8
8
  };
9
9
  event: Event | undefined;
10
10
  };
11
+ export type Executor = (args: ExecutorArgs) => any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react",
3
3
  "description": "Builder.io SDK for React",
4
- "version": "0.5.2",
4
+ "version": "0.5.4",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -18,8 +18,15 @@
18
18
  "react": "^18.2.0"
19
19
  },
20
20
  "devDependencies": {
21
+ "nx": "^16.6.0",
22
+ "nx-cloud": "^16.2.0",
21
23
  "react": "^18.2.0",
22
24
  "rimraf": "^3.0.2",
23
- "typescript": "^5.1.6"
25
+ "typescript": "^4.9.4"
26
+ },
27
+ "nx": {
28
+ "implicitDependencies": [
29
+ "@builder.io/sdks"
30
+ ]
24
31
  }
25
32
  }
File without changes