PageSourceSearch

https://ryplaced.ai/assets/AdminLessonUXSettings-BCNtKd-5.js

js ryplaced.ai collected 2026-10-05 14:33:09 UTC 6,110 bytes, 1 lines download raw bytes

1import{r as c,j as e}from"./motion-CosRO9bq.js";import{a as k,ay as P,bX as T,B as b,L as E,j as x,q as h,s as p,v as f,k as u,l as o,br as j,an as v,bY as y,bP as M}from"./App-B9yavX8s.js";import{S as I,a as V,b as R,c as $,d as C}from"./select-eGq0lKF4.js";import"./i18n-DM4FnftC.js";import{u as _}from"./useLessonUXSettings-CtKcnMEO.js";import{R as z}from"./rotate-ccw-ObJq5mjM.js";import{S as O}from"./save-gwQgStEE.js";import{P as U}from"./palette-vpfzVaPt.js";import{P as X}from"./panels-top-left-CRGVk4-d.js";import"./index-BmHsUbC1.js";import"./charts-mzLkVtyt.js";import"./client-ON1bHuT4.js";import"./index-0ZK6rZ-N.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};l.SENTRY_RELEASE={id:"a43e79a71eadc3928e287951d574ba9a9663ba9f"}}catch{}})();try{(function(){var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new l.Error().stack;t&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[t]="03c39476-8884-426c-b7c7-cb1a136324ea",l._sentryDebugIdIdentifier="sentry-dbid-03c39476-8884-426c-b7c7-cb1a136324ea")})()}catch{}function se(){const{t:l}=k(["admin","common"]),{settings:t,isLoading:N,updateAllSettings:w,isUpdating:d}=_(),[r,n]=c.useState(t),[m,S]=c.useState(!1);c.useEffect(()=>{n(t)},[t]),c.useEffect(()=>{S(JSON.stringify(r)!==JSON.stringify(t))},[r,t]);const g=(s,a)=>{n(i=>({...i,technicalLevelColors:{...i.technicalLevelColors,[s]:a}}))},L=()=>{w(r)},D=()=>{n(t)};return N?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(P,{})}):e.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-4xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(T,{className:"h-6 w-6 text-primary"}),"Lesson UX Settings"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Configure the appearance and behavior of lesson-related components"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"outline",onClick:D,disabled:!m||d,children:[e.jsx(z,{className:"h-4 w-4 ltr:mr-2 rtl:ml-2"}),"Reset"]}),e.jsxs(b,{onClick:L,disabled:!m||d,children:[d?e.jsx(E,{variant:"dot",size:"sm",className:"ltr:mr-2 rtl:ml-2"}):e.jsx(O,{className:"h-4 w-4 ltr:mr-2 rtl:ml-2"}),"Save Changes"]})]})]}),m&&e.jsx("div",{className:"mb-4 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:'You have unsaved changes. Click "Save Changes" to apply them.'})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(x,{children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(U,{className:"h-5 w-5 text-primary"}),"Technical Level Colors"]}),e.jsx(f,{children:"Configure the color scheme for difficulty/technical level badges across the platform"})]}),e.jsx(u,{className:"space-y-4",children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:Object.entries(r.technicalLevelColors).map(([s,a])=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(o,{htmlFor:`color-${s}`,className:"capitalize mb-2 block",children:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{id:`color-${s}`,type:"color",value:a,onChange:i=>g(s,i.target.value),className:"w-12 h-10 p-1 cursor-pointer"}),e.jsx(j,{type:"text",value:a,onChange:i=>g(s,i.target.value),className:"flex-1 font-mono text-sm",placeholder:"#000000"})]})]}),e.jsx(v,{variant:"outline",style:{backgroundColor:`${a}20`,borderColor:`${a}40`,color:a},className:"capitalize",children:s})]},s))})})]}),e.jsxs(x,{children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-5 w-5 text-primary"}),"View Mode Settings"]}),e.jsx(f,{children:"Configure default view modes and display options for lessons"})]}),e.jsxs(u,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{children:"Default View Mode"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The default view mode when users first visit the lessons page"})]}),e.jsxs(I,{value:r.defaultViewMode,onValueChange:s=>n(a=>({...a,defaultViewMode:s})),children:[e.jsx(V,{className:"w-[180px]",children:e.jsx(R,{})}),e.jsxs($,{children:[e.jsx(C,{value:"grid",children:"Grid View"}),e.jsx(C,{value:"curriculum",children:"Curriculum View"})]})]})]}),e.jsx(y,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{children:"Path Context Collapsed by Default (Mobile)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Whether the learning path context panel starts collapsed on mobile devices"})]}),e.jsx(M,{checked:r.pathContextCollapsedDefault,onCheckedChange:s=>n(a=>({...a,pathContextCollapsedDefault:s}))})]}),e.jsx(y,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{children:"Max Progress Dots"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Maximum number of progress dots to show in the path context panel"})]}),e.jsx(j,{type:"number",min:5,max:20,value:r.maxProgressDots,onChange:s=>n(a=>({...a,maxProgressDots:Math.max(5,Math.min(20,parseInt(s.target.value)||12))})),className:"w-[100px]"})]})]})]}),e.jsxs(x,{children:[e.jsxs(h,{children:[e.jsx(p,{children:"Live Preview"}),e.jsx(f,{children:"Preview how the technical level badges will appear with current settings"})]}),e.jsx(u,{children:e.jsx("div",{className:"flex flex-wrap gap-3",children:Object.entries(r.technicalLevelColors).map(([s,a])=>e.jsx(v,{variant:"outline",style:{backgroundColor:`${a}20`,borderColor:`${a}40`,color:a},className:"capitalize text-sm px-3 py-1",children:s},s))})})]})]})]})}export{se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.