@builder.io/sdk-react-native 0.1.1 → 0.1.3

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 (183) hide show
  1. package/dist/blocks/BaseText.js +40 -0
  2. package/dist/blocks/button/button.js +39 -0
  3. package/dist/blocks/button/component-info.js +42 -0
  4. package/dist/blocks/columns/columns.js +149 -0
  5. package/dist/blocks/columns/component-info.js +244 -0
  6. package/dist/blocks/custom-code/component-info.js +32 -0
  7. package/dist/blocks/custom-code/custom-code.js +76 -0
  8. package/dist/blocks/embed/component-info.js +47 -0
  9. package/dist/blocks/embed/embed.js +67 -0
  10. package/dist/blocks/embed/helpers.js +10 -0
  11. package/dist/blocks/form/component-info.js +263 -0
  12. package/dist/blocks/form/form.js +232 -0
  13. package/dist/blocks/fragment/component-info.js +12 -0
  14. package/dist/blocks/fragment/fragment.js +36 -0
  15. package/dist/blocks/image/component-info.js +152 -0
  16. package/dist/blocks/image/image.helpers.js +49 -0
  17. package/dist/blocks/image/image.js +81 -0
  18. package/dist/blocks/img/component-info.js +21 -0
  19. package/dist/blocks/img/img.js +35 -0
  20. package/dist/blocks/input/component-info.js +75 -0
  21. package/dist/blocks/input/input.js +32 -0
  22. package/dist/blocks/raw-text/component-info.js +17 -0
  23. package/dist/blocks/raw-text/raw-text.js +31 -0
  24. package/dist/blocks/section/component-info.js +50 -0
  25. package/dist/blocks/section/section.js +49 -0
  26. package/dist/blocks/select/component-info.js +60 -0
  27. package/dist/blocks/select/select.js +38 -0
  28. package/dist/blocks/submit-button/component-info.js +29 -0
  29. package/dist/blocks/submit-button/submit-button.js +36 -0
  30. package/dist/blocks/symbol/component-info.js +44 -0
  31. package/dist/blocks/symbol/symbol.js +97 -0
  32. package/dist/blocks/text/component-info.js +25 -0
  33. package/dist/blocks/text/text.js +112 -0
  34. package/dist/blocks/textarea/component-info.js +48 -0
  35. package/dist/blocks/textarea/textarea.js +31 -0
  36. package/dist/blocks/util.js +9 -0
  37. package/dist/blocks/video/component-info.js +107 -0
  38. package/dist/blocks/video/video.js +81 -0
  39. package/dist/components/render-block/block-styles.js +79 -0
  40. package/dist/components/render-block/render-block.helpers.js +109 -0
  41. package/dist/components/render-block/render-block.js +154 -0
  42. package/dist/components/render-block/render-component-with-context.js +45 -0
  43. package/dist/components/render-block/render-component.js +50 -0
  44. package/dist/components/render-block/render-repeated-block.js +45 -0
  45. package/dist/components/render-block/types.js +1 -0
  46. package/dist/components/render-blocks.js +76 -0
  47. package/dist/components/render-content/builder-editing.js +31 -0
  48. package/dist/components/render-content/components/render-styles.js +91 -0
  49. package/dist/components/render-content/index.js +8 -0
  50. package/dist/components/render-content/render-content.js +325 -0
  51. package/dist/components/render-inlined-styles.js +42 -0
  52. package/dist/constants/builder-registered-components.js +46 -0
  53. package/dist/constants/device-sizes.js +49 -0
  54. package/dist/constants/target.js +5 -0
  55. package/dist/context/builder.context.js +13 -0
  56. package/dist/context/types.js +1 -0
  57. package/dist/functions/camel-to-kebab-case.js +5 -0
  58. package/dist/functions/evaluate.js +25 -0
  59. package/dist/functions/event-handler-name.js +8 -0
  60. package/dist/functions/extract-text-styles.js +23 -0
  61. package/dist/functions/fast-clone.js +5 -0
  62. package/dist/functions/get-block-actions-handler.js +12 -0
  63. package/dist/functions/get-block-actions.js +19 -0
  64. package/dist/functions/get-block-component-options.js +29 -0
  65. package/dist/functions/get-block-properties.js +51 -0
  66. package/dist/functions/get-block-tag.js +8 -0
  67. package/dist/functions/get-builder-search-params/fn.test.js +15 -0
  68. package/dist/functions/get-builder-search-params/index.js +39 -0
  69. package/dist/functions/get-content/ab-testing.js +89 -0
  70. package/dist/functions/get-content/generate-content-url.js +44 -0
  71. package/dist/functions/get-content/generate-content-url.test.js +33 -0
  72. package/dist/functions/get-content/index.js +68 -0
  73. package/dist/functions/get-content/types.js +1 -0
  74. package/dist/functions/get-fetch.js +15 -0
  75. package/dist/functions/get-global-this.js +19 -0
  76. package/dist/functions/get-processed-block.js +52 -0
  77. package/dist/functions/get-processed-block.test.js +34 -0
  78. package/dist/functions/get-react-native-block-styles.js +30 -0
  79. package/dist/functions/if-target.js +13 -0
  80. package/dist/functions/is-browser.js +7 -0
  81. package/dist/functions/is-editing.js +8 -0
  82. package/dist/functions/is-iframe.js +8 -0
  83. package/dist/functions/is-previewing.js +15 -0
  84. package/dist/functions/on-change.js +28 -0
  85. package/dist/functions/on-change.test.js +21 -0
  86. package/dist/functions/register-component.js +65 -0
  87. package/dist/functions/register.js +31 -0
  88. package/dist/functions/sanitize-react-native-block-styles.js +71 -0
  89. package/dist/functions/set-editor-settings.js +16 -0
  90. package/dist/functions/set.js +12 -0
  91. package/dist/functions/set.test.js +18 -0
  92. package/dist/functions/track/helpers.js +53 -0
  93. package/dist/functions/track/index.js +124 -0
  94. package/dist/functions/track/interaction.js +51 -0
  95. package/dist/functions/track.js +120 -0
  96. package/dist/functions/transform-block-properties.js +18 -0
  97. package/dist/functions/transform-block.js +38 -0
  98. package/dist/helpers/ab-tests.js +10 -0
  99. package/dist/helpers/cookie.js +70 -0
  100. package/dist/helpers/css.js +33 -0
  101. package/dist/helpers/flatten.js +35 -0
  102. package/dist/helpers/localStorage.js +31 -0
  103. package/dist/helpers/nullable.js +5 -0
  104. package/dist/helpers/sessionId.js +51 -0
  105. package/dist/helpers/time.js +6 -0
  106. package/dist/helpers/url.js +14 -0
  107. package/dist/helpers/url.test.js +23 -0
  108. package/dist/helpers/uuid.js +14 -0
  109. package/dist/helpers/visitorId.js +33 -0
  110. package/dist/index-helpers/blocks-exports.js +22 -0
  111. package/dist/index-helpers/top-of-file.js +3 -0
  112. package/dist/index.js +29 -0
  113. package/dist/scripts/init-editing.js +97 -0
  114. package/dist/types/builder-block.js +1 -0
  115. package/dist/types/builder-content.js +1 -0
  116. package/dist/types/can-track.js +1 -0
  117. package/dist/types/components.js +1 -0
  118. package/dist/types/deep-partial.js +1 -0
  119. package/dist/types/element.js +1 -0
  120. package/dist/types/targets.js +1 -0
  121. package/dist/types/typescript.js +1 -0
  122. package/package.json +13 -5
  123. package/src/blocks/BaseText.jsx +17 -0
  124. package/src/blocks/button/button.jsx +28 -0
  125. package/src/blocks/columns/{columns.js → columns.jsx} +59 -36
  126. package/src/blocks/custom-code/{custom-code.js → custom-code.jsx} +22 -15
  127. package/src/blocks/embed/{embed.js → embed.jsx} +12 -11
  128. package/src/blocks/form/form.jsx +251 -0
  129. package/src/blocks/fragment/fragment.jsx +11 -0
  130. package/src/blocks/image/image.jsx +78 -0
  131. package/src/blocks/img/img.jsx +18 -0
  132. package/src/blocks/input/input.jsx +20 -0
  133. package/src/blocks/raw-text/raw-text.jsx +6 -0
  134. package/src/blocks/section/section.jsx +29 -0
  135. package/src/blocks/select/select.jsx +24 -0
  136. package/src/blocks/submit-button/submit-button.jsx +11 -0
  137. package/src/blocks/symbol/symbol.jsx +86 -0
  138. package/src/blocks/text/text.jsx +100 -0
  139. package/src/blocks/textarea/textarea.jsx +14 -0
  140. package/src/blocks/video/video.jsx +70 -0
  141. package/src/components/render-block/block-styles.jsx +70 -0
  142. package/src/components/render-block/render-block.helpers.js +90 -0
  143. package/src/components/render-block/render-block.jsx +183 -0
  144. package/src/components/render-block/render-component.jsx +45 -0
  145. package/src/components/render-block/render-repeated-block.jsx +22 -0
  146. package/src/components/render-blocks.jsx +86 -0
  147. package/src/components/render-content/builder-editing.jsx +6 -0
  148. package/src/components/render-content/components/{render-styles.js → render-styles.jsx} +21 -14
  149. package/src/components/render-content/render-content.jsx +373 -0
  150. package/src/components/render-inlined-styles.jsx +29 -0
  151. package/src/functions/track/helpers.js +50 -0
  152. package/src/functions/{track.js → track/index.js} +10 -6
  153. package/src/functions/track/interaction.js +53 -0
  154. package/src/helpers/localStorage.js +1 -0
  155. package/src/helpers/sessionId.js +4 -1
  156. package/src/helpers/url.js +3 -0
  157. package/src/helpers/url.test.js +6 -0
  158. package/src/helpers/visitorId.js +1 -0
  159. package/src/index.js +1 -1
  160. package/src/blocks/BaseText.js +0 -31
  161. package/src/blocks/button/button.js +0 -36
  162. package/src/blocks/form/form.js +0 -222
  163. package/src/blocks/fragment/fragment.js +0 -9
  164. package/src/blocks/image/image.js +0 -55
  165. package/src/blocks/img/img.js +0 -33
  166. package/src/blocks/input/input.js +0 -36
  167. package/src/blocks/raw-text/raw-text.js +0 -10
  168. package/src/blocks/section/section.js +0 -41
  169. package/src/blocks/select/select.js +0 -37
  170. package/src/blocks/submit-button/submit-button.js +0 -27
  171. package/src/blocks/symbol/symbol.js +0 -73
  172. package/src/blocks/text/text.js +0 -67
  173. package/src/blocks/textarea/textarea.js +0 -32
  174. package/src/blocks/video/video.js +0 -55
  175. package/src/components/render-block/block-styles.js +0 -50
  176. package/src/components/render-block/render-block.js +0 -202
  177. package/src/components/render-block/render-component-with-context.js +0 -35
  178. package/src/components/render-block/render-component.js +0 -35
  179. package/src/components/render-block/render-repeated-block.js +0 -33
  180. package/src/components/render-blocks.js +0 -63
  181. package/src/components/render-content/builder-editing.js +0 -8
  182. package/src/components/render-content/render-content.js +0 -296
  183. package/src/components/render-inlined-styles.js +0 -17
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- import { View } from "react-native";
3
- function BuilderEditing(props) {
4
- return /* @__PURE__ */ React.createElement(View, null);
5
- }
6
- export {
7
- BuilderEditing as default
8
- };
@@ -1,296 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import * as React from "react";
21
- import { View } from "react-native";
22
- import { useState, useRef, useEffect } from "react";
23
- import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
24
- import { TARGET } from "../../constants/target.js";
25
- import { evaluate } from "../../functions/evaluate.js";
26
- import { getContent } from "../../functions/get-content/index.js";
27
- import { fetch } from "../../functions/get-fetch.js";
28
- import { isBrowser } from "../../functions/is-browser.js";
29
- import { isEditing } from "../../functions/is-editing.js";
30
- import { isPreviewing } from "../../functions/is-previewing.js";
31
- import {
32
- components,
33
- createRegisterComponentMessage
34
- } from "../../functions/register-component.js";
35
- import { _track } from "../../functions/track.js";
36
- import RenderBlocks from "../render-blocks.js";
37
- import RenderContentStyles from "./components/render-styles.js";
38
- import BuilderContext from "../../context/builder.context.js";
39
- import {
40
- registerInsertMenu,
41
- setupBrowserForEditing
42
- } from "../../scripts/init-editing.js";
43
- function RenderContent(props) {
44
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
45
- const elementRef = useRef(null);
46
- const [forceReRenderCount, setForceReRenderCount] = useState(() => 0);
47
- const [overrideContent, setOverrideContent] = useState(() => null);
48
- function useContent() {
49
- var _a2, _b2, _c2, _d2, _e2;
50
- if (!props.content && !overrideContent) {
51
- return void 0;
52
- }
53
- const mergedContent = __spreadProps(__spreadValues(__spreadValues({}, props.content), overrideContent), {
54
- data: __spreadValues(__spreadValues(__spreadValues({}, (_a2 = props.content) == null ? void 0 : _a2.data), props.data), overrideContent == null ? void 0 : overrideContent.data),
55
- meta: __spreadProps(__spreadValues(__spreadValues({}, (_b2 = props.content) == null ? void 0 : _b2.meta), overrideContent == null ? void 0 : overrideContent.meta), {
56
- breakpoints: useBreakpoints || ((_c2 = overrideContent == null ? void 0 : overrideContent.meta) == null ? void 0 : _c2.breakpoints) || ((_e2 = (_d2 = props.content) == null ? void 0 : _d2.meta) == null ? void 0 : _e2.breakpoints)
57
- })
58
- });
59
- return mergedContent;
60
- }
61
- const [update, setUpdate] = useState(() => 0);
62
- const [useBreakpoints, setUseBreakpoints] = useState(() => null);
63
- function canTrackToUse() {
64
- return props.canTrack || true;
65
- }
66
- const [overrideState, setOverrideState] = useState(() => ({}));
67
- function contentState() {
68
- var _a2, _b2;
69
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (_b2 = (_a2 = props.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.state), props.data), props.locale ? {
70
- locale: props.locale
71
- } : {}), overrideState);
72
- }
73
- function contextContext() {
74
- return props.context || {};
75
- }
76
- function allRegisteredComponents() {
77
- const allComponentsArray = [
78
- ...getDefaultRegisteredComponents(),
79
- ...components,
80
- ...props.customComponents || []
81
- ];
82
- const allComponents = allComponentsArray.reduce((acc, curr) => __spreadProps(__spreadValues({}, acc), {
83
- [curr.name]: curr
84
- }), {});
85
- return allComponents;
86
- }
87
- function processMessage(event) {
88
- var _a2;
89
- const { data } = event;
90
- if (data) {
91
- switch (data.type) {
92
- case "builder.configureSdk": {
93
- const messageContent = data.data;
94
- const { breakpoints, contentId } = messageContent;
95
- if (!contentId || contentId !== ((_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.id)) {
96
- return;
97
- }
98
- setUseBreakpoints(breakpoints);
99
- setForceReRenderCount(forceReRenderCount + 1);
100
- break;
101
- }
102
- case "builder.contentUpdate": {
103
- const messageContent = data.data;
104
- const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
105
- const contentData = messageContent.data;
106
- if (key === props.model) {
107
- setOverrideContent(contentData);
108
- setForceReRenderCount(forceReRenderCount + 1);
109
- }
110
- break;
111
- }
112
- case "builder.patchUpdates": {
113
- break;
114
- }
115
- }
116
- }
117
- }
118
- function evaluateJsCode() {
119
- var _a2, _b2;
120
- const jsCode = (_b2 = (_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
121
- if (jsCode) {
122
- evaluate({
123
- code: jsCode,
124
- context: contextContext(),
125
- state: contentState()
126
- });
127
- }
128
- }
129
- function httpReqsData() {
130
- return {};
131
- }
132
- function onClick(_event) {
133
- var _a2, _b2;
134
- if (useContent()) {
135
- const variationId = (_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.testVariationId;
136
- const contentId = (_b2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _b2.id;
137
- _track({
138
- type: "click",
139
- canTrack: canTrackToUse(),
140
- contentId,
141
- apiKey: props.apiKey,
142
- variationId: variationId !== contentId ? variationId : void 0
143
- });
144
- }
145
- }
146
- function evalExpression(expression) {
147
- return expression.replace(/{{([^}]+)}}/g, (_match, group) => evaluate({
148
- code: group,
149
- context: contextContext(),
150
- state: contentState()
151
- }));
152
- }
153
- function handleRequest({ url, key }) {
154
- fetch(url).then((response) => response.json()).then((json) => {
155
- const newOverrideState = __spreadProps(__spreadValues({}, overrideState), {
156
- [key]: json
157
- });
158
- setOverrideState(newOverrideState);
159
- }).catch((err) => {
160
- console.log("error fetching dynamic data", url, err);
161
- });
162
- }
163
- function runHttpRequests() {
164
- var _a2, _b2, _c2;
165
- const requests = (_c2 = (_b2 = (_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.data) == null ? void 0 : _b2.httpRequests) != null ? _c2 : {};
166
- Object.entries(requests).forEach(([key, url]) => {
167
- if (url && (!httpReqsData()[key] || isEditing())) {
168
- const evaluatedUrl = evalExpression(url);
169
- handleRequest({
170
- url: evaluatedUrl,
171
- key
172
- });
173
- }
174
- });
175
- }
176
- function emitStateUpdate() {
177
- if (isEditing()) {
178
- window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
179
- detail: {
180
- state: contentState(),
181
- ref: {
182
- name: props.model
183
- }
184
- }
185
- }));
186
- }
187
- }
188
- function shouldRenderContentStyles() {
189
- var _a2, _b2, _c2, _d2, _e2;
190
- return Boolean((((_b2 = (_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.data) == null ? void 0 : _b2.cssCode) || ((_e2 = (_d2 = (_c2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _c2.data) == null ? void 0 : _d2.customFonts) == null ? void 0 : _e2.length)) && TARGET !== "reactNative");
191
- }
192
- useEffect(() => {
193
- var _a2, _b2;
194
- if (!props.apiKey) {
195
- console.error("[Builder.io]: No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
196
- }
197
- if (isBrowser()) {
198
- if (isEditing()) {
199
- setForceReRenderCount(forceReRenderCount + 1);
200
- registerInsertMenu();
201
- setupBrowserForEditing(__spreadValues(__spreadValues({}, props.locale ? {
202
- locale: props.locale
203
- } : {}), props.includeRefs ? {
204
- includeRefs: props.includeRefs
205
- } : {}));
206
- Object.values(allRegisteredComponents()).forEach((registeredComponent) => {
207
- var _a3;
208
- const message = createRegisterComponentMessage(registeredComponent);
209
- (_a3 = window.parent) == null ? void 0 : _a3.postMessage(message, "*");
210
- });
211
- window.addEventListener("message", processMessage);
212
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
213
- }
214
- if (useContent()) {
215
- const variationId = (_a2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _a2.testVariationId;
216
- const contentId = (_b2 = useContent == null ? void 0 : useContent()) == null ? void 0 : _b2.id;
217
- _track({
218
- type: "impression",
219
- canTrack: canTrackToUse(),
220
- contentId,
221
- apiKey: props.apiKey,
222
- variationId: variationId !== contentId ? variationId : void 0
223
- });
224
- }
225
- if (isPreviewing()) {
226
- const searchParams = new URL(location.href).searchParams;
227
- if (props.model && searchParams.get("builder.preview") === props.model) {
228
- const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
229
- if (previewApiKey) {
230
- getContent({
231
- model: props.model,
232
- apiKey: previewApiKey
233
- }).then((content) => {
234
- if (content) {
235
- setOverrideContent(content);
236
- }
237
- });
238
- }
239
- }
240
- }
241
- evaluateJsCode();
242
- runHttpRequests();
243
- emitStateUpdate();
244
- }
245
- }, []);
246
- useEffect(() => {
247
- evaluateJsCode();
248
- }, [(_b = (_a = useContent == null ? void 0 : useContent()) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode, contentState()]);
249
- useEffect(() => {
250
- runHttpRequests();
251
- }, [(_d = (_c = useContent == null ? void 0 : useContent()) == null ? void 0 : _c.data) == null ? void 0 : _d.httpRequests]);
252
- useEffect(() => {
253
- emitStateUpdate();
254
- }, [contentState()]);
255
- useEffect(() => {
256
- return () => {
257
- if (isBrowser()) {
258
- window.removeEventListener("message", processMessage);
259
- window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
260
- }
261
- };
262
- }, []);
263
- return /* @__PURE__ */ React.createElement(BuilderContext.Provider, {
264
- value: {
265
- get content() {
266
- return useContent();
267
- },
268
- get state() {
269
- return contentState();
270
- },
271
- get context() {
272
- return contextContext();
273
- },
274
- get apiKey() {
275
- return props.apiKey;
276
- },
277
- get registeredComponents() {
278
- return allRegisteredComponents();
279
- }
280
- }
281
- }, useContent() ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View, {
282
- ref: elementRef,
283
- onClick: (event) => onClick(event),
284
- "builder-content-id": (_e = useContent == null ? void 0 : useContent()) == null ? void 0 : _e.id,
285
- "builder-model": props.model
286
- }, shouldRenderContentStyles() ? /* @__PURE__ */ React.createElement(RenderContentStyles, {
287
- cssCode: (_g = (_f = useContent == null ? void 0 : useContent()) == null ? void 0 : _f.data) == null ? void 0 : _g.cssCode,
288
- customFonts: (_i = (_h = useContent == null ? void 0 : useContent()) == null ? void 0 : _h.data) == null ? void 0 : _i.customFonts
289
- }) : null, /* @__PURE__ */ React.createElement(RenderBlocks, {
290
- blocks: (_k = (_j = useContent == null ? void 0 : useContent()) == null ? void 0 : _j.data) == null ? void 0 : _k.blocks,
291
- key: forceReRenderCount
292
- }))) : null);
293
- }
294
- export {
295
- RenderContent as default
296
- };
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
- import { View, Text } from "react-native";
3
- import { TARGET } from "../constants/target.js";
4
- function RenderInlinedStyles(props) {
5
- function injectedStyleScript() {
6
- return `<${tag()}>${props.styles}</${tag()}>`;
7
- }
8
- function tag() {
9
- return "style";
10
- }
11
- return /* @__PURE__ */ React.createElement(React.Fragment, null, TARGET === "svelte" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View, {
12
- dangerouslySetInnerHTML: { __html: injectedStyleScript() }
13
- })) : /* @__PURE__ */ React.createElement(View, null, /* @__PURE__ */ React.createElement(Text, null, props.styles)));
14
- }
15
- export {
16
- RenderInlinedStyles as default
17
- };