@webstudio-is/sdk-components-react 0.70.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/LICENSE +21 -0
- package/README.md +3 -0
- package/lib/__generated__/blockquote.props.js +399 -0
- package/lib/__generated__/body.props.js +398 -0
- package/lib/__generated__/bold.props.js +398 -0
- package/lib/__generated__/box.props.js +416 -0
- package/lib/__generated__/button.props.js +420 -0
- package/lib/__generated__/checkbox-field.props.js +399 -0
- package/lib/__generated__/checkbox.props.js +439 -0
- package/lib/__generated__/code-text.props.js +405 -0
- package/lib/__generated__/error-message.props.js +398 -0
- package/lib/__generated__/form.props.js +406 -0
- package/lib/__generated__/fragment.props.js +4 -0
- package/lib/__generated__/heading.props.js +405 -0
- package/lib/__generated__/html-embed.props.js +11 -0
- package/lib/__generated__/image.props.js +442 -0
- package/lib/__generated__/input.props.js +445 -0
- package/lib/__generated__/italic.props.js +398 -0
- package/lib/__generated__/label.props.js +400 -0
- package/lib/__generated__/link-block.props.js +432 -0
- package/lib/__generated__/link.props.js +432 -0
- package/lib/__generated__/list-item.props.js +399 -0
- package/lib/__generated__/list.props.js +412 -0
- package/lib/__generated__/paragraph.props.js +398 -0
- package/lib/__generated__/radio-button-field.props.js +399 -0
- package/lib/__generated__/radio-button.props.js +439 -0
- package/lib/__generated__/rich-text-link.props.js +432 -0
- package/lib/__generated__/separator.props.js +398 -0
- package/lib/__generated__/slot.props.js +4 -0
- package/lib/__generated__/span.props.js +398 -0
- package/lib/__generated__/subscript.props.js +398 -0
- package/lib/__generated__/success-message.props.js +398 -0
- package/lib/__generated__/superscript.props.js +398 -0
- package/lib/__generated__/text-block.props.js +405 -0
- package/lib/__generated__/textarea.props.js +412 -0
- package/lib/blockquote.js +15 -0
- package/lib/blockquote.ws.js +76 -0
- package/lib/body.js +9 -0
- package/lib/body.ws.js +47 -0
- package/lib/bold.js +9 -0
- package/lib/bold.ws.js +23 -0
- package/lib/box.js +14 -0
- package/lib/box.ws.js +46 -0
- package/lib/button.js +16 -0
- package/lib/button.ws.js +31 -0
- package/lib/checkbox-field.js +9 -0
- package/lib/checkbox-field.ws.js +44 -0
- package/lib/checkbox.js +9 -0
- package/lib/checkbox.ws.js +40 -0
- package/lib/cjs/__generated__/blockquote.props.js +419 -0
- package/lib/cjs/__generated__/body.props.js +418 -0
- package/lib/cjs/__generated__/bold.props.js +418 -0
- package/lib/cjs/__generated__/box.props.js +436 -0
- package/lib/cjs/__generated__/button.props.js +440 -0
- package/lib/cjs/__generated__/checkbox-field.props.js +419 -0
- package/lib/cjs/__generated__/checkbox.props.js +459 -0
- package/lib/cjs/__generated__/code-text.props.js +425 -0
- package/lib/cjs/__generated__/error-message.props.js +418 -0
- package/lib/cjs/__generated__/form.props.js +426 -0
- package/lib/cjs/__generated__/fragment.props.js +24 -0
- package/lib/cjs/__generated__/heading.props.js +425 -0
- package/lib/cjs/__generated__/html-embed.props.js +31 -0
- package/lib/cjs/__generated__/image.props.js +462 -0
- package/lib/cjs/__generated__/input.props.js +465 -0
- package/lib/cjs/__generated__/italic.props.js +418 -0
- package/lib/cjs/__generated__/label.props.js +420 -0
- package/lib/cjs/__generated__/link-block.props.js +452 -0
- package/lib/cjs/__generated__/link.props.js +452 -0
- package/lib/cjs/__generated__/list-item.props.js +419 -0
- package/lib/cjs/__generated__/list.props.js +432 -0
- package/lib/cjs/__generated__/paragraph.props.js +418 -0
- package/lib/cjs/__generated__/radio-button-field.props.js +419 -0
- package/lib/cjs/__generated__/radio-button.props.js +459 -0
- package/lib/cjs/__generated__/rich-text-link.props.js +452 -0
- package/lib/cjs/__generated__/separator.props.js +418 -0
- package/lib/cjs/__generated__/slot.props.js +24 -0
- package/lib/cjs/__generated__/span.props.js +418 -0
- package/lib/cjs/__generated__/subscript.props.js +418 -0
- package/lib/cjs/__generated__/success-message.props.js +418 -0
- package/lib/cjs/__generated__/superscript.props.js +418 -0
- package/lib/cjs/__generated__/text-block.props.js +425 -0
- package/lib/cjs/__generated__/textarea.props.js +432 -0
- package/lib/cjs/blockquote.js +32 -0
- package/lib/cjs/blockquote.ws.js +94 -0
- package/lib/cjs/body.js +29 -0
- package/lib/cjs/body.ws.js +65 -0
- package/lib/cjs/bold.js +29 -0
- package/lib/cjs/bold.ws.js +41 -0
- package/lib/cjs/box.js +31 -0
- package/lib/cjs/box.ws.js +53 -0
- package/lib/cjs/button.js +36 -0
- package/lib/cjs/button.ws.js +49 -0
- package/lib/cjs/checkbox-field.js +29 -0
- package/lib/cjs/checkbox-field.ws.js +62 -0
- package/lib/cjs/checkbox.js +29 -0
- package/lib/cjs/checkbox.ws.js +58 -0
- package/lib/cjs/code-text.js +39 -0
- package/lib/cjs/code-text.ws.js +74 -0
- package/lib/cjs/components.js +88 -0
- package/lib/cjs/error-message.js +29 -0
- package/lib/cjs/error-message.ws.js +40 -0
- package/lib/cjs/form.js +29 -0
- package/lib/cjs/form.ws.js +82 -0
- package/lib/cjs/fragment.js +29 -0
- package/lib/cjs/fragment.ws.js +33 -0
- package/lib/cjs/heading.js +31 -0
- package/lib/cjs/heading.ws.js +56 -0
- package/lib/cjs/html-embed.js +80 -0
- package/lib/cjs/html-embed.ws.js +45 -0
- package/lib/cjs/image.js +76 -0
- package/lib/cjs/image.ws.js +66 -0
- package/lib/cjs/input.js +29 -0
- package/lib/cjs/input.ws.js +55 -0
- package/lib/cjs/italic.js +29 -0
- package/lib/cjs/italic.ws.js +47 -0
- package/lib/cjs/label.js +29 -0
- package/lib/cjs/label.ws.js +63 -0
- package/lib/cjs/link-block.js +30 -0
- package/lib/cjs/link-block.ws.js +53 -0
- package/lib/cjs/link.js +48 -0
- package/lib/cjs/link.ws.js +79 -0
- package/lib/cjs/list-item.js +32 -0
- package/lib/cjs/list-item.ws.js +51 -0
- package/lib/cjs/list.js +31 -0
- package/lib/cjs/list.ws.js +73 -0
- package/lib/cjs/metas.js +88 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/paragraph.js +29 -0
- package/lib/cjs/paragraph.ws.js +50 -0
- package/lib/cjs/props.js +88 -0
- package/lib/cjs/radio-button-field.js +29 -0
- package/lib/cjs/radio-button-field.ws.js +62 -0
- package/lib/cjs/radio-button.js +29 -0
- package/lib/cjs/radio-button.ws.js +58 -0
- package/lib/cjs/rich-text-link.js +28 -0
- package/lib/cjs/rich-text-link.ws.js +39 -0
- package/lib/cjs/separator.js +32 -0
- package/lib/cjs/separator.ws.js +70 -0
- package/lib/cjs/slot.js +36 -0
- package/lib/cjs/slot.ws.js +36 -0
- package/lib/cjs/span.js +29 -0
- package/lib/cjs/span.ws.js +41 -0
- package/lib/cjs/subscript.js +29 -0
- package/lib/cjs/subscript.ws.js +41 -0
- package/lib/cjs/success-message.js +29 -0
- package/lib/cjs/success-message.ws.js +40 -0
- package/lib/cjs/superscript.js +29 -0
- package/lib/cjs/superscript.ws.js +41 -0
- package/lib/cjs/text-block.js +32 -0
- package/lib/cjs/text-block.ws.js +57 -0
- package/lib/cjs/textarea.js +29 -0
- package/lib/cjs/textarea.ws.js +59 -0
- package/lib/code-text.js +22 -0
- package/lib/code-text.ws.js +56 -0
- package/lib/components.js +68 -0
- package/lib/error-message.js +9 -0
- package/lib/error-message.ws.js +20 -0
- package/lib/form.js +9 -0
- package/lib/form.ws.js +64 -0
- package/lib/fragment.js +9 -0
- package/lib/fragment.ws.js +13 -0
- package/lib/heading.js +14 -0
- package/lib/heading.ws.js +38 -0
- package/lib/html-embed.js +65 -0
- package/lib/html-embed.ws.js +25 -0
- package/lib/image.js +66 -0
- package/lib/image.ws.js +48 -0
- package/lib/input.js +9 -0
- package/lib/input.ws.js +37 -0
- package/lib/italic.js +9 -0
- package/lib/italic.ws.js +29 -0
- package/lib/label.js +9 -0
- package/lib/label.ws.js +45 -0
- package/lib/link-block.js +10 -0
- package/lib/link-block.ws.js +33 -0
- package/lib/link.js +32 -0
- package/lib/link.ws.js +61 -0
- package/lib/list-item.js +15 -0
- package/lib/list-item.ws.js +33 -0
- package/lib/list.js +14 -0
- package/lib/list.ws.js +55 -0
- package/lib/metas.js +68 -0
- package/lib/paragraph.js +9 -0
- package/lib/paragraph.ws.js +32 -0
- package/lib/props.js +68 -0
- package/lib/radio-button-field.js +9 -0
- package/lib/radio-button-field.ws.js +44 -0
- package/lib/radio-button.js +9 -0
- package/lib/radio-button.ws.js +40 -0
- package/lib/rich-text-link.js +8 -0
- package/lib/rich-text-link.ws.js +19 -0
- package/lib/separator.js +15 -0
- package/lib/separator.ws.js +52 -0
- package/lib/slot.js +16 -0
- package/lib/slot.ws.js +16 -0
- package/lib/span.js +9 -0
- package/lib/span.ws.js +23 -0
- package/lib/subscript.js +9 -0
- package/lib/subscript.ws.js +23 -0
- package/lib/success-message.js +9 -0
- package/lib/success-message.ws.js +20 -0
- package/lib/superscript.js +9 -0
- package/lib/superscript.ws.js +23 -0
- package/lib/text-block.js +15 -0
- package/lib/text-block.ws.js +39 -0
- package/lib/textarea.js +9 -0
- package/lib/textarea.ws.js +41 -0
- package/lib/types/__generated__/blockquote.props.d.ts +2 -0
- package/lib/types/__generated__/body.props.d.ts +2 -0
- package/lib/types/__generated__/bold.props.d.ts +2 -0
- package/lib/types/__generated__/box.props.d.ts +2 -0
- package/lib/types/__generated__/button.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox-field.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/__generated__/code-text.props.d.ts +2 -0
- package/lib/types/__generated__/error-message.props.d.ts +2 -0
- package/lib/types/__generated__/form.props.d.ts +2 -0
- package/lib/types/__generated__/fragment.props.d.ts +2 -0
- package/lib/types/__generated__/heading.props.d.ts +2 -0
- package/lib/types/__generated__/html-embed.props.d.ts +2 -0
- package/lib/types/__generated__/image.props.d.ts +2 -0
- package/lib/types/__generated__/input.props.d.ts +2 -0
- package/lib/types/__generated__/italic.props.d.ts +2 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/link-block.props.d.ts +2 -0
- package/lib/types/__generated__/link.props.d.ts +2 -0
- package/lib/types/__generated__/list-item.props.d.ts +2 -0
- package/lib/types/__generated__/list.props.d.ts +2 -0
- package/lib/types/__generated__/paragraph.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button-field.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/__generated__/separator.props.d.ts +2 -0
- package/lib/types/__generated__/slot.props.d.ts +2 -0
- package/lib/types/__generated__/span.props.d.ts +2 -0
- package/lib/types/__generated__/subscript.props.d.ts +2 -0
- package/lib/types/__generated__/success-message.props.d.ts +2 -0
- package/lib/types/__generated__/superscript.props.d.ts +2 -0
- package/lib/types/__generated__/text-block.props.d.ts +2 -0
- package/lib/types/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/blockquote.d.ts +3 -0
- package/lib/types/blockquote.stories.d.ts +5 -0
- package/lib/types/blockquote.ws.d.ts +3 -0
- package/lib/types/body.d.ts +3 -0
- package/lib/types/body.stories.d.ts +6 -0
- package/lib/types/body.ws.d.ts +3 -0
- package/lib/types/bold.d.ts +3 -0
- package/lib/types/bold.stories.d.ts +5 -0
- package/lib/types/bold.ws.d.ts +3 -0
- package/lib/types/box.d.ts +7 -0
- package/lib/types/box.stories.d.ts +9 -0
- package/lib/types/box.ws.d.ts +3 -0
- package/lib/types/button.d.ts +7 -0
- package/lib/types/button.stories.d.ts +9 -0
- package/lib/types/button.ws.d.ts +3 -0
- package/lib/types/checkbox-field.d.ts +3 -0
- package/lib/types/checkbox-field.ws.d.ts +3 -0
- package/lib/types/checkbox.d.ts +3 -0
- package/lib/types/checkbox.ws.d.ts +3 -0
- package/lib/types/code-text.d.ts +9 -0
- package/lib/types/code-text.stories.d.ts +11 -0
- package/lib/types/code-text.ws.d.ts +3 -0
- package/lib/types/components.d.ts +33 -0
- package/lib/types/error-message.d.ts +3 -0
- package/lib/types/error-message.ws.d.ts +3 -0
- package/lib/types/form.d.ts +3 -0
- package/lib/types/form.stories.d.ts +5 -0
- package/lib/types/form.ws.d.ts +3 -0
- package/lib/types/fragment.d.ts +6 -0
- package/lib/types/fragment.ws.d.ts +3 -0
- package/lib/types/heading.d.ts +7 -0
- package/lib/types/heading.stories.d.ts +9 -0
- package/lib/types/heading.ws.d.ts +3 -0
- package/lib/types/html-embed.d.ts +7 -0
- package/lib/types/html-embed.stories.d.ts +11 -0
- package/lib/types/html-embed.ws.d.ts +3 -0
- package/lib/types/image.d.ts +7 -0
- package/lib/types/image.stories.d.ts +13 -0
- package/lib/types/image.ws.d.ts +3 -0
- package/lib/types/input.d.ts +5 -0
- package/lib/types/input.stories.d.ts +9 -0
- package/lib/types/input.ws.d.ts +3 -0
- package/lib/types/italic.d.ts +3 -0
- package/lib/types/italic.stories.d.ts +5 -0
- package/lib/types/italic.ws.d.ts +3 -0
- package/lib/types/label.d.ts +3 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/link-block.d.ts +3 -0
- package/lib/types/link-block.stories.d.ts +13 -0
- package/lib/types/link-block.ws.d.ts +3 -0
- package/lib/types/link.d.ts +9 -0
- package/lib/types/link.stories.d.ts +13 -0
- package/lib/types/link.ws.d.ts +3 -0
- package/lib/types/list-item.d.ts +3 -0
- package/lib/types/list-item.stories.d.ts +5 -0
- package/lib/types/list-item.ws.d.ts +3 -0
- package/lib/types/list.d.ts +9 -0
- package/lib/types/list.stories.d.ts +9 -0
- package/lib/types/list.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +33 -0
- package/lib/types/paragraph.d.ts +3 -0
- package/lib/types/paragraph.stories.d.ts +5 -0
- package/lib/types/paragraph.ws.d.ts +3 -0
- package/lib/types/props.d.ts +33 -0
- package/lib/types/radio-button-field.d.ts +3 -0
- package/lib/types/radio-button-field.ws.d.ts +3 -0
- package/lib/types/radio-button.d.ts +3 -0
- package/lib/types/radio-button.ws.d.ts +3 -0
- package/lib/types/rich-text-link.d.ts +2 -0
- package/lib/types/rich-text-link.stories.d.ts +13 -0
- package/lib/types/rich-text-link.ws.d.ts +3 -0
- package/lib/types/separator.d.ts +3 -0
- package/lib/types/separator.stories.d.ts +5 -0
- package/lib/types/separator.ws.d.ts +3 -0
- package/lib/types/slot.d.ts +6 -0
- package/lib/types/slot.stories.d.ts +9 -0
- package/lib/types/slot.ws.d.ts +3 -0
- package/lib/types/span.d.ts +3 -0
- package/lib/types/span.stories.d.ts +5 -0
- package/lib/types/span.ws.d.ts +3 -0
- package/lib/types/subscript.d.ts +3 -0
- package/lib/types/subscript.stories.d.ts +5 -0
- package/lib/types/subscript.ws.d.ts +3 -0
- package/lib/types/success-message.d.ts +3 -0
- package/lib/types/success-message.ws.d.ts +3 -0
- package/lib/types/superscript.d.ts +3 -0
- package/lib/types/superscript.stories.d.ts +5 -0
- package/lib/types/superscript.ws.d.ts +3 -0
- package/lib/types/text-block.d.ts +7 -0
- package/lib/types/text-block.stories.d.ts +9 -0
- package/lib/types/text-block.ws.d.ts +3 -0
- package/lib/types/textarea.d.ts +3 -0
- package/lib/types/textarea.ws.d.ts +3 -0
- package/package.json +69 -0
- package/src/__generated__/blockquote.props.ts +444 -0
- package/src/__generated__/body.props.ts +443 -0
- package/src/__generated__/bold.props.ts +443 -0
- package/src/__generated__/box.props.ts +461 -0
- package/src/__generated__/button.props.ts +465 -0
- package/src/__generated__/checkbox-field.props.ts +444 -0
- package/src/__generated__/checkbox.props.ts +484 -0
- package/src/__generated__/code-text.props.ts +450 -0
- package/src/__generated__/error-message.props.ts +443 -0
- package/src/__generated__/form.props.ts +451 -0
- package/src/__generated__/fragment.props.ts +3 -0
- package/src/__generated__/heading.props.ts +450 -0
- package/src/__generated__/html-embed.props.ts +10 -0
- package/src/__generated__/image.props.ts +487 -0
- package/src/__generated__/input.props.ts +490 -0
- package/src/__generated__/italic.props.ts +443 -0
- package/src/__generated__/label.props.ts +445 -0
- package/src/__generated__/link-block.props.ts +477 -0
- package/src/__generated__/link.props.ts +477 -0
- package/src/__generated__/list-item.props.ts +444 -0
- package/src/__generated__/list.props.ts +457 -0
- package/src/__generated__/paragraph.props.ts +443 -0
- package/src/__generated__/radio-button-field.props.ts +444 -0
- package/src/__generated__/radio-button.props.ts +484 -0
- package/src/__generated__/rich-text-link.props.ts +477 -0
- package/src/__generated__/separator.props.ts +443 -0
- package/src/__generated__/slot.props.ts +3 -0
- package/src/__generated__/span.props.ts +443 -0
- package/src/__generated__/subscript.props.ts +443 -0
- package/src/__generated__/success-message.props.ts +443 -0
- package/src/__generated__/superscript.props.ts +443 -0
- package/src/__generated__/text-block.props.ts +450 -0
- package/src/__generated__/textarea.props.ts +457 -0
- package/src/blockquote.stories.tsx +16 -0
- package/src/blockquote.tsx +18 -0
- package/src/blockquote.ws.tsx +81 -0
- package/src/body.stories.tsx +11 -0
- package/src/body.tsx +10 -0
- package/src/body.ws.tsx +51 -0
- package/src/bold.stories.tsx +16 -0
- package/src/bold.tsx +10 -0
- package/src/bold.ws.tsx +26 -0
- package/src/box.stories.tsx +17 -0
- package/src/box.tsx +31 -0
- package/src/box.ws.ts +52 -0
- package/src/button.stories.tsx +13 -0
- package/src/button.tsx +23 -0
- package/src/button.ws.tsx +34 -0
- package/src/checkbox-field.tsx +10 -0
- package/src/checkbox-field.ws.tsx +47 -0
- package/src/checkbox.tsx +13 -0
- package/src/checkbox.ws.tsx +43 -0
- package/src/code-text.stories.tsx +16 -0
- package/src/code-text.tsx +31 -0
- package/src/code-text.ws.tsx +58 -0
- package/src/components.ts +33 -0
- package/src/error-message.tsx +10 -0
- package/src/error-message.ws.tsx +24 -0
- package/src/form.stories.tsx +14 -0
- package/src/form.tsx +14 -0
- package/src/form.ws.tsx +67 -0
- package/src/fragment.tsx +11 -0
- package/src/fragment.ws.ts +15 -0
- package/src/heading.stories.tsx +16 -0
- package/src/heading.tsx +20 -0
- package/src/heading.ws.tsx +44 -0
- package/src/html-embed.stories.tsx +16 -0
- package/src/html-embed.tsx +96 -0
- package/src/html-embed.ws.ts +27 -0
- package/src/image.stories.tsx +15 -0
- package/src/image.tsx +83 -0
- package/src/image.ws.tsx +54 -0
- package/src/input.stories.tsx +14 -0
- package/src/input.tsx +13 -0
- package/src/input.ws.tsx +40 -0
- package/src/italic.stories.tsx +16 -0
- package/src/italic.tsx +10 -0
- package/src/italic.ws.tsx +32 -0
- package/src/label.tsx +10 -0
- package/src/label.ws.tsx +48 -0
- package/src/link-block.stories.tsx +16 -0
- package/src/link-block.tsx +9 -0
- package/src/link-block.ws.tsx +38 -0
- package/src/link.stories.tsx +16 -0
- package/src/link.tsx +44 -0
- package/src/link.ws.tsx +64 -0
- package/src/list-item.stories.tsx +16 -0
- package/src/list-item.tsx +18 -0
- package/src/list-item.ws.tsx +36 -0
- package/src/list.stories.tsx +17 -0
- package/src/list.tsx +26 -0
- package/src/list.ws.tsx +58 -0
- package/src/metas.ts +33 -0
- package/src/paragraph.stories.tsx +16 -0
- package/src/paragraph.tsx +10 -0
- package/src/paragraph.ws.tsx +35 -0
- package/src/props.ts +33 -0
- package/src/radio-button-field.tsx +10 -0
- package/src/radio-button-field.ws.tsx +47 -0
- package/src/radio-button.tsx +13 -0
- package/src/radio-button.ws.tsx +43 -0
- package/src/rich-text-link.stories.tsx +16 -0
- package/src/rich-text-link.tsx +8 -0
- package/src/rich-text-link.ws.tsx +22 -0
- package/src/separator.stories.tsx +14 -0
- package/src/separator.tsx +18 -0
- package/src/separator.ws.tsx +56 -0
- package/src/slot.stories.tsx +16 -0
- package/src/slot.tsx +17 -0
- package/src/slot.ws.ts +18 -0
- package/src/span.stories.tsx +16 -0
- package/src/span.tsx +10 -0
- package/src/span.ws.tsx +26 -0
- package/src/subscript.stories.tsx +16 -0
- package/src/subscript.tsx +10 -0
- package/src/subscript.ws.tsx +26 -0
- package/src/success-message.tsx +10 -0
- package/src/success-message.ws.tsx +24 -0
- package/src/superscript.stories.tsx +16 -0
- package/src/superscript.tsx +10 -0
- package/src/superscript.ws.tsx +26 -0
- package/src/text-block.stories.tsx +16 -0
- package/src/text-block.tsx +21 -0
- package/src/text-block.ws.tsx +42 -0
- package/src/textarea.tsx +13 -0
- package/src/textarea.ws.tsx +44 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HeadingIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { h1, h2, h3, h4, h5, h6 } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/heading.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
h1,
|
|
9
|
+
h2,
|
|
10
|
+
h3,
|
|
11
|
+
h4,
|
|
12
|
+
h5,
|
|
13
|
+
h6
|
|
14
|
+
};
|
|
15
|
+
const meta = {
|
|
16
|
+
category: "text",
|
|
17
|
+
type: "rich-text",
|
|
18
|
+
label: "Heading",
|
|
19
|
+
icon: HeadingIcon,
|
|
20
|
+
states: defaultStates,
|
|
21
|
+
presetStyle,
|
|
22
|
+
template: [
|
|
23
|
+
{
|
|
24
|
+
type: "instance",
|
|
25
|
+
component: "Heading",
|
|
26
|
+
children: [{ type: "text", value: "Heading you can edit" }]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
order: 1
|
|
30
|
+
};
|
|
31
|
+
const propsMeta = {
|
|
32
|
+
props,
|
|
33
|
+
initialProps: ["tag"]
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
meta,
|
|
37
|
+
propsMeta
|
|
38
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
forwardRef,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useRef
|
|
7
|
+
} from "react";
|
|
8
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
9
|
+
import { ReactSdkContext } from "@webstudio-is/react-sdk";
|
|
10
|
+
const ExecutableHtml = (props) => {
|
|
11
|
+
const { code, innerRef, ...rest } = props;
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const container = containerRef.current;
|
|
15
|
+
if (container === null || code === void 0) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const range = document.createRange();
|
|
19
|
+
range.setStart(container, 0);
|
|
20
|
+
const fragment = range.createContextualFragment(code);
|
|
21
|
+
while (container.firstChild) {
|
|
22
|
+
container.removeChild(container.firstChild);
|
|
23
|
+
}
|
|
24
|
+
container.append(fragment);
|
|
25
|
+
}, [code]);
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
...rest,
|
|
30
|
+
ref: mergeRefs(innerRef, containerRef),
|
|
31
|
+
style: { display: "contents" }
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
const InnerHtml = (props) => {
|
|
36
|
+
const { code, innerRef, ...rest } = props;
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
...rest,
|
|
41
|
+
ref: innerRef,
|
|
42
|
+
style: { display: "contents" },
|
|
43
|
+
dangerouslySetInnerHTML: { __html: props.code ?? "" }
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
const Placeholder = (props) => {
|
|
48
|
+
const { code, innerRef, ...rest } = props;
|
|
49
|
+
return /* @__PURE__ */ jsx("div", { ref: innerRef, ...rest, style: { padding: "20px" }, children: 'Open "Properties" panel to insert HTML code' });
|
|
50
|
+
};
|
|
51
|
+
const HtmlEmbed = forwardRef((props, ref) => {
|
|
52
|
+
const { renderer } = useContext(ReactSdkContext);
|
|
53
|
+
const { code, executeScriptOnCanvas, ...rest } = props;
|
|
54
|
+
if (code === void 0 || code.trim().length === 0) {
|
|
55
|
+
return /* @__PURE__ */ jsx(Placeholder, { innerRef: ref, ...rest });
|
|
56
|
+
}
|
|
57
|
+
if (renderer === "canvas" && executeScriptOnCanvas === true) {
|
|
58
|
+
return /* @__PURE__ */ jsx(ExecutableHtml, { innerRef: ref, code, ...rest });
|
|
59
|
+
}
|
|
60
|
+
return /* @__PURE__ */ jsx(InnerHtml, { innerRef: ref, code, ...rest });
|
|
61
|
+
});
|
|
62
|
+
HtmlEmbed.displayName = "HtmlEmbed";
|
|
63
|
+
export {
|
|
64
|
+
HtmlEmbed
|
|
65
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EmbedIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { props } from "./__generated__/html-embed.props";
|
|
3
|
+
const meta = {
|
|
4
|
+
category: "general",
|
|
5
|
+
type: "embed",
|
|
6
|
+
label: "HTML Embed",
|
|
7
|
+
icon: EmbedIcon,
|
|
8
|
+
stylable: false,
|
|
9
|
+
order: 7
|
|
10
|
+
};
|
|
11
|
+
const propsMeta = {
|
|
12
|
+
props: {
|
|
13
|
+
...props,
|
|
14
|
+
code: {
|
|
15
|
+
required: true,
|
|
16
|
+
control: "code",
|
|
17
|
+
type: "string",
|
|
18
|
+
rows: 10
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
meta,
|
|
24
|
+
propsMeta
|
|
25
|
+
};
|
package/lib/image.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
forwardRef,
|
|
4
|
+
useMemo
|
|
5
|
+
} from "react";
|
|
6
|
+
import {
|
|
7
|
+
Image as WebstudioImage,
|
|
8
|
+
createImageLoader
|
|
9
|
+
} from "@webstudio-is/image";
|
|
10
|
+
import {
|
|
11
|
+
usePropAsset,
|
|
12
|
+
getInstanceIdFromComponentProps,
|
|
13
|
+
getParams
|
|
14
|
+
} from "@webstudio-is/react-sdk";
|
|
15
|
+
const defaultTag = "img";
|
|
16
|
+
const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
|
|
17
|
+
width="140"
|
|
18
|
+
height="140"
|
|
19
|
+
viewBox="0 0 600 600"
|
|
20
|
+
fill="none"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
>
|
|
23
|
+
<rect width="600" height="600" fill="#CCCCCC" />
|
|
24
|
+
<path
|
|
25
|
+
fill-rule="evenodd"
|
|
26
|
+
clip-rule="evenodd"
|
|
27
|
+
d="M450 170H150C141.716 170 135 176.716 135 185V415C135 423.284 141.716 430 150 430H450C458.284 430 465 423.284 465 415V185C465 176.716 458.284 170 450 170ZM150 145C127.909 145 110 162.909 110 185V415C110 437.091 127.909 455 150 455H450C472.091 455 490 437.091 490 415V185C490 162.909 472.091 145 450 145H150Z"
|
|
28
|
+
fill="#A2A2A2"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
d="M237.135 235.012C237.135 255.723 220.345 272.512 199.635 272.512C178.924 272.512 162.135 255.723 162.135 235.012C162.135 214.301 178.924 197.512 199.635 197.512C220.345 197.512 237.135 214.301 237.135 235.012Z"
|
|
32
|
+
fill="#A2A2A2"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M160 405V367.205L221.609 306.364L256.552 338.628L358.161 234L440 316.043V405H160Z"
|
|
36
|
+
fill="#A2A2A2"
|
|
37
|
+
/>
|
|
38
|
+
</svg>`)}`;
|
|
39
|
+
const Image = forwardRef(
|
|
40
|
+
(props, ref) => {
|
|
41
|
+
const asset = usePropAsset(getInstanceIdFromComponentProps(props), "src");
|
|
42
|
+
const loader = useMemo(() => {
|
|
43
|
+
const params = getParams();
|
|
44
|
+
return createImageLoader({ imageBaseUrl: params.imageBaseUrl });
|
|
45
|
+
}, []);
|
|
46
|
+
const src = asset?.name ?? props.src;
|
|
47
|
+
if (asset == null || loader == null) {
|
|
48
|
+
return /* @__PURE__ */ jsx("img", { ...props, src: src || imagePlaceholderSvg, ref }, src);
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
WebstudioImage,
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
loader,
|
|
55
|
+
src,
|
|
56
|
+
ref
|
|
57
|
+
},
|
|
58
|
+
src
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
Image.displayName = "Image";
|
|
63
|
+
export {
|
|
64
|
+
Image,
|
|
65
|
+
defaultTag
|
|
66
|
+
};
|
package/lib/image.ws.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ImageIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { img } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/image.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
img: [
|
|
9
|
+
...img,
|
|
10
|
+
// Otherwise on new image insert onto canvas it can overfit screen size multiple times
|
|
11
|
+
{
|
|
12
|
+
property: "maxWidth",
|
|
13
|
+
value: { type: "unit", unit: "%", value: 100 }
|
|
14
|
+
},
|
|
15
|
+
// inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
|
|
16
|
+
// see https://stackoverflow.com/questions/24771194/is-the-margin-of-inline-block-4px-is-static-for-all-browsers
|
|
17
|
+
{
|
|
18
|
+
property: "display",
|
|
19
|
+
value: { type: "keyword", value: "block" }
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
const meta = {
|
|
24
|
+
category: "media",
|
|
25
|
+
type: "embed",
|
|
26
|
+
label: "Image",
|
|
27
|
+
icon: ImageIcon,
|
|
28
|
+
states: defaultStates,
|
|
29
|
+
presetStyle,
|
|
30
|
+
order: 0
|
|
31
|
+
};
|
|
32
|
+
const { loader, ...publicProps } = props;
|
|
33
|
+
const propsMeta = {
|
|
34
|
+
props: {
|
|
35
|
+
...publicProps,
|
|
36
|
+
src: {
|
|
37
|
+
type: "string",
|
|
38
|
+
control: "file",
|
|
39
|
+
label: "Source",
|
|
40
|
+
required: false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
initialProps: ["src", "width", "height", "alt", "loading"]
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
meta,
|
|
47
|
+
propsMeta
|
|
48
|
+
};
|
package/lib/input.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
const defaultTag = "input";
|
|
4
|
+
const Input = forwardRef(({ children: _children, ...props }, ref) => /* @__PURE__ */ jsx("input", { ...props, ref }));
|
|
5
|
+
Input.displayName = "Input";
|
|
6
|
+
export {
|
|
7
|
+
Input,
|
|
8
|
+
defaultTag
|
|
9
|
+
};
|
package/lib/input.ws.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FormTextFieldIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { input } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/input.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
input
|
|
9
|
+
};
|
|
10
|
+
const meta = {
|
|
11
|
+
category: "forms",
|
|
12
|
+
type: "control",
|
|
13
|
+
label: "Text Input",
|
|
14
|
+
icon: FormTextFieldIcon,
|
|
15
|
+
presetStyle,
|
|
16
|
+
order: 3,
|
|
17
|
+
states: [
|
|
18
|
+
...defaultStates,
|
|
19
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
20
|
+
{ selector: ":valid", label: "Valid" },
|
|
21
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
22
|
+
{ selector: ":required", label: "Required" },
|
|
23
|
+
{ selector: ":optional", label: "Optional" },
|
|
24
|
+
{ selector: ":disabled", label: "Disabled" },
|
|
25
|
+
{ selector: ":enabled", label: "Enabled" },
|
|
26
|
+
{ selector: ":read-only", label: "Read Only" },
|
|
27
|
+
{ selector: ":read-write", label: "Read Write" }
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
const propsMeta = {
|
|
31
|
+
props,
|
|
32
|
+
initialProps: ["name", "type", "placeholder", "required", "autoFocus"]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
meta,
|
|
36
|
+
propsMeta
|
|
37
|
+
};
|
package/lib/italic.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
const defaultTag = "i";
|
|
4
|
+
const Italic = forwardRef((props, ref) => /* @__PURE__ */ jsx("i", { ...props, ref }));
|
|
5
|
+
Italic.displayName = "Italic";
|
|
6
|
+
export {
|
|
7
|
+
Italic,
|
|
8
|
+
defaultTag
|
|
9
|
+
};
|
package/lib/italic.ws.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TextItalicIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { i } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/italic.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
i: [
|
|
9
|
+
...i,
|
|
10
|
+
{
|
|
11
|
+
property: "fontStyle",
|
|
12
|
+
value: { type: "keyword", value: "italic" }
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
const meta = {
|
|
17
|
+
type: "rich-text-child",
|
|
18
|
+
label: "Italic Text",
|
|
19
|
+
icon: TextItalicIcon,
|
|
20
|
+
states: defaultStates,
|
|
21
|
+
presetStyle
|
|
22
|
+
};
|
|
23
|
+
const propsMeta = {
|
|
24
|
+
props
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
meta,
|
|
28
|
+
propsMeta
|
|
29
|
+
};
|
package/lib/label.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
const defaultTag = "label";
|
|
4
|
+
const Label = forwardRef((props, ref) => /* @__PURE__ */ jsx("label", { ...props, ref }));
|
|
5
|
+
Label.displayName = "Label";
|
|
6
|
+
export {
|
|
7
|
+
Label,
|
|
8
|
+
defaultTag
|
|
9
|
+
};
|
package/lib/label.ws.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TextBlockIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { label } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/label.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
label: [
|
|
9
|
+
...label,
|
|
10
|
+
{ property: "display", value: { type: "keyword", value: "block" } }
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
const meta = {
|
|
14
|
+
category: "forms",
|
|
15
|
+
type: "rich-text",
|
|
16
|
+
label: "Input Label",
|
|
17
|
+
icon: TextBlockIcon,
|
|
18
|
+
states: defaultStates,
|
|
19
|
+
presetStyle,
|
|
20
|
+
order: 2,
|
|
21
|
+
template: [
|
|
22
|
+
{
|
|
23
|
+
type: "instance",
|
|
24
|
+
component: "Label",
|
|
25
|
+
children: [{ type: "text", value: "Form Label" }]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
const propsMeta = {
|
|
30
|
+
props: {
|
|
31
|
+
...props,
|
|
32
|
+
htmlFor: {
|
|
33
|
+
required: false,
|
|
34
|
+
control: "text",
|
|
35
|
+
type: "string",
|
|
36
|
+
rows: 0,
|
|
37
|
+
label: "For"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
initialProps: ["htmlFor"]
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
meta,
|
|
44
|
+
propsMeta
|
|
45
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Link } from "./link";
|
|
4
|
+
import { defaultTag } from "./link";
|
|
5
|
+
const LinkBlock = forwardRef((props, ref) => /* @__PURE__ */ jsx(Link, { ...props, ref }));
|
|
6
|
+
LinkBlock.displayName = "LinkBlock";
|
|
7
|
+
export {
|
|
8
|
+
LinkBlock,
|
|
9
|
+
defaultTag
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LinkBlockIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { a } from "@webstudio-is/react-sdk/css-normalize";
|
|
3
|
+
import { props } from "./__generated__/link-block.props";
|
|
4
|
+
import { meta as linkMeta, propsMeta as linkPropsMeta } from "./link.ws";
|
|
5
|
+
const presetStyle = {
|
|
6
|
+
a: [
|
|
7
|
+
...a,
|
|
8
|
+
{
|
|
9
|
+
property: "display",
|
|
10
|
+
value: { type: "keyword", value: "inline-block" }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
};
|
|
14
|
+
const meta = {
|
|
15
|
+
category: "general",
|
|
16
|
+
type: "container",
|
|
17
|
+
label: "Link Block",
|
|
18
|
+
icon: LinkBlockIcon,
|
|
19
|
+
states: linkMeta.states,
|
|
20
|
+
presetStyle,
|
|
21
|
+
order: 2
|
|
22
|
+
};
|
|
23
|
+
const propsMeta = {
|
|
24
|
+
props: {
|
|
25
|
+
...props,
|
|
26
|
+
href: linkPropsMeta.props.href
|
|
27
|
+
},
|
|
28
|
+
initialProps: linkPropsMeta.initialProps
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
meta,
|
|
32
|
+
propsMeta
|
|
33
|
+
};
|
package/lib/link.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import {
|
|
4
|
+
usePropUrl,
|
|
5
|
+
getInstanceIdFromComponentProps,
|
|
6
|
+
getParams
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
const defaultTag = "a";
|
|
9
|
+
const Link = forwardRef((props, ref) => {
|
|
10
|
+
const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
|
|
11
|
+
const { assetBaseUrl } = getParams();
|
|
12
|
+
let url = "#";
|
|
13
|
+
switch (href?.type) {
|
|
14
|
+
case "page":
|
|
15
|
+
url = href.page.path === "" ? "/" : href.page.path;
|
|
16
|
+
if (href.hash !== void 0) {
|
|
17
|
+
url += `#${href.hash}`;
|
|
18
|
+
}
|
|
19
|
+
break;
|
|
20
|
+
case "asset":
|
|
21
|
+
url = `${assetBaseUrl}${href.asset.name}`;
|
|
22
|
+
break;
|
|
23
|
+
case "string":
|
|
24
|
+
url = href.url;
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx("a", { ...props, href: url, ref });
|
|
27
|
+
});
|
|
28
|
+
Link.displayName = "Link";
|
|
29
|
+
export {
|
|
30
|
+
Link,
|
|
31
|
+
defaultTag
|
|
32
|
+
};
|
package/lib/link.ws.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LinkIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { a } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/link.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
a: [
|
|
9
|
+
...a,
|
|
10
|
+
{
|
|
11
|
+
property: "minHeight",
|
|
12
|
+
value: { type: "unit", unit: "em", value: 1 }
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
property: "display",
|
|
16
|
+
value: { type: "keyword", value: "inline-block" }
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
const meta = {
|
|
21
|
+
category: "general",
|
|
22
|
+
type: "rich-text",
|
|
23
|
+
label: "Link Text",
|
|
24
|
+
icon: LinkIcon,
|
|
25
|
+
presetStyle,
|
|
26
|
+
order: 1,
|
|
27
|
+
states: [
|
|
28
|
+
...defaultStates,
|
|
29
|
+
{
|
|
30
|
+
selector: ":visited",
|
|
31
|
+
label: "Visited"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
category: "component-states",
|
|
35
|
+
selector: "[aria-current=page]",
|
|
36
|
+
label: "Current page"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
template: [
|
|
40
|
+
{
|
|
41
|
+
type: "instance",
|
|
42
|
+
component: "Link",
|
|
43
|
+
children: [{ type: "text", value: "Link text you can edit" }]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
const propsMeta = {
|
|
48
|
+
props: {
|
|
49
|
+
...props,
|
|
50
|
+
href: {
|
|
51
|
+
type: "string",
|
|
52
|
+
control: "url",
|
|
53
|
+
required: false
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
initialProps: ["href", "target", "prefetch"]
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
meta,
|
|
60
|
+
propsMeta
|
|
61
|
+
};
|
package/lib/list-item.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
createElement
|
|
4
|
+
} from "react";
|
|
5
|
+
const defaultTag = "li";
|
|
6
|
+
const ListItem = forwardRef(
|
|
7
|
+
(props, ref) => {
|
|
8
|
+
return createElement(defaultTag, { ...props, ref });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
ListItem.displayName = "ListItem";
|
|
12
|
+
export {
|
|
13
|
+
ListItem,
|
|
14
|
+
defaultTag
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ListItemIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { li } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/list-item.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
li
|
|
9
|
+
};
|
|
10
|
+
const meta = {
|
|
11
|
+
category: "general",
|
|
12
|
+
type: "rich-text",
|
|
13
|
+
requiredAncestors: ["List"],
|
|
14
|
+
label: "List Item",
|
|
15
|
+
icon: ListItemIcon,
|
|
16
|
+
states: defaultStates,
|
|
17
|
+
presetStyle,
|
|
18
|
+
template: [
|
|
19
|
+
{
|
|
20
|
+
type: "instance",
|
|
21
|
+
component: "ListItem",
|
|
22
|
+
children: [{ type: "text", value: "List Item you can edit" }]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
order: 4
|
|
26
|
+
};
|
|
27
|
+
const propsMeta = {
|
|
28
|
+
props
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
meta,
|
|
32
|
+
propsMeta
|
|
33
|
+
};
|
package/lib/list.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
createElement
|
|
4
|
+
} from "react";
|
|
5
|
+
const unorderedTag = "ul";
|
|
6
|
+
const orderedTag = "ol";
|
|
7
|
+
const List = forwardRef(({ ordered = false, ...props }, ref) => {
|
|
8
|
+
const tag = ordered ? orderedTag : unorderedTag;
|
|
9
|
+
return createElement(tag, { ...props, ref });
|
|
10
|
+
});
|
|
11
|
+
List.displayName = "List";
|
|
12
|
+
export {
|
|
13
|
+
List
|
|
14
|
+
};
|
package/lib/list.ws.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ListIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { ol, ul } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
+
import { props } from "./__generated__/list.props";
|
|
7
|
+
const presetStyle = {
|
|
8
|
+
ol: [
|
|
9
|
+
...ol,
|
|
10
|
+
{
|
|
11
|
+
property: "marginTop",
|
|
12
|
+
value: { type: "keyword", value: "0" }
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
property: "marginBottom",
|
|
16
|
+
value: { type: "keyword", value: "10px" }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
property: "paddingLeft",
|
|
20
|
+
value: { type: "keyword", value: "40px" }
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
ul: [
|
|
24
|
+
...ul,
|
|
25
|
+
{
|
|
26
|
+
property: "marginTop",
|
|
27
|
+
value: { type: "keyword", value: "0" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
property: "marginBottom",
|
|
31
|
+
value: { type: "keyword", value: "10px" }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
property: "paddingLeft",
|
|
35
|
+
value: { type: "keyword", value: "40px" }
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
const meta = {
|
|
40
|
+
category: "general",
|
|
41
|
+
type: "container",
|
|
42
|
+
label: "List",
|
|
43
|
+
icon: ListIcon,
|
|
44
|
+
states: defaultStates,
|
|
45
|
+
presetStyle,
|
|
46
|
+
order: 3
|
|
47
|
+
};
|
|
48
|
+
const propsMeta = {
|
|
49
|
+
props,
|
|
50
|
+
initialProps: ["ordered", "type", "starts", "reversed"]
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
meta,
|
|
54
|
+
propsMeta
|
|
55
|
+
};
|