@eigenpal/docx-js-editor 0.0.16 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/dist/ClipboardManager-D6dkOFg6.d.ts +436 -0
  2. package/dist/ClipboardManager-EZ0C6Onq.d.cts +436 -0
  3. package/dist/{DocumentAgent-Ci6_T-XM.d.ts → DocumentAgent-B0EC8lPC.d.cts} +2 -2
  4. package/dist/{DocumentAgent-DEGFgYEN.d.cts → DocumentAgent-BcCDg7i2.d.ts} +2 -2
  5. package/dist/{FindReplaceDialog-UMXCBBST.js → FindReplaceDialog-AWQXKEUQ.js} +2 -1
  6. package/dist/FindReplaceDialog-AWQXKEUQ.js.map +1 -0
  7. package/dist/FindReplaceDialog-I4SZDSVP.cjs +2 -0
  8. package/dist/FindReplaceDialog-I4SZDSVP.cjs.map +1 -0
  9. package/dist/{FootnotePropertiesDialog-OBQXOBJE.cjs → FootnotePropertiesDialog-73VT2ZVZ.cjs} +2 -1
  10. package/dist/FootnotePropertiesDialog-73VT2ZVZ.cjs.map +1 -0
  11. package/dist/{FootnotePropertiesDialog-TYQGPWPX.js → FootnotePropertiesDialog-ZM3EF3EF.js} +2 -1
  12. package/dist/FootnotePropertiesDialog-ZM3EF3EF.js.map +1 -0
  13. package/dist/{HyperlinkDialog-UOERZIBM.js → HyperlinkDialog-BA25XUT5.js} +2 -1
  14. package/dist/HyperlinkDialog-BA25XUT5.js.map +1 -0
  15. package/dist/HyperlinkDialog-V63LPOT2.cjs +2 -0
  16. package/dist/HyperlinkDialog-V63LPOT2.cjs.map +1 -0
  17. package/dist/{ImagePositionDialog-52FDANUK.js → ImagePositionDialog-AIAMKPFK.js} +2 -1
  18. package/dist/ImagePositionDialog-AIAMKPFK.js.map +1 -0
  19. package/dist/{ImagePositionDialog-ZK5WFBRC.cjs → ImagePositionDialog-KMK7ROV2.cjs} +2 -1
  20. package/dist/ImagePositionDialog-KMK7ROV2.cjs.map +1 -0
  21. package/dist/{ImagePropertiesDialog-YPSLPSF6.js → ImagePropertiesDialog-ERFCUVCW.js} +2 -1
  22. package/dist/ImagePropertiesDialog-ERFCUVCW.js.map +1 -0
  23. package/dist/{ImagePropertiesDialog-LU44RDIY.cjs → ImagePropertiesDialog-USMMRK6X.cjs} +2 -1
  24. package/dist/ImagePropertiesDialog-USMMRK6X.cjs.map +1 -0
  25. package/dist/{TablePropertiesDialog-KMOYHPGF.cjs → TablePropertiesDialog-72CIUAZT.cjs} +2 -1
  26. package/dist/TablePropertiesDialog-72CIUAZT.cjs.map +1 -0
  27. package/dist/{TablePropertiesDialog-OUUJAA7D.js → TablePropertiesDialog-EMUEVYB3.js} +2 -1
  28. package/dist/TablePropertiesDialog-EMUEVYB3.js.map +1 -0
  29. package/dist/{agentApi-CbVUCZRu.d.cts → agentApi-BFVyKagE.d.cts} +143 -2
  30. package/dist/{agentApi-CbVUCZRu.d.ts → agentApi-BFVyKagE.d.ts} +143 -2
  31. package/dist/{chunk-OEOUMSWH.cjs → chunk-2CHPKB5A.cjs} +8 -7
  32. package/dist/chunk-2CHPKB5A.cjs.map +1 -0
  33. package/dist/{chunk-R5SKERM2.js → chunk-2QOEHCBX.js} +2 -1
  34. package/dist/chunk-2QOEHCBX.js.map +1 -0
  35. package/dist/chunk-4QT5LPBA.cjs +24 -0
  36. package/dist/chunk-4QT5LPBA.cjs.map +1 -0
  37. package/dist/chunk-5DYSI4O4.cjs +60 -0
  38. package/dist/chunk-5DYSI4O4.cjs.map +1 -0
  39. package/dist/{chunk-DYQUXFE5.cjs → chunk-5FJXHXFV.cjs} +2 -1
  40. package/dist/chunk-5FJXHXFV.cjs.map +1 -0
  41. package/dist/chunk-6FEWNF6B.js +4 -0
  42. package/dist/chunk-6FEWNF6B.js.map +1 -0
  43. package/dist/chunk-6LF5HZCV.js +10 -0
  44. package/dist/chunk-6LF5HZCV.js.map +1 -0
  45. package/dist/{chunk-EMKABJPH.js → chunk-7JSPKVOW.js} +2 -1
  46. package/dist/chunk-7JSPKVOW.js.map +1 -0
  47. package/dist/chunk-C33XDRDJ.cjs +28 -0
  48. package/dist/chunk-C33XDRDJ.cjs.map +1 -0
  49. package/dist/chunk-CV5WFE7K.js +24 -0
  50. package/dist/chunk-CV5WFE7K.js.map +1 -0
  51. package/dist/{chunk-WFYRA2TH.js → chunk-CXJRNISO.js} +2 -1
  52. package/dist/chunk-CXJRNISO.js.map +1 -0
  53. package/dist/{chunk-VTAS7VZ6.cjs → chunk-DJAEBZ33.cjs} +2 -1
  54. package/dist/chunk-DJAEBZ33.cjs.map +1 -0
  55. package/dist/chunk-DP6Q75ZD.js +28 -0
  56. package/dist/chunk-DP6Q75ZD.js.map +1 -0
  57. package/dist/chunk-FDANI5P4.cjs +2 -0
  58. package/dist/chunk-FDANI5P4.cjs.map +1 -0
  59. package/dist/chunk-FGVGZLBL.js +2 -0
  60. package/dist/chunk-FGVGZLBL.js.map +1 -0
  61. package/dist/{chunk-SF53KLDZ.cjs → chunk-GJ4GKSDU.cjs} +2 -1
  62. package/dist/chunk-GJ4GKSDU.cjs.map +1 -0
  63. package/dist/{chunk-FYAWM7MP.cjs → chunk-GWBTKVFD.cjs} +2 -1
  64. package/dist/chunk-GWBTKVFD.cjs.map +1 -0
  65. package/dist/{chunk-WFWLPKQA.js → chunk-JOYPFQW2.js} +2 -1
  66. package/dist/chunk-JOYPFQW2.js.map +1 -0
  67. package/dist/{chunk-ZDYHAYN6.js → chunk-L54YNLSE.js} +2 -1
  68. package/dist/chunk-L54YNLSE.js.map +1 -0
  69. package/dist/chunk-LPGMLJMO.js +259 -0
  70. package/dist/chunk-LPGMLJMO.js.map +1 -0
  71. package/dist/{chunk-CTYOM6BE.js → chunk-M2T6XKT5.js} +2 -1
  72. package/dist/chunk-M2T6XKT5.js.map +1 -0
  73. package/dist/chunk-OHG7ROFC.js +11 -0
  74. package/dist/chunk-OHG7ROFC.js.map +1 -0
  75. package/dist/chunk-PANKMCFX.cjs +4 -0
  76. package/dist/chunk-PANKMCFX.cjs.map +1 -0
  77. package/dist/{chunk-PJVI53AH.js → chunk-Q6HUGWO6.js} +2 -1
  78. package/dist/chunk-Q6HUGWO6.js.map +1 -0
  79. package/dist/{chunk-MLSHZVL7.js → chunk-QDV75OJ4.js} +8 -7
  80. package/dist/chunk-QDV75OJ4.js.map +1 -0
  81. package/dist/chunk-QEBO3EQP.cjs +2 -0
  82. package/dist/chunk-QEBO3EQP.cjs.map +1 -0
  83. package/dist/chunk-QVIZ775M.cjs +259 -0
  84. package/dist/chunk-QVIZ775M.cjs.map +1 -0
  85. package/dist/chunk-RMUMR42R.cjs +10 -0
  86. package/dist/chunk-RMUMR42R.cjs.map +1 -0
  87. package/dist/{chunk-XS2AQFMF.cjs → chunk-S26DZVRQ.cjs} +2 -1
  88. package/dist/chunk-S26DZVRQ.cjs.map +1 -0
  89. package/dist/{chunk-L34XFLQZ.cjs → chunk-T2HQYRA7.cjs} +2 -1
  90. package/dist/chunk-T2HQYRA7.cjs.map +1 -0
  91. package/dist/chunk-ULXNEG66.js +60 -0
  92. package/dist/chunk-ULXNEG66.js.map +1 -0
  93. package/dist/{chunk-PXC7ARQB.cjs → chunk-WD2HTKRR.cjs} +2 -1
  94. package/dist/chunk-WD2HTKRR.cjs.map +1 -0
  95. package/dist/chunk-XZNOV52K.cjs +11 -0
  96. package/dist/chunk-XZNOV52K.cjs.map +1 -0
  97. package/dist/chunk-Y6VCTLCJ.js +2 -0
  98. package/dist/chunk-Y6VCTLCJ.js.map +1 -0
  99. package/dist/{clipboard-Cx7cb3kX.d.cts → clipboard-CqE-UZ2d.d.cts} +1 -1
  100. package/dist/{clipboard-BOocwmAM.d.ts → clipboard-beGtyabO.d.ts} +1 -1
  101. package/dist/{colorResolver-KXbUgzWC.d.ts → colorResolver-B5YbO_a4.d.ts} +170 -170
  102. package/dist/{colorResolver-CIDiSPWd.d.cts → colorResolver-Cu46bSKr.d.cts} +170 -170
  103. package/dist/core-plugins-reexport.cjs +2 -0
  104. package/dist/core-plugins-reexport.cjs.map +1 -0
  105. package/dist/{core-plugins.d.cts → core-plugins-reexport.d.cts} +4 -4
  106. package/dist/{core-plugins.d.ts → core-plugins-reexport.d.ts} +4 -4
  107. package/dist/core-plugins-reexport.js +2 -0
  108. package/dist/core-plugins-reexport.js.map +1 -0
  109. package/dist/core-reexport.cjs +2 -0
  110. package/dist/core-reexport.cjs.map +1 -0
  111. package/dist/core-reexport.d.cts +309 -0
  112. package/dist/core-reexport.d.ts +309 -0
  113. package/dist/core-reexport.js +2 -0
  114. package/dist/core-reexport.js.map +1 -0
  115. package/dist/executor-K5RXUTTR.js +2 -0
  116. package/dist/executor-K5RXUTTR.js.map +1 -0
  117. package/dist/executor-XIPIU3H4.cjs +2 -0
  118. package/dist/executor-XIPIU3H4.cjs.map +1 -0
  119. package/dist/{insertOperations-CzB5b-Of.d.ts → fontLoader-CFKpg0Ri.d.ts} +86 -86
  120. package/dist/{insertOperations-DKVmCV32.d.cts → fontLoader-HZYfILUm.d.cts} +86 -86
  121. package/dist/headless-reexport.cjs +5 -0
  122. package/dist/headless-reexport.cjs.map +1 -0
  123. package/dist/{headless.d.cts → headless-reexport.d.cts} +7 -7
  124. package/dist/{headless.d.ts → headless-reexport.d.ts} +7 -7
  125. package/dist/{headless.js → headless-reexport.js} +3 -2
  126. package/dist/headless-reexport.js.map +1 -0
  127. package/dist/index.cjs +6 -5
  128. package/dist/index.cjs.map +1 -0
  129. package/dist/index.css +1 -0
  130. package/dist/index.css.map +1 -0
  131. package/dist/index.d.cts +15 -13
  132. package/dist/index.d.ts +15 -13
  133. package/dist/index.js +6 -5
  134. package/dist/index.js.map +1 -0
  135. package/dist/{mcp.cjs → mcp-reexport.cjs} +11 -10
  136. package/dist/mcp-reexport.cjs.map +1 -0
  137. package/dist/{mcp.d.cts → mcp-reexport.d.cts} +2 -2
  138. package/dist/{mcp.d.ts → mcp-reexport.d.ts} +2 -2
  139. package/dist/{mcp.js → mcp-reexport.js} +10 -9
  140. package/dist/mcp-reexport.js.map +1 -0
  141. package/dist/{processTemplate-RJN6452W.js → processTemplate-G37IM66O.js} +2 -1
  142. package/dist/processTemplate-G37IM66O.js.map +1 -0
  143. package/dist/processTemplate-RFBGVH7T.cjs +2 -0
  144. package/dist/processTemplate-RFBGVH7T.cjs.map +1 -0
  145. package/dist/{react-BZxD04XV.d.ts → react-BjOCdeTs.d.ts} +43 -366
  146. package/dist/{react-D8eAYckC.d.cts → react-UzAn4o7l.d.cts} +43 -366
  147. package/dist/react.cjs +2 -1
  148. package/dist/react.cjs.map +1 -0
  149. package/dist/react.css +1 -0
  150. package/dist/react.css.map +1 -0
  151. package/dist/react.d.cts +6 -5
  152. package/dist/react.d.ts +6 -5
  153. package/dist/react.js +2 -1
  154. package/dist/react.js.map +1 -0
  155. package/dist/{registry-D4tvj9f3.d.ts → registry-CV6nYWqP.d.ts} +1 -1
  156. package/dist/{registry-ngv6Bumt.d.cts → registry-DjacfR6Q.d.cts} +1 -1
  157. package/dist/selectionRects-6DU7HN7E.js +2 -0
  158. package/dist/selectionRects-6DU7HN7E.js.map +1 -0
  159. package/dist/selectionRects-YZSC24ZP.cjs +2 -0
  160. package/dist/selectionRects-YZSC24ZP.cjs.map +1 -0
  161. package/dist/styles.css +1 -1
  162. package/dist/{types-D96elyJF.d.cts → types-Bnp8rvJn.d.cts} +2 -2
  163. package/dist/{types-xMzSPT4i.d.ts → types-DwZ3xysp.d.ts} +2 -2
  164. package/dist/ui.cjs +2 -1
  165. package/dist/ui.cjs.map +1 -0
  166. package/dist/ui.d.cts +3 -3
  167. package/dist/ui.d.ts +3 -3
  168. package/dist/ui.js +2 -1
  169. package/dist/ui.js.map +1 -0
  170. package/dist/{variableDetector-DeM1N-_L.d.ts → variableDetector-BaDeXz7D.d.ts} +1 -1
  171. package/dist/{variableDetector-CPxKo9jP.d.cts → variableDetector-CMhJtM96.d.cts} +1 -1
  172. package/package.json +26 -79
  173. package/LICENSE +0 -21
  174. package/README.md +0 -171
  175. package/dist/FindReplaceDialog-46BE7Q2G.cjs +0 -1
  176. package/dist/HyperlinkDialog-22NH7ZLP.cjs +0 -1
  177. package/dist/chunk-24N3L4IL.cjs +0 -258
  178. package/dist/chunk-2ASOEN3V.js +0 -1
  179. package/dist/chunk-46OFHSPJ.cjs +0 -2
  180. package/dist/chunk-65OFYOHF.cjs +0 -58
  181. package/dist/chunk-6YFGCUHU.js +0 -4
  182. package/dist/chunk-ESI4BSBF.js +0 -1
  183. package/dist/chunk-GLFFXY2X.js +0 -258
  184. package/dist/chunk-ITWEFKGQ.cjs +0 -1
  185. package/dist/chunk-JKN7TNPA.js +0 -12
  186. package/dist/chunk-KESNGXGO.js +0 -1
  187. package/dist/chunk-NO7WUK5E.cjs +0 -12
  188. package/dist/chunk-NT2REEAA.cjs +0 -1
  189. package/dist/chunk-O7QVCJN6.cjs +0 -4
  190. package/dist/chunk-OW5H5DNE.cjs +0 -1
  191. package/dist/chunk-OWMXCVKB.js +0 -1
  192. package/dist/chunk-RM3ITJ2H.cjs +0 -10
  193. package/dist/chunk-TOI5W3HK.js +0 -8
  194. package/dist/chunk-UAVOWAIF.cjs +0 -8
  195. package/dist/chunk-ULNHBTYA.js +0 -2
  196. package/dist/chunk-UXXV4GT6.js +0 -10
  197. package/dist/chunk-VOWKSURW.cjs +0 -1
  198. package/dist/chunk-YMXKVLTU.js +0 -58
  199. package/dist/core-plugins.cjs +0 -1
  200. package/dist/core-plugins.js +0 -1
  201. package/dist/core.cjs +0 -1
  202. package/dist/core.d.cts +0 -23
  203. package/dist/core.d.ts +0 -23
  204. package/dist/core.js +0 -1
  205. package/dist/executor-ITYZTNSH.cjs +0 -1
  206. package/dist/executor-TC7CLATE.js +0 -1
  207. package/dist/headless.cjs +0 -4
  208. package/dist/mcp-cli.js +0 -136
  209. package/dist/processTemplate-525HZL4S.cjs +0 -1
  210. package/dist/selectionRects-PQEUEW35.cjs +0 -1
  211. package/dist/selectionRects-QAG5RSHD.js +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"HyperlinkDialog-V63LPOT2.cjs"}
@@ -1 +1,2 @@
1
- import'./chunk-OWMXCVKB.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=useState("align"),[y,k]=useState("center"),[c,z]=useState("column"),[b,A]=useState(0),[g,m]=useState("align"),[h,L]=useState("top"),[S,B]=useState("paragraph"),[x,M]=useState(0),[C,N]=useState(0),[P,E]=useState(0),[T,H]=useState(0),[R,V]=useState(0);useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsx("div",{style:J,children:"Image Position"}),jsxs("div",{style:Q,children:[jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Horizontal"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"column",children:"Column"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"character",children:"Character"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Vertical"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsx("option",{value:"top",children:"Top"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"paragraph",children:"Paragraph"}),jsx("option",{value:"line",children:"Line"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Distance from text (px)"}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Top"}),jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Bottom"}),jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Left"}),jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Right"}),jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxs("div",{style:U,children:[jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}export{Z as ImagePositionDialog};
1
+ import'./chunk-Y6VCTLCJ.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=useState("align"),[y,k]=useState("center"),[c,z]=useState("column"),[b,A]=useState(0),[g,m]=useState("align"),[h,L]=useState("top"),[S,B]=useState("paragraph"),[x,M]=useState(0),[C,N]=useState(0),[P,E]=useState(0),[T,H]=useState(0),[R,V]=useState(0);useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsx("div",{style:J,children:"Image Position"}),jsxs("div",{style:Q,children:[jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Horizontal"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"column",children:"Column"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"character",children:"Character"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Vertical"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsx("option",{value:"top",children:"Top"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"paragraph",children:"Paragraph"}),jsx("option",{value:"line",children:"Line"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Distance from text (px)"}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Top"}),jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Bottom"}),jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Left"}),jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Right"}),jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxs("div",{style:U,children:[jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}export{Z as ImagePositionDialog};//# sourceMappingURL=ImagePositionDialog-AIAMKPFK.js.map
2
+ //# sourceMappingURL=ImagePositionDialog-AIAMKPFK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/ImagePositionDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","sectionStyle","sectionLabelStyle","rowStyle","labelStyle","inputStyle","selectStyle","footerStyle","btnStyle","ImagePositionDialog","isOpen","onClose","onApply","currentData","hMode","setHMode","useState","hAlign","setHAlign","hRelativeTo","setHRelativeTo","hOffset","setHOffset","vMode","setVMode","vAlign","setVAlign","vRelativeTo","setVRelativeTo","vOffset","setVOffset","distTop","setDistTop","distBottom","setDistBottom","distLeft","setDistLeft","distRight","setDistRight","useEffect","h","v","handleApply","useCallback","data","handleKeyDown","jsx","jsxs"],"mappings":"wHA4CA,IAAMA,CAAAA,CAA8B,CAClC,QAAA,CAAU,OAAA,CACV,GAAA,CAAK,CAAA,CACL,IAAA,CAAM,CAAA,CACN,KAAA,CAAO,CAAA,CACP,MAAA,CAAQ,CAAA,CACR,eAAA,CAAiB,oBAAA,CACjB,OAAA,CAAS,OACT,UAAA,CAAY,QAAA,CACZ,cAAA,CAAgB,QAAA,CAChB,MAAA,CAAQ,GACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,eAAA,CAAiB,OAAA,CACjB,YAAA,CAAc,CAAA,CACd,SAAA,CAAW,gCAAA,CACX,QAAA,CAAU,GAAA,CACV,QAAA,CAAU,GAAA,CACV,KAAA,CAAO,MAAA,CACP,MAAA,CAAQ,EACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,OAAA,CAAS,gBAAA,CACT,YAAA,CAAc,6BAAA,CACd,QAAA,CAAU,EAAA,CACV,WAAY,GACd,CAAA,CAEMC,CAAAA,CAA2B,CAC/B,OAAA,CAAS,WAAA,CACT,OAAA,CAAS,MAAA,CACT,aAAA,CAAe,QAAA,CACf,GAAA,CAAK,EACP,CAAA,CAEMC,CAAAA,CAA8B,CAClC,OAAA,CAAS,MAAA,CACT,aAAA,CAAe,QAAA,CACf,GAAA,CAAK,CACP,CAAA,CAEMC,CAAAA,CAAmC,CACvC,QAAA,CAAU,EAAA,CACV,UAAA,CAAY,GAAA,CACZ,KAAA,CAAO,iBACT,CAAA,CAEMC,CAAAA,CAA0B,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IA2LtB","file":"ImagePositionDialog-AIAMKPFK.js","sourcesContent":["/**\n * Image Position Dialog\n *\n * Modal for editing image positioning settings:\n * - Horizontal: alignment or offset, relative to page/column/margin/paragraph\n * - Vertical: alignment or offset, relative to page/margin/paragraph/line\n * - Distance from text (top/bottom/left/right)\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface ImagePositionData {\n horizontal?: {\n relativeTo?: string;\n posOffset?: number;\n align?: string;\n };\n vertical?: {\n relativeTo?: string;\n posOffset?: number;\n align?: string;\n };\n distTop?: number;\n distBottom?: number;\n distLeft?: number;\n distRight?: number;\n}\n\nexport interface ImagePositionDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (data: ImagePositionData) => void;\n currentData?: ImagePositionData;\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 400,\n maxWidth: 480,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n};\n\nconst sectionStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n};\n\nconst sectionLabelStyle: CSSProperties = {\n fontSize: 13,\n fontWeight: 600,\n color: 'var(--doc-text)',\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n};\n\nconst labelStyle: CSSProperties = {\n width: 75,\n fontSize: 12,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '4px 6px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 12,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function ImagePositionDialog({\n isOpen,\n onClose,\n onApply,\n currentData,\n}: ImagePositionDialogProps): React.ReactElement | null {\n const [hMode, setHMode] = useState<'align' | 'offset'>('align');\n const [hAlign, setHAlign] = useState('center');\n const [hRelativeTo, setHRelativeTo] = useState('column');\n const [hOffset, setHOffset] = useState(0);\n\n const [vMode, setVMode] = useState<'align' | 'offset'>('align');\n const [vAlign, setVAlign] = useState('top');\n const [vRelativeTo, setVRelativeTo] = useState('paragraph');\n const [vOffset, setVOffset] = useState(0);\n\n const [distTop, setDistTop] = useState(0);\n const [distBottom, setDistBottom] = useState(0);\n const [distLeft, setDistLeft] = useState(0);\n const [distRight, setDistRight] = useState(0);\n\n useEffect(() => {\n if (!isOpen) return;\n const h = currentData?.horizontal;\n const v = currentData?.vertical;\n if (h?.align) {\n setHMode('align');\n setHAlign(h.align);\n } else if (h?.posOffset != null) {\n setHMode('offset');\n setHOffset(h.posOffset);\n }\n if (h?.relativeTo) setHRelativeTo(h.relativeTo);\n\n if (v?.align) {\n setVMode('align');\n setVAlign(v.align);\n } else if (v?.posOffset != null) {\n setVMode('offset');\n setVOffset(v.posOffset);\n }\n if (v?.relativeTo) setVRelativeTo(v.relativeTo);\n\n setDistTop(currentData?.distTop ?? 0);\n setDistBottom(currentData?.distBottom ?? 0);\n setDistLeft(currentData?.distLeft ?? 0);\n setDistRight(currentData?.distRight ?? 0);\n }, [isOpen, currentData]);\n\n const handleApply = useCallback(() => {\n const data: ImagePositionData = {};\n data.horizontal = {\n relativeTo: hRelativeTo,\n ...(hMode === 'align' ? { align: hAlign } : { posOffset: hOffset }),\n };\n data.vertical = {\n relativeTo: vRelativeTo,\n ...(vMode === 'align' ? { align: vAlign } : { posOffset: vOffset }),\n };\n data.distTop = distTop;\n data.distBottom = distBottom;\n data.distLeft = distLeft;\n data.distRight = distRight;\n onApply(data);\n onClose();\n }, [\n hMode,\n hAlign,\n hRelativeTo,\n hOffset,\n vMode,\n vAlign,\n vRelativeTo,\n vOffset,\n distTop,\n distBottom,\n distLeft,\n distRight,\n onApply,\n onClose,\n ]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter') handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Image position\"\n >\n <div style={headerStyle}>Image Position</div>\n\n <div style={bodyStyle}>\n {/* Horizontal positioning */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Horizontal</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Position</label>\n <select\n style={selectStyle}\n value={hMode}\n onChange={(e) => setHMode(e.target.value as 'align' | 'offset')}\n >\n <option value=\"align\">Alignment</option>\n <option value=\"offset\">Offset</option>\n </select>\n </div>\n {hMode === 'align' ? (\n <div style={rowStyle}>\n <label style={labelStyle}>Align</label>\n <select\n style={selectStyle}\n value={hAlign}\n onChange={(e) => setHAlign(e.target.value)}\n >\n <option value=\"left\">Left</option>\n <option value=\"center\">Center</option>\n <option value=\"right\">Right</option>\n </select>\n </div>\n ) : (\n <div style={rowStyle}>\n <label style={labelStyle}>Offset (px)</label>\n <input\n type=\"number\"\n style={inputStyle}\n value={hOffset}\n onChange={(e) => setHOffset(Number(e.target.value) || 0)}\n />\n </div>\n )}\n <div style={rowStyle}>\n <label style={labelStyle}>Relative to</label>\n <select\n style={selectStyle}\n value={hRelativeTo}\n onChange={(e) => setHRelativeTo(e.target.value)}\n >\n <option value=\"page\">Page</option>\n <option value=\"column\">Column</option>\n <option value=\"margin\">Margin</option>\n <option value=\"character\">Character</option>\n </select>\n </div>\n </div>\n\n {/* Vertical positioning */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Vertical</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Position</label>\n <select\n style={selectStyle}\n value={vMode}\n onChange={(e) => setVMode(e.target.value as 'align' | 'offset')}\n >\n <option value=\"align\">Alignment</option>\n <option value=\"offset\">Offset</option>\n </select>\n </div>\n {vMode === 'align' ? (\n <div style={rowStyle}>\n <label style={labelStyle}>Align</label>\n <select\n style={selectStyle}\n value={vAlign}\n onChange={(e) => setVAlign(e.target.value)}\n >\n <option value=\"top\">Top</option>\n <option value=\"center\">Center</option>\n <option value=\"bottom\">Bottom</option>\n </select>\n </div>\n ) : (\n <div style={rowStyle}>\n <label style={labelStyle}>Offset (px)</label>\n <input\n type=\"number\"\n style={inputStyle}\n value={vOffset}\n onChange={(e) => setVOffset(Number(e.target.value) || 0)}\n />\n </div>\n )}\n <div style={rowStyle}>\n <label style={labelStyle}>Relative to</label>\n <select\n style={selectStyle}\n value={vRelativeTo}\n onChange={(e) => setVRelativeTo(e.target.value)}\n >\n <option value=\"page\">Page</option>\n <option value=\"margin\">Margin</option>\n <option value=\"paragraph\">Paragraph</option>\n <option value=\"line\">Line</option>\n </select>\n </div>\n </div>\n\n {/* Distance from text */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Distance from text (px)</div>\n <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }}>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Top</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distTop}\n onChange={(e) => setDistTop(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Bottom</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distBottom}\n onChange={(e) => setDistBottom(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Left</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distLeft}\n onChange={(e) => setDistLeft(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Right</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distRight}\n onChange={(e) => setDistRight(Number(e.target.value) || 0)}\n />\n </div>\n </div>\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1,2 @@
1
- 'use strict';require('./chunk-VOWKSURW.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=react.useState("align"),[y,k]=react.useState("center"),[c,z]=react.useState("column"),[b,A]=react.useState(0),[g,m]=react.useState("align"),[h,L]=react.useState("top"),[S,B]=react.useState("paragraph"),[x,M]=react.useState(0),[C,N]=react.useState(0),[P,E]=react.useState(0),[T,H]=react.useState(0),[R,V]=react.useState(0);react.useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=react.useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=react.useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsxRuntime.jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxRuntime.jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsxRuntime.jsx("div",{style:J,children:"Image Position"}),jsxRuntime.jsxs("div",{style:Q,children:[jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Horizontal"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"column",children:"Column"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"character",children:"Character"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Vertical"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"paragraph",children:"Paragraph"}),jsxRuntime.jsx("option",{value:"line",children:"Line"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Distance from text (px)"}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Top"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Bottom"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Left"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Right"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxRuntime.jsxs("div",{style:U,children:[jsxRuntime.jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}exports.ImagePositionDialog=Z;
1
+ 'use strict';require('./chunk-QEBO3EQP.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=react.useState("align"),[y,k]=react.useState("center"),[c,z]=react.useState("column"),[b,A]=react.useState(0),[g,m]=react.useState("align"),[h,L]=react.useState("top"),[S,B]=react.useState("paragraph"),[x,M]=react.useState(0),[C,N]=react.useState(0),[P,E]=react.useState(0),[T,H]=react.useState(0),[R,V]=react.useState(0);react.useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=react.useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=react.useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsxRuntime.jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxRuntime.jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsxRuntime.jsx("div",{style:J,children:"Image Position"}),jsxRuntime.jsxs("div",{style:Q,children:[jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Horizontal"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"column",children:"Column"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"character",children:"Character"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Vertical"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"paragraph",children:"Paragraph"}),jsxRuntime.jsx("option",{value:"line",children:"Line"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Distance from text (px)"}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Top"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Bottom"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Left"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Right"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxRuntime.jsxs("div",{style:U,children:[jsxRuntime.jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}exports.ImagePositionDialog=Z;//# sourceMappingURL=ImagePositionDialog-KMK7ROV2.cjs.map
2
+ //# sourceMappingURL=ImagePositionDialog-KMK7ROV2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/ImagePositionDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","sectionStyle","sectionLabelStyle","rowStyle","labelStyle","inputStyle","selectStyle","footerStyle","btnStyle","ImagePositionDialog","isOpen","onClose","onApply","currentData","hMode","setHMode","useState","hAlign","setHAlign","hRelativeTo","setHRelativeTo","hOffset","setHOffset","vMode","setVMode","vAlign","setVAlign","vRelativeTo","setVRelativeTo","vOffset","setVOffset","distTop","setDistTop","distBottom","setDistBottom","distLeft","setDistLeft","distRight","setDistRight","useEffect","h","v","handleApply","useCallback","data","handleKeyDown","jsx","jsxs"],"mappings":"gHA4CA,IAAMA,CAAAA,CAA8B,CAClC,QA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,CAAY,MAAO,EAAG,CAAA,CAAG,QAAA,CAAA,OAAA,CAAK,CAAA,CACjD0C,cAAAA,CAAC,OAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,KAAA,CAAOzC,CAAAA,CACP,GAAA,CAAK,CAAA,CACL,KAAA,CAAOgC,CAAAA,CACP,QAAA,CAAW,CAAA,EAAMC,CAAAA,CAAa,MAAA,CAAO,CAAA,CAAE,MAAA,CAAO,KAAK,CAAA,EAAK,CAAC,CAAA,CAC3D,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAEAS,eAAAA,CAAC,KAAA,CAAA,CAAI,KAAA,CAAOxC,EACV,QAAA,CAAA,CAAAuC,cAAAA,CAAC,QAAA,CAAA,CAAO,IAAA,CAAK,QAAA,CAAS,KAAA,CAAOtC,CAAAA,CAAU,OAAA,CAASG,CAAAA,CAAS,QAAA,CAAA,QAAA,CAEzD,CAAA,CACAmC,cAAAA,CAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,KAAA,CAAO,CACL,GAAGtC,CAAAA,CACH,eAAA,CAAiB,oBAAA,CACjB,KAAA,CAAO,OAAA,CACP,WAAA,CAAa,oBACf,CAAA,CACA,OAAA,CAASkC,CAAAA,CACV,QAAA,CAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,EAzLkB,IA2LtB","file":"ImagePositionDialog-KMK7ROV2.cjs","sourcesContent":["/**\n * Image Position Dialog\n *\n * Modal for editing image positioning settings:\n * - Horizontal: alignment or offset, relative to page/column/margin/paragraph\n * - Vertical: alignment or offset, relative to page/margin/paragraph/line\n * - Distance from text (top/bottom/left/right)\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface ImagePositionData {\n horizontal?: {\n relativeTo?: string;\n posOffset?: number;\n align?: string;\n };\n vertical?: {\n relativeTo?: string;\n posOffset?: number;\n align?: string;\n };\n distTop?: number;\n distBottom?: number;\n distLeft?: number;\n distRight?: number;\n}\n\nexport interface ImagePositionDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (data: ImagePositionData) => void;\n currentData?: ImagePositionData;\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 400,\n maxWidth: 480,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n};\n\nconst sectionStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n};\n\nconst sectionLabelStyle: CSSProperties = {\n fontSize: 13,\n fontWeight: 600,\n color: 'var(--doc-text)',\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n};\n\nconst labelStyle: CSSProperties = {\n width: 75,\n fontSize: 12,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '4px 6px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 12,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function ImagePositionDialog({\n isOpen,\n onClose,\n onApply,\n currentData,\n}: ImagePositionDialogProps): React.ReactElement | null {\n const [hMode, setHMode] = useState<'align' | 'offset'>('align');\n const [hAlign, setHAlign] = useState('center');\n const [hRelativeTo, setHRelativeTo] = useState('column');\n const [hOffset, setHOffset] = useState(0);\n\n const [vMode, setVMode] = useState<'align' | 'offset'>('align');\n const [vAlign, setVAlign] = useState('top');\n const [vRelativeTo, setVRelativeTo] = useState('paragraph');\n const [vOffset, setVOffset] = useState(0);\n\n const [distTop, setDistTop] = useState(0);\n const [distBottom, setDistBottom] = useState(0);\n const [distLeft, setDistLeft] = useState(0);\n const [distRight, setDistRight] = useState(0);\n\n useEffect(() => {\n if (!isOpen) return;\n const h = currentData?.horizontal;\n const v = currentData?.vertical;\n if (h?.align) {\n setHMode('align');\n setHAlign(h.align);\n } else if (h?.posOffset != null) {\n setHMode('offset');\n setHOffset(h.posOffset);\n }\n if (h?.relativeTo) setHRelativeTo(h.relativeTo);\n\n if (v?.align) {\n setVMode('align');\n setVAlign(v.align);\n } else if (v?.posOffset != null) {\n setVMode('offset');\n setVOffset(v.posOffset);\n }\n if (v?.relativeTo) setVRelativeTo(v.relativeTo);\n\n setDistTop(currentData?.distTop ?? 0);\n setDistBottom(currentData?.distBottom ?? 0);\n setDistLeft(currentData?.distLeft ?? 0);\n setDistRight(currentData?.distRight ?? 0);\n }, [isOpen, currentData]);\n\n const handleApply = useCallback(() => {\n const data: ImagePositionData = {};\n data.horizontal = {\n relativeTo: hRelativeTo,\n ...(hMode === 'align' ? { align: hAlign } : { posOffset: hOffset }),\n };\n data.vertical = {\n relativeTo: vRelativeTo,\n ...(vMode === 'align' ? { align: vAlign } : { posOffset: vOffset }),\n };\n data.distTop = distTop;\n data.distBottom = distBottom;\n data.distLeft = distLeft;\n data.distRight = distRight;\n onApply(data);\n onClose();\n }, [\n hMode,\n hAlign,\n hRelativeTo,\n hOffset,\n vMode,\n vAlign,\n vRelativeTo,\n vOffset,\n distTop,\n distBottom,\n distLeft,\n distRight,\n onApply,\n onClose,\n ]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter') handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Image position\"\n >\n <div style={headerStyle}>Image Position</div>\n\n <div style={bodyStyle}>\n {/* Horizontal positioning */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Horizontal</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Position</label>\n <select\n style={selectStyle}\n value={hMode}\n onChange={(e) => setHMode(e.target.value as 'align' | 'offset')}\n >\n <option value=\"align\">Alignment</option>\n <option value=\"offset\">Offset</option>\n </select>\n </div>\n {hMode === 'align' ? (\n <div style={rowStyle}>\n <label style={labelStyle}>Align</label>\n <select\n style={selectStyle}\n value={hAlign}\n onChange={(e) => setHAlign(e.target.value)}\n >\n <option value=\"left\">Left</option>\n <option value=\"center\">Center</option>\n <option value=\"right\">Right</option>\n </select>\n </div>\n ) : (\n <div style={rowStyle}>\n <label style={labelStyle}>Offset (px)</label>\n <input\n type=\"number\"\n style={inputStyle}\n value={hOffset}\n onChange={(e) => setHOffset(Number(e.target.value) || 0)}\n />\n </div>\n )}\n <div style={rowStyle}>\n <label style={labelStyle}>Relative to</label>\n <select\n style={selectStyle}\n value={hRelativeTo}\n onChange={(e) => setHRelativeTo(e.target.value)}\n >\n <option value=\"page\">Page</option>\n <option value=\"column\">Column</option>\n <option value=\"margin\">Margin</option>\n <option value=\"character\">Character</option>\n </select>\n </div>\n </div>\n\n {/* Vertical positioning */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Vertical</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Position</label>\n <select\n style={selectStyle}\n value={vMode}\n onChange={(e) => setVMode(e.target.value as 'align' | 'offset')}\n >\n <option value=\"align\">Alignment</option>\n <option value=\"offset\">Offset</option>\n </select>\n </div>\n {vMode === 'align' ? (\n <div style={rowStyle}>\n <label style={labelStyle}>Align</label>\n <select\n style={selectStyle}\n value={vAlign}\n onChange={(e) => setVAlign(e.target.value)}\n >\n <option value=\"top\">Top</option>\n <option value=\"center\">Center</option>\n <option value=\"bottom\">Bottom</option>\n </select>\n </div>\n ) : (\n <div style={rowStyle}>\n <label style={labelStyle}>Offset (px)</label>\n <input\n type=\"number\"\n style={inputStyle}\n value={vOffset}\n onChange={(e) => setVOffset(Number(e.target.value) || 0)}\n />\n </div>\n )}\n <div style={rowStyle}>\n <label style={labelStyle}>Relative to</label>\n <select\n style={selectStyle}\n value={vRelativeTo}\n onChange={(e) => setVRelativeTo(e.target.value)}\n >\n <option value=\"page\">Page</option>\n <option value=\"margin\">Margin</option>\n <option value=\"paragraph\">Paragraph</option>\n <option value=\"line\">Line</option>\n </select>\n </div>\n </div>\n\n {/* Distance from text */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Distance from text (px)</div>\n <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }}>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Top</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distTop}\n onChange={(e) => setDistTop(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Bottom</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distBottom}\n onChange={(e) => setDistBottom(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Left</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distLeft}\n onChange={(e) => setDistLeft(Number(e.target.value) || 0)}\n />\n </div>\n <div style={rowStyle}>\n <label style={{ ...labelStyle, width: 45 }}>Right</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n value={distRight}\n onChange={(e) => setDistRight(Number(e.target.value) || 0)}\n />\n </div>\n </div>\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1,2 @@
1
- import'./chunk-OWMXCVKB.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=useState(""),[r,x]=useState(0),[d,y]=useState("#000000"),[a,f]=useState("solid");useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsx("div",{style:w,children:"Image Properties"}),jsxs("div",{style:R,children:[jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Alt Text"}),jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Border"}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Style"}),jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsx("option",{value:"solid",children:"Solid"}),jsx("option",{value:"dashed",children:"Dashed"}),jsx("option",{value:"dotted",children:"Dotted"}),jsx("option",{value:"double",children:"Double"}),jsx("option",{value:"groove",children:"Groove"}),jsx("option",{value:"ridge",children:"Ridge"}),jsx("option",{value:"inset",children:"Inset"}),jsx("option",{value:"outset",children:"Outset"})]})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Color"}),jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxs("div",{style:B,children:[jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}export{T as ImagePropertiesDialog};
1
+ import'./chunk-Y6VCTLCJ.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=useState(""),[r,x]=useState(0),[d,y]=useState("#000000"),[a,f]=useState("solid");useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsx("div",{style:w,children:"Image Properties"}),jsxs("div",{style:R,children:[jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Alt Text"}),jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Border"}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Style"}),jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsx("option",{value:"solid",children:"Solid"}),jsx("option",{value:"dashed",children:"Dashed"}),jsx("option",{value:"dotted",children:"Dotted"}),jsx("option",{value:"double",children:"Double"}),jsx("option",{value:"groove",children:"Groove"}),jsx("option",{value:"ridge",children:"Ridge"}),jsx("option",{value:"inset",children:"Inset"}),jsx("option",{value:"outset",children:"Outset"})]})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Color"}),jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxs("div",{style:B,children:[jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}export{T as ImagePropertiesDialog};//# sourceMappingURL=ImagePropertiesDialog-ERFCUVCW.js.map
2
+ //# sourceMappingURL=ImagePropertiesDialog-ERFCUVCW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/ImagePropertiesDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","sectionStyle","sectionLabelStyle","rowStyle","labelStyle","inputStyle","selectStyle","textareaStyle","footerStyle","btnStyle","ImagePropertiesDialog","isOpen","onClose","onApply","currentData","alt","setAlt","useState","borderWidth","setBorderWidth","borderColor","setBorderColor","borderStyle","setBorderStyle","useEffect","handleApply","useCallback","handleKeyDown","e","jsx","jsxs"],"mappings":"wHAiCA,IAAMA,CAAAA,CAA8B,CAClC,QAAA,CAAU,OAAA,CACV,GAAA,CAAK,CAAA,CACL,KAAM,CAAA,CACN,KAAA,CAAO,CAAA,CACP,MAAA,CAAQ,EACR,eAAA,CAAiB,oBAAA,CACjB,OAAA,CAAS,MAAA,CACT,WAAY,QAAA,CACZ,cAAA,CAAgB,QAAA,CAChB,MAAA,CAAQ,GACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,eAAA,CAAiB,QACjB,YAAA,CAAc,CAAA,CACd,SAAA,CAAW,gCAAA,CACX,SAAU,GAAA,CACV,QAAA,CAAU,GAAA,CACV,KAAA,CAAO,OACP,MAAA,CAAQ,EACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,OAAA,CAAS,gBAAA,CACT,YAAA,CAAc,6BAAA,CACd,SAAU,EAAA,CACV,UAAA,CAAY,GACd,CAAA,CAEMC,EAA2B,CAC/B,OAAA,CAAS,WAAA,CACT,OAA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AA,CACL,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,eAAA,CAAiB,oBAAA,CACjB,KAAA,CAAO,QACP,WAAA,CAAa,oBACf,CAAA,CACA,OAAA,CAASgB,EACV,QAAA,CAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,EAnHkB,IAqHtB","file":"ImagePropertiesDialog-ERFCUVCW.js","sourcesContent":["/**\n * Image Properties Dialog\n *\n * Modal for editing image properties:\n * - Alt text for accessibility\n * - Border/outline style, color, and width\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface ImagePropertiesData {\n alt?: string;\n borderWidth?: number;\n borderColor?: string;\n borderStyle?: string;\n}\n\nexport interface ImagePropertiesDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (data: ImagePropertiesData) => void;\n currentData?: ImagePropertiesData;\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 380,\n maxWidth: 440,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n};\n\nconst sectionStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n};\n\nconst sectionLabelStyle: CSSProperties = {\n fontSize: 13,\n fontWeight: 600,\n color: 'var(--doc-text)',\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n};\n\nconst labelStyle: CSSProperties = {\n width: 60,\n fontSize: 12,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '4px 6px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 12,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst textareaStyle: CSSProperties = {\n ...inputStyle,\n minHeight: 60,\n resize: 'vertical' as const,\n fontFamily: 'inherit',\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function ImagePropertiesDialog({\n isOpen,\n onClose,\n onApply,\n currentData,\n}: ImagePropertiesDialogProps): React.ReactElement | null {\n const [alt, setAlt] = useState('');\n const [borderWidth, setBorderWidth] = useState(0);\n const [borderColor, setBorderColor] = useState('#000000');\n const [borderStyle, setBorderStyle] = useState('solid');\n\n useEffect(() => {\n if (!isOpen) return;\n setAlt(currentData?.alt ?? '');\n setBorderWidth(currentData?.borderWidth ?? 0);\n setBorderColor(currentData?.borderColor ?? '#000000');\n setBorderStyle(currentData?.borderStyle ?? 'solid');\n }, [isOpen, currentData]);\n\n const handleApply = useCallback(() => {\n onApply({\n alt: alt || undefined,\n borderWidth: borderWidth > 0 ? borderWidth : undefined,\n borderColor: borderWidth > 0 ? borderColor : undefined,\n borderStyle: borderWidth > 0 ? borderStyle : undefined,\n });\n onClose();\n }, [alt, borderWidth, borderColor, borderStyle, onApply, onClose]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter' && !e.shiftKey) handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Image properties\"\n >\n <div style={headerStyle}>Image Properties</div>\n\n <div style={bodyStyle}>\n {/* Alt Text */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Alt Text</div>\n <textarea\n style={textareaStyle}\n value={alt}\n onChange={(e) => setAlt(e.target.value)}\n placeholder=\"Describe this image for accessibility...\"\n />\n </div>\n\n {/* Border / Outline */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Border</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Width</label>\n <input\n type=\"number\"\n style={{ ...inputStyle, maxWidth: 80 }}\n min={0}\n max={20}\n step={0.5}\n value={borderWidth}\n onChange={(e) => setBorderWidth(Number(e.target.value) || 0)}\n />\n <span style={{ fontSize: 12, color: 'var(--doc-text-muted)' }}>px</span>\n </div>\n <div style={rowStyle}>\n <label style={labelStyle}>Style</label>\n <select\n style={selectStyle}\n value={borderStyle}\n onChange={(e) => setBorderStyle(e.target.value)}\n >\n <option value=\"solid\">Solid</option>\n <option value=\"dashed\">Dashed</option>\n <option value=\"dotted\">Dotted</option>\n <option value=\"double\">Double</option>\n <option value=\"groove\">Groove</option>\n <option value=\"ridge\">Ridge</option>\n <option value=\"inset\">Inset</option>\n <option value=\"outset\">Outset</option>\n </select>\n </div>\n <div style={rowStyle}>\n <label style={labelStyle}>Color</label>\n <input\n type=\"color\"\n value={borderColor}\n onChange={(e) => setBorderColor(e.target.value)}\n style={{\n width: 32,\n height: 24,\n padding: 0,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n }}\n />\n <input\n type=\"text\"\n style={{ ...inputStyle, maxWidth: 90 }}\n value={borderColor}\n onChange={(e) => setBorderColor(e.target.value)}\n />\n </div>\n {borderWidth > 0 && (\n <div\n style={{\n marginTop: 4,\n padding: 8,\n border: `${borderWidth}px ${borderStyle} ${borderColor}`,\n borderRadius: 4,\n fontSize: 11,\n color: 'var(--doc-text-muted)',\n textAlign: 'center',\n }}\n >\n Preview\n </div>\n )}\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1,2 @@
1
- 'use strict';require('./chunk-VOWKSURW.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=react.useState(""),[r,x]=react.useState(0),[d,y]=react.useState("#000000"),[a,f]=react.useState("solid");react.useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=react.useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=react.useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsxRuntime.jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxRuntime.jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsxRuntime.jsx("div",{style:w,children:"Image Properties"}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Alt Text"}),jsxRuntime.jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Border"}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Style"}),jsxRuntime.jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:"Solid"}),jsxRuntime.jsx("option",{value:"dashed",children:"Dashed"}),jsxRuntime.jsx("option",{value:"dotted",children:"Dotted"}),jsxRuntime.jsx("option",{value:"double",children:"Double"}),jsxRuntime.jsx("option",{value:"groove",children:"Groove"}),jsxRuntime.jsx("option",{value:"ridge",children:"Ridge"}),jsxRuntime.jsx("option",{value:"inset",children:"Inset"}),jsxRuntime.jsx("option",{value:"outset",children:"Outset"})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Color"}),jsxRuntime.jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxRuntime.jsxs("div",{style:B,children:[jsxRuntime.jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}exports.ImagePropertiesDialog=T;
1
+ 'use strict';require('./chunk-QEBO3EQP.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=react.useState(""),[r,x]=react.useState(0),[d,y]=react.useState("#000000"),[a,f]=react.useState("solid");react.useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=react.useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=react.useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsxRuntime.jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxRuntime.jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsxRuntime.jsx("div",{style:w,children:"Image Properties"}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Alt Text"}),jsxRuntime.jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Border"}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Style"}),jsxRuntime.jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:"Solid"}),jsxRuntime.jsx("option",{value:"dashed",children:"Dashed"}),jsxRuntime.jsx("option",{value:"dotted",children:"Dotted"}),jsxRuntime.jsx("option",{value:"double",children:"Double"}),jsxRuntime.jsx("option",{value:"groove",children:"Groove"}),jsxRuntime.jsx("option",{value:"ridge",children:"Ridge"}),jsxRuntime.jsx("option",{value:"inset",children:"Inset"}),jsxRuntime.jsx("option",{value:"outset",children:"Outset"})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Color"}),jsxRuntime.jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxRuntime.jsxs("div",{style:B,children:[jsxRuntime.jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}exports.ImagePropertiesDialog=T;//# sourceMappingURL=ImagePropertiesDialog-USMMRK6X.cjs.map
2
+ //# sourceMappingURL=ImagePropertiesDialog-USMMRK6X.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/ImagePropertiesDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","sectionStyle","sectionLabelStyle","rowStyle","labelStyle","inputStyle","selectStyle","textareaStyle","footerStyle","btnStyle","ImagePropertiesDialog","isOpen","onClose","onApply","currentData","alt","setAlt","useState","borderWidth","setBorderWidth","borderColor","setBorderColor","borderStyle","setBorderStyle","useEffect","handleApply","useCallback","handleKeyDown","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AAA,CAAO,KAAK,EAChD,CAAA,CAAA,CACF,CAAA,CACCV,CAAAA,CAAc,CAAA,EACbW,eAAC,KAAA,CAAA,CACC,KAAA,CAAO,CACL,SAAA,CAAW,EACX,OAAA,CAAS,CAAA,CACT,MAAA,CAAQ,CAAA,EAAGX,CAAW,CAAA,GAAA,EAAMI,CAAW,CAAA,CAAA,EAAIF,CAAW,GACtD,YAAA,CAAc,CAAA,CACd,QAAA,CAAU,EAAA,CACV,MAAO,uBAAA,CACP,SAAA,CAAW,QACb,CAAA,CACD,mBAED,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAEAU,eAAAA,CAAC,OAAI,KAAA,CAAOtB,CAAAA,CACV,QAAA,CAAA,CAAAqB,cAAAA,CAAC,UAAO,IAAA,CAAK,QAAA,CAAS,KAAA,CAAOpB,CAAAA,CAAU,QAASG,CAAAA,CAAS,QAAA,CAAA,QAAA,CAEzD,CAAA,CACAiB,cAAAA,CAAC,UACC,IAAA,CAAK,QAAA,CACL,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,eAAA,CAAiB,oBAAA,CACjB,KAAA,CAAO,QACP,WAAA,CAAa,oBACf,CAAA,CACA,OAAA,CAASgB,EACV,QAAA,CAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,EAnHkB,IAqHtB","file":"ImagePropertiesDialog-USMMRK6X.cjs","sourcesContent":["/**\n * Image Properties Dialog\n *\n * Modal for editing image properties:\n * - Alt text for accessibility\n * - Border/outline style, color, and width\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface ImagePropertiesData {\n alt?: string;\n borderWidth?: number;\n borderColor?: string;\n borderStyle?: string;\n}\n\nexport interface ImagePropertiesDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (data: ImagePropertiesData) => void;\n currentData?: ImagePropertiesData;\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 380,\n maxWidth: 440,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 16,\n};\n\nconst sectionStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n};\n\nconst sectionLabelStyle: CSSProperties = {\n fontSize: 13,\n fontWeight: 600,\n color: 'var(--doc-text)',\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n};\n\nconst labelStyle: CSSProperties = {\n width: 60,\n fontSize: 12,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '4px 6px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 12,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst textareaStyle: CSSProperties = {\n ...inputStyle,\n minHeight: 60,\n resize: 'vertical' as const,\n fontFamily: 'inherit',\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function ImagePropertiesDialog({\n isOpen,\n onClose,\n onApply,\n currentData,\n}: ImagePropertiesDialogProps): React.ReactElement | null {\n const [alt, setAlt] = useState('');\n const [borderWidth, setBorderWidth] = useState(0);\n const [borderColor, setBorderColor] = useState('#000000');\n const [borderStyle, setBorderStyle] = useState('solid');\n\n useEffect(() => {\n if (!isOpen) return;\n setAlt(currentData?.alt ?? '');\n setBorderWidth(currentData?.borderWidth ?? 0);\n setBorderColor(currentData?.borderColor ?? '#000000');\n setBorderStyle(currentData?.borderStyle ?? 'solid');\n }, [isOpen, currentData]);\n\n const handleApply = useCallback(() => {\n onApply({\n alt: alt || undefined,\n borderWidth: borderWidth > 0 ? borderWidth : undefined,\n borderColor: borderWidth > 0 ? borderColor : undefined,\n borderStyle: borderWidth > 0 ? borderStyle : undefined,\n });\n onClose();\n }, [alt, borderWidth, borderColor, borderStyle, onApply, onClose]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter' && !e.shiftKey) handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Image properties\"\n >\n <div style={headerStyle}>Image Properties</div>\n\n <div style={bodyStyle}>\n {/* Alt Text */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Alt Text</div>\n <textarea\n style={textareaStyle}\n value={alt}\n onChange={(e) => setAlt(e.target.value)}\n placeholder=\"Describe this image for accessibility...\"\n />\n </div>\n\n {/* Border / Outline */}\n <div style={sectionStyle}>\n <div style={sectionLabelStyle}>Border</div>\n <div style={rowStyle}>\n <label style={labelStyle}>Width</label>\n <input\n type=\"number\"\n style={{ ...inputStyle, maxWidth: 80 }}\n min={0}\n max={20}\n step={0.5}\n value={borderWidth}\n onChange={(e) => setBorderWidth(Number(e.target.value) || 0)}\n />\n <span style={{ fontSize: 12, color: 'var(--doc-text-muted)' }}>px</span>\n </div>\n <div style={rowStyle}>\n <label style={labelStyle}>Style</label>\n <select\n style={selectStyle}\n value={borderStyle}\n onChange={(e) => setBorderStyle(e.target.value)}\n >\n <option value=\"solid\">Solid</option>\n <option value=\"dashed\">Dashed</option>\n <option value=\"dotted\">Dotted</option>\n <option value=\"double\">Double</option>\n <option value=\"groove\">Groove</option>\n <option value=\"ridge\">Ridge</option>\n <option value=\"inset\">Inset</option>\n <option value=\"outset\">Outset</option>\n </select>\n </div>\n <div style={rowStyle}>\n <label style={labelStyle}>Color</label>\n <input\n type=\"color\"\n value={borderColor}\n onChange={(e) => setBorderColor(e.target.value)}\n style={{\n width: 32,\n height: 24,\n padding: 0,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n }}\n />\n <input\n type=\"text\"\n style={{ ...inputStyle, maxWidth: 90 }}\n value={borderColor}\n onChange={(e) => setBorderColor(e.target.value)}\n />\n </div>\n {borderWidth > 0 && (\n <div\n style={{\n marginTop: 4,\n padding: 8,\n border: `${borderWidth}px ${borderStyle} ${borderColor}`,\n borderRadius: 4,\n fontSize: 11,\n color: 'var(--doc-text-muted)',\n textAlign: 'center',\n }}\n >\n Preview\n </div>\n )}\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1,2 @@
1
- 'use strict';require('./chunk-VOWKSURW.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=react.useState(i?.width||0),[l,f]=react.useState(i?.widthType||"auto"),[p,g]=react.useState(i?.justification||"left");react.useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=react.useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=react.useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsxRuntime.jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxRuntime.jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsxRuntime.jsx("div",{style:T,children:"Table Properties"}),jsxRuntime.jsxs("div",{style:k,children:[jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width type"}),jsxRuntime.jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"auto",children:"Auto"}),jsxRuntime.jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsxRuntime.jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Alignment"}),jsxRuntime.jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]})]}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}exports.TablePropertiesDialog=z;
1
+ 'use strict';require('./chunk-QEBO3EQP.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=react.useState(i?.width||0),[l,f]=react.useState(i?.widthType||"auto"),[p,g]=react.useState(i?.justification||"left");react.useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=react.useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=react.useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsxRuntime.jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxRuntime.jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsxRuntime.jsx("div",{style:T,children:"Table Properties"}),jsxRuntime.jsxs("div",{style:k,children:[jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width type"}),jsxRuntime.jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"auto",children:"Auto"}),jsxRuntime.jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsxRuntime.jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Alignment"}),jsxRuntime.jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]})]}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}exports.TablePropertiesDialog=z;//# sourceMappingURL=TablePropertiesDialog-72CIUAZT.cjs.map
2
+ //# sourceMappingURL=TablePropertiesDialog-72CIUAZT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/TablePropertiesDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","rowStyle","labelStyle","inputStyle","selectStyle","footerStyle","btnStyle","TablePropertiesDialog","isOpen","onClose","onApply","currentProps","width","setWidth","useState","widthType","setWidthType","justification","setJustification","useEffect","handleApply","useCallback","props","handleKeyDown","e","jsx","jsxs"],"mappings":"gHAoCA,IAAMA,EAA8B,CAClC,QAAA,CAAU,OAAA,CACV,GAAA,CAAK,CAAA,CACL,IAAA,CAAM,CAAA,CACN,KAAA,CAAO,CAAA,CACP,MAAA,CAAQ,CAAA,CACR,eAAA,CAAiB,oBAAA,CACjB,OAAA,CAAS,OACT,UAAA,CAAY,QAAA,CACZ,cAAA,CAAgB,QAAA,CAChB,MAAA,CAAQ,GACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,eAAA,CAAiB,OAAA,CACjB,YAAA,CAAc,CAAA,CACd,SAAA,CAAW,iCACX,QAAA,CAAU,GAAA,CACV,QAAA,CAAU,GAAA,CACV,KAAA,CAAO,MAAA,CACP,MAAA,CAAQ,EACV,CAAA,CAEMC,CAAAA,CAA6B,CACjC,OAAA,CAAS,gBAAA,CACT,YAAA,CAAc,8BACd,QAAA,CAAU,EAAA,CACV,UAAA,CAAY,GACd,CAAA,CAEMC,CAAAA,CAA2B,CAC/B,OAAA,CAAS,WAAA,CACT,OAAA,CAAS,MAAA,CACT,aAAA,CAAe,QAAA,CACf,GAAA,CAAK,EACP,C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A,CACH,eAAA,CAAiB,oBAAA,CACjB,KAAA,CAAO,OAAA,CACP,WAAA,CAAa,oBACf,CAAA,CACA,OAAA,CAASc,CAAAA,CACV,QAAA,CAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CA9EkB,IAgFtB","file":"TablePropertiesDialog-72CIUAZT.cjs","sourcesContent":["/**\n * Table Properties Dialog\n *\n * Modal for editing table-level settings:\n * - Preferred width (twips or percentage)\n * - Alignment (left, center, right)\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface TableProperties {\n width?: number | null;\n widthType?: string | null;\n justification?: 'left' | 'center' | 'right' | null;\n}\n\nexport interface TablePropertiesDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (props: TableProperties) => void;\n currentProps?: {\n width?: number;\n widthType?: string;\n justification?: string;\n };\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 360,\n maxWidth: 440,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n};\n\nconst labelStyle: CSSProperties = {\n width: 80,\n fontSize: 13,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '6px 8px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 13,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function TablePropertiesDialog({\n isOpen,\n onClose,\n onApply,\n currentProps,\n}: TablePropertiesDialogProps): React.ReactElement | null {\n const [width, setWidth] = useState<number>(currentProps?.width || 0);\n const [widthType, setWidthType] = useState<string>(currentProps?.widthType || 'auto');\n const [justification, setJustification] = useState<string>(currentProps?.justification || 'left');\n\n useEffect(() => {\n if (isOpen) {\n setWidth(currentProps?.width || 0);\n setWidthType(currentProps?.widthType || 'auto');\n setJustification(currentProps?.justification || 'left');\n }\n }, [isOpen, currentProps]);\n\n const handleApply = useCallback(() => {\n const props: TableProperties = {};\n if (widthType === 'auto') {\n props.width = null;\n props.widthType = 'auto';\n } else {\n props.width = width;\n props.widthType = widthType;\n }\n props.justification = justification as 'left' | 'center' | 'right';\n onApply(props);\n onClose();\n }, [width, widthType, justification, onApply, onClose]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter') handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Table properties\"\n >\n <div style={headerStyle}>Table Properties</div>\n\n <div style={bodyStyle}>\n {/* Width type */}\n <div style={rowStyle}>\n <label style={labelStyle}>Width type</label>\n <select\n style={selectStyle}\n value={widthType}\n onChange={(e) => setWidthType(e.target.value)}\n >\n <option value=\"auto\">Auto</option>\n <option value=\"dxa\">Fixed (twips)</option>\n <option value=\"pct\">Percentage</option>\n </select>\n </div>\n\n {/* Width value */}\n {widthType !== 'auto' && (\n <div style={rowStyle}>\n <label style={labelStyle}>Width</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n step={widthType === 'pct' ? 5 : 100}\n value={width}\n onChange={(e) => setWidth(Number(e.target.value) || 0)}\n />\n <span style={{ fontSize: 11, color: 'var(--doc-text-muted)' }}>\n {widthType === 'pct' ? '(50ths of %)' : 'tw'}\n </span>\n </div>\n )}\n\n {/* Alignment */}\n <div style={rowStyle}>\n <label style={labelStyle}>Alignment</label>\n <select\n style={selectStyle}\n value={justification}\n onChange={(e) => setJustification(e.target.value)}\n >\n <option value=\"left\">Left</option>\n <option value=\"center\">Center</option>\n <option value=\"right\">Right</option>\n </select>\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1,2 @@
1
- import'./chunk-OWMXCVKB.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=useState(i?.width||0),[l,f]=useState(i?.widthType||"auto"),[p,g]=useState(i?.justification||"left");useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsx("div",{style:T,children:"Table Properties"}),jsxs("div",{style:k,children:[jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width type"}),jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsx("option",{value:"auto",children:"Auto"}),jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Alignment"}),jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]})]}),jsxs("div",{style:R,children:[jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}export{z as TablePropertiesDialog};
1
+ import'./chunk-Y6VCTLCJ.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=useState(i?.width||0),[l,f]=useState(i?.widthType||"auto"),[p,g]=useState(i?.justification||"left");useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsx("div",{style:T,children:"Table Properties"}),jsxs("div",{style:k,children:[jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width type"}),jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsx("option",{value:"auto",children:"Auto"}),jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Alignment"}),jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]})]}),jsxs("div",{style:R,children:[jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}export{z as TablePropertiesDialog};//# sourceMappingURL=TablePropertiesDialog-EMUEVYB3.js.map
2
+ //# sourceMappingURL=TablePropertiesDialog-EMUEVYB3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/dialogs/TablePropertiesDialog.tsx"],"names":["overlayStyle","dialogStyle","headerStyle","bodyStyle","rowStyle","labelStyle","inputStyle","selectStyle","footerStyle","btnStyle","TablePropertiesDialog","isOpen","onClose","onApply","currentProps","width","setWidth","useState","widthType","setWidthType","justification","setJustification","useEffect","handleApply","useCallback","props","handleKeyDown","e","jsx","jsxs"],"mappings":"wHAoCA,IAAMA,EAA8B,CAClC,QAAA,CAAU,OAAA,CACV,GAAA,CAAK,CAAA,CACL,IAAA,CAAM,CAAA,CACN,KAAA,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AAA,CAAA,MAAA,CAAI,CAAA,CACzBA,GAAAA,CAAC,QAAA,CAAA,CAAO,KAAA,CAAM,QAAA,CAAS,QAAA,CAAA,QAAA,CAAM,CAAA,CAC7BA,GAAAA,CAAC,QAAA,CAAA,CAAO,MAAM,OAAA,CAAQ,QAAA,CAAA,OAAA,CAAK,CAAA,CAAA,CAC7B,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAEAC,IAAAA,CAAC,KAAA,CAAA,CAAI,KAAA,CAAOrB,CAAAA,CACV,QAAA,CAAA,CAAAoB,GAAAA,CAAC,QAAA,CAAA,CAAO,IAAA,CAAK,SAAS,KAAA,CAAOnB,CAAAA,CAAU,OAAA,CAASG,CAAAA,CAAS,QAAA,CAAA,QAAA,CAEzD,CAAA,CACAgB,GAAAA,CAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,KAAA,CAAO,CACL,GAAGnB,CAAAA,CACH,eAAA,CAAiB,oBAAA,CACjB,KAAA,CAAO,OAAA,CACP,WAAA,CAAa,oBACf,CAAA,CACA,OAAA,CAASc,CAAAA,CACV,QAAA,CAAA,OAAA,CAED,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CA9EkB,IAgFtB","file":"TablePropertiesDialog-EMUEVYB3.js","sourcesContent":["/**\n * Table Properties Dialog\n *\n * Modal for editing table-level settings:\n * - Preferred width (twips or percentage)\n * - Alignment (left, center, right)\n */\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { CSSProperties } from 'react';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface TableProperties {\n width?: number | null;\n widthType?: string | null;\n justification?: 'left' | 'center' | 'right' | null;\n}\n\nexport interface TablePropertiesDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onApply: (props: TableProperties) => void;\n currentProps?: {\n width?: number;\n widthType?: string;\n justification?: string;\n };\n}\n\n// ============================================================================\n// STYLES\n// ============================================================================\n\nconst overlayStyle: CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 10000,\n};\n\nconst dialogStyle: CSSProperties = {\n backgroundColor: 'white',\n borderRadius: 8,\n boxShadow: '0 4px 20px rgba(0, 0, 0, 0.15)',\n minWidth: 360,\n maxWidth: 440,\n width: '100%',\n margin: 20,\n};\n\nconst headerStyle: CSSProperties = {\n padding: '16px 20px 12px',\n borderBottom: '1px solid var(--doc-border)',\n fontSize: 16,\n fontWeight: 600,\n};\n\nconst bodyStyle: CSSProperties = {\n padding: '16px 20px',\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n};\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n};\n\nconst labelStyle: CSSProperties = {\n width: 80,\n fontSize: 13,\n color: 'var(--doc-text-muted)',\n};\n\nconst inputStyle: CSSProperties = {\n flex: 1,\n padding: '6px 8px',\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n fontSize: 13,\n};\n\nconst selectStyle: CSSProperties = {\n ...inputStyle,\n};\n\nconst footerStyle: CSSProperties = {\n padding: '12px 20px 16px',\n borderTop: '1px solid var(--doc-border)',\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8,\n};\n\nconst btnStyle: CSSProperties = {\n padding: '6px 16px',\n fontSize: 13,\n border: '1px solid var(--doc-border)',\n borderRadius: 4,\n cursor: 'pointer',\n};\n\n// ============================================================================\n// COMPONENT\n// ============================================================================\n\nexport function TablePropertiesDialog({\n isOpen,\n onClose,\n onApply,\n currentProps,\n}: TablePropertiesDialogProps): React.ReactElement | null {\n const [width, setWidth] = useState<number>(currentProps?.width || 0);\n const [widthType, setWidthType] = useState<string>(currentProps?.widthType || 'auto');\n const [justification, setJustification] = useState<string>(currentProps?.justification || 'left');\n\n useEffect(() => {\n if (isOpen) {\n setWidth(currentProps?.width || 0);\n setWidthType(currentProps?.widthType || 'auto');\n setJustification(currentProps?.justification || 'left');\n }\n }, [isOpen, currentProps]);\n\n const handleApply = useCallback(() => {\n const props: TableProperties = {};\n if (widthType === 'auto') {\n props.width = null;\n props.widthType = 'auto';\n } else {\n props.width = width;\n props.widthType = widthType;\n }\n props.justification = justification as 'left' | 'center' | 'right';\n onApply(props);\n onClose();\n }, [width, widthType, justification, onApply, onClose]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n if (e.key === 'Enter') handleApply();\n },\n [onClose, handleApply]\n );\n\n if (!isOpen) return null;\n\n return (\n <div style={overlayStyle} onClick={onClose} onKeyDown={handleKeyDown}>\n <div\n style={dialogStyle}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-label=\"Table properties\"\n >\n <div style={headerStyle}>Table Properties</div>\n\n <div style={bodyStyle}>\n {/* Width type */}\n <div style={rowStyle}>\n <label style={labelStyle}>Width type</label>\n <select\n style={selectStyle}\n value={widthType}\n onChange={(e) => setWidthType(e.target.value)}\n >\n <option value=\"auto\">Auto</option>\n <option value=\"dxa\">Fixed (twips)</option>\n <option value=\"pct\">Percentage</option>\n </select>\n </div>\n\n {/* Width value */}\n {widthType !== 'auto' && (\n <div style={rowStyle}>\n <label style={labelStyle}>Width</label>\n <input\n type=\"number\"\n style={inputStyle}\n min={0}\n step={widthType === 'pct' ? 5 : 100}\n value={width}\n onChange={(e) => setWidth(Number(e.target.value) || 0)}\n />\n <span style={{ fontSize: 11, color: 'var(--doc-text-muted)' }}>\n {widthType === 'pct' ? '(50ths of %)' : 'tw'}\n </span>\n </div>\n )}\n\n {/* Alignment */}\n <div style={rowStyle}>\n <label style={labelStyle}>Alignment</label>\n <select\n style={selectStyle}\n value={justification}\n onChange={(e) => setJustification(e.target.value)}\n >\n <option value=\"left\">Left</option>\n <option value=\"center\">Center</option>\n <option value=\"right\">Right</option>\n </select>\n </div>\n </div>\n\n <div style={footerStyle}>\n <button type=\"button\" style={btnStyle} onClick={onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n style={{\n ...btnStyle,\n backgroundColor: 'var(--doc-primary)',\n color: 'white',\n borderColor: 'var(--doc-primary)',\n }}\n onClick={handleApply}\n >\n Apply\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}