@ng-doc/app 22.1.0 → 22.2.0

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 (157) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/ng-doc-app-classes-content-controller.mjs +22 -4
  3. package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -1
  4. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +36 -12
  5. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
  6. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  7. package/fesm2022/ng-doc-app-components-api-list.mjs +7 -5
  8. package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
  9. package/fesm2022/ng-doc-app-components-breadcrumb.mjs +5 -3
  10. package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
  11. package/fesm2022/ng-doc-app-components-code.mjs +6 -4
  12. package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
  13. package/fesm2022/ng-doc-app-components-command-palette.mjs +35 -27
  14. package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -1
  15. package/fesm2022/ng-doc-app-components-copy-button.mjs +6 -4
  16. package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
  17. package/fesm2022/ng-doc-app-components-demo-displayer.mjs +19 -4
  18. package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  19. package/fesm2022/ng-doc-app-components-demo-frame.mjs +195 -12
  20. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -1
  21. package/fesm2022/ng-doc-app-components-demo-pane.mjs +2 -2
  22. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  23. package/fesm2022/ng-doc-app-components-demo.mjs +49 -12
  24. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  25. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +5 -3
  26. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  27. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +4 -2
  28. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -1
  29. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +5 -3
  30. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  31. package/fesm2022/ng-doc-app-components-image-viewer.mjs +5 -3
  32. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  33. package/fesm2022/ng-doc-app-components-navbar.mjs +4 -2
  34. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  35. package/fesm2022/ng-doc-app-components-page-navigation.mjs +5 -3
  36. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  37. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +2 -2
  38. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  39. package/fesm2022/ng-doc-app-components-page.mjs +83 -16
  40. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  41. package/fesm2022/ng-doc-app-components-playground.mjs +743 -108
  42. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  43. package/fesm2022/ng-doc-app-components-root.mjs +51 -4
  44. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  45. package/fesm2022/ng-doc-app-components-search-result.mjs +8 -6
  46. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  47. package/fesm2022/ng-doc-app-components-search.mjs +7 -5
  48. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  49. package/fesm2022/ng-doc-app-components-sidebar.mjs +4 -3
  50. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  51. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +7 -5
  52. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  53. package/fesm2022/ng-doc-app-components-toc.mjs +4 -2
  54. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  55. package/fesm2022/ng-doc-app-constants.mjs +11 -1
  56. package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
  57. package/fesm2022/ng-doc-app-demo-app.mjs +618 -15
  58. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -1
  59. package/fesm2022/ng-doc-app-helpers.mjs +125 -6
  60. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  61. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +29 -18
  62. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  63. package/fesm2022/ng-doc-app-providers-texts.mjs +53 -0
  64. package/fesm2022/ng-doc-app-providers-texts.mjs.map +1 -0
  65. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  66. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  67. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +27 -2
  68. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -1
  69. package/fesm2022/ng-doc-app-services-highlighter.mjs +8 -5
  70. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  71. package/fesm2022/ng-doc-app-services-shortcuts.mjs +38 -4
  72. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -1
  73. package/fesm2022/ng-doc-app-texts-ar.mjs +238 -0
  74. package/fesm2022/ng-doc-app-texts-ar.mjs.map +1 -0
  75. package/fesm2022/ng-doc-app-texts-de.mjs +205 -0
  76. package/fesm2022/ng-doc-app-texts-de.mjs.map +1 -0
  77. package/fesm2022/ng-doc-app-texts-es.mjs +205 -0
  78. package/fesm2022/ng-doc-app-texts-es.mjs.map +1 -0
  79. package/fesm2022/ng-doc-app-texts-fr.mjs +205 -0
  80. package/fesm2022/ng-doc-app-texts-fr.mjs.map +1 -0
  81. package/fesm2022/ng-doc-app-texts-hi.mjs +219 -0
  82. package/fesm2022/ng-doc-app-texts-hi.mjs.map +1 -0
  83. package/fesm2022/ng-doc-app-texts-ja.mjs +205 -0
  84. package/fesm2022/ng-doc-app-texts-ja.mjs.map +1 -0
  85. package/fesm2022/ng-doc-app-texts-ko.mjs +205 -0
  86. package/fesm2022/ng-doc-app-texts-ko.mjs.map +1 -0
  87. package/fesm2022/ng-doc-app-texts-pt-br.mjs +205 -0
  88. package/fesm2022/ng-doc-app-texts-pt-br.mjs.map +1 -0
  89. package/fesm2022/ng-doc-app-texts-ru.mjs +231 -0
  90. package/fesm2022/ng-doc-app-texts-ru.mjs.map +1 -0
  91. package/fesm2022/ng-doc-app-texts-uk.mjs +231 -0
  92. package/fesm2022/ng-doc-app-texts-uk.mjs.map +1 -0
  93. package/fesm2022/ng-doc-app-texts-zh.mjs +205 -0
  94. package/fesm2022/ng-doc-app-texts-zh.mjs.map +1 -0
  95. package/fesm2022/ng-doc-app-tokens.mjs +214 -1
  96. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  97. package/fesm2022/ng-doc-app-type-controls-json-control.mjs +90 -0
  98. package/fesm2022/ng-doc-app-type-controls-json-control.mjs.map +1 -0
  99. package/fesm2022/ng-doc-app-type-controls-list-control.mjs +792 -0
  100. package/fesm2022/ng-doc-app-type-controls-list-control.mjs.map +1 -0
  101. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +5 -3
  102. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  103. package/fesm2022/ng-doc-app-type-controls.mjs +2 -0
  104. package/fesm2022/ng-doc-app-type-controls.mjs.map +1 -1
  105. package/package.json +59 -3
  106. package/styles/global.css +1 -0
  107. package/styles/main.css +1 -0
  108. package/types/ng-doc-app-classes-default-search-engine.d.ts +11 -0
  109. package/types/ng-doc-app-classes-root-page.d.ts +5 -0
  110. package/types/ng-doc-app-components-api-list.d.ts +3 -1
  111. package/types/ng-doc-app-components-breadcrumb.d.ts +2 -1
  112. package/types/ng-doc-app-components-code.d.ts +2 -0
  113. package/types/ng-doc-app-components-command-palette.d.ts +3 -1
  114. package/types/ng-doc-app-components-copy-button.d.ts +3 -1
  115. package/types/ng-doc-app-components-demo-displayer.d.ts +13 -1
  116. package/types/ng-doc-app-components-demo-frame.d.ts +62 -3
  117. package/types/ng-doc-app-components-demo.d.ts +27 -8
  118. package/types/ng-doc-app-components-fullscreen-button.d.ts +2 -0
  119. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +2 -0
  120. package/types/ng-doc-app-components-heading-anchor.d.ts +2 -0
  121. package/types/ng-doc-app-components-image-viewer.d.ts +2 -0
  122. package/types/ng-doc-app-components-navbar.d.ts +2 -0
  123. package/types/ng-doc-app-components-page-navigation.d.ts +2 -1
  124. package/types/ng-doc-app-components-page.d.ts +10 -1
  125. package/types/ng-doc-app-components-playground.d.ts +241 -44
  126. package/types/ng-doc-app-components-root.d.ts +18 -0
  127. package/types/ng-doc-app-components-search-result.d.ts +2 -0
  128. package/types/ng-doc-app-components-search.d.ts +2 -0
  129. package/types/ng-doc-app-components-sidebar.d.ts +2 -1
  130. package/types/ng-doc-app-components-theme-toggle.d.ts +4 -1
  131. package/types/ng-doc-app-components-toc.d.ts +2 -1
  132. package/types/ng-doc-app-constants.d.ts +11 -1
  133. package/types/ng-doc-app-demo-app.d.ts +211 -3
  134. package/types/ng-doc-app-helpers.d.ts +56 -3
  135. package/types/ng-doc-app-interfaces.d.ts +621 -3
  136. package/types/ng-doc-app-providers-ng-doc-app.d.ts +6 -0
  137. package/types/ng-doc-app-providers-texts.d.ts +28 -0
  138. package/types/ng-doc-app-providers.d.ts +1 -0
  139. package/types/ng-doc-app-services-content-scroll-intent.d.ts +11 -1
  140. package/types/ng-doc-app-services-highlighter.d.ts +3 -1
  141. package/types/ng-doc-app-services-shortcuts.d.ts +16 -0
  142. package/types/ng-doc-app-texts-ar.d.ts +13 -0
  143. package/types/ng-doc-app-texts-de.d.ts +12 -0
  144. package/types/ng-doc-app-texts-es.d.ts +12 -0
  145. package/types/ng-doc-app-texts-fr.d.ts +12 -0
  146. package/types/ng-doc-app-texts-hi.d.ts +12 -0
  147. package/types/ng-doc-app-texts-ja.d.ts +12 -0
  148. package/types/ng-doc-app-texts-ko.d.ts +12 -0
  149. package/types/ng-doc-app-texts-pt-br.d.ts +12 -0
  150. package/types/ng-doc-app-texts-ru.d.ts +12 -0
  151. package/types/ng-doc-app-texts-uk.d.ts +12 -0
  152. package/types/ng-doc-app-texts-zh.d.ts +12 -0
  153. package/types/ng-doc-app-tokens.d.ts +21 -2
  154. package/types/ng-doc-app-type-controls-json-control.d.ts +38 -0
  155. package/types/ng-doc-app-type-controls-list-control.d.ts +313 -0
  156. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +2 -1
  157. package/types/ng-doc-app-type-controls.d.ts +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-doc-app-type-controls-json-control.mjs","sources":["../../../../libs/app/type-controls/json-control/json-control.component.ts","../../../../libs/app/type-controls/json-control/json-control.component.html","../../../../libs/app/type-controls/json-control/ng-doc-app-type-controls-json-control.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Signal,\n signal,\n} from '@angular/core';\nimport { NgDocPlaygroundTexts, NgDocTypeControl } from '@ng-doc/app/interfaces';\nimport { NG_DOC_TEXTS } from '@ng-doc/app/tokens';\nimport { DIControl } from 'di-controls';\n\n/** The value of no text yet: no value has been written to the control. */\nconst NOTHING: unique symbol = Symbol('NOTHING');\n\nlet nextId = 0;\n\n/**\n * The playground control of array inputs that have no list control, such as `Item[]` or\n * `[string, number]`: a text area that holds the value as JSON.\n *\n * Text that parses sets the value; while the text is not JSON, the field is marked as invalid and\n * the input keeps its last valid value. An empty field is `undefined`, and the value that the\n * playground writes is shown as JSON again, so the text and the value always match. It edits any\n * value that JSON can hold, so it can also be registered for an object type.\n */\n@Component({\n selector: 'ng-doc-json-control',\n templateUrl: './json-control.component.html',\n styleUrls: ['./json-control.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocJsonControlComponent<T = unknown>\n extends DIControl<T | undefined>\n implements NgDocTypeControl<T | undefined>\n{\n /** The text of the field. */\n protected readonly text = signal<string>('');\n\n /** Whether the text is not JSON. */\n protected readonly invalid = signal<boolean>(false);\n\n /** The rows of the field: its lines, from 2 to 10. */\n protected readonly rows: Signal<number> = computed(() =>\n Math.min(Math.max(this.text().split('\\n').length, 2), 10),\n );\n\n protected readonly texts: NgDocPlaygroundTexts = inject(NG_DOC_TEXTS).playground;\n\n /** ID of the message that describes invalid text. */\n protected readonly errorId: string = `ng-doc-json-control-error-${nextId++}`;\n\n /** The value that the text stands for. */\n private textValue: T | null | undefined | typeof NOTHING = NOTHING;\n\n constructor() {\n super();\n }\n\n override writeValue(value: T | null | undefined): void {\n super.writeValue(value);\n\n // The form writes back each value the control reports. That value is the text already, which\n // must stay as the reader typed it (spaces, line breaks), so only another value replaces it.\n if (value !== this.textValue || this.invalid()) {\n this.textValue = value;\n this.text.set(toJson(value));\n this.invalid.set(false);\n }\n }\n\n /**\n * Sets the value from the text of the field, when it is JSON.\n * @param text - The text of the field.\n */\n protected edit(text: string): void {\n this.text.set(text);\n\n let value: T | undefined;\n\n try {\n value = text.trim() === '' ? undefined : (JSON.parse(text) as T);\n } catch {\n this.invalid.set(true);\n\n return;\n }\n\n this.invalid.set(false);\n this.textValue = value;\n this.updateModel(value);\n }\n}\n\n/**\n * The text of a value: JSON with two-space indents, or nothing for `undefined` and for values that\n * JSON can't hold.\n * @param value - The value.\n */\nfunction toJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? '';\n } catch {\n return '';\n }\n}\n","<textarea\n #field\n class=\"ng-doc-json-control-field\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n [rows]=\"rows()\"\n [value]=\"text()\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"invalid() ? errorId : null\"\n (input)=\"edit(field.value)\"\n (blur)=\"touch()\"></textarea>\n@if (invalid()) {\n <span class=\"ng-doc-json-control-error\" [id]=\"errorId\">{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