@record-evolution/widget-markdown 1.0.6 → 1.0.8

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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent widget-markdown following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "widget-markdown",
6
- "version": "1.0.6",
6
+ "version": "1.0.8",
7
7
  "engines": {
8
8
  "node": ">=24.9.0",
9
9
  "npm": ">=10.0.2"
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "github-markdown-css": "^5.8.1",
32
32
  "highlight.js": "^11.11.1",
33
- "lit": "^3.3.2",
33
+ "lit": "^3.3.3",
34
34
  "marked": "^16.3.0",
35
35
  "marked-highlight": "^2.2.3",
36
36
  "tslib": "^2.8.1"
@@ -25,7 +25,7 @@ export type Variables = {
25
25
  /**
26
26
  * A markdown rendering widget for displaying formatted text with dynamic variable substitution. Use this widget for documentation, instructions, dynamic reports, or any rich text content on dashboards. Supports full Markdown syntax including headers, lists, tables, links, and code blocks. Variables can be embedded using {{variableName}} notation and bound to data sources for real-time updates. Ideal for creating contextual help, status summaries, or narrative text that incorporates live data values.
27
27
  */
28
- export interface InputData {
28
+ export interface MarkdownConfiguration {
29
29
  markdown?: Markdown;
30
30
  data?: Variables;
31
31
  [k: string]: unknown;
@@ -1,6 +1,20 @@
1
1
  {
2
- "title": "InputData",
2
+ "title": "Markdown Configuration",
3
3
  "description": "A markdown rendering widget for displaying formatted text with dynamic variable substitution. Use this widget for documentation, instructions, dynamic reports, or any rich text content on dashboards. Supports full Markdown syntax including headers, lists, tables, links, and code blocks. Variables can be embedded using {{variableName}} notation and bound to data sources for real-time updates. Ideal for creating contextual help, status summaries, or narrative text that incorporates live data values.",
4
+ "aiSelection": {
5
+ "dataShape": "A Markdown document, with {{variableName}} placeholders substituted from data[] entries that each bind a label to a live value.",
6
+ "useWhen": [
7
+ "Prose, documentation, instructions or a written summary belongs on the dashboard.",
8
+ "The text needs structure or markup — headings, lists, links, tables, code blocks.",
9
+ "A narrative should incorporate live numbers, e.g. 'Line 3 produced {{units}} units today'."
10
+ ],
11
+ "notFor": [
12
+ "A single styled string with no markup — use widget-label; a Markdown renderer is overkill.",
13
+ "Fixed title / subtitle / body sections with per-section typography — use widget-textbox.",
14
+ "Tabular data coming from a query rather than written by hand — use widget-table.",
15
+ "Numbers that should be read as figures rather than embedded in a sentence — use widget-value."
16
+ ]
17
+ },
4
18
  "type": "object",
5
19
  "properties": {
6
20
  "markdown": {
@@ -16,7 +16,7 @@ import cssLang from 'highlight.js/lib/languages/css'
16
16
  import highlightCSS from 'highlight.js/styles/github.css?inline'
17
17
  import githubCss from 'github-markdown-css/github-markdown.css?inline'
18
18
  import { customElement, property, state } from 'lit/decorators.js'
19
- import { InputData } from './definition-schema'
19
+ import { MarkdownConfiguration } from './definition-schema'
20
20
 
21
21
  hljs.registerLanguage('shell', shell)
22
22
  hljs.registerLanguage('bash', shell)
@@ -37,7 +37,7 @@ type Theme = {
37
37
  @customElement('widget-markdown-versionplaceholder')
38
38
  export class WidgetMarkdown extends LitElement {
39
39
  @property({ type: Object })
40
- inputData?: InputData
40
+ inputData?: MarkdownConfiguration
41
41
 
42
42
  @property({ type: Object })
43
43
  theme?: Theme
@@ -159,6 +159,29 @@ export class WidgetMarkdown extends LitElement {
159
159
  overflow: auto;
160
160
  padding: 1cqh 1cqw;
161
161
  box-sizing: border-box;
162
+ /* Derive scrollbar colors from the (inherited) text color so they
163
+ follow custom styles and themes — e.g. light thumb on dark bg. */
164
+ scrollbar-width: thin;
165
+ scrollbar-color: color-mix(in srgb, currentColor 35%, transparent) transparent;
166
+ }
167
+
168
+ /* WebKit/Blink fallback for browsers without scrollbar-color support. */
169
+ .wrapper::-webkit-scrollbar {
170
+ width: 8px;
171
+ height: 8px;
172
+ }
173
+
174
+ .wrapper::-webkit-scrollbar-track {
175
+ background: transparent;
176
+ }
177
+
178
+ .wrapper::-webkit-scrollbar-thumb {
179
+ background-color: color-mix(in srgb, currentColor 35%, transparent);
180
+ border-radius: 4px;
181
+ }
182
+
183
+ .wrapper::-webkit-scrollbar-thumb:hover {
184
+ background-color: color-mix(in srgb, currentColor 55%, transparent);
162
185
  }
163
186
 
164
187
  h2 {