@builder.io/sdk-svelte 4.0.0 → 4.0.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.
- package/lib/browser/components/content/components/enable-editor.svelte +3 -0
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/helpers/subscribe-to-editor.d.ts +2 -0
- package/lib/browser/helpers/subscribe-to-editor.js +12 -1
- package/lib/edge/components/content/components/enable-editor.svelte +3 -0
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/helpers/subscribe-to-editor.d.ts +2 -0
- package/lib/edge/helpers/subscribe-to-editor.js +12 -1
- package/lib/node/components/content/components/enable-editor.svelte +3 -0
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/helpers/subscribe-to-editor.d.ts +2 -0
- package/lib/node/helpers/subscribe-to-editor.js +12 -1
- package/package.json +1 -1
- package/src/components/content/components/enable-editor.svelte +3 -0
- package/src/constants/sdk-version.ts +1 -1
- package/src/helpers/subscribe-to-editor.ts +14 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.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
|
};
|
|
@@ -20,6 +20,16 @@ export const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
20
20
|
callbacks.animation(data.data);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
|
+
case 'builder.resetState':
|
|
24
|
+
{
|
|
25
|
+
const messageContent = data.data;
|
|
26
|
+
const modelName = messageContent.model;
|
|
27
|
+
const newState = messageContent?.state;
|
|
28
|
+
if (modelName === model && newState) {
|
|
29
|
+
callbacks.stateUpdate(newState);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
23
33
|
case 'builder.contentUpdate':
|
|
24
34
|
{
|
|
25
35
|
const messageContent = data.data;
|
|
@@ -51,7 +61,8 @@ export const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) =>
|
|
|
51
61
|
callbacks: {
|
|
52
62
|
contentUpdate: callback,
|
|
53
63
|
animation: () => { },
|
|
54
|
-
configureSdk: () => { }
|
|
64
|
+
configureSdk: () => { },
|
|
65
|
+
stateUpdate: () => { }
|
|
55
66
|
},
|
|
56
67
|
model,
|
|
57
68
|
trustedHosts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.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
|
};
|
|
@@ -20,6 +20,16 @@ export const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
20
20
|
callbacks.animation(data.data);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
|
+
case 'builder.resetState':
|
|
24
|
+
{
|
|
25
|
+
const messageContent = data.data;
|
|
26
|
+
const modelName = messageContent.model;
|
|
27
|
+
const newState = messageContent?.state;
|
|
28
|
+
if (modelName === model && newState) {
|
|
29
|
+
callbacks.stateUpdate(newState);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
23
33
|
case 'builder.contentUpdate':
|
|
24
34
|
{
|
|
25
35
|
const messageContent = data.data;
|
|
@@ -51,7 +61,8 @@ export const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) =>
|
|
|
51
61
|
callbacks: {
|
|
52
62
|
contentUpdate: callback,
|
|
53
63
|
animation: () => { },
|
|
54
|
-
configureSdk: () => { }
|
|
64
|
+
configureSdk: () => { },
|
|
65
|
+
stateUpdate: () => { }
|
|
55
66
|
},
|
|
56
67
|
model,
|
|
57
68
|
trustedHosts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.0.
|
|
1
|
+
export declare const SDK_VERSION = "4.0.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.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
|
};
|
|
@@ -20,6 +20,16 @@ export const createEditorListener = ({ model, trustedHosts, callbacks }) => {
|
|
|
20
20
|
callbacks.animation(data.data);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
|
+
case 'builder.resetState':
|
|
24
|
+
{
|
|
25
|
+
const messageContent = data.data;
|
|
26
|
+
const modelName = messageContent.model;
|
|
27
|
+
const newState = messageContent?.state;
|
|
28
|
+
if (modelName === model && newState) {
|
|
29
|
+
callbacks.stateUpdate(newState);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
23
33
|
case 'builder.contentUpdate':
|
|
24
34
|
{
|
|
25
35
|
const messageContent = data.data;
|
|
@@ -51,7 +61,8 @@ export const subscribeToEditor = ({ model, apiKey, callback, trustedHosts }) =>
|
|
|
51
61
|
callbacks: {
|
|
52
62
|
contentUpdate: callback,
|
|
53
63
|
animation: () => { },
|
|
54
|
-
configureSdk: () => { }
|
|
64
|
+
configureSdk: () => { },
|
|
65
|
+
stateUpdate: () => { }
|
|
55
66
|
},
|
|
56
67
|
model,
|
|
57
68
|
trustedHosts
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.0.
|
|
1
|
+
export const SDK_VERSION = "4.0.1"
|
|
@@ -4,10 +4,12 @@ import { isFromTrustedHost } from '../functions/is-from-trusted-host';
|
|
|
4
4
|
import { setupBrowserForEditing } from '../scripts/init-editing';
|
|
5
5
|
import type { BuilderAnimation } from '../types/builder-block';
|
|
6
6
|
import type { BuilderContent } from '../types/builder-content';
|
|
7
|
+
import type { Dictionary } from '../types/typescript';
|
|
7
8
|
import { logger } from './logger';
|
|
8
9
|
type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
|
|
9
10
|
callbacks: {
|
|
10
11
|
contentUpdate: (updatedContent: BuilderContent) => void;
|
|
12
|
+
stateUpdate: (newState: Dictionary<string>) => void;
|
|
11
13
|
animation: (updatedContent: BuilderAnimation) => void;
|
|
12
14
|
configureSdk: (updatedContent: any) => void;
|
|
13
15
|
};
|
|
@@ -36,6 +38,16 @@ export const createEditorListener = ({
|
|
|
36
38
|
callbacks.animation(data.data);
|
|
37
39
|
break;
|
|
38
40
|
}
|
|
41
|
+
case 'builder.resetState':
|
|
42
|
+
{
|
|
43
|
+
const messageContent = data.data;
|
|
44
|
+
const modelName = messageContent.model;
|
|
45
|
+
const newState = messageContent?.state;
|
|
46
|
+
if (modelName === model && newState) {
|
|
47
|
+
callbacks.stateUpdate(newState);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
39
51
|
case 'builder.contentUpdate':
|
|
40
52
|
{
|
|
41
53
|
const messageContent = data.data;
|
|
@@ -96,7 +108,8 @@ export const subscribeToEditor: SubscribeToEditor = ({
|
|
|
96
108
|
callbacks: {
|
|
97
109
|
contentUpdate: callback,
|
|
98
110
|
animation: () => {},
|
|
99
|
-
configureSdk: () => {}
|
|
111
|
+
configureSdk: () => {},
|
|
112
|
+
stateUpdate: () => {}
|
|
100
113
|
},
|
|
101
114
|
model,
|
|
102
115
|
trustedHosts
|