kempo-ui 0.3.5 → 0.3.7

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 (146) hide show
  1. package/AGENTS.md +2 -1
  2. package/dist/components/Aside.js +1 -1
  3. package/dist/components/Main.js +1 -1
  4. package/docs/components/accordion.html +240 -8
  5. package/docs/components/aside-items.html +13 -9
  6. package/docs/components/aside-menu.html +13 -9
  7. package/docs/components/aside-push.html +11 -6
  8. package/docs/components/aside.html +289 -115
  9. package/docs/components/card.html +238 -7
  10. package/docs/components/color-picker.html +245 -14
  11. package/docs/components/content-slider.html +240 -8
  12. package/docs/components/context.html +241 -7
  13. package/docs/components/dialog.html +238 -7
  14. package/docs/components/dropdown.html +238 -7
  15. package/docs/components/filter-list.html +239 -10
  16. package/docs/components/focus-capture.html +241 -10
  17. package/docs/components/html-editor.html +266 -35
  18. package/docs/components/hybrid-component.html +238 -6
  19. package/docs/components/icon.html +239 -9
  20. package/docs/components/import.html +239 -8
  21. package/docs/components/light-component.html +239 -7
  22. package/docs/components/nav.html +240 -8
  23. package/docs/components/photo-viewer.html +239 -9
  24. package/docs/components/resize.html +240 -9
  25. package/docs/components/shadow-component.html +239 -7
  26. package/docs/components/show-more.html +237 -8
  27. package/docs/components/sortable.html +239 -8
  28. package/docs/components/spinner.html +237 -6
  29. package/docs/components/split.html +241 -10
  30. package/docs/components/table.html +241 -11
  31. package/docs/components/tableControls.html +240 -7
  32. package/docs/components/tableCustomFields.html +241 -8
  33. package/docs/components/tableFetchRecords.html +239 -7
  34. package/docs/components/tableFieldSortHide.html +239 -7
  35. package/docs/components/tablePagination.html +246 -13
  36. package/docs/components/tablePlaceholder.html +241 -8
  37. package/docs/components/tableRecordEditing.html +241 -8
  38. package/docs/components/tableRecordFiltering.html +239 -7
  39. package/docs/components/tableRecordHiding.html +241 -9
  40. package/docs/components/tableRecordSearching.html +239 -7
  41. package/docs/components/tableRecordSelection.html +240 -7
  42. package/docs/components/tableRowControls.html +241 -8
  43. package/docs/components/tableServerSync.html +245 -11
  44. package/docs/components/tableSorting.html +239 -7
  45. package/docs/components/tabs.html +240 -7
  46. package/docs/components/tags.html +239 -7
  47. package/docs/components/theme-select.html +239 -7
  48. package/docs/components/theme-switcher.html +240 -8
  49. package/docs/components/timestamp.html +239 -8
  50. package/docs/components/toast.html +240 -8
  51. package/docs/components/toggle.html +240 -9
  52. package/docs/components/tree.html +239 -8
  53. package/docs/index.html +244 -6
  54. package/docs/prod.config.json +0 -4
  55. package/docs/src/components/Aside.js +1 -1
  56. package/docs/src/components/Main.js +1 -1
  57. package/docs/utils/context.html +237 -6
  58. package/docs/utils/cookie.html +251 -21
  59. package/docs/utils/debounce.html +236 -5
  60. package/docs/utils/drag.html +236 -5
  61. package/docs/utils/elevation.html +238 -6
  62. package/docs/utils/formatTimestamp.html +239 -9
  63. package/docs/utils/object.html +236 -5
  64. package/docs/utils/propConverters.html +233 -3
  65. package/docs/utils/string.html +236 -5
  66. package/docs/utils/theme.html +237 -6
  67. package/docs/utils/toTitleCase.html +239 -9
  68. package/docs/utils/type.html +236 -5
  69. package/docs/utils/wait.html +236 -5
  70. package/docs-src/.config.js +16 -0
  71. package/docs-src/bare.template.html +16 -0
  72. package/docs-src/components/accordion.page.html +201 -0
  73. package/docs-src/components/aside-items.page.html +36 -0
  74. package/docs-src/components/aside-menu.page.html +36 -0
  75. package/docs-src/components/aside-push.page.html +20 -0
  76. package/docs-src/components/aside.page.html +494 -0
  77. package/docs-src/components/card.page.html +78 -0
  78. package/docs-src/components/color-picker.page.html +559 -0
  79. package/docs-src/components/content-slider.page.html +266 -0
  80. package/docs-src/components/context.page.html +214 -0
  81. package/docs-src/components/dialog.page.html +365 -0
  82. package/docs-src/components/dropdown.page.html +300 -0
  83. package/docs-src/components/filter-list.page.html +117 -0
  84. package/docs-src/components/focus-capture.page.html +97 -0
  85. package/docs-src/components/html-editor.page.html +423 -0
  86. package/docs-src/components/hybrid-component.page.html +96 -0
  87. package/docs-src/components/icon.page.html +208 -0
  88. package/docs-src/components/import.page.html +76 -0
  89. package/docs-src/components/light-component.page.html +99 -0
  90. package/docs-src/components/nav.page.html +106 -0
  91. package/docs-src/components/photo-viewer.page.html +253 -0
  92. package/docs-src/components/resize.page.html +161 -0
  93. package/docs-src/components/shadow-component.page.html +84 -0
  94. package/docs-src/components/show-more.page.html +113 -0
  95. package/docs-src/components/sortable.page.html +117 -0
  96. package/docs-src/components/spinner.page.html +197 -0
  97. package/docs-src/components/split.page.html +195 -0
  98. package/docs-src/components/table.page.html +283 -0
  99. package/docs-src/components/tableControls.page.html +64 -0
  100. package/docs-src/components/tableCustomFields.page.html +124 -0
  101. package/docs-src/components/tableFetchRecords.page.html +95 -0
  102. package/docs-src/components/tableFieldSortHide.page.html +56 -0
  103. package/docs-src/components/tablePagination.page.html +85 -0
  104. package/docs-src/components/tablePlaceholder.page.html +73 -0
  105. package/docs-src/components/tableRecordEditing.page.html +161 -0
  106. package/docs-src/components/tableRecordFiltering.page.html +69 -0
  107. package/docs-src/components/tableRecordHiding.page.html +65 -0
  108. package/docs-src/components/tableRecordSearching.page.html +56 -0
  109. package/docs-src/components/tableRecordSelection.page.html +60 -0
  110. package/docs-src/components/tableRowControls.page.html +62 -0
  111. package/docs-src/components/tableServerSync.page.html +129 -0
  112. package/docs-src/components/tableSorting.page.html +54 -0
  113. package/docs-src/components/tabs.page.html +201 -0
  114. package/docs-src/components/tags.page.html +157 -0
  115. package/docs-src/components/theme-select.page.html +106 -0
  116. package/docs-src/components/theme-switcher.page.html +122 -0
  117. package/docs-src/components/timestamp.page.html +109 -0
  118. package/docs-src/components/toast.page.html +338 -0
  119. package/docs-src/components/toggle.page.html +177 -0
  120. package/docs-src/components/tree.page.html +356 -0
  121. package/docs-src/default.template.html +28 -0
  122. package/docs-src/index.page.html +312 -0
  123. package/docs-src/nav.fragment.html +228 -0
  124. package/docs-src/utils/context.page.html +143 -0
  125. package/docs-src/utils/cookie.page.html +128 -0
  126. package/docs-src/utils/debounce.page.html +42 -0
  127. package/docs-src/utils/drag.page.html +64 -0
  128. package/docs-src/utils/elevation.page.html +144 -0
  129. package/docs-src/utils/formatTimestamp.page.html +76 -0
  130. package/docs-src/utils/object.page.html +76 -0
  131. package/docs-src/utils/propConverters.page.html +73 -0
  132. package/docs-src/utils/string.page.html +66 -0
  133. package/docs-src/utils/theme.page.html +136 -0
  134. package/docs-src/utils/toTitleCase.page.html +52 -0
  135. package/docs-src/utils/type.page.html +31 -0
  136. package/docs-src/utils/wait.page.html +31 -0
  137. package/package.json +4 -4
  138. package/scripts/build.js +5 -0
  139. package/scripts/docs.js +5 -52
  140. package/src/components/Aside.js +12 -1
  141. package/src/components/Main.js +1 -1
  142. package/tests/components/Aside.browser-test.js +75 -0
  143. package/docs/dev.config.json +0 -20
  144. package/docs/nav-1.inc.html +0 -168
  145. package/docs/nav.inc.html +0 -168
  146. package/docs/nav.inc.js +0 -70
@@ -0,0 +1,423 @@
1
+ <page pageName="HtmlEditor" title="HtmlEditor - Components - Kempo Docs - A Web Components Solution">
2
+ <content>
3
+ <k-accordion persistent-id="toc" class="b r mb">
4
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
5
+ <k-accordion-panel name="toc-panel">
6
+ <div class="m pl">
7
+ <h6>Examples</h6>
8
+ <a href="#fullExample">Complete Editor Example</a><br />
9
+ <a href="#javascriptUsage">JavaScript API Example</a><br />
10
+
11
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
12
+ <a href="#constructor">Constructor</a><br />
13
+ <a href="#properties">Properties</a><br />
14
+ <a href="#methods">Methods</a><br />
15
+ <a href="#events">Events</a><br />
16
+ </div>
17
+ </k-accordion-panel>
18
+ </k-accordion>
19
+
20
+ <p>A WYSIWYG HTML editor component with support for visual and code editing modes, form integration, and extensive formatting capabilities.</p>
21
+
22
+ <h3 id="fullExample"><a href="#fullExample" class="no-link">Complete Editor Example</a></h3>
23
+ <p>A fully-featured editor with all controls. Copy and paste this example to get started quickly:</p>
24
+ <div class="row -mx">
25
+ <div class="col m-span-12 px">
26
+ <k-card label="HTML">
27
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-html-editor</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"content"</span>&gt;</span>
28
+ <span class="hljs-comment">&lt;!-- Text formatting --&gt;</span>
29
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-group</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
30
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-bold</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-bold</span>&gt;</span>
31
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-italic</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-italic</span>&gt;</span>
32
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-underline</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-underline</span>&gt;</span>
33
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-strikethrough</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-strikethrough</span>&gt;</span>
34
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-group</span>&gt;</span>
35
+
36
+ <span class="hljs-comment">&lt;!-- Inline code --&gt;</span>
37
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-inline-code</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-inline-code</span>&gt;</span>
38
+
39
+ <span class="hljs-comment">&lt;!-- Text style --&gt;</span>
40
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-dropdown</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
41
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-icon</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"icon"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"..."</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-icon</span>&gt;</span>
42
+ <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>&gt;</span>Text Style<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
43
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-format-block</span> <span class="hljs-attr">tag</span>=<span class="hljs-string">"p"</span>&gt;</span>Paragraph<span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-format-block</span>&gt;</span>
44
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-format-block</span> <span class="hljs-attr">tag</span>=<span class="hljs-string">"h1"</span>&gt;</span>Heading 1<span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-format-block</span>&gt;</span>
45
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-format-block</span> <span class="hljs-attr">tag</span>=<span class="hljs-string">"h2"</span>&gt;</span>Heading 2<span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-format-block</span>&gt;</span>
46
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-format-block</span> <span class="hljs-attr">tag</span>=<span class="hljs-string">"h3"</span>&gt;</span>Heading 3<span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-format-block</span>&gt;</span>
47
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-code-block</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-code-block</span>&gt;</span>
48
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-dropdown</span>&gt;</span>
49
+
50
+ <span class="hljs-comment">&lt;!-- Lists --&gt;</span>
51
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-group</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
52
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-bullet-list</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-bullet-list</span>&gt;</span>
53
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-number-list</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-number-list</span>&gt;</span>
54
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-group</span>&gt;</span>
55
+
56
+ <span class="hljs-comment">&lt;!-- Alignment --&gt;</span>
57
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-group</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
58
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-align-left</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-align-left</span>&gt;</span>
59
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-align-center</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-align-center</span>&gt;</span>
60
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-align-right</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-align-right</span>&gt;</span>
61
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-align-justify</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-align-justify</span>&gt;</span>
62
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-group</span>&gt;</span>
63
+
64
+ <span class="hljs-comment">&lt;!-- Colors --&gt;</span>
65
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-group</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
66
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-text-color</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-text-color</span>&gt;</span>
67
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-text-background-color</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-text-background-color</span>&gt;</span>
68
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-group</span>&gt;</span>
69
+
70
+ <span class="hljs-comment">&lt;!-- Clear formatting --&gt;</span>
71
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-clear-formatting</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-clear-formatting</span>&gt;</span>
72
+
73
+ <span class="hljs-comment">&lt;!-- Link and table --&gt;</span>
74
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-group</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span>
75
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-create-link</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-create-link</span>&gt;</span>
76
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-insert-table</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-insert-table</span>&gt;</span>
77
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-group</span>&gt;</span>
78
+
79
+ <span class="hljs-comment">&lt;!-- Spacer and mode toggle --&gt;</span>
80
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-spacer</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-spacer</span>&gt;</span>
81
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-mode</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-mode</span>&gt;</span>
82
+
83
+ <span class="hljs-comment">&lt;!-- Bottom toolbar stats --&gt;</span>
84
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-word-count</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-bottom"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-word-count</span>&gt;</span>
85
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-hec-character-count</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-bottom"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-hec-character-count</span>&gt;</span>
86
+ <span class="hljs-tag">&lt;/<span class="hljs-name">k-html-editor</span>&gt;</span></code></pre>
87
+ </k-card>
88
+ </div>
89
+ <div class="col m-span-12 px">
90
+ <k-card label="Output">
91
+ <k-html-editor class="b r" value="<h3>Welcome to the HTML Editor</h3><p>This editor includes all formatting controls. Try selecting text and using the toolbar:</p><ul><li><b>Bold</b>, <i>italic</i>, <u>underline</u>, and <s>strikethrough</s></li><li>Text <span style='color: #e60000;'>colors</span> and <span style='background-color: #ffffcc;'>backgrounds</span></li><li>Lists, alignment, and <a href='#'>links</a></li><li>Format as <code>inline code</code> or code blocks</li></ul><p>Use the mode toggle to switch between visual and code editing.</p>" style="height: 600px">
92
+ <k-hec-group slot="toolbar-top">
93
+ <k-hec-bold></k-hec-bold>
94
+ <k-hec-italic></k-hec-italic>
95
+ <k-hec-underline></k-hec-underline>
96
+ <k-hec-strikethrough></k-hec-strikethrough>
97
+ </k-hec-group>
98
+ <k-hec-inline-code slot="toolbar-top"></k-hec-inline-code>
99
+ <k-hec-dropdown slot="toolbar-top">
100
+ <k-icon slot="icon" name="format_paragraph"></k-icon>
101
+
102
+ <k-hec-format-block tag="p">Paragraph</k-hec-format-block>
103
+ <k-hec-format-block tag="h1">Heading 1</k-hec-format-block>
104
+ <k-hec-format-block tag="h2">Heading 2</k-hec-format-block>
105
+ <k-hec-format-block tag="h3">Heading 3</k-hec-format-block>
106
+ <k-hec-code-block>Code Block</k-hec-code-block>
107
+ </k-hec-dropdown>
108
+ <k-hec-group slot="toolbar-top">
109
+ <k-hec-bullet-list></k-hec-bullet-list>
110
+ <k-hec-number-list></k-hec-number-list>
111
+ </k-hec-group>
112
+ <k-hec-group slot="toolbar-top">
113
+ <k-hec-align-left></k-hec-align-left>
114
+ <k-hec-align-center></k-hec-align-center>
115
+ <k-hec-align-right></k-hec-align-right>
116
+ <k-hec-align-justify></k-hec-align-justify>
117
+ </k-hec-group>
118
+ <k-hec-group slot="toolbar-top">
119
+ <k-hec-text-color></k-hec-text-color>
120
+ <k-hec-text-background-color></k-hec-text-background-color>
121
+ </k-hec-group>
122
+ <k-hec-clear-formatting slot="toolbar-top"></k-hec-clear-formatting>
123
+ <k-hec-group slot="toolbar-top">
124
+ <k-hec-create-link></k-hec-create-link>
125
+ <k-hec-insert-table></k-hec-insert-table>
126
+ </k-hec-group>
127
+ <k-hec-spacer slot="toolbar-top"></k-hec-spacer>
128
+ <k-hec-mode slot="toolbar-top"></k-hec-mode>
129
+ <k-hec-word-count slot="toolbar-bottom"></k-hec-word-count>
130
+ <k-hec-character-count slot="toolbar-bottom"></k-hec-character-count>
131
+ </k-html-editor>
132
+ </k-card>
133
+ </div>
134
+ </div>
135
+
136
+ <h3 id="javascriptUsage"><a href="#javascriptUsage" class="no-link">JavaScript API Example</a></h3>
137
+ <p>Use the editor without controls and interact with it programmatically using custom buttons and the JavaScript API:</p>
138
+ <div class="row -mx">
139
+ <div class="col m-span-12 px">
140
+ <k-card label="HTML">
141
+ <pre><code class="hljs xml"><span class="hljs-comment">&lt;!-- Custom toolbar --&gt;</span>
142
+ <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
143
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"myEditor.bold()"</span>&gt;</span>Bold<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
144
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"myEditor.italic()"</span>&gt;</span>Italic<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
145
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"myEditor.unorderedList()"</span>&gt;</span>List<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
146
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"myEditor.setTextColor('#ff0000')"</span>&gt;</span>Red<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
147
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"insertHTML()"</span>&gt;</span>Insert<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
148
+ <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"getContent()"</span>&gt;</span>Get Value<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
149
+ <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
150
+
151
+ <span class="hljs-comment">&lt;!-- Editor without controls --&gt;</span>
152
+ <span class="hljs-tag">&lt;<span class="hljs-name">k-html-editor</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"myEditor"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-html-editor</span>&gt;</span>
153
+
154
+ <span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript">
155
+ <span class="hljs-keyword">const</span> myEditor = <span class="hljs-variable language_">document</span>.getElementById(<span class="hljs-string">'myEditor'</span>);
156
+
157
+ <span class="hljs-comment">// Set initial content</span>
158
+ myEditor.setValue(<span class="hljs-string">'&lt;p&gt;Select text and use the buttons above!&lt;/p&gt;'</span>);
159
+
160
+ <span class="hljs-keyword">function</span> <span class="hljs-title function_">insertHTML</span>(<span class="hljs-params"></span>) {
161
+ myEditor.insertHTML(<span class="hljs-string">'&lt;p&gt;&lt;b&gt;Inserted content!&lt;/b&gt;&lt;/p&gt;'</span>);
162
+ }
163
+
164
+ <span class="hljs-keyword">function</span> <span class="hljs-title function_">getContent</span>(<span class="hljs-params"></span>) {
165
+ alert(myEditor.getValue());
166
+ }
167
+ </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
168
+ </k-card>
169
+ </div>
170
+ <div class="col m-span-12 px">
171
+ <k-card label="Output">
172
+ <div class="mb">
173
+ <button onclick="myEditor.bold()">Bold</button>
174
+ <button onclick="myEditor.italic()">Italic</button>
175
+ <button onclick="myEditor.unorderedList()">List</button>
176
+ <button onclick="myEditor.setTextColor('#ff0000')">Red</button>
177
+ <button onclick="insertMyEditorHTML()">Insert</button>
178
+ <button onclick="getMyEditorContent()">Get Value</button>
179
+ </div>
180
+ <k-html-editor id="myEditor" class="b r"></k-html-editor>
181
+ <script>
182
+ const myEditor = document.getElementById('myEditor');
183
+ setTimeout(() => {
184
+ myEditor.setValue('<p>Select text and use the buttons above to format it!</p><p>The editor works without any built-in controls - you have full control via JavaScript.</p>');
185
+ }, 100);
186
+
187
+ function insertMyEditorHTML() {
188
+ myEditor.insertHTML('<p><b>Inserted content!</b></p>');
189
+ }
190
+
191
+ function getMyEditorContent() {
192
+ alert(myEditor.getValue());
193
+ }
194
+ </script>
195
+ </k-card>
196
+ </div>
197
+ </div>
198
+
199
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
200
+
201
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
202
+ <p><code>new HtmlEditor()</code></p>
203
+ <p>Extends <code>ShadowComponent</code> which extends <code>LitElement</code>.</p>
204
+
205
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
206
+
207
+ <h5><code>name<i>: String</i></code></h5>
208
+ <p>The name attribute for form submission.</p>
209
+
210
+ <h5><code>value<i>: String</i></code></h5>
211
+ <p>The HTML content of the editor. Can be get or set via JavaScript or HTML attribute.</p>
212
+
213
+ <h5><code>mode<i>: String</i></code></h5>
214
+ <p>Current editing mode. Either <code>'visual'</code> (WYSIWYG) or <code>'code'</code> (raw HTML). Default: <code>'visual'</code></p>
215
+
216
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
217
+
218
+ <h4>Mode Control</h4>
219
+ <h5><code>setMode(mode)<i>: this</i></code></h5>
220
+ <p>Set the editing mode. Accepts <code>'visual'</code> or <code>'code'</code>.</p>
221
+
222
+ <h5><code>toggleMode()<i>: this</i></code></h5>
223
+ <p>Toggle between visual and code modes.</p>
224
+
225
+ <h4>Content Management</h4>
226
+ <h5><code>getValue()<i>: String</i></code></h5>
227
+ <p>Returns the current HTML content.</p>
228
+
229
+ <h5><code>setValue(html)<i>: this</i></code></h5>
230
+ <p>Sets the HTML content of the editor.</p>
231
+
232
+ <h5><code>clear()<i>: this</i></code></h5>
233
+ <p>Clears all content from the editor.</p>
234
+
235
+ <h4>Text Formatting</h4>
236
+ <h5><code>bold()<i>: this</i></code></h5>
237
+ <p>Applies bold formatting to the selected text.</p>
238
+
239
+ <h5><code>italic()<i>: this</i></code></h5>
240
+ <p>Applies italic formatting to the selected text.</p>
241
+
242
+ <h5><code>underline()<i>: this</i></code></h5>
243
+ <p>Applies underline formatting to the selected text.</p>
244
+
245
+ <h5><code>strikethrough()<i>: this</i></code></h5>
246
+ <p>Applies strikethrough formatting to the selected text.</p>
247
+
248
+ <h4>Lists</h4>
249
+ <h5><code>orderedList()<i>: this</i></code></h5>
250
+ <p>Creates or toggles an ordered (numbered) list.</p>
251
+
252
+ <h5><code>unorderedList()<i>: this</i></code></h5>
253
+ <p>Creates or toggles an unordered (bulleted) list.</p>
254
+
255
+ <h4>Text Alignment</h4>
256
+ <h5><code>alignLeft()<i>: this</i></code></h5>
257
+ <p>Aligns text to the left.</p>
258
+
259
+ <h5><code>alignCenter()<i>: this</i></code></h5>
260
+ <p>Centers the text.</p>
261
+
262
+ <h5><code>alignRight()<i>: this</i></code></h5>
263
+ <p>Aligns text to the right.</p>
264
+
265
+ <h5><code>alignJustify()<i>: this</i></code></h5>
266
+ <p>Justifies the text.</p>
267
+
268
+ <h4>Text Color</h4>
269
+ <h5><code>setTextColor(color)<i>: this</i></code></h5>
270
+ <p>Sets the foreground color of selected text. Accepts any valid CSS color value (hex, rgb, color name).</p>
271
+
272
+ <h5><code>removeTextColor()<i>: this</i></code></h5>
273
+ <p>Removes foreground color from selected text.</p>
274
+
275
+ <h5><code>setTextBackgroundColor(color)<i>: this</i></code></h5>
276
+ <p>Sets the background color of selected text. Accepts any valid CSS color value (hex, rgb, color name).</p>
277
+
278
+ <h5><code>removeTextBackgroundColor()<i>: this</i></code></h5>
279
+ <p>Removes background color from selected text.</p>
280
+
281
+ <h4>Formatting Control</h4>
282
+ <h5><code>removeFormat()<i>: this</i></code></h5>
283
+ <p>Removes all formatting from the selected text.</p>
284
+
285
+ <h5><code>formatBlock(tag)<i>: this</i></code></h5>
286
+ <p>Formats the current block with the specified HTML tag (e.g., 'h1', 'h2', 'h3', 'p', 'pre').</p>
287
+
288
+ <h5><code>insertHTML(html)<i>: this</i></code></h5>
289
+ <p>Inserts HTML at the current cursor position.</p>
290
+
291
+ <h5><code>insertAtCursor(html)<i>: this</i></code></h5>
292
+ <p>Alias for <code>insertHTML()</code>.</p>
293
+
294
+ <h5><code>insertTable(rows, columns, includeHeaders, cellData)<i>: this</i></code></h5>
295
+ <p>Inserts an HTML table at the cursor position.</p>
296
+ <ul>
297
+ <li><code>rows</code> - Number of rows to create</li>
298
+ <li><code>columns</code> - Number of columns to create</li>
299
+ <li><code>includeHeaders</code> - Boolean indicating whether to include header row (default: false)</li>
300
+ <li><code>cellData</code> - Optional 2D array of cell content. If provided, rows/columns are determined from array dimensions</li>
301
+ </ul>
302
+
303
+ <h5><code>insertElementAtCursor(element, selectAfter)<i>: this</i></code></h5>
304
+ <p>Inserts a DOM element at the cursor position or replaces selection.</p>
305
+ <ul>
306
+ <li><code>element</code> - DOM element to insert</li>
307
+ <li><code>selectAfter</code> - Boolean indicating whether to select the inserted element after insertion (default: true)</li>
308
+ </ul>
309
+
310
+ <h5><code>replaceSelectionWithElement(element, selectAfter)<i>: this</i></code></h5>
311
+ <p>Replaces the current selection with a DOM element.</p>
312
+ <ul>
313
+ <li><code>element</code> - DOM element to insert</li>
314
+ <li><code>selectAfter</code> - Boolean indicating whether to select the inserted element after replacement (default: true)</li>
315
+ </ul>
316
+
317
+ <h5><code>wrapSelection(before, after, savedSelection)<i>: this</i></code></h5>
318
+ <p>Wraps the selected text with HTML tags. Handles complex cases like unwrapping existing tags and preventing nested pre tags.</p>
319
+ <ul>
320
+ <li><code>before</code> - Opening HTML tag(s) to wrap with</li>
321
+ <li><code>after</code> - Closing HTML tag(s) to wrap with</li>
322
+ <li><code>savedSelection</code> - Optional previously saved selection text to use instead of current selection</li>
323
+ </ul>
324
+
325
+ <h4>Selection Management</h4>
326
+ <h5><code>getSelection()<i>: Object | null</i></code></h5>
327
+ <p>Returns an object containing information about the current selection: <code>{ text, html, range, selection }</code></p>
328
+
329
+ <h5><code>getSelectedText()<i>: String</i></code></h5>
330
+ <p>Returns the plain text of the current selection.</p>
331
+
332
+ <h5><code>getSelectedHTML()<i>: String</i></code></h5>
333
+ <p>Returns the HTML of the current selection.</p>
334
+
335
+ <h5><code>setSelection(startNode, startOffset, endNode, endOffset)<i>: this</i></code></h5>
336
+ <p>Programmatically sets the selection range.</p>
337
+
338
+ <h5><code>selectAll()<i>: this</i></code></h5>
339
+ <p>Selects all content in the editor.</p>
340
+
341
+ <h5><code>replaceSelection(html)<i>: this</i></code></h5>
342
+ <p>Replaces the current selection with the provided HTML.</p>
343
+
344
+ <h5><code>deleteSelection()<i>: this</i></code></h5>
345
+ <p>Deletes the currently selected content.</p>
346
+
347
+ <h5><code>getValueWithSelectionMarkers()<i>: Object</i></code></h5>
348
+ <p>Returns the editor content with special Unicode markers indicating cursor position or selection boundaries. Useful for preserving selection state during content transformations.</p>
349
+ <p>Returns object with properties:</p>
350
+ <ul>
351
+ <li><code>html</code> - HTML content with markers inserted</li>
352
+ <li><code>hasCursor</code> - Boolean indicating if cursor position is marked</li>
353
+ <li><code>hasSelection</code> - Boolean indicating if selection is marked</li>
354
+ <li><code>cursorMarker</code> - Unicode character used for cursor (\uFFF0)</li>
355
+ <li><code>selectionStart</code> - Unicode character for selection start (\uFFF1)</li>
356
+ <li><code>selectionEnd</code> - Unicode character for selection end (\uFFF2)</li>
357
+ <li><code>selectedText</code> - Plain text of the selection</li>
358
+ </ul>
359
+
360
+ <h5><code>setValueFromSelectionMarkers(html, markers)<i>: this</i></code></h5>
361
+ <p>Sets editor content and restores cursor/selection from Unicode markers. Companion method to <code>getValueWithSelectionMarkers()</code>.</p>
362
+ <ul>
363
+ <li><code>html</code> - HTML content containing marker characters</li>
364
+ <li><code>markers</code> - Object with marker information (hasCursor, hasSelection, cursorMarker, selectionStart, selectionEnd)</li>
365
+ </ul>
366
+
367
+ <h4>Links and Media</h4>
368
+ <h5><code>createLink(url)<i>: this</i></code></h5>
369
+ <p>Creates a hyperlink from the selected text.</p>
370
+
371
+ <h5><code>unlink()<i>: this</i></code></h5>
372
+ <p>Removes hyperlink from the selected text.</p>
373
+
374
+ <h5><code>insertImage(url)<i>: this</i></code></h5>
375
+ <p>Inserts an image at the cursor position.</p>
376
+
377
+ <h4>History</h4>
378
+ <h5><code>undo()<i>: this</i></code></h5>
379
+ <p>Undoes the last action.</p>
380
+
381
+ <h5><code>redo()<i>: this</i></code></h5>
382
+ <p>Redoes the last undone action.</p>
383
+
384
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
385
+
386
+ <h5><code>change</code></h5>
387
+ <p>Dispatched when the content changes. Event detail: <code>{ value: String }</code></p>
388
+
389
+ <h5><code>mode-changed</code></h5>
390
+ <p>Dispatched when the editing mode changes between 'visual' and 'code'. Event detail: <code>{ mode: String }</code></p>
391
+ </content>
392
+ <content location="scripts">
393
+ <script type="module" src="{{pathToRoot}}src/components/HtmlEditor.js"></script>
394
+ <script type="module" src="{{pathToRoot}}src/components/Dropdown.js"></script>
395
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/Bold.js"></script>
396
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/Italic.js"></script>
397
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/Underline.js"></script>
398
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/Strikethrough.js"></script>
399
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/BulletList.js"></script>
400
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/NumberList.js"></script>
401
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/AlignLeft.js"></script>
402
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/AlignCenter.js"></script>
403
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/AlignRight.js"></script>
404
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/AlignJustify.js"></script>
405
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/CreateLink.js"></script>
406
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/Mode.js"></script>
407
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/DropdownControl.js"></script>
408
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/FormatBlock.js"></script>
409
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/InlineCode.js"></script>
410
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/CodeBlock.js"></script>
411
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/ControlGroup.js"></script>
412
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/ControlSpacer.js"></script>
413
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/TextColor.js"></script>
414
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/TextBackgroundColor.js"></script>
415
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/ClearFormatting.js"></script>
416
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/WordCount.js"></script>
417
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/CharacterCount.js"></script>
418
+ <script type="module" src="{{pathToRoot}}src/components/htmlEditorControls/InsertTable.js"></script>
419
+ <script type="module" src="{{pathToRoot}}src/components/Resize.js"></script>
420
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
421
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
422
+ </content>
423
+ </page>
@@ -0,0 +1,96 @@
1
+ <page pageName="HybridComponent" title="HybridComponent - Base Components - Kempo Docs - A Web Components Solution">
2
+ <content>
3
+ <k-accordion persistent-id="toc" class="b r mb">
4
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
5
+ <k-accordion-panel name="toc-panel">
6
+ <div class="m pl">
7
+ <h6>Guide</h6>
8
+ <a href="#overview">Overview</a><br />
9
+ <a href="#basicUsage">Basic Usage</a><br />
10
+ <a href="#whenToUse">When to Use</a><br />
11
+
12
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
13
+ <a href="#constructor">Constructor</a><br />
14
+ <a href="#requirements">Requirements</a><br />
15
+ <a href="#properties">Properties</a><br />
16
+ <a href="#methods">Methods</a><br />
17
+ </div>
18
+ </k-accordion-panel>
19
+ </k-accordion>
20
+
21
+ <h3 id="overview"><a href="#overview" class="no-link">Overview</a></h3>
22
+ <p>HybridComponent is a base class that extends <a href="./components/shadow-component.html">ShadowComponent</a> and provides both shadow DOM rendering with Kempo CSS styles AND light DOM rendering. Use this when you want your component to:</p>
23
+ <ul>
24
+ <li>Have shadow DOM with Kempo CSS for internal UI elements</li>
25
+ <li>Also render content to the light DOM alongside natural children</li>
26
+ <li>Combine the benefits of both shadow and light DOM</li>
27
+ </ul>
28
+
29
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
30
+ <p>Create a custom component by extending HybridComponent and implementing both <code>render()</code> for shadow DOM and <code>renderLightDom()</code> for light DOM:</p>
31
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> HybridComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'./HybridComponent.js'</span>;<br /><span class="hljs-keyword">import</span> { html, css } <span class="hljs-keyword">from</span> <span class="hljs-string">'../lit-all.min.js'</span>;<br /><br /><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">MyHybridComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_">HybridComponent</span> {<br /> <span class="hljs-keyword">static</span> properties = {<br /> <span class="hljs-attr">title</span>: { <span class="hljs-attr">type</span>: <span class="hljs-title class_">String</span> }<br /> };<br /><br /> <span class="hljs-keyword">static</span> styles = css<span class="hljs-string">`<br /> :host {<br /> display: block;<br /> }<br /> .shadow-content {<br /> background: var(--c_primary);<br /> color: var(--tc_on_primary);<br /> padding: var(--spacer);<br /> }<br /> `</span>;<br /><br /> <span class="hljs-title function_">constructor</span>() {<br /> <span class="hljs-variable language_">super</span>();<br /> <span class="hljs-variable language_">this</span>.title = <span class="hljs-string">'Hybrid'</span>;<br /> }<br /><br /> <span class="hljs-comment">// Shadow DOM content with Kempo CSS styles</span><br /> <span class="hljs-title function_">render</span>() {<br /> <span class="hljs-keyword">return</span> html<span class="hljs-string">`<br /> &lt;div class="shadow-content"&gt;<br /> &lt;h3&gt;<span class="hljs-subst">${<span class="hljs-variable language_">this</span>.title}</span> Component&lt;/h3&gt;<br /> &lt;slot name="lightRoot"&gt;&lt;/slot&gt;<br /> &lt;/div&gt;<br /> `</span>;<br /> }<br /><br /> <span class="hljs-comment">// Light DOM content alongside natural children</span><br /> <span class="hljs-title function_">renderLightDom</span>() {<br /> <span class="hljs-keyword">return</span> html<span class="hljs-string">`<br /> &lt;p class="p"&gt;This is rendered to light DOM&lt;/p&gt;<br /> &lt;slot&gt;&lt;/slot&gt;<br /> `</span>;<br /> }<br />}<br /><br /><span class="hljs-variable language_">customElements</span>.<span class="hljs-title function_">define</span>(<span class="hljs-string">'my-hybrid-component'</span>, MyHybridComponent);</code></pre>
32
+
33
+ <p><strong>Important:</strong> The default <code>render()</code> method includes <code>&lt;slot name="lightRoot"&gt;&lt;/slot&gt;</code> which is where the light DOM content appears. If you override <code>render()</code>, make sure to include this slot.</p>
34
+
35
+ <p><strong>Also Important:</strong> Always call <code>super.updated()</code> when overriding the <code>updated()</code> lifecycle method:</p>
36
+ <pre><code class="hljs javascript"><span class="hljs-title function_">updated</span>(changedProperties) {<br /> <span class="hljs-variable language_">super</span>.<span class="hljs-title function_">updated</span>(); <span class="hljs-comment">// Required!</span><br /> <br /> <span class="hljs-comment">// Your custom logic here</span><br />}</code></pre>
37
+
38
+ <h3 id="whenToUse"><a href="#whenToUse" class="no-link">When to Use</a></h3>
39
+ <p>Use HybridComponent when:</p>
40
+ <ul>
41
+ <li>You need styled internal UI elements (buttons, headers, etc.) in shadow DOM</li>
42
+ <li>You also need to render content to light DOM alongside natural children</li>
43
+ <li>You want Kempo CSS styles for your component UI but need flexibility for user content</li>
44
+ </ul>
45
+
46
+ <p><strong>Example use cases:</strong></p>
47
+ <ul>
48
+ <li><strong>Dialog:</strong> Shadow DOM for styled dialog chrome (header, footer, overlay), light DOM for user content</li>
49
+ <li><strong>Collapsible:</strong> Shadow DOM for toggle button, light DOM for collapsible content</li>
50
+ <li><strong>Aside:</strong> Shadow DOM for menu structure and styling, light DOM for menu items</li>
51
+ </ul>
52
+
53
+ <p>Use <a href="./components/shadow-component.html">ShadowComponent</a> instead when you only need shadow DOM.</p>
54
+ <p>Use <a href="./components/light-component.html">LightComponent</a> instead when you only need light DOM.</p>
55
+
56
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
57
+
58
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
59
+ <h6>Extends ShadowComponent</h6>
60
+ <h5><code>new HybridComponent()</code></h5>
61
+ <p>Creates a new HybridComponent instance with both shadow DOM (with Kempo CSS) and light DOM rendering.</p>
62
+
63
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
64
+ <ul>
65
+ <li>Lit (html, render)</li>
66
+ <li><a href="shadow-component.html">ShadowComponent</a></li>
67
+ </ul>
68
+
69
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
70
+ <h5><code>lightRoot<i>: HTMLElement</i></code></h5>
71
+ <p>A container element with <code>display: contents</code> that holds the rendered light DOM content. It has <code>slot="lightRoot"</code> to connect it to the shadow DOM slot. Created automatically by <code>createRenderRoot()</code>.</p>
72
+
73
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
74
+ <h5><code>createRenderRoot()<i>: Element</i></code></h5>
75
+ <p>Creates both shadow DOM (via <code>super.createRenderRoot()</code>) and light DOM render containers. This method:</p>
76
+ <ul>
77
+ <li>Calls the parent ShadowComponent's <code>createRenderRoot()</code> to set up shadow DOM with Kempo CSS</li>
78
+ <li>Creates a <code>lightRoot</code> div with <code>display: contents</code> and <code>slot="lightRoot"</code></li>
79
+ <li>Appends <code>lightRoot</code> to the component element</li>
80
+ <li>Returns the shadow render container</li>
81
+ </ul>
82
+
83
+ <h5><code>updated()<i>: void</i></code></h5>
84
+ <p>Called automatically by Lit when the component updates. Renders the result of <code>renderLightDom()</code> into <code>lightRoot</code>. Override this method if needed, but always call <code>super.updated()</code>.</p>
85
+
86
+ <h5><code>renderLightDom()<i>: TemplateResult</i></code></h5>
87
+ <p>Override this method to define what should be rendered to the light DOM. Returns an empty template by default. Use Lit's <code>html</code> tagged template literal to return your content. Typically includes a <code>&lt;slot&gt;&lt;/slot&gt;</code> for natural children.</p>
88
+
89
+ <h5><code>render()<i>: TemplateResult</i></code></h5>
90
+ <p>Override this method to define what should be rendered to the shadow DOM. The default implementation returns <code>html`&lt;slot name="lightRoot"&gt;&lt;/slot&gt;`</code> which displays the light DOM content. When overriding, make sure to include this slot where you want the light DOM content to appear.</p>
91
+ </content>
92
+ <content location="scripts">
93
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
94
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
95
+ </content>
96
+ </page>