le-kit 0.1.5 → 0.1.6

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 (199) hide show
  1. package/dist/cjs/index-WzJ78D5H.js +1803 -0
  2. package/dist/cjs/index-WzJ78D5H.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +117 -0
  4. package/dist/cjs/index.cjs.js.map +1 -0
  5. package/dist/cjs/le-box.cjs.entry.js +184 -0
  6. package/dist/cjs/le-box.entry.cjs.js.map +1 -0
  7. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +1 -0
  8. package/dist/cjs/le-button_6.cjs.entry.js +1202 -0
  9. package/dist/cjs/le-card.cjs.entry.js +29 -0
  10. package/dist/cjs/le-card.entry.cjs.js.map +1 -0
  11. package/dist/cjs/le-kit.cjs.js +25 -0
  12. package/dist/cjs/le-kit.cjs.js.map +1 -0
  13. package/dist/cjs/le-number-input.cjs.entry.js +202 -0
  14. package/dist/cjs/le-number-input.entry.cjs.js.map +1 -0
  15. package/dist/cjs/le-popup.cjs.entry.js +212 -0
  16. package/dist/cjs/le-popup.entry.cjs.js.map +1 -0
  17. package/dist/cjs/le-round-progress.cjs.entry.js +106 -0
  18. package/dist/cjs/le-round-progress.entry.cjs.js.map +1 -0
  19. package/dist/cjs/le-stack.cjs.entry.js +135 -0
  20. package/dist/cjs/le-stack.entry.cjs.js.map +1 -0
  21. package/dist/cjs/le-text.cjs.entry.js +335 -0
  22. package/dist/cjs/le-text.entry.cjs.js.map +1 -0
  23. package/dist/cjs/le-turntable.cjs.entry.js +139 -0
  24. package/dist/cjs/le-turntable.entry.cjs.js.map +1 -0
  25. package/dist/cjs/loader.cjs.js +13 -0
  26. package/dist/cjs/loader.cjs.js.map +1 -0
  27. package/dist/cjs/utils-CBjH2E8A.js +152 -0
  28. package/dist/cjs/utils-CBjH2E8A.js.map +1 -0
  29. package/dist/collection/assets/.gitkeep +1 -0
  30. package/dist/collection/assets/custom-elements.json +4305 -0
  31. package/dist/collection/collection-manifest.json +26 -0
  32. package/dist/collection/components/le-box/le-box.default.css +37 -0
  33. package/dist/collection/components/le-box/le-box.js +614 -0
  34. package/dist/collection/components/le-box/le-box.js.map +1 -0
  35. package/dist/collection/components/le-button/le-button.default.css +263 -0
  36. package/dist/collection/components/le-button/le-button.js +368 -0
  37. package/dist/collection/components/le-button/le-button.js.map +1 -0
  38. package/dist/collection/components/le-card/le-card.default.css +74 -0
  39. package/dist/collection/components/le-card/le-card.js +102 -0
  40. package/dist/collection/components/le-card/le-card.js.map +1 -0
  41. package/dist/collection/components/le-checkbox/le-checkbox.css +93 -0
  42. package/dist/collection/components/le-checkbox/le-checkbox.js +192 -0
  43. package/dist/collection/components/le-checkbox/le-checkbox.js.map +1 -0
  44. package/dist/collection/components/le-component/le-component.css +189 -0
  45. package/dist/{le-kit/le-component.entry.js → collection/components/le-component/le-component.js} +137 -20
  46. package/dist/collection/components/le-component/le-component.js.map +1 -0
  47. package/dist/collection/components/le-number-input/le-number-input.css +135 -0
  48. package/dist/collection/components/le-number-input/le-number-input.js +515 -0
  49. package/dist/collection/components/le-number-input/le-number-input.js.map +1 -0
  50. package/dist/collection/components/le-popover/le-popover.css +143 -0
  51. package/dist/collection/components/le-popover/le-popover.js +693 -0
  52. package/dist/collection/components/le-popover/le-popover.js.map +1 -0
  53. package/dist/collection/components/le-popup/le-popup.api.js +101 -0
  54. package/dist/collection/components/le-popup/le-popup.api.js.map +1 -0
  55. package/dist/collection/components/le-popup/le-popup.css +222 -0
  56. package/dist/collection/components/le-popup/le-popup.js +596 -0
  57. package/dist/collection/components/le-popup/le-popup.js.map +1 -0
  58. package/dist/collection/components/le-round-progress/le-round-progress.css +34 -0
  59. package/dist/collection/components/le-round-progress/le-round-progress.js +184 -0
  60. package/dist/collection/components/le-round-progress/le-round-progress.js.map +1 -0
  61. package/dist/collection/components/le-slot/le-slot.default.css +222 -0
  62. package/dist/{le-kit/le-slot.entry.js → collection/components/le-slot/le-slot.js} +266 -16
  63. package/dist/collection/components/le-slot/le-slot.js.map +1 -0
  64. package/dist/collection/components/le-stack/le-stack.default.css +37 -0
  65. package/dist/collection/components/le-stack/le-stack.js +389 -0
  66. package/dist/collection/components/le-stack/le-stack.js.map +1 -0
  67. package/dist/collection/components/le-string-input/le-string-input.css +83 -0
  68. package/dist/collection/components/le-string-input/le-string-input.js +359 -0
  69. package/dist/collection/components/le-string-input/le-string-input.js.map +1 -0
  70. package/dist/collection/components/le-text/le-text.default.css +169 -0
  71. package/dist/collection/components/le-text/le-text.js +475 -0
  72. package/dist/collection/components/le-text/le-text.js.map +1 -0
  73. package/dist/collection/components/le-turntable/le-turntable.css +10 -0
  74. package/dist/collection/components/le-turntable/le-turntable.js +210 -0
  75. package/dist/collection/components/le-turntable/le-turntable.js.map +1 -0
  76. package/dist/collection/global/app.js +130 -0
  77. package/dist/collection/global/app.js.map +1 -0
  78. package/dist/collection/index.js +15 -0
  79. package/dist/collection/index.js.map +1 -0
  80. package/dist/collection/types/blocks.js +115 -0
  81. package/dist/collection/types/blocks.js.map +1 -0
  82. package/dist/collection/types/options.js +2 -0
  83. package/dist/collection/types/options.js.map +1 -0
  84. package/dist/collection/utils/utils.js +141 -0
  85. package/dist/collection/utils/utils.js.map +1 -0
  86. package/dist/components/index.js +127 -0
  87. package/dist/components/index.js.map +1 -0
  88. package/dist/components/le-box.js +256 -0
  89. package/dist/components/le-box.js.map +1 -0
  90. package/dist/components/le-button.js +9 -0
  91. package/dist/components/le-button.js.map +1 -0
  92. package/dist/components/le-button2.js +1411 -0
  93. package/dist/components/le-button2.js.map +1 -0
  94. package/dist/components/le-card.js +83 -0
  95. package/dist/components/le-card.js.map +1 -0
  96. package/dist/components/le-checkbox.js +9 -0
  97. package/dist/components/le-checkbox.js.map +1 -0
  98. package/dist/components/le-component.js +9 -0
  99. package/dist/components/le-component.js.map +1 -0
  100. package/dist/components/le-number-input.js +271 -0
  101. package/dist/components/le-number-input.js.map +1 -0
  102. package/dist/components/le-popover.js +9 -0
  103. package/dist/components/le-popover.js.map +1 -0
  104. package/dist/{le-kit/le-popover.entry.js → components/le-popover2.js} +45 -9
  105. package/dist/components/le-popover2.js.map +1 -0
  106. package/dist/components/le-popup.js +279 -0
  107. package/dist/components/le-popup.js.map +1 -0
  108. package/dist/components/le-round-progress.js +135 -0
  109. package/dist/components/le-round-progress.js.map +1 -0
  110. package/dist/components/le-slot.js +9 -0
  111. package/dist/components/le-slot.js.map +1 -0
  112. package/dist/components/le-stack.js +198 -0
  113. package/dist/components/le-stack.js.map +1 -0
  114. package/dist/components/le-string-input.js +9 -0
  115. package/dist/components/le-string-input.js.map +1 -0
  116. package/dist/components/le-text.js +398 -0
  117. package/dist/components/le-text.js.map +1 -0
  118. package/dist/components/le-turntable.js +164 -0
  119. package/dist/components/le-turntable.js.map +1 -0
  120. package/dist/docs.d.ts +443 -0
  121. package/dist/docs.json +5185 -0
  122. package/dist/esm/index-CdjJ98OT.js +1787 -0
  123. package/dist/esm/index-CdjJ98OT.js.map +1 -0
  124. package/dist/esm/index.js +106 -0
  125. package/dist/esm/index.js.map +1 -0
  126. package/dist/{le-kit → esm}/le-box.entry.js +3 -3
  127. package/dist/esm/le-box.entry.js.map +1 -0
  128. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +1 -0
  129. package/dist/esm/le-button_6.entry.js +1195 -0
  130. package/dist/{le-kit → esm}/le-card.entry.js +3 -3
  131. package/dist/esm/le-card.entry.js.map +1 -0
  132. package/dist/esm/le-kit.js +21 -0
  133. package/dist/esm/le-kit.js.map +1 -0
  134. package/dist/{le-kit → esm}/le-number-input.entry.js +5 -5
  135. package/dist/esm/le-number-input.entry.js.map +1 -0
  136. package/dist/{le-kit → esm}/le-popup.entry.js +6 -6
  137. package/dist/esm/le-popup.entry.js.map +1 -0
  138. package/dist/{le-kit → esm}/le-round-progress.entry.js +2 -2
  139. package/dist/esm/le-round-progress.entry.js.map +1 -0
  140. package/dist/{le-kit → esm}/le-stack.entry.js +3 -3
  141. package/dist/esm/le-stack.entry.js.map +1 -0
  142. package/dist/{le-kit → esm}/le-text.entry.js +3 -3
  143. package/dist/esm/le-text.entry.js.map +1 -0
  144. package/dist/{le-kit → esm}/le-turntable.entry.js +2 -2
  145. package/dist/esm/le-turntable.entry.js.map +1 -0
  146. package/dist/esm/loader.js +11 -0
  147. package/dist/esm/loader.js.map +1 -0
  148. package/dist/{le-kit/utils-FDOApZ53.js → esm/utils-CzfSUhYB.js} +3 -3
  149. package/dist/{le-kit/utils-FDOApZ53.js.map → esm/utils-CzfSUhYB.js.map} +1 -1
  150. package/dist/index.cjs.js +1 -0
  151. package/dist/index.js +1 -0
  152. package/dist/le-kit/index.esm.js +2 -116
  153. package/dist/le-kit/index.esm.js.map +1 -1
  154. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +1 -0
  155. package/dist/le-kit/le-kit.css +1 -1010
  156. package/dist/le-kit/le-kit.esm.js +2 -48
  157. package/dist/le-kit/le-kit.esm.js.map +1 -1
  158. package/dist/le-kit/p-0633b3ab.entry.js +2 -0
  159. package/dist/le-kit/p-0633b3ab.entry.js.map +1 -0
  160. package/dist/le-kit/p-1452a995.entry.js +2 -0
  161. package/dist/le-kit/p-1452a995.entry.js.map +1 -0
  162. package/dist/le-kit/p-220528ee.entry.js +2 -0
  163. package/dist/le-kit/p-220528ee.entry.js.map +1 -0
  164. package/dist/le-kit/p-32ff3dbe.entry.js +2 -0
  165. package/dist/le-kit/p-32ff3dbe.entry.js.map +1 -0
  166. package/dist/le-kit/p-3551598e.entry.js +2 -0
  167. package/dist/le-kit/p-3551598e.entry.js.map +1 -0
  168. package/dist/le-kit/p-722899f0.entry.js +2 -0
  169. package/dist/le-kit/p-722899f0.entry.js.map +1 -0
  170. package/dist/le-kit/p-95764888.entry.js +2 -0
  171. package/dist/le-kit/p-95764888.entry.js.map +1 -0
  172. package/dist/le-kit/p-CdjJ98OT.js +3 -0
  173. package/dist/le-kit/p-CdjJ98OT.js.map +1 -0
  174. package/dist/le-kit/p-CvDc0yWN.js +2 -0
  175. package/dist/le-kit/p-CvDc0yWN.js.map +1 -0
  176. package/dist/le-kit/p-bc20e30d.entry.js +2 -0
  177. package/dist/le-kit/p-bc20e30d.entry.js.map +1 -0
  178. package/dist/le-kit/p-d32eddad.entry.js +2 -0
  179. package/dist/le-kit/p-d32eddad.entry.js.map +1 -0
  180. package/dist/themes/base.css +89 -0
  181. package/dist/themes/dark.css +100 -0
  182. package/dist/themes/default.css +108 -0
  183. package/dist/themes/gradient.css +100 -0
  184. package/dist/themes/index.css +413 -0
  185. package/dist/themes/minimal.css +100 -0
  186. package/dist/themes/warm.css +100 -0
  187. package/dist/types/components.d.ts +4 -4
  188. package/package.json +1 -1
  189. package/dist/le-kit/index-Da-89pOc.js +0 -4522
  190. package/dist/le-kit/index-Da-89pOc.js.map +0 -1
  191. package/dist/le-kit/le-button.entry.esm.js.map +0 -1
  192. package/dist/le-kit/le-button.entry.js +0 -90
  193. package/dist/le-kit/le-checkbox.entry.esm.js.map +0 -1
  194. package/dist/le-kit/le-checkbox.entry.js +0 -59
  195. package/dist/le-kit/le-component.entry.esm.js.map +0 -1
  196. package/dist/le-kit/le-popover.entry.esm.js.map +0 -1
  197. package/dist/le-kit/le-slot.entry.esm.js.map +0 -1
  198. package/dist/le-kit/le-string-input.entry.esm.js.map +0 -1
  199. package/dist/le-kit/le-string-input.entry.js +0 -93
@@ -0,0 +1 @@
1
+ {"file":"le-text.js","mappings":";;;;AAAA,MAAM,gBAAgB,GAAG,88FAA88F;;MC2B19FA,QAAM,iBAAAC,kBAAA,CAAA,MAAA,MAAA,SAAA,WAAA,CAAA;;;;;;;;;AAGjB;;;AAGG;IACqC,OAAO,GAAyF,GAAG;AAE3I;;;AAGG;IACsB,KAAK,GAA4C,MAAM;AAEhF;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;IACK,QAAQ,GAAY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,EACjD,YAAY,EAAE,MAAM,IAAI,CAAC,kBAAkB,EAAE,EACvC,CAAA,CACJ,CACF,CACO,CACV;;;QAKX,QACE,EAAC,IAAI,EAAA,IAAA,EACH,CAAA,CAAC,GAAG,EAAA,EACF,KAAK,EAAE,SAAS,EAChB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,SAAS,EAAA,EAEhB,CAAA,CAAA,MAAA,EAAA,EAAM,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,OAAO,GAAG,EAAqB,EAAA,CAAS,CAC5D,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["LeText","__stencil_proxyCustomElement"],"sources":["src/components/le-text/le-text.default.css?tag=le-text&encapsulation=shadow","src/components/le-text/le-text.tsx"],"sourcesContent":["/**\n * le-text default styles\n *\n * Semantic text element with variant-based styling\n */\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/* Base text styles */\n.le-text {\n margin: 0;\n color: var(--le-text-color, var(--le-color-text));\n font-family: var(--le-font-family);\n line-height: var(--le-text-line-height, 1.5);\n}\n\n/* Paragraph */\n.variant-p {\n font-size: var(--le-font-size-base, 1rem);\n font-weight: var(--le-font-weight-normal, 400);\n color: var(--le-color-text);\n}\n\n/* Headings */\n.variant-h1 {\n font-size: var(--le-font-size-4xl, 2.5rem);\n font-weight: var(--le-font-weight-bold, 700);\n line-height: 1.2;\n color: var(--le-color-text);\n letter-spacing: -0.02em;\n}\n\n.variant-h2 {\n font-size: var(--le-font-size-3xl, 2rem);\n font-weight: var(--le-font-weight-bold, 700);\n line-height: 1.25;\n color: var(--le-color-text);\n letter-spacing: -0.01em;\n}\n\n.variant-h3 {\n font-size: var(--le-font-size-2xl, 1.5rem);\n font-weight: var(--le-font-weight-semibold, 600);\n line-height: 1.3;\n color: var(--le-color-text);\n}\n\n.variant-h4 {\n font-size: var(--le-font-size-xl, 1.25rem);\n font-weight: var(--le-font-weight-semibold, 600);\n line-height: 1.35;\n color: var(--le-color-text);\n}\n\n.variant-h5 {\n font-size: var(--le-font-size-lg, 1.125rem);\n font-weight: var(--le-font-weight-medium, 500);\n line-height: 1.4;\n color: var(--le-color-text);\n}\n\n.variant-h6 {\n font-size: var(--le-font-size-base, 1rem);\n font-weight: var(--le-font-weight-medium, 500);\n line-height: 1.45;\n color: var(--le-color-text);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n/* Code */\n.variant-code {\n font-family: var(--le-font-family-mono, 'SF Mono', 'Fira Code', 'Consolas', monospace);\n font-size: var(--le-font-size-sm, 0.875rem);\n background: var(--le-color-surface-alt, #f5f5f5);\n padding: var(--le-space-md);\n border-radius: var(--le-radius-md);\n overflow-x: auto;\n white-space: pre-wrap;\n color: var(--le-color-text);\n}\n\n/* Quote */\n.variant-quote {\n font-size: var(--le-font-size-lg, 1.125rem);\n font-style: italic;\n color: var(--le-color-text-secondary);\n border-left: 4px solid var(--le-color-primary);\n padding-left: var(--le-space-lg);\n margin-left: 0;\n margin-right: 0;\n}\n\n/* Label */\n.variant-label {\n font-size: var(--le-font-size-sm, 0.875rem);\n font-weight: var(--le-font-weight-medium, 500);\n color: var(--le-color-text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n/* Small */\n.variant-small {\n font-size: var(--le-font-size-sm, 0.875rem);\n color: var(--le-color-text-secondary);\n}\n\n/* Truncation */\n.truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.truncate.max-lines-2,\n.truncate.max-lines-3,\n.truncate.max-lines-4,\n.truncate.max-lines-5 {\n white-space: normal;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n}\n\n.truncate.max-lines-2 { -webkit-line-clamp: 2; line-clamp: 2; }\n.truncate.max-lines-3 { -webkit-line-clamp: 3; line-clamp: 3; }\n.truncate.max-lines-4 { -webkit-line-clamp: 4; line-clamp: 4; }\n.truncate.max-lines-5 { -webkit-line-clamp: 5; line-clamp: 5; }\n\n/* Alignment */\n:host([align=\"center\"]) .le-text { text-align: center; }\n:host([align=\"right\"]) .le-text { text-align: right; }\n:host([align=\"justify\"]) .le-text { text-align: justify; }\n\n/* Links inside text */\n.le-text a {\n color: var(--le-color-primary);\n text-decoration: underline;\n}\n\n.le-text a:hover {\n color: var(--le-color-primary-dark);\n}\n\n/* Bold, italic, etc. */\n.le-text strong,\n.le-text b {\n font-weight: var(--le-font-weight-bold, 700);\n}\n\n.le-text em,\n.le-text i {\n font-style: italic;\n}\n\n.le-text u {\n text-decoration: underline;\n}\n\n.le-text s,\n.le-text strike {\n text-decoration: line-through;\n}\n","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"],"version":3}
@@ -0,0 +1,164 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const leTurntableCss = ":host{display:block;cursor:grab}div.turntable{width:100%;height:100%;padding:1px}";
4
+
5
+ const LeTurntable$1 = /*@__PURE__*/ proxyCustomElement(class LeTurntable extends HTMLElement {
6
+ constructor(registerHost) {
7
+ super();
8
+ if (registerHost !== false) {
9
+ this.__registerHost();
10
+ }
11
+ this.__attachShadow();
12
+ }
13
+ get el() { return this; }
14
+ // transform origin
15
+ // gets the same values as transform-origin css property
16
+ center = 'center';
17
+ // transform rotate
18
+ value = 0;
19
+ updateValue(newValue) {
20
+ if (!this.rotating) {
21
+ this.currentAngle = parseFloat(newValue);
22
+ this.setAngle(this.currentAngle);
23
+ }
24
+ }
25
+ /**
26
+ * Internal state
27
+ *
28
+ * using properties instead of @State decoratorm
29
+ * because we are only changing styles of the element and don't
30
+ * need the element to be rerendered
31
+ */
32
+ // indicates is the element being manually rotated right now
33
+ rotating = false;
34
+ // coordinates of the transform origin in pixels
35
+ centerX;
36
+ centerY;
37
+ // element page (body?) offset in pixels
38
+ pageX;
39
+ pageY;
40
+ currentAngle = 0;
41
+ // angle at the start of the drag
42
+ startAngle;
43
+ /**
44
+ * Event listeners
45
+ */
46
+ handleMouseDown(evt) {
47
+ // set rotating mode on
48
+ this.rotating = true;
49
+ // get start angle
50
+ // getting pageX/Y, because when the element is transformed
51
+ // relative values are useless
52
+ this.startAngle = this.getAngle(evt.pageX, evt.pageY);
53
+ // cancel the event to prevent text selection
54
+ evt.preventDefault();
55
+ evt.stopPropagation();
56
+ return false;
57
+ }
58
+ /**
59
+ * Fires when the mouse moves
60
+ * checks is the element rotating right now and if it is
61
+ * then calc the current angle and rotate the element
62
+ *
63
+ * TODO: attach events only after the dragStart?
64
+ */
65
+ handleMouseMove(evt) {
66
+ if (this.rotating) {
67
+ // calc angle update and rotate element
68
+ this.setAngle(this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle));
69
+ return false;
70
+ }
71
+ }
72
+ handleMouseUp(evt) {
73
+ if (this.rotating) {
74
+ const angle = this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle);
75
+ this.setAngle(angle);
76
+ this.currentAngle = angle;
77
+ this.rotating = false;
78
+ return false;
79
+ }
80
+ }
81
+ // on window resize the center should be recalculated
82
+ handleWindowResize() {
83
+ this.getTransformOrigin();
84
+ }
85
+ /**
86
+ * Component lifecycles
87
+ */
88
+ componentDidLoad() {
89
+ this.el.style.transformOrigin = this.center;
90
+ this.currentAngle = this.value;
91
+ this.getTransformOrigin();
92
+ this.setAngle(this.currentAngle);
93
+ }
94
+ componentDidUpdate() {
95
+ this.getTransformOrigin();
96
+ }
97
+ /**
98
+ * Calculates the transform origin of the component
99
+ * and the page offset in pixels
100
+ *
101
+ * We'll need these values to calculate the angle of pointer event
102
+ */
103
+ getTransformOrigin() {
104
+ // transform origin
105
+ [this.centerX, this.centerY] = window
106
+ .getComputedStyle(this.el, null)
107
+ .transformOrigin.split(' ')
108
+ .map(val => Math.round(parseFloat(val)));
109
+ // page offset
110
+ let t = null;
111
+ const scrollContainer = ((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.scrollLeft === 'number' ? t : document.body;
112
+ const clientRects = this.el.getBoundingClientRect();
113
+ this.pageX = Math.round(clientRects.left + scrollContainer.scrollLeft);
114
+ this.pageY = Math.round(clientRects.top + scrollContainer.scrollTop);
115
+ }
116
+ /**
117
+ * Calculates current angle
118
+ *
119
+ * @param {number} posX horizontal mouse position
120
+ * @param {number} posY vertical mouse position
121
+ */
122
+ getAngle(posX, posY) {
123
+ const x = posX - this.pageX - this.centerX;
124
+ const y = posY - this.pageY - this.centerY;
125
+ const angle = Math.round(((Math.atan2(y, x) * 180) / Math.PI) * 100) / 100;
126
+ return angle;
127
+ }
128
+ setAngle(angle) {
129
+ this.el.style.transform = `rotate(${angle}deg)`;
130
+ }
131
+ render() {
132
+ return (h("div", { key: 'ec9a506a360881ab3c3df97027c8a25d663f6819', class: "turntable", onMouseDown: this.handleMouseDown.bind(this) }, h("slot", { key: '926a84fa75952bdc3e44f1b2146848401e8ab10f' })));
133
+ }
134
+ static get watchers() { return {
135
+ "value": ["updateValue"]
136
+ }; }
137
+ static get style() { return leTurntableCss; }
138
+ }, [769, "le-turntable", {
139
+ "center": [1],
140
+ "value": [2]
141
+ }, [[9, "mousemove", "handleMouseMove"], [9, "mouseup", "handleMouseUp"], [9, "resize", "handleWindowResize"]], {
142
+ "value": ["updateValue"]
143
+ }]);
144
+ function defineCustomElement$1() {
145
+ if (typeof customElements === "undefined") {
146
+ return;
147
+ }
148
+ const components = ["le-turntable"];
149
+ components.forEach(tagName => { switch (tagName) {
150
+ case "le-turntable":
151
+ if (!customElements.get(tagName)) {
152
+ customElements.define(tagName, LeTurntable$1);
153
+ }
154
+ break;
155
+ } });
156
+ }
157
+
158
+ const LeTurntable = LeTurntable$1;
159
+ const defineCustomElement = defineCustomElement$1;
160
+
161
+ export { LeTurntable, defineCustomElement };
162
+ //# sourceMappingURL=le-turntable.js.map
163
+
164
+ //# sourceMappingURL=le-turntable.js.map
@@ -0,0 +1 @@
1
+ {"file":"le-turntable.js","mappings":";;AAAA,MAAM,cAAc,GAAG,mFAAmF;;MCO7FA,aAAW,iBAAAC,kBAAA,CAAA,MAAA,WAAA,SAAA,WAAA,CAAA;;;;;;;;;;;IAMd,MAAM,GAAW,QAAQ;;IAGzB,KAAK,GAAW,CAAC;AAGzB,IAAA,WAAW,CAAC,QAAQ,EAAA;AAClB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC;AACxC,YAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;;;AAIpC;;;;;;AAMG;;IAGH,QAAQ,GAAG,KAAK;;AAGhB,IAAA,OAAO;AACP,IAAA,OAAO;;AAGP,IAAA,KAAK;AACL,IAAA,KAAK;IAEL,YAAY,GAAW,CAAC;;AAExB,IAAA,UAAU;AAEV;;AAEG;AACH,IAAA,eAAe,CAAC,GAAe,EAAA;;AAE7B,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;;;;AAKpB,QAAA,IAAI,CAAC,UA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A,OAAO,KAAK;;AAGd,IAAA,QAAQ,CAAC,KAAK,EAAA;QACZ,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,CAAA,OAAA,EAAU,KAAK,CAAA,IAAA,CAAM;;IAGjD,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,WAAW,EAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA,EACjE,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["LeTurntable","__stencil_proxyCustomElement"],"sources":["src/components/le-turntable/le-turntable.css?tag=le-turntable&encapsulation=shadow","src/components/le-turntable/le-turntable.tsx"],"sourcesContent":[":host {\n display: block;\n cursor: grab;\n}\n\ndiv.turntable {\n width: 100%;\n height: 100%;\n padding: 1px;\n}\n","import { Component, Element, Prop, Listen, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'le-turntable',\n styleUrl: 'le-turntable.css',\n shadow: true,\n})\nexport class LeTurntable {\n // host element\n @Element() el: HTMLElement;\n\n // transform origin\n // gets the same values as transform-origin css property\n @Prop() center: string = 'center';\n\n // transform rotate\n @Prop() value: number = 0;\n\n @Watch('value')\n updateValue(newValue) {\n if (!this.rotating) {\n this.currentAngle = parseFloat(newValue);\n this.setAngle(this.currentAngle);\n }\n }\n\n /**\n * Internal state\n *\n * using properties instead of @State decoratorm\n * because we are only changing styles of the element and don't\n * need the element to be rerendered\n */\n\n // indicates is the element being manually rotated right now\n rotating = false;\n\n // coordinates of the transform origin in pixels\n centerX: number;\n centerY: number;\n\n // element page (body?) offset in pixels\n pageX: number;\n pageY: number;\n\n currentAngle: number = 0;\n // angle at the start of the drag\n startAngle: number;\n\n /**\n * Event listeners\n */\n handleMouseDown(evt: MouseEvent) {\n // set rotating mode on\n this.rotating = true;\n\n // get start angle\n // getting pageX/Y, because when the element is transformed\n // relative values are useless\n this.startAngle = this.getAngle(evt.pageX, evt.pageY);\n\n // cancel the event to prevent text selection\n evt.preventDefault();\n evt.stopPropagation();\n return false;\n }\n\n /**\n * Fires when the mouse moves\n * checks is the element rotating right now and if it is\n * then calc the current angle and rotate the element\n *\n * TODO: attach events only after the dragStart?\n */\n @Listen('mousemove', { target: 'window' })\n handleMouseMove(evt: MouseEvent) {\n if (this.rotating) {\n // calc angle update and rotate element\n this.setAngle(this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle));\n return false;\n }\n }\n\n @Listen('mouseup', { target: 'window' })\n handleMouseUp(evt: MouseEvent) {\n if (this.rotating) {\n const angle = this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle);\n this.setAngle(angle);\n this.currentAngle = angle;\n this.rotating = false;\n return false;\n }\n }\n\n // on window resize the center should be recalculated\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.getTransformOrigin();\n }\n\n /**\n * Component lifecycles\n */\n componentDidLoad() {\n this.el.style.transformOrigin = this.center;\n this.currentAngle = this.value;\n\n this.getTransformOrigin();\n this.setAngle(this.currentAngle);\n }\n\n componentDidUpdate() {\n this.getTransformOrigin();\n }\n\n /**\n * Calculates the transform origin of the component\n * and the page offset in pixels\n *\n * We'll need these values to calculate the angle of pointer event\n */\n getTransformOrigin() {\n // transform origin\n [this.centerX, this.centerY] = window\n .getComputedStyle(this.el, null)\n .transformOrigin.split(' ')\n .map(val => Math.round(parseFloat(val)));\n // page offset\n let t = null;\n const scrollContainer = ((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.scrollLeft === 'number' ? t : document.body;\n const clientRects = this.el.getBoundingClientRect();\n this.pageX = Math.round(clientRects.left + scrollContainer.scrollLeft);\n this.pageY = Math.round(clientRects.top + scrollContainer.scrollTop);\n }\n\n /**\n * Calculates current angle\n *\n * @param {number} posX horizontal mouse position\n * @param {number} posY vertical mouse position\n */\n getAngle(posX: number, posY: number) {\n const x = posX - this.pageX - this.centerX;\n const y = posY - this.pageY - this.centerY;\n const angle = Math.round(((Math.atan2(y, x) * 180) / Math.PI) * 100) / 100;\n return angle;\n }\n\n setAngle(angle) {\n this.el.style.transform = `rotate(${angle}deg)`;\n }\n\n render() {\n return (\n <div class=\"turntable\" onMouseDown={this.handleMouseDown.bind(this)}>\n <slot />\n </div>\n );\n }\n}\n"],"version":3}
package/dist/docs.d.ts ADDED
@@ -0,0 +1,443 @@
1
+
2
+ /**
3
+ * This is an autogenerated file created by the Stencil compiler.
4
+ * DO NOT MODIFY IT MANUALLY
5
+ */
6
+ interface ComponentCompilerPropertyComplexType {
7
+ /**
8
+ * The string of the original type annotation in the Stencil source code
9
+ */
10
+ original: string;
11
+ /**
12
+ * A 'resolved' type, where e.g. imported types have been resolved and inlined
13
+ *
14
+ * For instance, an annotation like `(foo: Foo) => string;` will be
15
+ * converted to `(foo: { foo: string }) => string;`.
16
+ */
17
+ resolved: string;
18
+ /**
19
+ * A record of the types which were referenced in the assorted type
20
+ * annotation in the original source file.
21
+ */
22
+ references: ComponentCompilerTypeReferences;
23
+ }
24
+ type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
25
+ interface ComponentCompilerTypeReference {
26
+ /**
27
+ * A type may be defined:
28
+ * - locally (in the same file as the component that uses it)
29
+ * - globally
30
+ * - by importing it into a file (and is defined elsewhere)
31
+ */
32
+ location: "local" | "global" | "import";
33
+ /**
34
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
35
+ */
36
+ path?: string;
37
+ /**
38
+ * An ID for this type which is unique within a Stencil project.
39
+ */
40
+ id: string;
41
+ }
42
+ interface ComponentCompilerReferencedType {
43
+ /**
44
+ * The path to the module where the type is declared.
45
+ */
46
+ path: string;
47
+ /**
48
+ * The string of the original type annotation in the Stencil source code
49
+ */
50
+ declaration: string;
51
+ /**
52
+ * An extracted docstring
53
+ */
54
+ docstring: string;
55
+ }
56
+ interface ComponentCompilerEventComplexType {
57
+ original: string;
58
+ resolved: string;
59
+ references: ComponentCompilerTypeReferences;
60
+ }
61
+ interface ComponentCompilerMethodComplexType {
62
+ signature: string;
63
+ parameters: JsonDocMethodParameter[];
64
+ references: ComponentCompilerTypeReferences;
65
+ return: string;
66
+ }
67
+ /**
68
+ * The Type Library holds information about the types which are used in a
69
+ * Stencil project. During compilation, Stencil gathers information about the
70
+ * types which form part of a component's public API, such as properties
71
+ * decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
72
+ * then added to the Type Library, where it can be accessed later on for
73
+ * generating documentation.
74
+ *
75
+ * This information is included in the file written by the `docs-json` output
76
+ * target (see {@link JsonDocs.typeLibrary}).
77
+ */
78
+ export type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
79
+ /**
80
+ * A container for JSDoc metadata for a project
81
+ */
82
+ export interface JsonDocs {
83
+ /**
84
+ * The metadata for the JSDocs for each component in a Stencil project
85
+ */
86
+ components: JsonDocsComponent[];
87
+ /**
88
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
89
+ */
90
+ timestamp: string;
91
+ compiler: {
92
+ /**
93
+ * The name of the compiler that generated the metadata
94
+ */
95
+ name: string;
96
+ /**
97
+ * The version of the Stencil compiler that generated the metadata
98
+ */
99
+ version: string;
100
+ /**
101
+ * The version of TypeScript that was used to generate the metadata
102
+ */
103
+ typescriptVersion: string;
104
+ };
105
+ typeLibrary: JsonDocsTypeLibrary;
106
+ }
107
+ /**
108
+ * Container for JSDoc metadata for a single Stencil component
109
+ */
110
+ export interface JsonDocsComponent {
111
+ /**
112
+ * The directory containing the Stencil component, minus the file name.
113
+ *
114
+ * @example /workspaces/stencil-project/src/components/my-component
115
+ */
116
+ dirPath?: string;
117
+ /**
118
+ * The name of the file containing the Stencil component, with no path
119
+ *
120
+ * @example my-component.tsx
121
+ */
122
+ fileName?: string;
123
+ /**
124
+ * The full path of the file containing the Stencil component
125
+ *
126
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
127
+ */
128
+ filePath?: string;
129
+ /**
130
+ * The path to the component's `readme.md` file, including the filename
131
+ *
132
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
133
+ */
134
+ readmePath?: string;
135
+ /**
136
+ * The path to the component's `usage` directory
137
+ *
138
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
139
+ */
140
+ usagesDir?: string;
141
+ /**
142
+ * The encapsulation strategy for a component
143
+ */
144
+ encapsulation: "shadow" | "scoped" | "none";
145
+ /**
146
+ * The tag name for the component, for use in HTML
147
+ */
148
+ tag: string;
149
+ /**
150
+ * The contents of a component's `readme.md` that are user generated.
151
+ *
152
+ * Auto-generated contents are not stored in this reference.
153
+ */
154
+ readme: string;
155
+ /**
156
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
157
+ */
158
+ docs: string;
159
+ /**
160
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
161
+ */
162
+ docsTags: JsonDocsTag[];
163
+ /**
164
+ * The text from the class-level JSDoc for a Stencil component, if present.
165
+ */
166
+ overview?: string;
167
+ /**
168
+ * A mapping of usage example file names to their contents for the component.
169
+ */
170
+ usage: JsonDocsUsage;
171
+ /**
172
+ * Array of metadata for a component's `@Prop`s
173
+ */
174
+ props: JsonDocsProp[];
175
+ /**
176
+ * Array of metadata for a component's `@Method`s
177
+ */
178
+ methods: JsonDocsMethod[];
179
+ /**
180
+ * Array of metadata for a component's `@Event`s
181
+ */
182
+ events: JsonDocsEvent[];
183
+ /**
184
+ * Array of metadata for a component's `@Listen` handlers
185
+ */
186
+ listeners: JsonDocsListener[];
187
+ /**
188
+ * Array of metadata for a component's CSS styling information
189
+ */
190
+ styles: JsonDocsStyle[];
191
+ /**
192
+ * Array of component Slot information, generated from `@slot` tags
193
+ */
194
+ slots: JsonDocsSlot[];
195
+ /**
196
+ * Array of component Parts information, generate from `@part` tags
197
+ */
198
+ parts: JsonDocsPart[];
199
+ /**
200
+ * Array of metadata describing where the current component is used
201
+ */
202
+ dependents: string[];
203
+ /**
204
+ * Array of metadata listing the components which are used in current component
205
+ */
206
+ dependencies: string[];
207
+ /**
208
+ * Describes a tree of components coupling
209
+ */
210
+ dependencyGraph: JsonDocsDependencyGraph;
211
+ /**
212
+ * A deprecation reason/description found following a `@deprecated` tag
213
+ */
214
+ deprecation?: string;
215
+ }
216
+ export interface JsonDocsDependencyGraph {
217
+ [tagName: string]: string[];
218
+ }
219
+ /**
220
+ * A descriptor for a single JSDoc tag found in a block comment
221
+ */
222
+ export interface JsonDocsTag {
223
+ /**
224
+ * The tag name (immediately following the '@')
225
+ */
226
+ name: string;
227
+ /**
228
+ * The description that immediately follows the tag name
229
+ */
230
+ text?: string;
231
+ }
232
+ export interface JsonDocsValue {
233
+ value?: string;
234
+ type: string;
235
+ }
236
+ /**
237
+ * A mapping of file names to their contents.
238
+ *
239
+ * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
240
+ * given directory structure:
241
+ * ```
242
+ * src/components/my-component
243
+ * ├── my-component.tsx
244
+ * └── usage
245
+ * ├── bar.md
246
+ * └── foo.md
247
+ * ```
248
+ * an instance of this type would include the name of the markdown file, mapped to its contents:
249
+ * ```ts
250
+ * {
251
+ * 'bar': STRING_CONTENTS_OF_BAR.MD
252
+ * 'foo': STRING_CONTENTS_OF_FOO.MD
253
+ * }
254
+ * ```
255
+ */
256
+ export interface JsonDocsUsage {
257
+ [key: string]: string;
258
+ }
259
+ /**
260
+ * An intermediate representation of a `@Prop` decorated member's JSDoc
261
+ */
262
+ export interface JsonDocsProp {
263
+ /**
264
+ * the name of the prop
265
+ */
266
+ name: string;
267
+ complexType?: ComponentCompilerPropertyComplexType;
268
+ /**
269
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
270
+ */
271
+ type: string;
272
+ /**
273
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
274
+ */
275
+ mutable: boolean;
276
+ /**
277
+ * The name of the attribute that is exposed to configure a compiled web component
278
+ */
279
+ attr?: string;
280
+ /**
281
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
282
+ */
283
+ reflectToAttr: boolean;
284
+ /**
285
+ * the JSDoc description text associated with the prop
286
+ */
287
+ docs: string;
288
+ /**
289
+ * JSDoc tags associated with the prop
290
+ */
291
+ docsTags: JsonDocsTag[];
292
+ /**
293
+ * The default value of the prop
294
+ */
295
+ default?: string;
296
+ /**
297
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
298
+ */
299
+ deprecation?: string;
300
+ values: JsonDocsValue[];
301
+ /**
302
+ * `true` if a component is declared with a '?', `false` otherwise
303
+ *
304
+ * @example
305
+ * ```tsx
306
+ * @Prop() componentProps?: any;
307
+ * ```
308
+ */
309
+ optional: boolean;
310
+ /**
311
+ * `true` if a component is declared with a '!', `false` otherwise
312
+ *
313
+ * @example
314
+ * ```tsx
315
+ * @Prop() componentProps!: any;
316
+ * ```
317
+ */
318
+ required: boolean;
319
+ /**
320
+ * `true` if the prop has a `get()`. `false` otherwise
321
+ */
322
+ getter: boolean;
323
+ /**
324
+ * `true` if the prop has a `set()`. `false` otherwise
325
+ */
326
+ setter: boolean;
327
+ }
328
+ export interface JsonDocsMethod {
329
+ name: string;
330
+ docs: string;
331
+ docsTags: JsonDocsTag[];
332
+ deprecation?: string;
333
+ signature: string;
334
+ returns: JsonDocsMethodReturn;
335
+ parameters: JsonDocMethodParameter[];
336
+ complexType: ComponentCompilerMethodComplexType;
337
+ }
338
+ export interface JsonDocsMethodReturn {
339
+ type: string;
340
+ docs: string;
341
+ }
342
+ export interface JsonDocMethodParameter {
343
+ name: string;
344
+ type: string;
345
+ docs: string;
346
+ }
347
+ export interface JsonDocsEvent {
348
+ event: string;
349
+ bubbles: boolean;
350
+ cancelable: boolean;
351
+ composed: boolean;
352
+ complexType: ComponentCompilerEventComplexType;
353
+ docs: string;
354
+ docsTags: JsonDocsTag[];
355
+ deprecation?: string;
356
+ detail: string;
357
+ }
358
+ /**
359
+ * Type describing a CSS Style, as described by a JSDoc-style comment
360
+ */
361
+ export interface JsonDocsStyle {
362
+ /**
363
+ * The name of the style
364
+ */
365
+ name: string;
366
+ /**
367
+ * The type/description associated with the style
368
+ */
369
+ docs: string;
370
+ /**
371
+ * The annotation used in the JSDoc of the style (e.g. `@prop`)
372
+ */
373
+ annotation: string;
374
+ /**
375
+ * The mode associated with the style
376
+ */
377
+ mode: string | undefined;
378
+ }
379
+ export interface JsonDocsListener {
380
+ event: string;
381
+ target?: string;
382
+ capture: boolean;
383
+ passive: boolean;
384
+ }
385
+ /**
386
+ * A descriptor for a slot
387
+ *
388
+ * Objects of this type are translated from the JSDoc tag, `@slot`
389
+ */
390
+ export interface JsonDocsSlot {
391
+ /**
392
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
393
+ */
394
+ name: string;
395
+ /**
396
+ * A textual description of the slot.
397
+ */
398
+ docs: string;
399
+ }
400
+ /**
401
+ * A descriptor of a CSS Shadow Part
402
+ *
403
+ * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
404
+ * attribute on a component in TSX
405
+ */
406
+ export interface JsonDocsPart {
407
+ /**
408
+ * The name of the Shadow part
409
+ */
410
+ name: string;
411
+ /**
412
+ * A textual description of the Shadow part.
413
+ */
414
+ docs: string;
415
+ }
416
+ /**
417
+ * Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
418
+ */
419
+ export interface StyleDoc {
420
+ /**
421
+ * The name of the CSS property
422
+ */
423
+ name: string;
424
+ /**
425
+ * The user-defined description of the CSS property
426
+ */
427
+ docs: string;
428
+ /**
429
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
430
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
431
+ * ends).
432
+ */
433
+ annotation: "prop";
434
+ /**
435
+ * The Stencil style-mode that is associated with this property.
436
+ */
437
+ mode: string | undefined;
438
+ }
439
+
440
+ export {};
441
+
442
+ declare const _default: JsonDocs;
443
+ export default _default;