Skip to content

Commit

Permalink
Merge pull request #7 from PrestaSafe/1.0.3-dev
Browse files Browse the repository at this point in the history
1.0.3 version
  • Loading branch information
PrestaSafe authored Dec 13, 2022
2 parents ed8e0c7 + 4d779a8 commit d57d3f9
Show file tree
Hide file tree
Showing 22 changed files with 1,541 additions and 506 deletions.
2 changes: 1 addition & 1 deletion _dev/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dist-ssr
*.sw?

# vite config
vite.config.js
# vite.config.js
255 changes: 128 additions & 127 deletions _dev/package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions _dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"dependencies": {
"@headlessui/vue": "^1.6.5",
"@meforma/vue-toaster": "^1.3.0",
"@tailwindcss/forms": "^0.3.2",
"@tinymce/tinymce-vue": "^4.0.7",
"axios": "^0.21.1",
"sortablejs": "^1.10.2",
Expand All @@ -20,7 +19,7 @@
"devDependencies": {
"@headlessui/vue": "^1.6.5",
"@heroicons/vue": "^2.0.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/forms": "^0.4.0-alpha.2",
"@vitejs/plugin-vue": "^2.2.0",
"autoprefixer": "^10.4.7",
"dropzone": "^6.0.0-beta.2",
Expand Down
63 changes: 0 additions & 63 deletions _dev/src/components--/ReactivePanel.vue

This file was deleted.

18 changes: 6 additions & 12 deletions _dev/src/components/RightPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,32 +198,26 @@ emitter.on('globalSave', () => {
</div>

{{ trans('default_settings')}}


<!-- <Checkbox class="my-4" v-model="config.default.load_ajax" title="Chargement en arrière plan" name="loadAjax" /> -->
<Checkbox class="my-4" v-model="config.default.container" :title="trans('use_container')" name="container" /> {{ trans('bg_color') }}
<div class="flex mb-4 pt-4">
<ColorInput class="flex-auto rounded-full" v-model="config.default.bg_color" format="hex string" />
<Input class="flex-auto" :placeholder="trans('ex_color')" v-model="config.default.bg_color" name="bg_color" />
</div>

<SimpleSelect v-if="Object.keys(config.templates).length > 1" v-model="config.templateSelected" :availableTpl="config.templates" :currentTpl="config.templateSelected" :label="trans('choose_template')" />
<!-- <div class="flex gap-2 justify-center mt-2" v-if="config">
<Button icon="CloudUploadIcon" type="primary" @click="saveConfig()">Sauvegarder</Button>
</div> -->

<SimpleSelect
v-if="Object.keys(config.templates).length > 1" v-model="config.templateSelected" :availableTpl="config.templates"
:currentTpl="config.templateSelected"
@update="value => console.log('value', value)"
:label="trans('choose_template')" />
</div>

<!-- State panel -->
<div v-if="!showPanel" class="state flex flex-col p-2 bg-slate-100 h-full" @keyup.enter="save()">
<div v-for="f in state" :key="f">
<FieldRepeater @updateUpload="save()" :field="f" />
</div>
<!-- <div class="flex gap-2 justify-center mt-2" v-if="state">
<Button icon="CloudUploadIcon" type="primary" @click="save()">Sauvegarder</Button>
</div> -->
</div>


<div v-if="showPanel" class="bottom-0 w-full text border-top-1">
<div>
<section @click="displayThemePanel()" class="border hover:bg-indigo hover:text-white bg-indigo text-white">
Expand Down
16 changes: 8 additions & 8 deletions _dev/src/components/form/Choices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<div class="flex items-center justify-center">

<div class="w-full max-w-xs mx-auto">

<Listbox
as="div"
class="space-y-1"
v-model="modelValue"
v-model="currentChoice"
v-slot="{ open }"

>
Expand Down Expand Up @@ -103,7 +102,7 @@
</template>

<script setup>
import { defineComponent, defineEmits, watch, computed } from "vue";
import { defineComponent, defineEmits, watch, ref } from "vue";
import {
Listbox,
ListboxLabel,
Expand All @@ -115,25 +114,26 @@ import {
let props = defineProps({
choices: Object,
label: String,
modelValue: String | Object
modelValue: String
})
let currentChoice = ref(props.modelValue)
let selectedChoice = ref(props.choices[props.modelValue])
const emit = defineEmits(['update:modelValue'])
function onChange(e) {
emit('update:modelValue', e)
selectedChoice.value = props.choices[currentChoice.value]
}
watch(() => props.modelValue, onChange)
watch(currentChoice, onChange)
defineComponent({
Listbox,
ListboxLabel,
ListboxButton,
ListboxOptions,
ListboxOption,
})
const selectedChoice = computed(() => props.choices[props.modelValue])
console.log('model Value', props.modelValue)
</script>
18 changes: 8 additions & 10 deletions _dev/src/components/form/SimpleSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<div class="flex items-center justify-center">

<div class="w-full max-w-xs mx-auto">

<!-- <Button @click="test">TEST {{ props.item }} current choice: {{ currentChoice }}</Button> -->
<Listbox
as="div"
class="space-y-1"
v-model="modelValue"
v-model="currentChoice"
v-slot="{ open }"

>
Expand All @@ -19,7 +19,7 @@
class="cursor-default relative w-full rounded-md border border-gray-300 bg-white pl-3 pr-10 py-2 text-left focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition ease-in-out duration-150 sm:text-sm sm:leading-5"
>
<span class="block truncate">
{{ currentTpl }}
{{ currentChoice }}
</span>
<span
class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"
Expand Down Expand Up @@ -103,7 +103,7 @@
</template>

<script setup>
import { defineComponent, defineEmits, watch } from "vue";
import { defineComponent, defineEmits, watch, ref } from "vue";
import {
Listbox,
ListboxLabel,
Expand All @@ -116,25 +116,23 @@ let props = defineProps({
currentTpl: String,
availableTpl: Object,
label: String,
modelValue: String | Object
modelValue: Array
})
let currentChoice = ref(props.modelValue)
const emit = defineEmits(['update:modelValue'])
function onChange(e) {
emit('update:modelValue', e)
emit('update:currentTpl', e)
}
watch(() => props.modelValue, onChange)
watch(currentChoice, onChange)
defineComponent({
Listbox,
ListboxLabel,
ListboxButton,
ListboxOptions,
ListboxOption,
})
</script>
2 changes: 1 addition & 1 deletion _dev/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const pinia = createPinia()
import './index.css'


createApp(App).use(pinia).mount('#app')
createApp(App).use(pinia).mount('#app')
23 changes: 23 additions & 0 deletions _dev/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
build:{
manifest: true,
outDir: "../build/",
emptyOutDir: true,
},
server: {
// hmr: {
// host: 'vue.prestasafe.com',
// clientPort: 443,
// protocol: 'wss'
// }
hmr: {
host: 'localhost',
protocol: 'ws'
}
}
})
Loading

0 comments on commit d57d3f9

Please sign in to comment.