le-kit 0.1.13 → 0.1.14

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 (337) hide show
  1. package/dist/core/cjs/{index-BsRb_UTe.js → index-B0mg71He.js} +6 -6
  2. package/dist/core/cjs/index-B0mg71He.js.map +1 -0
  3. package/dist/core/cjs/index.cjs.js +2 -2
  4. package/dist/core/cjs/le-box.cjs.entry.js +2 -2
  5. package/dist/core/cjs/le-button.cjs.entry.js +2 -2
  6. package/dist/core/cjs/le-card.cjs.entry.js +2 -2
  7. package/dist/core/cjs/le-checkbox.cjs.entry.js +2 -2
  8. package/dist/core/cjs/le-kit.cjs.js +1 -1
  9. package/dist/core/cjs/le-number-input.cjs.entry.js +2 -2
  10. package/dist/core/cjs/le-popover.cjs.entry.js +1 -1
  11. package/dist/core/cjs/le-popup.cjs.entry.js +1 -1
  12. package/dist/core/cjs/le-round-progress.cjs.entry.js +1 -1
  13. package/dist/core/cjs/le-stack.cjs.entry.js +2 -2
  14. package/dist/core/cjs/le-string-input.cjs.entry.js +2 -2
  15. package/dist/core/cjs/le-text.cjs.entry.js +2 -2
  16. package/dist/core/cjs/le-turntable.cjs.entry.js +1 -1
  17. package/dist/core/cjs/loader.cjs.js +1 -1
  18. package/dist/{cjs/utils-DqhadIxH.js → core/cjs/utils-jdqP71LP.js} +3 -3
  19. package/dist/core/cjs/{utils-nsP8_w8_.js.map → utils-jdqP71LP.js.map} +1 -1
  20. package/dist/core/collection/global/app.js +4 -4
  21. package/dist/core/collection/global/app.js.map +1 -1
  22. package/dist/core/components/index.js.map +1 -1
  23. package/dist/core/components/le-box.js +34 -2
  24. package/dist/core/components/le-box.js.map +1 -1
  25. package/dist/core/components/le-button.js +1 -1
  26. package/dist/core/components/le-button2.js +1031 -6
  27. package/dist/core/components/le-button2.js.map +1 -1
  28. package/dist/core/components/le-card.js +36 -4
  29. package/dist/core/components/le-card.js.map +1 -1
  30. package/dist/core/components/le-checkbox.js +1 -79
  31. package/dist/core/components/le-checkbox.js.map +1 -1
  32. package/dist/core/components/le-component.d.ts +11 -0
  33. package/dist/core/components/le-number-input.js +30 -4
  34. package/dist/core/components/le-number-input.js.map +1 -1
  35. package/dist/core/components/le-popover.js +1 -377
  36. package/dist/core/components/le-popover.js.map +1 -1
  37. package/dist/core/components/le-popup.js +30 -4
  38. package/dist/core/components/le-popup.js.map +1 -1
  39. package/dist/core/components/le-round-progress.js +1 -1
  40. package/dist/core/components/le-round-progress.js.map +1 -1
  41. package/dist/core/components/le-slot.d.ts +11 -0
  42. package/dist/core/components/le-stack.js +36 -4
  43. package/dist/core/components/le-stack.js.map +1 -1
  44. package/dist/core/components/le-string-input.js +1 -119
  45. package/dist/core/components/le-string-input.js.map +1 -1
  46. package/dist/core/components/le-text.js +34 -2
  47. package/dist/core/components/le-text.js.map +1 -1
  48. package/dist/core/components/le-turntable.js +1 -1
  49. package/dist/core/components/le-turntable.js.map +1 -1
  50. package/dist/core/components/utils.js +4 -4
  51. package/dist/core/components/utils.js.map +1 -1
  52. package/dist/core/esm/{index-CJ-z5Zj1.js → index-SKsXnjWI.js} +6 -6
  53. package/dist/core/{le-kit/p-CJ-z5Zj1.js.map → esm/index-SKsXnjWI.js.map} +1 -1
  54. package/dist/core/esm/index.js +2 -2
  55. package/dist/core/esm/le-box.entry.js +2 -2
  56. package/dist/core/esm/le-button.entry.js +2 -2
  57. package/dist/core/esm/le-card.entry.js +2 -2
  58. package/dist/core/esm/le-checkbox.entry.js +2 -2
  59. package/dist/core/esm/le-kit.js +2 -2
  60. package/dist/core/esm/le-number-input.entry.js +2 -2
  61. package/dist/core/esm/le-popover.entry.js +1 -1
  62. package/dist/core/esm/le-popup.entry.js +1 -1
  63. package/dist/core/esm/le-round-progress.entry.js +1 -1
  64. package/dist/core/esm/le-stack.entry.js +2 -2
  65. package/dist/core/esm/le-string-input.entry.js +2 -2
  66. package/dist/core/esm/le-text.entry.js +2 -2
  67. package/dist/core/esm/le-turntable.entry.js +1 -1
  68. package/dist/core/esm/loader.js +2 -2
  69. package/dist/{esm/utils-Cf7fMI0j.js → core/esm/utils-DZdP1JiG.js} +3 -3
  70. package/dist/core/esm/{utils-Bxmld82M.js.map → utils-DZdP1JiG.js.map} +1 -1
  71. package/dist/core/le-kit/index.esm.js +1 -1
  72. package/dist/core/le-kit/le-kit.esm.js +1 -1
  73. package/dist/core/le-kit/p--VxUdzYV.js +2 -0
  74. package/dist/core/le-kit/{p-Drz36PDp.js.map → p--VxUdzYV.js.map} +1 -1
  75. package/dist/core/le-kit/{p-2ac4789a.entry.js → p-189cb775.entry.js} +2 -2
  76. package/dist/core/le-kit/{p-556086ca.entry.js → p-35c1d413.entry.js} +2 -2
  77. package/dist/core/le-kit/{p-aa6e906f.entry.js → p-4f133e72.entry.js} +2 -2
  78. package/dist/core/le-kit/{p-df552906.entry.js → p-55f70091.entry.js} +2 -2
  79. package/dist/core/le-kit/{p-e0861e82.entry.js → p-5fd7b23a.entry.js} +2 -2
  80. package/dist/core/le-kit/{p-5ef81068.entry.js → p-6e414a5c.entry.js} +2 -2
  81. package/dist/core/le-kit/{p-d75214f9.entry.js → p-7b121ca7.entry.js} +2 -2
  82. package/dist/core/le-kit/{p-45eace7c.entry.js → p-8c81fa95.entry.js} +2 -2
  83. package/dist/core/le-kit/{p-257495cc.entry.js → p-9aa81442.entry.js} +2 -2
  84. package/dist/core/le-kit/p-SKsXnjWI.js +3 -0
  85. package/dist/core/le-kit/p-SKsXnjWI.js.map +1 -0
  86. package/dist/core/le-kit/{p-66d35f48.entry.js → p-a9d05ef6.entry.js} +2 -2
  87. package/dist/core/le-kit/{p-73682c5e.entry.js → p-b2bd2a80.entry.js} +2 -2
  88. package/dist/core/le-kit/{p-0308bd1f.entry.js → p-ccac9611.entry.js} +2 -2
  89. package/dist/core/types/global/app.d.ts +4 -4
  90. package/dist/le-kit/assets/custom-elements.json +1007 -1007
  91. package/dist/le-kit/index-CAY3Hk_i.js +4559 -0
  92. package/dist/le-kit/index-CAY3Hk_i.js.map +1 -0
  93. package/dist/le-kit/index.esm.js +116 -2
  94. package/dist/le-kit/index.esm.js.map +1 -1
  95. package/dist/{esm → le-kit}/le-box.entry.js +3 -3
  96. package/dist/le-kit/le-button.entry.esm.js.map +1 -0
  97. package/dist/le-kit/le-button.entry.js +90 -0
  98. package/dist/{esm → le-kit}/le-card.entry.js +3 -3
  99. package/dist/le-kit/le-checkbox.entry.esm.js.map +1 -0
  100. package/dist/le-kit/le-checkbox.entry.js +59 -0
  101. package/dist/le-kit/le-component.entry.esm.js.map +1 -0
  102. package/dist/{collection/components/le-component/le-component.js → le-kit/le-component.entry.js} +19 -138
  103. package/dist/le-kit/le-kit.css +1010 -1
  104. package/dist/le-kit/le-kit.esm.js +48 -2
  105. package/dist/le-kit/le-kit.esm.js.map +1 -1
  106. package/dist/{esm → le-kit}/le-number-input.entry.js +5 -5
  107. package/dist/le-kit/le-popover.entry.esm.js.map +1 -0
  108. package/dist/{collection/components/le-popover/le-popover.js → le-kit/le-popover.entry.js} +16 -363
  109. package/dist/{esm → le-kit}/le-popup.entry.js +6 -6
  110. package/dist/{esm → le-kit}/le-round-progress.entry.js +2 -2
  111. package/dist/le-kit/le-slot.entry.esm.js.map +1 -0
  112. package/dist/{collection/components/le-slot/le-slot.js → le-kit/le-slot.entry.js} +20 -273
  113. package/dist/{esm → le-kit}/le-stack.entry.js +3 -3
  114. package/dist/le-kit/le-string-input.entry.esm.js.map +1 -0
  115. package/dist/le-kit/le-string-input.entry.js +93 -0
  116. package/dist/{esm → le-kit}/le-text.entry.js +3 -3
  117. package/dist/{esm → le-kit}/le-turntable.entry.js +2 -2
  118. package/dist/{core/esm/utils-Bxmld82M.js → le-kit/utils-cwSNy7ZS.js} +3 -3
  119. package/dist/{esm/utils-Cf7fMI0j.js.map → le-kit/utils-cwSNy7ZS.js.map} +1 -1
  120. package/dist/types/global/app.d.ts +4 -4
  121. package/package.json +3 -4
  122. package/readme.md +2 -2
  123. package/custom-elements.json +0 -4305
  124. package/dist/cjs/index-o1DRKw1g.js +0 -1842
  125. package/dist/cjs/index-o1DRKw1g.js.map +0 -1
  126. package/dist/cjs/index.cjs.js +0 -119
  127. package/dist/cjs/index.cjs.js.map +0 -1
  128. package/dist/cjs/le-box.cjs.entry.js +0 -184
  129. package/dist/cjs/le-box.entry.cjs.js.map +0 -1
  130. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +0 -1
  131. package/dist/cjs/le-button_6.cjs.entry.js +0 -1206
  132. package/dist/cjs/le-card.cjs.entry.js +0 -29
  133. package/dist/cjs/le-card.entry.cjs.js.map +0 -1
  134. package/dist/cjs/le-kit.cjs.js +0 -25
  135. package/dist/cjs/le-kit.cjs.js.map +0 -1
  136. package/dist/cjs/le-number-input.cjs.entry.js +0 -202
  137. package/dist/cjs/le-number-input.entry.cjs.js.map +0 -1
  138. package/dist/cjs/le-popup.cjs.entry.js +0 -212
  139. package/dist/cjs/le-popup.entry.cjs.js.map +0 -1
  140. package/dist/cjs/le-round-progress.cjs.entry.js +0 -106
  141. package/dist/cjs/le-round-progress.entry.cjs.js.map +0 -1
  142. package/dist/cjs/le-stack.cjs.entry.js +0 -135
  143. package/dist/cjs/le-stack.entry.cjs.js.map +0 -1
  144. package/dist/cjs/le-text.cjs.entry.js +0 -335
  145. package/dist/cjs/le-text.entry.cjs.js.map +0 -1
  146. package/dist/cjs/le-turntable.cjs.entry.js +0 -139
  147. package/dist/cjs/le-turntable.entry.cjs.js.map +0 -1
  148. package/dist/cjs/loader.cjs.js +0 -13
  149. package/dist/cjs/loader.cjs.js.map +0 -1
  150. package/dist/cjs/utils-DqhadIxH.js.map +0 -1
  151. package/dist/collection/assets/custom-elements.json +0 -4305
  152. package/dist/collection/collection-manifest.json +0 -26
  153. package/dist/collection/components/le-box/le-box.default.css +0 -37
  154. package/dist/collection/components/le-box/le-box.js +0 -614
  155. package/dist/collection/components/le-box/le-box.js.map +0 -1
  156. package/dist/collection/components/le-button/le-button.default.css +0 -263
  157. package/dist/collection/components/le-button/le-button.js +0 -368
  158. package/dist/collection/components/le-button/le-button.js.map +0 -1
  159. package/dist/collection/components/le-card/le-card.default.css +0 -74
  160. package/dist/collection/components/le-card/le-card.js +0 -102
  161. package/dist/collection/components/le-card/le-card.js.map +0 -1
  162. package/dist/collection/components/le-checkbox/le-checkbox.css +0 -93
  163. package/dist/collection/components/le-checkbox/le-checkbox.js +0 -192
  164. package/dist/collection/components/le-checkbox/le-checkbox.js.map +0 -1
  165. package/dist/collection/components/le-component/le-component.css +0 -189
  166. package/dist/collection/components/le-component/le-component.js.map +0 -1
  167. package/dist/collection/components/le-number-input/le-number-input.css +0 -135
  168. package/dist/collection/components/le-number-input/le-number-input.js +0 -515
  169. package/dist/collection/components/le-number-input/le-number-input.js.map +0 -1
  170. package/dist/collection/components/le-popover/le-popover.css +0 -143
  171. package/dist/collection/components/le-popover/le-popover.js.map +0 -1
  172. package/dist/collection/components/le-popup/le-popup.api.js +0 -101
  173. package/dist/collection/components/le-popup/le-popup.api.js.map +0 -1
  174. package/dist/collection/components/le-popup/le-popup.css +0 -222
  175. package/dist/collection/components/le-popup/le-popup.js +0 -596
  176. package/dist/collection/components/le-popup/le-popup.js.map +0 -1
  177. package/dist/collection/components/le-round-progress/le-round-progress.css +0 -34
  178. package/dist/collection/components/le-round-progress/le-round-progress.js +0 -184
  179. package/dist/collection/components/le-round-progress/le-round-progress.js.map +0 -1
  180. package/dist/collection/components/le-slot/le-slot.default.css +0 -222
  181. package/dist/collection/components/le-slot/le-slot.js.map +0 -1
  182. package/dist/collection/components/le-stack/le-stack.default.css +0 -37
  183. package/dist/collection/components/le-stack/le-stack.js +0 -389
  184. package/dist/collection/components/le-stack/le-stack.js.map +0 -1
  185. package/dist/collection/components/le-string-input/le-string-input.css +0 -83
  186. package/dist/collection/components/le-string-input/le-string-input.js +0 -359
  187. package/dist/collection/components/le-string-input/le-string-input.js.map +0 -1
  188. package/dist/collection/components/le-text/le-text.default.css +0 -169
  189. package/dist/collection/components/le-text/le-text.js +0 -475
  190. package/dist/collection/components/le-text/le-text.js.map +0 -1
  191. package/dist/collection/components/le-turntable/le-turntable.css +0 -10
  192. package/dist/collection/components/le-turntable/le-turntable.js +0 -210
  193. package/dist/collection/components/le-turntable/le-turntable.js.map +0 -1
  194. package/dist/collection/global/app.js +0 -167
  195. package/dist/collection/global/app.js.map +0 -1
  196. package/dist/collection/index.js +0 -15
  197. package/dist/collection/index.js.map +0 -1
  198. package/dist/collection/types/blocks.js +0 -115
  199. package/dist/collection/types/blocks.js.map +0 -1
  200. package/dist/collection/types/options.js +0 -2
  201. package/dist/collection/types/options.js.map +0 -1
  202. package/dist/collection/utils/utils.js +0 -141
  203. package/dist/collection/utils/utils.js.map +0 -1
  204. package/dist/components/index.js +0 -113
  205. package/dist/components/index.js.map +0 -1
  206. package/dist/components/le-box.js +0 -257
  207. package/dist/components/le-box.js.map +0 -1
  208. package/dist/components/le-button.js +0 -9
  209. package/dist/components/le-button.js.map +0 -1
  210. package/dist/components/le-button2.js +0 -1149
  211. package/dist/components/le-button2.js.map +0 -1
  212. package/dist/components/le-card.js +0 -84
  213. package/dist/components/le-card.js.map +0 -1
  214. package/dist/components/le-checkbox.js +0 -9
  215. package/dist/components/le-checkbox.js.map +0 -1
  216. package/dist/components/le-number-input.js +0 -272
  217. package/dist/components/le-number-input.js.map +0 -1
  218. package/dist/components/le-popover.js +0 -9
  219. package/dist/components/le-popover.js.map +0 -1
  220. package/dist/components/le-popup.js +0 -279
  221. package/dist/components/le-popup.js.map +0 -1
  222. package/dist/components/le-round-progress.js +0 -135
  223. package/dist/components/le-round-progress.js.map +0 -1
  224. package/dist/components/le-stack.js +0 -199
  225. package/dist/components/le-stack.js.map +0 -1
  226. package/dist/components/le-string-input.js +0 -9
  227. package/dist/components/le-string-input.js.map +0 -1
  228. package/dist/components/le-text.js +0 -399
  229. package/dist/components/le-text.js.map +0 -1
  230. package/dist/components/le-turntable.js +0 -164
  231. package/dist/components/le-turntable.js.map +0 -1
  232. package/dist/components/utils.js +0 -310
  233. package/dist/components/utils.js.map +0 -1
  234. package/dist/core/cjs/index-BsRb_UTe.js.map +0 -1
  235. package/dist/core/cjs/utils-nsP8_w8_.js +0 -152
  236. package/dist/core/collection/assets/custom-elements.json +0 -4305
  237. package/dist/core/collection/themes/base.css +0 -89
  238. package/dist/core/collection/themes/dark.css +0 -100
  239. package/dist/core/collection/themes/default.css +0 -108
  240. package/dist/core/collection/themes/gradient.css +0 -100
  241. package/dist/core/collection/themes/index.css +0 -413
  242. package/dist/core/collection/themes/minimal.css +0 -100
  243. package/dist/core/collection/themes/warm.css +0 -100
  244. package/dist/core/esm/index-CJ-z5Zj1.js.map +0 -1
  245. package/dist/core/le-kit/p-CJ-z5Zj1.js +0 -3
  246. package/dist/core/le-kit/p-Drz36PDp.js +0 -2
  247. package/dist/docs.d.ts +0 -443
  248. package/dist/docs.json +0 -5185
  249. package/dist/esm/index-CwNQ1GTa.js +0 -1824
  250. package/dist/esm/index-CwNQ1GTa.js.map +0 -1
  251. package/dist/esm/index.js +0 -106
  252. package/dist/esm/index.js.map +0 -1
  253. package/dist/esm/le-box.entry.js.map +0 -1
  254. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +0 -1
  255. package/dist/esm/le-button_6.entry.js +0 -1199
  256. package/dist/esm/le-card.entry.js.map +0 -1
  257. package/dist/esm/le-kit.js +0 -21
  258. package/dist/esm/le-kit.js.map +0 -1
  259. package/dist/esm/le-number-input.entry.js.map +0 -1
  260. package/dist/esm/le-popup.entry.js.map +0 -1
  261. package/dist/esm/le-round-progress.entry.js.map +0 -1
  262. package/dist/esm/le-stack.entry.js.map +0 -1
  263. package/dist/esm/le-text.entry.js.map +0 -1
  264. package/dist/esm/le-turntable.entry.js.map +0 -1
  265. package/dist/esm/loader.js +0 -11
  266. package/dist/esm/loader.js.map +0 -1
  267. package/dist/index.cjs.js +0 -1
  268. package/dist/index.js +0 -1
  269. package/dist/le-kit/dist/collection/themes/base.css +0 -89
  270. package/dist/le-kit/dist/collection/themes/dark.css +0 -100
  271. package/dist/le-kit/dist/collection/themes/default.css +0 -108
  272. package/dist/le-kit/dist/collection/themes/gradient.css +0 -100
  273. package/dist/le-kit/dist/collection/themes/index.css +0 -413
  274. package/dist/le-kit/dist/collection/themes/minimal.css +0 -100
  275. package/dist/le-kit/dist/collection/themes/warm.css +0 -100
  276. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +0 -1
  277. package/dist/le-kit/p-08dbcc25.entry.js +0 -2
  278. package/dist/le-kit/p-08dbcc25.entry.js.map +0 -1
  279. package/dist/le-kit/p-5dc35729.entry.js +0 -2
  280. package/dist/le-kit/p-5dc35729.entry.js.map +0 -1
  281. package/dist/le-kit/p-64374730.entry.js +0 -2
  282. package/dist/le-kit/p-64374730.entry.js.map +0 -1
  283. package/dist/le-kit/p-79ec6f7c.entry.js +0 -2
  284. package/dist/le-kit/p-79ec6f7c.entry.js.map +0 -1
  285. package/dist/le-kit/p-8daf3c7f.entry.js +0 -2
  286. package/dist/le-kit/p-8daf3c7f.entry.js.map +0 -1
  287. package/dist/le-kit/p-9c69235d.entry.js +0 -2
  288. package/dist/le-kit/p-9c69235d.entry.js.map +0 -1
  289. package/dist/le-kit/p-CwNQ1GTa.js +0 -3
  290. package/dist/le-kit/p-CwNQ1GTa.js.map +0 -1
  291. package/dist/le-kit/p-ad398acd.entry.js +0 -2
  292. package/dist/le-kit/p-ad398acd.entry.js.map +0 -1
  293. package/dist/le-kit/p-b8122ad6.entry.js +0 -2
  294. package/dist/le-kit/p-b8122ad6.entry.js.map +0 -1
  295. package/dist/le-kit/p-f9008505.entry.js +0 -2
  296. package/dist/le-kit/p-f9008505.entry.js.map +0 -1
  297. package/dist/le-kit/p-y3FECAx9.js +0 -2
  298. package/dist/le-kit/p-y3FECAx9.js.map +0 -1
  299. package/dist/themes/base.css +0 -89
  300. package/dist/themes/dark.css +0 -100
  301. package/dist/themes/default.css +0 -108
  302. package/dist/themes/gradient.css +0 -100
  303. package/dist/themes/index.css +0 -413
  304. package/dist/themes/minimal.css +0 -100
  305. package/dist/themes/warm.css +0 -100
  306. /package/dist/{collection/dist/collection → components}/themes/base.css +0 -0
  307. /package/dist/{collection/dist/collection → components}/themes/dark.css +0 -0
  308. /package/dist/{collection/dist/collection → components}/themes/default.css +0 -0
  309. /package/dist/{collection/dist/collection → components}/themes/gradient.css +0 -0
  310. /package/dist/{collection/dist/collection → components}/themes/index.css +0 -0
  311. /package/dist/{collection/dist/collection → components}/themes/minimal.css +0 -0
  312. /package/dist/{collection/dist/collection → components}/themes/warm.css +0 -0
  313. /package/dist/{components → core/components}/le-component.js +0 -0
  314. /package/dist/{components → core/components}/le-component.js.map +0 -0
  315. /package/dist/{components → core/components}/le-popover2.js +0 -0
  316. /package/dist/{components → core/components}/le-popover2.js.map +0 -0
  317. /package/dist/{components → core/components}/le-slot.js +0 -0
  318. /package/dist/{components → core/components}/le-slot.js.map +0 -0
  319. /package/dist/core/le-kit/{p-2ac4789a.entry.js.map → p-189cb775.entry.js.map} +0 -0
  320. /package/dist/core/le-kit/{p-556086ca.entry.js.map → p-35c1d413.entry.js.map} +0 -0
  321. /package/dist/core/le-kit/{p-aa6e906f.entry.js.map → p-4f133e72.entry.js.map} +0 -0
  322. /package/dist/core/le-kit/{p-df552906.entry.js.map → p-55f70091.entry.js.map} +0 -0
  323. /package/dist/core/le-kit/{p-e0861e82.entry.js.map → p-5fd7b23a.entry.js.map} +0 -0
  324. /package/dist/core/le-kit/{p-5ef81068.entry.js.map → p-6e414a5c.entry.js.map} +0 -0
  325. /package/dist/core/le-kit/{p-d75214f9.entry.js.map → p-7b121ca7.entry.js.map} +0 -0
  326. /package/dist/core/le-kit/{p-45eace7c.entry.js.map → p-8c81fa95.entry.js.map} +0 -0
  327. /package/dist/core/le-kit/{p-257495cc.entry.js.map → p-9aa81442.entry.js.map} +0 -0
  328. /package/dist/core/le-kit/{p-66d35f48.entry.js.map → p-a9d05ef6.entry.js.map} +0 -0
  329. /package/dist/core/le-kit/{p-73682c5e.entry.js.map → p-b2bd2a80.entry.js.map} +0 -0
  330. /package/dist/core/le-kit/{p-0308bd1f.entry.js.map → p-ccac9611.entry.js.map} +0 -0
  331. /package/dist/{collection → le-kit/dist/components}/themes/base.css +0 -0
  332. /package/dist/{collection → le-kit/dist/components}/themes/dark.css +0 -0
  333. /package/dist/{collection → le-kit/dist/components}/themes/default.css +0 -0
  334. /package/dist/{collection → le-kit/dist/components}/themes/gradient.css +0 -0
  335. /package/dist/{collection → le-kit/dist/components}/themes/index.css +0 -0
  336. /package/dist/{collection → le-kit/dist/components}/themes/minimal.css +0 -0
  337. /package/dist/{collection → le-kit/dist/components}/themes/warm.css +0 -0
@@ -1,475 +0,0 @@
1
- import { h, Host } from "@stencil/core";
2
- import { observeModeChanges } from "../../utils/utils";
3
- /**
4
- * A text component with rich text editing capabilities in admin mode.
5
- *
6
- * `le-text` renders semantic text elements (headings, paragraphs, code, quotes)
7
- * and provides a Notion-like rich text editor in admin mode with formatting
8
- * toolbar for bold, italic, links, and paragraph type selection.
9
- *
10
- * @slot - Default slot for text content
11
- *
12
- * @cssprop --le-text-color - Text color
13
- * @cssprop --le-text-font-size - Font size
14
- * @cssprop --le-text-line-height - Line height
15
- * @cssprop --le-text-font-weight - Font weight
16
- *
17
- * @csspart text - The text container element
18
- *
19
- * @cmsEditable true
20
- * @cmsCategory Content
21
- */
22
- export class LeText {
23
- el;
24
- /**
25
- * The semantic variant/type of text element
26
- * @allowedValues p | h1 | h2 | h3 | h4 | h5 | h6 | code | quote | label | small
27
- */
28
- variant = 'p';
29
- /**
30
- * Text alignment
31
- * @allowedValues left | center | right | justify
32
- */
33
- align = 'left';
34
- /**
35
- * Text color (CSS value or theme token)
36
- */
37
- color;
38
- /**
39
- * Whether the text should truncate with ellipsis
40
- */
41
- truncate = false;
42
- /**
43
- * Maximum number of lines before truncating (requires truncate=true)
44
- */
45
- maxLines;
46
- /**
47
- * Internal state to track admin mode
48
- */
49
- adminMode = false;
50
- /**
51
- * The HTML content being edited
52
- */
53
- content = '';
54
- /**
55
- * Whether the editor is focused (shows toolbar)
56
- */
57
- isFocused = false;
58
- /**
59
- * Current selection state for toolbar button highlighting
60
- */
61
- selectionState = {
62
- isBold: false,
63
- isItalic: false,
64
- isUnderline: false,
65
- isStrikethrough: false,
66
- isLink: false,
67
- blockType: 'p',
68
- };
69
- /**
70
- * Reference to the contenteditable element
71
- */
72
- editorRef;
73
- /**
74
- * Reference to the slot element
75
- */
76
- slotRef;
77
- disconnectModeObserver;
78
- connectedCallback() {
79
- this.disconnectModeObserver = observeModeChanges(this.el, (mode) => {
80
- const wasAdmin = this.adminMode;
81
- this.adminMode = mode === 'admin';
82
- if (this.adminMode && !wasAdmin) {
83
- // Entering admin mode - read content from slot
84
- requestAnimationFrame(() => this.readSlottedContent());
85
- }
86
- else if (!this.adminMode && wasAdmin) {
87
- // Leaving admin mode - sync content back to slot
88
- this.syncContentToSlot();
89
- }
90
- });
91
- }
92
- disconnectedCallback() {
93
- this.disconnectModeObserver?.();
94
- }
95
- onVariantChange() {
96
- // When variant changes in admin mode, update the content wrapper
97
- if (this.adminMode && this.editorRef) {
98
- this.syncContentToSlot();
99
- }
100
- }
101
- /**
102
- * Read content from slotted elements
103
- */
104
- readSlottedContent() {
105
- if (!this.slotRef)
106
- return;
107
- const assignedNodes = this.slotRef.assignedNodes({ flatten: true });
108
- // Collect all content from assigned nodes
109
- let html = '';
110
- assignedNodes.forEach(node => {
111
- if (node.nodeType === Node.TEXT_NODE) {
112
- html += node.textContent;
113
- }
114
- else if (node.nodeType === Node.ELEMENT_NODE) {
115
- html += node.innerHTML || node.textContent;
116
- }
117
- });
118
- this.content = html.trim();
119
- }
120
- /**
121
- * Sync edited content back to the slot
122
- */
123
- syncContentToSlot() {
124
- if (!this.editorRef)
125
- return;
126
- const newContent = this.editorRef.innerHTML;
127
- // Update the light DOM content
128
- // We need to update the actual slotted content
129
- const slot = this.slotRef;
130
- if (slot) {
131
- const assignedNodes = slot.assignedNodes({ flatten: true });
132
- if (assignedNodes.length > 0) {
133
- const firstNode = assignedNodes[0];
134
- if (firstNode.nodeType === Node.ELEMENT_NODE) {
135
- firstNode.innerHTML = newContent;
136
- }
137
- else if (firstNode.nodeType === Node.TEXT_NODE) {
138
- // Replace text node with the new content
139
- const parent = firstNode.parentNode;
140
- if (parent) {
141
- // Create a temporary element to parse HTML
142
- const temp = document.createElement('span');
143
- temp.innerHTML = newContent;
144
- // Replace the text node
145
- parent.replaceChild(temp, firstNode);
146
- // Unwrap the span if it only contains text
147
- if (temp.childNodes.length === 1 && temp.firstChild?.nodeType === Node.TEXT_NODE) {
148
- parent.replaceChild(temp.firstChild, temp);
149
- }
150
- }
151
- }
152
- }
153
- else {
154
- // No assigned nodes, set innerHTML on the host's light DOM
155
- this.el.innerHTML = newContent;
156
- }
157
- }
158
- }
159
- /**
160
- * Handle input in the contenteditable
161
- */
162
- handleInput = () => {
163
- if (this.editorRef) {
164
- this.content = this.editorRef.innerHTML;
165
- this.updateSelectionState();
166
- }
167
- };
168
- /**
169
- * Handle focus on the editor
170
- */
171
- handleFocus = () => {
172
- this.isFocused = true;
173
- this.updateSelectionState();
174
- };
175
- /**
176
- * Handle blur on the editor
177
- */
178
- handleBlur = (e) => {
179
- // Check if focus moved to toolbar
180
- const relatedTarget = e.relatedTarget;
181
- const toolbar = this.el.shadowRoot?.querySelector('.le-text-toolbar');
182
- if (toolbar?.contains(relatedTarget)) {
183
- // Focus moved to toolbar, keep it open
184
- return;
185
- }
186
- // Small delay to allow toolbar clicks to register
187
- setTimeout(() => {
188
- if (!this.el.shadowRoot?.activeElement) {
189
- this.isFocused = false;
190
- this.syncContentToSlot();
191
- }
192
- }, 150);
193
- };
194
- /**
195
- * Handle selection change to update toolbar state
196
- */
197
- handleSelectionChange = () => {
198
- this.updateSelectionState();
199
- };
200
- /**
201
- * Update the selection state for toolbar highlighting
202
- */
203
- updateSelectionState() {
204
- const selection = window.getSelection();
205
- if (!selection || selection.rangeCount === 0)
206
- return;
207
- this.selectionState = {
208
- isBold: document.queryCommandState('bold'),
209
- isItalic: document.queryCommandState('italic'),
210
- isUnderline: document.queryCommandState('underline'),
211
- isStrikethrough: document.queryCommandState('strikeThrough'),
212
- isLink: this.isSelectionInLink(selection),
213
- blockType: this.variant,
214
- };
215
- }
216
- /**
217
- * Check if current selection is within a link
218
- */
219
- isSelectionInLink(selection) {
220
- if (!selection.anchorNode)
221
- return false;
222
- let node = selection.anchorNode;
223
- while (node && node !== this.editorRef) {
224
- if (node.nodeName === 'A')
225
- return true;
226
- node = node.parentNode;
227
- }
228
- return false;
229
- }
230
- /**
231
- * Execute a formatting command
232
- */
233
- execCommand(command, value) {
234
- // Focus the editor first
235
- this.editorRef?.focus();
236
- // Execute the command
237
- document.execCommand(command, false, value);
238
- // Update state
239
- this.handleInput();
240
- this.updateSelectionState();
241
- }
242
- /**
243
- * Toggle bold formatting
244
- */
245
- toggleBold = (e) => {
246
- e.preventDefault();
247
- this.execCommand('bold');
248
- };
249
- /**
250
- * Toggle italic formatting
251
- */
252
- toggleItalic = (e) => {
253
- e.preventDefault();
254
- this.execCommand('italic');
255
- };
256
- /**
257
- * Toggle underline formatting
258
- */
259
- toggleUnderline = (e) => {
260
- e.preventDefault();
261
- this.execCommand('underline');
262
- };
263
- /**
264
- * Toggle strikethrough formatting
265
- */
266
- toggleStrikethrough = (e) => {
267
- e.preventDefault();
268
- this.execCommand('strikeThrough');
269
- };
270
- /**
271
- * Add or edit a link
272
- */
273
- toggleLink = (e) => {
274
- e.preventDefault();
275
- if (this.selectionState.isLink) {
276
- // Remove link
277
- this.execCommand('unlink');
278
- }
279
- else {
280
- // Add link
281
- const url = prompt('Enter URL:', 'https://');
282
- if (url) {
283
- this.execCommand('createLink', url);
284
- }
285
- }
286
- };
287
- /**
288
- * Change the block type/variant
289
- */
290
- changeVariant = (e) => {
291
- const select = e.target;
292
- this.variant = select.value;
293
- };
294
- /**
295
- * Render the formatting toolbar
296
- */
297
- renderToolbar() {
298
- return (h("div", { class: "le-text-toolbar" }, h("select", { class: "le-text-toolbar-select", onChange: this.changeVariant, onMouseDown: (e) => e.preventDefault() }, h("option", { value: "p", selected: this.variant === 'p' }, "Paragraph"), h("option", { value: "h1", selected: this.variant === 'h1' }, "Heading 1"), h("option", { value: "h2", selected: this.variant === 'h2' }, "Heading 2"), h("option", { value: "h3", selected: this.variant === 'h3' }, "Heading 3"), h("option", { value: "h4", selected: this.variant === 'h4' }, "Heading 4"), h("option", { value: "h5", selected: this.variant === 'h5' }, "Heading 5"), h("option", { value: "h6", selected: this.variant === 'h6' }, "Heading 6"), h("option", { value: "quote", selected: this.variant === 'quote' }, "Quote"), h("option", { value: "code", selected: this.variant === 'code' }, "Code"), h("option", { value: "label", selected: this.variant === 'label' }, "Label"), h("option", { value: "small", selected: this.variant === 'small' }, "Small")), h("div", { class: "le-text-toolbar-divider" }), h("button", { type: "button", class: { 'le-text-toolbar-btn': true, 'active': this.selectionState.isBold }, onMouseDown: this.toggleBold, title: "Bold (Ctrl+B)" }, h("strong", null, "B")), h("button", { type: "button", class: { 'le-text-toolbar-btn': true, 'active': this.selectionState.isItalic }, onMouseDown: this.toggleItalic, title: "Italic (Ctrl+I)" }, h("em", null, "I")), h("button", { type: "button", class: { 'le-text-toolbar-btn': true, 'active': this.selectionState.isUnderline }, onMouseDown: this.toggleUnderline, title: "Underline (Ctrl+U)" }, h("span", { style: { textDecoration: 'underline' } }, "U")), h("button", { type: "button", class: { 'le-text-toolbar-btn': true, 'active': this.selectionState.isStrikethrough }, onMouseDown: this.toggleStrikethrough, title: "Strikethrough" }, h("span", { style: { textDecoration: 'line-through' } }, "S")), h("div", { class: "le-text-toolbar-divider" }), h("button", { type: "button", class: { 'le-text-toolbar-btn': true, 'active': this.selectionState.isLink }, onMouseDown: this.toggleLink, title: this.selectionState.isLink ? 'Remove link' : 'Add link' }, "\uD83D\uDD17")));
299
- }
300
- /**
301
- * Get the semantic tag for the current variant
302
- */
303
- getTag() {
304
- switch (this.variant) {
305
- case 'quote':
306
- return 'blockquote';
307
- case 'code':
308
- return 'pre';
309
- case 'label':
310
- return 'label';
311
- case 'small':
312
- return 'small';
313
- default:
314
- return this.variant; // h1-h6, p
315
- }
316
- }
317
- render() {
318
- const Tag = this.getTag();
319
- const textStyle = {};
320
- if (this.color) {
321
- textStyle.color = this.color;
322
- }
323
- if (this.align) {
324
- textStyle.textAlign = this.align;
325
- }
326
- const textClass = {
327
- 'le-text': true,
328
- [`variant-${this.variant}`]: true,
329
- 'truncate': this.truncate,
330
- [`max-lines-${this.maxLines}`]: this.truncate && this.maxLines,
331
- };
332
- // Admin mode - show rich text editor
333
- if (this.adminMode) {
334
- return (h(Host, { class: "admin-mode" }, h("le-component", { component: "le-text" }, h("div", { class: "le-text-editor-wrapper" }, this.isFocused && this.renderToolbar(), h(Tag, { class: textClass, part: "text", style: textStyle }, h("div", { ref: (el) => this.editorRef = el, class: "le-text-editor", contentEditable: true, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleSelectionChange, onMouseUp: this.handleSelectionChange, innerHTML: this.content })), h("div", { class: "hidden-slot" }, h("slot", { ref: (el) => this.slotRef = el, onSlotchange: () => this.readSlottedContent() }))))));
335
- }
336
- // Default mode - render semantic element with slotted content
337
- return (h(Host, null, h(Tag, { class: textClass, part: "text", style: textStyle }, h("slot", { ref: (el) => this.slotRef = el }))));
338
- }
339
- static get is() { return "le-text"; }
340
- static get encapsulation() { return "shadow"; }
341
- static get originalStyleUrls() {
342
- return {
343
- "$": ["le-text.default.css"]
344
- };
345
- }
346
- static get styleUrls() {
347
- return {
348
- "$": ["le-text.default.css"]
349
- };
350
- }
351
- static get properties() {
352
- return {
353
- "variant": {
354
- "type": "string",
355
- "mutable": true,
356
- "complexType": {
357
- "original": "'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'code' | 'quote' | 'label' | 'small'",
358
- "resolved": "\"code\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"label\" | \"p\" | \"quote\" | \"small\"",
359
- "references": {}
360
- },
361
- "required": false,
362
- "optional": false,
363
- "docs": {
364
- "tags": [{
365
- "name": "allowedValues",
366
- "text": "p | h1 | h2 | h3 | h4 | h5 | h6 | code | quote | label | small"
367
- }],
368
- "text": "The semantic variant/type of text element"
369
- },
370
- "getter": false,
371
- "setter": false,
372
- "reflect": true,
373
- "attribute": "variant",
374
- "defaultValue": "'p'"
375
- },
376
- "align": {
377
- "type": "string",
378
- "mutable": false,
379
- "complexType": {
380
- "original": "'left' | 'center' | 'right' | 'justify'",
381
- "resolved": "\"center\" | \"justify\" | \"left\" | \"right\"",
382
- "references": {}
383
- },
384
- "required": false,
385
- "optional": false,
386
- "docs": {
387
- "tags": [{
388
- "name": "allowedValues",
389
- "text": "left | center | right | justify"
390
- }],
391
- "text": "Text alignment"
392
- },
393
- "getter": false,
394
- "setter": false,
395
- "reflect": true,
396
- "attribute": "align",
397
- "defaultValue": "'left'"
398
- },
399
- "color": {
400
- "type": "string",
401
- "mutable": false,
402
- "complexType": {
403
- "original": "string",
404
- "resolved": "string",
405
- "references": {}
406
- },
407
- "required": false,
408
- "optional": true,
409
- "docs": {
410
- "tags": [],
411
- "text": "Text color (CSS value or theme token)"
412
- },
413
- "getter": false,
414
- "setter": false,
415
- "reflect": false,
416
- "attribute": "color"
417
- },
418
- "truncate": {
419
- "type": "boolean",
420
- "mutable": false,
421
- "complexType": {
422
- "original": "boolean",
423
- "resolved": "boolean",
424
- "references": {}
425
- },
426
- "required": false,
427
- "optional": false,
428
- "docs": {
429
- "tags": [],
430
- "text": "Whether the text should truncate with ellipsis"
431
- },
432
- "getter": false,
433
- "setter": false,
434
- "reflect": false,
435
- "attribute": "truncate",
436
- "defaultValue": "false"
437
- },
438
- "maxLines": {
439
- "type": "number",
440
- "mutable": false,
441
- "complexType": {
442
- "original": "number",
443
- "resolved": "number",
444
- "references": {}
445
- },
446
- "required": false,
447
- "optional": true,
448
- "docs": {
449
- "tags": [],
450
- "text": "Maximum number of lines before truncating (requires truncate=true)"
451
- },
452
- "getter": false,
453
- "setter": false,
454
- "reflect": false,
455
- "attribute": "max-lines"
456
- }
457
- };
458
- }
459
- static get states() {
460
- return {
461
- "adminMode": {},
462
- "content": {},
463
- "isFocused": {},
464
- "selectionState": {}
465
- };
466
- }
467
- static get elementRef() { return "el"; }
468
- static get watchers() {
469
- return [{
470
- "propName": "variant",
471
- "methodName": "onVariantChange"
472
- }];
473
- }
474
- }
475
- //# sourceMappingURL=le-text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"le-text.js","sourceRoot":"","sources":["../../../src/components/le-text/le-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,OAAO,MAAM;IACN,EAAE,CAAc;IAE3B;;;OAGG;IACqC,OAAO,GAAyF,GAAG,CAAC;IAE5I;;;OAGG;IACsB,KAAK,GAA4C,MAAM,CAAC;IAEjF;;OAEG;IACK,KAAK,CAAU;IAEvB;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;OAEG;IACK,QAAQ,CAAU;IAE1B;;OAEG;IACc,SAAS,GAAY,KAAK,CAAC;IAE5C;;OAEG;IACc,OAAO,GAAW,EAAE,CAAC;IAEtC;;OAEG;IACc,SAAS,GAAY,KAAK,CAAC;IAE5C;;OAEG;IACc,cAAc,GAAmB;QAChD,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,KAAK;QAClB,eAAe,EAAE,KAAK;QACtB,MAAM,EAA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;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h, Host, Element, Watch } from '@stencil/core';\nimport { observeModeChanges } from '../../utils/utils';\n\n/**\n * A text component with rich text editing capabilities in admin mode.\n *\n * `le-text` renders semantic text elements (headings, paragraphs, code, quotes)\n * and provides a Notion-like rich text editor in admin mode with formatting\n * toolbar for bold, italic, links, and paragraph type selection.\n *\n * @slot - Default slot for text content\n *\n * @cssprop --le-text-color - Text color\n * @cssprop --le-text-font-size - Font size\n * @cssprop --le-text-line-height - Line height\n * @cssprop --le-text-font-weight - Font weight\n *\n * @csspart text - The text container element\n *\n * @cmsEditable true\n * @cmsCategory Content\n */\n@Component({\n tag: 'le-text',\n styleUrl: 'le-text.default.css',\n shadow: true,\n})\nexport class LeText {\n @Element() el: HTMLElement;\n\n /**\n * The semantic variant/type of text element\n * @allowedValues p | h1 | h2 | h3 | h4 | h5 | h6 | code | quote | label | small\n */\n @Prop({ mutable: true, reflect: true }) variant: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'code' | 'quote' | 'label' | 'small' = 'p';\n\n /**\n * Text alignment\n * @allowedValues left | center | right | justify\n */\n @Prop({ reflect: true }) align: 'left' | 'center' | 'right' | 'justify' = 'left';\n\n /**\n * Text color (CSS value or theme token)\n */\n @Prop() color?: string;\n\n /**\n * Whether the text should truncate with ellipsis\n */\n @Prop() truncate: boolean = false;\n\n /**\n * Maximum number of lines before truncating (requires truncate=true)\n */\n @Prop() maxLines?: number;\n\n /**\n * Internal state to track admin mode\n */\n @State() private adminMode: boolean = false;\n\n /**\n * The HTML content being edited\n */\n @State() private content: string = '';\n\n /**\n * Whether the editor is focused (shows toolbar)\n */\n @State() private isFocused: boolean = false;\n\n /**\n * Current selection state for toolbar button highlighting\n */\n @State() private selectionState: SelectionState = {\n isBold: false,\n isItalic: false,\n isUnderline: false,\n isStrikethrough: false,\n isLink: false,\n blockType: 'p',\n };\n\n /**\n * Reference to the contenteditable element\n */\n private editorRef?: HTMLDivElement;\n\n /**\n * Reference to the slot element\n */\n private slotRef?: HTMLSlotElement;\n\n private disconnectModeObserver?: () => void;\n\n connectedCallback() {\n this.disconnectModeObserver = observeModeChanges(this.el, (mode) => {\n const wasAdmin = this.adminMode;\n this.adminMode = mode === 'admin';\n \n if (this.adminMode && !wasAdmin) {\n // Entering admin mode - read content from slot\n requestAnimationFrame(() => this.readSlottedContent());\n } else if (!this.adminMode && wasAdmin) {\n // Leaving admin mode - sync content back to slot\n this.syncContentToSlot();\n }\n });\n }\n\n disconnectedCallback() {\n this.disconnectModeObserver?.();\n }\n\n @Watch('variant')\n onVariantChange() {\n // When variant changes in admin mode, update the content wrapper\n if (this.adminMode && this.editorRef) {\n this.syncContentToSlot();\n }\n }\n\n /**\n * Read content from slotted elements\n */\n private readSlottedContent() {\n if (!this.slotRef) return;\n \n const assignedNodes = this.slotRef.assignedNodes({ flatten: true });\n \n // Collect all content from assigned nodes\n let html = '';\n assignedNodes.forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as Element).innerHTML || node.textContent;\n }\n });\n \n this.content = html.trim();\n }\n\n /**\n * Sync edited content back to the slot\n */\n private syncContentToSlot() {\n if (!this.editorRef) return;\n \n const newContent = this.editorRef.innerHTML;\n \n // Update the light DOM content\n // We need to update the actual slotted content\n const slot = this.slotRef;\n if (slot) {\n const assignedNodes = slot.assignedNodes({ flatten: true });\n if (assignedNodes.length > 0) {\n const firstNode = assignedNodes[0];\n if (firstNode.nodeType === Node.ELEMENT_NODE) {\n (firstNode as Element).innerHTML = newContent;\n } else if (firstNode.nodeType === Node.TEXT_NODE) {\n // Replace text node with the new content\n const parent = firstNode.parentNode;\n if (parent) {\n // Create a temporary element to parse HTML\n const temp = document.createElement('span');\n temp.innerHTML = newContent;\n // Replace the text node\n parent.replaceChild(temp, firstNode);\n // Unwrap the span if it only contains text\n if (temp.childNodes.length === 1 && temp.firstChild?.nodeType === Node.TEXT_NODE) {\n parent.replaceChild(temp.firstChild, temp);\n }\n }\n }\n } else {\n // No assigned nodes, set innerHTML on the host's light DOM\n this.el.innerHTML = newContent;\n }\n }\n }\n\n /**\n * Handle input in the contenteditable\n */\n private handleInput = () => {\n if (this.editorRef) {\n this.content = this.editorRef.innerHTML;\n this.updateSelectionState();\n }\n };\n\n /**\n * Handle focus on the editor\n */\n private handleFocus = () => {\n this.isFocused = true;\n this.updateSelectionState();\n };\n\n /**\n * Handle blur on the editor\n */\n private handleBlur = (e: FocusEvent) => {\n // Check if focus moved to toolbar\n const relatedTarget = e.relatedTarget as HTMLElement;\n const toolbar = this.el.shadowRoot?.querySelector('.le-text-toolbar');\n \n if (toolbar?.contains(relatedTarget)) {\n // Focus moved to toolbar, keep it open\n return;\n }\n \n // Small delay to allow toolbar clicks to register\n setTimeout(() => {\n if (!this.el.shadowRoot?.activeElement) {\n this.isFocused = false;\n this.syncContentToSlot();\n }\n }, 150);\n };\n\n /**\n * Handle selection change to update toolbar state\n */\n private handleSelectionChange = () => {\n this.updateSelectionState();\n };\n\n /**\n * Update the selection state for toolbar highlighting\n */\n private updateSelectionState() {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n this.selectionState = {\n isBold: document.queryCommandState('bold'),\n isItalic: document.queryCommandState('italic'),\n isUnderline: document.queryCommandState('underline'),\n isStrikethrough: document.queryCommandState('strikeThrough'),\n isLink: this.isSelectionInLink(selection),\n blockType: this.variant,\n };\n }\n\n /**\n * Check if current selection is within a link\n */\n private isSelectionInLink(selection: Selection): boolean {\n if (!selection.anchorNode) return false;\n \n let node: Node | null = selection.anchorNode;\n while (node && node !== this.editorRef) {\n if (node.nodeName === 'A') return true;\n node = node.parentNode;\n }\n return false;\n }\n\n /**\n * Execute a formatting command\n */\n private execCommand(command: string, value?: string) {\n // Focus the editor first\n this.editorRef?.focus();\n \n // Execute the command\n document.execCommand(command, false, value);\n \n // Update state\n this.handleInput();\n this.updateSelectionState();\n }\n\n /**\n * Toggle bold formatting\n */\n private toggleBold = (e: Event) => {\n e.preventDefault();\n this.execCommand('bold');\n };\n\n /**\n * Toggle italic formatting\n */\n private toggleItalic = (e: Event) => {\n e.preventDefault();\n this.execCommand('italic');\n };\n\n /**\n * Toggle underline formatting\n */\n private toggleUnderline = (e: Event) => {\n e.preventDefault();\n this.execCommand('underline');\n };\n\n /**\n * Toggle strikethrough formatting\n */\n private toggleStrikethrough = (e: Event) => {\n e.preventDefault();\n this.execCommand('strikeThrough');\n };\n\n /**\n * Add or edit a link\n */\n private toggleLink = (e: Event) => {\n e.preventDefault();\n \n if (this.selectionState.isLink) {\n // Remove link\n this.execCommand('unlink');\n } else {\n // Add link\n const url = prompt('Enter URL:', 'https://');\n if (url) {\n this.execCommand('createLink', url);\n }\n }\n };\n\n /**\n * Change the block type/variant\n */\n private changeVariant = (e: Event) => {\n const select = e.target as HTMLSelectElement;\n this.variant = select.value as typeof this.variant;\n };\n\n /**\n * Render the formatting toolbar\n */\n private renderToolbar() {\n return (\n <div class=\"le-text-toolbar\">\n <select \n class=\"le-text-toolbar-select\"\n onChange={this.changeVariant}\n onMouseDown={(e) => e.preventDefault()}\n >\n <option value=\"p\" selected={this.variant === 'p'}>Paragraph</option>\n <option value=\"h1\" selected={this.variant === 'h1'}>Heading 1</option>\n <option value=\"h2\" selected={this.variant === 'h2'}>Heading 2</option>\n <option value=\"h3\" selected={this.variant === 'h3'}>Heading 3</option>\n <option value=\"h4\" selected={this.variant === 'h4'}>Heading 4</option>\n <option value=\"h5\" selected={this.variant === 'h5'}>Heading 5</option>\n <option value=\"h6\" selected={this.variant === 'h6'}>Heading 6</option>\n <option value=\"quote\" selected={this.variant === 'quote'}>Quote</option>\n <option value=\"code\" selected={this.variant === 'code'}>Code</option>\n <option value=\"label\" selected={this.variant === 'label'}>Label</option>\n <option value=\"small\" selected={this.variant === 'small'}>Small</option>\n </select>\n \n <div class=\"le-text-toolbar-divider\"></div>\n \n <button\n type=\"button\"\n class={{ 'le-text-toolbar-btn': true, 'active': this.selectionState.isBold }}\n onMouseDown={this.toggleBold}\n title=\"Bold (Ctrl+B)\"\n >\n <strong>B</strong>\n </button>\n \n <button\n type=\"button\"\n class={{ 'le-text-toolbar-btn': true, 'active': this.selectionState.isItalic }}\n onMouseDown={this.toggleItalic}\n title=\"Italic (Ctrl+I)\"\n >\n <em>I</em>\n </button>\n \n <button\n type=\"button\"\n class={{ 'le-text-toolbar-btn': true, 'active': this.selectionState.isUnderline }}\n onMouseDown={this.toggleUnderline}\n title=\"Underline (Ctrl+U)\"\n >\n <span style={{ textDecoration: 'underline' }}>U</span>\n </button>\n \n <button\n type=\"button\"\n class={{ 'le-text-toolbar-btn': true, 'active': this.selectionState.isStrikethrough }}\n onMouseDown={this.toggleStrikethrough}\n title=\"Strikethrough\"\n >\n <span style={{ textDecoration: 'line-through' }}>S</span>\n </button>\n \n <div class=\"le-text-toolbar-divider\"></div>\n \n <button\n type=\"button\"\n class={{ 'le-text-toolbar-btn': true, 'active': this.selectionState.isLink }}\n onMouseDown={this.toggleLink}\n title={this.selectionState.isLink ? 'Remove link' : 'Add link'}\n >\n 🔗\n </button>\n </div>\n );\n }\n\n /**\n * Get the semantic tag for the current variant\n */\n private getTag(): string {\n switch (this.variant) {\n case 'quote':\n return 'blockquote';\n case 'code':\n return 'pre';\n case 'label':\n return 'label';\n case 'small':\n return 'small';\n default:\n return this.variant; // h1-h6, p\n }\n }\n\n render() {\n const Tag = this.getTag();\n \n const textStyle: { [key: string]: string } = {};\n if (this.color) {\n textStyle.color = this.color;\n }\n if (this.align) {\n textStyle.textAlign = this.align;\n }\n\n const textClass = {\n 'le-text': true,\n [`variant-${this.variant}`]: true,\n 'truncate': this.truncate,\n [`max-lines-${this.maxLines}`]: this.truncate && this.maxLines,\n };\n\n // Admin mode - show rich text editor\n if (this.adminMode) {\n return (\n <Host class=\"admin-mode\">\n <le-component component=\"le-text\">\n <div class=\"le-text-editor-wrapper\">\n {this.isFocused && this.renderToolbar()}\n <Tag \n class={textClass}\n part=\"text\"\n style={textStyle}\n >\n <div\n ref={(el) => this.editorRef = el}\n class=\"le-text-editor\"\n contentEditable={true}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyUp={this.handleSelectionChange}\n onMouseUp={this.handleSelectionChange}\n innerHTML={this.content}\n ></div>\n </Tag>\n {/* Hidden slot to receive light DOM content */}\n <div class=\"hidden-slot\">\n <slot \n ref={(el) => this.slotRef = el as HTMLSlotElement}\n onSlotchange={() => this.readSlottedContent()}\n ></slot>\n </div>\n </div>\n </le-component>\n </Host>\n );\n }\n\n // Default mode - render semantic element with slotted content\n return (\n <Host>\n <Tag \n class={textClass}\n part=\"text\"\n style={textStyle}\n >\n <slot ref={(el) => this.slotRef = el as HTMLSlotElement}></slot>\n </Tag>\n </Host>\n );\n }\n}\n\n/**\n * Selection state for toolbar\n */\ninterface SelectionState {\n isBold: boolean;\n isItalic: boolean;\n isUnderline: boolean;\n isStrikethrough: boolean;\n isLink: boolean;\n blockType: string;\n}\n"]}
@@ -1,10 +0,0 @@
1
- :host {
2
- display: block;
3
- cursor: grab;
4
- }
5
-
6
- div.turntable {
7
- width: 100%;
8
- height: 100%;
9
- padding: 1px;
10
- }