@builder.io/sdk-svelte 0.7.5 → 0.8.0

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.
@@ -42,16 +42,14 @@ $: Tag = () => {
42
42
  return block.tagName || "div";
43
43
  };
44
44
  $: canShowBlock = () => {
45
- if ("hide" in processedBlock()) {
46
- return !processedBlock().hide;
47
- }
48
- if ("show" in processedBlock()) {
49
- return processedBlock().show;
50
- }
51
- if (block.repeat?.collection && !repeatItem?.()?.length) {
45
+ if (block.repeat?.collection) {
46
+ if (repeatItem?.()?.length)
47
+ return true;
52
48
  return false;
53
49
  }
54
- return true;
50
+ const shouldHide = "hide" in processedBlock() ? processedBlock().hide : false;
51
+ const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
52
+ return shouldShow && !shouldHide;
55
53
  };
56
54
  $: childrenWithoutParentComponent = () => {
57
55
  /**
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.7.5";
1
+ export declare const SDK_VERSION = "0.8.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.7.5";
1
+ export const SDK_VERSION = "0.8.0";
@@ -42,16 +42,14 @@ $: Tag = () => {
42
42
  return block.tagName || "div";
43
43
  };
44
44
  $: canShowBlock = () => {
45
- if ("hide" in processedBlock()) {
46
- return !processedBlock().hide;
47
- }
48
- if ("show" in processedBlock()) {
49
- return processedBlock().show;
50
- }
51
- if (block.repeat?.collection && !repeatItem?.()?.length) {
45
+ if (block.repeat?.collection) {
46
+ if (repeatItem?.()?.length)
47
+ return true;
52
48
  return false;
53
49
  }
54
- return true;
50
+ const shouldHide = "hide" in processedBlock() ? processedBlock().hide : false;
51
+ const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
52
+ return shouldShow && !shouldHide;
55
53
  };
56
54
  $: childrenWithoutParentComponent = () => {
57
55
  /**
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.7.5";
1
+ export declare const SDK_VERSION = "0.8.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.7.5";
1
+ export const SDK_VERSION = "0.8.0";
@@ -42,16 +42,14 @@ $: Tag = () => {
42
42
  return block.tagName || "div";
43
43
  };
44
44
  $: canShowBlock = () => {
45
- if ("hide" in processedBlock()) {
46
- return !processedBlock().hide;
47
- }
48
- if ("show" in processedBlock()) {
49
- return processedBlock().show;
50
- }
51
- if (block.repeat?.collection && !repeatItem?.()?.length) {
45
+ if (block.repeat?.collection) {
46
+ if (repeatItem?.()?.length)
47
+ return true;
52
48
  return false;
53
49
  }
54
- return true;
50
+ const shouldHide = "hide" in processedBlock() ? processedBlock().hide : false;
51
+ const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
52
+ return shouldShow && !shouldHide;
55
53
  };
56
54
  $: childrenWithoutParentComponent = () => {
57
55
  /**
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.7.5";
1
+ export declare const SDK_VERSION = "0.8.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.7.5";
1
+ export const SDK_VERSION = "0.8.0";
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.7.5",
4
+ "version": "0.8.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "lib",
8
8
  "src"
9
9
  ],
10
- "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/svelte#readme",
10
+ "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/svelte",
11
11
  "repository": {
12
12
  "type": "git",
13
13
  "url": "git+https://github.com/BuilderIO/builder.git",
@@ -63,16 +63,15 @@
63
63
  return block.tagName || "div";
64
64
  };
65
65
  $: canShowBlock = () => {
66
- if ("hide" in processedBlock()) {
67
- return !processedBlock().hide;
68
- }
69
- if ("show" in processedBlock()) {
70
- return processedBlock().show;
71
- }
72
- if (block.repeat?.collection && !repeatItem?.()?.length) {
66
+ if (block.repeat?.collection) {
67
+ if (repeatItem?.()?.length) return true;
73
68
  return false;
74
69
  }
75
- return true;
70
+ const shouldHide =
71
+ "hide" in processedBlock() ? processedBlock().hide : false;
72
+ const shouldShow =
73
+ "show" in processedBlock() ? processedBlock().show : true;
74
+ return shouldShow && !shouldHide;
76
75
  };
77
76
  $: childrenWithoutParentComponent = () => {
78
77
  /**
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.7.5"
1
+ export const SDK_VERSION = "0.8.0"