@ng-doc/app 15.0.0-beta.32 → 15.0.0-beta.34

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 (332) hide show
  1. package/assets/themes/ng-doc-dark-purple.css +112 -0
  2. package/assets/themes/ng-doc-night.css +1 -0
  3. package/classes/index.d.ts +0 -1
  4. package/classes/root-page/root-page.d.ts +24 -5
  5. package/classes/search-engine/search-engine.d.ts +1 -1
  6. package/components/api-list/api-list.component.d.ts +3 -4
  7. package/components/api-list/api-list.module.d.ts +1 -1
  8. package/components/demo/demo.component.d.ts +5 -4
  9. package/components/demo-displayer/demo-displayer.component.d.ts +1 -1
  10. package/components/demo-displayer/demo-displayer.module.d.ts +2 -1
  11. package/components/index.d.ts +1 -0
  12. package/components/navbar/navbar.component.d.ts +18 -0
  13. package/components/navbar/navbar.module.d.ts +4 -2
  14. package/components/page/page.component.d.ts +9 -1
  15. package/components/page/page.module.d.ts +8 -6
  16. package/components/playground/base-playground.d.ts +15 -0
  17. package/components/playground/index.d.ts +5 -0
  18. package/components/playground/playground-demo/playground-demo.component.d.ts +33 -0
  19. package/components/playground/playground-form.d.ts +6 -0
  20. package/components/playground/playground-properties/playground-properties.component.d.ts +22 -0
  21. package/components/{playground-property → playground/playground-property}/playground-property.component.d.ts +2 -2
  22. package/components/playground/playground.component.d.ts +6 -5
  23. package/components/playground/playground.module.d.ts +9 -6
  24. package/components/root/root.component.d.ts +36 -2
  25. package/components/root/root.module.d.ts +2 -2
  26. package/components/search/search.component.d.ts +1 -1
  27. package/components/search/search.module.d.ts +1 -1
  28. package/components/search-result/search-result.component.d.ts +1 -1
  29. package/components/sidebar/sidebar-category/sidebar-category.component.d.ts +2 -2
  30. package/components/sidebar/sidebar.module.d.ts +9 -4
  31. package/components/theme-toggle/theme-toggle.component.d.ts +2 -1
  32. package/constants/themes.d.ts +63 -0
  33. package/esm2020/classes/index.mjs +1 -2
  34. package/esm2020/classes/root-page/root-page.mjs +4 -1
  35. package/esm2020/classes/search-engine/search-engine.mjs +9 -10
  36. package/esm2020/components/api-list/api-list.component.mjs +18 -8
  37. package/esm2020/components/api-list/api-list.module.mjs +7 -4
  38. package/esm2020/components/code/code.component.mjs +4 -4
  39. package/esm2020/components/demo/demo.component.mjs +8 -7
  40. package/esm2020/components/demo-displayer/demo-displayer.component.mjs +6 -3
  41. package/esm2020/components/demo-displayer/demo-displayer.module.mjs +7 -3
  42. package/esm2020/components/index.mjs +2 -1
  43. package/esm2020/components/link/link.component.mjs +1 -1
  44. package/esm2020/components/navbar/navbar.component.mjs +24 -4
  45. package/esm2020/components/navbar/navbar.module.mjs +4 -5
  46. package/esm2020/components/page/page.component.mjs +35 -12
  47. package/esm2020/components/page/page.module.mjs +46 -7
  48. package/esm2020/components/playground/base-playground.mjs +18 -0
  49. package/esm2020/components/playground/index.mjs +6 -1
  50. package/esm2020/components/playground/playground-demo/playground-demo.component.mjs +117 -0
  51. package/esm2020/components/playground/playground-form.mjs +2 -0
  52. package/esm2020/components/playground/playground-properties/playground-properties.component.mjs +42 -0
  53. package/esm2020/components/playground/playground-property/playground-property.component.mjs +89 -0
  54. package/esm2020/components/playground/playground.component.mjs +15 -13
  55. package/esm2020/components/playground/playground.module.mjs +57 -14
  56. package/esm2020/components/root/root.component.mjs +54 -7
  57. package/esm2020/components/root/root.module.mjs +6 -6
  58. package/esm2020/components/search/search.component.mjs +3 -3
  59. package/esm2020/components/search/search.module.mjs +10 -4
  60. package/esm2020/components/search-result/search-result.component.mjs +1 -1
  61. package/esm2020/components/sidebar/sidebar-category/sidebar-category.component.mjs +10 -6
  62. package/esm2020/components/sidebar/sidebar-item/sidebar-item.component.mjs +5 -4
  63. package/esm2020/components/sidebar/sidebar.component.mjs +4 -16
  64. package/esm2020/components/sidebar/sidebar.module.mjs +7 -2
  65. package/esm2020/components/theme-toggle/theme-toggle.component.mjs +21 -14
  66. package/esm2020/components/toc/toc-element/toc-element.component.mjs +3 -3
  67. package/esm2020/components/toc/toc.component.mjs +4 -4
  68. package/esm2020/constants/themes.mjs +67 -1
  69. package/esm2020/directives/code-highlighter/code-highlighter.directive.mjs +1 -19
  70. package/esm2020/directives/route-active/route-active.directive.mjs +2 -2
  71. package/esm2020/helpers/generate-toc/generate-toc.mjs +10 -14
  72. package/esm2020/helpers/index.mjs +2 -3
  73. package/esm2020/helpers/is-playground-property/is-playground-property.mjs +2 -2
  74. package/esm2020/helpers/provide-playground-demo/index.mjs +2 -0
  75. package/esm2020/helpers/provide-playground-demo/ng-doc-app-helpers-provide-playground-demo.mjs +5 -0
  76. package/esm2020/helpers/provide-playground-demo/provide-playground-demo.mjs +29 -0
  77. package/esm2020/helpers/provide-type-control/provide-type-control.mjs +1 -1
  78. package/esm2020/index.mjs +2 -1
  79. package/esm2020/interfaces/context.mjs +1 -1
  80. package/esm2020/interfaces/demo-assets.mjs +1 -1
  81. package/esm2020/interfaces/index.mjs +1 -2
  82. package/esm2020/interfaces/navigation.mjs +1 -1
  83. package/esm2020/interfaces/provided-type-control.mjs +1 -1
  84. package/esm2020/interfaces/type-control-provider-options.mjs +1 -1
  85. package/esm2020/modules/root/ng-doc.module.mjs +11 -11
  86. package/esm2020/pipes/extract-value/extract-value.pipe.mjs +2 -2
  87. package/esm2020/processors/demo-processor/demo-processor.directive.mjs +2 -3
  88. package/esm2020/processors/html-processor/html-processor.directive.mjs +2 -3
  89. package/esm2020/processors/tooltip-processor/tooltip-wrapper.component.mjs +3 -3
  90. package/esm2020/services/sidebar/sidebar.service.mjs +49 -8
  91. package/esm2020/services/theme/theme.service.mjs +2 -2
  92. package/esm2020/tokens/api-list.mjs +1 -1
  93. package/esm2020/type-controls/boolean-control/boolean-control.module.mjs +4 -3
  94. package/esm2020/type-controls/number-control/number-control.component.mjs +2 -2
  95. package/esm2020/type-controls/number-control/number-control.module.mjs +4 -3
  96. package/esm2020/type-controls/string-control/string-control.component.mjs +2 -2
  97. package/esm2020/type-controls/string-control/string-control.module.mjs +4 -3
  98. package/esm2020/type-controls/type-alias-control/type-alias-control.component.mjs +2 -2
  99. package/esm2020/type-controls/type-alias-control/type-alias-control.module.mjs +4 -3
  100. package/esm2020/types/index.mjs +1 -2
  101. package/fesm2015/ng-doc-app-classes-root-page.mjs +3 -0
  102. package/fesm2015/ng-doc-app-classes-root-page.mjs.map +1 -1
  103. package/fesm2015/ng-doc-app-classes-search-engine.mjs +10 -11
  104. package/fesm2015/ng-doc-app-classes-search-engine.mjs.map +1 -1
  105. package/fesm2015/ng-doc-app-classes.mjs +0 -1
  106. package/fesm2015/ng-doc-app-classes.mjs.map +1 -1
  107. package/fesm2015/ng-doc-app-components-api-list.mjs +23 -10
  108. package/fesm2015/ng-doc-app-components-api-list.mjs.map +1 -1
  109. package/fesm2015/ng-doc-app-components-code.mjs +3 -3
  110. package/fesm2015/ng-doc-app-components-code.mjs.map +1 -1
  111. package/fesm2015/ng-doc-app-components-demo-displayer.mjs +11 -4
  112. package/fesm2015/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  113. package/fesm2015/ng-doc-app-components-demo.mjs +8 -6
  114. package/fesm2015/ng-doc-app-components-demo.mjs.map +1 -1
  115. package/fesm2015/ng-doc-app-components-link.mjs.map +1 -1
  116. package/fesm2015/ng-doc-app-components-navbar.mjs +27 -7
  117. package/fesm2015/ng-doc-app-components-navbar.mjs.map +1 -1
  118. package/fesm2015/ng-doc-app-components-page.mjs +83 -18
  119. package/fesm2015/ng-doc-app-components-page.mjs.map +1 -1
  120. package/fesm2015/ng-doc-app-components-playground.mjs +324 -31
  121. package/fesm2015/ng-doc-app-components-playground.mjs.map +1 -1
  122. package/fesm2015/ng-doc-app-components-root.mjs +58 -10
  123. package/fesm2015/ng-doc-app-components-root.mjs.map +1 -1
  124. package/fesm2015/ng-doc-app-components-search-result.mjs.map +1 -1
  125. package/fesm2015/ng-doc-app-components-search.mjs +11 -5
  126. package/fesm2015/ng-doc-app-components-search.mjs.map +1 -1
  127. package/fesm2015/ng-doc-app-components-sidebar.mjs +20 -23
  128. package/fesm2015/ng-doc-app-components-sidebar.mjs.map +1 -1
  129. package/fesm2015/ng-doc-app-components-theme-toggle.mjs +21 -13
  130. package/fesm2015/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  131. package/fesm2015/ng-doc-app-components-toc.mjs +5 -5
  132. package/fesm2015/ng-doc-app-components-toc.mjs.map +1 -1
  133. package/fesm2015/ng-doc-app-components.mjs +1 -0
  134. package/fesm2015/ng-doc-app-components.mjs.map +1 -1
  135. package/fesm2015/ng-doc-app-constants.mjs +67 -1
  136. package/fesm2015/ng-doc-app-constants.mjs.map +1 -1
  137. package/fesm2015/ng-doc-app-directives-code-highlighter.mjs +0 -18
  138. package/fesm2015/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
  139. package/fesm2015/ng-doc-app-directives-route-active.mjs +1 -1
  140. package/fesm2015/ng-doc-app-directives-route-active.mjs.map +1 -1
  141. package/fesm2015/ng-doc-app-helpers-generate-toc.mjs +10 -13
  142. package/fesm2015/ng-doc-app-helpers-generate-toc.mjs.map +1 -1
  143. package/fesm2015/ng-doc-app-helpers-is-playground-property.mjs +1 -1
  144. package/fesm2015/ng-doc-app-helpers-is-playground-property.mjs.map +1 -1
  145. package/fesm2015/ng-doc-app-helpers-provide-playground-demo.mjs +37 -0
  146. package/fesm2015/ng-doc-app-helpers-provide-playground-demo.mjs.map +1 -0
  147. package/fesm2015/ng-doc-app-helpers-provide-type-control.mjs.map +1 -1
  148. package/fesm2015/ng-doc-app-helpers.mjs +1 -2
  149. package/fesm2015/ng-doc-app-helpers.mjs.map +1 -1
  150. package/fesm2015/ng-doc-app-modules-root.mjs +10 -10
  151. package/fesm2015/ng-doc-app-modules-root.mjs.map +1 -1
  152. package/fesm2015/ng-doc-app-pipes-extract-value.mjs +1 -1
  153. package/fesm2015/ng-doc-app-pipes-extract-value.mjs.map +1 -1
  154. package/fesm2015/ng-doc-app-processors-demo-processor.mjs +2 -2
  155. package/fesm2015/ng-doc-app-processors-demo-processor.mjs.map +1 -1
  156. package/fesm2015/ng-doc-app-processors-html-processor.mjs +1 -2
  157. package/fesm2015/ng-doc-app-processors-html-processor.mjs.map +1 -1
  158. package/fesm2015/ng-doc-app-processors-tooltip-processor.mjs +2 -2
  159. package/fesm2015/ng-doc-app-processors-tooltip-processor.mjs.map +1 -1
  160. package/fesm2015/ng-doc-app-services-sidebar.mjs +50 -7
  161. package/fesm2015/ng-doc-app-services-sidebar.mjs.map +1 -1
  162. package/fesm2015/ng-doc-app-services-theme.mjs +1 -1
  163. package/fesm2015/ng-doc-app-services-theme.mjs.map +1 -1
  164. package/fesm2015/ng-doc-app-tokens.mjs.map +1 -1
  165. package/fesm2015/ng-doc-app-type-controls-boolean-control.mjs +3 -2
  166. package/fesm2015/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
  167. package/fesm2015/ng-doc-app-type-controls-number-control.mjs +4 -3
  168. package/fesm2015/ng-doc-app-type-controls-number-control.mjs.map +1 -1
  169. package/fesm2015/ng-doc-app-type-controls-string-control.mjs +4 -3
  170. package/fesm2015/ng-doc-app-type-controls-string-control.mjs.map +1 -1
  171. package/fesm2015/ng-doc-app-type-controls-type-alias-control.mjs +4 -3
  172. package/fesm2015/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  173. package/fesm2015/ng-doc-app.mjs +1 -0
  174. package/fesm2015/ng-doc-app.mjs.map +1 -1
  175. package/fesm2020/ng-doc-app-classes-root-page.mjs +3 -0
  176. package/fesm2020/ng-doc-app-classes-root-page.mjs.map +1 -1
  177. package/fesm2020/ng-doc-app-classes-search-engine.mjs +10 -11
  178. package/fesm2020/ng-doc-app-classes-search-engine.mjs.map +1 -1
  179. package/fesm2020/ng-doc-app-classes.mjs +0 -1
  180. package/fesm2020/ng-doc-app-classes.mjs.map +1 -1
  181. package/fesm2020/ng-doc-app-components-api-list.mjs +23 -10
  182. package/fesm2020/ng-doc-app-components-api-list.mjs.map +1 -1
  183. package/fesm2020/ng-doc-app-components-code.mjs +3 -3
  184. package/fesm2020/ng-doc-app-components-code.mjs.map +1 -1
  185. package/fesm2020/ng-doc-app-components-demo-displayer.mjs +11 -4
  186. package/fesm2020/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  187. package/fesm2020/ng-doc-app-components-demo.mjs +7 -6
  188. package/fesm2020/ng-doc-app-components-demo.mjs.map +1 -1
  189. package/fesm2020/ng-doc-app-components-link.mjs.map +1 -1
  190. package/fesm2020/ng-doc-app-components-navbar.mjs +27 -7
  191. package/fesm2020/ng-doc-app-components-navbar.mjs.map +1 -1
  192. package/fesm2020/ng-doc-app-components-page.mjs +79 -18
  193. package/fesm2020/ng-doc-app-components-page.mjs.map +1 -1
  194. package/fesm2020/ng-doc-app-components-playground.mjs +315 -31
  195. package/fesm2020/ng-doc-app-components-playground.mjs.map +1 -1
  196. package/fesm2020/ng-doc-app-components-root.mjs +58 -10
  197. package/fesm2020/ng-doc-app-components-root.mjs.map +1 -1
  198. package/fesm2020/ng-doc-app-components-search-result.mjs.map +1 -1
  199. package/fesm2020/ng-doc-app-components-search.mjs +11 -5
  200. package/fesm2020/ng-doc-app-components-search.mjs.map +1 -1
  201. package/fesm2020/ng-doc-app-components-sidebar.mjs +20 -23
  202. package/fesm2020/ng-doc-app-components-sidebar.mjs.map +1 -1
  203. package/fesm2020/ng-doc-app-components-theme-toggle.mjs +20 -13
  204. package/fesm2020/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  205. package/fesm2020/ng-doc-app-components-toc.mjs +5 -5
  206. package/fesm2020/ng-doc-app-components-toc.mjs.map +1 -1
  207. package/fesm2020/ng-doc-app-components.mjs +1 -0
  208. package/fesm2020/ng-doc-app-components.mjs.map +1 -1
  209. package/fesm2020/ng-doc-app-constants.mjs +67 -1
  210. package/fesm2020/ng-doc-app-constants.mjs.map +1 -1
  211. package/fesm2020/ng-doc-app-directives-code-highlighter.mjs +0 -18
  212. package/fesm2020/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
  213. package/fesm2020/ng-doc-app-directives-route-active.mjs +1 -1
  214. package/fesm2020/ng-doc-app-directives-route-active.mjs.map +1 -1
  215. package/fesm2020/ng-doc-app-helpers-generate-toc.mjs +10 -13
  216. package/fesm2020/ng-doc-app-helpers-generate-toc.mjs.map +1 -1
  217. package/fesm2020/ng-doc-app-helpers-is-playground-property.mjs +1 -1
  218. package/fesm2020/ng-doc-app-helpers-is-playground-property.mjs.map +1 -1
  219. package/fesm2020/ng-doc-app-helpers-provide-playground-demo.mjs +36 -0
  220. package/fesm2020/ng-doc-app-helpers-provide-playground-demo.mjs.map +1 -0
  221. package/fesm2020/ng-doc-app-helpers-provide-type-control.mjs.map +1 -1
  222. package/fesm2020/ng-doc-app-helpers.mjs +1 -2
  223. package/fesm2020/ng-doc-app-helpers.mjs.map +1 -1
  224. package/fesm2020/ng-doc-app-modules-root.mjs +10 -10
  225. package/fesm2020/ng-doc-app-modules-root.mjs.map +1 -1
  226. package/fesm2020/ng-doc-app-pipes-extract-value.mjs +1 -1
  227. package/fesm2020/ng-doc-app-pipes-extract-value.mjs.map +1 -1
  228. package/fesm2020/ng-doc-app-processors-demo-processor.mjs +1 -2
  229. package/fesm2020/ng-doc-app-processors-demo-processor.mjs.map +1 -1
  230. package/fesm2020/ng-doc-app-processors-html-processor.mjs +1 -2
  231. package/fesm2020/ng-doc-app-processors-html-processor.mjs.map +1 -1
  232. package/fesm2020/ng-doc-app-processors-tooltip-processor.mjs +2 -2
  233. package/fesm2020/ng-doc-app-processors-tooltip-processor.mjs.map +1 -1
  234. package/fesm2020/ng-doc-app-services-sidebar.mjs +48 -7
  235. package/fesm2020/ng-doc-app-services-sidebar.mjs.map +1 -1
  236. package/fesm2020/ng-doc-app-services-theme.mjs +1 -1
  237. package/fesm2020/ng-doc-app-services-theme.mjs.map +1 -1
  238. package/fesm2020/ng-doc-app-tokens.mjs.map +1 -1
  239. package/fesm2020/ng-doc-app-type-controls-boolean-control.mjs +3 -2
  240. package/fesm2020/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
  241. package/fesm2020/ng-doc-app-type-controls-number-control.mjs +4 -3
  242. package/fesm2020/ng-doc-app-type-controls-number-control.mjs.map +1 -1
  243. package/fesm2020/ng-doc-app-type-controls-string-control.mjs +4 -3
  244. package/fesm2020/ng-doc-app-type-controls-string-control.mjs.map +1 -1
  245. package/fesm2020/ng-doc-app-type-controls-type-alias-control.mjs +4 -3
  246. package/fesm2020/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  247. package/fesm2020/ng-doc-app.mjs +1 -0
  248. package/fesm2020/ng-doc-app.mjs.map +1 -1
  249. package/helpers/generate-toc/generate-toc.d.ts +2 -1
  250. package/helpers/index.d.ts +1 -2
  251. package/helpers/is-playground-property/is-playground-property.d.ts +1 -1
  252. package/helpers/provide-playground-demo/index.d.ts +1 -0
  253. package/helpers/provide-playground-demo/provide-playground-demo.d.ts +18 -0
  254. package/helpers/provide-type-control/provide-type-control.d.ts +1 -1
  255. package/index.d.ts +1 -0
  256. package/interfaces/context.d.ts +6 -0
  257. package/interfaces/demo-assets.d.ts +1 -1
  258. package/interfaces/index.d.ts +0 -1
  259. package/interfaces/navigation.d.ts +3 -0
  260. package/interfaces/provided-type-control.d.ts +1 -1
  261. package/interfaces/type-control-provider-options.d.ts +7 -0
  262. package/modules/root/ng-doc.module.d.ts +2 -4
  263. package/package.json +12 -55
  264. package/pipes/extract-value/extract-value.pipe.d.ts +1 -1
  265. package/services/sidebar/sidebar.service.d.ts +28 -1
  266. package/styles/global.css +200 -171
  267. package/styles/main.css +200 -171
  268. package/tokens/api-list.d.ts +1 -1
  269. package/types/index.d.ts +0 -1
  270. package/classes/html-parser/index.d.ts +0 -1
  271. package/components/playground-demo/demo/base-demo.component.d.ts +0 -7
  272. package/components/playground-demo/index.d.ts +0 -2
  273. package/components/playground-demo/playground-demo.component.d.ts +0 -29
  274. package/components/playground-demo/playground-demo.module.d.ts +0 -9
  275. package/components/playground-properties/index.d.ts +0 -2
  276. package/components/playground-properties/playground-properties.component.d.ts +0 -16
  277. package/components/playground-properties/playground-properties.module.d.ts +0 -11
  278. package/components/playground-property/index.d.ts +0 -2
  279. package/components/playground-property/playground-property.module.d.ts +0 -11
  280. package/esm2020/classes/html-parser/index.mjs +0 -2
  281. package/esm2020/classes/html-parser/ng-doc-app-classes-html-parser.mjs +0 -5
  282. package/esm2020/components/playground-demo/demo/base-demo.component.mjs +0 -3
  283. package/esm2020/components/playground-demo/index.mjs +0 -3
  284. package/esm2020/components/playground-demo/ng-doc-app-components-playground-demo.mjs +0 -5
  285. package/esm2020/components/playground-demo/playground-demo.component.mjs +0 -101
  286. package/esm2020/components/playground-demo/playground-demo.module.mjs +0 -19
  287. package/esm2020/components/playground-properties/index.mjs +0 -3
  288. package/esm2020/components/playground-properties/ng-doc-app-components-playground-properties.mjs +0 -5
  289. package/esm2020/components/playground-properties/playground-properties.component.mjs +0 -36
  290. package/esm2020/components/playground-properties/playground-properties.module.mjs +0 -50
  291. package/esm2020/components/playground-property/index.mjs +0 -3
  292. package/esm2020/components/playground-property/ng-doc-app-components-playground-property.mjs +0 -5
  293. package/esm2020/components/playground-property/playground-property.component.mjs +0 -88
  294. package/esm2020/components/playground-property/playground-property.module.mjs +0 -21
  295. package/esm2020/helpers/compile-template/compile-template.mjs +0 -116
  296. package/esm2020/helpers/compile-template/index.mjs +0 -2
  297. package/esm2020/helpers/compile-template/ng-doc-app-helpers-compile-template.mjs +0 -5
  298. package/esm2020/helpers/format-html/format-html.mjs +0 -16
  299. package/esm2020/helpers/format-html/index.mjs +0 -2
  300. package/esm2020/helpers/format-html/ng-doc-app-helpers-format-html.mjs +0 -5
  301. package/esm2020/interfaces/playground-form.mjs +0 -2
  302. package/esm2020/types/header-level.mjs +0 -2
  303. package/fesm2015/ng-doc-app-classes-html-parser.mjs +0 -8
  304. package/fesm2015/ng-doc-app-classes-html-parser.mjs.map +0 -1
  305. package/fesm2015/ng-doc-app-components-playground-demo.mjs +0 -123
  306. package/fesm2015/ng-doc-app-components-playground-demo.mjs.map +0 -1
  307. package/fesm2015/ng-doc-app-components-playground-properties.mjs +0 -90
  308. package/fesm2015/ng-doc-app-components-playground-properties.mjs.map +0 -1
  309. package/fesm2015/ng-doc-app-components-playground-property.mjs +0 -113
  310. package/fesm2015/ng-doc-app-components-playground-property.mjs.map +0 -1
  311. package/fesm2015/ng-doc-app-helpers-compile-template.mjs +0 -122
  312. package/fesm2015/ng-doc-app-helpers-compile-template.mjs.map +0 -1
  313. package/fesm2015/ng-doc-app-helpers-format-html.mjs +0 -22
  314. package/fesm2015/ng-doc-app-helpers-format-html.mjs.map +0 -1
  315. package/fesm2020/ng-doc-app-classes-html-parser.mjs +0 -8
  316. package/fesm2020/ng-doc-app-classes-html-parser.mjs.map +0 -1
  317. package/fesm2020/ng-doc-app-components-playground-demo.mjs +0 -123
  318. package/fesm2020/ng-doc-app-components-playground-demo.mjs.map +0 -1
  319. package/fesm2020/ng-doc-app-components-playground-properties.mjs +0 -89
  320. package/fesm2020/ng-doc-app-components-playground-properties.mjs.map +0 -1
  321. package/fesm2020/ng-doc-app-components-playground-property.mjs +0 -112
  322. package/fesm2020/ng-doc-app-components-playground-property.mjs.map +0 -1
  323. package/fesm2020/ng-doc-app-helpers-compile-template.mjs +0 -122
  324. package/fesm2020/ng-doc-app-helpers-compile-template.mjs.map +0 -1
  325. package/fesm2020/ng-doc-app-helpers-format-html.mjs +0 -22
  326. package/fesm2020/ng-doc-app-helpers-format-html.mjs.map +0 -1
  327. package/helpers/compile-template/compile-template.d.ts +0 -18
  328. package/helpers/compile-template/index.d.ts +0 -1
  329. package/helpers/format-html/format-html.d.ts +0 -5
  330. package/helpers/format-html/index.d.ts +0 -1
  331. package/interfaces/playground-form.d.ts +0 -5
  332. package/types/header-level.d.ts +0 -4
@@ -1,24 +1,268 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/forms';
4
- import { ReactiveFormsModule } from '@angular/forms';
5
- import * as i1 from '@ng-doc/app/classes';
6
- import { objectKeys, extractValue } from '@ng-doc/core';
7
- import * as i3 from '@angular/common';
2
+ import { Directive, isDevMode, ViewContainerRef, Component, ChangeDetectionStrategy, Input, ViewChild, HostBinding, EventEmitter, Output, ChangeDetectorRef, Injector, NgModule } from '@angular/core';
3
+ import * as i3 from '@angular/forms';
4
+ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
5
+ import * as i1$1 from '@ng-doc/app/classes/root-page';
6
+ import { NgDocRootPage } from '@ng-doc/app/classes/root-page';
7
+ import { extractValueOrThrow, extractValue } from '@ng-doc/core/helpers/extract-value';
8
+ import { objectKeys } from '@ng-doc/core/helpers/object-keys';
9
+ import * as i2 from '@angular/common';
8
10
  import { CommonModule } from '@angular/common';
9
- import * as i4 from '@ng-doc/app/components/playground-demo';
10
- import { NgDocPlaygroundDemoModule } from '@ng-doc/app/components/playground-demo';
11
- import * as i5 from '@ng-doc/app/components/playground-properties';
12
- import { NgDocPlaygroundPropertiesModule } from '@ng-doc/app/components/playground-properties';
13
- import * as i6 from '@ng-doc/ui-kit';
14
- import { NgDocAsArrayModule } from '@ng-doc/ui-kit';
11
+ import * as i1 from '@angular/cdk/layout';
12
+ import { Breakpoints } from '@angular/cdk/layout';
13
+ import { pluck, takeUntil } from 'rxjs/operators';
14
+ import * as i4 from '@ng-doc/ui-kit';
15
+ import { NgDocLabelModule, NgDocTooltipModule, NgDocAsArrayModule, NgDocButtonIconModule, NgDocIconModule, NgDocTextModule, NgDocCheckboxModule, NgDocButtonModule } from '@ng-doc/ui-kit';
16
+ import { isPlaygroundProperty } from '@ng-doc/app/helpers/is-playground-property';
17
+ import { getTokenForType } from '@ng-doc/app/helpers/provide-type-control';
18
+ import { __decorate, __metadata } from 'tslib';
19
+ import { getPlaygroundDemoToken } from '@ng-doc/app/helpers/provide-playground-demo';
20
+ import { buildPlaygroundDemoTemplate } from '@ng-doc/core/helpers/build-playground-demo-template';
21
+ import { formatHtml } from '@ng-doc/core/helpers/format-html';
22
+ import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
23
+ import { of, Subject } from 'rxjs';
24
+ import * as i2$1 from '@ng-doc/app/components/demo-displayer';
25
+ import { NgDocDemoDisplayerModule } from '@ng-doc/app/components/demo-displayer';
26
+ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
27
+
28
+ /**
29
+ * Base class for playgrounds components.
30
+ */
31
+ class NgDocBasePlayground {
32
+ constructor() {
33
+ this.data = {};
34
+ this.content = {};
35
+ }
36
+ }
37
+ NgDocBasePlayground.selector = 'unknown';
38
+ NgDocBasePlayground.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocBasePlayground, deps: [], target: i0.ɵɵFactoryTarget.Directive });
39
+ NgDocBasePlayground.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.3", type: NgDocBasePlayground, ngImport: i0 });
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocBasePlayground, decorators: [{
41
+ type: Directive
42
+ }] });
43
+
44
+ class NgDocPlaygroundPropertyComponent {
45
+ constructor(injector) {
46
+ this.injector = injector;
47
+ this.name = '';
48
+ }
49
+ ngOnChanges({ property, control }) {
50
+ if (property && this.property) {
51
+ this.propertyControl?.destroy();
52
+ this.propertyControl = undefined;
53
+ const type = isPlaygroundProperty(this.property) ? this.property.type : 'boolean';
54
+ const typeControl = this.getControlForType(type) ??
55
+ this.getControlForTypeAlias(isPlaygroundProperty(this.property) ? this.property.options : undefined);
56
+ if (typeControl && this.propertyOutlet) {
57
+ this.propertyControl = this.propertyOutlet.createComponent(typeControl.control);
58
+ this.propertyControl.instance.name = this.name;
59
+ this.propertyControl.instance.description = this.tooltipContent;
60
+ this.propertyControl.instance.options = isPlaygroundProperty(this.property)
61
+ ? this.property.options
62
+ : undefined;
63
+ this.propertyControl.instance.default = isPlaygroundProperty(this.property)
64
+ ? this.property.default
65
+ : undefined;
66
+ this.propertyControl.instance.writeValue(this.control?.value);
67
+ this.option = typeControl.options;
68
+ }
69
+ else if (isDevMode()) {
70
+ console.warn(`NgDocPlayground didn't find the control for the @Input "${this.name}", the type "${type}" was not recognized'`);
71
+ }
72
+ }
73
+ if (control) {
74
+ this.control?.registerOnChange((value) => this.propertyControl?.instance?.writeValue(value));
75
+ this.propertyControl?.instance.registerOnChange((value) => this.control?.setValue(value));
76
+ this.propertyControl?.instance.registerOnTouched(() => this.control?.markAsTouched());
77
+ }
78
+ }
79
+ get hasPropertyControl() {
80
+ return !!this.propertyControl;
81
+ }
82
+ get tooltipContent() {
83
+ return this.property && isPlaygroundProperty(this.property) ? this.property.description ?? '' : '';
84
+ }
85
+ getControlForType(type) {
86
+ const token = getTokenForType(type);
87
+ return token ? this.injector.get(token) : undefined;
88
+ }
89
+ getControlForTypeAlias(options) {
90
+ if (options && options.length) {
91
+ let optionsIsValid = true;
92
+ try {
93
+ // checking that all values are extractable
94
+ options.forEach((item) => extractValueOrThrow(item));
95
+ }
96
+ catch {
97
+ optionsIsValid = false;
98
+ }
99
+ if (optionsIsValid) {
100
+ const token = getTokenForType('NgDocTypeAlias');
101
+ return token ? this.injector.get(token) : undefined;
102
+ }
103
+ }
104
+ return undefined;
105
+ }
106
+ }
107
+ NgDocPlaygroundPropertyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertyComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
108
+ NgDocPlaygroundPropertyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundPropertyComponent, selector: "ng-doc-playground-property", inputs: { name: "name", property: "property", control: "control" }, host: { properties: { "attr.data-has-property-control": "this.hasPropertyControl" } }, viewQueries: [{ propertyName: "propertyOutlet", first: true, predicate: ["propertyOutlet"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<label [ng-doc-label]=\"option?.hideLabel ? '' : labelContent\">\n\t<ng-template #labelContent>\n\t\t<span\n\t\t\t[ngDocTooltip]=\"tooltipContent\"\n\t\t\t[canOpen]=\"!!tooltipContent\"\n\t\t\t[positions]=\"['left-center', 'top-right', 'bottom-right']\"\n\t\t\t>{{ name }}</span\n\t\t>\n\t</ng-template>\n\t<ng-container #propertyOutlet></ng-container>\n</label>\n", styles: [":host{display:block}:host[data-has-property-control=false]{display:none}\n"], dependencies: [{ kind: "component", type: i4.NgDocLabelComponent, selector: "label[ng-doc-label]", inputs: ["ng-doc-label", "align"] }, { kind: "directive", type: i4.NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertyComponent, decorators: [{
110
+ type: Component,
111
+ args: [{ selector: 'ng-doc-playground-property', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [ng-doc-label]=\"option?.hideLabel ? '' : labelContent\">\n\t<ng-template #labelContent>\n\t\t<span\n\t\t\t[ngDocTooltip]=\"tooltipContent\"\n\t\t\t[canOpen]=\"!!tooltipContent\"\n\t\t\t[positions]=\"['left-center', 'top-right', 'bottom-right']\"\n\t\t\t>{{ name }}</span\n\t\t>\n\t</ng-template>\n\t<ng-container #propertyOutlet></ng-container>\n</label>\n", styles: [":host{display:block}:host[data-has-property-control=false]{display:none}\n"] }]
112
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { name: [{
113
+ type: Input
114
+ }], property: [{
115
+ type: Input
116
+ }], control: [{
117
+ type: Input
118
+ }], propertyOutlet: [{
119
+ type: ViewChild,
120
+ args: ['propertyOutlet', { read: ViewContainerRef, static: true }]
121
+ }], hasPropertyControl: [{
122
+ type: HostBinding,
123
+ args: ['attr.data-has-property-control']
124
+ }] } });
125
+
126
+ class NgDocPlaygroundPropertiesComponent {
127
+ constructor(breakpointObserver) {
128
+ this.breakpointObserver = breakpointObserver;
129
+ this.recreateDemo = false;
130
+ this.recreateDemoChange = new EventEmitter();
131
+ this.resetForm = new EventEmitter();
132
+ this.breakpoints = [Breakpoints.XSmall];
133
+ this.observer = this.breakpointObserver.observe(this.breakpoints).pipe(pluck('matches'));
134
+ }
135
+ getFormControl(controlType, key) {
136
+ return this.form.get(controlType)?.get(key);
137
+ }
138
+ }
139
+ NgDocPlaygroundPropertiesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertiesComponent, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
140
+ NgDocPlaygroundPropertiesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: { form: "form", properties: "properties", dynamicContent: "dynamicContent", recreateDemo: "recreateDemo" }, outputs: { recreateDemoChange: "recreateDemoChange", resetForm: "resetForm" }, ngImport: i0, template: "<div class=\"ng-doc-playground-properties-wrapper\" [class.vertical]=\"observer | async\">\n\t<div class=\"ng-doc-playground-demos\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"ng-doc-playground-properties\">\n\t\t<div class=\"ng-doc-playground-header\">\n\t\t\t<h4 ng-doc-text>Playground</h4>\n\t\t\t<button ng-doc-button color=\"red\" (click)=\"resetForm.emit()\">Reset</button>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-setting\">\n\t\t\t<ng-doc-checkbox [(ngModel)]=\"recreateDemo\" (ngModelChange)=\"recreateDemoChange.emit($event)\">\n\t\t\t\t<span\n\t\t\t\t\tng-doc-text\n\t\t\t\t\t[ngDocTooltip]=\"'Recreates demo everytime\\none of the input has changed'\"\n\t\t\t\t\t[positions]=\"['bottom-right', 'left-center']\"\n\t\t\t\t>\n\t\t\t\t\tRecreate\n\t\t\t\t\t<ng-doc-icon icon=\"info\" ngDocTextRight></ng-doc-icon>\n\t\t\t\t</span>\n\t\t\t</ng-doc-checkbox>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-divider\"></div>\n\t\t<ng-container *ngIf=\"(properties | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Settings</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let property of properties | keyvalue\"\n\t\t\t\t[name]=\"property.value.name\"\n\t\t\t\t[property]=\"property.value\"\n\t\t\t\t[control]=\"getFormControl('properties', property.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\n\t\t<ng-container *ngIf=\"(dynamicContent | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Content</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let content of dynamicContent | keyvalue\"\n\t\t\t\t[name]=\"content.value.label\"\n\t\t\t\t[property]=\"content.value\"\n\t\t\t\t[control]=\"getFormControl('content', content.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\t</div>\n</div>\n", styles: [":host .ng-doc-playground-properties-wrapper{position:relative;display:flex}:host .ng-doc-playground-properties-wrapper.vertical{flex-direction:column}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-demos{margin-right:0;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-properties{width:100%}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-demos{display:flex;flex-direction:column;width:100%;overflow:hidden;margin-right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties{flex-shrink:0;width:300px;padding:calc(var(--ng-doc-base-gutter) * 2) calc(var(--ng-doc-base-gutter) * 3);background-color:var(--ng-doc-base-1);border-radius:var(--ng-doc-base-gutter)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties ng-doc-playground-property:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-controls{display:flex;justify-content:flex-end}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header h4{margin:0}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-setting{display:flex;flex-direction:column}:host .ng-doc-playground-properties-wrapper .ng-doc-title{margin-top:0;margin-bottom:calc(var(--ng-doc-base-gutter) + var(--ng-doc-base-gutter) / 2)}:host .ng-doc-playground-divider{margin:calc(var(--ng-doc-base-gutter) * 2) 0;height:1px;background-color:var(--ng-doc-base-2)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }, { kind: "component", type: i4.NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "size"] }, { kind: "component", type: i4.NgDocTextComponent, selector: "[ng-doc-text]", inputs: ["size", "color", "align", "absoluteContent"] }, { kind: "directive", type: i4.NgDocTextRightDirective, selector: "[ngDocTextRight]" }, { kind: "component", type: i4.NgDocCheckboxComponent, selector: "ng-doc-checkbox", inputs: ["color"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgDocButtonComponent, selector: "button[ng-doc-button], a[ng-doc-button], button[ng-doc-button-flat], a[ng-doc-button-flat], button[ng-doc-button-text], a[ng-doc-button-text]", inputs: ["size", "color", "rounded"] }, { kind: "component", type: NgDocPlaygroundPropertyComponent, selector: "ng-doc-playground-property", inputs: ["name", "property", "control"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertiesComponent, decorators: [{
142
+ type: Component,
143
+ args: [{ selector: 'ng-doc-playground-properties', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ng-doc-playground-properties-wrapper\" [class.vertical]=\"observer | async\">\n\t<div class=\"ng-doc-playground-demos\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"ng-doc-playground-properties\">\n\t\t<div class=\"ng-doc-playground-header\">\n\t\t\t<h4 ng-doc-text>Playground</h4>\n\t\t\t<button ng-doc-button color=\"red\" (click)=\"resetForm.emit()\">Reset</button>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-setting\">\n\t\t\t<ng-doc-checkbox [(ngModel)]=\"recreateDemo\" (ngModelChange)=\"recreateDemoChange.emit($event)\">\n\t\t\t\t<span\n\t\t\t\t\tng-doc-text\n\t\t\t\t\t[ngDocTooltip]=\"'Recreates demo everytime\\none of the input has changed'\"\n\t\t\t\t\t[positions]=\"['bottom-right', 'left-center']\"\n\t\t\t\t>\n\t\t\t\t\tRecreate\n\t\t\t\t\t<ng-doc-icon icon=\"info\" ngDocTextRight></ng-doc-icon>\n\t\t\t\t</span>\n\t\t\t</ng-doc-checkbox>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-divider\"></div>\n\t\t<ng-container *ngIf=\"(properties | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Settings</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let property of properties | keyvalue\"\n\t\t\t\t[name]=\"property.value.name\"\n\t\t\t\t[property]=\"property.value\"\n\t\t\t\t[control]=\"getFormControl('properties', property.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\n\t\t<ng-container *ngIf=\"(dynamicContent | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Content</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let content of dynamicContent | keyvalue\"\n\t\t\t\t[name]=\"content.value.label\"\n\t\t\t\t[property]=\"content.value\"\n\t\t\t\t[control]=\"getFormControl('content', content.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\t</div>\n</div>\n", styles: [":host .ng-doc-playground-properties-wrapper{position:relative;display:flex}:host .ng-doc-playground-properties-wrapper.vertical{flex-direction:column}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-demos{margin-right:0;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-properties{width:100%}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-demos{display:flex;flex-direction:column;width:100%;overflow:hidden;margin-right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties{flex-shrink:0;width:300px;padding:calc(var(--ng-doc-base-gutter) * 2) calc(var(--ng-doc-base-gutter) * 3);background-color:var(--ng-doc-base-1);border-radius:var(--ng-doc-base-gutter)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties ng-doc-playground-property:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-controls{display:flex;justify-content:flex-end}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header h4{margin:0}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-setting{display:flex;flex-direction:column}:host .ng-doc-playground-properties-wrapper .ng-doc-title{margin-top:0;margin-bottom:calc(var(--ng-doc-base-gutter) + var(--ng-doc-base-gutter) / 2)}:host .ng-doc-playground-divider{margin:calc(var(--ng-doc-base-gutter) * 2) 0;height:1px;background-color:var(--ng-doc-base-2)}\n"] }]
144
+ }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }]; }, propDecorators: { form: [{
145
+ type: Input
146
+ }], properties: [{
147
+ type: Input
148
+ }], dynamicContent: [{
149
+ type: Input
150
+ }], recreateDemo: [{
151
+ type: Input
152
+ }], recreateDemoChange: [{
153
+ type: Output
154
+ }], resetForm: [{
155
+ type: Output
156
+ }] } });
157
+
158
+ let NgDocPlaygroundDemoComponent = class NgDocPlaygroundDemoComponent {
159
+ constructor(rootPage, injector) {
160
+ this.rootPage = rootPage;
161
+ this.injector = injector;
162
+ this.id = '';
163
+ this.selector = '';
164
+ this.recreateDemo = false;
165
+ this.code = of('');
166
+ this.unsubscribe$ = new Subject();
167
+ }
168
+ ngOnChanges({ form, id }) {
169
+ if (form && id) {
170
+ this.unsubscribe$.next();
171
+ const demoInjector = getPlaygroundDemoToken(this.id);
172
+ if (demoInjector) {
173
+ const demos = this.injector.get(demoInjector, []);
174
+ this.playgroundDemo = demos.find((demo) => demo.selector === this.selector);
175
+ }
176
+ this.updateDemo();
177
+ this.form?.valueChanges
178
+ .pipe(takeUntil(this.unsubscribe$), untilDestroyed(this))
179
+ .subscribe((data) => this.updateDemo(data));
180
+ }
181
+ }
182
+ updateDemo(data) {
183
+ if (this.recreateDemo || !this.demoRef) {
184
+ this.renderDemo();
185
+ }
186
+ if (data) {
187
+ Object.assign(this.demoRef?.instance.playground ?? {}, data.properties);
188
+ Object.assign(this.demoRef?.instance.content ?? {}, data.content);
189
+ this.demoRef?.instance?.viewContainerRef?.injector.get(ChangeDetectorRef)?.markForCheck();
190
+ }
191
+ this.updateCodeView();
192
+ }
193
+ renderDemo() {
194
+ if (this.playgroundDemo) {
195
+ this.demoRef?.destroy();
196
+ if (this.playgroundDemo) {
197
+ this.demoRef = this.demoOutlet?.createComponent(this.playgroundDemo);
198
+ }
199
+ this.demoRef?.changeDetectorRef.markForCheck();
200
+ }
201
+ }
202
+ updateCodeView() {
203
+ const template = buildPlaygroundDemoTemplate(this.configuration?.template ?? '', this.selector, this.getActiveContent(), this.getActiveInputs());
204
+ this.code = formatHtml(template);
205
+ }
206
+ getActiveContent() {
207
+ const formData = this.form?.controls.content.value ?? {};
208
+ return objectKeys(formData).reduce((result, key) => {
209
+ result[key] = formData[key] ? this.configuration?.content?.[key].template ?? '' : '';
210
+ return result;
211
+ }, {});
212
+ }
213
+ getActiveInputs() {
214
+ const formData = this.form?.controls.properties.value ?? {};
215
+ return objectKeys(formData).reduce((result, key) => {
216
+ const property = this.properties?.[key];
217
+ if (property) {
218
+ const value = formData[key];
219
+ const isString = typeof value === 'string';
220
+ const inputValue = isString ? `'${value}'` : `${JSON.stringify(value)}`;
221
+ if ((property.default ?? '') !== inputValue) {
222
+ result[property.name] = inputValue;
223
+ }
224
+ }
225
+ return result;
226
+ }, {});
227
+ }
228
+ ngOnDestroy() {
229
+ this.unsubscribe$.next();
230
+ this.unsubscribe$.complete();
231
+ }
232
+ };
233
+ NgDocPlaygroundDemoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundDemoComponent, deps: [{ token: i1$1.NgDocRootPage }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
234
+ NgDocPlaygroundDemoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: { id: "id", selector: "selector", configuration: "configuration", properties: "properties", recreateDemo: "recreateDemo", form: "form" }, viewQueries: [{ propertyName: "demoOutlet", first: true, predicate: ["demoOutlet"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-doc-demo-displayer [code]=\"(code | async) ?? ''\" [border]=\"false\" language=\"html\">\n\t<ng-container #demoOutlet></ng-container>\n</ng-doc-demo-displayer>\n", styles: [":host{display:block;border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);overflow:hidden}:host:not(:last-child){border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}:host:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}\n"], dependencies: [{ kind: "component", type: i2$1.NgDocDemoDisplayerComponent, selector: "ng-doc-demo-displayer", inputs: ["codeContent", "code", "language", "container", "border", "expanded"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
235
+ NgDocPlaygroundDemoComponent = __decorate([
236
+ UntilDestroy(),
237
+ __metadata("design:paramtypes", [NgDocRootPage, Injector])
238
+ ], NgDocPlaygroundDemoComponent);
239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundDemoComponent, decorators: [{
240
+ type: Component,
241
+ args: [{ selector: 'ng-doc-playground-demo', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-demo-displayer [code]=\"(code | async) ?? ''\" [border]=\"false\" language=\"html\">\n\t<ng-container #demoOutlet></ng-container>\n</ng-doc-demo-displayer>\n", styles: [":host{display:block;border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);overflow:hidden}:host:not(:last-child){border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}:host:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}\n"] }]
242
+ }], ctorParameters: function () { return [{ type: i1$1.NgDocRootPage }, { type: i0.Injector }]; }, propDecorators: { id: [{
243
+ type: Input
244
+ }], selector: [{
245
+ type: Input
246
+ }], configuration: [{
247
+ type: Input
248
+ }], properties: [{
249
+ type: Input
250
+ }], recreateDemo: [{
251
+ type: Input
252
+ }], form: [{
253
+ type: Input
254
+ }], demoOutlet: [{
255
+ type: ViewChild,
256
+ args: ['demoOutlet', { static: true, read: ViewContainerRef }]
257
+ }] } });
15
258
 
16
259
  class NgDocPlaygroundComponent {
17
260
  constructor(rootPage, formBuilder) {
18
261
  this.rootPage = rootPage;
19
262
  this.formBuilder = formBuilder;
263
+ this.id = '';
20
264
  this.selectors = [];
21
- this.reinitializeDemo = false;
265
+ this.recreateDemo = false;
22
266
  }
23
267
  ngOnInit() {
24
268
  const propertiesForm = this.formBuilder.group(this.getPropertiesFormValues());
@@ -27,10 +271,9 @@ class NgDocPlaygroundComponent {
27
271
  properties: propertiesForm,
28
272
  content: contentForm,
29
273
  });
30
- console.log(this.rootPage.playground, this.id, this.properties);
31
274
  }
32
275
  get configuration() {
33
- return this.id && this.rootPage.playground ? this.rootPage.playground[this.id] : undefined;
276
+ return this.rootPage.dependencies?.playgrounds?.[this.id];
34
277
  }
35
278
  getPropertiesFormValues() {
36
279
  return objectKeys(this.properties ?? {}).reduce((controls, key) => {
@@ -41,12 +284,13 @@ class NgDocPlaygroundComponent {
41
284
  }, {});
42
285
  }
43
286
  getContentFormValues() {
44
- return objectKeys(this.configuration?.dynamicContent ?? {}).reduce((controls, key) => {
45
- if (this.configuration?.dynamicContent) {
287
+ return objectKeys(this.configuration?.content ?? {}).reduce((controls, key) => {
288
+ if (this.configuration?.content) {
46
289
  controls[key] = false;
47
290
  }
48
291
  return controls;
49
292
  }, {});
293
+ return {};
50
294
  }
51
295
  resetForm() {
52
296
  this.formGroup?.reset({
@@ -55,38 +299,78 @@ class NgDocPlaygroundComponent {
55
299
  });
56
300
  }
57
301
  }
58
- NgDocPlaygroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, deps: [{ token: i1.NgDocRootPage }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
59
- NgDocPlaygroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundComponent, selector: "ng-doc-playground", ngImport: i0, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties [form]=\"formGroup\" [properties]=\"properties\"\n\t\t\t\t\t\t\t\t [dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t [(reinitializeDemo)]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t (resetForm)=\"resetForm()\">\n\t\t<ng-doc-playground-demo *ngFor=\"let selector of (configuration.selectors ?? selectors) | asArray\"\n\t\t\t\t\t\t\t\t[target]=\"configuration.target\"\n\t\t\t\t\t\t\t\t[selector]=\"selector\"\n\t\t\t\t\t\t\t\t[template]=\"configuration.template\"\n\t\t\t\t\t\t\t\t[properties]=\"properties\"\n\t\t\t\t\t\t\t\t[data]=\"configuration.data\"\n\t\t\t\t\t\t\t\t[dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t[reinitializeDemo]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t[form]=\"formGroup\">\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: ["target", "selector", "template", "properties", "dynamicContent", "data", "reinitializeDemo", "form"] }, { kind: "component", type: i5.NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: ["form", "properties", "dynamicContent", "reinitializeDemo"], outputs: ["reinitializeDemoChange", "resetForm"] }, { kind: "pipe", type: i6.NgDocAsArrayPipe, name: "asArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
302
+ NgDocPlaygroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, deps: [{ token: i1$1.NgDocRootPage }, { token: i3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
303
+ NgDocPlaygroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundComponent, selector: "ng-doc-playground", ngImport: i0, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties\n\t\t[form]=\"formGroup\"\n\t\t[properties]=\"properties\"\n\t\t[dynamicContent]=\"configuration.content\"\n\t\t[(recreateDemo)]=\"recreateDemo\"\n\t\t(resetForm)=\"resetForm()\"\n\t>\n\t\t<ng-doc-playground-demo\n\t\t\t*ngFor=\"let selector of configuration.selectors ?? selectors | asArray\"\n\t\t\t[id]=\"id\"\n\t\t\t[selector]=\"selector\"\n\t\t\t[properties]=\"properties\"\n\t\t\t[configuration]=\"configuration\"\n\t\t\t[recreateDemo]=\"recreateDemo\"\n\t\t\t[form]=\"formGroup\"\n\t\t>\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: ["form", "properties", "dynamicContent", "recreateDemo"], outputs: ["recreateDemoChange", "resetForm"] }, { kind: "component", type: NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: ["id", "selector", "configuration", "properties", "recreateDemo", "form"] }, { kind: "pipe", type: i4.NgDocAsArrayPipe, name: "asArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
60
304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, decorators: [{
61
305
  type: Component,
62
- args: [{ selector: 'ng-doc-playground', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties [form]=\"formGroup\" [properties]=\"properties\"\n\t\t\t\t\t\t\t\t [dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t [(reinitializeDemo)]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t (resetForm)=\"resetForm()\">\n\t\t<ng-doc-playground-demo *ngFor=\"let selector of (configuration.selectors ?? selectors) | asArray\"\n\t\t\t\t\t\t\t\t[target]=\"configuration.target\"\n\t\t\t\t\t\t\t\t[selector]=\"selector\"\n\t\t\t\t\t\t\t\t[template]=\"configuration.template\"\n\t\t\t\t\t\t\t\t[properties]=\"properties\"\n\t\t\t\t\t\t\t\t[data]=\"configuration.data\"\n\t\t\t\t\t\t\t\t[dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t[reinitializeDemo]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t[form]=\"formGroup\">\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"] }]
63
- }], ctorParameters: function () { return [{ type: i1.NgDocRootPage }, { type: i2.FormBuilder }]; } });
306
+ args: [{ selector: 'ng-doc-playground', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties\n\t\t[form]=\"formGroup\"\n\t\t[properties]=\"properties\"\n\t\t[dynamicContent]=\"configuration.content\"\n\t\t[(recreateDemo)]=\"recreateDemo\"\n\t\t(resetForm)=\"resetForm()\"\n\t>\n\t\t<ng-doc-playground-demo\n\t\t\t*ngFor=\"let selector of configuration.selectors ?? selectors | asArray\"\n\t\t\t[id]=\"id\"\n\t\t\t[selector]=\"selector\"\n\t\t\t[properties]=\"properties\"\n\t\t\t[configuration]=\"configuration\"\n\t\t\t[recreateDemo]=\"recreateDemo\"\n\t\t\t[form]=\"formGroup\"\n\t\t>\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"] }]
307
+ }], ctorParameters: function () { return [{ type: i1$1.NgDocRootPage }, { type: i3.FormBuilder }]; } });
64
308
 
65
309
  class NgDocPlaygroundModule {
66
310
  }
67
311
  NgDocPlaygroundModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
68
- NgDocPlaygroundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, declarations: [NgDocPlaygroundComponent], imports: [CommonModule,
312
+ NgDocPlaygroundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, declarations: [NgDocPlaygroundComponent,
313
+ NgDocPlaygroundPropertyComponent,
314
+ NgDocPlaygroundPropertiesComponent,
315
+ NgDocPlaygroundDemoComponent], imports: [CommonModule,
69
316
  ReactiveFormsModule,
317
+ NgDocLabelModule,
318
+ NgDocTooltipModule,
319
+ PolymorpheusModule,
70
320
  NgDocAsArrayModule,
71
- NgDocPlaygroundDemoModule,
72
- NgDocPlaygroundPropertiesModule], exports: [NgDocPlaygroundComponent] });
321
+ NgDocButtonIconModule,
322
+ NgDocIconModule,
323
+ NgDocTextModule,
324
+ NgDocCheckboxModule,
325
+ FormsModule,
326
+ NgDocButtonModule,
327
+ NgDocDemoDisplayerModule], exports: [NgDocPlaygroundComponent,
328
+ NgDocPlaygroundPropertyComponent,
329
+ NgDocPlaygroundPropertiesComponent,
330
+ NgDocPlaygroundDemoComponent] });
73
331
  NgDocPlaygroundModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, imports: [CommonModule,
74
332
  ReactiveFormsModule,
333
+ NgDocLabelModule,
334
+ NgDocTooltipModule,
335
+ PolymorpheusModule,
75
336
  NgDocAsArrayModule,
76
- NgDocPlaygroundDemoModule,
77
- NgDocPlaygroundPropertiesModule] });
337
+ NgDocButtonIconModule,
338
+ NgDocIconModule,
339
+ NgDocTextModule,
340
+ NgDocCheckboxModule,
341
+ FormsModule,
342
+ NgDocButtonModule,
343
+ NgDocDemoDisplayerModule] });
78
344
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, decorators: [{
79
345
  type: NgModule,
80
346
  args: [{
81
- declarations: [NgDocPlaygroundComponent],
347
+ declarations: [
348
+ NgDocPlaygroundComponent,
349
+ NgDocPlaygroundPropertyComponent,
350
+ NgDocPlaygroundPropertiesComponent,
351
+ NgDocPlaygroundDemoComponent,
352
+ ],
82
353
  imports: [
83
354
  CommonModule,
84
355
  ReactiveFormsModule,
356
+ NgDocLabelModule,
357
+ NgDocTooltipModule,
358
+ PolymorpheusModule,
85
359
  NgDocAsArrayModule,
86
- NgDocPlaygroundDemoModule,
87
- NgDocPlaygroundPropertiesModule,
360
+ NgDocButtonIconModule,
361
+ NgDocIconModule,
362
+ NgDocTextModule,
363
+ NgDocCheckboxModule,
364
+ FormsModule,
365
+ NgDocButtonModule,
366
+ NgDocDemoDisplayerModule,
367
+ ],
368
+ exports: [
369
+ NgDocPlaygroundComponent,
370
+ NgDocPlaygroundPropertyComponent,
371
+ NgDocPlaygroundPropertiesComponent,
372
+ NgDocPlaygroundDemoComponent,
88
373
  ],
89
- exports: [NgDocPlaygroundComponent],
90
374
  }]
91
375
  }] });
92
376
 
@@ -94,5 +378,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
94
378
  * Generated bundle index. Do not edit.
95
379
  */
96
380
 
97
- export { NgDocPlaygroundComponent, NgDocPlaygroundModule };
381
+ export { NgDocBasePlayground, NgDocPlaygroundComponent, NgDocPlaygroundDemoComponent, NgDocPlaygroundModule, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundPropertyComponent };
98
382
  //# sourceMappingURL=ng-doc-app-components-playground.mjs.map