@builder.io/sdk-svelte 0.0.1 → 0.0.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.
@@ -1,10 +1,3 @@
1
- import { JSX } from '@builder.io/mitosis/jsx-runtime';
2
1
  import { BuilderBlock } from '../types/builder-block.js';
3
- declare type JSXElementConstructor<P> = (props: P) => JSX.Element | null;
4
- export declare type TagName = string | JSXElementConstructor<any>;
5
- /**
6
- * The `JSXElementConstructor` type is here to account for a react-native override, where we have a
7
- * `View` tag wrapping every component.
8
- */
2
+ export declare type TagName = string;
9
3
  export declare function getBlockTag(block: BuilderBlock): TagName;
10
- export {};
@@ -1,9 +1,4 @@
1
- import '@builder.io/mitosis/jsx-runtime';
2
1
  import '../types/builder-block.js';
3
- /**
4
- * The `JSXElementConstructor` type is here to account for a react-native override, where we have a
5
- * `View` tag wrapping every component.
6
- */
7
2
  export function getBlockTag(block) {
8
3
  return block.tagName || 'div';
9
4
  }
@@ -1,6 +1,6 @@
1
1
  declare type QueryObject = Record<string, string>;
2
2
  export declare const convertSearchParamsToQueryObject: (searchParams: URLSearchParams) => QueryObject;
3
- export declare const getBuilderSearchParams: (options: QueryObject) => QueryObject;
3
+ export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
4
4
  export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
5
5
  export declare const normalizeSearchParams: (searchParams: QueryObject | URLSearchParams) => QueryObject;
6
6
  export {};
@@ -7,7 +7,11 @@ export const convertSearchParamsToQueryObject = (searchParams) => {
7
7
  });
8
8
  return options;
9
9
  };
10
- export const getBuilderSearchParams = (options) => {
10
+ export const getBuilderSearchParams = (_options) => {
11
+ if (!_options) {
12
+ return {};
13
+ }
14
+ const options = normalizeSearchParams(_options);
11
15
  const newOptions = {};
12
16
  Object.keys(options).forEach((key) => {
13
17
  if (key.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
@@ -22,7 +26,7 @@ export const getBuilderSearchParamsFromWindow = () => {
22
26
  return {};
23
27
  }
24
28
  const searchParams = new URLSearchParams(window.location.search);
25
- return getBuilderSearchParams(convertSearchParamsToQueryObject(searchParams));
29
+ return getBuilderSearchParams(searchParams);
26
30
  };
27
31
  export const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams
28
32
  ? convertSearchParamsToQueryObject(searchParams)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package"