Copy the Chatwoot (v4.14.0) frontend runnable subset into frontend/ for customization: - app/javascript/ (Vue SPA: dashboard, widget, sdk, portal, superadmin) - app/views/ (ERB templates for vite-plugin-ruby entrypoint resolution) - app/helpers/, app/assets/ (Rails view helpers, static assets) - enterprise/ (Enterprise edition frontend overlay) - config/vite.json, vite.config.ts, bin/vite (Vite-Rails toolchain) - package.json, pnpm-lock.yaml, tailwind/postcss/eslint configs - Gemfile, Gemfile.lock (vite_rails gem for bin/vite binstub) Excluded Rails backend: controllers, models, services, jobs, mailers, policies, db, lib, spec, public, node_modules. Update references to the new frontend location: - .gitignore: exclude frontend build artifacts (node_modules, tmp, packs), keep frontend/bin/ and frontend/vendor/ via negation - backend/scripts/parity_frontend_smoke.sh: CHATWOOT_DIR default reference/chatwoot -> ../frontend - backend/scripts/parity_frontend_browser_smoke.mjs: same default update - AGENTS.md: add frontend section with Rails/Vite coupling notes - README: architecture tree includes frontend/
82 lines
1.8 KiB
Vue
82 lines
1.8 KiB
Vue
<script setup>
|
|
import { useToggle } from '@vueuse/core';
|
|
import { vOnClickOutside } from '@vueuse/components';
|
|
|
|
import Button from 'dashboard/components-next/button/Button.vue';
|
|
import InlineInput from 'dashboard/components-next/inline-input/InlineInput.vue';
|
|
|
|
defineProps({
|
|
placeholder: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
buttonLabel: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
confirmLabel: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
cancelLabel: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(['add']);
|
|
|
|
const modelValue = defineModel({
|
|
type: String,
|
|
default: '',
|
|
});
|
|
|
|
const [showPopover, togglePopover] = useToggle();
|
|
const onClickAdd = () => {
|
|
if (!modelValue.value?.trim()) return;
|
|
emit('add', modelValue.value.trim());
|
|
modelValue.value = '';
|
|
togglePopover(false);
|
|
};
|
|
|
|
const onClickCancel = () => {
|
|
togglePopover(false);
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
v-on-click-outside="() => togglePopover(false)"
|
|
class="inline-flex relative"
|
|
>
|
|
<Button
|
|
:label="buttonLabel"
|
|
sm
|
|
slate
|
|
class="flex-shrink-0"
|
|
@click="togglePopover(!showPopover)"
|
|
/>
|
|
<div
|
|
v-if="showPopover"
|
|
class="absolute w-[26.5rem] top-9 z-50 ltr:left-0 rtl:right-0 flex flex-col gap-5 bg-n-alpha-3 backdrop-blur-[100px] p-4 rounded-xl border border-n-weak shadow-md"
|
|
>
|
|
<InlineInput
|
|
v-model="modelValue"
|
|
:placeholder="placeholder"
|
|
@keyup.enter="onClickAdd"
|
|
/>
|
|
<div class="flex gap-2 justify-between">
|
|
<Button
|
|
:label="cancelLabel"
|
|
sm
|
|
link
|
|
slate
|
|
class="h-10 hover:!no-underline"
|
|
@click="onClickCancel"
|
|
/>
|
|
<Button :label="confirmLabel" sm @click="onClickAdd" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|