@builder.io/sdk-qwik 0.18.0 → 0.18.1

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.
@@ -69,6 +69,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
69
69
  },
70
70
  contentUpdate: (newContent) => {
71
71
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
72
+ },
73
+ stateUpdate: (newState) => {
74
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
72
75
  }
73
76
  }
74
77
  })(event);
@@ -67,6 +67,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
67
67
  },
68
68
  contentUpdate: (newContent) => {
69
69
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
70
+ },
71
+ stateUpdate: (newState) => {
72
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
70
73
  }
71
74
  }
72
75
  })(event);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.18.0";
3
+ const SDK_VERSION = "0.18.1";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.18.0";
1
+ const SDK_VERSION = "0.18.1";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -17,6 +17,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
17
17
  case "builder.triggerAnimation":
18
18
  callbacks.animation(data.data);
19
19
  break;
20
+ case "builder.resetState": {
21
+ const messageContent = data.data;
22
+ const modelName = messageContent.model;
23
+ const newState = messageContent == null ? void 0 : messageContent.state;
24
+ if (modelName === model && newState)
25
+ callbacks.stateUpdate(newState);
26
+ break;
27
+ }
20
28
  case "builder.contentUpdate": {
21
29
  const messageContent = data.data;
22
30
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -44,6 +52,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
44
52
  animation: () => {
45
53
  },
46
54
  configureSdk: () => {
55
+ },
56
+ stateUpdate: () => {
47
57
  }
48
58
  },
49
59
  model,
@@ -15,6 +15,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
15
15
  case "builder.triggerAnimation":
16
16
  callbacks.animation(data.data);
17
17
  break;
18
+ case "builder.resetState": {
19
+ const messageContent = data.data;
20
+ const modelName = messageContent.model;
21
+ const newState = messageContent == null ? void 0 : messageContent.state;
22
+ if (modelName === model && newState)
23
+ callbacks.stateUpdate(newState);
24
+ break;
25
+ }
18
26
  case "builder.contentUpdate": {
19
27
  const messageContent = data.data;
20
28
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -42,6 +50,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
42
50
  animation: () => {
43
51
  },
44
52
  configureSdk: () => {
53
+ },
54
+ stateUpdate: () => {
45
55
  }
46
56
  },
47
57
  model,
@@ -69,6 +69,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
69
69
  },
70
70
  contentUpdate: (newContent) => {
71
71
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
72
+ },
73
+ stateUpdate: (newState) => {
74
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
72
75
  }
73
76
  }
74
77
  })(event);
@@ -67,6 +67,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
67
67
  },
68
68
  contentUpdate: (newContent) => {
69
69
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
70
+ },
71
+ stateUpdate: (newState) => {
72
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
70
73
  }
71
74
  }
72
75
  })(event);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.18.0";
3
+ const SDK_VERSION = "0.18.1";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.18.0";
1
+ const SDK_VERSION = "0.18.1";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -17,6 +17,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
17
17
  case "builder.triggerAnimation":
18
18
  callbacks.animation(data.data);
19
19
  break;
20
+ case "builder.resetState": {
21
+ const messageContent = data.data;
22
+ const modelName = messageContent.model;
23
+ const newState = messageContent == null ? void 0 : messageContent.state;
24
+ if (modelName === model && newState)
25
+ callbacks.stateUpdate(newState);
26
+ break;
27
+ }
20
28
  case "builder.contentUpdate": {
21
29
  const messageContent = data.data;
22
30
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -44,6 +52,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
44
52
  animation: () => {
45
53
  },
46
54
  configureSdk: () => {
55
+ },
56
+ stateUpdate: () => {
47
57
  }
48
58
  },
49
59
  model,
@@ -15,6 +15,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
15
15
  case "builder.triggerAnimation":
16
16
  callbacks.animation(data.data);
17
17
  break;
18
+ case "builder.resetState": {
19
+ const messageContent = data.data;
20
+ const modelName = messageContent.model;
21
+ const newState = messageContent == null ? void 0 : messageContent.state;
22
+ if (modelName === model && newState)
23
+ callbacks.stateUpdate(newState);
24
+ break;
25
+ }
18
26
  case "builder.contentUpdate": {
19
27
  const messageContent = data.data;
20
28
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -42,6 +50,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
42
50
  animation: () => {
43
51
  },
44
52
  configureSdk: () => {
53
+ },
54
+ stateUpdate: () => {
45
55
  }
46
56
  },
47
57
  model,
@@ -69,6 +69,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
69
69
  },
70
70
  contentUpdate: (newContent) => {
71
71
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
72
+ },
73
+ stateUpdate: (newState) => {
74
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
72
75
  }
73
76
  }
74
77
  })(event);
@@ -67,6 +67,9 @@ const processMessage = function processMessage2(props, state, showContentProps,
67
67
  },
68
68
  contentUpdate: (newContent) => {
69
69
  mergeNewContent(props, state, showContentProps, elementRef, newContent);
70
+ },
71
+ stateUpdate: (newState) => {
72
+ mergeNewRootState(props, state, showContentProps, elementRef, newState);
70
73
  }
71
74
  }
72
75
  })(event);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.18.0";
3
+ const SDK_VERSION = "0.18.1";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.18.0";
1
+ const SDK_VERSION = "0.18.1";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -17,6 +17,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
17
17
  case "builder.triggerAnimation":
18
18
  callbacks.animation(data.data);
19
19
  break;
20
+ case "builder.resetState": {
21
+ const messageContent = data.data;
22
+ const modelName = messageContent.model;
23
+ const newState = messageContent == null ? void 0 : messageContent.state;
24
+ if (modelName === model && newState)
25
+ callbacks.stateUpdate(newState);
26
+ break;
27
+ }
20
28
  case "builder.contentUpdate": {
21
29
  const messageContent = data.data;
22
30
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -44,6 +52,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
44
52
  animation: () => {
45
53
  },
46
54
  configureSdk: () => {
55
+ },
56
+ stateUpdate: () => {
47
57
  }
48
58
  },
49
59
  model,
@@ -15,6 +15,14 @@ const createEditorListener = ({ model, trustedHosts, callbacks }) => {
15
15
  case "builder.triggerAnimation":
16
16
  callbacks.animation(data.data);
17
17
  break;
18
+ case "builder.resetState": {
19
+ const messageContent = data.data;
20
+ const modelName = messageContent.model;
21
+ const newState = messageContent == null ? void 0 : messageContent.state;
22
+ if (modelName === model && newState)
23
+ callbacks.stateUpdate(newState);
24
+ break;
25
+ }
18
26
  case "builder.contentUpdate": {
19
27
  const messageContent = data.data;
20
28
  const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
@@ -42,6 +50,8 @@ const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) => {
42
50
  animation: () => {
43
51
  },
44
52
  configureSdk: () => {
53
+ },
54
+ stateUpdate: () => {
45
55
  }
46
56
  },
47
57
  model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.18.0";
1
+ export declare const SDK_VERSION = "0.18.1";
@@ -1,9 +1,11 @@
1
1
  import type { ContentProps } from '../components/content/content.types';
2
2
  import type { BuilderAnimation } from '../types/builder-block';
3
3
  import type { BuilderContent } from '../types/builder-content';
4
+ import type { Dictionary } from '../types/typescript';
4
5
  type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
5
6
  callbacks: {
6
7
  contentUpdate: (updatedContent: BuilderContent) => void;
8
+ stateUpdate: (newState: Dictionary<string>) => void;
7
9
  animation: (updatedContent: BuilderAnimation) => void;
8
10
  configureSdk: (updatedContent: any) => void;
9
11
  };