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/
76 lines
1.3 KiB
Vue
76 lines
1.3 KiB
Vue
<script>
|
|
export default {
|
|
props: {
|
|
size: {
|
|
type: String,
|
|
default: 'small',
|
|
},
|
|
colorScheme: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
},
|
|
computed: {
|
|
colorSchemeClasses() {
|
|
if (this.colorScheme === 'primary') {
|
|
return 'before:!border-t-n-brand';
|
|
}
|
|
|
|
if (this.colorScheme === 'warning') {
|
|
return 'before:!border-t-n-amber-6';
|
|
}
|
|
|
|
if (this.colorScheme === 'success') {
|
|
return 'before:!border-t-n-teal-9';
|
|
}
|
|
|
|
return this.colorScheme;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<span class="spinner" :class="`${size} ${colorSchemeClasses}`" />
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
@keyframes spinner {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
.spinner {
|
|
@apply relative inline-block w-6 h-6 align-middle;
|
|
|
|
&:before {
|
|
@apply border-n-slate-10 border-2 border-solid content-[''] box-border absolute top-[50%] left-[50%] rounded-full border-t-n-strong -ml-2.5 -mt-2.5 w-6 h-6 animate-[spinner_0.9s_linear_infinite];
|
|
}
|
|
|
|
&.message {
|
|
@apply p-2.5 top-0 left-0 mx-auto my-0 mt-3 bg-n-background rounded-[2rem];
|
|
|
|
&:before {
|
|
@apply -mt-3 -ml-3;
|
|
}
|
|
}
|
|
|
|
&.small {
|
|
@apply w-4 h-4;
|
|
|
|
&:before {
|
|
@apply w-4 h-4 -mt-2;
|
|
}
|
|
}
|
|
|
|
&.tiny {
|
|
@apply w-2.5 h-2.5 py-0 px-1;
|
|
|
|
&:before {
|
|
@apply w-2.5 h-2.5 -mt-1.5;
|
|
}
|
|
}
|
|
}
|
|
</style>
|