@builder.io/sdk-react-native 0.5.4 → 0.5.5

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.
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPreviewContent = void 0;
4
- const helpers_1 = require("./helpers");
5
- const init_1 = require("./init");
6
- function getPreviewContent(searchParams) {
7
- (0, init_1.init)();
8
- const id = (0, helpers_1.getIdFromSearchParams)(searchParams);
9
- return typeof id === "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(id) : void 0;
4
+ function getPreviewContent(_searchParams) {
5
+ return void 0;
10
6
  }
11
7
  exports.getPreviewContent = getPreviewContent;
@@ -1,13 +1 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIdFromSearchParams = void 0;
4
- const logger_1 = require("../logger");
5
- const getIdFromSearchParams = searchParams => {
6
- const previewedModel = searchParams.get("preview");
7
- const previewedId = searchParams.get("overrides." + previewedModel);
8
- if (!previewedId) {
9
- logger_1.logger.warn("No previewed ID found in search params.");
10
- }
11
- return previewedId;
12
- };
13
- exports.getIdFromSearchParams = getIdFromSearchParams;
@@ -1,13 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.init = void 0;
4
- const lru_cache_1 = require("lru-cache");
5
- function init() {
6
- if (!globalThis._BUILDER_PREVIEW_LRU_CACHE) {
7
- globalThis._BUILDER_PREVIEW_LRU_CACHE = new lru_cache_1.LRUCache({
8
- max: 500,
9
- ttl: 1e3 * 60 * 5
10
- });
11
- }
12
- }
4
+ function init() { }
13
5
  exports.init = init;
@@ -23,12 +23,8 @@ var __async = (__this, __arguments, generator) => {
23
23
  step((generator = generator.apply(__this, __arguments)).next());
24
24
  });
25
25
  };
26
- "use server";
27
- const init_1 = require("./init");
28
26
  function postPreviewContent(_0) {
29
27
  return __async(this, arguments, function* ({ key, value }) {
30
- (0, init_1.init)();
31
- globalThis._BUILDER_PREVIEW_LRU_CACHE.set(key, value);
32
28
  return {
33
29
  [key]: value
34
30
  };
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": "0.5.4",
4
+ "version": "0.5.5",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,8 +1,4 @@
1
- import { getIdFromSearchParams } from "./helpers";
2
- import { init } from "./init";
3
- function getPreviewContent(searchParams) {
4
- init();
5
- const id = getIdFromSearchParams(searchParams);
6
- return typeof id === "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(id) : void 0;
1
+ function getPreviewContent(_searchParams) {
2
+ return void 0;
7
3
  }
8
4
  export { getPreviewContent }
@@ -1,10 +0,0 @@
1
- import { logger } from "../logger";
2
- const getIdFromSearchParams = searchParams => {
3
- const previewedModel = searchParams.get("preview");
4
- const previewedId = searchParams.get("overrides." + previewedModel);
5
- if (!previewedId) {
6
- logger.warn("No previewed ID found in search params.");
7
- }
8
- return previewedId;
9
- };
10
- export { getIdFromSearchParams }
@@ -1,10 +1,2 @@
1
- import { LRUCache } from "lru-cache";
2
- function init() {
3
- if (!globalThis._BUILDER_PREVIEW_LRU_CACHE) {
4
- globalThis._BUILDER_PREVIEW_LRU_CACHE = new LRUCache({
5
- max: 500,
6
- ttl: 1e3 * 60 * 5
7
- });
8
- }
9
- }
1
+ function init() {}
10
2
  export { init }
@@ -18,15 +18,11 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- "use server";
22
- import { init } from "./init";
23
21
  function postPreviewContent(_0) {
24
22
  return __async(this, arguments, function* ({
25
23
  key,
26
24
  value
27
25
  }) {
28
- init();
29
- globalThis._BUILDER_PREVIEW_LRU_CACHE.set(key, value);
30
26
  return {
31
27
  [key]: value
32
28
  };