@builder.io/sdk-solid 0.5.8 → 0.6.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.
- package/README.md +0 -4
- package/dist/index.d.ts +51 -0
- package/lib/browser/dev.js +4790 -0
- package/lib/browser/dev.jsx +4392 -0
- package/lib/browser/index.js +4767 -0
- package/lib/browser/index.jsx +4374 -0
- package/lib/edge/dev.js +7921 -0
- package/lib/edge/dev.jsx +7525 -0
- package/lib/edge/index.js +7898 -0
- package/lib/edge/index.jsx +7507 -0
- package/lib/node/dev.js +4790 -0
- package/lib/node/dev.jsx +4392 -0
- package/lib/node/index.js +4767 -0
- package/lib/node/index.jsx +4374 -0
- package/package.json +86 -14
- package/CHANGELOG.md +0 -98
- package/solid-index.jsx +0 -5
- package/src/blocks/BaseText.jsx +0 -11
- package/src/blocks/button/button.jsx +0 -41
- package/src/blocks/button/component-info.js +0 -34
- package/src/blocks/columns/columns.jsx +0 -174
- package/src/blocks/columns/component-info.js +0 -218
- package/src/blocks/custom-code/component-info.js +0 -24
- package/src/blocks/custom-code/custom-code.jsx +0 -62
- package/src/blocks/embed/component-info.js +0 -37
- package/src/blocks/embed/embed.jsx +0 -50
- package/src/blocks/embed/helpers.js +0 -3
- package/src/blocks/form/component-info.js +0 -223
- package/src/blocks/form/form.jsx +0 -5
- package/src/blocks/fragment/component-info.js +0 -8
- package/src/blocks/fragment/fragment.jsx +0 -5
- package/src/blocks/helpers.js +0 -27
- package/src/blocks/image/component-info.js +0 -122
- package/src/blocks/image/image.helpers.js +0 -46
- package/src/blocks/image/image.jsx +0 -122
- package/src/blocks/img/component-info.js +0 -15
- package/src/blocks/img/img.jsx +0 -20
- package/src/blocks/input/component-info.js +0 -45
- package/src/blocks/input/input.jsx +0 -22
- package/src/blocks/raw-text/component-info.js +0 -11
- package/src/blocks/raw-text/raw-text.jsx +0 -10
- package/src/blocks/section/component-info.js +0 -41
- package/src/blocks/section/section.jsx +0 -26
- package/src/blocks/select/component-info.js +0 -44
- package/src/blocks/select/select.jsx +0 -30
- package/src/blocks/submit-button/component-info.js +0 -23
- package/src/blocks/submit-button/submit-button.jsx +0 -11
- package/src/blocks/symbol/component-info.js +0 -35
- package/src/blocks/symbol/symbol.helpers.js +0 -60
- package/src/blocks/symbol/symbol.jsx +0 -64
- package/src/blocks/text/component-info.js +0 -20
- package/src/blocks/text/text.jsx +0 -14
- package/src/blocks/textarea/component-info.js +0 -38
- package/src/blocks/textarea/textarea.jsx +0 -16
- package/src/blocks/video/component-info.js +0 -83
- package/src/blocks/video/video.jsx +0 -61
- package/src/components/block/block.helpers.js +0 -99
- package/src/components/block/block.jsx +0 -167
- package/src/components/block/components/block-styles.jsx +0 -85
- package/src/components/block/components/block-wrapper.jsx +0 -50
- package/src/components/block/components/component-ref/component-ref.helpers.js +0 -41
- package/src/components/block/components/component-ref/component-ref.jsx +0 -58
- package/src/components/block/components/interactive-element.jsx +0 -30
- package/src/components/block/components/repeated-block.jsx +0 -20
- package/src/components/block/types.js +0 -0
- package/src/components/blocks/blocks-wrapper.jsx +0 -66
- package/src/components/blocks/blocks.jsx +0 -57
- package/src/components/content/components/enable-editor.jsx +0 -347
- package/src/components/content/components/styles.helpers.js +0 -56
- package/src/components/content/components/styles.jsx +0 -36
- package/src/components/content/content.helpers.js +0 -48
- package/src/components/content/content.jsx +0 -136
- package/src/components/content/content.types.js +0 -0
- package/src/components/content/index.js +0 -2
- package/src/components/content/wrap-component-ref.js +0 -2
- package/src/components/content-variants/content-variants.jsx +0 -115
- package/src/components/content-variants/content-variants.types.js +0 -0
- package/src/components/content-variants/helpers.js +0 -158
- package/src/components/inlined-script.jsx +0 -5
- package/src/components/inlined-styles.jsx +0 -5
- package/src/constants/builder-registered-components.js +0 -63
- package/src/constants/device-sizes.js +0 -48
- package/src/constants/sdk-version.js +0 -1
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -16
- package/src/context/components.context.js +0 -5
- package/src/context/types.js +0 -0
- package/src/functions/apply-patch-with-mutation.js +0 -66
- package/src/functions/camel-to-kebab-case.js +0 -2
- package/src/functions/evaluate/acorn-interpreter.js +0 -2876
- package/src/functions/evaluate/evaluate.js +0 -79
- package/src/functions/evaluate/index.js +0 -2
- package/src/functions/evaluate/non-node-runtime/index.js +0 -18
- package/src/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -92
- package/src/functions/evaluate/types.js +0 -0
- package/src/functions/event-handler-name.js +0 -5
- package/src/functions/extract-text-styles.js +0 -14
- package/src/functions/fast-clone.js +0 -2
- package/src/functions/fetch-builder-props.js +0 -60
- package/src/functions/get-block-actions-handler.js +0 -11
- package/src/functions/get-block-actions.js +0 -29
- package/src/functions/get-block-component-options.js +0 -27
- package/src/functions/get-block-properties.js +0 -63
- package/src/functions/get-builder-search-params/index.js +0 -33
- package/src/functions/get-content/generate-content-url.js +0 -59
- package/src/functions/get-content/index.js +0 -116
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +0 -12
- package/src/functions/get-global-this.js +0 -16
- package/src/functions/get-processed-block.js +0 -74
- package/src/functions/get-react-native-block-styles.js +0 -32
- package/src/functions/is-browser.js +0 -4
- package/src/functions/is-editing.js +0 -6
- package/src/functions/is-iframe.js +0 -5
- package/src/functions/is-non-node-server.js +0 -9
- package/src/functions/is-previewing.js +0 -12
- package/src/functions/on-change.js +0 -24
- package/src/functions/register-component.js +0 -60
- package/src/functions/register.js +0 -27
- package/src/functions/sanitize-react-native-block-styles.js +0 -71
- package/src/functions/set-editor-settings.js +0 -13
- package/src/functions/set.js +0 -9
- package/src/functions/track/helpers.js +0 -48
- package/src/functions/track/index.js +0 -131
- package/src/functions/track/interaction.js +0 -57
- package/src/functions/transform-block-properties.js +0 -4
- package/src/functions/transform-block.js +0 -4
- package/src/helpers/ab-tests.js +0 -158
- package/src/helpers/canTrack.js +0 -3
- package/src/helpers/cookie.js +0 -77
- package/src/helpers/css.js +0 -30
- package/src/helpers/flatten.js +0 -31
- package/src/helpers/localStorage.js +0 -32
- package/src/helpers/logger.js +0 -8
- package/src/helpers/nullable.js +0 -2
- package/src/helpers/preview-lru-cache/get.js +0 -4
- package/src/helpers/preview-lru-cache/helpers.js +0 -0
- package/src/helpers/preview-lru-cache/init.js +0 -2
- package/src/helpers/preview-lru-cache/set.js +0 -31
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +0 -55
- package/src/helpers/time.js +0 -3
- package/src/helpers/url.js +0 -11
- package/src/helpers/uuid.js +0 -11
- package/src/helpers/visitorId.js +0 -35
- package/src/index-helpers/blocks-exports.js +0 -13
- package/src/index-helpers/top-of-file.js +0 -2
- package/src/index.js +0 -12
- package/src/scripts/init-editing.js +0 -109
- package/src/types/api-version.js +0 -2
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/builder-props.js +0 -0
- package/src/types/can-track.js +0 -0
- package/src/types/components.js +0 -0
- package/src/types/deep-partial.js +0 -0
- package/src/types/element.js +0 -0
- package/src/types/enforced-partials.js +0 -0
- package/src/types/input.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
- package/vite.config.ts +0 -18
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Show, For, onMount, createSignal } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
checkShouldRunVariants,
|
|
5
|
-
getScriptString,
|
|
6
|
-
getVariants,
|
|
7
|
-
getVariantsScriptString,
|
|
8
|
-
} from "./helpers.js";
|
|
9
|
-
import ContentComponent from "../content/content";
|
|
10
|
-
import { getDefaultCanTrack } from "../../helpers/canTrack.js";
|
|
11
|
-
import InlinedStyles from "../inlined-styles";
|
|
12
|
-
import { handleABTestingSync } from "../../helpers/ab-tests.js";
|
|
13
|
-
import InlinedScript from "../inlined-script";
|
|
14
|
-
import { TARGET } from "../../constants/target.js";
|
|
15
|
-
|
|
16
|
-
function ContentVariants(props) {
|
|
17
|
-
const [shouldRenderVariants, setShouldRenderVariants] = createSignal(
|
|
18
|
-
checkShouldRunVariants({
|
|
19
|
-
canTrack: getDefaultCanTrack(props.canTrack),
|
|
20
|
-
content: props.content,
|
|
21
|
-
})
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
function variantScriptStr() {
|
|
25
|
-
return getVariantsScriptString(
|
|
26
|
-
getVariants(props.content).map((value) => ({
|
|
27
|
-
id: value.testVariationId,
|
|
28
|
-
testRatio: value.testRatio,
|
|
29
|
-
})),
|
|
30
|
-
props.content?.id || ""
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function hideVariantsStyleString() {
|
|
35
|
-
return getVariants(props.content)
|
|
36
|
-
.map((value) => `.variant-${value.testVariationId} { display: none; } `)
|
|
37
|
-
.join("");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function defaultContent() {
|
|
41
|
-
return shouldRenderVariants()
|
|
42
|
-
? {
|
|
43
|
-
...props.content,
|
|
44
|
-
testVariationId: props.content?.id,
|
|
45
|
-
}
|
|
46
|
-
: handleABTestingSync({
|
|
47
|
-
item: props.content,
|
|
48
|
-
canTrack: getDefaultCanTrack(props.canTrack),
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
onMount(() => {
|
|
53
|
-
/**
|
|
54
|
-
* We unmount the non-winning variants post-hydration in Vue.
|
|
55
|
-
*/
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<>
|
|
60
|
-
<Show when={!props.__isNestedRender && TARGET !== "reactNative"}>
|
|
61
|
-
<InlinedScript scriptStr={getScriptString()}></InlinedScript>
|
|
62
|
-
</Show>
|
|
63
|
-
<Show when={shouldRenderVariants()}>
|
|
64
|
-
<InlinedStyles
|
|
65
|
-
id={`variants-styles-${props.content?.id}`}
|
|
66
|
-
styles={hideVariantsStyleString()}
|
|
67
|
-
></InlinedStyles>
|
|
68
|
-
<InlinedScript scriptStr={variantScriptStr()}></InlinedScript>
|
|
69
|
-
<For each={getVariants(props.content)}>
|
|
70
|
-
{(variant, _index) => {
|
|
71
|
-
const index = _index();
|
|
72
|
-
return (
|
|
73
|
-
<ContentComponent
|
|
74
|
-
key={variant.testVariationId}
|
|
75
|
-
content={variant}
|
|
76
|
-
showContent={false}
|
|
77
|
-
classNameProp={undefined}
|
|
78
|
-
model={props.model}
|
|
79
|
-
data={props.data}
|
|
80
|
-
context={props.context}
|
|
81
|
-
apiKey={props.apiKey}
|
|
82
|
-
apiVersion={props.apiVersion}
|
|
83
|
-
customComponents={props.customComponents}
|
|
84
|
-
canTrack={props.canTrack}
|
|
85
|
-
locale={props.locale}
|
|
86
|
-
includeRefs={props.includeRefs}
|
|
87
|
-
enrich={props.enrich}
|
|
88
|
-
isSsrAbTest={shouldRenderVariants()}
|
|
89
|
-
></ContentComponent>
|
|
90
|
-
);
|
|
91
|
-
}}
|
|
92
|
-
</For>
|
|
93
|
-
</Show>
|
|
94
|
-
<ContentComponent
|
|
95
|
-
{...{}}
|
|
96
|
-
content={defaultContent()}
|
|
97
|
-
classNameProp={`variant-${props.content?.id}`}
|
|
98
|
-
showContent={true}
|
|
99
|
-
model={props.model}
|
|
100
|
-
data={props.data}
|
|
101
|
-
context={props.context}
|
|
102
|
-
apiKey={props.apiKey}
|
|
103
|
-
apiVersion={props.apiVersion}
|
|
104
|
-
customComponents={props.customComponents}
|
|
105
|
-
canTrack={props.canTrack}
|
|
106
|
-
locale={props.locale}
|
|
107
|
-
includeRefs={props.includeRefs}
|
|
108
|
-
enrich={props.enrich}
|
|
109
|
-
isSsrAbTest={shouldRenderVariants()}
|
|
110
|
-
></ContentComponent>
|
|
111
|
-
</>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export default ContentVariants;
|
|
File without changes
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
configurable: true,
|
|
10
|
-
writable: true,
|
|
11
|
-
value
|
|
12
|
-
}) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
import { TARGET } from "../../constants/target.js";
|
|
22
|
-
import { isBrowser } from "../../functions/is-browser.js";
|
|
23
|
-
const getVariants = content => Object.values((content == null ? void 0 : content.variations) || {}).map(variant => __spreadProps(__spreadValues({}, variant), {
|
|
24
|
-
testVariationId: variant.id,
|
|
25
|
-
id: content == null ? void 0 : content.id
|
|
26
|
-
}));
|
|
27
|
-
const checkShouldRunVariants = ({
|
|
28
|
-
canTrack,
|
|
29
|
-
content
|
|
30
|
-
}) => {
|
|
31
|
-
const hasVariants = getVariants(content).length > 0;
|
|
32
|
-
if (TARGET === "reactNative") return false;
|
|
33
|
-
if (!hasVariants) return false;
|
|
34
|
-
if (!canTrack) return false;
|
|
35
|
-
if (TARGET === "vue2" || TARGET === "vue3") return true;
|
|
36
|
-
if (isBrowser()) return false;
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
39
|
-
function bldrAbTest(contentId, variants, isHydrationTarget2) {
|
|
40
|
-
var _a;
|
|
41
|
-
function getAndSetVariantId() {
|
|
42
|
-
function setCookie(name, value, days) {
|
|
43
|
-
let expires = "";
|
|
44
|
-
if (days) {
|
|
45
|
-
const date = new Date();
|
|
46
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
|
|
47
|
-
expires = "; expires=" + date.toUTCString();
|
|
48
|
-
}
|
|
49
|
-
document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
|
|
50
|
-
}
|
|
51
|
-
function getCookie(name) {
|
|
52
|
-
const nameEQ = name + "=";
|
|
53
|
-
const ca = document.cookie.split(";");
|
|
54
|
-
for (let i = 0; i < ca.length; i++) {
|
|
55
|
-
let c = ca[i];
|
|
56
|
-
while (c.charAt(0) === " ") c = c.substring(1, c.length);
|
|
57
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
const cookieName = `builder.tests.${contentId}`;
|
|
62
|
-
const variantInCookie = getCookie(cookieName);
|
|
63
|
-
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
64
|
-
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
65
|
-
return variantInCookie;
|
|
66
|
-
}
|
|
67
|
-
let n = 0;
|
|
68
|
-
const random = Math.random();
|
|
69
|
-
for (let i = 0; i < variants.length; i++) {
|
|
70
|
-
const variant = variants[i];
|
|
71
|
-
const testRatio = variant.testRatio;
|
|
72
|
-
n += testRatio;
|
|
73
|
-
if (random < n) {
|
|
74
|
-
setCookie(cookieName, variant.id);
|
|
75
|
-
return variant.id;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
setCookie(cookieName, contentId);
|
|
79
|
-
return contentId;
|
|
80
|
-
}
|
|
81
|
-
const winningVariantId = getAndSetVariantId();
|
|
82
|
-
const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
|
|
83
|
-
if (isHydrationTarget2) {
|
|
84
|
-
styleEl.remove();
|
|
85
|
-
const thisScriptEl = document.currentScript;
|
|
86
|
-
thisScriptEl == null ? void 0 : thisScriptEl.remove();
|
|
87
|
-
} else {
|
|
88
|
-
const newStyleStr = variants.concat({
|
|
89
|
-
id: contentId
|
|
90
|
-
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
91
|
-
return `.variant-${value.id} { display: none; }
|
|
92
|
-
`;
|
|
93
|
-
}).join("");
|
|
94
|
-
styleEl.innerHTML = newStyleStr;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
|
|
98
|
-
var _a;
|
|
99
|
-
if (!navigator.cookieEnabled) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
function getCookie(name) {
|
|
103
|
-
const nameEQ = name + "=";
|
|
104
|
-
const ca = document.cookie.split(";");
|
|
105
|
-
for (let i = 0; i < ca.length; i++) {
|
|
106
|
-
let c = ca[i];
|
|
107
|
-
while (c.charAt(0) === " ") c = c.substring(1, c.length);
|
|
108
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
const cookieName = `builder.tests.${defaultContentId}`;
|
|
113
|
-
const variantId = getCookie(cookieName);
|
|
114
|
-
const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
|
|
115
|
-
const variantIsDefaultContent = variantContentId === defaultContentId;
|
|
116
|
-
if (variantId === variantContentId) {
|
|
117
|
-
if (variantIsDefaultContent) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
|
|
121
|
-
parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
|
|
122
|
-
} else {
|
|
123
|
-
if (variantIsDefaultContent) {
|
|
124
|
-
if (isHydrationTarget2) {
|
|
125
|
-
parentDiv == null ? void 0 : parentDiv.remove();
|
|
126
|
-
} else {
|
|
127
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
|
|
128
|
-
parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const getIsHydrationTarget = target => target === "react" || target === "reactNative";
|
|
136
|
-
const isHydrationTarget = getIsHydrationTarget(TARGET);
|
|
137
|
-
const AB_TEST_FN_NAME = "builderIoAbTest";
|
|
138
|
-
const CONTENT_FN_NAME = "builderIoRenderContent";
|
|
139
|
-
const getScriptString = () => {
|
|
140
|
-
const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
|
|
141
|
-
const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
142
|
-
return `
|
|
143
|
-
window.${AB_TEST_FN_NAME} = ${fnStr}
|
|
144
|
-
window.${CONTENT_FN_NAME} = ${fnStr2}
|
|
145
|
-
`;
|
|
146
|
-
};
|
|
147
|
-
const getVariantsScriptString = (variants, contentId) => {
|
|
148
|
-
return `
|
|
149
|
-
window.${AB_TEST_FN_NAME}("${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget})`;
|
|
150
|
-
};
|
|
151
|
-
const getRenderContentScriptString = ({
|
|
152
|
-
contentId,
|
|
153
|
-
variationId
|
|
154
|
-
}) => {
|
|
155
|
-
return `
|
|
156
|
-
window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
|
|
157
|
-
};
|
|
158
|
-
export { checkShouldRunVariants, getRenderContentScriptString, getScriptString, getVariants, getVariantsScriptString }
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value
|
|
10
|
-
}) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
|
-
import { default as Button } from "../blocks/button/button";
|
|
19
|
-
import { componentInfo as buttonComponentInfo } from "../blocks/button/component-info.js";
|
|
20
|
-
import { default as Columns } from "../blocks/columns/columns";
|
|
21
|
-
import { componentInfo as columnsComponentInfo } from "../blocks/columns/component-info.js";
|
|
22
|
-
import { componentInfo as fragmentComponentInfo } from "../blocks/fragment/component-info.js";
|
|
23
|
-
import { default as Fragment } from "../blocks/fragment/fragment";
|
|
24
|
-
import { componentInfo as imageComponentInfo } from "../blocks/image/component-info.js";
|
|
25
|
-
import { default as Image } from "../blocks/image/image";
|
|
26
|
-
import { componentInfo as sectionComponentInfo } from "../blocks/section/component-info.js";
|
|
27
|
-
import { default as Section } from "../blocks/section/section";
|
|
28
|
-
import { componentInfo as symbolComponentInfo } from "../blocks/symbol/component-info.js";
|
|
29
|
-
import { default as Symbol } from "../blocks/symbol/symbol";
|
|
30
|
-
import { componentInfo as textComponentInfo } from "../blocks/text/component-info.js";
|
|
31
|
-
import { default as Text } from "../blocks/text/text";
|
|
32
|
-
import { componentInfo as videoComponentInfo } from "../blocks/video/component-info.js";
|
|
33
|
-
import { default as Video } from "../blocks/video/video";
|
|
34
|
-
import { componentInfo as embedComponentInfo } from "../blocks/embed/component-info.js";
|
|
35
|
-
import { default as embed } from "../blocks/embed/embed";
|
|
36
|
-
import { default as Img } from "../blocks/img/img";
|
|
37
|
-
import { componentInfo as imgComponentInfo } from "../blocks/img/component-info.js";
|
|
38
|
-
import { default as customCode } from "../blocks/custom-code/custom-code";
|
|
39
|
-
import { componentInfo as customCodeInfo } from "../blocks/custom-code/component-info.js";
|
|
40
|
-
const getDefaultRegisteredComponents = () => [__spreadValues({
|
|
41
|
-
component: Button
|
|
42
|
-
}, buttonComponentInfo), __spreadValues({
|
|
43
|
-
component: Columns
|
|
44
|
-
}, columnsComponentInfo), __spreadValues({
|
|
45
|
-
component: customCode
|
|
46
|
-
}, customCodeInfo), __spreadValues({
|
|
47
|
-
component: embed
|
|
48
|
-
}, embedComponentInfo), __spreadValues({
|
|
49
|
-
component: Fragment
|
|
50
|
-
}, fragmentComponentInfo), __spreadValues({
|
|
51
|
-
component: Image
|
|
52
|
-
}, imageComponentInfo), __spreadValues({
|
|
53
|
-
component: Img
|
|
54
|
-
}, imgComponentInfo), __spreadValues({
|
|
55
|
-
component: Section
|
|
56
|
-
}, sectionComponentInfo), __spreadValues({
|
|
57
|
-
component: Symbol
|
|
58
|
-
}, symbolComponentInfo), __spreadValues({
|
|
59
|
-
component: Text
|
|
60
|
-
}, textComponentInfo), __spreadValues({
|
|
61
|
-
component: Video
|
|
62
|
-
}, videoComponentInfo)];
|
|
63
|
-
export { getDefaultRegisteredComponents }
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { fastClone } from "../functions/fast-clone.js";
|
|
2
|
-
const SIZES = {
|
|
3
|
-
small: {
|
|
4
|
-
min: 320,
|
|
5
|
-
default: 321,
|
|
6
|
-
max: 640
|
|
7
|
-
},
|
|
8
|
-
medium: {
|
|
9
|
-
min: 641,
|
|
10
|
-
default: 642,
|
|
11
|
-
max: 991
|
|
12
|
-
},
|
|
13
|
-
large: {
|
|
14
|
-
min: 990,
|
|
15
|
-
default: 991,
|
|
16
|
-
max: 1200
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
|
|
20
|
-
const getSizesForBreakpoints = ({
|
|
21
|
-
small,
|
|
22
|
-
medium
|
|
23
|
-
}) => {
|
|
24
|
-
const newSizes = fastClone(SIZES);
|
|
25
|
-
if (!small || !medium) {
|
|
26
|
-
return newSizes;
|
|
27
|
-
}
|
|
28
|
-
const smallMin = Math.floor(small / 2);
|
|
29
|
-
newSizes.small = {
|
|
30
|
-
max: small,
|
|
31
|
-
min: smallMin,
|
|
32
|
-
default: smallMin + 1
|
|
33
|
-
};
|
|
34
|
-
const mediumMin = newSizes.small.max + 1;
|
|
35
|
-
newSizes.medium = {
|
|
36
|
-
max: medium,
|
|
37
|
-
min: mediumMin,
|
|
38
|
-
default: mediumMin + 1
|
|
39
|
-
};
|
|
40
|
-
const largeMin = newSizes.medium.max + 1;
|
|
41
|
-
newSizes.large = {
|
|
42
|
-
max: 2e3,
|
|
43
|
-
min: largeMin,
|
|
44
|
-
default: largeMin + 1
|
|
45
|
-
};
|
|
46
|
-
return newSizes;
|
|
47
|
-
};
|
|
48
|
-
export { getMaxWidthQueryForSize, getSizesForBreakpoints }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.5.8"
|
package/src/constants/target.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createContext } from "solid-js";
|
|
2
|
-
var stdin_default = createContext({
|
|
3
|
-
content: null,
|
|
4
|
-
context: {},
|
|
5
|
-
localState: void 0,
|
|
6
|
-
rootSetState() {
|
|
7
|
-
},
|
|
8
|
-
rootState: {},
|
|
9
|
-
apiKey: null,
|
|
10
|
-
apiVersion: void 0,
|
|
11
|
-
componentInfos: {},
|
|
12
|
-
inheritedStyles: {}
|
|
13
|
-
});
|
|
14
|
-
export {
|
|
15
|
-
stdin_default as default
|
|
16
|
-
};
|
package/src/context/types.js
DELETED
|
File without changes
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value
|
|
10
|
-
}) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
|
-
const applyPatchWithMinimalMutationChain = (obj, patch, preserveRoot = false) => {
|
|
19
|
-
if (Object(obj) !== obj) {
|
|
20
|
-
return obj;
|
|
21
|
-
}
|
|
22
|
-
const {
|
|
23
|
-
path,
|
|
24
|
-
op,
|
|
25
|
-
value
|
|
26
|
-
} = patch;
|
|
27
|
-
const pathArr = path.split(/\//);
|
|
28
|
-
if (pathArr[0] === "") {
|
|
29
|
-
pathArr.shift();
|
|
30
|
-
}
|
|
31
|
-
const newObj = preserveRoot ? obj : __spreadValues({}, obj);
|
|
32
|
-
let objPart = newObj;
|
|
33
|
-
for (let i = 0; i < pathArr.length; i++) {
|
|
34
|
-
const isLast = i === pathArr.length - 1;
|
|
35
|
-
const property = pathArr[i];
|
|
36
|
-
if (isLast) {
|
|
37
|
-
if (op === "replace") {
|
|
38
|
-
objPart[property] = value;
|
|
39
|
-
} else if (op === "add") {
|
|
40
|
-
const index = Number(property);
|
|
41
|
-
if (Array.isArray(objPart)) {
|
|
42
|
-
if (property === "-") {
|
|
43
|
-
objPart.push(value);
|
|
44
|
-
} else {
|
|
45
|
-
objPart.splice(index, 0, value);
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
objPart[property] = value;
|
|
49
|
-
}
|
|
50
|
-
} else if (op === "remove") {
|
|
51
|
-
const index = Number(property);
|
|
52
|
-
if (Array.isArray(objPart)) {
|
|
53
|
-
objPart.splice(index, 1);
|
|
54
|
-
} else {
|
|
55
|
-
delete objPart[property];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
const nextProperty = pathArr[i + 1];
|
|
60
|
-
const newPart = Object(objPart[property]) === objPart[property] ? objPart[property] : String(Number(nextProperty)) === nextProperty ? [] : {};
|
|
61
|
-
objPart = objPart[property] = Array.isArray(newPart) ? [...newPart] : __spreadValues({}, newPart);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return newObj;
|
|
65
|
-
};
|
|
66
|
-
export { applyPatchWithMinimalMutationChain }
|