@builder.io/mitosis 0.0.63 → 0.0.65
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/dist/src/constants/html_tags.js +63 -0
- package/dist/src/flow.d.ts +3 -0
- package/dist/src/flow.js +5 -1
- package/dist/src/generators/angular.d.ts +1 -0
- package/dist/src/generators/angular.js +33 -10
- package/dist/src/generators/react/generator.js +4 -2
- package/dist/src/generators/react-native.js +51 -34
- package/dist/src/generators/svelte.js +7 -3
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/types/config.d.ts +3 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/__tests__/data/advanced-ref.raw.d.ts +0 -4
- package/dist/src/__tests__/data/advanced-ref.raw.jsx +0 -39
- package/dist/src/__tests__/data/basic-boolean-attribute-component.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic-boolean-attribute-component.raw.jsx +0 -8
- package/dist/src/__tests__/data/basic-boolean-attribute.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic-boolean-attribute.raw.jsx +0 -15
- package/dist/src/__tests__/data/basic-child-component.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-child-component.raw.jsx +0 -21
- package/dist/src/__tests__/data/basic-context.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-context.raw.jsx +0 -29
- package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.jsx +0 -10
- package/dist/src/__tests__/data/basic-for-show.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-for-show.raw.jsx +0 -20
- package/dist/src/__tests__/data/basic-for.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-for.raw.jsx +0 -23
- package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.d.ts +0 -5
- package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.jsx +0 -17
- package/dist/src/__tests__/data/basic-forwardRef.raw.d.ts +0 -5
- package/dist/src/__tests__/data/basic-forwardRef.raw.jsx +0 -14
- package/dist/src/__tests__/data/basic-onChange.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-onChange.raw.jsx +0 -17
- package/dist/src/__tests__/data/basic-onMount-update.raw.d.ts +0 -5
- package/dist/src/__tests__/data/basic-onMount-update.raw.jsx +0 -17
- package/dist/src/__tests__/data/basic-onUpdate-return.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-onUpdate-return.raw.jsx +0 -24
- package/dist/src/__tests__/data/basic-outputs-meta.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-outputs-meta.raw.jsx +0 -17
- package/dist/src/__tests__/data/basic-outputs.raw.d.ts +0 -1
- package/dist/src/__tests__/data/basic-outputs.raw.jsx +0 -14
- package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.jsx +0 -14
- package/dist/src/__tests__/data/basic-props-destructure.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic-props-destructure.raw.jsx +0 -14
- package/dist/src/__tests__/data/basic-props.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic-props.raw.jsx +0 -13
- package/dist/src/__tests__/data/basic-ref-assignment.raw.d.ts +0 -4
- package/dist/src/__tests__/data/basic-ref-assignment.raw.jsx +0 -15
- package/dist/src/__tests__/data/basic-ref-usePrevious.raw.d.ts +0 -5
- package/dist/src/__tests__/data/basic-ref-usePrevious.raw.jsx +0 -35
- package/dist/src/__tests__/data/basic-ref.raw.d.ts +0 -4
- package/dist/src/__tests__/data/basic-ref.raw.jsx +0 -36
- package/dist/src/__tests__/data/basic.raw.d.ts +0 -6
- package/dist/src/__tests__/data/basic.raw.jsx +0 -22
- package/dist/src/__tests__/data/blocks/button-with-metadata.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/button-with-metadata.raw.jsx +0 -23
- package/dist/src/__tests__/data/blocks/button.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/button.raw.jsx +0 -18
- package/dist/src/__tests__/data/blocks/classname-jsx.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/classname-jsx.raw.jsx +0 -15
- package/dist/src/__tests__/data/blocks/columns.raw.d.ts +0 -12
- package/dist/src/__tests__/data/blocks/columns.raw.jsx +0 -42
- package/dist/src/__tests__/data/blocks/content-slot-html.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/content-slot-html.raw.jsx +0 -15
- package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.jsx +0 -15
- package/dist/src/__tests__/data/blocks/custom-code.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/custom-code.raw.jsx +0 -48
- package/dist/src/__tests__/data/blocks/embed.raw.d.ts +0 -4
- package/dist/src/__tests__/data/blocks/embed.raw.jsx +0 -48
- package/dist/src/__tests__/data/blocks/form.raw.d.ts +0 -25
- package/dist/src/__tests__/data/blocks/form.raw.jsx +0 -272
- package/dist/src/__tests__/data/blocks/image.raw.d.ts +0 -15
- package/dist/src/__tests__/data/blocks/image.raw.jsx +0 -65
- package/dist/src/__tests__/data/blocks/img-state.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/img-state.raw.jsx +0 -17
- package/dist/src/__tests__/data/blocks/img.raw.d.ts +0 -9
- package/dist/src/__tests__/data/blocks/img.raw.jsx +0 -11
- package/dist/src/__tests__/data/blocks/input.raw.d.ts +0 -11
- package/dist/src/__tests__/data/blocks/input.raw.jsx +0 -8
- package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.jsx +0 -13
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.jsx +0 -25
- package/dist/src/__tests__/data/blocks/onInit-onMount.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onInit-onMount.raw.jsx +0 -13
- package/dist/src/__tests__/data/blocks/onInit.raw.d.ts +0 -8
- package/dist/src/__tests__/data/blocks/onInit.raw.jsx +0 -20
- package/dist/src/__tests__/data/blocks/onMount.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onMount.raw.jsx +0 -13
- package/dist/src/__tests__/data/blocks/onUpdate.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onUpdate.raw.jsx +0 -10
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +0 -14
- package/dist/src/__tests__/data/blocks/raw-text.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/raw-text.raw.jsx +0 -7
- package/dist/src/__tests__/data/blocks/root-fragment-multi-node.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/root-fragment-multi-node.raw.jsx +0 -18
- package/dist/src/__tests__/data/blocks/rootShow.raw.d.ts +0 -3
- package/dist/src/__tests__/data/blocks/rootShow.raw.jsx +0 -9
- package/dist/src/__tests__/data/blocks/section-state.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/section-state.raw.jsx +0 -17
- package/dist/src/__tests__/data/blocks/section.raw.d.ts +0 -7
- package/dist/src/__tests__/data/blocks/section.raw.jsx +0 -11
- package/dist/src/__tests__/data/blocks/select.raw.d.ts +0 -11
- package/dist/src/__tests__/data/blocks/select.raw.jsx +0 -14
- package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.jsx +0 -15
- package/dist/src/__tests__/data/blocks/self-referencing-component.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/self-referencing-component.raw.jsx +0 -12
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.jsx +0 -52
- package/dist/src/__tests__/data/blocks/slot-html.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/slot-html.raw.jsx +0 -15
- package/dist/src/__tests__/data/blocks/slot-jsx.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/slot-jsx.raw.jsx +0 -12
- package/dist/src/__tests__/data/blocks/stamped-io.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +0 -60
- package/dist/src/__tests__/data/blocks/submit-button.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/submit-button.raw.jsx +0 -9
- package/dist/src/__tests__/data/blocks/text.raw.d.ts +0 -8
- package/dist/src/__tests__/data/blocks/text.raw.jsx +0 -19
- package/dist/src/__tests__/data/blocks/textarea.raw.d.ts +0 -8
- package/dist/src/__tests__/data/blocks/textarea.raw.jsx +0 -6
- package/dist/src/__tests__/data/blocks/video.raw.d.ts +0 -17
- package/dist/src/__tests__/data/blocks/video.raw.jsx +0 -21
- package/dist/src/__tests__/data/context/component-with-context.lite.d.ts +0 -3
- package/dist/src/__tests__/data/context/component-with-context.lite.jsx +0 -21
- package/dist/src/__tests__/data/context/simple.context.lite.d.ts +0 -9
- package/dist/src/__tests__/data/context/simple.context.lite.js +0 -15
- package/dist/src/__tests__/data/default-props/default-props.raw.d.ts +0 -7
- package/dist/src/__tests__/data/default-props/default-props.raw.jsx +0 -23
- package/dist/src/__tests__/data/jsx-json.spec.d.ts +0 -2
- package/dist/src/__tests__/data/jsx-json.spec.js +0 -10226
- package/dist/src/__tests__/data/nested-styles.lite.d.ts +0 -1
- package/dist/src/__tests__/data/nested-styles.lite.jsx +0 -20
- package/dist/src/__tests__/data/show/nested-show.raw.d.ts +0 -6
- package/dist/src/__tests__/data/show/nested-show.raw.jsx +0 -11
- package/dist/src/__tests__/data/show/show-with-for.raw.d.ts +0 -6
- package/dist/src/__tests__/data/show/show-with-for.raw.jsx +0 -9
- package/dist/src/__tests__/data/styles/class-and-className.raw.d.ts +0 -1
- package/dist/src/__tests__/data/styles/class-and-className.raw.jsx +0 -10
- package/dist/src/__tests__/data/styles/class.raw.d.ts +0 -1
- package/dist/src/__tests__/data/styles/class.raw.jsx +0 -10
- package/dist/src/__tests__/data/styles/className.raw.d.ts +0 -1
- package/dist/src/__tests__/data/styles/className.raw.jsx +0 -10
- package/dist/src/__tests__/data/styles/classState.raw.d.ts +0 -1
- package/dist/src/__tests__/data/styles/classState.raw.jsx +0 -13
- package/dist/src/__tests__/data/types/component-props-interface.raw.d.ts +0 -6
- package/dist/src/__tests__/data/types/component-props-interface.raw.jsx +0 -6
- package/dist/src/__tests__/data/types/component-props-type.raw.d.ts +0 -6
- package/dist/src/__tests__/data/types/component-props-type.raw.jsx +0 -6
- package/dist/src/__tests__/data/types/component-with-default-values-types.raw.d.ts +0 -5
- package/dist/src/__tests__/data/types/component-with-default-values-types.raw.jsx +0 -9
- package/dist/src/__tests__/data/types/foo-type.d.ts +0 -1
- package/dist/src/__tests__/data/types/foo-type.js +0 -2
- package/dist/src/__tests__/data/types/preserve-typing.raw.d.ts +0 -8
- package/dist/src/__tests__/data/types/preserve-typing.raw.jsx +0 -6
- package/dist/src/__tests__/data/types/type-dependency.raw.d.ts +0 -7
- package/dist/src/__tests__/data/types/type-dependency.raw.jsx +0 -6
- package/dist/src/__tests__/data/types/type-export.lite.d.ts +0 -3
- package/dist/src/__tests__/data/types/type-export.lite.jsx +0 -6
- package/dist/src/__tests__/shared.d.ts +0 -8
- package/dist/src/__tests__/shared.js +0 -369
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import '@builder.io/mitosis';
|
|
2
|
-
export interface ImgProps {
|
|
3
|
-
attributes?: any;
|
|
4
|
-
imgSrc?: string;
|
|
5
|
-
altText?: string;
|
|
6
|
-
backgroundSize?: 'cover' | 'contain';
|
|
7
|
-
backgroundPosition?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
8
|
-
}
|
|
9
|
-
export default function ImgComponent(props: ImgProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@builder.io/mitosis");
|
|
4
|
-
var sdk_1 = require("@builder.io/sdk");
|
|
5
|
-
function ImgComponent(props) {
|
|
6
|
-
return (<img style={{
|
|
7
|
-
objectFit: props.backgroundSize || 'cover',
|
|
8
|
-
objectPosition: props.backgroundPosition || 'center',
|
|
9
|
-
}} {...props.attributes} key={(sdk_1.Builder.isEditing && props.imgSrc) || 'default-key'} alt={props.altText} src={props.imgSrc}/>);
|
|
10
|
-
}
|
|
11
|
-
exports.default = ImgComponent;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import '@builder.io/mitosis';
|
|
2
|
-
export interface FormInputProps {
|
|
3
|
-
type?: string;
|
|
4
|
-
attributes?: any;
|
|
5
|
-
name?: string;
|
|
6
|
-
value?: string;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
defaultValue?: string;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export default function FormInputComponent(props: FormInputProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@builder.io/mitosis");
|
|
4
|
-
var sdk_1 = require("@builder.io/sdk");
|
|
5
|
-
function FormInputComponent(props) {
|
|
6
|
-
return (<input {...props.attributes} key={sdk_1.Builder.isEditing && props.defaultValue ? props.defaultValue : 'default-key'} placeholder={props.placeholder} type={props.type} name={props.name} value={props.value} defaultValue={props.defaultValue} required={props.required}/>);
|
|
7
|
-
}
|
|
8
|
-
exports.default = FormInputComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function MultipleOnUpdate(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function MultipleOnUpdate() {
|
|
5
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
6
|
-
console.log('Runs on every update/rerender');
|
|
7
|
-
});
|
|
8
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
9
|
-
console.log('Runs on every update/rerender as well');
|
|
10
|
-
});
|
|
11
|
-
return <div />;
|
|
12
|
-
}
|
|
13
|
-
exports.default = MultipleOnUpdate;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function MultipleOnUpdateWithDeps(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function MultipleOnUpdateWithDeps() {
|
|
5
|
-
var state = (0, mitosis_1.useStore)({
|
|
6
|
-
a: 'a',
|
|
7
|
-
b: 'b',
|
|
8
|
-
c: 'c',
|
|
9
|
-
d: 'd',
|
|
10
|
-
});
|
|
11
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
12
|
-
console.log('Runs when a or b changes', state.a, state.b);
|
|
13
|
-
if (state.a === 'a') {
|
|
14
|
-
state.a = 'b';
|
|
15
|
-
}
|
|
16
|
-
}, [state.a, state.b]);
|
|
17
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
18
|
-
console.log('Runs when c or d changes', state.c, state.d);
|
|
19
|
-
if (state.a === 'a') {
|
|
20
|
-
state.a = 'b';
|
|
21
|
-
}
|
|
22
|
-
}, [state.c, state.d]);
|
|
23
|
-
return <div />;
|
|
24
|
-
}
|
|
25
|
-
exports.default = MultipleOnUpdateWithDeps;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function OnInit(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function OnInit() {
|
|
5
|
-
(0, mitosis_1.onInit)(function () {
|
|
6
|
-
console.log('onInit');
|
|
7
|
-
});
|
|
8
|
-
(0, mitosis_1.onMount)(function () {
|
|
9
|
-
console.log('onMount');
|
|
10
|
-
});
|
|
11
|
-
return <div />;
|
|
12
|
-
}
|
|
13
|
-
exports.default = OnInit;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultValues = void 0;
|
|
4
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
5
|
-
exports.defaultValues = {
|
|
6
|
-
name: 'PatrickJS',
|
|
7
|
-
};
|
|
8
|
-
function OnInit(props) {
|
|
9
|
-
var state = (0, mitosis_1.useStore)({
|
|
10
|
-
// name: props.name
|
|
11
|
-
// name: defaultValues.name || props.name,
|
|
12
|
-
name: '',
|
|
13
|
-
});
|
|
14
|
-
(0, mitosis_1.onInit)(function () {
|
|
15
|
-
state.name = exports.defaultValues.name || props.name;
|
|
16
|
-
console.log('set defaults with props');
|
|
17
|
-
});
|
|
18
|
-
return <div>Default name defined by parent {state.name}</div>;
|
|
19
|
-
}
|
|
20
|
-
exports.default = OnInit;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Comp(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function Comp() {
|
|
5
|
-
(0, mitosis_1.onMount)(function () {
|
|
6
|
-
console.log('Runs on mount');
|
|
7
|
-
});
|
|
8
|
-
(0, mitosis_1.onUnMount)(function () {
|
|
9
|
-
console.log('Runs on unMount');
|
|
10
|
-
});
|
|
11
|
-
return <div />;
|
|
12
|
-
}
|
|
13
|
-
exports.default = Comp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function OnUpdate(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function OnUpdate() {
|
|
5
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
6
|
-
console.log('Runs on every update/rerender');
|
|
7
|
-
});
|
|
8
|
-
return <div />;
|
|
9
|
-
}
|
|
10
|
-
exports.default = OnUpdate;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function OnUpdateWithDeps(props) {
|
|
5
|
-
var state = (0, mitosis_1.useStore)({
|
|
6
|
-
a: 'a',
|
|
7
|
-
b: 'b',
|
|
8
|
-
});
|
|
9
|
-
(0, mitosis_1.onUpdate)(function () {
|
|
10
|
-
console.log('Runs when a, b or size changes', state.a, state.b, props.size);
|
|
11
|
-
}, [state.a, state.b, props.size]);
|
|
12
|
-
return <div />;
|
|
13
|
-
}
|
|
14
|
-
exports.default = OnUpdateWithDeps;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function RawText(props) {
|
|
4
|
-
var _a, _b;
|
|
5
|
-
return (<span class={((_a = props.attributes) === null || _a === void 0 ? void 0 : _a.class) || ((_b = props.attributes) === null || _b === void 0 ? void 0 : _b.className)} innerHTML={props.text || ''}/>);
|
|
6
|
-
}
|
|
7
|
-
exports.default = RawText;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function Button(props) {
|
|
5
|
-
return (<>
|
|
6
|
-
<mitosis_1.Show when={props.link}>
|
|
7
|
-
<a {...props.attributes} href={props.link} target={props.openLinkInNewTab ? '_blank' : undefined}>
|
|
8
|
-
{props.text}
|
|
9
|
-
</a>
|
|
10
|
-
</mitosis_1.Show>
|
|
11
|
-
<mitosis_1.Show when={!props.link}>
|
|
12
|
-
<button {...props.attributes} type="button">
|
|
13
|
-
{props.text}
|
|
14
|
-
</button>
|
|
15
|
-
</mitosis_1.Show>
|
|
16
|
-
</>);
|
|
17
|
-
}
|
|
18
|
-
exports.default = Button;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function RenderStyles(props) {
|
|
5
|
-
return (<mitosis_1.Show when={props.foo === 'bar'} else={<div>Foo</div>}>
|
|
6
|
-
<div>Bar</div>
|
|
7
|
-
</mitosis_1.Show>);
|
|
8
|
-
}
|
|
9
|
-
exports.default = RenderStyles;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function SectionStateComponent(props) {
|
|
5
|
-
var state = (0, mitosis_1.useStore)({
|
|
6
|
-
max: 42,
|
|
7
|
-
items: [42],
|
|
8
|
-
});
|
|
9
|
-
return (<mitosis_1.Show when={state.max}>
|
|
10
|
-
<mitosis_1.For each={state.items}>
|
|
11
|
-
{function (item) { return (<section {...props.attributes} style={{ maxWidth: item + state.max }}>
|
|
12
|
-
{props.children}
|
|
13
|
-
</section>); }}
|
|
14
|
-
</mitosis_1.For>
|
|
15
|
-
</mitosis_1.Show>);
|
|
16
|
-
}
|
|
17
|
-
exports.default = SectionStateComponent;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@builder.io/mitosis");
|
|
4
|
-
function SectionComponent(props) {
|
|
5
|
-
return (<section {...props.attributes} style={props.maxWidth && typeof props.maxWidth === 'number'
|
|
6
|
-
? { maxWidth: props.maxWidth }
|
|
7
|
-
: undefined}>
|
|
8
|
-
{props.children}
|
|
9
|
-
</section>);
|
|
10
|
-
}
|
|
11
|
-
exports.default = SectionComponent;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface FormSelectProps {
|
|
2
|
-
options?: {
|
|
3
|
-
name?: string;
|
|
4
|
-
value: string;
|
|
5
|
-
}[];
|
|
6
|
-
attributes?: any;
|
|
7
|
-
name?: string;
|
|
8
|
-
value?: string;
|
|
9
|
-
defaultValue?: string;
|
|
10
|
-
}
|
|
11
|
-
export default function SelectComponent(props: FormSelectProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
var sdk_1 = require("@builder.io/sdk");
|
|
5
|
-
function SelectComponent(props) {
|
|
6
|
-
return (<select {...props.attributes} value={props.value} key={sdk_1.Builder.isEditing && props.defaultValue ? props.defaultValue : 'default-key'} defaultValue={props.defaultValue} name={props.name}>
|
|
7
|
-
<mitosis_1.For each={props.options}>
|
|
8
|
-
{function (option, index) { return (<option value={option.value} data-index={index}>
|
|
9
|
-
{option.name || option.value}
|
|
10
|
-
</option>); }}
|
|
11
|
-
</mitosis_1.For>
|
|
12
|
-
</select>);
|
|
13
|
-
}
|
|
14
|
-
exports.default = SelectComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function MyComponent(props: any): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function MyComponent(props) {
|
|
5
|
-
return (<div>
|
|
6
|
-
{props.name}
|
|
7
|
-
{props.children}
|
|
8
|
-
<mitosis_1.Show when={props.name === 'Batman'}>
|
|
9
|
-
<MyComponent name={'Bruce'}>
|
|
10
|
-
<div>Wayne</div>
|
|
11
|
-
</MyComponent>
|
|
12
|
-
</mitosis_1.Show>
|
|
13
|
-
</div>);
|
|
14
|
-
}
|
|
15
|
-
exports.default = MyComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function MyComponent(props: any): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
function MyComponent(props) {
|
|
5
|
-
return (<div>
|
|
6
|
-
{props.name}
|
|
7
|
-
<mitosis_1.Show when={props.name === 'Batman'}>
|
|
8
|
-
<MyComponent name={'Bruce Wayne'}/>
|
|
9
|
-
</mitosis_1.Show>
|
|
10
|
-
</div>);
|
|
11
|
-
}
|
|
12
|
-
exports.default = MyComponent;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
(0, mitosis_1.useMetadata)({ isAttachedToShadowDom: true });
|
|
5
|
-
function SmileReviews(props) {
|
|
6
|
-
var state = (0, mitosis_1.useStore)({
|
|
7
|
-
reviews: [],
|
|
8
|
-
name: 'test',
|
|
9
|
-
showReviewPrompt: false,
|
|
10
|
-
});
|
|
11
|
-
// TODO: allow async function here
|
|
12
|
-
(0, mitosis_1.onMount)(function () {
|
|
13
|
-
fetch("https://stamped.io/api/widget/reviews?storeUrl=builder-io.myshopify.com&apiKey=".concat(props.apiKey || 'pubkey-8bbDq7W6w4sB3OWeM1HUy2s47702hM', "&productId=").concat(props.productId || '2410511106127'))
|
|
14
|
-
.then(function (res) { return res.json(); })
|
|
15
|
-
.then(function (data) {
|
|
16
|
-
state.reviews = data.data;
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return (<div data-user={state.name}>
|
|
20
|
-
<button onClick={function () { return (state.showReviewPrompt = true); }}>Write a review</button>
|
|
21
|
-
<mitosis_1.Show when={state.showReviewPrompt}>
|
|
22
|
-
<input placeholder="Email"/>
|
|
23
|
-
|
|
24
|
-
<input css={{ display: 'block' }} placeholder="Title"/>
|
|
25
|
-
|
|
26
|
-
<textarea css={{ display: 'block' }} placeholder="How was your experience?"/>
|
|
27
|
-
<button css={{ display: 'block' }} onClick={function () {
|
|
28
|
-
state.showReviewPrompt = false;
|
|
29
|
-
}}>
|
|
30
|
-
Submit
|
|
31
|
-
</button>
|
|
32
|
-
</mitosis_1.Show>
|
|
33
|
-
<mitosis_1.For each={state.reviews}>
|
|
34
|
-
{function (review, index) { return (<div $name="Review" key={review.id} css={{
|
|
35
|
-
margin: '10px',
|
|
36
|
-
padding: '10px',
|
|
37
|
-
background: 'white',
|
|
38
|
-
display: 'flex',
|
|
39
|
-
borderRadius: '5px',
|
|
40
|
-
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
41
|
-
}}>
|
|
42
|
-
<img css={{ height: '30px', width: '30px', marginRight: '10px' }} src={review.avatar}/>
|
|
43
|
-
<div class={state.showReviewPrompt ? 'bg-primary' : 'bg-secondary'}>
|
|
44
|
-
<div>N: {index}</div>
|
|
45
|
-
<div>{review.author}</div>
|
|
46
|
-
<div>{review.reviewMessage}</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>); }}
|
|
49
|
-
</mitosis_1.For>
|
|
50
|
-
</div>);
|
|
51
|
-
}
|
|
52
|
-
exports.default = SmileReviews;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
7
|
-
var content_slot_jsx_raw_1 = __importDefault(require("./content-slot-jsx.raw"));
|
|
8
|
-
function SlotCode(props) {
|
|
9
|
-
return (<div>
|
|
10
|
-
<content_slot_jsx_raw_1.default>
|
|
11
|
-
<mitosis_1.Slot testing={<div>Hello</div>}></mitosis_1.Slot>
|
|
12
|
-
</content_slot_jsx_raw_1.default>
|
|
13
|
-
</div>);
|
|
14
|
-
}
|
|
15
|
-
exports.default = SlotCode;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var content_slot_jsx_raw_1 = __importDefault(require("./content-slot-jsx.raw"));
|
|
7
|
-
function SlotCode(props) {
|
|
8
|
-
return (<div>
|
|
9
|
-
<content_slot_jsx_raw_1.default slotTesting={<div>Hello</div>}/>
|
|
10
|
-
</div>);
|
|
11
|
-
}
|
|
12
|
-
exports.default = SlotCode;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
4
|
-
var lodash_1 = require("lodash");
|
|
5
|
-
var lodash_2 = require("lodash");
|
|
6
|
-
function SmileReviews(props) {
|
|
7
|
-
var state = (0, mitosis_1.useStore)({
|
|
8
|
-
reviews: [],
|
|
9
|
-
name: 'test',
|
|
10
|
-
showReviewPrompt: false,
|
|
11
|
-
kebabCaseValue: function () {
|
|
12
|
-
return (0, lodash_1.kebabCase)('testThat');
|
|
13
|
-
},
|
|
14
|
-
snakeCaseValue: function () {
|
|
15
|
-
return (0, lodash_2.snakeCase)('testThis');
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
// TODO: allow async function here
|
|
19
|
-
(0, mitosis_1.onMount)(function () {
|
|
20
|
-
fetch("https://stamped.io/api/widget/reviews?storeUrl=builder-io.myshopify.com&apiKey=".concat(props.apiKey || 'pubkey-8bbDq7W6w4sB3OWeM1HUy2s47702hM', "&productId=").concat(props.productId || '2410511106127'))
|
|
21
|
-
.then(function (res) { return res.json(); })
|
|
22
|
-
.then(function (data) {
|
|
23
|
-
state.reviews = data.data;
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
return (<div data-user={state.name}>
|
|
27
|
-
<button onClick={function () { return (state.showReviewPrompt = true); }}>Write a review</button>
|
|
28
|
-
<mitosis_1.Show when={state.showReviewPrompt}>
|
|
29
|
-
<input placeholder="Email"/>
|
|
30
|
-
|
|
31
|
-
<input css={{ display: 'block' }} placeholder="Title"/>
|
|
32
|
-
|
|
33
|
-
<textarea css={{ display: 'block' }} placeholder="How was your experience?"/>
|
|
34
|
-
<button css={{ display: 'block' }} onClick={function (event) {
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
state.showReviewPrompt = false;
|
|
37
|
-
}}>
|
|
38
|
-
Submit
|
|
39
|
-
</button>
|
|
40
|
-
</mitosis_1.Show>
|
|
41
|
-
<mitosis_1.For each={state.reviews}>
|
|
42
|
-
{function (review, index) { return (<div $name="Review" key={review.id} css={{
|
|
43
|
-
margin: '10px',
|
|
44
|
-
padding: '10px',
|
|
45
|
-
background: 'white',
|
|
46
|
-
display: 'flex',
|
|
47
|
-
borderRadius: '5px',
|
|
48
|
-
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
49
|
-
}}>
|
|
50
|
-
<img css={{ height: '30px', width: '30px', marginRight: '10px' }} src={review.avatar}/>
|
|
51
|
-
<div class={state.showReviewPrompt ? 'bg-primary' : 'bg-secondary'}>
|
|
52
|
-
<div>N: {index}</div>
|
|
53
|
-
<div>{review.author}</div>
|
|
54
|
-
<div>{review.reviewMessage}</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>); }}
|
|
57
|
-
</mitosis_1.For>
|
|
58
|
-
</div>);
|
|
59
|
-
}
|
|
60
|
-
exports.default = SmileReviews;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@builder.io/mitosis");
|
|
4
|
-
function SubmitButton(props) {
|
|
5
|
-
return (<button {...props.attributes} type="submit">
|
|
6
|
-
{props.text}
|
|
7
|
-
</button>);
|
|
8
|
-
}
|
|
9
|
-
exports.default = SubmitButton;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var sdk_1 = require("@builder.io/sdk");
|
|
4
|
-
var mitosis_1 = require("@builder.io/mitosis");
|
|
5
|
-
function Text(props) {
|
|
6
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7
|
-
var allowEditingText = sdk_1.Builder.isBrowser &&
|
|
8
|
-
sdk_1.Builder.isEditing &&
|
|
9
|
-
location.search.includes('builder.allowTextEdit=true') &&
|
|
10
|
-
!(((_b = (_a = props.builderBlock) === null || _a === void 0 ? void 0 : _a.bindings) === null || _b === void 0 ? void 0 : _b['component.options.text']) ||
|
|
11
|
-
((_d = (_c = props.builderBlock) === null || _c === void 0 ? void 0 : _c.bindings) === null || _d === void 0 ? void 0 : _d['options.text']) ||
|
|
12
|
-
((_f = (_e = props.builderBlock) === null || _e === void 0 ? void 0 : _e.bindings) === null || _f === void 0 ? void 0 : _f['text']));
|
|
13
|
-
var state = (0, mitosis_1.useStore)({ name: 'Decadef20' });
|
|
14
|
-
// TODO: Add back dynamic `direction` CSS prop when we add support for some
|
|
15
|
-
// sort of dynamic CSS
|
|
16
|
-
// css={{ direction: props.rtlMode ? 'rtl' : 'ltr' }}
|
|
17
|
-
return (<div contentEditable={allowEditingText || undefined} data-name={{ test: state.name || 'any name' }} innerHTML={props.text || props.content || state.name || '<p class="text-lg">my name</p>'}/>);
|
|
18
|
-
}
|
|
19
|
-
exports.default = Text;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function Textarea(props) {
|
|
4
|
-
return (<textarea {...props.attributes} placeholder={props.placeholder} name={props.name} value={props.value} defaultValue={props.defaultValue}/>);
|
|
5
|
-
}
|
|
6
|
-
exports.default = Textarea;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface VideoProps {
|
|
2
|
-
attributes?: any;
|
|
3
|
-
video?: string;
|
|
4
|
-
autoPlay?: boolean;
|
|
5
|
-
controls?: boolean;
|
|
6
|
-
muted?: boolean;
|
|
7
|
-
loop?: boolean;
|
|
8
|
-
playsInline?: boolean;
|
|
9
|
-
aspectRatio?: number;
|
|
10
|
-
width?: number;
|
|
11
|
-
height?: number;
|
|
12
|
-
fit?: 'contain' | 'cover' | 'fill';
|
|
13
|
-
position?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
14
|
-
posterImage?: string;
|
|
15
|
-
lazyLoad?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export default function Video(props: VideoProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
|