@builder.io/sdk-react-native 2.0.7 → 2.0.9

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 (91) hide show
  1. package/lib/browser/commonjs/components/block/block.js +2 -1
  2. package/lib/browser/commonjs/components/block/block.js.map +1 -1
  3. package/lib/browser/commonjs/components/content/content.js +2 -2
  4. package/lib/browser/commonjs/components/content/content.js.map +1 -1
  5. package/lib/browser/commonjs/constants/sdk-version.js +1 -1
  6. package/lib/browser/commonjs/functions/register-component.js +3 -3
  7. package/lib/browser/commonjs/functions/register-component.js.map +1 -1
  8. package/lib/browser/commonjs/functions/register.js +4 -0
  9. package/lib/browser/commonjs/functions/register.js.map +1 -1
  10. package/lib/browser/commonjs/functions/transform-style-property.js +3 -0
  11. package/lib/browser/commonjs/functions/transform-style-property.js.map +1 -1
  12. package/lib/browser/module/components/block/block.js +2 -1
  13. package/lib/browser/module/components/block/block.js.map +1 -1
  14. package/lib/browser/module/components/content/content.js +3 -3
  15. package/lib/browser/module/components/content/content.js.map +1 -1
  16. package/lib/browser/module/constants/sdk-version.js +1 -1
  17. package/lib/browser/module/functions/register-component.js +2 -2
  18. package/lib/browser/module/functions/register-component.js.map +1 -1
  19. package/lib/browser/module/functions/register.js +4 -0
  20. package/lib/browser/module/functions/register.js.map +1 -1
  21. package/lib/browser/module/functions/transform-style-property.js +3 -0
  22. package/lib/browser/module/functions/transform-style-property.js.map +1 -1
  23. package/lib/browser/typescript/components/block/block.d.ts.map +1 -1
  24. package/lib/browser/typescript/constants/sdk-version.d.ts +1 -1
  25. package/lib/browser/typescript/functions/register-component.d.ts +1 -1
  26. package/lib/browser/typescript/functions/register-component.d.ts.map +1 -1
  27. package/lib/browser/typescript/functions/register.d.ts.map +1 -1
  28. package/lib/browser/typescript/functions/transform-style-property.d.ts.map +1 -1
  29. package/lib/edge/commonjs/components/block/block.js +2 -1
  30. package/lib/edge/commonjs/components/block/block.js.map +1 -1
  31. package/lib/edge/commonjs/components/content/content.js +2 -2
  32. package/lib/edge/commonjs/components/content/content.js.map +1 -1
  33. package/lib/edge/commonjs/constants/sdk-version.js +1 -1
  34. package/lib/edge/commonjs/functions/register-component.js +3 -3
  35. package/lib/edge/commonjs/functions/register-component.js.map +1 -1
  36. package/lib/edge/commonjs/functions/register.js +4 -0
  37. package/lib/edge/commonjs/functions/register.js.map +1 -1
  38. package/lib/edge/commonjs/functions/transform-style-property.js +3 -0
  39. package/lib/edge/commonjs/functions/transform-style-property.js.map +1 -1
  40. package/lib/edge/module/components/block/block.js +2 -1
  41. package/lib/edge/module/components/block/block.js.map +1 -1
  42. package/lib/edge/module/components/content/content.js +3 -3
  43. package/lib/edge/module/components/content/content.js.map +1 -1
  44. package/lib/edge/module/constants/sdk-version.js +1 -1
  45. package/lib/edge/module/functions/register-component.js +2 -2
  46. package/lib/edge/module/functions/register-component.js.map +1 -1
  47. package/lib/edge/module/functions/register.js +4 -0
  48. package/lib/edge/module/functions/register.js.map +1 -1
  49. package/lib/edge/module/functions/transform-style-property.js +3 -0
  50. package/lib/edge/module/functions/transform-style-property.js.map +1 -1
  51. package/lib/edge/typescript/components/block/block.d.ts.map +1 -1
  52. package/lib/edge/typescript/constants/sdk-version.d.ts +1 -1
  53. package/lib/edge/typescript/functions/register-component.d.ts +1 -1
  54. package/lib/edge/typescript/functions/register-component.d.ts.map +1 -1
  55. package/lib/edge/typescript/functions/register.d.ts.map +1 -1
  56. package/lib/edge/typescript/functions/transform-style-property.d.ts.map +1 -1
  57. package/lib/node/commonjs/components/block/block.js +2 -1
  58. package/lib/node/commonjs/components/block/block.js.map +1 -1
  59. package/lib/node/commonjs/components/content/content.js +2 -2
  60. package/lib/node/commonjs/components/content/content.js.map +1 -1
  61. package/lib/node/commonjs/constants/sdk-version.js +1 -1
  62. package/lib/node/commonjs/functions/register-component.js +3 -3
  63. package/lib/node/commonjs/functions/register-component.js.map +1 -1
  64. package/lib/node/commonjs/functions/register.js +4 -0
  65. package/lib/node/commonjs/functions/register.js.map +1 -1
  66. package/lib/node/commonjs/functions/transform-style-property.js +3 -0
  67. package/lib/node/commonjs/functions/transform-style-property.js.map +1 -1
  68. package/lib/node/module/components/block/block.js +2 -1
  69. package/lib/node/module/components/block/block.js.map +1 -1
  70. package/lib/node/module/components/content/content.js +3 -3
  71. package/lib/node/module/components/content/content.js.map +1 -1
  72. package/lib/node/module/constants/sdk-version.js +1 -1
  73. package/lib/node/module/functions/register-component.js +2 -2
  74. package/lib/node/module/functions/register-component.js.map +1 -1
  75. package/lib/node/module/functions/register.js +4 -0
  76. package/lib/node/module/functions/register.js.map +1 -1
  77. package/lib/node/module/functions/transform-style-property.js +3 -0
  78. package/lib/node/module/functions/transform-style-property.js.map +1 -1
  79. package/lib/node/typescript/components/block/block.d.ts.map +1 -1
  80. package/lib/node/typescript/constants/sdk-version.d.ts +1 -1
  81. package/lib/node/typescript/functions/register-component.d.ts +1 -1
  82. package/lib/node/typescript/functions/register-component.d.ts.map +1 -1
  83. package/lib/node/typescript/functions/register.d.ts.map +1 -1
  84. package/lib/node/typescript/functions/transform-style-property.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/src/components/block/block.tsx +2 -1
  87. package/src/components/content/content.tsx +3 -3
  88. package/src/constants/sdk-version.ts +1 -1
  89. package/src/functions/register-component.ts +2 -2
  90. package/src/functions/register.ts +4 -0
  91. package/src/functions/transform-style-property.ts +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,aAAa,EAAE,GAAG,CAAC;CACpB,CAAC;AACF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAkB9D,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,qBA8K/B;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,aAAa,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAkB9D,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,qBA8K/B;AAED,eAAe,KAAK,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.7";
1
+ export declare const SDK_VERSION = "2.0.9";
2
2
  //# sourceMappingURL=sdk-version.d.ts.map
@@ -3,5 +3,5 @@ export declare const createRegisterComponentMessage: (info: ComponentInfo) => {
3
3
  type: string;
4
4
  data: any;
5
5
  };
6
- export declare function serializeComponentInfo(info: ComponentInfo): any;
6
+ export declare function serializeIncludingFunctions(info: ComponentInfo): any;
7
7
  //# sourceMappingURL=register-component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-component.d.ts","sourceRoot":"","sources":["../../../../src/functions/register-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,eAAO,MAAM,8BAA8B,SAAU,aAAa;;;CAGhE,CAAC;AAaH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,OAOzD"}
1
+ {"version":3,"file":"register-component.d.ts","sourceRoot":"","sources":["../../../../src/functions/register-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,eAAO,MAAM,8BAA8B,SAAU,aAAa;;;CAGhE,CAAC;AAaH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,aAAa,OAO9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/functions/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CACjC;AACD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAID,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;AAC3E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/functions/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CACjC;AACD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAID,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;AAC3E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transform-style-property.d.ts","sourceRoot":"","sources":["../../../../src/functions/transform-style-property.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAqgB3D,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,KAAK,GACN,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC;CACZ,gDAOA"}
1
+ {"version":3,"file":"transform-style-property.d.ts","sourceRoot":"","sources":["../../../../src/functions/transform-style-property.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAygB3D,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,KAAK,GACN,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC;CACZ,gDAOA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-native",
3
3
  "description": "Builder.io SDK for React Native",
4
- "version": "2.0.7",
4
+ "version": "2.0.9",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react-native",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,6 +21,7 @@ export type BlockProps = {
21
21
  registeredComponents: RegisteredComponents;
22
22
  linkComponent: any;
23
23
  };
24
+ import { TARGET } from "../../constants/target";
24
25
  import type {
25
26
  BuilderContextInterface,
26
27
  RegisteredComponents,
@@ -136,7 +137,7 @@ function Block(props: BlockProps) {
136
137
  registeredComponents: props.registeredComponents,
137
138
  builderBlock: processedBlock(),
138
139
  includeBlockProps: blockComponent?.()?.noWrap === true,
139
- isInteractive: !blockComponent?.()?.isRSC,
140
+ isInteractive: !(blockComponent?.()?.isRSC && TARGET === "rsc"),
140
141
  };
141
142
  }
142
143
 
@@ -21,7 +21,7 @@ import type {
21
21
  BuilderRenderState,
22
22
  RegisteredComponents,
23
23
  } from "../../context/types";
24
- import { serializeComponentInfo } from "../../functions/register-component";
24
+ import { serializeIncludingFunctions } from "../../functions/register-component";
25
25
  import type { ComponentInfo } from "../../types/components";
26
26
  import type { Dictionary } from "../../types/typescript";
27
27
  import Blocks from "../blocks/blocks";
@@ -67,7 +67,7 @@ function ContentComponent(props: ContentProps) {
67
67
  ...acc,
68
68
  [info.name]: {
69
69
  component: component,
70
- ...serializeComponentInfo(info),
70
+ ...serializeIncludingFunctions(info),
71
71
  },
72
72
  }),
73
73
  {}
@@ -101,7 +101,7 @@ function ContentComponent(props: ContentProps) {
101
101
  ].reduce<Dictionary<ComponentInfo>>(
102
102
  (acc, { component: _, ...info }) => ({
103
103
  ...acc,
104
- [info.name]: serializeComponentInfo(info),
104
+ [info.name]: serializeIncludingFunctions(info),
105
105
  }),
106
106
  {}
107
107
  ),
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.7"
1
+ export const SDK_VERSION = "2.0.9"
@@ -1,7 +1,7 @@
1
1
  import type { ComponentInfo } from '../types/components';
2
2
  export const createRegisterComponentMessage = (info: ComponentInfo) => ({
3
3
  type: 'builder.registerComponent',
4
- data: serializeComponentInfo(info)
4
+ data: serializeIncludingFunctions(info)
5
5
  });
6
6
 
7
7
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -15,7 +15,7 @@ const serializeFn = (fnValue: Function) => {
15
15
  const appendFunction = !fnStr.startsWith('function') && !fnStr.startsWith('(');
16
16
  return `return (${appendFunction ? 'function ' : ''}${fnStr}).apply(this, arguments)`;
17
17
  };
18
- export function serializeComponentInfo(info: ComponentInfo) {
18
+ export function serializeIncludingFunctions(info: ComponentInfo) {
19
19
  return JSON.parse(JSON.stringify(info, (key, value) => {
20
20
  if (typeof value === 'function') {
21
21
  return serializeFn(value);
@@ -1,6 +1,7 @@
1
1
  import type { BuilderBlock } from '../types/builder-block';
2
2
  import type { DeepPartial } from '../types/deep-partial';
3
3
  import { isBrowser } from './is-browser';
4
+ import { serializeIncludingFunctions } from './register-component';
4
5
  export interface InsertMenuItem {
5
6
  name: string;
6
7
  icon?: string;
@@ -19,6 +20,9 @@ const registry: {
19
20
  export function register(type: 'insertMenu', info: InsertMenuConfig): void;
20
21
  export function register(type: string, info: any): void;
21
22
  export function register(type: string, info: any) {
23
+ if (type === 'plugin') {
24
+ info = serializeIncludingFunctions(info);
25
+ }
22
26
  let typeList = registry[type];
23
27
  if (!typeList) {
24
28
  typeList = registry[type] = [];
@@ -112,6 +112,10 @@ const cssProperties: Record<string, CSSPropertyValidator> = {
112
112
  paddingHorizontal: (value: string) => lengthPattern.test(value),
113
113
  paddingVertical: (value: string) => lengthPattern.test(value),
114
114
 
115
+ gap: (value: string) => lengthPattern.test(value),
116
+ columnGap: (value: string) => lengthPattern.test(value),
117
+ rowGap: (value: string) => lengthPattern.test(value),
118
+
115
119
  // Border Properties
116
120
  borderStyle: (value: string) =>
117
121
  ['solid', 'dotted', 'dashed', 'none'].includes(value),