-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: brand new plugin system 🎉 (include refactoring to receive new c…
…ustom setting type)
- Loading branch information
Showing
109 changed files
with
1,106 additions
and
717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/frontend/editor/components/kit/polymorphic-text-input.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div> | ||
<uikit-text-input | ||
:label="label" | ||
:name="name" | ||
:isFocused="isFocused" | ||
@blur="$emit('blur')" | ||
v-model="inputValue" | ||
v-if="isText" | ||
/> | ||
<uikit-textarea-input | ||
:label="label" | ||
:name="name" | ||
:isFocused="isFocused" | ||
:rows="options.nbRows" | ||
@blur="$emit('blur')" | ||
v-model="inputValue" | ||
v-else-if="isTextArea" | ||
/> | ||
<uikit-rich-text-input | ||
:label="label" | ||
:name="name" | ||
:isFocused="isFocused" | ||
:lineBreak="options.lineBreak" | ||
:rows="options.nbRows" | ||
:table="options.htmlTable" | ||
@blur="$emit('blur')" | ||
v-model="inputValue" | ||
v-else-if="isRichText" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'UIKitPolymorphicTextInput', | ||
props: { | ||
label: { type: String, default: 'Label' }, | ||
name: { type: String, default: 'text' }, | ||
value: { type: String }, | ||
isFocused: { type: Boolean, default: false }, | ||
options: { type: Object, default: {} } | ||
}, | ||
computed: { | ||
isText() { | ||
return !this.options.html && parseInt(this.options.nbRows || 1) < 2 | ||
}, | ||
isTextArea() { | ||
return !this.options.html && parseInt(this.options.nbRows) > 1 | ||
}, | ||
isRichText() { | ||
return this.options.html | ||
}, | ||
inputValue: { | ||
get() { | ||
return this.value | ||
}, | ||
set(value) { | ||
this.$emit('input', value) | ||
}, | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { registerInput, getInputs } from '@/misc/dynamic-inputs' | ||
|
||
import TextInput from '@/components/kit/polymorphic-text-input.vue' | ||
import ImageInput from '@/components/kit/image-input.vue' | ||
import LinkInput from '@/components/kit/link-input.vue' | ||
import SimpleSelect from '@/components/kit/simple-select.vue' | ||
import CollectionItemInput from '@/components/kit/collection-item-input.vue' | ||
import CheckboxInput from '@/components/kit/checkbox-input.vue' | ||
import ColorInput from '@/components/kit/color-input.vue' | ||
import IconInput from '@/components/kit/icon-input.vue' | ||
import Divider from '@/components/kit/divider.vue' | ||
import Hint from '@/components/kit/hint.vue' | ||
|
||
registerInput('text', TextInput, (props, options) => ({ ...props, options })) | ||
registerInput('image', ImageInput) | ||
registerInput('link', LinkInput, (props, options) => ({ ...props, withText: options.withText })) | ||
registerInput('select', SimpleSelect, (props, options) => ({ ...props, selectOptions: options.selectOptions })) | ||
registerInput('collection_item', CollectionItemInput, (props, options) => ({ ...props, collectionId: options.collectionId })) | ||
registerInput('checkbox', CheckboxInput) | ||
registerInput('icon', IconInput) | ||
registerInput('color', ColorInput, (props, options) => ({ ...props, presets: options.presets })) | ||
registerInput('divider', Divider, (props, options) => ({ text: props.label, withHint: options.withHint })) | ||
registerInput('hint', Hint, (props, options) => ({ text: props.label })) |
File renamed without changes.
Oops, something went wrong.