@builder.io/sdk-svelte 4.1.1 → 4.1.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.
- package/lib/browser/components/content/components/enable-editor.svelte +1 -2
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/get-processed-block.js +4 -3
- package/lib/browser/scripts/init-editing.d.ts +0 -1
- package/lib/browser/scripts/init-editing.js +0 -24
- package/lib/edge/components/content/components/enable-editor.svelte +1 -2
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/get-processed-block.js +4 -3
- package/lib/edge/scripts/init-editing.d.ts +0 -1
- package/lib/edge/scripts/init-editing.js +0 -24
- package/lib/node/components/content/components/enable-editor.svelte +1 -2
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/get-processed-block.js +4 -3
- package/lib/node/scripts/init-editing.d.ts +0 -1
- package/lib/node/scripts/init-editing.js +0 -24
- package/package.json +1 -1
- package/src/components/content/components/enable-editor.svelte +1 -5
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-processed-block.ts +4 -3
- package/src/scripts/init-editing.ts +0 -24
|
@@ -16,7 +16,7 @@ import { getDefaultCanTrack } from "../../../helpers/canTrack";
|
|
|
16
16
|
import { getCookieSync } from "../../../helpers/cookie";
|
|
17
17
|
import "../../../helpers/preview-lru-cache/set";
|
|
18
18
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor";
|
|
19
|
-
import {
|
|
19
|
+
import { setupBrowserForEditing } from "../../../scripts/init-editing";
|
|
20
20
|
import { triggerAnimation } from "../../block/animator";
|
|
21
21
|
import "../../dynamic-div.svelte";
|
|
22
22
|
import { needsElementRefDivForEditing } from "./enable-editor.helpers";
|
|
@@ -174,7 +174,6 @@ function emitStateUpdate() {
|
|
|
174
174
|
}
|
|
175
175
|
function elementRef_onIniteditingbldr(event) {
|
|
176
176
|
window.addEventListener("message", processMessage);
|
|
177
|
-
registerInsertMenu();
|
|
178
177
|
setupBrowserForEditing({
|
|
179
178
|
...(locale
|
|
180
179
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.1.
|
|
1
|
+
export declare const SDK_VERSION = "4.1.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.1.
|
|
1
|
+
export const SDK_VERSION = "4.1.3";
|
|
@@ -73,13 +73,14 @@ const evaluateBindings = ({ block, context, localState, rootState, rootSetState
|
|
|
73
73
|
return copied;
|
|
74
74
|
};
|
|
75
75
|
export function getProcessedBlock({ block, context, localState, rootState, rootSetState }) {
|
|
76
|
-
let transformedBlock =
|
|
77
|
-
transformedBlock =
|
|
78
|
-
return evaluateBindings({
|
|
76
|
+
let transformedBlock = transformBlock(block);
|
|
77
|
+
transformedBlock = evaluateBindings({
|
|
79
78
|
block: transformedBlock,
|
|
80
79
|
localState,
|
|
81
80
|
rootState,
|
|
82
81
|
rootSetState,
|
|
83
82
|
context
|
|
84
83
|
});
|
|
84
|
+
transformedBlock = resolveLocalizedValues(transformedBlock, rootState.locale);
|
|
85
|
+
return transformedBlock;
|
|
85
86
|
}
|
|
@@ -2,30 +2,6 @@ import { SDK_VERSION } from '../constants/sdk-version';
|
|
|
2
2
|
import { TARGET } from '../constants/target';
|
|
3
3
|
import { isBrowser } from '../functions/is-browser';
|
|
4
4
|
import { isFromTrustedHost } from '../functions/is-from-trusted-host';
|
|
5
|
-
import { register } from '../functions/register';
|
|
6
|
-
export const registerInsertMenu = () => {
|
|
7
|
-
register('insertMenu', {
|
|
8
|
-
name: '_default',
|
|
9
|
-
default: true,
|
|
10
|
-
items: [{
|
|
11
|
-
name: 'Box'
|
|
12
|
-
}, {
|
|
13
|
-
name: 'Text'
|
|
14
|
-
}, {
|
|
15
|
-
name: 'Image'
|
|
16
|
-
}, {
|
|
17
|
-
name: 'Columns'
|
|
18
|
-
}, ...(TARGET === 'reactNative' ? [] : [{
|
|
19
|
-
name: 'Core:Section'
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Core:Button'
|
|
22
|
-
}, {
|
|
23
|
-
name: 'Embed'
|
|
24
|
-
}, {
|
|
25
|
-
name: 'Custom Code'
|
|
26
|
-
}])]
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
5
|
let isSetupForEditing = false;
|
|
30
6
|
export const setupBrowserForEditing = (options) => {
|
|
31
7
|
if (isSetupForEditing) {
|
|
@@ -16,7 +16,7 @@ import { getDefaultCanTrack } from "../../../helpers/canTrack";
|
|
|
16
16
|
import { getCookieSync } from "../../../helpers/cookie";
|
|
17
17
|
import "../../../helpers/preview-lru-cache/set";
|
|
18
18
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor";
|
|
19
|
-
import {
|
|
19
|
+
import { setupBrowserForEditing } from "../../../scripts/init-editing";
|
|
20
20
|
import { triggerAnimation } from "../../block/animator";
|
|
21
21
|
import "../../dynamic-div.svelte";
|
|
22
22
|
import { needsElementRefDivForEditing } from "./enable-editor.helpers";
|
|
@@ -174,7 +174,6 @@ function emitStateUpdate() {
|
|
|
174
174
|
}
|
|
175
175
|
function elementRef_onIniteditingbldr(event) {
|
|
176
176
|
window.addEventListener("message", processMessage);
|
|
177
|
-
registerInsertMenu();
|
|
178
177
|
setupBrowserForEditing({
|
|
179
178
|
...(locale
|
|
180
179
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.1.
|
|
1
|
+
export declare const SDK_VERSION = "4.1.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.1.
|
|
1
|
+
export const SDK_VERSION = "4.1.3";
|
|
@@ -73,13 +73,14 @@ const evaluateBindings = ({ block, context, localState, rootState, rootSetState
|
|
|
73
73
|
return copied;
|
|
74
74
|
};
|
|
75
75
|
export function getProcessedBlock({ block, context, localState, rootState, rootSetState }) {
|
|
76
|
-
let transformedBlock =
|
|
77
|
-
transformedBlock =
|
|
78
|
-
return evaluateBindings({
|
|
76
|
+
let transformedBlock = transformBlock(block);
|
|
77
|
+
transformedBlock = evaluateBindings({
|
|
79
78
|
block: transformedBlock,
|
|
80
79
|
localState,
|
|
81
80
|
rootState,
|
|
82
81
|
rootSetState,
|
|
83
82
|
context
|
|
84
83
|
});
|
|
84
|
+
transformedBlock = resolveLocalizedValues(transformedBlock, rootState.locale);
|
|
85
|
+
return transformedBlock;
|
|
85
86
|
}
|
|
@@ -2,30 +2,6 @@ import { SDK_VERSION } from '../constants/sdk-version';
|
|
|
2
2
|
import { TARGET } from '../constants/target';
|
|
3
3
|
import { isBrowser } from '../functions/is-browser';
|
|
4
4
|
import { isFromTrustedHost } from '../functions/is-from-trusted-host';
|
|
5
|
-
import { register } from '../functions/register';
|
|
6
|
-
export const registerInsertMenu = () => {
|
|
7
|
-
register('insertMenu', {
|
|
8
|
-
name: '_default',
|
|
9
|
-
default: true,
|
|
10
|
-
items: [{
|
|
11
|
-
name: 'Box'
|
|
12
|
-
}, {
|
|
13
|
-
name: 'Text'
|
|
14
|
-
}, {
|
|
15
|
-
name: 'Image'
|
|
16
|
-
}, {
|
|
17
|
-
name: 'Columns'
|
|
18
|
-
}, ...(TARGET === 'reactNative' ? [] : [{
|
|
19
|
-
name: 'Core:Section'
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Core:Button'
|
|
22
|
-
}, {
|
|
23
|
-
name: 'Embed'
|
|
24
|
-
}, {
|
|
25
|
-
name: 'Custom Code'
|
|
26
|
-
}])]
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
5
|
let isSetupForEditing = false;
|
|
30
6
|
export const setupBrowserForEditing = (options) => {
|
|
31
7
|
if (isSetupForEditing) {
|
|
@@ -16,7 +16,7 @@ import { getDefaultCanTrack } from "../../../helpers/canTrack";
|
|
|
16
16
|
import { getCookieSync } from "../../../helpers/cookie";
|
|
17
17
|
import "../../../helpers/preview-lru-cache/set";
|
|
18
18
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor";
|
|
19
|
-
import {
|
|
19
|
+
import { setupBrowserForEditing } from "../../../scripts/init-editing";
|
|
20
20
|
import { triggerAnimation } from "../../block/animator";
|
|
21
21
|
import "../../dynamic-div.svelte";
|
|
22
22
|
import { needsElementRefDivForEditing } from "./enable-editor.helpers";
|
|
@@ -174,7 +174,6 @@ function emitStateUpdate() {
|
|
|
174
174
|
}
|
|
175
175
|
function elementRef_onIniteditingbldr(event) {
|
|
176
176
|
window.addEventListener("message", processMessage);
|
|
177
|
-
registerInsertMenu();
|
|
178
177
|
setupBrowserForEditing({
|
|
179
178
|
...(locale
|
|
180
179
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.1.
|
|
1
|
+
export declare const SDK_VERSION = "4.1.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.1.
|
|
1
|
+
export const SDK_VERSION = "4.1.3";
|
|
@@ -73,13 +73,14 @@ const evaluateBindings = ({ block, context, localState, rootState, rootSetState
|
|
|
73
73
|
return copied;
|
|
74
74
|
};
|
|
75
75
|
export function getProcessedBlock({ block, context, localState, rootState, rootSetState }) {
|
|
76
|
-
let transformedBlock =
|
|
77
|
-
transformedBlock =
|
|
78
|
-
return evaluateBindings({
|
|
76
|
+
let transformedBlock = transformBlock(block);
|
|
77
|
+
transformedBlock = evaluateBindings({
|
|
79
78
|
block: transformedBlock,
|
|
80
79
|
localState,
|
|
81
80
|
rootState,
|
|
82
81
|
rootSetState,
|
|
83
82
|
context
|
|
84
83
|
});
|
|
84
|
+
transformedBlock = resolveLocalizedValues(transformedBlock, rootState.locale);
|
|
85
|
+
return transformedBlock;
|
|
85
86
|
}
|
|
@@ -2,30 +2,6 @@ import { SDK_VERSION } from '../constants/sdk-version';
|
|
|
2
2
|
import { TARGET } from '../constants/target';
|
|
3
3
|
import { isBrowser } from '../functions/is-browser';
|
|
4
4
|
import { isFromTrustedHost } from '../functions/is-from-trusted-host';
|
|
5
|
-
import { register } from '../functions/register';
|
|
6
|
-
export const registerInsertMenu = () => {
|
|
7
|
-
register('insertMenu', {
|
|
8
|
-
name: '_default',
|
|
9
|
-
default: true,
|
|
10
|
-
items: [{
|
|
11
|
-
name: 'Box'
|
|
12
|
-
}, {
|
|
13
|
-
name: 'Text'
|
|
14
|
-
}, {
|
|
15
|
-
name: 'Image'
|
|
16
|
-
}, {
|
|
17
|
-
name: 'Columns'
|
|
18
|
-
}, ...(TARGET === 'reactNative' ? [] : [{
|
|
19
|
-
name: 'Core:Section'
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Core:Button'
|
|
22
|
-
}, {
|
|
23
|
-
name: 'Embed'
|
|
24
|
-
}, {
|
|
25
|
-
name: 'Custom Code'
|
|
26
|
-
}])]
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
5
|
let isSetupForEditing = false;
|
|
30
6
|
export const setupBrowserForEditing = (options) => {
|
|
31
7
|
if (isSetupForEditing) {
|
package/package.json
CHANGED
|
@@ -33,10 +33,7 @@
|
|
|
33
33
|
import { getCookieSync } from "../../../helpers/cookie";
|
|
34
34
|
import { postPreviewContent } from "../../../helpers/preview-lru-cache/set";
|
|
35
35
|
import { createEditorListener } from "../../../helpers/subscribe-to-editor";
|
|
36
|
-
import {
|
|
37
|
-
registerInsertMenu,
|
|
38
|
-
setupBrowserForEditing,
|
|
39
|
-
} from "../../../scripts/init-editing";
|
|
36
|
+
import { setupBrowserForEditing } from "../../../scripts/init-editing";
|
|
40
37
|
import type { BuilderContent } from "../../../types/builder-content";
|
|
41
38
|
import type { ComponentInfo } from "../../../types/components";
|
|
42
39
|
import type { Dictionary } from "../../../types/typescript";
|
|
@@ -216,7 +213,6 @@
|
|
|
216
213
|
}
|
|
217
214
|
function elementRef_onIniteditingbldr(event) {
|
|
218
215
|
window.addEventListener("message", processMessage);
|
|
219
|
-
registerInsertMenu();
|
|
220
216
|
setupBrowserForEditing({
|
|
221
217
|
...(locale
|
|
222
218
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.1.
|
|
1
|
+
export const SDK_VERSION = "4.1.3"
|
|
@@ -91,13 +91,14 @@ export function getProcessedBlock({
|
|
|
91
91
|
}: {
|
|
92
92
|
block: BuilderBlock;
|
|
93
93
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock {
|
|
94
|
-
let transformedBlock =
|
|
95
|
-
transformedBlock =
|
|
96
|
-
return evaluateBindings({
|
|
94
|
+
let transformedBlock = transformBlock(block);
|
|
95
|
+
transformedBlock = evaluateBindings({
|
|
97
96
|
block: transformedBlock,
|
|
98
97
|
localState,
|
|
99
98
|
rootState,
|
|
100
99
|
rootSetState,
|
|
101
100
|
context
|
|
102
101
|
});
|
|
102
|
+
transformedBlock = resolveLocalizedValues(transformedBlock, (rootState.locale as string | undefined));
|
|
103
|
+
return transformedBlock;
|
|
103
104
|
}
|
|
@@ -2,30 +2,6 @@ import { SDK_VERSION } from '../constants/sdk-version';
|
|
|
2
2
|
import { TARGET } from '../constants/target';
|
|
3
3
|
import { isBrowser } from '../functions/is-browser';
|
|
4
4
|
import { isFromTrustedHost } from '../functions/is-from-trusted-host';
|
|
5
|
-
import { register } from '../functions/register';
|
|
6
|
-
export const registerInsertMenu = () => {
|
|
7
|
-
register('insertMenu', {
|
|
8
|
-
name: '_default',
|
|
9
|
-
default: true,
|
|
10
|
-
items: [{
|
|
11
|
-
name: 'Box'
|
|
12
|
-
}, {
|
|
13
|
-
name: 'Text'
|
|
14
|
-
}, {
|
|
15
|
-
name: 'Image'
|
|
16
|
-
}, {
|
|
17
|
-
name: 'Columns'
|
|
18
|
-
}, ...(TARGET === 'reactNative' ? [] : [{
|
|
19
|
-
name: 'Core:Section'
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Core:Button'
|
|
22
|
-
}, {
|
|
23
|
-
name: 'Embed'
|
|
24
|
-
}, {
|
|
25
|
-
name: 'Custom Code'
|
|
26
|
-
}])]
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
5
|
let isSetupForEditing = false;
|
|
30
6
|
export const setupBrowserForEditing = (options: {
|
|
31
7
|
modelName: string;
|