@developer_tribe/react-builder 1.2.9 → 1.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developer_tribe/react-builder",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "restricted": true,
@@ -8,25 +8,19 @@
8
8
  "main": "dist/index.cjs.js",
9
9
  "module": "dist/index.esm.js",
10
10
  "types": "dist/index.d.ts",
11
- "react-native": "dist/index.native.cjs.js",
11
+ "react-native": "dist/index.cjs.js",
12
12
  "exports": {
13
13
  ".": {
14
- "react-native": {
15
- "types": "./dist/index.native.d.ts",
16
- "import": "./dist/index.native.esm.js",
17
- "require": "./dist/index.native.cjs.js",
18
- "default": "./dist/index.native.cjs.js"
19
- },
20
14
  "types": "./dist/index.d.ts",
21
15
  "import": "./dist/index.esm.js",
22
16
  "require": "./dist/index.cjs.js",
23
17
  "default": "./dist/index.esm.js"
24
18
  },
25
- "./native": {
26
- "types": "./dist/index.native.d.ts",
27
- "import": "./dist/index.native.esm.js",
28
- "require": "./dist/index.native.cjs.js",
29
- "default": "./dist/index.native.cjs.js"
19
+ "./web": {
20
+ "types": "./dist/index.web.d.ts",
21
+ "import": "./dist/index.web.esm.js",
22
+ "require": "./dist/index.web.cjs.js",
23
+ "default": "./dist/index.web.esm.js"
30
24
  },
31
25
  "./dist/styles.css": "./dist/styles.css",
32
26
  "./dist/background.jpg": "./dist/background.jpg",
@@ -117,5 +111,6 @@
117
111
  },
118
112
  "resolutions": {
119
113
  "strip-ansi": "6.0.1"
120
- }
114
+ },
115
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
121
116
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "supportedProjectVersion": "1.1.2",
3
- "reactBuilderVersion": "1.2.8"
3
+ "reactBuilderVersion": "1.2.10"
4
4
  }
package/src/index.ts CHANGED
@@ -1,15 +1,92 @@
1
- import './styles/index.scss';
1
+ /**
2
+ * React Native-safe entrypoint.
3
+ *
4
+ * IMPORTANT:
5
+ * - No SCSS imports
6
+ * - No `react-dom` imports
7
+ * - No web-only modules that touch `window`/`document`/`localStorage`
8
+ *
9
+ * This file is meant to be used via the package `react-native` entry (Metro)
10
+ * or by importing the package root (recommended).
11
+ */
12
+ //TODO: index's shoudl be reviewed and updated.
13
+ // Types
14
+ export type { TargetedScreenSize } from './types/TargetedScreenSize';
15
+ export type { Node, NodeData, NodeDefaultAttribute } from './types/Node';
16
+ export type { Project, ProjectColors } from './types/Project';
17
+ export type { Device } from './types/Device';
18
+ export type { AppConfig, Localication } from './types/PreviewConfig';
19
+ export { defaultAppConfig } from './types/PreviewConfig';
20
+ export type { Fonts, FontDefinition } from './types/Fonts';
21
+ export type {
22
+ PaywallBenefitValue,
23
+ PaywallBenefits,
24
+ Product as PaywallProduct,
25
+ PaywallModel,
26
+ } from './paywall/types/paywall-types';
27
+
28
+ // Paywall hooks (RN-safe placeholders)
29
+ export {
30
+ usePaywallCounter,
31
+ useCloseStatusPaywall,
32
+ useCarouselOptionsSeperator,
33
+ useCalculateLocalizedPrice,
34
+ useDiscountRate,
35
+ } from './paywall/hooks';
36
+
37
+ // Context (RN-safe). In React Native, `products` should come from an IAP wrapper
38
+ // (e.g. `react-native-iap`) and be passed into `BuilderProvider` by the host app.
39
+ export {
40
+ BuilderProvider,
41
+ useBuilderParams,
42
+ } from './components/BuilderProvider';
43
+ export { ParamsProvider } from './components/ParamsProvider';
44
+ export { LocalizationParamsProvider } from './components/LocalizationParamsProvider';
45
+ export { useParams } from './hooks/useParams';
46
+ export { useLocalizationParams } from './hooks/useLocalizationParams';
47
+ export { useLocalize } from './hooks/useLocalize';
48
+ export { useExtractTextStyle } from './attribute-analyser/style/native/useExtractTextStyle';
49
+ export { useExtractViewStyle } from './attribute-analyser/style/native/useExtractViewStyle';
50
+ export { useExtractImageStyle } from './attribute-analyser/style/native/useExtractImageStyle';
2
51
 
3
- // Web entrypoint trimmed to what the `example/` app uses.
4
- export { ProjectPage } from './pages/ProjectPage';
5
- export { getSamples } from './assets/samples/getSamples';
52
+ // Pure utilities (RN-safe)
53
+ export {
54
+ isNodeNullOrUndefined,
55
+ isNodeString,
56
+ isNodeArray,
57
+ isEmptyObject,
58
+ analyseNode,
59
+ analyseAndProccess,
60
+ } from './utils/analyseNode';
6
61
  export { getMeta } from './utils/getMeta';
7
- export { defaultAppConfig } from './types/PreviewConfig';
8
- export { useExtractTextStyle } from './attribute-analyser/style/web/useExtractTextStyle';
9
- export { useExtractViewStyle } from './attribute-analyser/style/web/useExtractViewStyle';
10
- export { useExtractImageStyle } from './attribute-analyser/style/web/useExtractImageStyle';
62
+ export { novaToJson } from './utils/novaToJson';
63
+ export { getDevices, getDefaultDevice } from './utils/getDevices';
64
+ export { querySelector } from './utils/querySelector';
65
+ export {
66
+ getImage,
67
+ TRIBE_ASSETS_BASE_URL,
68
+ TribeAssetName,
69
+ parseTribeAssetName,
70
+ resolveImageSrc,
71
+ } from './utils/getImage';
72
+ export {
73
+ getPatternByType,
74
+ getAttributeSchema,
75
+ getAttributeMeta,
76
+ getDefaultsForType,
77
+ getTypeSchema,
78
+ isPrimitiveType,
79
+ getArrayItemType,
80
+ } from './utils/patterns';
11
81
 
12
- export type { AppConfig } from './types/PreviewConfig';
13
- export type { Project, ProjectColors } from './types/Project';
14
- //NOTE: TECH-DEBT: This is a temporary solution to export the native index. We should find a better way to do this.
15
- export * from './index.native';
82
+ // Node helpers (RN-safe)
83
+ export { default as useNode } from './build-components/useNode';
84
+
85
+ // Static sample data helpers (RN-safe)
86
+ export {
87
+ getSamples,
88
+ getBasicSamples,
89
+ getOnboardSamples,
90
+ } from './assets/samples/getSamples';
91
+ export type { EventObjectGenerated } from './build-components/OnboardButton/OnboardButtonProps.generated';
92
+ export * from './build-components';
@@ -0,0 +1,7 @@
1
+ import './styles/index.scss';
2
+
3
+ // Web entrypoint.
4
+ export { ProjectPage } from './pages/ProjectPage';
5
+
6
+ // Re-export the RN-safe/root entry so `react-builder/web` can also access shared APIs.
7
+ export * from './index';