@builder.io/sdk-react 0.5.9 → 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/lib/browser/index.cjs +97 -0
- package/lib/browser/index.mjs +2598 -0
- package/lib/browser/server-entry-2e639417.js +2 -0
- package/lib/browser/server-entry-f7504f89.mjs +534 -0
- package/lib/browser/server-entry.cjs +1 -0
- package/lib/browser/server-entry.mjs +16 -0
- package/lib/edge/index.cjs +117 -0
- package/lib/edge/index.mjs +5042 -0
- package/lib/edge/server-entry-2e639417.js +2 -0
- package/lib/edge/server-entry-f7504f89.mjs +534 -0
- package/lib/edge/server-entry.cjs +1 -0
- package/lib/edge/server-entry.mjs +16 -0
- package/lib/node/index.cjs +97 -0
- package/lib/node/index.mjs +2598 -0
- package/lib/node/server-entry-2e639417.js +2 -0
- package/lib/node/server-entry-f7504f89.mjs +534 -0
- package/lib/node/server-entry.cjs +1 -0
- package/lib/node/server-entry.mjs +16 -0
- package/package.json +97 -11
- package/types/constants/sdk-version.d.ts +1 -0
- package/types/functions/deopt.d.ts +4 -0
- package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
- package/types/functions/evaluate/edge-runtime/index.d.ts +1 -0
- package/types/functions/evaluate/placeholder-runtime.d.ts +2 -0
- package/{dist → types}/functions/fetch-builder-props.d.ts +2 -1
- package/{dist → types}/functions/get-content/index.d.ts +4 -5
- package/types/functions/is-edge-runtime.d.ts +4 -0
- package/{dist → types}/index-helpers/blocks-exports.d.ts +2 -2
- package/dist/blocks/BaseText.js +0 -9
- package/dist/blocks/button/button.js +0 -12
- package/dist/blocks/button/component-info.js +0 -34
- package/dist/blocks/columns/columns.js +0 -121
- package/dist/blocks/columns/component-info.js +0 -219
- package/dist/blocks/custom-code/component-info.js +0 -23
- package/dist/blocks/custom-code/custom-code.js +0 -51
- package/dist/blocks/embed/component-info.js +0 -39
- package/dist/blocks/embed/embed.js +0 -42
- package/dist/blocks/embed/helpers.js +0 -2
- package/dist/blocks/form/component-info.js +0 -232
- package/dist/blocks/form/form.js +0 -6
- package/dist/blocks/fragment/component-info.js +0 -7
- package/dist/blocks/fragment/fragment.js +0 -6
- package/dist/blocks/helpers.js +0 -40
- package/dist/blocks/image/component-info.js +0 -122
- package/dist/blocks/image/image.helpers.js +0 -47
- package/dist/blocks/image/image.js +0 -82
- package/dist/blocks/img/component-info.js +0 -15
- package/dist/blocks/img/img.js +0 -10
- package/dist/blocks/input/component-info.js +0 -46
- package/dist/blocks/input/input.js +0 -7
- package/dist/blocks/raw-text/component-info.js +0 -10
- package/dist/blocks/raw-text/raw-text.js +0 -6
- package/dist/blocks/section/component-info.js +0 -40
- package/dist/blocks/section/section.js +0 -17
- package/dist/blocks/select/component-info.js +0 -43
- package/dist/blocks/select/select.js +0 -7
- package/dist/blocks/submit-button/component-info.js +0 -26
- package/dist/blocks/submit-button/submit-button.js +0 -6
- package/dist/blocks/symbol/component-info.js +0 -34
- package/dist/blocks/symbol/symbol.helpers.js +0 -31
- package/dist/blocks/symbol/symbol.js +0 -45
- package/dist/blocks/text/component-info.js +0 -19
- package/dist/blocks/text/text.js +0 -8
- package/dist/blocks/textarea/component-info.js +0 -37
- package/dist/blocks/textarea/textarea.js +0 -6
- package/dist/blocks/video/component-info.js +0 -82
- package/dist/blocks/video/video.js +0 -50
- package/dist/components/block/block.helpers.js +0 -69
- package/dist/components/block/block.js +0 -94
- package/dist/components/block/components/block-styles.js +0 -65
- package/dist/components/block/components/block-wrapper.js +0 -36
- package/dist/components/block/components/component-ref/component-ref.helpers.js +0 -22
- package/dist/components/block/components/component-ref/component-ref.js +0 -23
- package/dist/components/block/components/interactive-element.js +0 -20
- package/dist/components/block/components/repeated-block.js +0 -11
- package/dist/components/block/types.js +0 -1
- package/dist/components/blocks/blocks-wrapper.js +0 -38
- package/dist/components/blocks/blocks.js +0 -17
- package/dist/components/content/components/enable-editor.js +0 -271
- package/dist/components/content/components/styles.helpers.js +0 -58
- package/dist/components/content/components/styles.js +0 -32
- package/dist/components/content/content.helpers.js +0 -30
- package/dist/components/content/content.js +0 -85
- package/dist/components/content/content.types.js +0 -1
- package/dist/components/content/index.js +0 -1
- package/dist/components/content/wrap-component-ref.js +0 -6
- package/dist/components/content-variants/content-variants.js +0 -52
- package/dist/components/content-variants/content-variants.types.js +0 -1
- package/dist/components/content-variants/helpers.js +0 -189
- package/dist/components/inlined-script.js +0 -6
- package/dist/components/inlined-styles.js +0 -6
- package/dist/constants/builder-registered-components.js +0 -60
- package/dist/constants/device-sizes.js +0 -45
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/sdk-version.js +0 -1
- package/dist/constants/target.js +0 -2
- package/dist/context/builder.context.js +0 -12
- package/dist/context/components.context.js +0 -2
- package/dist/context/types.js +0 -1
- package/dist/functions/apply-patch-with-mutation.js +0 -54
- package/dist/functions/camel-to-kebab-case.js +0 -1
- package/dist/functions/evaluate/browser-runtime/browser.js +0 -31
- package/dist/functions/evaluate/browser-runtime/index.js +0 -1
- package/dist/functions/evaluate/evaluate.js +0 -47
- package/dist/functions/evaluate/helpers.js +0 -10
- package/dist/functions/evaluate/index.js +0 -1
- package/dist/functions/evaluate/node-runtime/index.js +0 -1
- package/dist/functions/evaluate/non-node-runtime/acorn-interpreter.js +0 -3111
- package/dist/functions/evaluate/non-node-runtime/index.d.ts +0 -1
- package/dist/functions/evaluate/non-node-runtime/index.js +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -83
- package/dist/functions/event-handler-name.js +0 -4
- package/dist/functions/extract-text-styles.js +0 -22
- package/dist/functions/fast-clone.js +0 -4
- package/dist/functions/fetch-builder-props.js +0 -25
- package/dist/functions/get-block-actions-handler.js +0 -10
- package/dist/functions/get-block-actions.js +0 -28
- package/dist/functions/get-block-component-options.js +0 -10
- package/dist/functions/get-block-properties.js +0 -72
- package/dist/functions/get-builder-search-params/index.js +0 -38
- package/dist/functions/get-content/generate-content-url.js +0 -33
- package/dist/functions/get-content/index.js +0 -100
- package/dist/functions/get-content/types.js +0 -1
- package/dist/functions/get-fetch.js +0 -11
- package/dist/functions/get-global-this.js +0 -15
- package/dist/functions/get-processed-block.js +0 -46
- package/dist/functions/get-react-native-block-styles.js +0 -17
- package/dist/functions/is-browser.js +0 -3
- package/dist/functions/is-editing.js +0 -5
- package/dist/functions/is-iframe.js +0 -4
- package/dist/functions/is-non-node-server.d.ts +0 -4
- package/dist/functions/is-non-node-server.js +0 -8
- package/dist/functions/is-previewing.js +0 -11
- package/dist/functions/on-change.js +0 -28
- package/dist/functions/register-component.js +0 -38
- package/dist/functions/register.js +0 -27
- package/dist/functions/sanitize-react-native-block-styles.js +0 -61
- package/dist/functions/set-editor-settings.js +0 -12
- package/dist/functions/set.js +0 -14
- package/dist/functions/track/helpers.js +0 -51
- package/dist/functions/track/index.js +0 -71
- package/dist/functions/track/interaction.js +0 -53
- package/dist/functions/transform-block-properties.js +0 -5
- package/dist/functions/transform-block.js +0 -4
- package/dist/helpers/ab-tests.js +0 -122
- package/dist/helpers/canTrack.js +0 -2
- package/dist/helpers/cookie.js +0 -55
- package/dist/helpers/css.js +0 -27
- package/dist/helpers/flatten.js +0 -19
- package/dist/helpers/localStorage.js +0 -24
- package/dist/helpers/logger.js +0 -7
- package/dist/helpers/nullable.js +0 -1
- package/dist/helpers/preview-lru-cache/get.js +0 -3
- package/dist/helpers/preview-lru-cache/helpers.js +0 -0
- package/dist/helpers/preview-lru-cache/init.js +0 -6
- package/dist/helpers/preview-lru-cache/set.js +0 -5
- package/dist/helpers/preview-lru-cache/types.js +0 -0
- package/dist/helpers/sessionId.js +0 -30
- package/dist/helpers/time.js +0 -2
- package/dist/helpers/url.js +0 -15
- package/dist/helpers/uuid.js +0 -15
- package/dist/helpers/visitorId.js +0 -30
- package/dist/index-helpers/blocks-exports.js +0 -19
- package/dist/index-helpers/top-of-file.js +0 -4
- package/dist/index.js +0 -7
- package/dist/scripts/init-editing.js +0 -110
- package/dist/server-index.js +0 -10
- package/dist/types/api-version.js +0 -1
- package/dist/types/builder-block.js +0 -1
- package/dist/types/builder-content.js +0 -1
- package/dist/types/builder-props.js +0 -1
- package/dist/types/can-track.js +0 -1
- package/dist/types/components.js +0 -1
- package/dist/types/deep-partial.js +0 -1
- package/dist/types/element.js +0 -1
- package/dist/types/enforced-partials.js +0 -1
- package/dist/types/input.js +0 -1
- package/dist/types/targets.js +0 -1
- package/dist/types/typescript.js +0 -1
- /package/{dist → types}/blocks/BaseText.d.ts +0 -0
- /package/{dist → types}/blocks/button/button.d.ts +0 -0
- /package/{dist → types}/blocks/button/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/columns/columns.d.ts +0 -0
- /package/{dist → types}/blocks/columns/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/custom-code.d.ts +0 -0
- /package/{dist → types}/blocks/embed/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/embed/embed.d.ts +0 -0
- /package/{dist → types}/blocks/embed/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/form/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/form/form.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/fragment.d.ts +0 -0
- /package/{dist → types}/blocks/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/image/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/img/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/img/img.d.ts +0 -0
- /package/{dist → types}/blocks/input/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/input/input.d.ts +0 -0
- /package/{dist → types}/blocks/raw-text/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/raw-text/raw-text.d.ts +0 -0
- /package/{dist → types}/blocks/section/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/section/section.d.ts +0 -0
- /package/{dist → types}/blocks/select/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/select/select.d.ts +0 -0
- /package/{dist → types}/blocks/submit-button/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/submit-button/submit-button.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/text/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/text/text.d.ts +0 -0
- /package/{dist → types}/blocks/textarea/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/textarea/textarea.d.ts +0 -0
- /package/{dist → types}/blocks/video/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/video/video.d.ts +0 -0
- /package/{dist → types}/components/block/block.d.ts +0 -0
- /package/{dist → types}/components/block/block.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-styles.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-wrapper.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/interactive-element.d.ts +0 -0
- /package/{dist → types}/components/block/components/repeated-block.d.ts +0 -0
- /package/{dist → types}/components/block/types.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks-wrapper.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks.d.ts +0 -0
- /package/{dist → types}/components/content/components/enable-editor.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/content.d.ts +0 -0
- /package/{dist → types}/components/content/content.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/content.types.d.ts +0 -0
- /package/{dist → types}/components/content/index.d.ts +0 -0
- /package/{dist → types}/components/content/wrap-component-ref.d.ts +0 -0
- /package/{dist → types}/components/content-variants/content-variants.d.ts +0 -0
- /package/{dist → types}/components/content-variants/content-variants.types.d.ts +0 -0
- /package/{dist → types}/components/content-variants/helpers.d.ts +0 -0
- /package/{dist → types}/components/inlined-script.d.ts +0 -0
- /package/{dist → types}/components/inlined-styles.d.ts +0 -0
- /package/{dist → types}/constants/builder-registered-components.d.ts +0 -0
- /package/{dist → types}/constants/device-sizes.d.ts +0 -0
- /package/{dist → types}/constants/target.d.ts +0 -0
- /package/{dist → types}/context/builder.context.d.ts +0 -0
- /package/{dist → types}/context/components.context.d.ts +0 -0
- /package/{dist → types}/context/types.d.ts +0 -0
- /package/{dist → types}/functions/apply-patch-with-mutation.d.ts +0 -0
- /package/{dist → types}/functions/camel-to-kebab-case.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/browser-runtime/browser.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/browser-runtime/index.d.ts +0 -0
- /package/{dist/functions/evaluate/non-node-runtime → types/functions/evaluate/edge-runtime}/acorn-interpreter.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/evaluate.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/helpers.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/index.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/node-runtime/index.d.ts +0 -0
- /package/{dist → types}/functions/event-handler-name.d.ts +0 -0
- /package/{dist → types}/functions/extract-text-styles.d.ts +0 -0
- /package/{dist → types}/functions/fast-clone.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions-handler.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions.d.ts +0 -0
- /package/{dist → types}/functions/get-block-component-options.d.ts +0 -0
- /package/{dist → types}/functions/get-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/get-builder-search-params/index.d.ts +0 -0
- /package/{dist → types}/functions/get-content/generate-content-url.d.ts +0 -0
- /package/{dist → types}/functions/get-content/types.d.ts +0 -0
- /package/{dist → types}/functions/get-fetch.d.ts +0 -0
- /package/{dist → types}/functions/get-global-this.d.ts +0 -0
- /package/{dist → types}/functions/get-processed-block.d.ts +0 -0
- /package/{dist → types}/functions/get-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/is-browser.d.ts +0 -0
- /package/{dist → types}/functions/is-editing.d.ts +0 -0
- /package/{dist → types}/functions/is-iframe.d.ts +0 -0
- /package/{dist → types}/functions/is-previewing.d.ts +0 -0
- /package/{dist → types}/functions/on-change.d.ts +0 -0
- /package/{dist → types}/functions/register-component.d.ts +0 -0
- /package/{dist → types}/functions/register.d.ts +0 -0
- /package/{dist → types}/functions/sanitize-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/set-editor-settings.d.ts +0 -0
- /package/{dist → types}/functions/set.d.ts +0 -0
- /package/{dist → types}/functions/track/helpers.d.ts +0 -0
- /package/{dist → types}/functions/track/index.d.ts +0 -0
- /package/{dist → types}/functions/track/interaction.d.ts +0 -0
- /package/{dist → types}/functions/transform-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/transform-block.d.ts +0 -0
- /package/{dist → types}/helpers/ab-tests.d.ts +0 -0
- /package/{dist → types}/helpers/canTrack.d.ts +0 -0
- /package/{dist → types}/helpers/cookie.d.ts +0 -0
- /package/{dist → types}/helpers/css.d.ts +0 -0
- /package/{dist → types}/helpers/flatten.d.ts +0 -0
- /package/{dist → types}/helpers/localStorage.d.ts +0 -0
- /package/{dist → types}/helpers/logger.d.ts +0 -0
- /package/{dist → types}/helpers/nullable.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/get.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/helpers.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/init.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/set.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/types.d.ts +0 -0
- /package/{dist → types}/helpers/sessionId.d.ts +0 -0
- /package/{dist → types}/helpers/time.d.ts +0 -0
- /package/{dist → types}/helpers/url.d.ts +0 -0
- /package/{dist → types}/helpers/uuid.d.ts +0 -0
- /package/{dist → types}/helpers/visitorId.d.ts +0 -0
- /package/{dist → types}/index-helpers/top-of-file.d.ts +0 -0
- /package/{dist → types}/index.d.ts +0 -0
- /package/{dist → types}/scripts/init-editing.d.ts +0 -0
- /package/{dist → types}/server-index.d.ts +0 -0
- /package/{dist → types}/types/api-version.d.ts +0 -0
- /package/{dist → types}/types/builder-block.d.ts +0 -0
- /package/{dist → types}/types/builder-content.d.ts +0 -0
- /package/{dist → types}/types/builder-props.d.ts +0 -0
- /package/{dist → types}/types/can-track.d.ts +0 -0
- /package/{dist → types}/types/components.d.ts +0 -0
- /package/{dist → types}/types/deep-partial.d.ts +0 -0
- /package/{dist → types}/types/element.d.ts +0 -0
- /package/{dist → types}/types/enforced-partials.d.ts +0 -0
- /package/{dist → types}/types/input.d.ts +0 -0
- /package/{dist → types}/types/targets.d.ts +0 -0
- /package/{dist → types}/types/typescript.d.ts +0 -0
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
name: 'Form:Form',
|
|
3
|
-
// editableTags: ['builder-form-error']
|
|
4
|
-
defaults: {
|
|
5
|
-
responsiveStyles: {
|
|
6
|
-
large: {
|
|
7
|
-
marginTop: '15px',
|
|
8
|
-
paddingBottom: '15px'
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5',
|
|
13
|
-
inputs: [{
|
|
14
|
-
name: 'sendSubmissionsTo',
|
|
15
|
-
type: 'string',
|
|
16
|
-
// TODO: save to builder data and user can download as csv
|
|
17
|
-
// TODO: easy for mode too or computed add/remove fields form mode
|
|
18
|
-
// so you can edit details and high level mode at same time...
|
|
19
|
-
// Later - more integrations like mailchimp
|
|
20
|
-
// /api/v1/form-submit?to=mailchimp
|
|
21
|
-
enum: [{
|
|
22
|
-
label: 'Send to email',
|
|
23
|
-
value: 'email',
|
|
24
|
-
helperText: 'Send form submissions to the email address of your choosing'
|
|
25
|
-
}, {
|
|
26
|
-
label: 'Custom',
|
|
27
|
-
value: 'custom',
|
|
28
|
-
helperText: 'Handle where the form requests go manually with a little code, e.g. to your own custom backend'
|
|
29
|
-
}],
|
|
30
|
-
defaultValue: 'email'
|
|
31
|
-
}, {
|
|
32
|
-
name: 'sendSubmissionsToEmail',
|
|
33
|
-
type: 'string',
|
|
34
|
-
required: true,
|
|
35
|
-
// TODO: required: () => options.get("sendSubmissionsTo") === "email"
|
|
36
|
-
defaultValue: 'your@email.com',
|
|
37
|
-
showIf: 'options.get("sendSubmissionsTo") === "email"'
|
|
38
|
-
}, {
|
|
39
|
-
name: 'sendWithJs',
|
|
40
|
-
type: 'boolean',
|
|
41
|
-
helperText: 'Set to false to use basic html form action',
|
|
42
|
-
defaultValue: true,
|
|
43
|
-
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
44
|
-
}, {
|
|
45
|
-
name: 'name',
|
|
46
|
-
type: 'string',
|
|
47
|
-
defaultValue: 'My form'
|
|
48
|
-
// advanced: true
|
|
49
|
-
}, {
|
|
50
|
-
name: 'action',
|
|
51
|
-
type: 'string',
|
|
52
|
-
helperText: 'URL to send the form data to',
|
|
53
|
-
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
54
|
-
}, {
|
|
55
|
-
name: 'contentType',
|
|
56
|
-
type: 'string',
|
|
57
|
-
defaultValue: 'application/json',
|
|
58
|
-
advanced: true,
|
|
59
|
-
// TODO: do automatically if file input
|
|
60
|
-
enum: ['application/json', 'multipart/form-data', 'application/x-www-form-urlencoded'],
|
|
61
|
-
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
62
|
-
}, {
|
|
63
|
-
name: 'method',
|
|
64
|
-
type: 'string',
|
|
65
|
-
showIf: 'options.get("sendSubmissionsTo") === "custom"',
|
|
66
|
-
defaultValue: 'POST',
|
|
67
|
-
advanced: true
|
|
68
|
-
}, {
|
|
69
|
-
name: 'previewState',
|
|
70
|
-
type: 'string',
|
|
71
|
-
// TODO: persist: false flag
|
|
72
|
-
enum: ['unsubmitted', 'sending', 'success', 'error'],
|
|
73
|
-
defaultValue: 'unsubmitted',
|
|
74
|
-
helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
|
|
75
|
-
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
76
|
-
}, {
|
|
77
|
-
name: 'successUrl',
|
|
78
|
-
type: 'url',
|
|
79
|
-
helperText: 'Optional URL to redirect the user to on form submission success',
|
|
80
|
-
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
81
|
-
}, {
|
|
82
|
-
name: 'resetFormOnSubmit',
|
|
83
|
-
type: 'boolean',
|
|
84
|
-
showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
|
|
85
|
-
advanced: true
|
|
86
|
-
}, {
|
|
87
|
-
name: 'successMessage',
|
|
88
|
-
type: 'uiBlocks',
|
|
89
|
-
hideFromUI: true,
|
|
90
|
-
defaultValue: [{
|
|
91
|
-
'@type': '@builder.io/sdk:Element',
|
|
92
|
-
responsiveStyles: {
|
|
93
|
-
large: {
|
|
94
|
-
marginTop: '10px'
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
component: {
|
|
98
|
-
name: 'Text',
|
|
99
|
-
options: {
|
|
100
|
-
text: '<span>Thanks!</span>'
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}]
|
|
104
|
-
}, {
|
|
105
|
-
name: 'validate',
|
|
106
|
-
type: 'boolean',
|
|
107
|
-
defaultValue: true,
|
|
108
|
-
advanced: true
|
|
109
|
-
}, {
|
|
110
|
-
name: 'errorMessagePath',
|
|
111
|
-
type: 'text',
|
|
112
|
-
advanced: true,
|
|
113
|
-
helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
|
|
114
|
-
}, {
|
|
115
|
-
name: 'errorMessage',
|
|
116
|
-
type: 'uiBlocks',
|
|
117
|
-
hideFromUI: true,
|
|
118
|
-
defaultValue: [{
|
|
119
|
-
'@type': '@builder.io/sdk:Element',
|
|
120
|
-
responsiveStyles: {
|
|
121
|
-
large: {
|
|
122
|
-
marginTop: '10px'
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
bindings: {
|
|
126
|
-
'component.options.text': 'state.formErrorMessage || block.component.options.text'
|
|
127
|
-
},
|
|
128
|
-
component: {
|
|
129
|
-
name: 'Text',
|
|
130
|
-
options: {
|
|
131
|
-
text: '<span>Form submission error :( Please check your answers and try again</span>'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}]
|
|
135
|
-
}, {
|
|
136
|
-
name: 'sendingMessage',
|
|
137
|
-
type: 'uiBlocks',
|
|
138
|
-
hideFromUI: true,
|
|
139
|
-
defaultValue: [{
|
|
140
|
-
'@type': '@builder.io/sdk:Element',
|
|
141
|
-
responsiveStyles: {
|
|
142
|
-
large: {
|
|
143
|
-
marginTop: '10px'
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
component: {
|
|
147
|
-
name: 'Text',
|
|
148
|
-
options: {
|
|
149
|
-
text: '<span>Sending...</span>'
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}]
|
|
153
|
-
}, {
|
|
154
|
-
name: 'customHeaders',
|
|
155
|
-
type: 'map',
|
|
156
|
-
valueType: {
|
|
157
|
-
type: 'string'
|
|
158
|
-
},
|
|
159
|
-
advanced: true,
|
|
160
|
-
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
161
|
-
}],
|
|
162
|
-
noWrap: true,
|
|
163
|
-
canHaveChildren: true,
|
|
164
|
-
defaultChildren: [{
|
|
165
|
-
'@type': '@builder.io/sdk:Element',
|
|
166
|
-
responsiveStyles: {
|
|
167
|
-
large: {
|
|
168
|
-
marginTop: '10px'
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
component: {
|
|
172
|
-
name: 'Text',
|
|
173
|
-
options: {
|
|
174
|
-
text: '<span>Enter your name</span>'
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
'@type': '@builder.io/sdk:Element',
|
|
179
|
-
responsiveStyles: {
|
|
180
|
-
large: {
|
|
181
|
-
marginTop: '10px'
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
component: {
|
|
185
|
-
name: 'Form:Input',
|
|
186
|
-
options: {
|
|
187
|
-
name: 'name',
|
|
188
|
-
placeholder: 'Jane Doe'
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
'@type': '@builder.io/sdk:Element',
|
|
193
|
-
responsiveStyles: {
|
|
194
|
-
large: {
|
|
195
|
-
marginTop: '10px'
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
component: {
|
|
199
|
-
name: 'Text',
|
|
200
|
-
options: {
|
|
201
|
-
text: '<span>Enter your email</span>'
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
'@type': '@builder.io/sdk:Element',
|
|
206
|
-
responsiveStyles: {
|
|
207
|
-
large: {
|
|
208
|
-
marginTop: '10px'
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
component: {
|
|
212
|
-
name: 'Form:Input',
|
|
213
|
-
options: {
|
|
214
|
-
name: 'email',
|
|
215
|
-
placeholder: 'jane@doe.com'
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
'@type': '@builder.io/sdk:Element',
|
|
220
|
-
responsiveStyles: {
|
|
221
|
-
large: {
|
|
222
|
-
marginTop: '10px'
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
component: {
|
|
226
|
-
name: 'Form:SubmitButton',
|
|
227
|
-
options: {
|
|
228
|
-
text: 'Submit'
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}]
|
|
232
|
-
};
|
package/dist/blocks/form/form.js
DELETED
package/dist/blocks/helpers.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export function filterAttrs(attrs = {}, prefix, isEvent) {
|
|
2
|
-
const result = {};
|
|
3
|
-
for (const attr in attrs) {
|
|
4
|
-
if (!attrs[attr])
|
|
5
|
-
continue;
|
|
6
|
-
if (isEvent && !attr.startsWith(prefix))
|
|
7
|
-
continue;
|
|
8
|
-
const eventName = isEvent ? attr.replace(prefix, '') : attr;
|
|
9
|
-
result[eventName] = attrs[attr];
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Svelte SDK: workaround to dynamically provide event handlers to components/elements.
|
|
15
|
-
* https://svelte.dev/repl/1246699e266f41218a8eeb45b9b58b54?version=3.24.1
|
|
16
|
-
*/
|
|
17
|
-
export function setAttrs(node, attrs = {}) {
|
|
18
|
-
const attrKeys = Object.keys(attrs);
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param {string} attr
|
|
22
|
-
*/
|
|
23
|
-
const setup = (attr) => node.addEventListener(attr, attrs[attr]);
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param {string} attr
|
|
27
|
-
*/
|
|
28
|
-
const teardown = (attr) => node.removeEventListener(attr, attrs[attr]);
|
|
29
|
-
attrKeys.forEach(setup);
|
|
30
|
-
return {
|
|
31
|
-
update(attrs = {}) {
|
|
32
|
-
const attrKeys = Object.keys(attrs);
|
|
33
|
-
attrKeys.forEach(teardown);
|
|
34
|
-
attrKeys.forEach(setup);
|
|
35
|
-
},
|
|
36
|
-
destroy() {
|
|
37
|
-
attrKeys.forEach(teardown);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
name: 'Image',
|
|
3
|
-
static: true,
|
|
4
|
-
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4',
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
position: 'relative',
|
|
7
|
-
minHeight: '20px',
|
|
8
|
-
minWidth: '20px',
|
|
9
|
-
overflow: 'hidden'
|
|
10
|
-
},
|
|
11
|
-
canHaveChildren: true,
|
|
12
|
-
inputs: [{
|
|
13
|
-
name: 'image',
|
|
14
|
-
type: 'file',
|
|
15
|
-
bubble: true,
|
|
16
|
-
allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg'],
|
|
17
|
-
required: true,
|
|
18
|
-
defaultValue: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a',
|
|
19
|
-
onChange: (options) => {
|
|
20
|
-
const DEFAULT_ASPECT_RATIO = 0.7041;
|
|
21
|
-
options.delete('srcset');
|
|
22
|
-
options.delete('noWebp');
|
|
23
|
-
function loadImage(url, timeout = 60000) {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
const img = document.createElement('img');
|
|
26
|
-
let loaded = false;
|
|
27
|
-
img.onload = () => {
|
|
28
|
-
loaded = true;
|
|
29
|
-
resolve(img);
|
|
30
|
-
};
|
|
31
|
-
img.addEventListener('error', event => {
|
|
32
|
-
console.warn('Image load failed', event.error);
|
|
33
|
-
reject(event.error);
|
|
34
|
-
});
|
|
35
|
-
img.src = url;
|
|
36
|
-
setTimeout(() => {
|
|
37
|
-
if (!loaded) {
|
|
38
|
-
reject(new Error('Image load timed out'));
|
|
39
|
-
}
|
|
40
|
-
}, timeout);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function round(num) {
|
|
44
|
-
return Math.round(num * 1000) / 1000;
|
|
45
|
-
}
|
|
46
|
-
const value = options.get('image');
|
|
47
|
-
const aspectRatio = options.get('aspectRatio');
|
|
48
|
-
// For SVG images - don't render as webp, keep them as SVG
|
|
49
|
-
fetch(value).then(res => res.blob()).then(blob => {
|
|
50
|
-
if (blob.type.includes('svg')) {
|
|
51
|
-
options.set('noWebp', true);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO)) {
|
|
55
|
-
return loadImage(value).then(img => {
|
|
56
|
-
const possiblyUpdatedAspectRatio = options.get('aspectRatio');
|
|
57
|
-
if (options.get('image') === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
|
|
58
|
-
if (img.width && img.height) {
|
|
59
|
-
options.set('aspectRatio', round(img.height / img.width));
|
|
60
|
-
options.set('height', img.height);
|
|
61
|
-
options.set('width', img.width);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
name: 'backgroundSize',
|
|
69
|
-
type: 'text',
|
|
70
|
-
defaultValue: 'cover',
|
|
71
|
-
enum: [{
|
|
72
|
-
label: 'contain',
|
|
73
|
-
value: 'contain',
|
|
74
|
-
helperText: 'The image should never get cropped'
|
|
75
|
-
}, {
|
|
76
|
-
label: 'cover',
|
|
77
|
-
value: 'cover',
|
|
78
|
-
helperText: "The image should fill it's box, cropping when needed"
|
|
79
|
-
}]
|
|
80
|
-
}, {
|
|
81
|
-
name: 'backgroundPosition',
|
|
82
|
-
type: 'text',
|
|
83
|
-
defaultValue: 'center',
|
|
84
|
-
enum: ['center', 'top', 'left', 'right', 'bottom', 'top left', 'top right', 'bottom left', 'bottom right']
|
|
85
|
-
}, {
|
|
86
|
-
name: 'altText',
|
|
87
|
-
type: 'string',
|
|
88
|
-
helperText: 'Text to display when the user has images off'
|
|
89
|
-
}, {
|
|
90
|
-
name: 'height',
|
|
91
|
-
type: 'number',
|
|
92
|
-
hideFromUI: true
|
|
93
|
-
}, {
|
|
94
|
-
name: 'width',
|
|
95
|
-
type: 'number',
|
|
96
|
-
hideFromUI: true
|
|
97
|
-
}, {
|
|
98
|
-
name: 'sizes',
|
|
99
|
-
type: 'string',
|
|
100
|
-
hideFromUI: true
|
|
101
|
-
}, {
|
|
102
|
-
name: 'srcset',
|
|
103
|
-
type: 'string',
|
|
104
|
-
hideFromUI: true
|
|
105
|
-
}, {
|
|
106
|
-
name: 'lazy',
|
|
107
|
-
type: 'boolean',
|
|
108
|
-
defaultValue: true,
|
|
109
|
-
hideFromUI: true
|
|
110
|
-
}, {
|
|
111
|
-
name: 'fitContent',
|
|
112
|
-
type: 'boolean',
|
|
113
|
-
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
114
|
-
defaultValue: true
|
|
115
|
-
}, {
|
|
116
|
-
name: 'aspectRatio',
|
|
117
|
-
type: 'number',
|
|
118
|
-
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
119
|
-
advanced: true,
|
|
120
|
-
defaultValue: 0.7041
|
|
121
|
-
}]
|
|
122
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Taken from (and modified) the shopify theme script repo
|
|
2
|
-
// https://github.com/Shopify/theme-scripts/blob/bcfb471f2a57d439e2f964a1bb65b67708cc90c3/packages/theme-images/images.js#L59
|
|
3
|
-
function removeProtocol(path) {
|
|
4
|
-
return path.replace(/http(s)?:/, '');
|
|
5
|
-
}
|
|
6
|
-
function updateQueryParam(uri = '', key, value) {
|
|
7
|
-
const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
|
|
8
|
-
const separator = uri.indexOf('?') !== -1 ? '&' : '?';
|
|
9
|
-
if (uri.match(re)) {
|
|
10
|
-
return uri.replace(re, '$1' + key + '=' + encodeURIComponent(value) + '$2');
|
|
11
|
-
}
|
|
12
|
-
return uri + separator + key + '=' + encodeURIComponent(value);
|
|
13
|
-
}
|
|
14
|
-
function getShopifyImageUrl(src, size) {
|
|
15
|
-
if (!src || !src?.match(/cdn\.shopify\.com/) || !size) {
|
|
16
|
-
return src;
|
|
17
|
-
}
|
|
18
|
-
if (size === 'master') {
|
|
19
|
-
return removeProtocol(src);
|
|
20
|
-
}
|
|
21
|
-
const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
22
|
-
if (match) {
|
|
23
|
-
const prefix = src.split(match[0]);
|
|
24
|
-
const suffix = match[3];
|
|
25
|
-
const useSize = size.match('x') ? size : `${size}x`;
|
|
26
|
-
return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
export function getSrcSet(url) {
|
|
31
|
-
if (!url) {
|
|
32
|
-
return url;
|
|
33
|
-
}
|
|
34
|
-
const sizes = [100, 200, 400, 800, 1200, 1600, 2000];
|
|
35
|
-
if (url.match(/builder\.io/)) {
|
|
36
|
-
let srcUrl = url;
|
|
37
|
-
const widthInSrc = Number(url.split('?width=')[1]);
|
|
38
|
-
if (!isNaN(widthInSrc)) {
|
|
39
|
-
srcUrl = `${srcUrl} ${widthInSrc}w`;
|
|
40
|
-
}
|
|
41
|
-
return sizes.filter(size => size !== widthInSrc).map(size => `${updateQueryParam(url, 'width', size)} ${size}w`).concat([srcUrl]).join(', ');
|
|
42
|
-
}
|
|
43
|
-
if (url.match(/cdn\.shopify\.com/)) {
|
|
44
|
-
return sizes.map(size => [getShopifyImageUrl(url, `${size}x${size}`), size]).filter(([sizeUrl]) => !!sizeUrl).map(([sizeUrl, size]) => `${sizeUrl} ${size}w`).concat([url]).join(', ');
|
|
45
|
-
}
|
|
46
|
-
return url;
|
|
47
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { getSrcSet } from "./image.helpers.js";
|
|
4
|
-
function Image(props) {
|
|
5
|
-
function srcSetToUse() {
|
|
6
|
-
const imageToUse = props.image || props.src;
|
|
7
|
-
const url = imageToUse;
|
|
8
|
-
if (!url ||
|
|
9
|
-
// We can auto add srcset for cdn.builder.io and shopify
|
|
10
|
-
// images, otherwise you can supply this prop manually
|
|
11
|
-
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))) {
|
|
12
|
-
return props.srcset;
|
|
13
|
-
}
|
|
14
|
-
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
15
|
-
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
16
|
-
console.debug("Removed given srcset");
|
|
17
|
-
return getSrcSet(url);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
else if (props.image && !props.srcset) {
|
|
21
|
-
return getSrcSet(url);
|
|
22
|
-
}
|
|
23
|
-
return getSrcSet(url);
|
|
24
|
-
}
|
|
25
|
-
function webpSrcSet() {
|
|
26
|
-
if (srcSetToUse?.()?.match(/builder\.io/) && !props.noWebp) {
|
|
27
|
-
return srcSetToUse().replace(/\?/g, "?format=webp&");
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return "";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function aspectRatioCss() {
|
|
34
|
-
const aspectRatioStyles = {
|
|
35
|
-
position: "absolute",
|
|
36
|
-
height: "100%",
|
|
37
|
-
width: "100%",
|
|
38
|
-
left: "0px",
|
|
39
|
-
top: "0px",
|
|
40
|
-
};
|
|
41
|
-
const out = props.aspectRatio ? aspectRatioStyles : undefined;
|
|
42
|
-
return out;
|
|
43
|
-
}
|
|
44
|
-
return (React.createElement(React.Fragment, null,
|
|
45
|
-
React.createElement(React.Fragment, null,
|
|
46
|
-
React.createElement("picture", null,
|
|
47
|
-
webpSrcSet() ? (React.createElement(React.Fragment, null,
|
|
48
|
-
React.createElement("source", { type: "image/webp", srcSet: webpSrcSet() }))) : null,
|
|
49
|
-
React.createElement("img", { loading: "lazy", alt: props.altText, role: props.altText ? "presentation" : undefined, style: {
|
|
50
|
-
objectPosition: props.backgroundPosition || "center",
|
|
51
|
-
objectFit: props.backgroundSize || "cover",
|
|
52
|
-
...aspectRatioCss(),
|
|
53
|
-
}, className: "builder-image" +
|
|
54
|
-
(props.className ? " " + props.className : "") +
|
|
55
|
-
" img-ef11a6be", src: props.image, srcSet: srcSetToUse(), sizes: props.sizes })),
|
|
56
|
-
props.aspectRatio &&
|
|
57
|
-
!(props.builderBlock?.children?.length && props.fitContent) ? (React.createElement(React.Fragment, null,
|
|
58
|
-
React.createElement("div", { className: "builder-image-sizer div-ef11a6be", style: {
|
|
59
|
-
paddingTop: props.aspectRatio * 100 + "%",
|
|
60
|
-
} }))) : null,
|
|
61
|
-
props.builderBlock?.children?.length && props.fitContent ? (React.createElement(React.Fragment, null, props.children)) : null,
|
|
62
|
-
!props.fitContent && props.children ? (React.createElement(React.Fragment, null,
|
|
63
|
-
React.createElement("div", { className: "div-ef11a6be-2" }, props.children))) : null),
|
|
64
|
-
React.createElement("style", null, `.img-ef11a6be {
|
|
65
|
-
opacity: 1;
|
|
66
|
-
transition: opacity 0.2s ease-in-out;
|
|
67
|
-
}.div-ef11a6be {
|
|
68
|
-
width: 100%;
|
|
69
|
-
pointer-events: none;
|
|
70
|
-
font-size: 0;
|
|
71
|
-
}.div-ef11a6be-2 {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
align-items: stretch;
|
|
75
|
-
position: absolute;
|
|
76
|
-
top: 0;
|
|
77
|
-
left: 0;
|
|
78
|
-
width: 100%;
|
|
79
|
-
height: 100%;
|
|
80
|
-
}`)));
|
|
81
|
-
}
|
|
82
|
-
export default Image;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
// friendlyName?
|
|
3
|
-
name: 'Raw:Img',
|
|
4
|
-
hideFromInsertMenu: true,
|
|
5
|
-
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4',
|
|
6
|
-
inputs: [{
|
|
7
|
-
name: 'image',
|
|
8
|
-
bubble: true,
|
|
9
|
-
type: 'file',
|
|
10
|
-
allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg', 'gif', 'webp'],
|
|
11
|
-
required: true
|
|
12
|
-
}],
|
|
13
|
-
noWrap: true,
|
|
14
|
-
static: true
|
|
15
|
-
};
|
package/dist/blocks/img/img.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
4
|
-
function ImgComponent(props) {
|
|
5
|
-
return (React.createElement("img", { style: {
|
|
6
|
-
objectFit: props.backgroundSize || "cover",
|
|
7
|
-
objectPosition: props.backgroundPosition || "center",
|
|
8
|
-
}, key: (isEditing() && props.imgSrc) || "default-key", alt: props.altText, src: props.imgSrc || props.image, ...{}, ...props.attributes }));
|
|
9
|
-
}
|
|
10
|
-
export default ImgComponent;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
name: 'Form:Input',
|
|
3
|
-
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca',
|
|
4
|
-
inputs: [{
|
|
5
|
-
name: 'type',
|
|
6
|
-
type: 'text',
|
|
7
|
-
enum: ['text', 'number', 'email', 'url', 'checkbox', 'radio', 'range', 'date', 'datetime-local', 'search', 'tel', 'time', 'file', 'month', 'week', 'password', 'color', 'hidden'],
|
|
8
|
-
defaultValue: 'text'
|
|
9
|
-
}, {
|
|
10
|
-
name: 'name',
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true,
|
|
13
|
-
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
14
|
-
}, {
|
|
15
|
-
name: 'placeholder',
|
|
16
|
-
type: 'string',
|
|
17
|
-
defaultValue: 'Hello there',
|
|
18
|
-
helperText: 'Text to display when there is no value'
|
|
19
|
-
},
|
|
20
|
-
// TODO: handle value vs default value automatically like ng-model
|
|
21
|
-
{
|
|
22
|
-
name: 'defaultValue',
|
|
23
|
-
type: 'string'
|
|
24
|
-
}, {
|
|
25
|
-
name: 'value',
|
|
26
|
-
type: 'string',
|
|
27
|
-
advanced: true
|
|
28
|
-
}, {
|
|
29
|
-
name: 'required',
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
helperText: 'Is this input required to be filled out to submit a form',
|
|
32
|
-
defaultValue: false
|
|
33
|
-
}],
|
|
34
|
-
noWrap: true,
|
|
35
|
-
static: true,
|
|
36
|
-
defaultStyles: {
|
|
37
|
-
paddingTop: '10px',
|
|
38
|
-
paddingBottom: '10px',
|
|
39
|
-
paddingLeft: '10px',
|
|
40
|
-
paddingRight: '10px',
|
|
41
|
-
borderRadius: '3px',
|
|
42
|
-
borderWidth: '1px',
|
|
43
|
-
borderStyle: 'solid',
|
|
44
|
-
borderColor: '#ccc'
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
4
|
-
function FormInputComponent(props) {
|
|
5
|
-
return (React.createElement("input", { ...{}, ...props.attributes, key: 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 }));
|
|
6
|
-
}
|
|
7
|
-
export default FormInputComponent;
|