feat: Add debug tab with performance optimizations
Browse files- Implement environment-controlled debug data collection (ENABLE_DEBUG_TAB)
- Add frontend debug tab with sortable thematic pool analysis
- Optimize debug performance by removing expensive semantic neighbor computation
- Add comprehensive debug insights: generation params, word scoring, selection algorithm
- Update API response model to include optional debug field
- Create interactive UI for analyzing ML word selection process
Signed-off-by: Vimal Kumar <[email protected]>
- crossword-app/backend-py/docs/debug_tab_feature.md +214 -0
- crossword-app/backend-py/public/assets/index-BjEV3Co3.js +10 -0
- crossword-app/backend-py/public/assets/index-BjEV3Co3.js.map +1 -0
- crossword-app/backend-py/public/assets/index-C8ibg3Hv.css +1 -0
- crossword-app/backend-py/public/assets/index-DW3Gfxju.js +10 -0
- crossword-app/backend-py/public/assets/index-DW3Gfxju.js.map +1 -0
- crossword-app/backend-py/public/assets/index-Dqo17R2W.js +10 -0
- crossword-app/backend-py/public/assets/index-Dqo17R2W.js.map +1 -0
- crossword-app/backend-py/public/assets/index-Du5pYm00.css +1 -0
- crossword-app/backend-py/public/index.html +2 -2
- crossword-app/backend-py/src/routes/api.py +10 -2
- crossword-app/backend-py/src/services/crossword_generator.py +22 -6
- crossword-app/backend-py/src/services/thematic_word_service.py +68 -3
- crossword-app/frontend/src/App.jsx +35 -7
- crossword-app/frontend/src/components/DebugTab.jsx +265 -0
- crossword-app/frontend/src/styles/puzzle.css +192 -0
crossword-app/backend-py/docs/debug_tab_feature.md
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Debug Tab Feature Documentation
|
2 |
+
|
3 |
+
## Overview
|
4 |
+
|
5 |
+
The debug tab feature provides detailed insights into the thematic word generation process when enabled via environment variable. This feature is designed for developers to understand how the ML-based word selection algorithm works internally.
|
6 |
+
|
7 |
+
## Environment Variable
|
8 |
+
|
9 |
+
```bash
|
10 |
+
ENABLE_DEBUG_TAB=true # Enable debug data collection and return
|
11 |
+
ENABLE_DEBUG_TAB=false # Disable debug data (default)
|
12 |
+
```
|
13 |
+
|
14 |
+
## When Debug Data is Collected
|
15 |
+
|
16 |
+
Debug data is collected during the thematic word generation process in `find_words_for_crossword()` when:
|
17 |
+
|
18 |
+
1. `ENABLE_DEBUG_TAB=true` environment variable is set
|
19 |
+
2. The thematic word service is properly initialized
|
20 |
+
3. Any API endpoint that generates crossword puzzles is called
|
21 |
+
|
22 |
+
## API Response Structure
|
23 |
+
|
24 |
+
### Without Debug (Default)
|
25 |
+
```json
|
26 |
+
{
|
27 |
+
"grid": [...],
|
28 |
+
"clues": {...},
|
29 |
+
"metadata": {...}
|
30 |
+
}
|
31 |
+
```
|
32 |
+
|
33 |
+
### With Debug Enabled
|
34 |
+
```json
|
35 |
+
{
|
36 |
+
"grid": [...],
|
37 |
+
"clues": {...},
|
38 |
+
"metadata": {...},
|
39 |
+
"debug": {
|
40 |
+
"enabled": true,
|
41 |
+
"generation_params": {
|
42 |
+
"topics": ["animals"],
|
43 |
+
"difficulty": "easy",
|
44 |
+
"requested_words": 10,
|
45 |
+
"custom_sentence": null,
|
46 |
+
"multi_theme": true,
|
47 |
+
"thematic_pool_size": 150,
|
48 |
+
"min_similarity": 0.25
|
49 |
+
},
|
50 |
+
"thematic_pool": [
|
51 |
+
{
|
52 |
+
"word": "CAT",
|
53 |
+
"similarity": 0.834,
|
54 |
+
"tier": "tier_5_common",
|
55 |
+
"percentile": 0.952,
|
56 |
+
"tier_description": "Common (Top 8%)"
|
57 |
+
}
|
58 |
+
],
|
59 |
+
"candidate_words": [
|
60 |
+
{
|
61 |
+
"word": "CAT",
|
62 |
+
"similarity": 0.834,
|
63 |
+
"tier": "tier_5_common",
|
64 |
+
"percentile": 0.952,
|
65 |
+
"clue": "Feline pet",
|
66 |
+
"semantic_neighbors": ["dog", "kitten", "feline", "pet", "animal"]
|
67 |
+
}
|
68 |
+
],
|
69 |
+
"selection_method": "softmax",
|
70 |
+
"selection_params": {
|
71 |
+
"use_softmax_selection": true,
|
72 |
+
"similarity_temperature": 0.2,
|
73 |
+
"difficulty_weight": 0.5
|
74 |
+
},
|
75 |
+
"selected_words": [
|
76 |
+
{
|
77 |
+
"word": "CAT",
|
78 |
+
"similarity": 0.834,
|
79 |
+
"tier": "tier_5_common",
|
80 |
+
"percentile": 0.952,
|
81 |
+
"clue": "Feline pet"
|
82 |
+
}
|
83 |
+
]
|
84 |
+
}
|
85 |
+
}
|
86 |
+
```
|
87 |
+
|
88 |
+
## Debug Data Structure
|
89 |
+
|
90 |
+
### `generation_params`
|
91 |
+
- **topics**: Input topics provided by user
|
92 |
+
- **difficulty**: Selected difficulty level
|
93 |
+
- **requested_words**: Number of words requested
|
94 |
+
- **custom_sentence**: Custom sentence input (if any)
|
95 |
+
- **multi_theme**: Whether multi-theme processing was used
|
96 |
+
- **thematic_pool_size**: Size of initial thematic pool generated
|
97 |
+
- **min_similarity**: Minimum similarity threshold used
|
98 |
+
|
99 |
+
### `thematic_pool`
|
100 |
+
Array of all words generated thematically (typically 150 words):
|
101 |
+
- **word**: The word in uppercase
|
102 |
+
- **similarity**: Cosine similarity score to theme (0.0-1.0)
|
103 |
+
- **tier**: Frequency tier (tier_1_ultra_common to tier_10_very_rare)
|
104 |
+
- **percentile**: Word frequency percentile (0.0-1.0, higher = more common)
|
105 |
+
- **tier_description**: Human-readable tier description
|
106 |
+
|
107 |
+
### `candidate_words`
|
108 |
+
Array of words that passed filtering and got clues generated:
|
109 |
+
- All fields from `thematic_pool` plus:
|
110 |
+
- **clue**: Generated crossword clue
|
111 |
+
- **semantic_neighbors**: List of semantically similar words from embeddings
|
112 |
+
|
113 |
+
### `selection_method`
|
114 |
+
- `"softmax"`: Uses ML-based probabilistic selection
|
115 |
+
- `"random"`: Uses traditional random selection
|
116 |
+
|
117 |
+
### `selection_params`
|
118 |
+
Current algorithm parameters:
|
119 |
+
- **use_softmax_selection**: Whether softmax selection is enabled
|
120 |
+
- **similarity_temperature**: Temperature for softmax (lower = more deterministic)
|
121 |
+
- **difficulty_weight**: Balance between similarity and frequency (0.0-1.0)
|
122 |
+
|
123 |
+
### `selected_words`
|
124 |
+
Final words chosen for crossword generation with their scores and metadata.
|
125 |
+
|
126 |
+
## Use Cases for Debug Data
|
127 |
+
|
128 |
+
### 1. Algorithm Performance Analysis
|
129 |
+
- Compare similarity scores across difficulty levels
|
130 |
+
- Analyze frequency distribution in selections
|
131 |
+
- Understand why certain words were selected/rejected
|
132 |
+
|
133 |
+
### 2. Difficulty Tuning
|
134 |
+
- Verify easy mode selects common words (high percentiles)
|
135 |
+
- Verify hard mode selects rare words (low percentiles)
|
136 |
+
- Check if composite scoring is working as expected
|
137 |
+
|
138 |
+
### 3. Clue Quality Assessment
|
139 |
+
- Review generated clues for accuracy
|
140 |
+
- Analyze semantic neighbors for clue generation
|
141 |
+
- Identify words that need manual clue overrides
|
142 |
+
|
143 |
+
### 4. Theme Relevance Debugging
|
144 |
+
- Check similarity scores for theme matching
|
145 |
+
- Identify words that don't match intended theme
|
146 |
+
- Analyze multi-theme vs single-theme behavior
|
147 |
+
|
148 |
+
## Frontend Integration
|
149 |
+
|
150 |
+
The debug data can be displayed in a separate "Debug" or "Peek-in" tab that shows:
|
151 |
+
|
152 |
+
1. **Generation Overview**: Parameters and summary statistics
|
153 |
+
2. **Thematic Pool**: Sortable table of all 150 generated words
|
154 |
+
3. **Selection Process**: Visualization of softmax probabilities
|
155 |
+
4. **Semantic Analysis**: Word neighbors and clue generation details
|
156 |
+
5. **Performance Metrics**: Timing and efficiency data
|
157 |
+
|
158 |
+
## Performance Impact
|
159 |
+
|
160 |
+
- **Disabled** (default): No performance impact
|
161 |
+
- **Enabled**: Minimal impact (~5-10ms additional processing)
|
162 |
+
- Semantic neighbor computation: ~1-2ms per word
|
163 |
+
- Debug data structure creation: ~3-5ms total
|
164 |
+
- JSON serialization: Negligible
|
165 |
+
|
166 |
+
## Security Considerations
|
167 |
+
|
168 |
+
- Debug data exposes internal ML model behavior
|
169 |
+
- Should only be enabled in development/staging environments
|
170 |
+
- No sensitive user data is exposed
|
171 |
+
- All data is derived from public word frequencies and embeddings
|
172 |
+
|
173 |
+
## Testing
|
174 |
+
|
175 |
+
```bash
|
176 |
+
# Test debug disabled
|
177 |
+
python test_debug_feature.py
|
178 |
+
|
179 |
+
# Test with full model loading (takes time)
|
180 |
+
ENABLE_DEBUG_TAB=true python -c "import asyncio; from test_debug_feature import full_integration_test; asyncio.run(full_integration_test())"
|
181 |
+
|
182 |
+
# Test API endpoint with debug enabled
|
183 |
+
ENABLE_DEBUG_TAB=true uvicorn app:app --host 0.0.0.0 --port 7860
|
184 |
+
curl -X POST http://localhost:7860/api/generate -H "Content-Type: application/json" -d '{"topics": ["animals"], "difficulty": "easy", "wordCount": 8}'
|
185 |
+
```
|
186 |
+
|
187 |
+
## Implementation Details
|
188 |
+
|
189 |
+
### Files Modified
|
190 |
+
- `src/services/thematic_word_service.py`: Debug data collection
|
191 |
+
- `src/services/crossword_generator.py`: Debug data pass-through
|
192 |
+
- `src/routes/api.py`: Debug data inclusion in responses
|
193 |
+
|
194 |
+
### Key Functions
|
195 |
+
- `ThematicWordService.find_words_for_crossword()`: Now returns `{"words": [...], "debug": {...}}`
|
196 |
+
- `CrosswordGenerator._select_words()`: Now returns `(words, debug_data)` tuple
|
197 |
+
- `CrosswordGenerator.generate_puzzle()`: Includes debug data in response
|
198 |
+
|
199 |
+
### Environment Variable Parsing
|
200 |
+
```python
|
201 |
+
self.enable_debug_tab = os.getenv("ENABLE_DEBUG_TAB", "false").lower() == "true"
|
202 |
+
```
|
203 |
+
|
204 |
+
## Future Enhancements
|
205 |
+
|
206 |
+
1. **Performance Metrics**: Add timing data for each processing stage
|
207 |
+
2. **Grid Placement Debug**: Include grid placement algorithm details
|
208 |
+
3. **Clue Generation Debug**: Detailed clue generation process insights
|
209 |
+
4. **Statistical Analysis**: Word distribution charts and analytics
|
210 |
+
5. **Export Functionality**: Export debug data as CSV/JSON for analysis
|
211 |
+
|
212 |
+
---
|
213 |
+
|
214 |
+
*This feature was implemented in August 2025 as part of the crossword generation optimization project.*
|
crossword-app/backend-py/public/assets/index-BjEV3Co3.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{r as m,a as R,R as $}from"./vendor-nf7bT_Uh.js";(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))i(t);new MutationObserver(t=>{for(const r of t)if(r.type==="childList")for(const h of r.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function u(t){const r={};return t.integrity&&(r.integrity=t.integrity),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?r.credentials="include":t.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(t){if(t.ep)return;t.ep=!0;const r=u(t);fetch(t.href,r)}})();var C={exports:{}},_={};/**
|
2 |
+
* @license React
|
3 |
+
* react-jsx-runtime.production.min.js
|
4 |
+
*
|
5 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
6 |
+
*
|
7 |
+
* This source code is licensed under the MIT license found in the
|
8 |
+
* LICENSE file in the root directory of this source tree.
|
9 |
+
*/var O=m,L=Symbol.for("react.element"),F=Symbol.for("react.fragment"),G=Object.prototype.hasOwnProperty,M=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U={key:!0,ref:!0,__self:!0,__source:!0};function T(s,c,u){var i,t={},r=null,h=null;u!==void 0&&(r=""+u),c.key!==void 0&&(r=""+c.key),c.ref!==void 0&&(h=c.ref);for(i in c)G.call(c,i)&&!U.hasOwnProperty(i)&&(t[i]=c[i]);if(s&&s.defaultProps)for(i in c=s.defaultProps,c)t[i]===void 0&&(t[i]=c[i]);return{$$typeof:L,type:s,key:r,ref:h,props:t,_owner:M.current}}_.Fragment=F;_.jsx=T;_.jsxs=T;C.exports=_;var e=C.exports,z={},S=R;z.createRoot=S.createRoot,z.hydrateRoot=S.hydrateRoot;const W=({onTopicsChange:s,availableTopics:c=[],selectedTopics:u=[],customSentence:i="",onSentenceChange:t,multiTheme:r=!0,onMultiThemeChange:h})=>{const g=o=>{const f=u.includes(o)?u.filter(j=>j!==o):[...u,o];s(f)};return e.jsxs("div",{className:"topic-selector",children:[e.jsx("h3",{children:"Select Topics"}),e.jsx("div",{className:"topic-buttons",children:c.map(o=>e.jsx("button",{className:`topic-btn ${u.includes(o.name)?"selected":""}`,onClick:()=>g(o.name),children:o.name},o.id))}),e.jsxs("div",{className:"sentence-input-container",children:[e.jsx("label",{htmlFor:"custom-sentence",className:"sentence-label",children:"Custom Sentence (optional)"}),e.jsx("textarea",{id:"custom-sentence",className:"sentence-input",value:i,onChange:o=>t&&t(o.target.value),placeholder:"Enter a sentence to influence word selection...",rows:"3",maxLength:"200"}),e.jsxs("div",{className:"sentence-info",children:[e.jsxs("span",{className:"char-count",children:[i.length,"/200 characters"]}),i&&e.jsx("button",{type:"button",className:"clear-sentence-btn",onClick:()=>t&&t(""),title:"Clear sentence",children:"Clear"})]})]}),e.jsxs("div",{className:"multi-theme-toggle-container",children:[e.jsxs("label",{className:"multi-theme-toggle",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:o=>h&&h(o.target.checked),className:"multi-theme-checkbox"}),e.jsx("span",{className:"multi-theme-label",children:"🎯 Use Multi-Theme Processing"})]}),e.jsx("p",{className:"multi-theme-description",children:r?"AI will process each theme separately and balance results":"AI will blend all themes into a single concept"})]}),e.jsxs("p",{className:"selected-count",children:[u.length," topic",u.length!==1?"s":""," selected"]})]})},B=({grid:s,clues:c,showSolution:u,onCellChange:i})=>{const[t,r]=m.useState({});m.useEffect(()=>{r({})},[s]);const h=(l,n,a)=>{const p=`${l}-${n}`,x={...t,[p]:a.toUpperCase()};r(x),i&&i(l,n,a)},g=(l,n)=>{if(u&&!o(l,n))return s[l][n];const a=`${l}-${n}`;return t[a]||""},o=(l,n)=>s[l][n]===".",f=(l,n)=>{if(!c)return null;const a=c.find(p=>p.position.row===l&&p.position.col===n);return a?a.number:null};if(!s||s.length===0)return e.jsx("div",{className:"puzzle-grid",children:"No puzzle loaded"});const j=s.length,d=s[0]?s[0].length:0;return e.jsx("div",{className:"puzzle-container",children:e.jsx("div",{className:"puzzle-grid",style:{gridTemplateColumns:`repeat(${d}, 35px)`,gridTemplateRows:`repeat(${j}, 35px)`},children:s.map((l,n)=>l.map((a,p)=>{const x=f(n,p);return o(n,p)?e.jsx("div",{className:"grid-cell empty-cell",style:{visibility:"hidden"}},`${n}-${p}`):e.jsxs("div",{className:"grid-cell white-cell",children:[x&&e.jsx("span",{className:"cell-number",children:x}),e.jsx("input",{type:"text",maxLength:"1",value:g(n,p),onChange:v=>h(n,p,v.target.value),className:`cell-input ${u?"solution-text":""}`,disabled:u})]},`${n}-${p}`)}))})})},q=({clues:s=[]})=>{const c=s.filter(t=>t.direction==="across"),u=s.filter(t=>t.direction==="down"),i=({title:t,clueList:r})=>e.jsxs("div",{className:"clue-section",children:[e.jsx("h4",{children:t}),e.jsx("ol",{children:r.map(h=>e.jsxs("li",{className:"clue-item",children:[e.jsx("span",{className:"clue-number",children:h.number}),e.jsx("span",{className:"clue-text",children:h.text})]},`${h.number}-${h.direction}`))})]});return e.jsxs("div",{className:"clue-list",children:[e.jsx(i,{title:"Across",clueList:c}),e.jsx(i,{title:"Down",clueList:u})]})},Y=({debugData:s})=>{const[c,u]=m.useState("overview");if(!s||!s.enabled)return e.jsx("div",{className:"debug-tab",children:e.jsx("p",{children:"Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend."})});const i=[{id:"overview",label:"Overview"},{id:"thematic-pool",label:"Thematic Pool"},{id:"candidates",label:"Candidates"},{id:"selection",label:"Selection"},{id:"selected",label:"Selected Words"}],t=()=>{var d,l,n;return e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Generation Parameters"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Topics:"})," ",s.generation_params.topics.join(", ")]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty:"})," ",s.generation_params.difficulty]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Requested Words:"})," ",s.generation_params.requested_words]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool Size:"})," ",s.generation_params.thematic_pool_size]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Min Similarity:"})," ",s.generation_params.min_similarity]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Multi-theme:"})," ",s.generation_params.multi_theme?"Yes":"No"]}),s.generation_params.custom_sentence&&e.jsxs("div",{children:[e.jsx("strong",{children:"Custom Sentence:"}),' "',s.generation_params.custom_sentence,'"']})]}),e.jsx("h3",{children:"Selection Algorithm"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Method:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Use Softmax:"})," ",s.selection_params.use_softmax_selection?"Yes":"No"]})]}),e.jsx("h3",{children:"Results Summary"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool:"})," ",((d=s.thematic_pool)==null?void 0:d.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Candidates:"})," ",((l=s.candidate_words)==null?void 0:l.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Selected:"})," ",((n=s.selected_words)==null?void 0:n.length)||0," words"]})]})]})},r=(d,l=!1,n=!1)=>e.jsx("div",{className:"word-table-container",children:e.jsxs("table",{className:"word-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Word"}),e.jsx("th",{children:"Similarity"}),e.jsx("th",{children:"Percentile"}),e.jsx("th",{children:"Tier"}),l&&e.jsx("th",{children:"Clue"}),n&&e.jsx("th",{children:"Semantic Neighbors"})]})}),e.jsx("tbody",{children:d.map((a,p)=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:a.word})}),e.jsx("td",{children:a.similarity.toFixed(3)}),e.jsx("td",{children:a.percentile.toFixed(3)}),e.jsx("td",{title:a.tier_description||a.tier,children:a.tier.replace("tier_","").replace("_"," ")}),l&&e.jsx("td",{children:a.clue}),n&&e.jsx("td",{children:((x=a.semantic_neighbors)==null?void 0:x.slice(0,3).join(", "))||"N/A"})]},p)})})]})}),h=()=>{const d=[...s.thematic_pool||[]].sort((l,n)=>n.similarity-l.similarity);return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Thematic Pool (",d.length," words)"]}),e.jsx("p",{children:"All words generated thematically, sorted by similarity to theme."}),r(d)]})},g=()=>{const d=s.candidate_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Candidate Words (",d.length," words)"]}),e.jsx("p",{children:"Words that passed filtering and got clues generated."}),r(d,!0,!0)]})},o=()=>e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Selection Process"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Algorithm:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature," (lower = more deterministic)"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight," (balance between similarity and frequency)"]})]}),e.jsx("h4",{children:"How it works:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Composite Score"})," = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Frequency Alignment"}),": Gaussian distribution favoring target percentiles by difficulty"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Softmax Selection"}),": Probabilistic selection based on composite scores with temperature control"]})]}),e.jsx("h4",{children:"Difficulty Targets:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Easy:"})," 90th percentile (common words like CAT, DOG)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Medium:"})," 50th percentile (balanced selection)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Hard:"})," 20th percentile (rare words like QUETZAL, PLATYPUS)"]})]})]}),f=()=>{const d=s.selected_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Selected Words (",d.length," words)"]}),e.jsx("p",{children:"Final words chosen for crossword generation."}),r(d,!0)]})},j=()=>{switch(c){case"overview":return t();case"thematic-pool":return h();case"candidates":return g();case"selection":return o();case"selected":return f();default:return t()}};return e.jsxs("div",{className:"debug-tab",children:[e.jsx("div",{className:"debug-nav",children:i.map(d=>e.jsx("button",{className:`debug-nav-btn ${c===d.id?"active":""}`,onClick:()=>u(d.id),children:d.label},d.id))}),e.jsx("div",{className:"debug-content",children:j()})]})},H=({message:s="Generating puzzle..."})=>e.jsxs("div",{className:"loading-spinner",children:[e.jsx("div",{className:"spinner"}),e.jsx("p",{className:"loading-message",children:s})]}),J=()=>{const[s,c]=m.useState(null),[u,i]=m.useState(!1),[t,r]=m.useState(null),[h,g]=m.useState([]),o="",f=m.useCallback(async()=>{try{i(!0);const n=await fetch(`${o}/api/topics`);if(!n.ok)throw new Error("Failed to fetch topics");const a=await n.json();g(a)}catch(n){r(n.message)}finally{i(!1)}},[o]),j=m.useCallback(async(n,a="medium",p=!1,x="",y=!0)=>{try{i(!0),r(null);const v=await fetch(`${o}/api/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topics:n,difficulty:a,useAI:p,...x&&{customSentence:x},multiTheme:y})});if(!v.ok){const w=await v.json().catch(()=>({}));throw new Error(w.message||"Failed to generate puzzle")}const N=await v.json();return c(N),N}catch(v){return r(v.message),null}finally{i(!1)}},[o]),d=m.useCallback(async n=>{try{const a=await fetch(`${o}/api/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({puzzle:s,answers:n})});if(!a.ok)throw new Error("Failed to validate answers");return await a.json()}catch(a){return r(a.message),null}},[o,s]),l=m.useCallback(()=>{c(null),r(null)},[]);return{puzzle:s,loading:u,error:t,topics:h,fetchTopics:f,generatePuzzle:j,validateAnswers:d,resetPuzzle:l}};function K(){const[s,c]=m.useState([]),[u,i]=m.useState("medium"),[t,r]=m.useState(!1),[h,g]=m.useState(""),[o,f]=m.useState(!0),[j,d]=m.useState("puzzle"),{puzzle:l,loading:n,error:a,topics:p,fetchTopics:x,generatePuzzle:y,resetPuzzle:v}=J();m.useEffect(()=>{x()},[x]);const N=async()=>{if(s.length===0&&!h.trim()){alert("Please select at least one topic or provide a custom sentence");return}r(!1),await y(s,u,!1,h,o)},w=b=>{c(b)},P=b=>{g(b)},k=b=>{f(b)},E=()=>{v(),c([]),r(!1),i("medium"),g(""),f(!0),d("puzzle")},A=()=>{r(!0)};return e.jsxs("div",{className:"crossword-app",children:[e.jsxs("header",{className:"app-header",children:[e.jsx("h1",{className:"app-title",children:"Crossword Puzzle Generator"}),e.jsx("p",{children:"Select topics and generate your custom crossword puzzle!"})]}),e.jsx(W,{onTopicsChange:w,availableTopics:p,selectedTopics:s,customSentence:h,onSentenceChange:P,multiTheme:o,onMultiThemeChange:k}),e.jsxs("div",{className:"puzzle-controls",children:[e.jsxs("select",{value:u,onChange:b=>i(b.target.value),className:"control-btn",children:[e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]}),e.jsx("button",{onClick:N,disabled:n||s.length===0&&!h.trim(),className:"control-btn generate-btn",children:n?"Generating...":"Generate Puzzle"}),e.jsx("button",{onClick:E,className:"control-btn reset-btn",children:"Reset"}),l&&!t&&e.jsx("button",{onClick:A,className:"control-btn reveal-btn",children:"Reveal Solution"})]}),a&&e.jsxs("div",{className:"error-message",children:["Error: ",a]}),n&&e.jsx(H,{}),l&&!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"tab-nav",children:[e.jsx("button",{className:`tab-btn ${j==="puzzle"?"active":""}`,onClick:()=>d("puzzle"),children:"Puzzle"}),l.debug&&e.jsx("button",{className:`tab-btn ${j==="debug"?"active":""}`,onClick:()=>d("debug"),children:"Debug"})]}),j==="puzzle"&&e.jsxs("div",{className:"puzzle-layout",children:[e.jsx(B,{grid:l.grid,clues:l.clues,showSolution:t}),e.jsx(q,{clues:l.clues})]}),j==="debug"&&l.debug&&e.jsx(Y,{debugData:l.debug})]}),!l&&!n&&!a&&e.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#7f8c8d"},children:'Select topics and click "Generate Puzzle" to start!'})]})}z.createRoot(document.getElementById("root")).render(e.jsx($.StrictMode,{children:e.jsx(K,{})}));
|
10 |
+
//# sourceMappingURL=index-BjEV3Co3.js.map
|
crossword-app/backend-py/public/assets/index-BjEV3Co3.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"index-BjEV3Co3.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react-dom/client.js","../../src/components/TopicSelector.jsx","../../src/components/PuzzleGrid.jsx","../../src/components/ClueList.jsx","../../src/components/DebugTab.jsx","../../src/components/LoadingSpinner.jsx","../../src/hooks/useCrossword.js","../../src/App.jsx","../../src/main.jsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","import React from 'react';\n\nconst TopicSelector = ({ \n onTopicsChange, \n availableTopics = [], \n selectedTopics = [],\n customSentence = '',\n onSentenceChange,\n multiTheme = true,\n onMultiThemeChange\n}) => {\n const handleTopicToggle = (topic) => {\n const newSelectedTopics = selectedTopics.includes(topic)\n ? selectedTopics.filter(t => t !== topic)\n : [...selectedTopics, topic];\n \n onTopicsChange(newSelectedTopics);\n };\n\n return (\n <div className=\"topic-selector\">\n <h3>Select Topics</h3>\n <div className=\"topic-buttons\">\n {availableTopics.map(topic => (\n <button\n key={topic.id}\n className={`topic-btn ${selectedTopics.includes(topic.name) ? 'selected' : ''}`}\n onClick={() => handleTopicToggle(topic.name)}\n >\n {topic.name}\n </button>\n ))}\n </div>\n \n <div className=\"sentence-input-container\">\n <label htmlFor=\"custom-sentence\" className=\"sentence-label\">\n Custom Sentence (optional)\n </label>\n <textarea\n id=\"custom-sentence\"\n className=\"sentence-input\"\n value={customSentence}\n onChange={(e) => onSentenceChange && onSentenceChange(e.target.value)}\n placeholder=\"Enter a sentence to influence word selection...\"\n rows=\"3\"\n maxLength=\"200\"\n />\n <div className=\"sentence-info\">\n <span className=\"char-count\">{customSentence.length}/200 characters</span>\n {customSentence && (\n <button \n type=\"button\"\n className=\"clear-sentence-btn\"\n onClick={() => onSentenceChange && onSentenceChange('')}\n title=\"Clear sentence\"\n >\n Clear\n </button>\n )}\n </div>\n </div>\n \n <div className=\"multi-theme-toggle-container\">\n <label className=\"multi-theme-toggle\">\n <input\n type=\"checkbox\"\n checked={multiTheme}\n onChange={(e) => onMultiThemeChange && onMultiThemeChange(e.target.checked)}\n className=\"multi-theme-checkbox\"\n />\n <span className=\"multi-theme-label\">\n 🎯 Use Multi-Theme Processing\n </span>\n </label>\n <p className=\"multi-theme-description\">\n {multiTheme \n ? \"AI will process each theme separately and balance results\" \n : \"AI will blend all themes into a single concept\"\n }\n </p>\n </div>\n \n <p className=\"selected-count\">\n {selectedTopics.length} topic{selectedTopics.length !== 1 ? 's' : ''} selected\n </p>\n </div>\n );\n};\n\nexport default TopicSelector;","import React, { useState, useEffect } from 'react';\n\nconst PuzzleGrid = ({ grid, clues, showSolution, onCellChange }) => {\n const [userAnswers, setUserAnswers] = useState({});\n\n useEffect(() => {\n setUserAnswers({});\n }, [grid]);\n\n const handleCellInput = (row, col, value) => {\n const key = `${row}-${col}`;\n const newAnswers = { ...userAnswers, [key]: value.toUpperCase() };\n setUserAnswers(newAnswers);\n onCellChange && onCellChange(row, col, value);\n };\n\n const getCellValue = (row, col) => {\n if (showSolution && !isBlackCell(row, col)) {\n return grid[row][col];\n }\n const key = `${row}-${col}`;\n return userAnswers[key] || '';\n };\n\n const isBlackCell = (row, col) => {\n return grid[row][col] === '.';\n };\n\n const getCellNumber = (row, col) => {\n if (!clues) return null;\n const clue = clues.find(c => c.position.row === row && c.position.col === col);\n return clue ? clue.number : null;\n };\n\n if (!grid || grid.length === 0) {\n return <div className=\"puzzle-grid\">No puzzle loaded</div>;\n }\n\n const gridRows = grid.length;\n const gridCols = grid[0] ? grid[0].length : 0;\n\n return (\n <div className=\"puzzle-container\">\n <div \n className=\"puzzle-grid\"\n style={{\n gridTemplateColumns: `repeat(${gridCols}, 35px)`,\n gridTemplateRows: `repeat(${gridRows}, 35px)`\n }}\n >\n {grid.map((row, rowIndex) =>\n row.map((cell, colIndex) => {\n const cellNumber = getCellNumber(rowIndex, colIndex);\n const isBlack = isBlackCell(rowIndex, colIndex);\n \n // Only render cells that contain letters (not black/unused cells)\n if (isBlack) {\n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell empty-cell\"\n style={{ visibility: 'hidden' }}\n >\n </div>\n );\n }\n \n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell white-cell\"\n >\n {cellNumber && <span className=\"cell-number\">{cellNumber}</span>}\n <input\n type=\"text\"\n maxLength=\"1\"\n value={getCellValue(rowIndex, colIndex)}\n onChange={(e) => handleCellInput(rowIndex, colIndex, e.target.value)}\n className={`cell-input ${showSolution ? 'solution-text' : ''}`}\n disabled={showSolution}\n />\n </div>\n );\n })\n )}\n </div>\n </div>\n );\n};\n\nexport default PuzzleGrid;","import React from 'react';\n\nconst ClueList = ({ clues = [] }) => {\n const acrossClues = clues.filter(clue => clue.direction === 'across');\n const downClues = clues.filter(clue => clue.direction === 'down');\n\n const ClueSection = ({ title, clueList }) => (\n <div className=\"clue-section\">\n <h4>{title}</h4>\n <ol>\n {clueList.map(clue => (\n <li key={`${clue.number}-${clue.direction}`} className=\"clue-item\">\n <span className=\"clue-number\">{clue.number}</span>\n <span className=\"clue-text\">{clue.text}</span>\n </li>\n ))}\n </ol>\n </div>\n );\n\n return (\n <div className=\"clue-list\">\n <ClueSection title=\"Across\" clueList={acrossClues} />\n <ClueSection title=\"Down\" clueList={downClues} />\n </div>\n );\n};\n\nexport default ClueList;","import React, { useState } from 'react';\n\nconst DebugTab = ({ debugData }) => {\n const [activeSection, setActiveSection] = useState('overview');\n\n if (!debugData || !debugData.enabled) {\n return (\n <div className=\"debug-tab\">\n <p>Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend.</p>\n </div>\n );\n }\n\n const sections = [\n { id: 'overview', label: 'Overview' },\n { id: 'thematic-pool', label: 'Thematic Pool' },\n { id: 'candidates', label: 'Candidates' },\n { id: 'selection', label: 'Selection' },\n { id: 'selected', label: 'Selected Words' }\n ];\n\n const renderOverview = () => (\n <div className=\"debug-section\">\n <h3>Generation Parameters</h3>\n <div className=\"debug-grid\">\n <div><strong>Topics:</strong> {debugData.generation_params.topics.join(', ')}</div>\n <div><strong>Difficulty:</strong> {debugData.generation_params.difficulty}</div>\n <div><strong>Requested Words:</strong> {debugData.generation_params.requested_words}</div>\n <div><strong>Thematic Pool Size:</strong> {debugData.generation_params.thematic_pool_size}</div>\n <div><strong>Min Similarity:</strong> {debugData.generation_params.min_similarity}</div>\n <div><strong>Multi-theme:</strong> {debugData.generation_params.multi_theme ? 'Yes' : 'No'}</div>\n {debugData.generation_params.custom_sentence && (\n <div><strong>Custom Sentence:</strong> \"{debugData.generation_params.custom_sentence}\"</div>\n )}\n </div>\n\n <h3>Selection Algorithm</h3>\n <div className=\"debug-grid\">\n <div><strong>Method:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature}</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight}</div>\n <div><strong>Use Softmax:</strong> {debugData.selection_params.use_softmax_selection ? 'Yes' : 'No'}</div>\n </div>\n\n <h3>Results Summary</h3>\n <div className=\"debug-grid\">\n <div><strong>Thematic Pool:</strong> {debugData.thematic_pool?.length || 0} words</div>\n <div><strong>Candidates:</strong> {debugData.candidate_words?.length || 0} words</div>\n <div><strong>Selected:</strong> {debugData.selected_words?.length || 0} words</div>\n </div>\n </div>\n );\n\n const renderWordTable = (words, showClue = false, showNeighbors = false) => (\n <div className=\"word-table-container\">\n <table className=\"word-table\">\n <thead>\n <tr>\n <th>Word</th>\n <th>Similarity</th>\n <th>Percentile</th>\n <th>Tier</th>\n {showClue && <th>Clue</th>}\n {showNeighbors && <th>Semantic Neighbors</th>}\n </tr>\n </thead>\n <tbody>\n {words.map((word, idx) => (\n <tr key={idx}>\n <td><strong>{word.word}</strong></td>\n <td>{word.similarity.toFixed(3)}</td>\n <td>{word.percentile.toFixed(3)}</td>\n <td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>\n {showClue && <td>{word.clue}</td>}\n {showNeighbors && <td>{word.semantic_neighbors?.slice(0, 3).join(', ') || 'N/A'}</td>}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n\n const renderThematicPool = () => {\n const sortedPool = [...(debugData.thematic_pool || [])].sort((a, b) => b.similarity - a.similarity);\n \n return (\n <div className=\"debug-section\">\n <h3>Thematic Pool ({sortedPool.length} words)</h3>\n <p>All words generated thematically, sorted by similarity to theme.</p>\n {renderWordTable(sortedPool)}\n </div>\n );\n };\n\n const renderCandidates = () => {\n const candidates = debugData.candidate_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Candidate Words ({candidates.length} words)</h3>\n <p>Words that passed filtering and got clues generated.</p>\n {renderWordTable(candidates, true, true)}\n </div>\n );\n };\n\n const renderSelection = () => (\n <div className=\"debug-section\">\n <h3>Selection Process</h3>\n <div className=\"debug-grid\">\n <div><strong>Algorithm:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature} (lower = more deterministic)</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight} (balance between similarity and frequency)</div>\n </div>\n \n <h4>How it works:</h4>\n <ul>\n <li><strong>Composite Score</strong> = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment</li>\n <li><strong>Frequency Alignment</strong>: Gaussian distribution favoring target percentiles by difficulty</li>\n <li><strong>Softmax Selection</strong>: Probabilistic selection based on composite scores with temperature control</li>\n </ul>\n\n <h4>Difficulty Targets:</h4>\n <ul>\n <li><strong>Easy:</strong> 90th percentile (common words like CAT, DOG)</li>\n <li><strong>Medium:</strong> 50th percentile (balanced selection)</li>\n <li><strong>Hard:</strong> 20th percentile (rare words like QUETZAL, PLATYPUS)</li>\n </ul>\n </div>\n );\n\n const renderSelected = () => {\n const selected = debugData.selected_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Selected Words ({selected.length} words)</h3>\n <p>Final words chosen for crossword generation.</p>\n {renderWordTable(selected, true)}\n </div>\n );\n };\n\n const renderSection = () => {\n switch (activeSection) {\n case 'overview': return renderOverview();\n case 'thematic-pool': return renderThematicPool();\n case 'candidates': return renderCandidates();\n case 'selection': return renderSelection();\n case 'selected': return renderSelected();\n default: return renderOverview();\n }\n };\n\n return (\n <div className=\"debug-tab\">\n <div className=\"debug-nav\">\n {sections.map(section => (\n <button\n key={section.id}\n className={`debug-nav-btn ${activeSection === section.id ? 'active' : ''}`}\n onClick={() => setActiveSection(section.id)}\n >\n {section.label}\n </button>\n ))}\n </div>\n \n <div className=\"debug-content\">\n {renderSection()}\n </div>\n </div>\n );\n};\n\nexport default DebugTab;","import React from 'react';\n\nconst LoadingSpinner = ({ message = \"Generating puzzle...\" }) => {\n return (\n <div className=\"loading-spinner\">\n <div className=\"spinner\"></div>\n <p className=\"loading-message\">{message}</p>\n </div>\n );\n};\n\nexport default LoadingSpinner;","import { useState, useCallback } from 'react';\n\nconst useCrossword = () => {\n const [puzzle, setPuzzle] = useState(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(null);\n const [topics, setTopics] = useState([]);\n\n const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || (import.meta.env.PROD ? '' : 'http://localhost:3000');\n\n const fetchTopics = useCallback(async () => {\n try {\n setLoading(true);\n const response = await fetch(`${API_BASE_URL}/api/topics`);\n if (!response.ok) throw new Error('Failed to fetch topics');\n const data = await response.json();\n setTopics(data);\n } catch (err) {\n setError(err.message);\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const generatePuzzle = useCallback(async (selectedTopics, difficulty = 'medium', useAI = false, customSentence = '', multiTheme = true) => {\n try {\n setLoading(true);\n setError(null);\n \n const response = await fetch(`${API_BASE_URL}/api/generate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n topics: selectedTopics,\n difficulty,\n useAI,\n ...(customSentence && { customSentence }),\n multiTheme\n })\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new Error(errorData.message || 'Failed to generate puzzle');\n }\n \n const puzzleData = await response.json();\n setPuzzle(puzzleData);\n return puzzleData;\n } catch (err) {\n setError(err.message);\n return null;\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const validateAnswers = useCallback(async (userAnswers) => {\n try {\n const response = await fetch(`${API_BASE_URL}/api/validate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n puzzle: puzzle,\n answers: userAnswers\n })\n });\n\n if (!response.ok) throw new Error('Failed to validate answers');\n \n return await response.json();\n } catch (err) {\n setError(err.message);\n return null;\n }\n }, [API_BASE_URL, puzzle]);\n\n const resetPuzzle = useCallback(() => {\n setPuzzle(null);\n setError(null);\n }, []);\n\n return {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n validateAnswers,\n resetPuzzle\n };\n};\n\nexport default useCrossword;","import React, { useState, useEffect } from 'react';\nimport TopicSelector from './components/TopicSelector';\nimport PuzzleGrid from './components/PuzzleGrid';\nimport ClueList from './components/ClueList';\nimport DebugTab from './components/DebugTab';\nimport LoadingSpinner from './components/LoadingSpinner';\nimport useCrossword from './hooks/useCrossword';\nimport './styles/puzzle.css';\n\nfunction App() {\n const [selectedTopics, setSelectedTopics] = useState([]);\n const [difficulty, setDifficulty] = useState('medium');\n const [showSolution, setShowSolution] = useState(false);\n const [customSentence, setCustomSentence] = useState('');\n const [multiTheme, setMultiTheme] = useState(true);\n const [activeTab, setActiveTab] = useState('puzzle');\n \n const {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n resetPuzzle\n } = useCrossword();\n\n useEffect(() => {\n fetchTopics();\n }, [fetchTopics]);\n\n const handleGeneratePuzzle = async () => {\n if (selectedTopics.length === 0 && !customSentence.trim()) {\n alert('Please select at least one topic or provide a custom sentence');\n return;\n }\n \n setShowSolution(false);\n await generatePuzzle(selectedTopics, difficulty, false, customSentence, multiTheme);\n };\n\n const handleTopicsChange = (topics) => {\n setSelectedTopics(topics);\n };\n\n const handleSentenceChange = (sentence) => {\n setCustomSentence(sentence);\n };\n\n const handleMultiThemeChange = (enabled) => {\n setMultiTheme(enabled);\n };\n\n\n const handleReset = () => {\n resetPuzzle();\n setSelectedTopics([]);\n setShowSolution(false);\n setDifficulty('medium');\n setCustomSentence('');\n setMultiTheme(true);\n setActiveTab('puzzle');\n };\n\n const handleRevealSolution = () => {\n setShowSolution(true);\n };\n\n return (\n <div className=\"crossword-app\">\n <header className=\"app-header\">\n <h1 className=\"app-title\">Crossword Puzzle Generator</h1>\n <p>Select topics and generate your custom crossword puzzle!</p>\n </header>\n\n <TopicSelector \n onTopicsChange={handleTopicsChange}\n availableTopics={topics}\n selectedTopics={selectedTopics}\n customSentence={customSentence}\n onSentenceChange={handleSentenceChange}\n multiTheme={multiTheme}\n onMultiThemeChange={handleMultiThemeChange}\n />\n\n <div className=\"puzzle-controls\">\n <select \n value={difficulty} \n onChange={(e) => setDifficulty(e.target.value)}\n className=\"control-btn\"\n >\n <option value=\"easy\">Easy</option>\n <option value=\"medium\">Medium</option>\n <option value=\"hard\">Hard</option>\n </select>\n \n <button\n onClick={handleGeneratePuzzle}\n disabled={loading || (selectedTopics.length === 0 && !customSentence.trim())}\n className=\"control-btn generate-btn\"\n >\n {loading ? 'Generating...' : 'Generate Puzzle'}\n </button>\n \n <button\n onClick={handleReset}\n className=\"control-btn reset-btn\"\n >\n Reset\n </button>\n \n {puzzle && !showSolution && (\n <button\n onClick={handleRevealSolution}\n className=\"control-btn reveal-btn\"\n >\n Reveal Solution\n </button>\n )}\n </div>\n\n {error && (\n <div className=\"error-message\">\n Error: {error}\n </div>\n )}\n\n {loading && <LoadingSpinner />}\n\n {puzzle && !loading && (\n <>\n {/* Tab Navigation */}\n <div className=\"tab-nav\">\n <button\n className={`tab-btn ${activeTab === 'puzzle' ? 'active' : ''}`}\n onClick={() => setActiveTab('puzzle')}\n >\n Puzzle\n </button>\n {puzzle.debug && (\n <button\n className={`tab-btn ${activeTab === 'debug' ? 'active' : ''}`}\n onClick={() => setActiveTab('debug')}\n >\n Debug\n </button>\n )}\n </div>\n\n {/* Tab Content */}\n {activeTab === 'puzzle' && (\n <div className=\"puzzle-layout\">\n <PuzzleGrid \n grid={puzzle.grid} \n clues={puzzle.clues}\n showSolution={showSolution}\n />\n <ClueList clues={puzzle.clues} />\n </div>\n )}\n\n {activeTab === 'debug' && puzzle.debug && (\n <DebugTab debugData={puzzle.debug} />\n )}\n </>\n )}\n\n {!puzzle && !loading && !error && (\n <div style={{ textAlign: 'center', padding: '40px', color: '#7f8c8d' }}>\n Select topics and click \"Generate Puzzle\" to start!\n </div>\n )}\n </div>\n );\n}\n\nexport default App;","import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n)"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","reactJsxRuntime_production_min","jsxRuntimeModule","client","TopicSelector","onTopicsChange","availableTopics","selectedTopics","customSentence","onSentenceChange","multiTheme","onMultiThemeChange","handleTopicToggle","topic","newSelectedTopics","t","jsxs","jsx","PuzzleGrid","grid","clues","showSolution","onCellChange","userAnswers","setUserAnswers","useState","useEffect","handleCellInput","row","col","value","key","newAnswers","getCellValue","isBlackCell","getCellNumber","clue","gridRows","gridCols","rowIndex","cell","colIndex","cellNumber","ClueList","acrossClues","downClues","ClueSection","title","clueList","DebugTab","debugData","activeSection","setActiveSection","sections","renderOverview","_a","_b","_c","renderWordTable","words","showClue","showNeighbors","word","idx","renderThematicPool","sortedPool","renderCandidates","candidates","renderSelection","renderSelected","selected","renderSection","section","LoadingSpinner","message","useCrossword","puzzle","setPuzzle","loading","setLoading","error","setError","topics","setTopics","API_BASE_URL","fetchTopics","useCallback","response","data","err","generatePuzzle","difficulty","useAI","errorData","puzzleData","validateAnswers","resetPuzzle","App","setSelectedTopics","setDifficulty","setShowSolution","setCustomSentence","setMultiTheme","activeTab","setActiveTab","handleGeneratePuzzle","handleTopicsChange","handleSentenceChange","sentence","handleMultiThemeChange","enabled","handleReset","handleRevealSolution","Fragment","ReactDOM","React"],"mappings":";;;;;;;;GASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAK,EAAE,KAAcH,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiB,EAAEA,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,aAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAI,EAAE,MAAMD,EAAE,OAAOP,EAAE,OAAO,CAAC,YAAkBF,EAAEW,EAAA,IAAYP,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AAA,CAAAC,EAAAA,IAAC,SAAA,CACC,UAAW,WAAWsF,IAAc,SAAW,SAAW,EAAE,GAC5D,QAAS,IAAMC,EAAa,QAAQ,EACrC,SAAA,QAAA,CAAA,EAGA5B,EAAO,OACN3D,EAAAA,IAAC,SAAA,CACC,UAAW,WAAWsF,IAAc,QAAU,SAAW,EAAE,GAC3D,QAAS,IAAMC,EAAa,OAAO,EACpC,SAAA,OAAA,CAAA,CAED,EAEJ,EAGCD,IAAc,UACbvF,OAAC,MAAA,CAAI,UAAU,gBACb,SAAA,CAAAC,EAAAA,IAACC,EAAA,CACC,KAAM0D,EAAO,KACb,MAAOA,EAAO,MACd,aAAAvD,CAAA,CAAA,EAEFJ,EAAAA,IAAC0B,EAAA,CAAS,MAAOiC,EAAO,KAAA,CAAO,CAAA,EACjC,EAGD2B,IAAc,SAAW3B,EAAO,aAC9B3B,EAAA,CAAS,UAAW2B,EAAO,KAAA,CAAO,CAAA,EAEvC,EAGD,CAACA,GAAU,CAACE,GAAW,CAACE,GACvB/D,EAAAA,IAAC,MAAA,CAAI,MAAO,CAAE,UAAW,SAAU,QAAS,OAAQ,MAAO,SAAA,EAAa,SAAA,qDAAA,CAExE,CAAA,EAEJ,CAEJ,CC1KAiG,EAAS,WAAW,SAAS,eAAe,MAAM,CAAC,EAAE,aAClDC,EAAM,WAAN,CACC,SAAAlG,MAACgF,IAAI,CAAA,CACP,CACF","x_google_ignoreList":[0,1,2]}
|
crossword-app/backend-py/public/assets/index-C8ibg3Hv.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.crossword-app{max-width:1200px;margin:0 auto;padding:20px;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}.app-header{text-align:center;margin-bottom:30px}.app-title{color:#2c3e50;font-size:2.5rem;margin-bottom:10px}.topic-selector{background:#f8f9fa;padding:20px;border-radius:8px;margin-bottom:20px}.topic-selector h3{margin-top:0;color:#2c3e50}.topic-buttons{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:15px}.topic-btn{padding:8px 16px;border:2px solid #3498db;background:#fff;color:#3498db;border-radius:20px;cursor:pointer;transition:all .3s ease;font-weight:500}.topic-btn:hover,.topic-btn.selected{background:#3498db;color:#fff}.selected-count{color:#7f8c8d;font-size:.9rem;margin:0}.sentence-input-container{margin-top:20px;margin-bottom:15px}.sentence-label{display:block;margin-bottom:8px;color:#2c3e50;font-weight:500;font-size:.95rem}.sentence-input{width:100%;padding:12px;border:2px solid #e1e8ed;border-radius:8px;font-family:inherit;font-size:.9rem;line-height:1.4;resize:vertical;min-height:80px;background:#fff;transition:border-color .3s ease,box-shadow .3s ease;box-sizing:border-box}.sentence-input:focus{outline:none;border-color:#3498db;box-shadow:0 0 0 3px #3498db1a}.sentence-input::placeholder{color:#95a5a6;font-style:italic}.sentence-info{display:flex;justify-content:space-between;align-items:center;margin-top:6px;font-size:.8rem}.char-count{color:#7f8c8d}.clear-sentence-btn{background:#e74c3c;color:#fff;border:none;padding:4px 8px;border-radius:4px;cursor:pointer;font-size:.75rem;transition:background-color .2s ease}.clear-sentence-btn:hover{background:#c0392b}.clear-sentence-btn:active{background:#a93226}.multi-theme-toggle-container{margin-top:20px;margin-bottom:15px;padding:15px;background:#f0f4f8;border:1px solid #e1e8ed;border-radius:8px}.multi-theme-toggle{display:flex;align-items:center;cursor:pointer;margin-bottom:8px}.multi-theme-checkbox{width:18px;height:18px;margin-right:10px;cursor:pointer;accent-color:#3498db}.multi-theme-label{font-weight:500;color:#2c3e50;font-size:.95rem;-webkit-user-select:none;user-select:none}.multi-theme-description{margin:0;font-size:.85rem;color:#5a6c7d;line-height:1.4;font-style:italic;padding-left:28px}.ai-toggle-container{margin:20px 0;padding:15px;background:#f8f9fa;border-radius:8px;border:2px solid #e9ecef;transition:all .3s ease}.ai-toggle-container:has(.ai-checkbox:checked){background:linear-gradient(135deg,#e3f2fd,#f3e5f5);border-color:#3498db}.ai-toggle{display:flex;align-items:center;cursor:pointer;font-weight:500;margin-bottom:8px}.ai-checkbox{width:20px;height:20px;margin-right:12px;cursor:pointer;accent-color:#3498db}.ai-label{font-size:1rem;color:#2c3e50;-webkit-user-select:none;user-select:none}.ai-status{color:#27ae60;font-weight:600;font-size:.9rem}.ai-description{margin:0;font-size:.85rem;color:#6c757d;line-height:1.4;padding-left:32px}.puzzle-controls{display:flex;gap:15px;margin-bottom:20px;justify-content:center}.control-btn{padding:10px 20px;border:none;border-radius:5px;cursor:pointer;font-weight:600;transition:background-color .3s ease}.control-btn:disabled{background:#bdc3c7!important;color:#7f8c8d!important;cursor:not-allowed;opacity:.7}.generate-btn{background:#27ae60;color:#fff}.generate-btn:hover{background:#229954}.generate-btn:disabled{background:#bdc3c7;cursor:not-allowed}.reset-btn{background:#e74c3c;color:#fff}.reset-btn:hover{background:#c0392b}.reveal-btn{background:#f39c12;color:#fff}.reveal-btn:hover{background:#e67e22}.loading-spinner{display:flex;flex-direction:column;align-items:center;padding:40px}.spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #3498db;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:15px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-message{color:#7f8c8d;font-size:1.1rem}.puzzle-info{display:flex;justify-content:space-between;align-items:center;margin:20px 0 10px;padding:10px 15px;background:#f8f9fa;border-radius:6px;border-left:4px solid #3498db}.puzzle-stats{font-size:.9rem;color:#6c757d;font-weight:500}.ai-generated-badge{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;padding:4px 12px;border-radius:15px;font-size:.8rem;font-weight:600;text-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 2px 4px #0000001a}.puzzle-layout{display:grid;grid-template-columns:1fr 300px;gap:30px;margin-top:20px}@media (max-width: 768px){.puzzle-layout{grid-template-columns:1fr;gap:20px}.puzzle-info{flex-direction:column;gap:8px;text-align:center}.ai-toggle-container{padding:12px}.ai-description{padding-left:0;text-align:center}}.puzzle-container{display:flex;justify-content:center}.puzzle-grid{display:grid;gap:0;margin:0 auto;width:fit-content;height:fit-content}.grid-cell{width:35px;height:35px;position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;background:#fff}.grid-cell:before{content:"";position:absolute;top:0;left:0;right:-1px;bottom:-1px;border:1px solid #2c3e50;pointer-events:none;z-index:10}.black-cell{background:#f0f0f0}.black-cell:before{background:#f0f0f0;border:1px solid #2c3e50}.white-cell{background:#fff}.empty-cell{background:transparent;border:none;visibility:hidden}.empty-cell:before{display:none}.cell-input{width:100%;height:100%;border:none!important;text-align:center;font-size:16px;font-weight:700;background:transparent;outline:none;text-transform:uppercase;position:relative;z-index:5}.cell-input:focus{background:#e8f4fd;box-shadow:inset 0 0 0 2px #3498db}.cell-number{position:absolute;top:1px;left:2px;font-size:10px;font-weight:700;color:#2c3e50;line-height:1;z-index:15;pointer-events:none}.solution-text{color:#2c3e50!important;font-weight:700!important;background:#fff!important}.solution-text:disabled{opacity:1!important;cursor:default}.grid-cell .solution-text{border:none!important;background:#fff!important}.clue-list{background:#f8f9fa;padding:20px;border-radius:8px;max-height:600px;overflow-y:auto}.clue-section{margin-bottom:25px}.clue-section h4{color:#2c3e50;margin-bottom:15px;font-size:1.2rem;border-bottom:2px solid #3498db;padding-bottom:5px}.clue-section ol{padding-left:0;list-style:none}.clue-item{display:flex;margin-bottom:8px;padding:8px;border-radius:4px;cursor:pointer;transition:background-color .2s ease}.clue-item:hover{background:#e9ecef}.clue-number{font-weight:700;color:#3498db;margin-right:10px;min-width:25px}.clue-text{flex:1;color:#2c3e50}.error-message{background:#f8d7da;color:#721c24;padding:15px;border-radius:5px;margin:20px 0;border:1px solid #f5c6cb}.success-message{background:#d4edda;color:#155724;padding:15px;border-radius:5px;margin:20px 0;border:1px solid #c3e6cb;text-align:center;font-weight:600}.tab-nav{display:flex;border-bottom:2px solid #e9ecef;margin-bottom:20px;gap:2px}.tab-btn{padding:12px 20px;border:none;background:#f8f9fa;color:#6c757d;cursor:pointer;border-radius:8px 8px 0 0;font-weight:500;transition:all .3s ease}.tab-btn:hover{background:#e9ecef;color:#495057}.tab-btn.active{background:#3498db;color:#fff}.debug-tab{background:#f8f9fa;border-radius:8px;padding:20px;margin-top:20px}.debug-nav{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;border-bottom:2px solid #e9ecef;padding-bottom:15px}.debug-nav-btn{padding:8px 16px;border:1px solid #dee2e6;background:#fff;color:#495057;border-radius:20px;cursor:pointer;font-size:.9rem;font-weight:500;transition:all .3s ease}.debug-nav-btn:hover{background:#e9ecef;border-color:#adb5bd}.debug-nav-btn.active{background:#3498db;color:#fff;border-color:#3498db}.debug-content{min-height:300px}.debug-section h3{color:#2c3e50;margin-bottom:15px;border-bottom:1px solid #dee2e6;padding-bottom:8px}.debug-section h4{color:#495057;margin-top:20px;margin-bottom:10px}.debug-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px;margin-bottom:20px}.debug-grid>div{padding:8px 12px;background:#fff;border-radius:4px;border:1px solid #e9ecef;font-size:.9rem}.debug-grid strong{color:#2c3e50}.word-table-container{max-height:400px;overflow-y:auto;border:1px solid #dee2e6;border-radius:6px;background:#fff}.word-table{width:100%;border-collapse:collapse;font-size:.85rem}.word-table th{background:#f8f9fa;padding:8px 12px;text-align:left;border-bottom:2px solid #dee2e6;font-weight:600;color:#495057;position:sticky;top:0;z-index:1}.word-table th.sorted-column{background:#e3f2fd;color:#1976d2;font-weight:700}.word-table th[style*="cursor: pointer"]:hover{background:#e9ecef}.word-table td{padding:6px 12px;border-bottom:1px solid #f1f3f4}.word-table tr:hover{background-color:#f8f9fa}.word-table td:first-child{font-weight:600;color:#2c3e50}.debug-section ul{margin:10px 0;padding-left:20px}.debug-section li{margin:5px 0;font-size:.9rem;line-height:1.4}@media (max-width: 768px){.debug-nav{justify-content:center}.debug-nav-btn{font-size:.8rem;padding:6px 12px}.debug-grid{grid-template-columns:1fr}.word-table{font-size:.75rem}.word-table th,.word-table td{padding:4px 8px}}
|
crossword-app/backend-py/public/assets/index-DW3Gfxju.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{r as m,a as R,R as $}from"./vendor-nf7bT_Uh.js";(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))i(t);new MutationObserver(t=>{for(const r of t)if(r.type==="childList")for(const h of r.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function u(t){const r={};return t.integrity&&(r.integrity=t.integrity),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?r.credentials="include":t.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(t){if(t.ep)return;t.ep=!0;const r=u(t);fetch(t.href,r)}})();var C={exports:{}},_={};/**
|
2 |
+
* @license React
|
3 |
+
* react-jsx-runtime.production.min.js
|
4 |
+
*
|
5 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
6 |
+
*
|
7 |
+
* This source code is licensed under the MIT license found in the
|
8 |
+
* LICENSE file in the root directory of this source tree.
|
9 |
+
*/var O=m,L=Symbol.for("react.element"),F=Symbol.for("react.fragment"),G=Object.prototype.hasOwnProperty,M=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U={key:!0,ref:!0,__self:!0,__source:!0};function T(s,c,u){var i,t={},r=null,h=null;u!==void 0&&(r=""+u),c.key!==void 0&&(r=""+c.key),c.ref!==void 0&&(h=c.ref);for(i in c)G.call(c,i)&&!U.hasOwnProperty(i)&&(t[i]=c[i]);if(s&&s.defaultProps)for(i in c=s.defaultProps,c)t[i]===void 0&&(t[i]=c[i]);return{$$typeof:L,type:s,key:r,ref:h,props:t,_owner:M.current}}_.Fragment=F;_.jsx=T;_.jsxs=T;C.exports=_;var e=C.exports,z={},S=R;z.createRoot=S.createRoot,z.hydrateRoot=S.hydrateRoot;const W=({onTopicsChange:s,availableTopics:c=[],selectedTopics:u=[],customSentence:i="",onSentenceChange:t,multiTheme:r=!0,onMultiThemeChange:h})=>{const g=o=>{const f=u.includes(o)?u.filter(j=>j!==o):[...u,o];s(f)};return e.jsxs("div",{className:"topic-selector",children:[e.jsx("h3",{children:"Select Topics"}),e.jsx("div",{className:"topic-buttons",children:c.map(o=>e.jsx("button",{className:`topic-btn ${u.includes(o.name)?"selected":""}`,onClick:()=>g(o.name),children:o.name},o.id))}),e.jsxs("div",{className:"sentence-input-container",children:[e.jsx("label",{htmlFor:"custom-sentence",className:"sentence-label",children:"Custom Sentence (optional)"}),e.jsx("textarea",{id:"custom-sentence",className:"sentence-input",value:i,onChange:o=>t&&t(o.target.value),placeholder:"Enter a sentence to influence word selection...",rows:"3",maxLength:"200"}),e.jsxs("div",{className:"sentence-info",children:[e.jsxs("span",{className:"char-count",children:[i.length,"/200 characters"]}),i&&e.jsx("button",{type:"button",className:"clear-sentence-btn",onClick:()=>t&&t(""),title:"Clear sentence",children:"Clear"})]})]}),e.jsxs("div",{className:"multi-theme-toggle-container",children:[e.jsxs("label",{className:"multi-theme-toggle",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:o=>h&&h(o.target.checked),className:"multi-theme-checkbox"}),e.jsx("span",{className:"multi-theme-label",children:"🎯 Use Multi-Theme Processing"})]}),e.jsx("p",{className:"multi-theme-description",children:r?"AI will process each theme separately and balance results":"AI will blend all themes into a single concept"})]}),e.jsxs("p",{className:"selected-count",children:[u.length," topic",u.length!==1?"s":""," selected"]})]})},B=({grid:s,clues:c,showSolution:u,onCellChange:i})=>{const[t,r]=m.useState({});m.useEffect(()=>{r({})},[s]);const h=(l,n,a)=>{const p=`${l}-${n}`,x={...t,[p]:a.toUpperCase()};r(x),i&&i(l,n,a)},g=(l,n)=>{if(u&&!o(l,n))return s[l][n];const a=`${l}-${n}`;return t[a]||""},o=(l,n)=>s[l][n]===".",f=(l,n)=>{if(!c)return null;const a=c.find(p=>p.position.row===l&&p.position.col===n);return a?a.number:null};if(!s||s.length===0)return e.jsx("div",{className:"puzzle-grid",children:"No puzzle loaded"});const j=s.length,d=s[0]?s[0].length:0;return e.jsx("div",{className:"puzzle-container",children:e.jsx("div",{className:"puzzle-grid",style:{gridTemplateColumns:`repeat(${d}, 35px)`,gridTemplateRows:`repeat(${j}, 35px)`},children:s.map((l,n)=>l.map((a,p)=>{const x=f(n,p);return o(n,p)?e.jsx("div",{className:"grid-cell empty-cell",style:{visibility:"hidden"}},`${n}-${p}`):e.jsxs("div",{className:"grid-cell white-cell",children:[x&&e.jsx("span",{className:"cell-number",children:x}),e.jsx("input",{type:"text",maxLength:"1",value:g(n,p),onChange:v=>h(n,p,v.target.value),className:`cell-input ${u?"solution-text":""}`,disabled:u})]},`${n}-${p}`)}))})})},q=({clues:s=[]})=>{const c=s.filter(t=>t.direction==="across"),u=s.filter(t=>t.direction==="down"),i=({title:t,clueList:r})=>e.jsxs("div",{className:"clue-section",children:[e.jsx("h4",{children:t}),e.jsx("ol",{children:r.map(h=>e.jsxs("li",{className:"clue-item",children:[e.jsx("span",{className:"clue-number",children:h.number}),e.jsx("span",{className:"clue-text",children:h.text})]},`${h.number}-${h.direction}`))})]});return e.jsxs("div",{className:"clue-list",children:[e.jsx(i,{title:"Across",clueList:c}),e.jsx(i,{title:"Down",clueList:u})]})},Y=({debugData:s})=>{const[c,u]=m.useState("overview");if(!s||!s.enabled)return e.jsx("div",{className:"debug-tab",children:e.jsx("p",{children:"Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend."})});const i=[{id:"overview",label:"Overview"},{id:"thematic-pool",label:"Thematic Pool"},{id:"candidates",label:"Candidates"},{id:"selection",label:"Selection"},{id:"selected",label:"Selected Words"}],t=()=>{var d,l,n;return e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Generation Parameters"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Topics:"})," ",s.generation_params.topics.join(", ")]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty:"})," ",s.generation_params.difficulty]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Requested Words:"})," ",s.generation_params.requested_words]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool Size:"})," ",s.generation_params.thematic_pool_size]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Min Similarity:"})," ",s.generation_params.min_similarity]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Multi-theme:"})," ",s.generation_params.multi_theme?"Yes":"No"]}),s.generation_params.custom_sentence&&e.jsxs("div",{children:[e.jsx("strong",{children:"Custom Sentence:"}),' "',s.generation_params.custom_sentence,'"']})]}),e.jsx("h3",{children:"Selection Algorithm"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Method:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Use Softmax:"})," ",s.selection_params.use_softmax_selection?"Yes":"No"]})]}),e.jsx("h3",{children:"Results Summary"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool:"})," ",((d=s.thematic_pool)==null?void 0:d.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Candidates:"})," ",((l=s.candidate_words)==null?void 0:l.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Selected:"})," ",((n=s.selected_words)==null?void 0:n.length)||0," words"]})]})]})},r=(d,l=!1,n=!1)=>e.jsx("div",{className:"word-table-container",children:e.jsxs("table",{className:"word-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Word"}),e.jsx("th",{children:"Similarity"}),e.jsx("th",{children:"Percentile"}),e.jsx("th",{children:"Tier"}),l&&e.jsx("th",{children:"Clue"}),n&&e.jsx("th",{children:"Semantic Neighbors"})]})}),e.jsx("tbody",{children:d.map((a,p)=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:a.word})}),e.jsx("td",{children:a.similarity.toFixed(3)}),e.jsx("td",{children:a.percentile.toFixed(3)}),e.jsx("td",{title:a.tier_description||a.tier,children:a.tier.replace("tier_","").replace("_"," ")}),l&&e.jsx("td",{children:a.clue}),n&&e.jsx("td",{children:((x=a.semantic_neighbors)==null?void 0:x.slice(0,3).join(", "))||"N/A"})]},p)})})]})}),h=()=>{const d=[...s.thematic_pool||[]].sort((l,n)=>n.similarity-l.similarity);return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Thematic Pool (",d.length," words)"]}),e.jsx("p",{children:"All words generated thematically, sorted by similarity to theme."}),r(d)]})},g=()=>{const d=s.candidate_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Candidate Words (",d.length," words)"]}),e.jsx("p",{children:"Words that passed filtering and got clues generated."}),r(d,!0,!1)]})},o=()=>e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Selection Process"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Algorithm:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature," (lower = more deterministic)"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight," (balance between similarity and frequency)"]})]}),e.jsx("h4",{children:"How it works:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Composite Score"})," = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Frequency Alignment"}),": Gaussian distribution favoring target percentiles by difficulty"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Softmax Selection"}),": Probabilistic selection based on composite scores with temperature control"]})]}),e.jsx("h4",{children:"Difficulty Targets:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Easy:"})," 90th percentile (common words like CAT, DOG)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Medium:"})," 50th percentile (balanced selection)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Hard:"})," 20th percentile (rare words like QUETZAL, PLATYPUS)"]})]})]}),f=()=>{const d=s.selected_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Selected Words (",d.length," words)"]}),e.jsx("p",{children:"Final words chosen for crossword generation."}),r(d,!0)]})},j=()=>{switch(c){case"overview":return t();case"thematic-pool":return h();case"candidates":return g();case"selection":return o();case"selected":return f();default:return t()}};return e.jsxs("div",{className:"debug-tab",children:[e.jsx("div",{className:"debug-nav",children:i.map(d=>e.jsx("button",{className:`debug-nav-btn ${c===d.id?"active":""}`,onClick:()=>u(d.id),children:d.label},d.id))}),e.jsx("div",{className:"debug-content",children:j()})]})},H=({message:s="Generating puzzle..."})=>e.jsxs("div",{className:"loading-spinner",children:[e.jsx("div",{className:"spinner"}),e.jsx("p",{className:"loading-message",children:s})]}),J=()=>{const[s,c]=m.useState(null),[u,i]=m.useState(!1),[t,r]=m.useState(null),[h,g]=m.useState([]),o="",f=m.useCallback(async()=>{try{i(!0);const n=await fetch(`${o}/api/topics`);if(!n.ok)throw new Error("Failed to fetch topics");const a=await n.json();g(a)}catch(n){r(n.message)}finally{i(!1)}},[o]),j=m.useCallback(async(n,a="medium",p=!1,x="",y=!0)=>{try{i(!0),r(null);const v=await fetch(`${o}/api/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topics:n,difficulty:a,useAI:p,...x&&{customSentence:x},multiTheme:y})});if(!v.ok){const w=await v.json().catch(()=>({}));throw new Error(w.message||"Failed to generate puzzle")}const N=await v.json();return c(N),N}catch(v){return r(v.message),null}finally{i(!1)}},[o]),d=m.useCallback(async n=>{try{const a=await fetch(`${o}/api/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({puzzle:s,answers:n})});if(!a.ok)throw new Error("Failed to validate answers");return await a.json()}catch(a){return r(a.message),null}},[o,s]),l=m.useCallback(()=>{c(null),r(null)},[]);return{puzzle:s,loading:u,error:t,topics:h,fetchTopics:f,generatePuzzle:j,validateAnswers:d,resetPuzzle:l}};function K(){const[s,c]=m.useState([]),[u,i]=m.useState("medium"),[t,r]=m.useState(!1),[h,g]=m.useState(""),[o,f]=m.useState(!0),[j,d]=m.useState("puzzle"),{puzzle:l,loading:n,error:a,topics:p,fetchTopics:x,generatePuzzle:y,resetPuzzle:v}=J();m.useEffect(()=>{x()},[x]);const N=async()=>{if(s.length===0&&!h.trim()){alert("Please select at least one topic or provide a custom sentence");return}r(!1),await y(s,u,!1,h,o)},w=b=>{c(b)},P=b=>{g(b)},k=b=>{f(b)},E=()=>{v(),c([]),r(!1),i("medium"),g(""),f(!0),d("puzzle")},A=()=>{r(!0)};return e.jsxs("div",{className:"crossword-app",children:[e.jsxs("header",{className:"app-header",children:[e.jsx("h1",{className:"app-title",children:"Crossword Puzzle Generator"}),e.jsx("p",{children:"Select topics and generate your custom crossword puzzle!"})]}),e.jsx(W,{onTopicsChange:w,availableTopics:p,selectedTopics:s,customSentence:h,onSentenceChange:P,multiTheme:o,onMultiThemeChange:k}),e.jsxs("div",{className:"puzzle-controls",children:[e.jsxs("select",{value:u,onChange:b=>i(b.target.value),className:"control-btn",children:[e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]}),e.jsx("button",{onClick:N,disabled:n||s.length===0&&!h.trim(),className:"control-btn generate-btn",children:n?"Generating...":"Generate Puzzle"}),e.jsx("button",{onClick:E,className:"control-btn reset-btn",children:"Reset"}),l&&!t&&e.jsx("button",{onClick:A,className:"control-btn reveal-btn",children:"Reveal Solution"})]}),a&&e.jsxs("div",{className:"error-message",children:["Error: ",a]}),n&&e.jsx(H,{}),l&&!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"tab-nav",children:[e.jsx("button",{className:`tab-btn ${j==="puzzle"?"active":""}`,onClick:()=>d("puzzle"),children:"Puzzle"}),l.debug&&e.jsx("button",{className:`tab-btn ${j==="debug"?"active":""}`,onClick:()=>d("debug"),children:"Debug"})]}),j==="puzzle"&&e.jsxs("div",{className:"puzzle-layout",children:[e.jsx(B,{grid:l.grid,clues:l.clues,showSolution:t}),e.jsx(q,{clues:l.clues})]}),j==="debug"&&l.debug&&e.jsx(Y,{debugData:l.debug})]}),!l&&!n&&!a&&e.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#7f8c8d"},children:'Select topics and click "Generate Puzzle" to start!'})]})}z.createRoot(document.getElementById("root")).render(e.jsx($.StrictMode,{children:e.jsx(K,{})}));
|
10 |
+
//# sourceMappingURL=index-DW3Gfxju.js.map
|
crossword-app/backend-py/public/assets/index-DW3Gfxju.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"index-DW3Gfxju.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react-dom/client.js","../../src/components/TopicSelector.jsx","../../src/components/PuzzleGrid.jsx","../../src/components/ClueList.jsx","../../src/components/DebugTab.jsx","../../src/components/LoadingSpinner.jsx","../../src/hooks/useCrossword.js","../../src/App.jsx","../../src/main.jsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","import React from 'react';\n\nconst TopicSelector = ({ \n onTopicsChange, \n availableTopics = [], \n selectedTopics = [],\n customSentence = '',\n onSentenceChange,\n multiTheme = true,\n onMultiThemeChange\n}) => {\n const handleTopicToggle = (topic) => {\n const newSelectedTopics = selectedTopics.includes(topic)\n ? selectedTopics.filter(t => t !== topic)\n : [...selectedTopics, topic];\n \n onTopicsChange(newSelectedTopics);\n };\n\n return (\n <div className=\"topic-selector\">\n <h3>Select Topics</h3>\n <div className=\"topic-buttons\">\n {availableTopics.map(topic => (\n <button\n key={topic.id}\n className={`topic-btn ${selectedTopics.includes(topic.name) ? 'selected' : ''}`}\n onClick={() => handleTopicToggle(topic.name)}\n >\n {topic.name}\n </button>\n ))}\n </div>\n \n <div className=\"sentence-input-container\">\n <label htmlFor=\"custom-sentence\" className=\"sentence-label\">\n Custom Sentence (optional)\n </label>\n <textarea\n id=\"custom-sentence\"\n className=\"sentence-input\"\n value={customSentence}\n onChange={(e) => onSentenceChange && onSentenceChange(e.target.value)}\n placeholder=\"Enter a sentence to influence word selection...\"\n rows=\"3\"\n maxLength=\"200\"\n />\n <div className=\"sentence-info\">\n <span className=\"char-count\">{customSentence.length}/200 characters</span>\n {customSentence && (\n <button \n type=\"button\"\n className=\"clear-sentence-btn\"\n onClick={() => onSentenceChange && onSentenceChange('')}\n title=\"Clear sentence\"\n >\n Clear\n </button>\n )}\n </div>\n </div>\n \n <div className=\"multi-theme-toggle-container\">\n <label className=\"multi-theme-toggle\">\n <input\n type=\"checkbox\"\n checked={multiTheme}\n onChange={(e) => onMultiThemeChange && onMultiThemeChange(e.target.checked)}\n className=\"multi-theme-checkbox\"\n />\n <span className=\"multi-theme-label\">\n 🎯 Use Multi-Theme Processing\n </span>\n </label>\n <p className=\"multi-theme-description\">\n {multiTheme \n ? \"AI will process each theme separately and balance results\" \n : \"AI will blend all themes into a single concept\"\n }\n </p>\n </div>\n \n <p className=\"selected-count\">\n {selectedTopics.length} topic{selectedTopics.length !== 1 ? 's' : ''} selected\n </p>\n </div>\n );\n};\n\nexport default TopicSelector;","import React, { useState, useEffect } from 'react';\n\nconst PuzzleGrid = ({ grid, clues, showSolution, onCellChange }) => {\n const [userAnswers, setUserAnswers] = useState({});\n\n useEffect(() => {\n setUserAnswers({});\n }, [grid]);\n\n const handleCellInput = (row, col, value) => {\n const key = `${row}-${col}`;\n const newAnswers = { ...userAnswers, [key]: value.toUpperCase() };\n setUserAnswers(newAnswers);\n onCellChange && onCellChange(row, col, value);\n };\n\n const getCellValue = (row, col) => {\n if (showSolution && !isBlackCell(row, col)) {\n return grid[row][col];\n }\n const key = `${row}-${col}`;\n return userAnswers[key] || '';\n };\n\n const isBlackCell = (row, col) => {\n return grid[row][col] === '.';\n };\n\n const getCellNumber = (row, col) => {\n if (!clues) return null;\n const clue = clues.find(c => c.position.row === row && c.position.col === col);\n return clue ? clue.number : null;\n };\n\n if (!grid || grid.length === 0) {\n return <div className=\"puzzle-grid\">No puzzle loaded</div>;\n }\n\n const gridRows = grid.length;\n const gridCols = grid[0] ? grid[0].length : 0;\n\n return (\n <div className=\"puzzle-container\">\n <div \n className=\"puzzle-grid\"\n style={{\n gridTemplateColumns: `repeat(${gridCols}, 35px)`,\n gridTemplateRows: `repeat(${gridRows}, 35px)`\n }}\n >\n {grid.map((row, rowIndex) =>\n row.map((cell, colIndex) => {\n const cellNumber = getCellNumber(rowIndex, colIndex);\n const isBlack = isBlackCell(rowIndex, colIndex);\n \n // Only render cells that contain letters (not black/unused cells)\n if (isBlack) {\n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell empty-cell\"\n style={{ visibility: 'hidden' }}\n >\n </div>\n );\n }\n \n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell white-cell\"\n >\n {cellNumber && <span className=\"cell-number\">{cellNumber}</span>}\n <input\n type=\"text\"\n maxLength=\"1\"\n value={getCellValue(rowIndex, colIndex)}\n onChange={(e) => handleCellInput(rowIndex, colIndex, e.target.value)}\n className={`cell-input ${showSolution ? 'solution-text' : ''}`}\n disabled={showSolution}\n />\n </div>\n );\n })\n )}\n </div>\n </div>\n );\n};\n\nexport default PuzzleGrid;","import React from 'react';\n\nconst ClueList = ({ clues = [] }) => {\n const acrossClues = clues.filter(clue => clue.direction === 'across');\n const downClues = clues.filter(clue => clue.direction === 'down');\n\n const ClueSection = ({ title, clueList }) => (\n <div className=\"clue-section\">\n <h4>{title}</h4>\n <ol>\n {clueList.map(clue => (\n <li key={`${clue.number}-${clue.direction}`} className=\"clue-item\">\n <span className=\"clue-number\">{clue.number}</span>\n <span className=\"clue-text\">{clue.text}</span>\n </li>\n ))}\n </ol>\n </div>\n );\n\n return (\n <div className=\"clue-list\">\n <ClueSection title=\"Across\" clueList={acrossClues} />\n <ClueSection title=\"Down\" clueList={downClues} />\n </div>\n );\n};\n\nexport default ClueList;","import React, { useState } from 'react';\n\nconst DebugTab = ({ debugData }) => {\n const [activeSection, setActiveSection] = useState('overview');\n\n if (!debugData || !debugData.enabled) {\n return (\n <div className=\"debug-tab\">\n <p>Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend.</p>\n </div>\n );\n }\n\n const sections = [\n { id: 'overview', label: 'Overview' },\n { id: 'thematic-pool', label: 'Thematic Pool' },\n { id: 'candidates', label: 'Candidates' },\n { id: 'selection', label: 'Selection' },\n { id: 'selected', label: 'Selected Words' }\n ];\n\n const renderOverview = () => (\n <div className=\"debug-section\">\n <h3>Generation Parameters</h3>\n <div className=\"debug-grid\">\n <div><strong>Topics:</strong> {debugData.generation_params.topics.join(', ')}</div>\n <div><strong>Difficulty:</strong> {debugData.generation_params.difficulty}</div>\n <div><strong>Requested Words:</strong> {debugData.generation_params.requested_words}</div>\n <div><strong>Thematic Pool Size:</strong> {debugData.generation_params.thematic_pool_size}</div>\n <div><strong>Min Similarity:</strong> {debugData.generation_params.min_similarity}</div>\n <div><strong>Multi-theme:</strong> {debugData.generation_params.multi_theme ? 'Yes' : 'No'}</div>\n {debugData.generation_params.custom_sentence && (\n <div><strong>Custom Sentence:</strong> \"{debugData.generation_params.custom_sentence}\"</div>\n )}\n </div>\n\n <h3>Selection Algorithm</h3>\n <div className=\"debug-grid\">\n <div><strong>Method:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature}</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight}</div>\n <div><strong>Use Softmax:</strong> {debugData.selection_params.use_softmax_selection ? 'Yes' : 'No'}</div>\n </div>\n\n <h3>Results Summary</h3>\n <div className=\"debug-grid\">\n <div><strong>Thematic Pool:</strong> {debugData.thematic_pool?.length || 0} words</div>\n <div><strong>Candidates:</strong> {debugData.candidate_words?.length || 0} words</div>\n <div><strong>Selected:</strong> {debugData.selected_words?.length || 0} words</div>\n </div>\n </div>\n );\n\n const renderWordTable = (words, showClue = false, showNeighbors = false) => (\n <div className=\"word-table-container\">\n <table className=\"word-table\">\n <thead>\n <tr>\n <th>Word</th>\n <th>Similarity</th>\n <th>Percentile</th>\n <th>Tier</th>\n {showClue && <th>Clue</th>}\n {showNeighbors && <th>Semantic Neighbors</th>}\n </tr>\n </thead>\n <tbody>\n {words.map((word, idx) => (\n <tr key={idx}>\n <td><strong>{word.word}</strong></td>\n <td>{word.similarity.toFixed(3)}</td>\n <td>{word.percentile.toFixed(3)}</td>\n <td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>\n {showClue && <td>{word.clue}</td>}\n {showNeighbors && <td>{word.semantic_neighbors?.slice(0, 3).join(', ') || 'N/A'}</td>}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n\n const renderThematicPool = () => {\n const sortedPool = [...(debugData.thematic_pool || [])].sort((a, b) => b.similarity - a.similarity);\n \n return (\n <div className=\"debug-section\">\n <h3>Thematic Pool ({sortedPool.length} words)</h3>\n <p>All words generated thematically, sorted by similarity to theme.</p>\n {renderWordTable(sortedPool)}\n </div>\n );\n };\n\n const renderCandidates = () => {\n const candidates = debugData.candidate_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Candidate Words ({candidates.length} words)</h3>\n <p>Words that passed filtering and got clues generated.</p>\n {renderWordTable(candidates, true, false)}\n </div>\n );\n };\n\n const renderSelection = () => (\n <div className=\"debug-section\">\n <h3>Selection Process</h3>\n <div className=\"debug-grid\">\n <div><strong>Algorithm:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature} (lower = more deterministic)</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight} (balance between similarity and frequency)</div>\n </div>\n \n <h4>How it works:</h4>\n <ul>\n <li><strong>Composite Score</strong> = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment</li>\n <li><strong>Frequency Alignment</strong>: Gaussian distribution favoring target percentiles by difficulty</li>\n <li><strong>Softmax Selection</strong>: Probabilistic selection based on composite scores with temperature control</li>\n </ul>\n\n <h4>Difficulty Targets:</h4>\n <ul>\n <li><strong>Easy:</strong> 90th percentile (common words like CAT, DOG)</li>\n <li><strong>Medium:</strong> 50th percentile (balanced selection)</li>\n <li><strong>Hard:</strong> 20th percentile (rare words like QUETZAL, PLATYPUS)</li>\n </ul>\n </div>\n );\n\n const renderSelected = () => {\n const selected = debugData.selected_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Selected Words ({selected.length} words)</h3>\n <p>Final words chosen for crossword generation.</p>\n {renderWordTable(selected, true)}\n </div>\n );\n };\n\n const renderSection = () => {\n switch (activeSection) {\n case 'overview': return renderOverview();\n case 'thematic-pool': return renderThematicPool();\n case 'candidates': return renderCandidates();\n case 'selection': return renderSelection();\n case 'selected': return renderSelected();\n default: return renderOverview();\n }\n };\n\n return (\n <div className=\"debug-tab\">\n <div className=\"debug-nav\">\n {sections.map(section => (\n <button\n key={section.id}\n className={`debug-nav-btn ${activeSection === section.id ? 'active' : ''}`}\n onClick={() => setActiveSection(section.id)}\n >\n {section.label}\n </button>\n ))}\n </div>\n \n <div className=\"debug-content\">\n {renderSection()}\n </div>\n </div>\n );\n};\n\nexport default DebugTab;","import React from 'react';\n\nconst LoadingSpinner = ({ message = \"Generating puzzle...\" }) => {\n return (\n <div className=\"loading-spinner\">\n <div className=\"spinner\"></div>\n <p className=\"loading-message\">{message}</p>\n </div>\n );\n};\n\nexport default LoadingSpinner;","import { useState, useCallback } from 'react';\n\nconst useCrossword = () => {\n const [puzzle, setPuzzle] = useState(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(null);\n const [topics, setTopics] = useState([]);\n\n const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || (import.meta.env.PROD ? '' : 'http://localhost:3000');\n\n const fetchTopics = useCallback(async () => {\n try {\n setLoading(true);\n const response = await fetch(`${API_BASE_URL}/api/topics`);\n if (!response.ok) throw new Error('Failed to fetch topics');\n const data = await response.json();\n setTopics(data);\n } catch (err) {\n setError(err.message);\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const generatePuzzle = useCallback(async (selectedTopics, difficulty = 'medium', useAI = false, customSentence = '', multiTheme = true) => {\n try {\n setLoading(true);\n setError(null);\n \n const response = await fetch(`${API_BASE_URL}/api/generate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n topics: selectedTopics,\n difficulty,\n useAI,\n ...(customSentence && { customSentence }),\n multiTheme\n })\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new Error(errorData.message || 'Failed to generate puzzle');\n }\n \n const puzzleData = await response.json();\n setPuzzle(puzzleData);\n return puzzleData;\n } catch (err) {\n setError(err.message);\n return null;\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const validateAnswers = useCallback(async (userAnswers) => {\n try {\n const response = await fetch(`${API_BASE_URL}/api/validate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n puzzle: puzzle,\n answers: userAnswers\n })\n });\n\n if (!response.ok) throw new Error('Failed to validate answers');\n \n return await response.json();\n } catch (err) {\n setError(err.message);\n return null;\n }\n }, [API_BASE_URL, puzzle]);\n\n const resetPuzzle = useCallback(() => {\n setPuzzle(null);\n setError(null);\n }, []);\n\n return {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n validateAnswers,\n resetPuzzle\n };\n};\n\nexport default useCrossword;","import React, { useState, useEffect } from 'react';\nimport TopicSelector from './components/TopicSelector';\nimport PuzzleGrid from './components/PuzzleGrid';\nimport ClueList from './components/ClueList';\nimport DebugTab from './components/DebugTab';\nimport LoadingSpinner from './components/LoadingSpinner';\nimport useCrossword from './hooks/useCrossword';\nimport './styles/puzzle.css';\n\nfunction App() {\n const [selectedTopics, setSelectedTopics] = useState([]);\n const [difficulty, setDifficulty] = useState('medium');\n const [showSolution, setShowSolution] = useState(false);\n const [customSentence, setCustomSentence] = useState('');\n const [multiTheme, setMultiTheme] = useState(true);\n const [activeTab, setActiveTab] = useState('puzzle');\n \n const {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n resetPuzzle\n } = useCrossword();\n\n useEffect(() => {\n fetchTopics();\n }, [fetchTopics]);\n\n const handleGeneratePuzzle = async () => {\n if (selectedTopics.length === 0 && !customSentence.trim()) {\n alert('Please select at least one topic or provide a custom sentence');\n return;\n }\n \n setShowSolution(false);\n await generatePuzzle(selectedTopics, difficulty, false, customSentence, multiTheme);\n };\n\n const handleTopicsChange = (topics) => {\n setSelectedTopics(topics);\n };\n\n const handleSentenceChange = (sentence) => {\n setCustomSentence(sentence);\n };\n\n const handleMultiThemeChange = (enabled) => {\n setMultiTheme(enabled);\n };\n\n\n const handleReset = () => {\n resetPuzzle();\n setSelectedTopics([]);\n setShowSolution(false);\n setDifficulty('medium');\n setCustomSentence('');\n setMultiTheme(true);\n setActiveTab('puzzle');\n };\n\n const handleRevealSolution = () => {\n setShowSolution(true);\n };\n\n return (\n <div className=\"crossword-app\">\n <header className=\"app-header\">\n <h1 className=\"app-title\">Crossword Puzzle Generator</h1>\n <p>Select topics and generate your custom crossword puzzle!</p>\n </header>\n\n <TopicSelector \n onTopicsChange={handleTopicsChange}\n availableTopics={topics}\n selectedTopics={selectedTopics}\n customSentence={customSentence}\n onSentenceChange={handleSentenceChange}\n multiTheme={multiTheme}\n onMultiThemeChange={handleMultiThemeChange}\n />\n\n <div className=\"puzzle-controls\">\n <select \n value={difficulty} \n onChange={(e) => setDifficulty(e.target.value)}\n className=\"control-btn\"\n >\n <option value=\"easy\">Easy</option>\n <option value=\"medium\">Medium</option>\n <option value=\"hard\">Hard</option>\n </select>\n \n <button\n onClick={handleGeneratePuzzle}\n disabled={loading || (selectedTopics.length === 0 && !customSentence.trim())}\n className=\"control-btn generate-btn\"\n >\n {loading ? 'Generating...' : 'Generate Puzzle'}\n </button>\n \n <button\n onClick={handleReset}\n className=\"control-btn reset-btn\"\n >\n Reset\n </button>\n \n {puzzle && !showSolution && (\n <button\n onClick={handleRevealSolution}\n className=\"control-btn reveal-btn\"\n >\n Reveal Solution\n </button>\n )}\n </div>\n\n {error && (\n <div className=\"error-message\">\n Error: {error}\n </div>\n )}\n\n {loading && <LoadingSpinner />}\n\n {puzzle && !loading && (\n <>\n {/* Tab Navigation */}\n <div className=\"tab-nav\">\n <button\n className={`tab-btn ${activeTab === 'puzzle' ? 'active' : ''}`}\n onClick={() => setActiveTab('puzzle')}\n >\n Puzzle\n </button>\n {puzzle.debug && (\n <button\n className={`tab-btn ${activeTab === 'debug' ? 'active' : ''}`}\n onClick={() => setActiveTab('debug')}\n >\n Debug\n </button>\n )}\n </div>\n\n {/* Tab Content */}\n {activeTab === 'puzzle' && (\n <div className=\"puzzle-layout\">\n <PuzzleGrid \n grid={puzzle.grid} \n clues={puzzle.clues}\n showSolution={showSolution}\n />\n <ClueList clues={puzzle.clues} />\n </div>\n )}\n\n {activeTab === 'debug' && puzzle.debug && (\n <DebugTab debugData={puzzle.debug} />\n )}\n </>\n )}\n\n {!puzzle && !loading && !error && (\n <div style={{ textAlign: 'center', padding: '40px', color: '#7f8c8d' }}>\n Select topics and click \"Generate Puzzle\" to start!\n </div>\n )}\n </div>\n );\n}\n\nexport default App;","import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n)"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","reactJsxRuntime_production_min","jsxRuntimeModule","client","TopicSelector","onTopicsChange","availableTopics","selectedTopics","customSentence","onSentenceChange","multiTheme","onMultiThemeChange","handleTopicToggle","topic","newSelectedTopics","t","jsxs","jsx","PuzzleGrid","grid","clues","showSolution","onCellChange","userAnswers","setUserAnswers","useState","useEffect","handleCellInput","row","col","value","key","newAnswers","getCellValue","isBlackCell","getCellNumber","clue","gridRows","gridCols","rowIndex","cell","colIndex","cellNumber","ClueList","acrossClues","downClues","ClueSection","title","clueList","DebugTab","debugData","activeSection","setActiveSection","sections","renderOverview","_a","_b","_c","renderWordTable","words","showClue","showNeighbors","word","idx","renderThematicPool","sortedPool","renderCandidates","candidates","renderSelection","renderSelected","selected","renderSection","section","LoadingSpinner","message","useCrossword","puzzle","setPuzzle","loading","setLoading","error","setError","topics","setTopics","API_BASE_URL","fetchTopics","useCallback","response","data","err","generatePuzzle","difficulty","useAI","errorData","puzzleData","validateAnswers","resetPuzzle","App","setSelectedTopics","setDifficulty","setShowSolution","setCustomSentence","setMultiTheme","activeTab","setActiveTab","handleGeneratePuzzle","handleTopicsChange","handleSentenceChange","sentence","handleMultiThemeChange","enabled","handleReset","handleRevealSolution","Fragment","ReactDOM","React"],"mappings":";;;;;;;;GASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAK,EAAE,KAAcH,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiB,EAAEA,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAA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
1 |
+
import{r as p,a as R,R as $}from"./vendor-nf7bT_Uh.js";(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))r(t);new MutationObserver(t=>{for(const n of t)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function u(t){const n={};return t.integrity&&(n.integrity=t.integrity),t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?n.credentials="include":t.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(t){if(t.ep)return;t.ep=!0;const n=u(t);fetch(t.href,n)}})();var k={exports:{}},C={};/**
|
2 |
+
* @license React
|
3 |
+
* react-jsx-runtime.production.min.js
|
4 |
+
*
|
5 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
6 |
+
*
|
7 |
+
* This source code is licensed under the MIT license found in the
|
8 |
+
* LICENSE file in the root directory of this source tree.
|
9 |
+
*/var L=p,O=Symbol.for("react.element"),F=Symbol.for("react.fragment"),B=Object.prototype.hasOwnProperty,G=L.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,W={key:!0,ref:!0,__self:!0,__source:!0};function E(s,c,u){var r,t={},n=null,o=null;u!==void 0&&(n=""+u),c.key!==void 0&&(n=""+c.key),c.ref!==void 0&&(o=c.ref);for(r in c)B.call(c,r)&&!W.hasOwnProperty(r)&&(t[r]=c[r]);if(s&&s.defaultProps)for(r in c=s.defaultProps,c)t[r]===void 0&&(t[r]=c[r]);return{$$typeof:O,type:s,key:n,ref:o,props:t,_owner:G.current}}C.Fragment=F;C.jsx=E;C.jsxs=E;k.exports=C;var e=k.exports,T={},P=R;T.createRoot=P.createRoot,T.hydrateRoot=P.hydrateRoot;const M=({onTopicsChange:s,availableTopics:c=[],selectedTopics:u=[],customSentence:r="",onSentenceChange:t,multiTheme:n=!0,onMultiThemeChange:o})=>{const b=a=>{const v=u.includes(a)?u.filter(j=>j!==a):[...u,a];s(v)};return e.jsxs("div",{className:"topic-selector",children:[e.jsx("h3",{children:"Select Topics"}),e.jsx("div",{className:"topic-buttons",children:c.map(a=>e.jsx("button",{className:`topic-btn ${u.includes(a.name)?"selected":""}`,onClick:()=>b(a.name),children:a.name},a.id))}),e.jsxs("div",{className:"sentence-input-container",children:[e.jsx("label",{htmlFor:"custom-sentence",className:"sentence-label",children:"Custom Sentence (optional)"}),e.jsx("textarea",{id:"custom-sentence",className:"sentence-input",value:r,onChange:a=>t&&t(a.target.value),placeholder:"Enter a sentence to influence word selection...",rows:"3",maxLength:"200"}),e.jsxs("div",{className:"sentence-info",children:[e.jsxs("span",{className:"char-count",children:[r.length,"/200 characters"]}),r&&e.jsx("button",{type:"button",className:"clear-sentence-btn",onClick:()=>t&&t(""),title:"Clear sentence",children:"Clear"})]})]}),e.jsxs("div",{className:"multi-theme-toggle-container",children:[e.jsxs("label",{className:"multi-theme-toggle",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:a=>o&&o(a.target.checked),className:"multi-theme-checkbox"}),e.jsx("span",{className:"multi-theme-label",children:"🎯 Use Multi-Theme Processing"})]}),e.jsx("p",{className:"multi-theme-description",children:n?"AI will process each theme separately and balance results":"AI will blend all themes into a single concept"})]}),e.jsxs("p",{className:"selected-count",children:[u.length," topic",u.length!==1?"s":""," selected"]})]})},U=({grid:s,clues:c,showSolution:u,onCellChange:r})=>{const[t,n]=p.useState({});p.useEffect(()=>{n({})},[s]);const o=(d,i,m)=>{const x=`${d}-${i}`,g={...t,[x]:m.toUpperCase()};n(g),r&&r(d,i,m)},b=(d,i)=>{if(u&&!a(d,i))return s[d][i];const m=`${d}-${i}`;return t[m]||""},a=(d,i)=>s[d][i]===".",v=(d,i)=>{if(!c)return null;const m=c.find(x=>x.position.row===d&&x.position.col===i);return m?m.number:null};if(!s||s.length===0)return e.jsx("div",{className:"puzzle-grid",children:"No puzzle loaded"});const j=s.length,y=s[0]?s[0].length:0;return e.jsx("div",{className:"puzzle-container",children:e.jsx("div",{className:"puzzle-grid",style:{gridTemplateColumns:`repeat(${y}, 35px)`,gridTemplateRows:`repeat(${j}, 35px)`},children:s.map((d,i)=>d.map((m,x)=>{const g=v(i,x);return a(i,x)?e.jsx("div",{className:"grid-cell empty-cell",style:{visibility:"hidden"}},`${i}-${x}`):e.jsxs("div",{className:"grid-cell white-cell",children:[g&&e.jsx("span",{className:"cell-number",children:g}),e.jsx("input",{type:"text",maxLength:"1",value:b(i,x),onChange:l=>o(i,x,l.target.value),className:`cell-input ${u?"solution-text":""}`,disabled:u})]},`${i}-${x}`)}))})})},q=({clues:s=[]})=>{const c=s.filter(t=>t.direction==="across"),u=s.filter(t=>t.direction==="down"),r=({title:t,clueList:n})=>e.jsxs("div",{className:"clue-section",children:[e.jsx("h4",{children:t}),e.jsx("ol",{children:n.map(o=>e.jsxs("li",{className:"clue-item",children:[e.jsx("span",{className:"clue-number",children:o.number}),e.jsx("span",{className:"clue-text",children:o.text})]},`${o.number}-${o.direction}`))})]});return e.jsxs("div",{className:"clue-list",children:[e.jsx(r,{title:"Across",clueList:c}),e.jsx(r,{title:"Down",clueList:u})]})},Y=({debugData:s})=>{const[c,u]=p.useState("overview"),[r,t]=p.useState("similarity"),[n,o]=p.useState("desc");if(!s||!s.enabled)return e.jsx("div",{className:"debug-tab",children:e.jsx("p",{children:"Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend."})});const b=[{id:"overview",label:"Overview"},{id:"thematic-pool",label:"Thematic Pool"},{id:"candidates",label:"Candidates"},{id:"selection",label:"Selection"},{id:"selected",label:"Selected Words"}],a=()=>{var l,f,h;return e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Generation Parameters"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Topics:"})," ",s.generation_params.topics.join(", ")]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty:"})," ",s.generation_params.difficulty]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Requested Words:"})," ",s.generation_params.requested_words]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool Size:"})," ",s.generation_params.thematic_pool_size]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Min Similarity:"})," ",s.generation_params.min_similarity]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Multi-theme:"})," ",s.generation_params.multi_theme?"Yes":"No"]}),s.generation_params.custom_sentence&&e.jsxs("div",{children:[e.jsx("strong",{children:"Custom Sentence:"}),' "',s.generation_params.custom_sentence,'"']})]}),e.jsx("h3",{children:"Selection Algorithm"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Method:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Use Softmax:"})," ",s.selection_params.use_softmax_selection?"Yes":"No"]})]}),e.jsx("h3",{children:"Results Summary"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Thematic Pool:"})," ",((l=s.thematic_pool)==null?void 0:l.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Candidates:"})," ",((f=s.candidate_words)==null?void 0:f.length)||0," words"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Selected:"})," ",((h=s.selected_words)==null?void 0:h.length)||0," words"]})]})]})},v=(l,f=!1)=>e.jsx("div",{className:"word-table-container",children:e.jsxs("table",{className:"word-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Word"}),e.jsx("th",{children:"Similarity"}),e.jsx("th",{children:"Percentile"}),e.jsx("th",{children:"Tier"}),f&&e.jsx("th",{children:"Clue"})]})}),e.jsx("tbody",{children:l.map((h,N)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:h.word})}),e.jsx("td",{children:h.similarity.toFixed(3)}),e.jsx("td",{children:h.percentile.toFixed(3)}),e.jsx("td",{title:h.tier_description||h.tier,children:h.tier.replace("tier_","").replace("_"," ")}),f&&e.jsx("td",{children:h.clue})]},N))})]})}),j=l=>{r===l?o(n==="asc"?"desc":"asc"):(t(l),o(l==="word"?"asc":"desc"))},y=l=>r!==l?" ↕️":n==="asc"?" ▲":" ▼",d=()=>{const f=[...s.thematic_pool||[]].sort((h,N)=>{let w,S;switch(r){case"word":w=h.word.toLowerCase(),S=N.word.toLowerCase();break;case"similarity":w=h.similarity,S=N.similarity;break;case"percentile":w=h.percentile,S=N.percentile;break;default:w=h.similarity,S=N.similarity}return n==="asc"?w<S?-1:w>S?1:0:w>S?-1:w<S?1:0});return e.jsx("div",{className:"word-table-container",children:e.jsxs("table",{className:"word-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsxs("th",{onClick:()=>j("word"),style:{cursor:"pointer",userSelect:"none"},className:r==="word"?"sorted-column":"",children:["Word",y("word")]}),e.jsxs("th",{onClick:()=>j("similarity"),style:{cursor:"pointer",userSelect:"none"},className:r==="similarity"?"sorted-column":"",children:["Similarity",y("similarity")]}),e.jsxs("th",{onClick:()=>j("percentile"),style:{cursor:"pointer",userSelect:"none"},className:r==="percentile"?"sorted-column":"",children:["Percentile",y("percentile")]}),e.jsx("th",{children:"Tier"})]})}),e.jsx("tbody",{children:f.map((h,N)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:h.word})}),e.jsx("td",{children:h.similarity.toFixed(3)}),e.jsx("td",{children:h.percentile.toFixed(3)}),e.jsx("td",{title:h.tier_description||h.tier,children:h.tier.replace("tier_","").replace("_"," ")})]},N))})]})})},i=()=>{const l=s.thematic_pool||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Thematic Pool (",l.length," words)"]}),e.jsx("p",{children:"All words generated thematically. Click column headers to sort."}),d()]})},m=()=>{const l=s.candidate_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Candidate Words (",l.length," words)"]}),e.jsx("p",{children:"Words that passed filtering and got clues generated."}),v(l,!0)]})},x=()=>e.jsxs("div",{className:"debug-section",children:[e.jsx("h3",{children:"Selection Process"}),e.jsxs("div",{className:"debug-grid",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Algorithm:"})," ",s.selection_method]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Temperature:"})," ",s.selection_params.similarity_temperature," (lower = more deterministic)"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Difficulty Weight:"})," ",s.selection_params.difficulty_weight," (balance between similarity and frequency)"]})]}),e.jsx("h4",{children:"How it works:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Composite Score"})," = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Frequency Alignment"}),": Gaussian distribution favoring target percentiles by difficulty"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Softmax Selection"}),": Probabilistic selection based on composite scores with temperature control"]})]}),e.jsx("h4",{children:"Difficulty Targets:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Easy:"})," 90th percentile (common words like CAT, DOG)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Medium:"})," 50th percentile (balanced selection)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Hard:"})," 20th percentile (rare words like QUETZAL, PLATYPUS)"]})]})]}),g=()=>{const l=s.selected_words||[];return e.jsxs("div",{className:"debug-section",children:[e.jsxs("h3",{children:["Selected Words (",l.length," words)"]}),e.jsx("p",{children:"Final words chosen for crossword generation."}),v(l,!0)]})},z=()=>{switch(c){case"overview":return a();case"thematic-pool":return i();case"candidates":return m();case"selection":return x();case"selected":return g();default:return a()}};return e.jsxs("div",{className:"debug-tab",children:[e.jsx("div",{className:"debug-nav",children:b.map(l=>e.jsx("button",{className:`debug-nav-btn ${c===l.id?"active":""}`,onClick:()=>u(l.id),children:l.label},l.id))}),e.jsx("div",{className:"debug-content",children:z()})]})},H=({message:s="Generating puzzle..."})=>e.jsxs("div",{className:"loading-spinner",children:[e.jsx("div",{className:"spinner"}),e.jsx("p",{className:"loading-message",children:s})]}),J=()=>{const[s,c]=p.useState(null),[u,r]=p.useState(!1),[t,n]=p.useState(null),[o,b]=p.useState([]),a="",v=p.useCallback(async()=>{try{r(!0);const i=await fetch(`${a}/api/topics`);if(!i.ok)throw new Error("Failed to fetch topics");const m=await i.json();b(m)}catch(i){n(i.message)}finally{r(!1)}},[a]),j=p.useCallback(async(i,m="medium",x=!1,g="",z=!0)=>{try{r(!0),n(null);const l=await fetch(`${a}/api/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topics:i,difficulty:m,useAI:x,...g&&{customSentence:g},multiTheme:z})});if(!l.ok){const h=await l.json().catch(()=>({}));throw new Error(h.message||"Failed to generate puzzle")}const f=await l.json();return c(f),f}catch(l){return n(l.message),null}finally{r(!1)}},[a]),y=p.useCallback(async i=>{try{const m=await fetch(`${a}/api/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({puzzle:s,answers:i})});if(!m.ok)throw new Error("Failed to validate answers");return await m.json()}catch(m){return n(m.message),null}},[a,s]),d=p.useCallback(()=>{c(null),n(null)},[]);return{puzzle:s,loading:u,error:t,topics:o,fetchTopics:v,generatePuzzle:j,validateAnswers:y,resetPuzzle:d}};function V(){const[s,c]=p.useState([]),[u,r]=p.useState("medium"),[t,n]=p.useState(!1),[o,b]=p.useState(""),[a,v]=p.useState(!0),[j,y]=p.useState("puzzle"),{puzzle:d,loading:i,error:m,topics:x,fetchTopics:g,generatePuzzle:z,resetPuzzle:l}=J();p.useEffect(()=>{g()},[g]);const f=async()=>{if(s.length===0&&!o.trim()){alert("Please select at least one topic or provide a custom sentence");return}n(!1),await z(s,u,!1,o,a)},h=_=>{c(_)},N=_=>{b(_)},w=_=>{v(_)},S=()=>{l(),c([]),n(!1),r("medium"),b(""),v(!0),y("puzzle")},A=()=>{n(!0)};return e.jsxs("div",{className:"crossword-app",children:[e.jsxs("header",{className:"app-header",children:[e.jsx("h1",{className:"app-title",children:"Crossword Puzzle Generator"}),e.jsx("p",{children:"Select topics and generate your custom crossword puzzle!"})]}),e.jsx(M,{onTopicsChange:h,availableTopics:x,selectedTopics:s,customSentence:o,onSentenceChange:N,multiTheme:a,onMultiThemeChange:w}),e.jsxs("div",{className:"puzzle-controls",children:[e.jsxs("select",{value:u,onChange:_=>r(_.target.value),className:"control-btn",children:[e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]}),e.jsx("button",{onClick:f,disabled:i||s.length===0&&!o.trim(),className:"control-btn generate-btn",children:i?"Generating...":"Generate Puzzle"}),e.jsx("button",{onClick:S,className:"control-btn reset-btn",children:"Reset"}),d&&!t&&e.jsx("button",{onClick:A,className:"control-btn reveal-btn",children:"Reveal Solution"})]}),m&&e.jsxs("div",{className:"error-message",children:["Error: ",m]}),i&&e.jsx(H,{}),d&&!i&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"tab-nav",children:[e.jsx("button",{className:`tab-btn ${j==="puzzle"?"active":""}`,onClick:()=>y("puzzle"),children:"Puzzle"}),d.debug&&e.jsx("button",{className:`tab-btn ${j==="debug"?"active":""}`,onClick:()=>y("debug"),children:"Debug"})]}),j==="puzzle"&&e.jsxs("div",{className:"puzzle-layout",children:[e.jsx(U,{grid:d.grid,clues:d.clues,showSolution:t}),e.jsx(q,{clues:d.clues})]}),j==="debug"&&d.debug&&e.jsx(Y,{debugData:d.debug})]}),!d&&!i&&!m&&e.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#7f8c8d"},children:'Select topics and click "Generate Puzzle" to start!'})]})}T.createRoot(document.getElementById("root")).render(e.jsx($.StrictMode,{children:e.jsx(V,{})}));
|
10 |
+
//# sourceMappingURL=index-Dqo17R2W.js.map
|
crossword-app/backend-py/public/assets/index-Dqo17R2W.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"index-Dqo17R2W.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/react-dom/client.js","../../src/components/TopicSelector.jsx","../../src/components/PuzzleGrid.jsx","../../src/components/ClueList.jsx","../../src/components/DebugTab.jsx","../../src/components/LoadingSpinner.jsx","../../src/hooks/useCrossword.js","../../src/App.jsx","../../src/main.jsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","import React from 'react';\n\nconst TopicSelector = ({ \n onTopicsChange, \n availableTopics = [], \n selectedTopics = [],\n customSentence = '',\n onSentenceChange,\n multiTheme = true,\n onMultiThemeChange\n}) => {\n const handleTopicToggle = (topic) => {\n const newSelectedTopics = selectedTopics.includes(topic)\n ? selectedTopics.filter(t => t !== topic)\n : [...selectedTopics, topic];\n \n onTopicsChange(newSelectedTopics);\n };\n\n return (\n <div className=\"topic-selector\">\n <h3>Select Topics</h3>\n <div className=\"topic-buttons\">\n {availableTopics.map(topic => (\n <button\n key={topic.id}\n className={`topic-btn ${selectedTopics.includes(topic.name) ? 'selected' : ''}`}\n onClick={() => handleTopicToggle(topic.name)}\n >\n {topic.name}\n </button>\n ))}\n </div>\n \n <div className=\"sentence-input-container\">\n <label htmlFor=\"custom-sentence\" className=\"sentence-label\">\n Custom Sentence (optional)\n </label>\n <textarea\n id=\"custom-sentence\"\n className=\"sentence-input\"\n value={customSentence}\n onChange={(e) => onSentenceChange && onSentenceChange(e.target.value)}\n placeholder=\"Enter a sentence to influence word selection...\"\n rows=\"3\"\n maxLength=\"200\"\n />\n <div className=\"sentence-info\">\n <span className=\"char-count\">{customSentence.length}/200 characters</span>\n {customSentence && (\n <button \n type=\"button\"\n className=\"clear-sentence-btn\"\n onClick={() => onSentenceChange && onSentenceChange('')}\n title=\"Clear sentence\"\n >\n Clear\n </button>\n )}\n </div>\n </div>\n \n <div className=\"multi-theme-toggle-container\">\n <label className=\"multi-theme-toggle\">\n <input\n type=\"checkbox\"\n checked={multiTheme}\n onChange={(e) => onMultiThemeChange && onMultiThemeChange(e.target.checked)}\n className=\"multi-theme-checkbox\"\n />\n <span className=\"multi-theme-label\">\n 🎯 Use Multi-Theme Processing\n </span>\n </label>\n <p className=\"multi-theme-description\">\n {multiTheme \n ? \"AI will process each theme separately and balance results\" \n : \"AI will blend all themes into a single concept\"\n }\n </p>\n </div>\n \n <p className=\"selected-count\">\n {selectedTopics.length} topic{selectedTopics.length !== 1 ? 's' : ''} selected\n </p>\n </div>\n );\n};\n\nexport default TopicSelector;","import React, { useState, useEffect } from 'react';\n\nconst PuzzleGrid = ({ grid, clues, showSolution, onCellChange }) => {\n const [userAnswers, setUserAnswers] = useState({});\n\n useEffect(() => {\n setUserAnswers({});\n }, [grid]);\n\n const handleCellInput = (row, col, value) => {\n const key = `${row}-${col}`;\n const newAnswers = { ...userAnswers, [key]: value.toUpperCase() };\n setUserAnswers(newAnswers);\n onCellChange && onCellChange(row, col, value);\n };\n\n const getCellValue = (row, col) => {\n if (showSolution && !isBlackCell(row, col)) {\n return grid[row][col];\n }\n const key = `${row}-${col}`;\n return userAnswers[key] || '';\n };\n\n const isBlackCell = (row, col) => {\n return grid[row][col] === '.';\n };\n\n const getCellNumber = (row, col) => {\n if (!clues) return null;\n const clue = clues.find(c => c.position.row === row && c.position.col === col);\n return clue ? clue.number : null;\n };\n\n if (!grid || grid.length === 0) {\n return <div className=\"puzzle-grid\">No puzzle loaded</div>;\n }\n\n const gridRows = grid.length;\n const gridCols = grid[0] ? grid[0].length : 0;\n\n return (\n <div className=\"puzzle-container\">\n <div \n className=\"puzzle-grid\"\n style={{\n gridTemplateColumns: `repeat(${gridCols}, 35px)`,\n gridTemplateRows: `repeat(${gridRows}, 35px)`\n }}\n >\n {grid.map((row, rowIndex) =>\n row.map((cell, colIndex) => {\n const cellNumber = getCellNumber(rowIndex, colIndex);\n const isBlack = isBlackCell(rowIndex, colIndex);\n \n // Only render cells that contain letters (not black/unused cells)\n if (isBlack) {\n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell empty-cell\"\n style={{ visibility: 'hidden' }}\n >\n </div>\n );\n }\n \n return (\n <div\n key={`${rowIndex}-${colIndex}`}\n className=\"grid-cell white-cell\"\n >\n {cellNumber && <span className=\"cell-number\">{cellNumber}</span>}\n <input\n type=\"text\"\n maxLength=\"1\"\n value={getCellValue(rowIndex, colIndex)}\n onChange={(e) => handleCellInput(rowIndex, colIndex, e.target.value)}\n className={`cell-input ${showSolution ? 'solution-text' : ''}`}\n disabled={showSolution}\n />\n </div>\n );\n })\n )}\n </div>\n </div>\n );\n};\n\nexport default PuzzleGrid;","import React from 'react';\n\nconst ClueList = ({ clues = [] }) => {\n const acrossClues = clues.filter(clue => clue.direction === 'across');\n const downClues = clues.filter(clue => clue.direction === 'down');\n\n const ClueSection = ({ title, clueList }) => (\n <div className=\"clue-section\">\n <h4>{title}</h4>\n <ol>\n {clueList.map(clue => (\n <li key={`${clue.number}-${clue.direction}`} className=\"clue-item\">\n <span className=\"clue-number\">{clue.number}</span>\n <span className=\"clue-text\">{clue.text}</span>\n </li>\n ))}\n </ol>\n </div>\n );\n\n return (\n <div className=\"clue-list\">\n <ClueSection title=\"Across\" clueList={acrossClues} />\n <ClueSection title=\"Down\" clueList={downClues} />\n </div>\n );\n};\n\nexport default ClueList;","import React, { useState } from 'react';\n\nconst DebugTab = ({ debugData }) => {\n const [activeSection, setActiveSection] = useState('overview');\n const [sortBy, setSortBy] = useState('similarity');\n const [sortDirection, setSortDirection] = useState('desc');\n\n if (!debugData || !debugData.enabled) {\n return (\n <div className=\"debug-tab\">\n <p>Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend.</p>\n </div>\n );\n }\n\n const sections = [\n { id: 'overview', label: 'Overview' },\n { id: 'thematic-pool', label: 'Thematic Pool' },\n { id: 'candidates', label: 'Candidates' },\n { id: 'selection', label: 'Selection' },\n { id: 'selected', label: 'Selected Words' }\n ];\n\n const renderOverview = () => (\n <div className=\"debug-section\">\n <h3>Generation Parameters</h3>\n <div className=\"debug-grid\">\n <div><strong>Topics:</strong> {debugData.generation_params.topics.join(', ')}</div>\n <div><strong>Difficulty:</strong> {debugData.generation_params.difficulty}</div>\n <div><strong>Requested Words:</strong> {debugData.generation_params.requested_words}</div>\n <div><strong>Thematic Pool Size:</strong> {debugData.generation_params.thematic_pool_size}</div>\n <div><strong>Min Similarity:</strong> {debugData.generation_params.min_similarity}</div>\n <div><strong>Multi-theme:</strong> {debugData.generation_params.multi_theme ? 'Yes' : 'No'}</div>\n {debugData.generation_params.custom_sentence && (\n <div><strong>Custom Sentence:</strong> \"{debugData.generation_params.custom_sentence}\"</div>\n )}\n </div>\n\n <h3>Selection Algorithm</h3>\n <div className=\"debug-grid\">\n <div><strong>Method:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature}</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight}</div>\n <div><strong>Use Softmax:</strong> {debugData.selection_params.use_softmax_selection ? 'Yes' : 'No'}</div>\n </div>\n\n <h3>Results Summary</h3>\n <div className=\"debug-grid\">\n <div><strong>Thematic Pool:</strong> {debugData.thematic_pool?.length || 0} words</div>\n <div><strong>Candidates:</strong> {debugData.candidate_words?.length || 0} words</div>\n <div><strong>Selected:</strong> {debugData.selected_words?.length || 0} words</div>\n </div>\n </div>\n );\n\n const renderWordTable = (words, showClue = false) => (\n <div className=\"word-table-container\">\n <table className=\"word-table\">\n <thead>\n <tr>\n <th>Word</th>\n <th>Similarity</th>\n <th>Percentile</th>\n <th>Tier</th>\n {showClue && <th>Clue</th>}\n </tr>\n </thead>\n <tbody>\n {words.map((word, idx) => (\n <tr key={idx}>\n <td><strong>{word.word}</strong></td>\n <td>{word.similarity.toFixed(3)}</td>\n <td>{word.percentile.toFixed(3)}</td>\n <td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>\n {showClue && <td>{word.clue}</td>}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n\n const handleSort = (column) => {\n if (sortBy === column) {\n setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');\n } else {\n setSortBy(column);\n setSortDirection(column === 'word' ? 'asc' : 'desc');\n }\n };\n\n const getSortIcon = (column) => {\n if (sortBy !== column) return ' ↕️';\n return sortDirection === 'asc' ? ' ▲' : ' ▼';\n };\n\n const renderSortableThematicPool = () => {\n const pool = debugData.thematic_pool || [];\n \n const sortedPool = [...pool].sort((a, b) => {\n let aVal, bVal;\n \n switch (sortBy) {\n case 'word':\n aVal = a.word.toLowerCase();\n bVal = b.word.toLowerCase();\n break;\n case 'similarity':\n aVal = a.similarity;\n bVal = b.similarity;\n break;\n case 'percentile':\n aVal = a.percentile;\n bVal = b.percentile;\n break;\n default:\n aVal = a.similarity;\n bVal = b.similarity;\n }\n \n if (sortDirection === 'asc') {\n return aVal < bVal ? -1 : aVal > bVal ? 1 : 0;\n } else {\n return aVal > bVal ? -1 : aVal < bVal ? 1 : 0;\n }\n });\n \n return (\n <div className=\"word-table-container\">\n <table className=\"word-table\">\n <thead>\n <tr>\n <th \n onClick={() => handleSort('word')} \n style={{ cursor: 'pointer', userSelect: 'none' }}\n className={sortBy === 'word' ? 'sorted-column' : ''}\n >\n Word{getSortIcon('word')}\n </th>\n <th \n onClick={() => handleSort('similarity')} \n style={{ cursor: 'pointer', userSelect: 'none' }}\n className={sortBy === 'similarity' ? 'sorted-column' : ''}\n >\n Similarity{getSortIcon('similarity')}\n </th>\n <th \n onClick={() => handleSort('percentile')} \n style={{ cursor: 'pointer', userSelect: 'none' }}\n className={sortBy === 'percentile' ? 'sorted-column' : ''}\n >\n Percentile{getSortIcon('percentile')}\n </th>\n <th>Tier</th>\n </tr>\n </thead>\n <tbody>\n {sortedPool.map((word, idx) => (\n <tr key={idx}>\n <td><strong>{word.word}</strong></td>\n <td>{word.similarity.toFixed(3)}</td>\n <td>{word.percentile.toFixed(3)}</td>\n <td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n };\n\n const renderThematicPool = () => {\n const pool = debugData.thematic_pool || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Thematic Pool ({pool.length} words)</h3>\n <p>All words generated thematically. Click column headers to sort.</p>\n {renderSortableThematicPool()}\n </div>\n );\n };\n\n const renderCandidates = () => {\n const candidates = debugData.candidate_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Candidate Words ({candidates.length} words)</h3>\n <p>Words that passed filtering and got clues generated.</p>\n {renderWordTable(candidates, true)}\n </div>\n );\n };\n\n const renderSelection = () => (\n <div className=\"debug-section\">\n <h3>Selection Process</h3>\n <div className=\"debug-grid\">\n <div><strong>Algorithm:</strong> {debugData.selection_method}</div>\n <div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature} (lower = more deterministic)</div>\n <div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight} (balance between similarity and frequency)</div>\n </div>\n \n <h4>How it works:</h4>\n <ul>\n <li><strong>Composite Score</strong> = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment</li>\n <li><strong>Frequency Alignment</strong>: Gaussian distribution favoring target percentiles by difficulty</li>\n <li><strong>Softmax Selection</strong>: Probabilistic selection based on composite scores with temperature control</li>\n </ul>\n\n <h4>Difficulty Targets:</h4>\n <ul>\n <li><strong>Easy:</strong> 90th percentile (common words like CAT, DOG)</li>\n <li><strong>Medium:</strong> 50th percentile (balanced selection)</li>\n <li><strong>Hard:</strong> 20th percentile (rare words like QUETZAL, PLATYPUS)</li>\n </ul>\n </div>\n );\n\n const renderSelected = () => {\n const selected = debugData.selected_words || [];\n \n return (\n <div className=\"debug-section\">\n <h3>Selected Words ({selected.length} words)</h3>\n <p>Final words chosen for crossword generation.</p>\n {renderWordTable(selected, true)}\n </div>\n );\n };\n\n const renderSection = () => {\n switch (activeSection) {\n case 'overview': return renderOverview();\n case 'thematic-pool': return renderThematicPool();\n case 'candidates': return renderCandidates();\n case 'selection': return renderSelection();\n case 'selected': return renderSelected();\n default: return renderOverview();\n }\n };\n\n return (\n <div className=\"debug-tab\">\n <div className=\"debug-nav\">\n {sections.map(section => (\n <button\n key={section.id}\n className={`debug-nav-btn ${activeSection === section.id ? 'active' : ''}`}\n onClick={() => setActiveSection(section.id)}\n >\n {section.label}\n </button>\n ))}\n </div>\n \n <div className=\"debug-content\">\n {renderSection()}\n </div>\n </div>\n );\n};\n\nexport default DebugTab;","import React from 'react';\n\nconst LoadingSpinner = ({ message = \"Generating puzzle...\" }) => {\n return (\n <div className=\"loading-spinner\">\n <div className=\"spinner\"></div>\n <p className=\"loading-message\">{message}</p>\n </div>\n );\n};\n\nexport default LoadingSpinner;","import { useState, useCallback } from 'react';\n\nconst useCrossword = () => {\n const [puzzle, setPuzzle] = useState(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(null);\n const [topics, setTopics] = useState([]);\n\n const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || (import.meta.env.PROD ? '' : 'http://localhost:3000');\n\n const fetchTopics = useCallback(async () => {\n try {\n setLoading(true);\n const response = await fetch(`${API_BASE_URL}/api/topics`);\n if (!response.ok) throw new Error('Failed to fetch topics');\n const data = await response.json();\n setTopics(data);\n } catch (err) {\n setError(err.message);\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const generatePuzzle = useCallback(async (selectedTopics, difficulty = 'medium', useAI = false, customSentence = '', multiTheme = true) => {\n try {\n setLoading(true);\n setError(null);\n \n const response = await fetch(`${API_BASE_URL}/api/generate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n topics: selectedTopics,\n difficulty,\n useAI,\n ...(customSentence && { customSentence }),\n multiTheme\n })\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new Error(errorData.message || 'Failed to generate puzzle');\n }\n \n const puzzleData = await response.json();\n setPuzzle(puzzleData);\n return puzzleData;\n } catch (err) {\n setError(err.message);\n return null;\n } finally {\n setLoading(false);\n }\n }, [API_BASE_URL]);\n\n const validateAnswers = useCallback(async (userAnswers) => {\n try {\n const response = await fetch(`${API_BASE_URL}/api/validate`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n puzzle: puzzle,\n answers: userAnswers\n })\n });\n\n if (!response.ok) throw new Error('Failed to validate answers');\n \n return await response.json();\n } catch (err) {\n setError(err.message);\n return null;\n }\n }, [API_BASE_URL, puzzle]);\n\n const resetPuzzle = useCallback(() => {\n setPuzzle(null);\n setError(null);\n }, []);\n\n return {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n validateAnswers,\n resetPuzzle\n };\n};\n\nexport default useCrossword;","import React, { useState, useEffect } from 'react';\nimport TopicSelector from './components/TopicSelector';\nimport PuzzleGrid from './components/PuzzleGrid';\nimport ClueList from './components/ClueList';\nimport DebugTab from './components/DebugTab';\nimport LoadingSpinner from './components/LoadingSpinner';\nimport useCrossword from './hooks/useCrossword';\nimport './styles/puzzle.css';\n\nfunction App() {\n const [selectedTopics, setSelectedTopics] = useState([]);\n const [difficulty, setDifficulty] = useState('medium');\n const [showSolution, setShowSolution] = useState(false);\n const [customSentence, setCustomSentence] = useState('');\n const [multiTheme, setMultiTheme] = useState(true);\n const [activeTab, setActiveTab] = useState('puzzle');\n \n const {\n puzzle,\n loading,\n error,\n topics,\n fetchTopics,\n generatePuzzle,\n resetPuzzle\n } = useCrossword();\n\n useEffect(() => {\n fetchTopics();\n }, [fetchTopics]);\n\n const handleGeneratePuzzle = async () => {\n if (selectedTopics.length === 0 && !customSentence.trim()) {\n alert('Please select at least one topic or provide a custom sentence');\n return;\n }\n \n setShowSolution(false);\n await generatePuzzle(selectedTopics, difficulty, false, customSentence, multiTheme);\n };\n\n const handleTopicsChange = (topics) => {\n setSelectedTopics(topics);\n };\n\n const handleSentenceChange = (sentence) => {\n setCustomSentence(sentence);\n };\n\n const handleMultiThemeChange = (enabled) => {\n setMultiTheme(enabled);\n };\n\n\n const handleReset = () => {\n resetPuzzle();\n setSelectedTopics([]);\n setShowSolution(false);\n setDifficulty('medium');\n setCustomSentence('');\n setMultiTheme(true);\n setActiveTab('puzzle');\n };\n\n const handleRevealSolution = () => {\n setShowSolution(true);\n };\n\n return (\n <div className=\"crossword-app\">\n <header className=\"app-header\">\n <h1 className=\"app-title\">Crossword Puzzle Generator</h1>\n <p>Select topics and generate your custom crossword puzzle!</p>\n </header>\n\n <TopicSelector \n onTopicsChange={handleTopicsChange}\n availableTopics={topics}\n selectedTopics={selectedTopics}\n customSentence={customSentence}\n onSentenceChange={handleSentenceChange}\n multiTheme={multiTheme}\n onMultiThemeChange={handleMultiThemeChange}\n />\n\n <div className=\"puzzle-controls\">\n <select \n value={difficulty} \n onChange={(e) => setDifficulty(e.target.value)}\n className=\"control-btn\"\n >\n <option value=\"easy\">Easy</option>\n <option value=\"medium\">Medium</option>\n <option value=\"hard\">Hard</option>\n </select>\n \n <button\n onClick={handleGeneratePuzzle}\n disabled={loading || (selectedTopics.length === 0 && !customSentence.trim())}\n className=\"control-btn generate-btn\"\n >\n {loading ? 'Generating...' : 'Generate Puzzle'}\n </button>\n \n <button\n onClick={handleReset}\n className=\"control-btn reset-btn\"\n >\n Reset\n </button>\n \n {puzzle && !showSolution && (\n <button\n onClick={handleRevealSolution}\n className=\"control-btn reveal-btn\"\n >\n Reveal Solution\n </button>\n )}\n </div>\n\n {error && (\n <div className=\"error-message\">\n Error: {error}\n </div>\n )}\n\n {loading && <LoadingSpinner />}\n\n {puzzle && !loading && (\n <>\n {/* Tab Navigation */}\n <div className=\"tab-nav\">\n <button\n className={`tab-btn ${activeTab === 'puzzle' ? 'active' : ''}`}\n onClick={() => setActiveTab('puzzle')}\n >\n Puzzle\n </button>\n {puzzle.debug && (\n <button\n className={`tab-btn ${activeTab === 'debug' ? 'active' : ''}`}\n onClick={() => setActiveTab('debug')}\n >\n Debug\n </button>\n )}\n </div>\n\n {/* Tab Content */}\n {activeTab === 'puzzle' && (\n <div className=\"puzzle-layout\">\n <PuzzleGrid \n grid={puzzle.grid} \n clues={puzzle.clues}\n showSolution={showSolution}\n />\n <ClueList clues={puzzle.clues} />\n </div>\n )}\n\n {activeTab === 'debug' && puzzle.debug && (\n <DebugTab debugData={puzzle.debug} />\n )}\n </>\n )}\n\n {!puzzle && !loading && !error && (\n <div style={{ textAlign: 'center', padding: '40px', color: '#7f8c8d' }}>\n Select topics and click \"Generate Puzzle\" to start!\n </div>\n )}\n </div>\n );\n}\n\nexport default App;","import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n)"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","jsxRuntimeModule","client","TopicSelector","onTopicsChange","availableTopics","selectedTopics","customSentence","onSentenceChange","multiTheme","onMultiThemeChange","handleTopicToggle","topic","newSelectedTopics","t","jsxs","jsx","PuzzleGrid","grid","clues","showSolution","onCellChange","userAnswers","setUserAnswers","useState","useEffect","handleCellInput","row","col","value","key","newAnswers","getCellValue","isBlackCell","getCellNumber","clue","gridRows","gridCols","rowIndex","cell","colIndex","cellNumber","ClueList","acrossClues","downClues","ClueSection","title","clueList","DebugTab","debugData","activeSection","setActiveSection","sortBy","setSortBy","sortDirection","setSortDirection","sections","renderOverview","_a","_b","_c","renderWordTable","words","showClue","word","idx","handleSort","column","getSortIcon","renderSortableThematicPool","sortedPool","aVal","bVal","renderThematicPool","pool","renderCandidates","candidates","renderSelection","renderSelected","selected","renderSection","section","LoadingSpinner","message","useCrossword","puzzle","setPuzzle","loading","setLoading","error","setError","topics","setTopics","API_BASE_URL","fetchTopics","useCallback","response","data","err","generatePuzzle","difficulty","useAI","errorData","puzzleData","validateAnswers","resetPuzzle","App","setSelectedTopics","setDifficulty","setShowSolution","setCustomSentence","setMultiTheme","activeTab","setActiveTab","handleGeneratePuzzle","handleTopicsChange","handleSentenceChange","sentence","handleMultiThemeChange","enabled","handleReset","handleRevealSolution","Fragment","ReactDOM","React"],"mappings":";;;;;;;;GASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,EAAEL,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,aAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAIC,EAAE,MAAMF,EAAE,OAAOP,EAAE,OAAO,CAAC,YAAkBF,EAAEY,EAAA,IAAYR,EAAEQ,EAAA,KAAaR,ECPxWS,EAAA,QAAiBf,uBCDfG,EAAIH,EAENgB,EAAA,WAAqBb,EAAE,WACvBa,EAAA,YAAsBb,EAAE,YCH1B,MAAMc,EAAgB,CAAC,CACrB,eAAAC,EACA,gBAAAC,EAAkB,CAAA,EAClB,eAAAC,EAAiB,CAAA,EACjB,eAAAC,EAAiB,GACjB,iBAAAC,EACA,WAAAC,EAAa,GACb,mBAAAC,CACF,IAAM,C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/backend-py/public/assets/index-Du5pYm00.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.crossword-app{max-width:1200px;margin:0 auto;padding:20px;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}.app-header{text-align:center;margin-bottom:30px}.app-title{color:#2c3e50;font-size:2.5rem;margin-bottom:10px}.topic-selector{background:#f8f9fa;padding:20px;border-radius:8px;margin-bottom:20px}.topic-selector h3{margin-top:0;color:#2c3e50}.topic-buttons{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:15px}.topic-btn{padding:8px 16px;border:2px solid #3498db;background:#fff;color:#3498db;border-radius:20px;cursor:pointer;transition:all .3s ease;font-weight:500}.topic-btn:hover,.topic-btn.selected{background:#3498db;color:#fff}.selected-count{color:#7f8c8d;font-size:.9rem;margin:0}.sentence-input-container{margin-top:20px;margin-bottom:15px}.sentence-label{display:block;margin-bottom:8px;color:#2c3e50;font-weight:500;font-size:.95rem}.sentence-input{width:100%;padding:12px;border:2px solid #e1e8ed;border-radius:8px;font-family:inherit;font-size:.9rem;line-height:1.4;resize:vertical;min-height:80px;background:#fff;transition:border-color .3s ease,box-shadow .3s ease;box-sizing:border-box}.sentence-input:focus{outline:none;border-color:#3498db;box-shadow:0 0 0 3px #3498db1a}.sentence-input::placeholder{color:#95a5a6;font-style:italic}.sentence-info{display:flex;justify-content:space-between;align-items:center;margin-top:6px;font-size:.8rem}.char-count{color:#7f8c8d}.clear-sentence-btn{background:#e74c3c;color:#fff;border:none;padding:4px 8px;border-radius:4px;cursor:pointer;font-size:.75rem;transition:background-color .2s ease}.clear-sentence-btn:hover{background:#c0392b}.clear-sentence-btn:active{background:#a93226}.multi-theme-toggle-container{margin-top:20px;margin-bottom:15px;padding:15px;background:#f0f4f8;border:1px solid #e1e8ed;border-radius:8px}.multi-theme-toggle{display:flex;align-items:center;cursor:pointer;margin-bottom:8px}.multi-theme-checkbox{width:18px;height:18px;margin-right:10px;cursor:pointer;accent-color:#3498db}.multi-theme-label{font-weight:500;color:#2c3e50;font-size:.95rem;-webkit-user-select:none;user-select:none}.multi-theme-description{margin:0;font-size:.85rem;color:#5a6c7d;line-height:1.4;font-style:italic;padding-left:28px}.ai-toggle-container{margin:20px 0;padding:15px;background:#f8f9fa;border-radius:8px;border:2px solid #e9ecef;transition:all .3s ease}.ai-toggle-container:has(.ai-checkbox:checked){background:linear-gradient(135deg,#e3f2fd,#f3e5f5);border-color:#3498db}.ai-toggle{display:flex;align-items:center;cursor:pointer;font-weight:500;margin-bottom:8px}.ai-checkbox{width:20px;height:20px;margin-right:12px;cursor:pointer;accent-color:#3498db}.ai-label{font-size:1rem;color:#2c3e50;-webkit-user-select:none;user-select:none}.ai-status{color:#27ae60;font-weight:600;font-size:.9rem}.ai-description{margin:0;font-size:.85rem;color:#6c757d;line-height:1.4;padding-left:32px}.puzzle-controls{display:flex;gap:15px;margin-bottom:20px;justify-content:center}.control-btn{padding:10px 20px;border:none;border-radius:5px;cursor:pointer;font-weight:600;transition:background-color .3s ease}.control-btn:disabled{background:#bdc3c7!important;color:#7f8c8d!important;cursor:not-allowed;opacity:.7}.generate-btn{background:#27ae60;color:#fff}.generate-btn:hover{background:#229954}.generate-btn:disabled{background:#bdc3c7;cursor:not-allowed}.reset-btn{background:#e74c3c;color:#fff}.reset-btn:hover{background:#c0392b}.reveal-btn{background:#f39c12;color:#fff}.reveal-btn:hover{background:#e67e22}.loading-spinner{display:flex;flex-direction:column;align-items:center;padding:40px}.spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #3498db;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:15px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-message{color:#7f8c8d;font-size:1.1rem}.puzzle-info{display:flex;justify-content:space-between;align-items:center;margin:20px 0 10px;padding:10px 15px;background:#f8f9fa;border-radius:6px;border-left:4px solid #3498db}.puzzle-stats{font-size:.9rem;color:#6c757d;font-weight:500}.ai-generated-badge{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;padding:4px 12px;border-radius:15px;font-size:.8rem;font-weight:600;text-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 2px 4px #0000001a}.puzzle-layout{display:grid;grid-template-columns:1fr 300px;gap:30px;margin-top:20px}@media (max-width: 768px){.puzzle-layout{grid-template-columns:1fr;gap:20px}.puzzle-info{flex-direction:column;gap:8px;text-align:center}.ai-toggle-container{padding:12px}.ai-description{padding-left:0;text-align:center}}.puzzle-container{display:flex;justify-content:center}.puzzle-grid{display:grid;gap:0;margin:0 auto;width:fit-content;height:fit-content}.grid-cell{width:35px;height:35px;position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;background:#fff}.grid-cell:before{content:"";position:absolute;top:0;left:0;right:-1px;bottom:-1px;border:1px solid #2c3e50;pointer-events:none;z-index:10}.black-cell{background:#f0f0f0}.black-cell:before{background:#f0f0f0;border:1px solid #2c3e50}.white-cell{background:#fff}.empty-cell{background:transparent;border:none;visibility:hidden}.empty-cell:before{display:none}.cell-input{width:100%;height:100%;border:none!important;text-align:center;font-size:16px;font-weight:700;background:transparent;outline:none;text-transform:uppercase;position:relative;z-index:5}.cell-input:focus{background:#e8f4fd;box-shadow:inset 0 0 0 2px #3498db}.cell-number{position:absolute;top:1px;left:2px;font-size:10px;font-weight:700;color:#2c3e50;line-height:1;z-index:15;pointer-events:none}.solution-text{color:#2c3e50!important;font-weight:700!important;background:#fff!important}.solution-text:disabled{opacity:1!important;cursor:default}.grid-cell .solution-text{border:none!important;background:#fff!important}.clue-list{background:#f8f9fa;padding:20px;border-radius:8px;max-height:600px;overflow-y:auto}.clue-section{margin-bottom:25px}.clue-section h4{color:#2c3e50;margin-bottom:15px;font-size:1.2rem;border-bottom:2px solid #3498db;padding-bottom:5px}.clue-section ol{padding-left:0;list-style:none}.clue-item{display:flex;margin-bottom:8px;padding:8px;border-radius:4px;cursor:pointer;transition:background-color .2s ease}.clue-item:hover{background:#e9ecef}.clue-number{font-weight:700;color:#3498db;margin-right:10px;min-width:25px}.clue-text{flex:1;color:#2c3e50}.error-message{background:#f8d7da;color:#721c24;padding:15px;border-radius:5px;margin:20px 0;border:1px solid #f5c6cb}.success-message{background:#d4edda;color:#155724;padding:15px;border-radius:5px;margin:20px 0;border:1px solid #c3e6cb;text-align:center;font-weight:600}.tab-nav{display:flex;border-bottom:2px solid #e9ecef;margin-bottom:20px;gap:2px}.tab-btn{padding:12px 20px;border:none;background:#f8f9fa;color:#6c757d;cursor:pointer;border-radius:8px 8px 0 0;font-weight:500;transition:all .3s ease}.tab-btn:hover{background:#e9ecef;color:#495057}.tab-btn.active{background:#3498db;color:#fff}.debug-tab{background:#f8f9fa;border-radius:8px;padding:20px;margin-top:20px}.debug-nav{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;border-bottom:2px solid #e9ecef;padding-bottom:15px}.debug-nav-btn{padding:8px 16px;border:1px solid #dee2e6;background:#fff;color:#495057;border-radius:20px;cursor:pointer;font-size:.9rem;font-weight:500;transition:all .3s ease}.debug-nav-btn:hover{background:#e9ecef;border-color:#adb5bd}.debug-nav-btn.active{background:#3498db;color:#fff;border-color:#3498db}.debug-content{min-height:300px}.debug-section h3{color:#2c3e50;margin-bottom:15px;border-bottom:1px solid #dee2e6;padding-bottom:8px}.debug-section h4{color:#495057;margin-top:20px;margin-bottom:10px}.debug-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px;margin-bottom:20px}.debug-grid>div{padding:8px 12px;background:#fff;border-radius:4px;border:1px solid #e9ecef;font-size:.9rem}.debug-grid strong{color:#2c3e50}.word-table-container{max-height:400px;overflow-y:auto;border:1px solid #dee2e6;border-radius:6px;background:#fff}.word-table{width:100%;border-collapse:collapse;font-size:.85rem}.word-table th{background:#f8f9fa;padding:8px 12px;text-align:left;border-bottom:2px solid #dee2e6;font-weight:600;color:#495057;position:sticky;top:0;z-index:1}.word-table td{padding:6px 12px;border-bottom:1px solid #f1f3f4}.word-table tr:hover{background-color:#f8f9fa}.word-table td:first-child{font-weight:600;color:#2c3e50}.debug-section ul{margin:10px 0;padding-left:20px}.debug-section li{margin:5px 0;font-size:.9rem;line-height:1.4}@media (max-width: 768px){.debug-nav{justify-content:center}.debug-nav-btn{font-size:.8rem;padding:6px 12px}.debug-grid{grid-template-columns:1fr}.word-table{font-size:.75rem}.word-table th,.word-table td{padding:4px 8px}}
|
crossword-app/backend-py/public/index.html
CHANGED
@@ -6,9 +6,9 @@
|
|
6 |
<meta name="description" content="Generate custom crossword puzzles by selecting topics" />
|
7 |
<meta name="keywords" content="crossword, puzzle, word game, brain teaser" />
|
8 |
<title>Crossword Puzzle Generator</title>
|
9 |
-
<script type="module" crossorigin src="/assets/index-
|
10 |
<link rel="modulepreload" crossorigin href="/assets/vendor-nf7bT_Uh.js">
|
11 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
12 |
</head>
|
13 |
<body>
|
14 |
<div id="root"></div>
|
|
|
6 |
<meta name="description" content="Generate custom crossword puzzles by selecting topics" />
|
7 |
<meta name="keywords" content="crossword, puzzle, word game, brain teaser" />
|
8 |
<title>Crossword Puzzle Generator</title>
|
9 |
+
<script type="module" crossorigin src="/assets/index-Dqo17R2W.js"></script>
|
10 |
<link rel="modulepreload" crossorigin href="/assets/vendor-nf7bT_Uh.js">
|
11 |
+
<link rel="stylesheet" crossorigin href="/assets/index-C8ibg3Hv.css">
|
12 |
</head>
|
13 |
<body>
|
14 |
<div id="root"></div>
|
crossword-app/backend-py/src/routes/api.py
CHANGED
@@ -48,6 +48,7 @@ class PuzzleResponse(BaseModel):
|
|
48 |
grid: List[List[str]]
|
49 |
clues: List[ClueInfo]
|
50 |
metadata: PuzzleMetadata
|
|
|
51 |
|
52 |
class TopicInfo(BaseModel):
|
53 |
id: str
|
@@ -288,9 +289,10 @@ async def debug_thematic_search(
|
|
288 |
if not thematic_service or not thematic_service.is_initialized:
|
289 |
raise HTTPException(status_code=503, detail="Thematic service not available")
|
290 |
|
291 |
-
|
|
|
292 |
|
293 |
-
|
294 |
"topic": topic,
|
295 |
"difficulty": difficulty,
|
296 |
"max_words": max_words,
|
@@ -298,6 +300,12 @@ async def debug_thematic_search(
|
|
298 |
"words": words
|
299 |
}
|
300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
except Exception as e:
|
302 |
logger.error(f"❌ Thematic search debug failed: {e}")
|
303 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
48 |
grid: List[List[str]]
|
49 |
clues: List[ClueInfo]
|
50 |
metadata: PuzzleMetadata
|
51 |
+
debug: Optional[Dict[str, Any]] = None
|
52 |
|
53 |
class TopicInfo(BaseModel):
|
54 |
id: str
|
|
|
289 |
if not thematic_service or not thematic_service.is_initialized:
|
290 |
raise HTTPException(status_code=503, detail="Thematic service not available")
|
291 |
|
292 |
+
result = await thematic_service.find_words_for_crossword([topic], difficulty, max_words)
|
293 |
+
words = result["words"]
|
294 |
|
295 |
+
response = {
|
296 |
"topic": topic,
|
297 |
"difficulty": difficulty,
|
298 |
"max_words": max_words,
|
|
|
300 |
"words": words
|
301 |
}
|
302 |
|
303 |
+
# Include debug data if available
|
304 |
+
if "debug" in result:
|
305 |
+
response["debug"] = result["debug"]
|
306 |
+
|
307 |
+
return response
|
308 |
+
|
309 |
except Exception as e:
|
310 |
logger.error(f"❌ Thematic search debug failed: {e}")
|
311 |
raise HTTPException(status_code=500, detail=str(e))
|
crossword-app/backend-py/src/services/crossword_generator.py
CHANGED
@@ -27,7 +27,7 @@ class CrosswordGenerator:
|
|
27 |
logger.info(f"🎯 Generating puzzle for topics: {topics}, difficulty: {difficulty}{sentence_info}, requested words: {requested_words}")
|
28 |
|
29 |
# Get words from thematic AI service
|
30 |
-
words = await self._select_words(topics, difficulty, custom_sentence, multi_theme, requested_words)
|
31 |
|
32 |
if len(words) < self.min_words:
|
33 |
logger.error(f"❌ Not enough words: {len(words)} < {self.min_words}")
|
@@ -42,7 +42,8 @@ class CrosswordGenerator:
|
|
42 |
|
43 |
logger.info(f"✅ Generated crossword with {len(grid_result['placed_words'])} words")
|
44 |
|
45 |
-
|
|
|
46 |
"grid": grid_result["grid"],
|
47 |
"clues": grid_result["clues"],
|
48 |
"metadata": {
|
@@ -54,25 +55,40 @@ class CrosswordGenerator:
|
|
54 |
}
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
except Exception as e:
|
58 |
logger.error(f"❌ Error generating puzzle: {e}")
|
59 |
raise
|
60 |
|
61 |
-
async def _select_words(self, topics: List[str], difficulty: str, custom_sentence: str = None, multi_theme: bool = True, requested_words: int = 10) -> List[Dict[str, Any]]:
|
62 |
-
"""Select words for the crossword using thematic AI service.
|
|
|
|
|
|
|
|
|
63 |
if not self.thematic_service:
|
64 |
raise Exception("Thematic service is required for word generation")
|
65 |
|
66 |
logger.info(f"🎯 Using thematic AI service for word generation with {requested_words} requested words")
|
67 |
|
68 |
# Use the dedicated crossword method for better word selection
|
69 |
-
|
|
|
|
|
|
|
|
|
70 |
|
71 |
if len(words) < self.min_words:
|
72 |
raise Exception(f"Thematic service generated insufficient words: {len(words)} < {self.min_words}")
|
73 |
|
74 |
logger.info(f"✅ Thematic service generated {len(words)} words")
|
75 |
-
return self._sort_words_for_crossword(words)
|
76 |
|
77 |
|
78 |
def _sort_words_for_crossword(self, words: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
|
27 |
logger.info(f"🎯 Generating puzzle for topics: {topics}, difficulty: {difficulty}{sentence_info}, requested words: {requested_words}")
|
28 |
|
29 |
# Get words from thematic AI service
|
30 |
+
words, debug_data = await self._select_words(topics, difficulty, custom_sentence, multi_theme, requested_words)
|
31 |
|
32 |
if len(words) < self.min_words:
|
33 |
logger.error(f"❌ Not enough words: {len(words)} < {self.min_words}")
|
|
|
42 |
|
43 |
logger.info(f"✅ Generated crossword with {len(grid_result['placed_words'])} words")
|
44 |
|
45 |
+
# Build result with optional debug data
|
46 |
+
result = {
|
47 |
"grid": grid_result["grid"],
|
48 |
"clues": grid_result["clues"],
|
49 |
"metadata": {
|
|
|
55 |
}
|
56 |
}
|
57 |
|
58 |
+
# Add debug data if available
|
59 |
+
if debug_data is not None:
|
60 |
+
result["debug"] = debug_data
|
61 |
+
logger.info(f"🐛 Debug data included in puzzle response")
|
62 |
+
|
63 |
+
return result
|
64 |
+
|
65 |
except Exception as e:
|
66 |
logger.error(f"❌ Error generating puzzle: {e}")
|
67 |
raise
|
68 |
|
69 |
+
async def _select_words(self, topics: List[str], difficulty: str, custom_sentence: str = None, multi_theme: bool = True, requested_words: int = 10) -> Tuple[List[Dict[str, Any]], Optional[Dict[str, Any]]]:
|
70 |
+
"""Select words for the crossword using thematic AI service.
|
71 |
+
|
72 |
+
Returns:
|
73 |
+
Tuple of (words, debug_data) where debug_data is None if debug is disabled
|
74 |
+
"""
|
75 |
if not self.thematic_service:
|
76 |
raise Exception("Thematic service is required for word generation")
|
77 |
|
78 |
logger.info(f"🎯 Using thematic AI service for word generation with {requested_words} requested words")
|
79 |
|
80 |
# Use the dedicated crossword method for better word selection
|
81 |
+
result = await self.thematic_service.find_words_for_crossword(topics, difficulty, requested_words, custom_sentence, multi_theme)
|
82 |
+
|
83 |
+
# Extract words and debug data from new format
|
84 |
+
words = result["words"]
|
85 |
+
debug_data = result.get("debug", None)
|
86 |
|
87 |
if len(words) < self.min_words:
|
88 |
raise Exception(f"Thematic service generated insufficient words: {len(words)} < {self.min_words}")
|
89 |
|
90 |
logger.info(f"✅ Thematic service generated {len(words)} words")
|
91 |
+
return self._sort_words_for_crossword(words), debug_data
|
92 |
|
93 |
|
94 |
def _sort_words_for_crossword(self, words: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
crossword-app/backend-py/src/services/thematic_word_service.py
CHANGED
@@ -288,6 +288,9 @@ class ThematicWordService:
|
|
288 |
self.difficulty_weight = float(os.getenv("DIFFICULTY_WEIGHT", "0.5"))
|
289 |
self.thematic_pool_size = int(os.getenv("THEMATIC_POOL_SIZE", "150"))
|
290 |
|
|
|
|
|
|
|
291 |
# Core components
|
292 |
self.vocab_manager = VocabularyManager(str(self.cache_dir), self.vocab_size_limit)
|
293 |
self.model: Optional[SentenceTransformer] = None
|
@@ -1049,7 +1052,7 @@ class ThematicWordService:
|
|
1049 |
|
1050 |
return status
|
1051 |
|
1052 |
-
async def find_words_for_crossword(self, topics: List[str], difficulty: str, requested_words: int = 10, custom_sentence: str = None, multi_theme: bool = True) ->
|
1053 |
"""
|
1054 |
Crossword-specific word finding method with 50% overgeneration and clue quality filtering.
|
1055 |
|
@@ -1061,7 +1064,11 @@ class ThematicWordService:
|
|
1061 |
multi_theme: Whether to use multi-theme processing (True) or single-theme blending (False)
|
1062 |
|
1063 |
Returns:
|
1064 |
-
|
|
|
|
|
|
|
|
|
1065 |
"""
|
1066 |
if not self.is_initialized:
|
1067 |
await self.initialize_async()
|
@@ -1181,7 +1188,65 @@ class ThematicWordService:
|
|
1181 |
|
1182 |
logger.info(f"✅ Selected {len(final_words)} words from {len(candidate_words)} total candidates")
|
1183 |
logger.info(f"📝 Final words: {[w['word'] for w in final_words]}")
|
1184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1185 |
|
1186 |
def _matches_crossword_difficulty(self, word: str, difficulty: str) -> bool:
|
1187 |
"""Check if word matches crossword difficulty criteria."""
|
|
|
288 |
self.difficulty_weight = float(os.getenv("DIFFICULTY_WEIGHT", "0.5"))
|
289 |
self.thematic_pool_size = int(os.getenv("THEMATIC_POOL_SIZE", "150"))
|
290 |
|
291 |
+
# Debug tab configuration
|
292 |
+
self.enable_debug_tab = os.getenv("ENABLE_DEBUG_TAB", "false").lower() == "true"
|
293 |
+
|
294 |
# Core components
|
295 |
self.vocab_manager = VocabularyManager(str(self.cache_dir), self.vocab_size_limit)
|
296 |
self.model: Optional[SentenceTransformer] = None
|
|
|
1052 |
|
1053 |
return status
|
1054 |
|
1055 |
+
async def find_words_for_crossword(self, topics: List[str], difficulty: str, requested_words: int = 10, custom_sentence: str = None, multi_theme: bool = True) -> Dict[str, Any]:
|
1056 |
"""
|
1057 |
Crossword-specific word finding method with 50% overgeneration and clue quality filtering.
|
1058 |
|
|
|
1064 |
multi_theme: Whether to use multi-theme processing (True) or single-theme blending (False)
|
1065 |
|
1066 |
Returns:
|
1067 |
+
Dictionary with words and optional debug data:
|
1068 |
+
{
|
1069 |
+
"words": [{"word": str, "clue": str, "similarity": float, "source": "thematic", "tier": str}],
|
1070 |
+
"debug": {...} (only if ENABLE_DEBUG_TAB=true)
|
1071 |
+
}
|
1072 |
"""
|
1073 |
if not self.is_initialized:
|
1074 |
await self.initialize_async()
|
|
|
1188 |
|
1189 |
logger.info(f"✅ Selected {len(final_words)} words from {len(candidate_words)} total candidates")
|
1190 |
logger.info(f"📝 Final words: {[w['word'] for w in final_words]}")
|
1191 |
+
|
1192 |
+
# Prepare return data
|
1193 |
+
result = {"words": final_words}
|
1194 |
+
|
1195 |
+
# Add debug data if enabled
|
1196 |
+
if self.enable_debug_tab:
|
1197 |
+
debug_data = {
|
1198 |
+
"enabled": True,
|
1199 |
+
"generation_params": {
|
1200 |
+
"topics": topics,
|
1201 |
+
"difficulty": difficulty,
|
1202 |
+
"requested_words": requested_words,
|
1203 |
+
"custom_sentence": custom_sentence,
|
1204 |
+
"multi_theme": multi_theme,
|
1205 |
+
"thematic_pool_size": thematic_pool,
|
1206 |
+
"min_similarity": min_similarity
|
1207 |
+
},
|
1208 |
+
"thematic_pool": [
|
1209 |
+
{
|
1210 |
+
"word": word,
|
1211 |
+
"similarity": float(similarity),
|
1212 |
+
"tier": tier,
|
1213 |
+
"percentile": self.word_percentiles.get(word.lower(), 0.0),
|
1214 |
+
"tier_description": self.tier_descriptions.get(tier, tier)
|
1215 |
+
}
|
1216 |
+
for word, similarity, tier in raw_results
|
1217 |
+
],
|
1218 |
+
"candidate_words": [
|
1219 |
+
{
|
1220 |
+
"word": word_data["word"],
|
1221 |
+
"similarity": word_data["similarity"],
|
1222 |
+
"tier": word_data["tier"],
|
1223 |
+
"percentile": self.word_percentiles.get(word_data["word"].lower(), 0.0),
|
1224 |
+
"clue": word_data["clue"]
|
1225 |
+
# Removed semantic_neighbors - too expensive to compute for all candidates
|
1226 |
+
}
|
1227 |
+
for word_data in candidate_words
|
1228 |
+
],
|
1229 |
+
"selection_method": "softmax" if self.use_softmax_selection else "random",
|
1230 |
+
"selection_params": {
|
1231 |
+
"use_softmax_selection": self.use_softmax_selection,
|
1232 |
+
"similarity_temperature": self.similarity_temperature,
|
1233 |
+
"difficulty_weight": self.difficulty_weight
|
1234 |
+
},
|
1235 |
+
"selected_words": [
|
1236 |
+
{
|
1237 |
+
"word": word_data["word"],
|
1238 |
+
"similarity": word_data["similarity"],
|
1239 |
+
"tier": word_data["tier"],
|
1240 |
+
"percentile": self.word_percentiles.get(word_data["word"].lower(), 0.0),
|
1241 |
+
"clue": word_data["clue"]
|
1242 |
+
}
|
1243 |
+
for word_data in final_words
|
1244 |
+
]
|
1245 |
+
}
|
1246 |
+
result["debug"] = debug_data
|
1247 |
+
logger.info(f"🐛 Debug data collected: {len(debug_data['thematic_pool'])} thematic words, {len(debug_data['candidate_words'])} candidates, {len(debug_data['selected_words'])} selected")
|
1248 |
+
|
1249 |
+
return result
|
1250 |
|
1251 |
def _matches_crossword_difficulty(self, word: str, difficulty: str) -> bool:
|
1252 |
"""Check if word matches crossword difficulty criteria."""
|
crossword-app/frontend/src/App.jsx
CHANGED
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
2 |
import TopicSelector from './components/TopicSelector';
|
3 |
import PuzzleGrid from './components/PuzzleGrid';
|
4 |
import ClueList from './components/ClueList';
|
|
|
5 |
import LoadingSpinner from './components/LoadingSpinner';
|
6 |
import useCrossword from './hooks/useCrossword';
|
7 |
import './styles/puzzle.css';
|
@@ -12,6 +13,7 @@ function App() {
|
|
12 |
const [showSolution, setShowSolution] = useState(false);
|
13 |
const [customSentence, setCustomSentence] = useState('');
|
14 |
const [multiTheme, setMultiTheme] = useState(true);
|
|
|
15 |
|
16 |
const {
|
17 |
puzzle,
|
@@ -57,6 +59,7 @@ function App() {
|
|
57 |
setDifficulty('medium');
|
58 |
setCustomSentence('');
|
59 |
setMultiTheme(true);
|
|
|
60 |
};
|
61 |
|
62 |
const handleRevealSolution = () => {
|
@@ -126,14 +129,39 @@ function App() {
|
|
126 |
|
127 |
{puzzle && !loading && (
|
128 |
<>
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
</>
|
138 |
)}
|
139 |
|
|
|
2 |
import TopicSelector from './components/TopicSelector';
|
3 |
import PuzzleGrid from './components/PuzzleGrid';
|
4 |
import ClueList from './components/ClueList';
|
5 |
+
import DebugTab from './components/DebugTab';
|
6 |
import LoadingSpinner from './components/LoadingSpinner';
|
7 |
import useCrossword from './hooks/useCrossword';
|
8 |
import './styles/puzzle.css';
|
|
|
13 |
const [showSolution, setShowSolution] = useState(false);
|
14 |
const [customSentence, setCustomSentence] = useState('');
|
15 |
const [multiTheme, setMultiTheme] = useState(true);
|
16 |
+
const [activeTab, setActiveTab] = useState('puzzle');
|
17 |
|
18 |
const {
|
19 |
puzzle,
|
|
|
59 |
setDifficulty('medium');
|
60 |
setCustomSentence('');
|
61 |
setMultiTheme(true);
|
62 |
+
setActiveTab('puzzle');
|
63 |
};
|
64 |
|
65 |
const handleRevealSolution = () => {
|
|
|
129 |
|
130 |
{puzzle && !loading && (
|
131 |
<>
|
132 |
+
{/* Tab Navigation */}
|
133 |
+
<div className="tab-nav">
|
134 |
+
<button
|
135 |
+
className={`tab-btn ${activeTab === 'puzzle' ? 'active' : ''}`}
|
136 |
+
onClick={() => setActiveTab('puzzle')}
|
137 |
+
>
|
138 |
+
Puzzle
|
139 |
+
</button>
|
140 |
+
{puzzle.debug && (
|
141 |
+
<button
|
142 |
+
className={`tab-btn ${activeTab === 'debug' ? 'active' : ''}`}
|
143 |
+
onClick={() => setActiveTab('debug')}
|
144 |
+
>
|
145 |
+
Debug
|
146 |
+
</button>
|
147 |
+
)}
|
148 |
</div>
|
149 |
+
|
150 |
+
{/* Tab Content */}
|
151 |
+
{activeTab === 'puzzle' && (
|
152 |
+
<div className="puzzle-layout">
|
153 |
+
<PuzzleGrid
|
154 |
+
grid={puzzle.grid}
|
155 |
+
clues={puzzle.clues}
|
156 |
+
showSolution={showSolution}
|
157 |
+
/>
|
158 |
+
<ClueList clues={puzzle.clues} />
|
159 |
+
</div>
|
160 |
+
)}
|
161 |
+
|
162 |
+
{activeTab === 'debug' && puzzle.debug && (
|
163 |
+
<DebugTab debugData={puzzle.debug} />
|
164 |
+
)}
|
165 |
</>
|
166 |
)}
|
167 |
|
crossword-app/frontend/src/components/DebugTab.jsx
ADDED
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { useState } from 'react';
|
2 |
+
|
3 |
+
const DebugTab = ({ debugData }) => {
|
4 |
+
const [activeSection, setActiveSection] = useState('overview');
|
5 |
+
const [sortBy, setSortBy] = useState('similarity');
|
6 |
+
const [sortDirection, setSortDirection] = useState('desc');
|
7 |
+
|
8 |
+
if (!debugData || !debugData.enabled) {
|
9 |
+
return (
|
10 |
+
<div className="debug-tab">
|
11 |
+
<p>Debug data not available. Set ENABLE_DEBUG_TAB=true on the backend.</p>
|
12 |
+
</div>
|
13 |
+
);
|
14 |
+
}
|
15 |
+
|
16 |
+
const sections = [
|
17 |
+
{ id: 'overview', label: 'Overview' },
|
18 |
+
{ id: 'thematic-pool', label: 'Thematic Pool' },
|
19 |
+
{ id: 'candidates', label: 'Candidates' },
|
20 |
+
{ id: 'selection', label: 'Selection' },
|
21 |
+
{ id: 'selected', label: 'Selected Words' }
|
22 |
+
];
|
23 |
+
|
24 |
+
const renderOverview = () => (
|
25 |
+
<div className="debug-section">
|
26 |
+
<h3>Generation Parameters</h3>
|
27 |
+
<div className="debug-grid">
|
28 |
+
<div><strong>Topics:</strong> {debugData.generation_params.topics.join(', ')}</div>
|
29 |
+
<div><strong>Difficulty:</strong> {debugData.generation_params.difficulty}</div>
|
30 |
+
<div><strong>Requested Words:</strong> {debugData.generation_params.requested_words}</div>
|
31 |
+
<div><strong>Thematic Pool Size:</strong> {debugData.generation_params.thematic_pool_size}</div>
|
32 |
+
<div><strong>Min Similarity:</strong> {debugData.generation_params.min_similarity}</div>
|
33 |
+
<div><strong>Multi-theme:</strong> {debugData.generation_params.multi_theme ? 'Yes' : 'No'}</div>
|
34 |
+
{debugData.generation_params.custom_sentence && (
|
35 |
+
<div><strong>Custom Sentence:</strong> "{debugData.generation_params.custom_sentence}"</div>
|
36 |
+
)}
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<h3>Selection Algorithm</h3>
|
40 |
+
<div className="debug-grid">
|
41 |
+
<div><strong>Method:</strong> {debugData.selection_method}</div>
|
42 |
+
<div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature}</div>
|
43 |
+
<div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight}</div>
|
44 |
+
<div><strong>Use Softmax:</strong> {debugData.selection_params.use_softmax_selection ? 'Yes' : 'No'}</div>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<h3>Results Summary</h3>
|
48 |
+
<div className="debug-grid">
|
49 |
+
<div><strong>Thematic Pool:</strong> {debugData.thematic_pool?.length || 0} words</div>
|
50 |
+
<div><strong>Candidates:</strong> {debugData.candidate_words?.length || 0} words</div>
|
51 |
+
<div><strong>Selected:</strong> {debugData.selected_words?.length || 0} words</div>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
);
|
55 |
+
|
56 |
+
const renderWordTable = (words, showClue = false) => (
|
57 |
+
<div className="word-table-container">
|
58 |
+
<table className="word-table">
|
59 |
+
<thead>
|
60 |
+
<tr>
|
61 |
+
<th>Word</th>
|
62 |
+
<th>Similarity</th>
|
63 |
+
<th>Percentile</th>
|
64 |
+
<th>Tier</th>
|
65 |
+
{showClue && <th>Clue</th>}
|
66 |
+
</tr>
|
67 |
+
</thead>
|
68 |
+
<tbody>
|
69 |
+
{words.map((word, idx) => (
|
70 |
+
<tr key={idx}>
|
71 |
+
<td><strong>{word.word}</strong></td>
|
72 |
+
<td>{word.similarity.toFixed(3)}</td>
|
73 |
+
<td>{word.percentile.toFixed(3)}</td>
|
74 |
+
<td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>
|
75 |
+
{showClue && <td>{word.clue}</td>}
|
76 |
+
</tr>
|
77 |
+
))}
|
78 |
+
</tbody>
|
79 |
+
</table>
|
80 |
+
</div>
|
81 |
+
);
|
82 |
+
|
83 |
+
const handleSort = (column) => {
|
84 |
+
if (sortBy === column) {
|
85 |
+
setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
|
86 |
+
} else {
|
87 |
+
setSortBy(column);
|
88 |
+
setSortDirection(column === 'word' ? 'asc' : 'desc');
|
89 |
+
}
|
90 |
+
};
|
91 |
+
|
92 |
+
const getSortIcon = (column) => {
|
93 |
+
if (sortBy !== column) return ' ↕️';
|
94 |
+
return sortDirection === 'asc' ? ' ▲' : ' ▼';
|
95 |
+
};
|
96 |
+
|
97 |
+
const renderSortableThematicPool = () => {
|
98 |
+
const pool = debugData.thematic_pool || [];
|
99 |
+
|
100 |
+
const sortedPool = [...pool].sort((a, b) => {
|
101 |
+
let aVal, bVal;
|
102 |
+
|
103 |
+
switch (sortBy) {
|
104 |
+
case 'word':
|
105 |
+
aVal = a.word.toLowerCase();
|
106 |
+
bVal = b.word.toLowerCase();
|
107 |
+
break;
|
108 |
+
case 'similarity':
|
109 |
+
aVal = a.similarity;
|
110 |
+
bVal = b.similarity;
|
111 |
+
break;
|
112 |
+
case 'percentile':
|
113 |
+
aVal = a.percentile;
|
114 |
+
bVal = b.percentile;
|
115 |
+
break;
|
116 |
+
default:
|
117 |
+
aVal = a.similarity;
|
118 |
+
bVal = b.similarity;
|
119 |
+
}
|
120 |
+
|
121 |
+
if (sortDirection === 'asc') {
|
122 |
+
return aVal < bVal ? -1 : aVal > bVal ? 1 : 0;
|
123 |
+
} else {
|
124 |
+
return aVal > bVal ? -1 : aVal < bVal ? 1 : 0;
|
125 |
+
}
|
126 |
+
});
|
127 |
+
|
128 |
+
return (
|
129 |
+
<div className="word-table-container">
|
130 |
+
<table className="word-table">
|
131 |
+
<thead>
|
132 |
+
<tr>
|
133 |
+
<th
|
134 |
+
onClick={() => handleSort('word')}
|
135 |
+
style={{ cursor: 'pointer', userSelect: 'none' }}
|
136 |
+
className={sortBy === 'word' ? 'sorted-column' : ''}
|
137 |
+
>
|
138 |
+
Word{getSortIcon('word')}
|
139 |
+
</th>
|
140 |
+
<th
|
141 |
+
onClick={() => handleSort('similarity')}
|
142 |
+
style={{ cursor: 'pointer', userSelect: 'none' }}
|
143 |
+
className={sortBy === 'similarity' ? 'sorted-column' : ''}
|
144 |
+
>
|
145 |
+
Similarity{getSortIcon('similarity')}
|
146 |
+
</th>
|
147 |
+
<th
|
148 |
+
onClick={() => handleSort('percentile')}
|
149 |
+
style={{ cursor: 'pointer', userSelect: 'none' }}
|
150 |
+
className={sortBy === 'percentile' ? 'sorted-column' : ''}
|
151 |
+
>
|
152 |
+
Percentile{getSortIcon('percentile')}
|
153 |
+
</th>
|
154 |
+
<th>Tier</th>
|
155 |
+
</tr>
|
156 |
+
</thead>
|
157 |
+
<tbody>
|
158 |
+
{sortedPool.map((word, idx) => (
|
159 |
+
<tr key={idx}>
|
160 |
+
<td><strong>{word.word}</strong></td>
|
161 |
+
<td>{word.similarity.toFixed(3)}</td>
|
162 |
+
<td>{word.percentile.toFixed(3)}</td>
|
163 |
+
<td title={word.tier_description || word.tier}>{word.tier.replace('tier_', '').replace('_', ' ')}</td>
|
164 |
+
</tr>
|
165 |
+
))}
|
166 |
+
</tbody>
|
167 |
+
</table>
|
168 |
+
</div>
|
169 |
+
);
|
170 |
+
};
|
171 |
+
|
172 |
+
const renderThematicPool = () => {
|
173 |
+
const pool = debugData.thematic_pool || [];
|
174 |
+
|
175 |
+
return (
|
176 |
+
<div className="debug-section">
|
177 |
+
<h3>Thematic Pool ({pool.length} words)</h3>
|
178 |
+
<p>All words generated thematically. Click column headers to sort.</p>
|
179 |
+
{renderSortableThematicPool()}
|
180 |
+
</div>
|
181 |
+
);
|
182 |
+
};
|
183 |
+
|
184 |
+
const renderCandidates = () => {
|
185 |
+
const candidates = debugData.candidate_words || [];
|
186 |
+
|
187 |
+
return (
|
188 |
+
<div className="debug-section">
|
189 |
+
<h3>Candidate Words ({candidates.length} words)</h3>
|
190 |
+
<p>Words that passed filtering and got clues generated.</p>
|
191 |
+
{renderWordTable(candidates, true)}
|
192 |
+
</div>
|
193 |
+
);
|
194 |
+
};
|
195 |
+
|
196 |
+
const renderSelection = () => (
|
197 |
+
<div className="debug-section">
|
198 |
+
<h3>Selection Process</h3>
|
199 |
+
<div className="debug-grid">
|
200 |
+
<div><strong>Algorithm:</strong> {debugData.selection_method}</div>
|
201 |
+
<div><strong>Temperature:</strong> {debugData.selection_params.similarity_temperature} (lower = more deterministic)</div>
|
202 |
+
<div><strong>Difficulty Weight:</strong> {debugData.selection_params.difficulty_weight} (balance between similarity and frequency)</div>
|
203 |
+
</div>
|
204 |
+
|
205 |
+
<h4>How it works:</h4>
|
206 |
+
<ul>
|
207 |
+
<li><strong>Composite Score</strong> = (1 - difficulty_weight) × similarity + difficulty_weight × frequency_alignment</li>
|
208 |
+
<li><strong>Frequency Alignment</strong>: Gaussian distribution favoring target percentiles by difficulty</li>
|
209 |
+
<li><strong>Softmax Selection</strong>: Probabilistic selection based on composite scores with temperature control</li>
|
210 |
+
</ul>
|
211 |
+
|
212 |
+
<h4>Difficulty Targets:</h4>
|
213 |
+
<ul>
|
214 |
+
<li><strong>Easy:</strong> 90th percentile (common words like CAT, DOG)</li>
|
215 |
+
<li><strong>Medium:</strong> 50th percentile (balanced selection)</li>
|
216 |
+
<li><strong>Hard:</strong> 20th percentile (rare words like QUETZAL, PLATYPUS)</li>
|
217 |
+
</ul>
|
218 |
+
</div>
|
219 |
+
);
|
220 |
+
|
221 |
+
const renderSelected = () => {
|
222 |
+
const selected = debugData.selected_words || [];
|
223 |
+
|
224 |
+
return (
|
225 |
+
<div className="debug-section">
|
226 |
+
<h3>Selected Words ({selected.length} words)</h3>
|
227 |
+
<p>Final words chosen for crossword generation.</p>
|
228 |
+
{renderWordTable(selected, true)}
|
229 |
+
</div>
|
230 |
+
);
|
231 |
+
};
|
232 |
+
|
233 |
+
const renderSection = () => {
|
234 |
+
switch (activeSection) {
|
235 |
+
case 'overview': return renderOverview();
|
236 |
+
case 'thematic-pool': return renderThematicPool();
|
237 |
+
case 'candidates': return renderCandidates();
|
238 |
+
case 'selection': return renderSelection();
|
239 |
+
case 'selected': return renderSelected();
|
240 |
+
default: return renderOverview();
|
241 |
+
}
|
242 |
+
};
|
243 |
+
|
244 |
+
return (
|
245 |
+
<div className="debug-tab">
|
246 |
+
<div className="debug-nav">
|
247 |
+
{sections.map(section => (
|
248 |
+
<button
|
249 |
+
key={section.id}
|
250 |
+
className={`debug-nav-btn ${activeSection === section.id ? 'active' : ''}`}
|
251 |
+
onClick={() => setActiveSection(section.id)}
|
252 |
+
>
|
253 |
+
{section.label}
|
254 |
+
</button>
|
255 |
+
))}
|
256 |
+
</div>
|
257 |
+
|
258 |
+
<div className="debug-content">
|
259 |
+
{renderSection()}
|
260 |
+
</div>
|
261 |
+
</div>
|
262 |
+
);
|
263 |
+
};
|
264 |
+
|
265 |
+
export default DebugTab;
|
crossword-app/frontend/src/styles/puzzle.css
CHANGED
@@ -551,4 +551,196 @@
|
|
551 |
border: 1px solid #c3e6cb;
|
552 |
text-align: center;
|
553 |
font-weight: 600;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
}
|
|
|
551 |
border: 1px solid #c3e6cb;
|
552 |
text-align: center;
|
553 |
font-weight: 600;
|
554 |
+
}
|
555 |
+
|
556 |
+
/* Tab Navigation */
|
557 |
+
.tab-nav {
|
558 |
+
display: flex;
|
559 |
+
border-bottom: 2px solid #e9ecef;
|
560 |
+
margin-bottom: 20px;
|
561 |
+
gap: 2px;
|
562 |
+
}
|
563 |
+
|
564 |
+
.tab-btn {
|
565 |
+
padding: 12px 20px;
|
566 |
+
border: none;
|
567 |
+
background: #f8f9fa;
|
568 |
+
color: #6c757d;
|
569 |
+
cursor: pointer;
|
570 |
+
border-radius: 8px 8px 0 0;
|
571 |
+
font-weight: 500;
|
572 |
+
transition: all 0.3s ease;
|
573 |
+
}
|
574 |
+
|
575 |
+
.tab-btn:hover {
|
576 |
+
background: #e9ecef;
|
577 |
+
color: #495057;
|
578 |
+
}
|
579 |
+
|
580 |
+
.tab-btn.active {
|
581 |
+
background: #3498db;
|
582 |
+
color: white;
|
583 |
+
}
|
584 |
+
|
585 |
+
/* Debug Tab Styles */
|
586 |
+
.debug-tab {
|
587 |
+
background: #f8f9fa;
|
588 |
+
border-radius: 8px;
|
589 |
+
padding: 20px;
|
590 |
+
margin-top: 20px;
|
591 |
+
}
|
592 |
+
|
593 |
+
.debug-nav {
|
594 |
+
display: flex;
|
595 |
+
flex-wrap: wrap;
|
596 |
+
gap: 8px;
|
597 |
+
margin-bottom: 20px;
|
598 |
+
border-bottom: 2px solid #e9ecef;
|
599 |
+
padding-bottom: 15px;
|
600 |
+
}
|
601 |
+
|
602 |
+
.debug-nav-btn {
|
603 |
+
padding: 8px 16px;
|
604 |
+
border: 1px solid #dee2e6;
|
605 |
+
background: white;
|
606 |
+
color: #495057;
|
607 |
+
border-radius: 20px;
|
608 |
+
cursor: pointer;
|
609 |
+
font-size: 0.9rem;
|
610 |
+
font-weight: 500;
|
611 |
+
transition: all 0.3s ease;
|
612 |
+
}
|
613 |
+
|
614 |
+
.debug-nav-btn:hover {
|
615 |
+
background: #e9ecef;
|
616 |
+
border-color: #adb5bd;
|
617 |
+
}
|
618 |
+
|
619 |
+
.debug-nav-btn.active {
|
620 |
+
background: #3498db;
|
621 |
+
color: white;
|
622 |
+
border-color: #3498db;
|
623 |
+
}
|
624 |
+
|
625 |
+
.debug-content {
|
626 |
+
min-height: 300px;
|
627 |
+
}
|
628 |
+
|
629 |
+
.debug-section h3 {
|
630 |
+
color: #2c3e50;
|
631 |
+
margin-bottom: 15px;
|
632 |
+
border-bottom: 1px solid #dee2e6;
|
633 |
+
padding-bottom: 8px;
|
634 |
+
}
|
635 |
+
|
636 |
+
.debug-section h4 {
|
637 |
+
color: #495057;
|
638 |
+
margin-top: 20px;
|
639 |
+
margin-bottom: 10px;
|
640 |
+
}
|
641 |
+
|
642 |
+
.debug-grid {
|
643 |
+
display: grid;
|
644 |
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
645 |
+
gap: 10px;
|
646 |
+
margin-bottom: 20px;
|
647 |
+
}
|
648 |
+
|
649 |
+
.debug-grid > div {
|
650 |
+
padding: 8px 12px;
|
651 |
+
background: white;
|
652 |
+
border-radius: 4px;
|
653 |
+
border: 1px solid #e9ecef;
|
654 |
+
font-size: 0.9rem;
|
655 |
+
}
|
656 |
+
|
657 |
+
.debug-grid strong {
|
658 |
+
color: #2c3e50;
|
659 |
+
}
|
660 |
+
|
661 |
+
/* Word Table Styles */
|
662 |
+
.word-table-container {
|
663 |
+
max-height: 400px;
|
664 |
+
overflow-y: auto;
|
665 |
+
border: 1px solid #dee2e6;
|
666 |
+
border-radius: 6px;
|
667 |
+
background: white;
|
668 |
+
}
|
669 |
+
|
670 |
+
.word-table {
|
671 |
+
width: 100%;
|
672 |
+
border-collapse: collapse;
|
673 |
+
font-size: 0.85rem;
|
674 |
+
}
|
675 |
+
|
676 |
+
.word-table th {
|
677 |
+
background: #f8f9fa;
|
678 |
+
padding: 8px 12px;
|
679 |
+
text-align: left;
|
680 |
+
border-bottom: 2px solid #dee2e6;
|
681 |
+
font-weight: 600;
|
682 |
+
color: #495057;
|
683 |
+
position: sticky;
|
684 |
+
top: 0;
|
685 |
+
z-index: 1;
|
686 |
+
}
|
687 |
+
|
688 |
+
.word-table th.sorted-column {
|
689 |
+
background: #e3f2fd;
|
690 |
+
color: #1976d2;
|
691 |
+
font-weight: 700;
|
692 |
+
}
|
693 |
+
|
694 |
+
.word-table th[style*="cursor: pointer"]:hover {
|
695 |
+
background: #e9ecef;
|
696 |
+
}
|
697 |
+
|
698 |
+
.word-table td {
|
699 |
+
padding: 6px 12px;
|
700 |
+
border-bottom: 1px solid #f1f3f4;
|
701 |
+
}
|
702 |
+
|
703 |
+
.word-table tr:hover {
|
704 |
+
background-color: #f8f9fa;
|
705 |
+
}
|
706 |
+
|
707 |
+
.word-table td:first-child {
|
708 |
+
font-weight: 600;
|
709 |
+
color: #2c3e50;
|
710 |
+
}
|
711 |
+
|
712 |
+
.debug-section ul {
|
713 |
+
margin: 10px 0;
|
714 |
+
padding-left: 20px;
|
715 |
+
}
|
716 |
+
|
717 |
+
.debug-section li {
|
718 |
+
margin: 5px 0;
|
719 |
+
font-size: 0.9rem;
|
720 |
+
line-height: 1.4;
|
721 |
+
}
|
722 |
+
|
723 |
+
/* Responsive */
|
724 |
+
@media (max-width: 768px) {
|
725 |
+
.debug-nav {
|
726 |
+
justify-content: center;
|
727 |
+
}
|
728 |
+
|
729 |
+
.debug-nav-btn {
|
730 |
+
font-size: 0.8rem;
|
731 |
+
padding: 6px 12px;
|
732 |
+
}
|
733 |
+
|
734 |
+
.debug-grid {
|
735 |
+
grid-template-columns: 1fr;
|
736 |
+
}
|
737 |
+
|
738 |
+
.word-table {
|
739 |
+
font-size: 0.75rem;
|
740 |
+
}
|
741 |
+
|
742 |
+
.word-table th,
|
743 |
+
.word-table td {
|
744 |
+
padding: 4px 8px;
|
745 |
+
}
|
746 |
}
|