@redvars/peacock 3.15.0 → 3.17.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/dist/assets/styles.css +1 -1
  2. package/dist/assets/styles.css.map +1 -1
  3. package/dist/assets/theme.js +19 -19
  4. package/dist/assets/tokens.css +1 -1
  5. package/dist/assets/tokens.css.map +1 -1
  6. package/dist/card-content.js +8 -7
  7. package/dist/card-content.js.map +1 -1
  8. package/dist/card.js +142 -98
  9. package/dist/card.js.map +1 -1
  10. package/dist/{chart-bar-D5dGFJfK.js → cartesian-chart-DgE4USyC.js} +529 -312
  11. package/dist/cartesian-chart-DgE4USyC.js.map +1 -0
  12. package/dist/chart-area.js +78 -0
  13. package/dist/chart-area.js.map +1 -0
  14. package/dist/chart-bar.js +283 -213
  15. package/dist/chart-bar.js.map +1 -1
  16. package/dist/{transform-DSwFSqzD.js → chart-base-C2qRMF48.js} +771 -102
  17. package/dist/chart-base-C2qRMF48.js.map +1 -0
  18. package/dist/chart-doughnut.js +55 -287
  19. package/dist/chart-doughnut.js.map +1 -1
  20. package/dist/chart-line.js +626 -0
  21. package/dist/chart-line.js.map +1 -0
  22. package/dist/chart-pie.js +637 -195
  23. package/dist/chart-pie.js.map +1 -1
  24. package/dist/code-editor.js +704 -131
  25. package/dist/code-editor.js.map +1 -1
  26. package/dist/code-group.js +188 -0
  27. package/dist/code-group.js.map +1 -0
  28. package/dist/code-highlighter.js +895 -257
  29. package/dist/code-highlighter.js.map +1 -1
  30. package/dist/custom-elements-jsdocs.json +2278 -677
  31. package/dist/custom-elements.json +13962 -3690
  32. package/dist/image.js +5 -1
  33. package/dist/image.js.map +1 -1
  34. package/dist/index.js +8 -7
  35. package/dist/index.js.map +1 -1
  36. package/dist/loader-full.js +1 -1
  37. package/dist/loader.js +9 -3
  38. package/dist/loader.js.map +1 -1
  39. package/dist/{is-dark-mode-DOcaw4Yq.js → observe-theme-change-DCifz1uv.js} +2 -6
  40. package/dist/observe-theme-change-DCifz1uv.js.map +1 -0
  41. package/dist/pagination.js +408 -110
  42. package/dist/pagination.js.map +1 -1
  43. package/dist/path-CJ0Arqcy.js +166 -0
  44. package/dist/path-CJ0Arqcy.js.map +1 -0
  45. package/dist/snackbar.js +89 -34
  46. package/dist/snackbar.js.map +1 -1
  47. package/dist/src/__internal/chart/cartesian-chart.d.ts +80 -0
  48. package/dist/src/__internal/chart/chart-base.d.ts +113 -0
  49. package/dist/src/__internal/chart/paths.d.ts +5 -0
  50. package/dist/src/__internal/chart/types.d.ts +42 -0
  51. package/dist/src/card/card-content.d.ts +2 -3
  52. package/dist/src/card/card.d.ts +31 -17
  53. package/dist/src/chart-area/chart-area.d.ts +54 -0
  54. package/dist/src/chart-area/index.d.ts +1 -0
  55. package/dist/src/chart-bar/chart-bar.d.ts +44 -33
  56. package/dist/src/chart-bar/index.d.ts +0 -1
  57. package/dist/src/chart-doughnut/chart-doughnut.d.ts +33 -39
  58. package/dist/src/chart-line/chart-line.d.ts +69 -0
  59. package/dist/src/chart-line/index.d.ts +1 -0
  60. package/dist/src/chart-pie/chart-pie.d.ts +63 -28
  61. package/dist/src/code-editor/code-editor.d.ts +52 -13
  62. package/dist/src/code-editor/editor-theme.d.ts +60 -0
  63. package/dist/src/code-highlighter/code-group.d.ts +52 -0
  64. package/dist/src/code-highlighter/code-highlighter.d.ts +122 -15
  65. package/dist/src/code-highlighter/index.d.ts +1 -0
  66. package/dist/src/code-highlighter/line-ranges.d.ts +24 -0
  67. package/dist/src/code-highlighter/local.d.ts +4 -1
  68. package/dist/src/code-highlighter/token-colors.d.ts +8 -0
  69. package/dist/src/index.d.ts +4 -2
  70. package/dist/src/pagination/page-items.d.ts +14 -0
  71. package/dist/src/pagination/pagination.d.ts +46 -7
  72. package/dist/src/snackbar/snackbar.d.ts +13 -1
  73. package/dist/src/table/table.d.ts +125 -27
  74. package/dist/src/toolbar/toolbar.d.ts +56 -51
  75. package/dist/table.js +1007 -338
  76. package/dist/table.js.map +1 -1
  77. package/dist/test/chart.test.d.ts +1 -0
  78. package/dist/test/code-highlighter.test.d.ts +1 -0
  79. package/dist/test/pagination.test.d.ts +1 -0
  80. package/dist/test/table.test.d.ts +1 -0
  81. package/dist/token-colors-0TFHWbcq.js +81 -0
  82. package/dist/token-colors-0TFHWbcq.js.map +1 -0
  83. package/dist/toolbar.js +195 -184
  84. package/dist/toolbar.js.map +1 -1
  85. package/dist/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +1 -2
  87. package/readme.md +7 -6
  88. package/scss/_code-block.scss +139 -0
  89. package/scss/tokens.css +24 -0
  90. package/src/__internal/chart/cartesian-chart.ts +404 -0
  91. package/src/__internal/chart/chart-base.scss +252 -0
  92. package/src/__internal/chart/chart-base.ts +474 -0
  93. package/src/__internal/chart/paths.ts +28 -0
  94. package/src/__internal/chart/types.ts +49 -0
  95. package/src/card/card-content.ts +12 -9
  96. package/src/card/card.scss +66 -54
  97. package/src/card/card.ts +109 -73
  98. package/src/chart-area/chart-area.ts +82 -0
  99. package/src/chart-area/index.ts +1 -0
  100. package/src/chart-bar/chart-bar.ts +336 -250
  101. package/src/chart-bar/index.ts +0 -1
  102. package/src/chart-doughnut/chart-doughnut.ts +62 -262
  103. package/src/chart-doughnut/demo/index.html +14 -22
  104. package/src/chart-line/chart-line.scss +25 -0
  105. package/src/chart-line/chart-line.ts +346 -0
  106. package/src/chart-line/index.ts +1 -0
  107. package/src/chart-pie/chart-pie.scss +35 -16
  108. package/src/chart-pie/chart-pie.ts +282 -188
  109. package/src/chart-pie/demo/index.html +13 -21
  110. package/src/code-editor/code-editor.scss +132 -36
  111. package/src/code-editor/code-editor.ts +308 -88
  112. package/src/code-editor/demo/index.html +39 -12
  113. package/src/code-editor/editor-theme.ts +213 -0
  114. package/src/code-highlighter/code-group.scss +34 -0
  115. package/src/code-highlighter/code-group.ts +173 -0
  116. package/src/code-highlighter/code-highlighter.scss +226 -111
  117. package/src/code-highlighter/code-highlighter.ts +554 -199
  118. package/src/code-highlighter/demo/index.html +68 -4
  119. package/src/code-highlighter/index.ts +1 -0
  120. package/src/code-highlighter/line-ranges.ts +81 -0
  121. package/src/code-highlighter/local.ts +9 -3
  122. package/src/code-highlighter/token-colors.ts +42 -0
  123. package/src/index.ts +4 -2
  124. package/src/loader.ts +8 -2
  125. package/src/pagination/page-items.ts +50 -0
  126. package/src/pagination/pagination.scss +159 -44
  127. package/src/pagination/pagination.ts +275 -74
  128. package/src/snackbar/demo/index.html +39 -4
  129. package/src/snackbar/snackbar.scss +27 -10
  130. package/src/snackbar/snackbar.ts +80 -37
  131. package/src/table/table.scss +337 -109
  132. package/src/table/table.ts +812 -272
  133. package/src/toolbar/toolbar-colors.scss +6 -7
  134. package/src/toolbar/toolbar.scss +35 -106
  135. package/src/toolbar/toolbar.ts +180 -80
  136. package/dist/array-D5vjT2Xm.js +0 -14
  137. package/dist/array-D5vjT2Xm.js.map +0 -1
  138. package/dist/chart-bar-D5dGFJfK.js.map +0 -1
  139. package/dist/chart-stacked-bar.js +0 -403
  140. package/dist/chart-stacked-bar.js.map +0 -1
  141. package/dist/copy-to-clipboard-upGx-Ueo.js +0 -39
  142. package/dist/copy-to-clipboard-upGx-Ueo.js.map +0 -1
  143. package/dist/is-dark-mode-DOcaw4Yq.js.map +0 -1
  144. package/dist/pie-Dz0IDiPt.js +0 -537
  145. package/dist/pie-Dz0IDiPt.js.map +0 -1
  146. package/dist/pierre-dark-DFWl0m-C.js +0 -4
  147. package/dist/pierre-dark-DFWl0m-C.js.map +0 -1
  148. package/dist/pierre-light-BEkAPImt.js +0 -4
  149. package/dist/pierre-light-BEkAPImt.js.map +0 -1
  150. package/dist/src/chart-bar/chart-stacked-bar.d.ts +0 -78
  151. package/dist/src/code-highlighter/constants.d.ts +0 -1
  152. package/dist/transform-DSwFSqzD.js.map +0 -1
  153. package/src/chart-bar/chart-bar.scss +0 -58
  154. package/src/chart-bar/chart-stacked-bar.ts +0 -398
  155. package/src/chart-doughnut/chart-donut.scss +0 -37
  156. package/src/code-highlighter/constants.ts +0 -117
  157. /package/dist/test/{chart-bar.test.d.ts → card.test.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"code-editor.js","sources":["../../src/code-editor/code-editor.ts"],"sourcesContent":["import { type CSSResult, html, nothing, PropertyValues } from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport BaseInput from '../input/BaseInput.js';\nimport { observeThemeChange } from '../__internal/utils/observe-theme-change.js';\nimport { redispatchEvent } from '../__internal/utils/dispatch-event-utils.js';\nimport { copyToClipboard } from '../__internal/utils/copy-to-clipboard.js';\nimport { isDarkMode } from '@/__internal/utils/is-dark-mode.js';\n\nimport styles from './code-editor.scss';\n\nexport type CodeEditorLanguage =\n | 'javascript'\n | 'typescript'\n | 'json'\n | 'html'\n | 'css'\n | 'scss'\n | 'markdown';\n\n/** A problem shown in the editor: a squiggle under the text and a mark in the scroll bar. Lines and columns count from 1. */\nexport type CodeEditorMarker = {\n line: number;\n column?: number;\n endLine?: number;\n endColumn?: number;\n message: string;\n severity?: 'error' | 'warning' | 'info';\n};\n\ntype Monaco = typeof import('./monaco.js');\n\nconst locale = {\n copied: 'Copied',\n copyToClipboard: 'Copy to clipboard',\n readOnly: 'Read Only',\n breakpoint: 'Breakpoint',\n currentLine: 'Paused here',\n};\n\nconst EXTENSIONS: Record<CodeEditorLanguage, string> = {\n javascript: 'js',\n typescript: 'ts',\n json: 'json',\n html: 'html',\n css: 'css',\n scss: 'scss',\n markdown: 'md',\n};\n\n/** Where the language workers are: `monaco/` beside the built component. */\nconst WORKERS = new URL('./monaco/', import.meta.url);\n\nlet loading: Promise<Monaco> | undefined;\nlet instances = 0;\n\n/**\n * Loads Monaco once per page: its workers come from this origin, and the icon font is declared in\n * the document, since a shadow root ignores `@font-face`.\n */\nfunction loadMonaco(): Promise<Monaco> {\n loading ??= (async () => {\n Reflect.set(globalThis, 'MonacoEnvironment', {\n getWorker(_id: string, label: string) {\n const file =\n label === 'typescript' || label === 'javascript'\n ? 'ts.worker.js'\n : label === 'json'\n ? 'json.worker.js'\n : 'editor.worker.js';\n return new Worker(new URL(file, WORKERS), { type: 'module' });\n },\n });\n const font = (styles as CSSResult).cssText.match(/@font-face\\s*\\{[^}]*font-family:\\s*codicon[^}]*\\}/);\n if (font && !document.getElementById('wc-code-editor-codicon')) {\n const style = document.createElement('style');\n style.id = 'wc-code-editor-codicon';\n style.textContent = font[0];\n document.head.append(style);\n }\n return import('./monaco.js');\n })();\n return loading;\n}\n\n/**\n * @label Code Editor\n * @tag wc-code-editor\n * @rawTag code-editor\n *\n * @summary A Monaco-based code editing component with syntax highlighting, completions and debugging marks.\n * @overview\n * - CodeEditor wraps Monaco Editor as a web component. Monaco is bundled with Peacock and loaded when the first editor appears; nothing comes from a CDN, so it works under a content security policy that allows only its own origin.\n * - Supports TypeScript, JavaScript, JSON, HTML, CSS, SCSS and Markdown, with completions and errors for TypeScript, JavaScript and JSON; read-only mode, line numbers, minimap, and dark/light theme.\n * - `lib-source` adds TypeScript declarations for completions, such as the modules a script may import.\n * - With `breakpoint-gutter`, a click in the gutter fires `breakpoint-toggle`; `breakpoints` and `current-line` draw the marks a debugger shows.\n * - `markers` underline problems, such as where a run failed.\n * - With `fill`, the editor takes the height of its container.\n * - Has a copy button; hide it with `hide-copy`.\n * - Emits `change` when content is edited and updates value from property changes.\n *\n * @cssprop --code-editor-height - Height of the editor. Defaults to 300px.\n *\n * @fires {Event} change - Dispatched when the user edits the content.\n * @fires {CustomEvent<{value: string}>} copied - Dispatched after the copy button copies the content.\n * @fires {CustomEvent<{line: number}>} breakpoint-toggle - Dispatched when the gutter of a line is clicked, with `breakpoint-gutter` set. The component does not change `breakpoints` itself.\n *\n * @example\n * ```html\n * <wc-code-editor\n * language=\"css\"\n * readonly\n * style=\"width: 100%; --code-editor-height: 10rem;\"\n * value=\":root { --color-primary: #6341d5; }\">\n * </wc-code-editor>\n * ```\n * @tags input, editor\n */\n@IndividualComponent\nexport default class CodeEditor extends BaseInput {\n // ── Static\n\n static styles = [styles];\n\n // ── Properties\n\n // `name` (for form use) comes from BaseInput's form association.\n\n /** The code shown in the editor. Updated as the user types. */\n @property({ type: String })\n value = '';\n\n /** Language used for syntax highlighting. Can be changed after the editor loads. */\n @property({ type: String })\n language: CodeEditorLanguage = 'javascript';\n\n /** TypeScript declarations (a `.d.ts`) for completions in TypeScript and JavaScript, such as the modules the code may import. */\n @property({ type: String, attribute: 'lib-source' })\n libSource: string | undefined;\n\n /** Compiler options for TypeScript and JavaScript, over the editor's defaults (target and modules ESNext, strict), such as `{ lib: ['es2022'] }`. */\n @property({ type: Object, attribute: false })\n compilerOptions: Record<string, unknown> | undefined;\n\n /** Whether line numbers show in the gutter. */\n @property({ type: String })\n lineNumbers: 'off' | 'on' = 'on';\n\n /** Shows the minimap. Leave the attribute out to hide it. */\n @property({ type: Boolean })\n minimap = false;\n\n /** Hides the copy button. */\n @property({ type: Boolean, attribute: 'hide-copy' })\n hideCopy = false;\n\n /** Shows a \"Read Only\" badge while the editor is read-only or disabled. */\n @property({ type: Boolean, attribute: 'show-readonly-badge' })\n showReadonlyBadge = false;\n\n /** Shows a gutter for breakpoints; a click there, or on a line number, fires `breakpoint-toggle`. */\n @property({ type: Boolean, attribute: 'breakpoint-gutter' })\n breakpointGutter = false;\n\n /** The lines with a breakpoint, from 1. */\n @property({ type: Array, attribute: false })\n breakpoints: number[] = [];\n\n /** The line a debugger is paused at, marked and scrolled into view; none when unset. */\n @property({ type: Number, attribute: 'current-line' })\n currentLine: number | undefined;\n\n /** Problems to underline, such as where a run failed. */\n @property({ type: Array, attribute: false })\n markers: CodeEditorMarker[] = [];\n\n /** Takes the height of the container instead of `--code-editor-height`. */\n @property({ type: Boolean, reflect: true })\n fill = false;\n\n /** Whether the page is in dark mode; picks the Monaco theme. */\n @state() private _isDarkMode: boolean = isDarkMode();\n\n /** Whether the editor text has focus. */\n @state() private hasFocus = false;\n\n /** Whether the copy button was just used; shows a check for a few seconds. */\n @state() private _copied = false;\n\n /** The Monaco editor instance, once loaded. */\n @state() private editorMonacoInstance?: any;\n\n // ── Queries\n\n @query('.editor') private editorElement!: HTMLElement;\n\n // ── Private fields\n\n /** The Monaco API, once loaded. */\n monaco: Monaco | undefined;\n\n /** This editor's model's address, unique on the page so two editors never share a model. */\n private readonly __id = ++instances;\n\n /** Stops listening for theme changes. */\n private __unobserveTheme?: () => void;\n\n /** Resets the copied state of the copy button. */\n private __copiedTimer?: ReturnType<typeof setTimeout>;\n\n /** The declarations added for `libSource`. */\n private __lib?: { dispose(): void }[];\n\n /** The breakpoint and current-line marks. */\n private __decorations?: { set(decorations: unknown[]): void; clear(): void };\n\n // ── Lifecycle\n\n connectedCallback() {\n super.connectedCallback();\n this.__unobserveTheme = observeThemeChange(() => {\n this._isDarkMode = isDarkMode();\n this.monaco?.editor.setTheme(this.getTheme());\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__unobserveTheme?.();\n clearTimeout(this.__copiedTimer);\n this.__lib?.forEach(lib => lib.dispose());\n this.__lib = undefined;\n const model = this.editorMonacoInstance?.getModel();\n this.editorMonacoInstance?.dispose();\n model?.dispose();\n this.editorMonacoInstance = undefined;\n }\n\n protected firstUpdated() {\n this.initializeMonaco();\n }\n\n protected updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('libSource') || changedProperties.has('compilerOptions')) this.libSourceChanged();\n\n const editor = this.editorMonacoInstance;\n if (!editor || !this.monaco) return;\n\n if (changedProperties.has('disabled') || changedProperties.has('readonly')) {\n editor.updateOptions({ readOnly: this.disabled || this.readonly });\n }\n\n if (\n changedProperties.has('lineNumbers') ||\n changedProperties.has('minimap') ||\n changedProperties.has('breakpointGutter')\n ) {\n editor.updateOptions({\n lineNumbers: this.lineNumbers,\n minimap: { enabled: this.minimap },\n glyphMargin: this.breakpointGutter,\n });\n }\n\n if (changedProperties.has('language')) {\n this.monaco.editor.setModelLanguage(editor.getModel(), this.language);\n }\n\n if (changedProperties.has('value') && editor.getValue() !== this.value) {\n editor.setValue(this.value || '');\n }\n\n if (changedProperties.has('breakpoints') || changedProperties.has('currentLine')) {\n this.drawDecorations();\n }\n if (changedProperties.has('currentLine') && this.currentLine) {\n editor.revealLineInCenterIfOutsideViewport(this.currentLine);\n }\n\n if (changedProperties.has('markers')) this.drawMarkers();\n }\n\n // ── Public methods\n\n async initializeMonaco() {\n const monaco = await loadMonaco();\n // Disconnected while Monaco loaded: nothing to put it in.\n if (!this.isConnected || !this.editorElement) return;\n this.monaco = monaco;\n\n const model = monaco.editor.createModel(\n this.value,\n this.language,\n monaco.Uri.parse(`file:///wc-code-editor/${this.__id}/index.${EXTENSIONS[this.language] ?? 'txt'}`),\n );\n this.editorMonacoInstance = monaco.editor.create(this.editorElement, {\n model,\n lineNumbers: this.lineNumbers,\n minimap: { enabled: this.minimap },\n glyphMargin: this.breakpointGutter,\n theme: this.getTheme(),\n readOnly: this.disabled || this.readonly,\n automaticLayout: true,\n fixedOverflowWidgets: true,\n scrollBeyondLastLine: false,\n });\n this.__decorations = this.editorMonacoInstance.createDecorationsCollection([]);\n\n this.libSourceChanged();\n this.drawDecorations();\n this.drawMarkers();\n\n this.editorMonacoInstance.onDidChangeModelContent((e: any) => {\n if (!e.isFlush) {\n const newValue = this.editorMonacoInstance!.getValue();\n this.value = newValue;\n redispatchEvent(\n this,\n new Event('change', { bubbles: true, composed: true }),\n );\n }\n });\n\n this.editorMonacoInstance.onMouseDown((e: any) => {\n if (!this.breakpointGutter) return;\n const type = e.target?.type;\n const { MouseTargetType } = monaco.editor;\n if (type !== MouseTargetType.GUTTER_GLYPH_MARGIN && type !== MouseTargetType.GUTTER_LINE_NUMBERS) return;\n const line = e.target.position?.lineNumber;\n if (!line) return;\n this.dispatchEvent(\n new CustomEvent('breakpoint-toggle', {\n detail: { line },\n bubbles: true,\n composed: true,\n }),\n );\n });\n\n this.editorMonacoInstance.onDidFocusEditorText(() => {\n this.hasFocus = true;\n });\n\n this.editorMonacoInstance.onDidBlurEditorText(() => {\n this.hasFocus = false;\n });\n }\n\n async setFocus() {\n this.editorMonacoInstance?.focus();\n }\n\n async setBlur() {\n this.editorMonacoInstance?.trigger(\n 'keyboard',\n 'type',\n '',\n ); /* Focus hack or use blur if available */\n }\n\n /** Scrolls `line` into view and puts the cursor at its start. */\n revealLine(line: number) {\n const editor = this.editorMonacoInstance;\n if (!editor) return;\n editor.revealLineInCenterIfOutsideViewport(line);\n editor.setPosition({ lineNumber: line, column: 1 });\n }\n\n // ── Private methods\n\n private libSourceChanged() {\n const typescript = this.monaco?.typescript;\n if (!typescript) return;\n const defaults = [typescript.typescriptDefaults, typescript.javascriptDefaults];\n for (const found of defaults) {\n found.setCompilerOptions({\n target: typescript.ScriptTarget.ESNext,\n module: typescript.ModuleKind.ESNext,\n moduleResolution: typescript.ModuleResolutionKind.NodeJs,\n allowNonTsExtensions: true,\n strict: true,\n noEmit: true,\n ...this.compilerOptions,\n });\n }\n this.__lib?.forEach(lib => lib.dispose());\n this.__lib = this.libSource\n ? defaults.map(found => found.addExtraLib(this.libSource!, `file:///wc-code-editor/${this.__id}/lib.d.ts`))\n : undefined;\n }\n\n private drawDecorations() {\n const monaco = this.monaco;\n if (!monaco || !this.__decorations) return;\n const range = (line: number) => new monaco.Range(line, 1, line, 1);\n const decorations: unknown[] = this.breakpoints.map(line => ({\n range: range(line),\n options: {\n glyphMarginClassName: 'wc-code-editor-breakpoint',\n glyphMarginHoverMessage: { value: locale.breakpoint },\n stickiness: 1,\n },\n }));\n if (this.currentLine) {\n decorations.push({\n range: range(this.currentLine),\n options: {\n isWholeLine: true,\n className: 'wc-code-editor-current-line',\n glyphMarginClassName: 'wc-code-editor-current-line-glyph',\n glyphMarginHoverMessage: { value: locale.currentLine },\n },\n });\n }\n this.__decorations.set(decorations);\n }\n\n private drawMarkers() {\n const monaco = this.monaco;\n const model = this.editorMonacoInstance?.getModel();\n if (!monaco || !model) return;\n const severity = {\n error: monaco.MarkerSeverity.Error,\n warning: monaco.MarkerSeverity.Warning,\n info: monaco.MarkerSeverity.Info,\n };\n monaco.editor.setModelMarkers(\n model,\n 'wc-code-editor',\n this.markers.map(marker => {\n const endLine = marker.endLine ?? marker.line;\n return {\n startLineNumber: marker.line,\n startColumn: marker.column ?? 1,\n endLineNumber: endLine,\n endColumn: marker.endColumn ?? model.getLineMaxColumn(Math.min(endLine, model.getLineCount())),\n message: marker.message,\n severity: severity[marker.severity ?? 'error'],\n };\n }),\n );\n }\n\n private getTheme() {\n return this._isDarkMode ? 'vs-dark' : 'vs';\n }\n\n private async __handleCopyClick() {\n const value = this.editorMonacoInstance?.getValue() ?? this.value ?? '';\n await copyToClipboard(value);\n this._copied = true;\n clearTimeout(this.__copiedTimer);\n this.__copiedTimer = setTimeout(() => {\n this._copied = false;\n }, 3000);\n this.dispatchEvent(\n new CustomEvent('copied', {\n detail: { value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ── Render helpers\n\n private renderToolbar() {\n const showBadge = this.showReadonlyBadge && (this.disabled || this.readonly);\n if (this.hideCopy && !showBadge) return nothing;\n\n return html`\n <div class=\"toolbar\">\n ${showBadge\n ? html`<wc-tag class=\"read-only-tag\" color=\"red\">${locale.readOnly}</wc-tag>`\n : nothing}\n ${this.hideCopy\n ? nothing\n : html`<wc-icon-button\n class=\"copy-button\"\n color=${this._copied ? 'success' : 'surface'}\n variant=\"text\"\n size=\"xs\"\n aria-label=${this._copied ? locale.copied : locale.copyToClipboard}\n tooltip=${this._copied ? locale.copied : locale.copyToClipboard}\n @click=${this.__handleCopyClick}\n >\n <wc-icon name=${this._copied ? 'check' : 'content_copy'}></wc-icon>\n </wc-icon-button>`}\n </div>\n `;\n }\n\n // ── Render\n\n render() {\n if (this.fill) {\n // A pane of its own, such as an IDE's: no field outline, as tall as its container.\n return html`\n <div class=\"code-editor-component fill\">\n ${this.renderToolbar()}\n <div class=\"editor\"></div>\n ${!this.editorMonacoInstance\n ? html`<div class=\"code-editor-loader\"><wc-spinner></wc-spinner> Loading...</div>`\n : nothing}\n </div>\n `;\n }\n // The field isn't marked read-only: its read-only look dims the\n // container, and a read-only editor is still meant to be read.\n return html`\n <wc-field\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?skeleton=${this.skeleton}\n ?focused=${this.hasFocus}\n .host=${this}\n class=\"${classMap({\n 'code-editor-component': true,\n disabled: this.disabled,\n })}\"\n >\n ${this.renderToolbar()}\n <div class=\"editor\"></div>\n ${!this.editorMonacoInstance\n ? html`\n <div class=\"code-editor-loader\">\n <wc-spinner></wc-spinner> Loading...\n </div>\n `\n : nothing}\n </wc-field>\n `;\n }\n}\n"],"names":["styles","nothing","html","classMap","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,EAAA,UAAU,CA8Z9B;yBA9ZoB,UAAU;;;;"}
1
+ {"version":3,"file":"code-editor.js","sources":["../../src/code-editor/editor-theme.ts","../../src/code-editor/code-editor.ts"],"sourcesContent":["import { tokenColor } from '../code-highlighter/token-colors.js';\n\n/**\n * The colors the editor theme is built from: Peacock color roles, plus the syntax colors\n * wc-code-highlighter uses, so the two show code alike. Monaco takes hex colors only, so these\n * are resolved on the page and converted.\n */\nexport const PALETTE_SOURCES = {\n surface: 'var(--color-surface)',\n surfaceContainerHigh: 'var(--color-surface-container-high)',\n surfaceContainerHighest: 'var(--color-surface-container-highest)',\n onSurface: 'var(--color-on-surface)',\n onSurfaceVariant: 'var(--color-on-surface-variant)',\n outline: 'var(--color-outline)',\n outlineVariant: 'var(--color-outline-variant)',\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n secondaryContainer: 'var(--color-secondary-container)',\n onSecondaryContainer: 'var(--color-on-secondary-container)',\n error: 'var(--color-error)',\n warning: 'var(--color-warning)',\n info: 'var(--color-blue)',\n foreground: tokenColor('foreground'),\n keyword: tokenColor('token-keyword'),\n string: tokenColor('token-string'),\n func: tokenColor('token-function'),\n constant: tokenColor('token-constant'),\n comment: tokenColor('token-comment'),\n punctuation: tokenColor('token-punctuation'),\n parameter: tokenColor('token-parameter'),\n link: tokenColor('token-link'),\n} as const;\n\nexport type EditorPalette = Record<keyof typeof PALETTE_SOURCES, string>;\n\n/** Monaco's standalone theme data, as `monaco.editor.defineTheme` takes it. */\nexport type EditorThemeData = {\n base: 'vs' | 'vs-dark';\n inherit: boolean;\n rules: { token: string; foreground?: string; fontStyle?: string }[];\n colors: Record<string, string>;\n};\n\nlet context: CanvasRenderingContext2D | null | undefined;\n\n/**\n * Converts any CSS color the browser understands (`rgb()`, `oklch()`, `color()`, …) to\n * `#rrggbb`, or `#rrggbbaa` when it is not opaque, by painting one pixel.\n */\nexport function cssColorToHex(color: string): string {\n context ??= document\n .createElement('canvas')\n .getContext('2d', { willReadFrequently: true });\n if (!context) return '#000000';\n context.clearRect(0, 0, 1, 1);\n context.fillStyle = '#000000';\n context.fillStyle = color;\n context.fillRect(0, 0, 1, 1);\n const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data;\n const hex = [r, g, b, ...(a < 255 ? [a] : [])]\n .map(value => value.toString(16).padStart(2, '0'))\n .join('');\n return `#${hex}`;\n}\n\n/**\n * Resolves the palette where `probe` sits, so it follows the theme around the editor:\n * `data-theme`, the system color scheme, or a custom theme.\n */\nexport function resolvePalette(probe: HTMLElement): EditorPalette {\n const palette = {} as EditorPalette;\n for (const [key, value] of Object.entries(PALETTE_SOURCES)) {\n // eslint-disable-next-line no-param-reassign\n probe.style.color = value;\n palette[key as keyof EditorPalette] = cssColorToHex(\n getComputedStyle(probe).color,\n );\n }\n // eslint-disable-next-line no-param-reassign\n probe.style.color = '';\n return palette;\n}\n\n/** `#rrggbb` with an alpha from 0 to 1. */\nfunction alpha(hex: string, opacity: number): string {\n const value = Math.round(Math.min(1, Math.max(0, opacity)) * 255);\n return `${hex.slice(0, 7)}${value.toString(16).padStart(2, '0')}`;\n}\n\n/** Whether a `#rrggbb` color is dark, by relative luminance. */\nexport function isDark(hex: string): boolean {\n const [r, g, b] = [1, 3, 5].map(index => {\n const channel = parseInt(hex.slice(index, index + 2), 16) / 255;\n return channel <= 0.04045\n ? channel / 12.92\n : ((channel + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b < 0.18;\n}\n\n/** Monaco rules take colors without the `#`. */\nconst bare = (hex: string) => hex.slice(1, 7);\n\n/**\n * Builds the editor theme from a palette. The editor background is transparent, so the frame\n * around it shows through; widgets such as suggestions and hovers sit on surface containers.\n */\nexport function buildEditorTheme(p: EditorPalette): EditorThemeData {\n return {\n base: isDark(p.surface) ? 'vs-dark' : 'vs',\n // Not inherited: Monaco's own rules are more specific than these (`string.value.json`,\n // `keyword.flow`, …) and would keep its stock colors.\n inherit: false,\n rules: [\n { token: '', foreground: bare(p.foreground) },\n { token: 'comment', foreground: bare(p.comment), fontStyle: 'italic' },\n { token: 'keyword', foreground: bare(p.keyword) },\n { token: 'string', foreground: bare(p.string) },\n { token: 'string.escape', foreground: bare(p.constant) },\n { token: 'string.key.json', foreground: bare(p.keyword) },\n { token: 'string.link', foreground: bare(p.link) },\n { token: 'number', foreground: bare(p.constant) },\n { token: 'constant', foreground: bare(p.constant) },\n { token: 'regexp', foreground: bare(p.string) },\n { token: 'type', foreground: bare(p.func) },\n { token: 'identifier', foreground: bare(p.foreground) },\n { token: 'variable', foreground: bare(p.parameter) },\n { token: 'predefined', foreground: bare(p.func) },\n { token: 'annotation', foreground: bare(p.func) },\n { token: 'delimiter', foreground: bare(p.punctuation) },\n { token: 'operator', foreground: bare(p.punctuation) },\n { token: 'tag', foreground: bare(p.string) },\n { token: 'metatag', foreground: bare(p.keyword) },\n { token: 'attribute.name', foreground: bare(p.func) },\n { token: 'attribute.value', foreground: bare(p.string) },\n { token: 'tag.css', foreground: bare(p.func) },\n { token: 'attribute.name.css', foreground: bare(p.constant) },\n { token: 'attribute.value.css', foreground: bare(p.foreground) },\n { token: 'attribute.value.number.css', foreground: bare(p.constant) },\n { token: 'attribute.value.unit.css', foreground: bare(p.constant) },\n { token: 'attribute.value.hex.css', foreground: bare(p.constant) },\n { token: 'strong', fontStyle: 'bold' },\n { token: 'emphasis', fontStyle: 'italic' },\n { token: 'keyword.json', foreground: bare(p.constant) },\n { token: 'invalid', foreground: bare(p.error) },\n ],\n colors: {\n foreground: p.onSurface,\n focusBorder: p.primary,\n 'editor.background': '#00000000',\n 'editor.foreground': p.foreground,\n 'editorGutter.background': '#00000000',\n 'editorLineNumber.foreground': p.onSurfaceVariant,\n 'editorLineNumber.activeForeground': p.onSurface,\n 'editor.lineHighlightBackground': alpha(p.onSurface, 0.05),\n 'editor.lineHighlightBorder': '#00000000',\n 'editorCursor.foreground': p.primary,\n 'editor.selectionBackground': alpha(p.primary, 0.24),\n 'editor.inactiveSelectionBackground': alpha(p.primary, 0.12),\n 'editor.selectionHighlightBackground': alpha(p.primary, 0.12),\n 'editor.wordHighlightBackground': alpha(p.primary, 0.1),\n 'editor.wordHighlightStrongBackground': alpha(p.primary, 0.16),\n 'editor.findMatchBackground': alpha(p.warning, 0.4),\n 'editor.findMatchHighlightBackground': alpha(p.warning, 0.2),\n 'editorBracketMatch.background': alpha(p.primary, 0.12),\n 'editorBracketMatch.border': alpha(p.primary, 0.5),\n 'editorIndentGuide.background1': alpha(p.outlineVariant, 0.6),\n 'editorIndentGuide.activeBackground1': p.outline,\n 'editorWhitespace.foreground': p.outlineVariant,\n 'editorError.foreground': p.error,\n 'editorWarning.foreground': p.warning,\n 'editorInfo.foreground': p.info,\n 'editorOverviewRuler.border': '#00000000',\n 'editorOverviewRuler.errorForeground': p.error,\n 'editorOverviewRuler.warningForeground': p.warning,\n 'editorWidget.background': p.surfaceContainerHigh,\n 'editorWidget.foreground': p.onSurface,\n 'editorWidget.border': p.outlineVariant,\n 'editorSuggestWidget.background': p.surfaceContainerHigh,\n 'editorSuggestWidget.border': p.outlineVariant,\n 'editorSuggestWidget.foreground': p.onSurface,\n 'editorSuggestWidget.highlightForeground': p.primary,\n 'editorSuggestWidget.selectedBackground': p.secondaryContainer,\n 'editorSuggestWidget.selectedForeground': p.onSecondaryContainer,\n 'editorHoverWidget.background': p.surfaceContainerHigh,\n 'editorHoverWidget.foreground': p.onSurface,\n 'editorHoverWidget.border': p.outlineVariant,\n 'input.background': p.surfaceContainerHighest,\n 'input.foreground': p.onSurface,\n 'input.border': p.outlineVariant,\n 'inputOption.activeBorder': p.primary,\n 'list.hoverBackground': alpha(p.onSurface, 0.08),\n 'list.activeSelectionBackground': p.secondaryContainer,\n 'list.activeSelectionForeground': p.onSecondaryContainer,\n 'list.highlightForeground': p.primary,\n 'scrollbar.shadow': '#00000000',\n 'scrollbarSlider.background': alpha(p.onSurface, 0.16),\n 'scrollbarSlider.hoverBackground': alpha(p.onSurface, 0.28),\n 'scrollbarSlider.activeBackground': alpha(p.onSurface, 0.38),\n 'minimap.background': '#00000000',\n 'widget.shadow': alpha('#000000', 0.2),\n // Bracket pairs cycle through the theme's accent roles.\n 'editorBracketHighlight.foreground1': p.primary,\n 'editorBracketHighlight.foreground2': p.tertiary,\n 'editorBracketHighlight.foreground3': p.secondary,\n 'editorBracketHighlight.foreground4': p.primary,\n 'editorBracketHighlight.foreground5': p.tertiary,\n 'editorBracketHighlight.foreground6': p.secondary,\n 'editorBracketHighlight.unexpectedBracket.foreground': p.error,\n },\n };\n}\n","import { type CSSResult, html, nothing, PropertyValues } from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport BaseInput from '../input/BaseInput.js';\nimport { observeThemeChange } from '../__internal/utils/observe-theme-change.js';\nimport { redispatchEvent } from '../__internal/utils/dispatch-event-utils.js';\nimport { copyToClipboard } from '../__internal/utils/copy-to-clipboard.js';\nimport { buildEditorTheme, resolvePalette } from './editor-theme.js';\n\nimport styles from './code-editor.scss';\n\nexport type CodeEditorLanguage =\n | 'javascript'\n | 'typescript'\n | 'json'\n | 'html'\n | 'css'\n | 'scss'\n | 'markdown';\n\nexport type CodeEditorSize = 'sm' | 'md';\n\n/** A problem shown in the editor: a squiggle under the text and a mark in the scroll bar. Lines and columns count from 1. */\nexport type CodeEditorMarker = {\n line: number;\n column?: number;\n endLine?: number;\n endColumn?: number;\n message: string;\n severity?: 'error' | 'warning' | 'info';\n};\n\ntype Monaco = typeof import('./monaco.js');\n\nconst locale = {\n copied: 'Copied',\n copyToClipboard: 'Copy to clipboard',\n copiedCode: 'Copied code to clipboard',\n readOnly: 'Read only',\n wrapLines: 'Wrap lines',\n unwrapLines: 'Turn off line wrap',\n editorLabel: 'Code editor',\n breakpoint: 'Breakpoint',\n currentLine: 'Paused here',\n};\n\nconst EXTENSIONS: Record<CodeEditorLanguage, string> = {\n javascript: 'js',\n typescript: 'ts',\n json: 'json',\n html: 'html',\n css: 'css',\n scss: 'scss',\n markdown: 'md',\n};\n\n/** Monaco has one theme per page; every editor defines it from the tokens around it. */\nconst THEME_NAME = 'peacock';\n\n/** How long the copy button shows its check. */\nconst COPY_FEEDBACK_DURATION = 2000;\n\n/** Where the language workers are: `monaco/` beside the built component. */\nconst WORKERS = new URL('./monaco/', import.meta.url);\n\nlet loading: Promise<Monaco> | undefined;\nlet instances = 0;\n\n/** The worker file for a Monaco language service label. */\nfunction workerFile(label: string): string {\n if (label === 'typescript' || label === 'javascript') return 'ts.worker.js';\n if (label === 'json') return 'json.worker.js';\n return 'editor.worker.js';\n}\n\n/** The next editor's model number. */\nfunction nextInstanceId(): number {\n instances += 1;\n return instances;\n}\n\n/**\n * Loads Monaco once per page: its workers come from this origin, and the icon font is declared in\n * the document, since a shadow root ignores `@font-face`.\n */\nfunction loadMonaco(): Promise<Monaco> {\n loading ??= (async () => {\n Reflect.set(window, 'MonacoEnvironment', {\n getWorker(_id: string, label: string) {\n return new Worker(new URL(workerFile(label), WORKERS), {\n type: 'module',\n });\n },\n });\n const font = (styles as CSSResult).cssText.match(\n /@font-face\\s*\\{[^}]*font-family:\\s*codicon[^}]*\\}/,\n );\n if (font && !document.getElementById('wc-code-editor-codicon')) {\n const [declaration] = font;\n const style = document.createElement('style');\n style.id = 'wc-code-editor-codicon';\n style.textContent = declaration;\n document.head.append(style);\n }\n return import('./monaco.js');\n })();\n return loading;\n}\n\n/**\n * @label Code Editor\n * @tag wc-code-editor\n * @rawTag code-editor\n *\n * @summary A Monaco-based code editing component with syntax highlighting, completions and debugging marks.\n * @overview\n * - CodeEditor wraps Monaco Editor as a web component, in the same frame as `wc-code-highlighter`: an optional header with a title and actions, or a copy button that floats at the top end. Monaco is bundled with Peacock and loaded when the first editor appears; nothing comes from a CDN, so it works under a content security policy that allows only its own origin. The code shows as plain text until Monaco is ready.\n * - Its colors come from the theme's color roles and the code highlighter's syntax colors, so light, dark, the system color scheme and custom themes all follow the tokens.\n * - Supports TypeScript, JavaScript, JSON, HTML, CSS, SCSS and Markdown, with completions and errors for TypeScript, JavaScript and JSON; read-only mode, line numbers, line wrapping and a minimap.\n * - `lib-source` adds TypeScript declarations for completions, such as the modules a script may import.\n * - With `breakpoint-gutter`, a click in the gutter fires `breakpoint-toggle`; `breakpoints` and `current-line` draw the marks a debugger shows.\n * - `markers` underline problems, such as where a run failed.\n * - With `fill`, the editor drops its frame and takes the height of its container, as a pane of its own.\n * - Emits `change` when content is edited and updates value from property changes.\n *\n * @slot title - Header title content. Overrides `label` and shows the header.\n * @slot icon - Icon shown before the title in the header.\n * @slot actions - Extra action buttons, shown in the header or floating at the top end.\n *\n * @csspart container - The outer frame.\n * @csspart header - The header row.\n * @csspart title - The header title.\n * @csspart actions - The action buttons group.\n * @csspart editor - The area Monaco renders into.\n *\n * @cssprop --code-editor-height - Height of the editing area. Defaults to 300px. Ignored with `fill`.\n * @cssprop --code-editor-background - Frame background. Defaults to `--color-surface-container-low`.\n * @cssprop --code-editor-border-color - Frame border color. Defaults to `--color-outline-variant`.\n * @cssprop --code-editor-shape - Frame corner radius. Defaults to `--shape-corner-medium`.\n * @cssprop --code-highlighter-token-keyword - Keyword color, shared with `wc-code-highlighter`, like the other `--code-highlighter-token-*` colors.\n *\n * @fires {Event} change - Dispatched when the user edits the content.\n * @fires {CustomEvent<{value: string}>} copied - Dispatched after the copy button copies the content.\n * @fires {CustomEvent<{line: number}>} breakpoint-toggle - Dispatched when the gutter of a line is clicked, with `breakpoint-gutter` set. The component does not change `breakpoints` itself.\n *\n * @example\n * ```html\n * <wc-code-editor\n * language=\"css\"\n * label=\"theme.css\"\n * readonly\n * style=\"width: 100%; --code-editor-height: 10rem;\"\n * value=\":root { --color-primary: #6341d5; }\">\n * </wc-code-editor>\n * ```\n * @tags input, editor\n */\n@IndividualComponent\nexport default class CodeEditor extends BaseInput {\n // ── Static\n\n static styles = [styles];\n\n // ── Properties\n\n // `name` (for form use) comes from BaseInput's form association.\n\n /** The code shown in the editor. Updated as the user types. */\n @property({ type: String })\n value = '';\n\n /** Language used for syntax highlighting. Can be changed after the editor loads. */\n @property({ type: String })\n language: CodeEditorLanguage = 'javascript';\n\n /** Header title, such as a file name. Shows the header. */\n @property({ type: String })\n label = '';\n\n /** TypeScript declarations (a `.d.ts`) for completions in TypeScript and JavaScript, such as the modules the code may import. */\n @property({ type: String, attribute: 'lib-source' })\n libSource: string | undefined;\n\n /** Compiler options for TypeScript and JavaScript, over the editor's defaults (target and modules ESNext, strict), such as `{ lib: ['es2022'] }`. */\n @property({ type: Object, attribute: false })\n compilerOptions: Record<string, unknown> | undefined;\n\n /** Whether line numbers show in the gutter. */\n @property({ type: String, attribute: 'line-numbers' })\n lineNumbers: 'off' | 'on' = 'on';\n\n /** Wraps long lines instead of scrolling horizontally. */\n @property({ type: Boolean, reflect: true })\n wrap = false;\n\n /** Shows a button that turns line wrapping on and off. */\n @property({ type: Boolean, attribute: 'wrap-toggle' })\n wrapToggle = false;\n\n /** Shows the minimap. Leave the attribute out to hide it. */\n @property({ type: Boolean })\n minimap = false;\n\n /** Size of the editor. `sm` uses smaller text and padding. */\n @property({ type: String, reflect: true })\n size: CodeEditorSize = 'md';\n\n /** Hides the copy button. */\n @property({ type: Boolean, attribute: 'hide-copy' })\n hideCopy = false;\n\n /** Shows a \"Read only\" badge while the editor is read-only or disabled. */\n @property({ type: Boolean, attribute: 'show-readonly-badge' })\n showReadonlyBadge = false;\n\n /** Shows a gutter for breakpoints; a click there, or on a line number, fires `breakpoint-toggle`. */\n @property({ type: Boolean, attribute: 'breakpoint-gutter' })\n breakpointGutter = false;\n\n /** The lines with a breakpoint, from 1. */\n @property({ type: Array, attribute: false })\n breakpoints: number[] = [];\n\n /** The line a debugger is paused at, marked and scrolled into view; none when unset. */\n @property({ type: Number, attribute: 'current-line' })\n currentLine: number | undefined;\n\n /** Problems to underline, such as where a run failed. */\n @property({ type: Array, attribute: false })\n markers: CodeEditorMarker[] = [];\n\n /** Drops the frame and takes the height of the container instead of `--code-editor-height`. */\n @property({ type: Boolean, reflect: true })\n fill = false;\n\n /** Whether the editor text has focus. */\n @state() private hasFocus = false;\n\n /** Whether the copy button was just used; shows a check for a moment. */\n @state() private _copied = false;\n\n /** The Monaco editor instance, once loaded. */\n @state() private editorMonacoInstance?: any;\n\n // ── Queries\n\n @query('.editor') private editorElement?: HTMLElement;\n\n @query('.probe') private probeElement?: HTMLElement;\n\n // ── Private fields\n\n /** The Monaco API, once loaded. */\n monaco: Monaco | undefined;\n\n /** This editor's model's address, unique on the page so two editors never share a model. */\n private readonly __id = nextInstanceId();\n\n /** Stops listening for theme changes. */\n private __unobserveTheme?: () => void;\n\n /** The system color scheme, watched so the editor follows it. */\n private __colorScheme?: MediaQueryList;\n\n /** Re-renders when slotted header content is added or removed. */\n private __childObserver?: MutationObserver;\n\n /** Resets the copied state of the copy button. */\n private __copiedTimer?: ReturnType<typeof setTimeout>;\n\n /** The declarations added for `libSource`. */\n private __lib?: { dispose(): void }[];\n\n /** The breakpoint and current-line marks. */\n private __decorations?: { set(decorations: unknown[]): void; clear(): void };\n\n /** The font and padding last given to Monaco, to skip unchanged updates. */\n private __layoutKey = '';\n\n // ── Lifecycle\n\n connectedCallback() {\n super.connectedCallback();\n this.__unobserveTheme = observeThemeChange(this.__applyTheme);\n this.__colorScheme = window.matchMedia?.('(prefers-color-scheme: dark)');\n this.__colorScheme?.addEventListener('change', this.__applyTheme);\n this.__childObserver = new MutationObserver(() => this.requestUpdate());\n this.__childObserver.observe(this, {\n childList: true,\n attributes: true,\n attributeFilter: ['slot'],\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__unobserveTheme?.();\n this.__colorScheme?.removeEventListener('change', this.__applyTheme);\n this.__childObserver?.disconnect();\n clearTimeout(this.__copiedTimer);\n this.__lib?.forEach(lib => lib.dispose());\n this.__lib = undefined;\n const model = this.editorMonacoInstance?.getModel();\n this.editorMonacoInstance?.dispose();\n model?.dispose();\n this.editorMonacoInstance = undefined;\n }\n\n protected firstUpdated() {\n this.initializeMonaco();\n }\n\n protected updated(changedProperties: PropertyValues<this>) {\n if (\n changedProperties.has('libSource') ||\n changedProperties.has('compilerOptions')\n )\n this.libSourceChanged();\n\n const editor = this.editorMonacoInstance;\n if (!editor || !this.monaco) return;\n\n if (\n changedProperties.has('disabled') ||\n changedProperties.has('readonly')\n ) {\n editor.updateOptions({ readOnly: this.disabled || this.readonly });\n }\n\n if (\n changedProperties.has('lineNumbers') ||\n changedProperties.has('minimap') ||\n changedProperties.has('breakpointGutter') ||\n changedProperties.has('wrap') ||\n changedProperties.has('label')\n ) {\n editor.updateOptions({\n lineNumbers: this.lineNumbers,\n minimap: { enabled: this.minimap },\n glyphMargin: this.breakpointGutter,\n wordWrap: this.wrap ? 'on' : 'off',\n ariaLabel: this.label || locale.editorLabel,\n });\n }\n\n // The header and size set the font and padding; read them back from the styles.\n this.__applyLayout();\n\n if (changedProperties.has('language')) {\n this.monaco.editor.setModelLanguage(editor.getModel(), this.language);\n }\n\n if (changedProperties.has('value') && editor.getValue() !== this.value) {\n editor.setValue(this.value || '');\n }\n\n if (\n changedProperties.has('breakpoints') ||\n changedProperties.has('currentLine')\n ) {\n this.drawDecorations();\n }\n if (changedProperties.has('currentLine') && this.currentLine) {\n editor.revealLineInCenterIfOutsideViewport(this.currentLine);\n }\n\n if (changedProperties.has('markers')) this.drawMarkers();\n }\n\n // ── Public methods\n\n async initializeMonaco() {\n const monaco = await loadMonaco();\n // Disconnected while Monaco loaded: nothing to put it in.\n if (!this.isConnected || !this.editorElement) return;\n this.monaco = monaco;\n this.__applyTheme();\n\n const model = monaco.editor.createModel(\n this.value,\n this.language,\n monaco.Uri.parse(\n `file:///wc-code-editor/${this.__id}/index.${EXTENSIONS[this.language] ?? 'txt'}`,\n ),\n );\n const layout = this.__readLayout();\n this.__layoutKey = JSON.stringify(layout);\n this.editorMonacoInstance = monaco.editor.create(this.editorElement, {\n model,\n ...layout,\n lineNumbers: this.lineNumbers,\n minimap: { enabled: this.minimap },\n glyphMargin: this.breakpointGutter,\n wordWrap: this.wrap ? 'on' : 'off',\n theme: THEME_NAME,\n readOnly: this.disabled || this.readonly,\n ariaLabel: this.label || locale.editorLabel,\n automaticLayout: true,\n fixedOverflowWidgets: true,\n scrollBeyondLastLine: false,\n lineNumbersMinChars: 3,\n lineDecorationsWidth: 8,\n renderLineHighlight: 'line',\n renderLineHighlightOnlyWhenFocus: true,\n overviewRulerBorder: false,\n hideCursorInOverviewRuler: true,\n stickyScroll: { enabled: false },\n scrollbar: {\n useShadows: false,\n verticalScrollbarSize: 10,\n horizontalScrollbarSize: 10,\n },\n });\n this.__decorations = this.editorMonacoInstance.createDecorationsCollection(\n [],\n );\n\n // Monaco measures the font when it starts; measure again once web fonts have loaded.\n document.fonts?.ready.then(() => this.monaco?.editor.remeasureFonts());\n\n this.libSourceChanged();\n this.drawDecorations();\n this.drawMarkers();\n\n this.editorMonacoInstance.onDidChangeModelContent((e: any) => {\n if (!e.isFlush) {\n const newValue = this.editorMonacoInstance!.getValue();\n this.value = newValue;\n redispatchEvent(\n this,\n new Event('change', { bubbles: true, composed: true }),\n );\n }\n });\n\n this.editorMonacoInstance.onMouseDown((e: any) => {\n if (!this.breakpointGutter) return;\n const type = e.target?.type;\n const { MouseTargetType } = monaco.editor;\n if (\n type !== MouseTargetType.GUTTER_GLYPH_MARGIN &&\n type !== MouseTargetType.GUTTER_LINE_NUMBERS\n )\n return;\n const line = e.target.position?.lineNumber;\n if (!line) return;\n this.dispatchEvent(\n new CustomEvent('breakpoint-toggle', {\n detail: { line },\n bubbles: true,\n composed: true,\n }),\n );\n });\n\n this.editorMonacoInstance.onDidFocusEditorText(() => {\n this.hasFocus = true;\n });\n\n this.editorMonacoInstance.onDidBlurEditorText(() => {\n this.hasFocus = false;\n });\n }\n\n async setFocus() {\n this.editorMonacoInstance?.focus();\n }\n\n async setBlur() {\n this.editorMonacoInstance?.trigger(\n 'keyboard',\n 'type',\n '',\n ); /* Focus hack or use blur if available */\n }\n\n /** Scrolls `line` into view and puts the cursor at its start. */\n revealLine(line: number) {\n const editor = this.editorMonacoInstance;\n if (!editor) return;\n editor.revealLineInCenterIfOutsideViewport(line);\n editor.setPosition({ lineNumber: line, column: 1 });\n }\n\n // ── Private methods\n\n /** Defines the page's editor theme from the tokens around this editor. */\n private __applyTheme = () => {\n const { monaco, probeElement } = this;\n if (!monaco || !probeElement) return;\n monaco.editor.defineTheme(\n THEME_NAME,\n buildEditorTheme(resolvePalette(probeElement)),\n );\n monaco.editor.setTheme(THEME_NAME);\n };\n\n /** The font and padding the styles give the code, for Monaco's options. */\n private __readLayout() {\n const probe = this.probeElement;\n if (!probe) return {};\n const style = getComputedStyle(probe);\n const fontSize = parseFloat(style.fontSize) || 14;\n return {\n fontFamily: style.fontFamily,\n fontSize,\n lineHeight: parseFloat(style.lineHeight) || Math.round(fontSize * 1.43),\n padding: {\n top: parseFloat(style.paddingTop) || 0,\n bottom: parseFloat(style.paddingBottom) || 0,\n },\n };\n }\n\n /** Gives Monaco the font and padding when the header or size changed them. */\n private __applyLayout() {\n const layout = this.__readLayout();\n const key = JSON.stringify(layout);\n if (key === this.__layoutKey) return;\n this.__layoutKey = key;\n this.editorMonacoInstance?.updateOptions(layout);\n }\n\n /** Whether light-DOM children are assigned to the named slot. */\n private __hasSlotted(name: string): boolean {\n return Array.from(this.children).some(\n child => child.getAttribute('slot') === name,\n );\n }\n\n private libSourceChanged() {\n const typescript = this.monaco?.typescript;\n if (!typescript) return;\n const defaults = [\n typescript.typescriptDefaults,\n typescript.javascriptDefaults,\n ];\n for (const found of defaults) {\n found.setCompilerOptions({\n target: typescript.ScriptTarget.ESNext,\n module: typescript.ModuleKind.ESNext,\n moduleResolution: typescript.ModuleResolutionKind.NodeJs,\n allowNonTsExtensions: true,\n strict: true,\n noEmit: true,\n ...this.compilerOptions,\n });\n }\n this.__lib?.forEach(lib => lib.dispose());\n this.__lib = this.libSource\n ? defaults.map(found =>\n found.addExtraLib(\n this.libSource!,\n `file:///wc-code-editor/${this.__id}/lib.d.ts`,\n ),\n )\n : undefined;\n }\n\n private drawDecorations() {\n const { monaco } = this;\n if (!monaco || !this.__decorations) return;\n const range = (line: number) => new monaco.Range(line, 1, line, 1);\n const decorations: unknown[] = this.breakpoints.map(line => ({\n range: range(line),\n options: {\n glyphMarginClassName: 'wc-code-editor-breakpoint',\n glyphMarginHoverMessage: { value: locale.breakpoint },\n stickiness: 1,\n },\n }));\n if (this.currentLine) {\n decorations.push({\n range: range(this.currentLine),\n options: {\n isWholeLine: true,\n className: 'wc-code-editor-current-line',\n glyphMarginClassName: 'wc-code-editor-current-line-glyph',\n glyphMarginHoverMessage: { value: locale.currentLine },\n },\n });\n }\n this.__decorations.set(decorations);\n }\n\n private drawMarkers() {\n const { monaco } = this;\n const model = this.editorMonacoInstance?.getModel();\n if (!monaco || !model) return;\n const severity = {\n error: monaco.MarkerSeverity.Error,\n warning: monaco.MarkerSeverity.Warning,\n info: monaco.MarkerSeverity.Info,\n };\n monaco.editor.setModelMarkers(\n model,\n 'wc-code-editor',\n this.markers.map(marker => {\n const endLine = marker.endLine ?? marker.line;\n return {\n startLineNumber: marker.line,\n startColumn: marker.column ?? 1,\n endLineNumber: endLine,\n endColumn:\n marker.endColumn ??\n model.getLineMaxColumn(Math.min(endLine, model.getLineCount())),\n message: marker.message,\n severity: severity[marker.severity ?? 'error'],\n };\n }),\n );\n }\n\n private async __handleCopyClick() {\n const value = this.editorMonacoInstance?.getValue() ?? this.value ?? '';\n await copyToClipboard(value);\n this._copied = true;\n clearTimeout(this.__copiedTimer);\n this.__copiedTimer = setTimeout(() => {\n this._copied = false;\n }, COPY_FEEDBACK_DURATION);\n this.dispatchEvent(\n new CustomEvent('copied', {\n detail: { value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private __handleWrapClick() {\n this.wrap = !this.wrap;\n }\n\n // ── Render helpers\n\n private renderBadge() {\n return html`<span class=\"read-only-badge\">\n <wc-icon name=\"lock\"></wc-icon>${locale.readOnly}\n </span>`;\n }\n\n private renderActions(floating: boolean, showBadge: boolean) {\n return html`\n <div\n class=${classMap({\n actions: true,\n floating,\n pinned: floating && showBadge,\n })}\n part=\"actions\"\n >\n ${showBadge ? this.renderBadge() : nothing}\n <slot name=\"actions\"></slot>\n ${this.wrapToggle\n ? html`<wc-icon-button\n class=\"wrap-button\"\n variant=\"text\"\n size=\"xs\"\n shape=\"round\"\n color=\"surface\"\n toggle\n ?selected=${this.wrap}\n aria-label=${this.wrap ? locale.unwrapLines : locale.wrapLines}\n tooltip=${this.wrap ? locale.unwrapLines : locale.wrapLines}\n @click=${this.__handleWrapClick}\n >\n <wc-icon name=\"wrap_text\"></wc-icon>\n </wc-icon-button>`\n : nothing}\n ${this.hideCopy\n ? nothing\n : html`<wc-icon-button\n class=\"copy-button\"\n variant=\"text\"\n size=\"xs\"\n shape=\"round\"\n color=${this._copied ? 'success' : 'surface'}\n aria-label=${this._copied\n ? locale.copied\n : locale.copyToClipboard}\n tooltip=${this._copied ? locale.copied : locale.copyToClipboard}\n @click=${this.__handleCopyClick}\n >\n <wc-icon\n name=${this._copied ? 'check' : 'content_copy'}\n ></wc-icon>\n </wc-icon-button>`}\n </div>\n `;\n }\n\n private renderHeader(showBadge: boolean) {\n return html`\n <div class=\"header\" part=\"header\">\n <slot name=\"icon\"></slot>\n <div class=\"title\" part=\"title\">\n <slot name=\"title\">${this.label}</slot>\n </div>\n ${this.renderActions(false, showBadge)}\n </div>\n `;\n }\n\n // ── Render\n\n render() {\n const hasHeader = !!this.label || this.__hasSlotted('title');\n const showBadge =\n this.showReadonlyBadge && (this.disabled || this.readonly);\n const hasActions =\n !this.hideCopy ||\n this.wrapToggle ||\n showBadge ||\n this.__hasSlotted('actions');\n const loaded = !!this.editorMonacoInstance;\n\n // A read-only editor keeps full contrast: it is still meant to be read.\n return html`\n <div\n class=${classMap({\n 'code-block': true,\n 'has-header': hasHeader,\n focused: this.hasFocus,\n disabled: this.disabled,\n numbered: this.lineNumbers !== 'off',\n 'breakpoint-gutter': this.breakpointGutter,\n })}\n part=\"container\"\n >\n ${hasHeader ? this.renderHeader(showBadge) : nothing}\n ${!hasHeader && hasActions\n ? this.renderActions(true, showBadge)\n : nothing}\n <div class=\"editor-area\">\n <div class=\"editor\" part=\"editor\"></div>\n ${loaded\n ? nothing\n : html`<pre class=\"placeholder\" aria-hidden=\"true\">\n${this.value}</pre\n >`}\n ${this.skeleton\n ? html`<wc-skeleton class=\"skeleton\" visible></wc-skeleton>`\n : nothing}\n </div>\n <span class=\"probe\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\" aria-live=\"polite\"\n >${this._copied ? locale.copiedCode : ''}</span\n >\n </div>\n `;\n }\n}\n"],"names":["styles","html","classMap","nothing","property","state","query"],"mappings":";;;;;;;;;;;;;;AAEA;;;;AAIG;AACI,MAAM,eAAe,GAAG;AAC7B,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,oBAAoB,EAAE,qCAAqC;AAC3D,IAAA,uBAAuB,EAAE,wCAAwC;AACjE,IAAA,SAAS,EAAE,yBAAyB;AACpC,IAAA,gBAAgB,EAAE,iCAAiC;AACnD,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,cAAc,EAAE,8BAA8B;AAC9C,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,SAAS,EAAE,wBAAwB;AACnC,IAAA,QAAQ,EAAE,uBAAuB;AACjC,IAAA,kBAAkB,EAAE,kCAAkC;AACtD,IAAA,oBAAoB,EAAE,qCAAqC;AAC3D,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC;AACpC,IAAA,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC;AACpC,IAAA,MAAM,EAAE,UAAU,CAAC,cAAc,CAAC;A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,CAAK;AAAsC,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,MAAA,CAAA;AAIlB,UAAA,CAAA;IAAzBC,CAAK,CAAC,SAAS;AAAsC,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAE7B,UAAA,CAAA;IAAxBA,CAAK,CAAC,QAAQ;AAAqC,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AA1FjC,UAAU,GAAA,UAAA,CAAA;IAD9B;AACoB,CAAA,EAAA,UAAU,CAmlB9B;yBAnlBoB,UAAU;;;;"}
@@ -0,0 +1,188 @@
1
+ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-Bdwyrvd6.js';
2
+ import { n } from './property-B49QQ8pS.js';
3
+ import { r } from './state-DkTK9EGF.js';
4
+
5
+ var css_248z = i`* {
6
+ box-sizing: border-box;
7
+ -webkit-tap-highlight-color: transparent;
8
+ }
9
+
10
+ .screen-reader-only {
11
+ display: none !important;
12
+ }
13
+
14
+ [hidden] {
15
+ display: none !important;
16
+ }
17
+
18
+ :host {
19
+ display: block;
20
+ min-width: 0;
21
+ }
22
+
23
+ .code-group {
24
+ display: flex;
25
+ flex-direction: column;
26
+ min-width: 0;
27
+ overflow: hidden;
28
+ background: var(--code-highlighter-background, var(--color-surface-container-low));
29
+ border: 1px solid var(--code-highlighter-border-color, var(--color-outline-variant));
30
+ border-radius: var(--code-highlighter-shape, var(--shape-corner-medium));
31
+ }
32
+
33
+ .header {
34
+ min-width: 0;
35
+ overflow-x: auto;
36
+ scrollbar-width: none;
37
+ }
38
+
39
+ ::slotted([hidden]) {
40
+ display: none !important;
41
+ }`;
42
+
43
+ /**
44
+ * @label Code Group
45
+ * @tag wc-code-group
46
+ * @rawTag code-group
47
+ *
48
+ * @summary Shows several code blocks in one frame, with a tab for each block.
49
+ * @overview
50
+ * <p>Put <code>wc-code-highlighter</code> elements inside. Each block's <code>label</code> names its tab,
51
+ * and only the selected block is shown. The group draws the frame, so the blocks drop their own
52
+ * border and header, and their actions float at the top end.</p>
53
+ *
54
+ * @example
55
+ * ```html
56
+ * <wc-code-group>
57
+ * <wc-code-highlighter label="greeting.ts" language="typescript"><pre><code>
58
+ * export const greeting = 'Hello';</code></pre></wc-code-highlighter>
59
+ * <wc-code-highlighter label="greeting.css" language="css"><pre><code>
60
+ * p { color: var(--color-primary); }</code></pre></wc-code-highlighter>
61
+ * </wc-code-group>
62
+ * ```
63
+ *
64
+ * @slot - `wc-code-highlighter` elements, one per tab.
65
+ *
66
+ * @csspart container - The outer frame.
67
+ * @csspart header - The tab bar.
68
+ *
69
+ * @fires {CustomEvent<{index: number}>} change - Dispatched when the user selects another tab.
70
+ *
71
+ * @tags display
72
+ */
73
+ let CodeGroup = class CodeGroup extends i$1 {
74
+ constructor() {
75
+ // ── Static ────────────────────────────────────────────────────────────────
76
+ super(...arguments);
77
+ // ── Properties ────────────────────────────────────────────────────────────
78
+ /** Index of the shown block. */
79
+ this.selectedIndex = 0;
80
+ /** The grouped code blocks, in slot order. */
81
+ this._blocks = [];
82
+ }
83
+ // ── Lifecycle ─────────────────────────────────────────────────────────────
84
+ connectedCallback() {
85
+ super.connectedCallback();
86
+ this.__labelObserver = new MutationObserver(() => this.requestUpdate());
87
+ this.__labelObserver.observe(this, {
88
+ subtree: true,
89
+ attributes: true,
90
+ attributeFilter: ['label', 'language'],
91
+ });
92
+ }
93
+ disconnectedCallback() {
94
+ this.__labelObserver?.disconnect();
95
+ super.disconnectedCallback();
96
+ }
97
+ updated(changed) {
98
+ if (changed.has('selectedIndex') || changed.has('_blocks')) {
99
+ this.__syncBlocks();
100
+ }
101
+ }
102
+ // ── Private methods ───────────────────────────────────────────────────────
103
+ /** The selected index, kept within the blocks. */
104
+ get __activeIndex() {
105
+ const last = this._blocks.length - 1;
106
+ return Math.min(Math.max(0, this.selectedIndex || 0), Math.max(0, last));
107
+ }
108
+ /** Marks every block as grouped and shows only the selected one. */
109
+ __syncBlocks() {
110
+ const active = this.__activeIndex;
111
+ this._blocks.forEach((block, index) => {
112
+ block.setAttribute('grouped', '');
113
+ block.toggleAttribute('hidden', index !== active);
114
+ });
115
+ }
116
+ __handleSlotChange(event) {
117
+ const slot = event.target;
118
+ const blocks = slot
119
+ .assignedElements({ flatten: true })
120
+ .filter(element => element.localName === 'wc-code-highlighter');
121
+ // Blocks moved out of the group get their own frame back.
122
+ for (const block of this._blocks) {
123
+ if (!blocks.includes(block)) {
124
+ block.removeAttribute('grouped');
125
+ block.removeAttribute('hidden');
126
+ }
127
+ }
128
+ this._blocks = blocks;
129
+ }
130
+ __handleTabChange(event) {
131
+ event.stopPropagation();
132
+ const { index } = event.detail;
133
+ if (index < 0 || index === this.__activeIndex)
134
+ return;
135
+ this.selectedIndex = index;
136
+ this.dispatchEvent(new CustomEvent('change', {
137
+ detail: { index },
138
+ bubbles: true,
139
+ composed: true,
140
+ }));
141
+ }
142
+ // eslint-disable-next-line class-methods-use-this
143
+ __stopEvent(event) {
144
+ event.stopPropagation();
145
+ }
146
+ // ── Render helpers ────────────────────────────────────────────────────────
147
+ // eslint-disable-next-line class-methods-use-this
148
+ __tabLabel(block, index) {
149
+ return (block.label ||
150
+ block.getAttribute('label') ||
151
+ block.language ||
152
+ `${index + 1}`);
153
+ }
154
+ // ── Render ────────────────────────────────────────────────────────────────
155
+ render() {
156
+ const active = this.__activeIndex;
157
+ return b `
158
+ <div class="code-group" part="container">
159
+ <div class="header" part="header">
160
+ <wc-tabs
161
+ class="tabs"
162
+ variant="secondary"
163
+ @change=${this.__handleTabChange}
164
+ @tab-click=${this.__stopEvent}
165
+ >
166
+ ${this._blocks.map((block, index) => b `<wc-tab .active=${index === active}
167
+ >${this.__tabLabel(block, index)}</wc-tab
168
+ >`)}
169
+ </wc-tabs>
170
+ </div>
171
+ <slot @slotchange=${this.__handleSlotChange}></slot>
172
+ </div>
173
+ `;
174
+ }
175
+ };
176
+ CodeGroup.styles = [css_248z];
177
+ __decorate([
178
+ n({ attribute: 'selected-index', type: Number, reflect: true })
179
+ ], CodeGroup.prototype, "selectedIndex", void 0);
180
+ __decorate([
181
+ r()
182
+ ], CodeGroup.prototype, "_blocks", void 0);
183
+ CodeGroup = __decorate([
184
+ IndividualComponent
185
+ ], CodeGroup);
186
+
187
+ export { CodeGroup };
188
+ //# sourceMappingURL=code-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-group.js","sources":["../../src/code-highlighter/code-group.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './code-group.scss';\n\n/** Minimal shape of a grouped `wc-code-highlighter`. */\ntype CodeBlockElement = HTMLElement & { label?: string; language?: string };\n\n/**\n * @label Code Group\n * @tag wc-code-group\n * @rawTag code-group\n *\n * @summary Shows several code blocks in one frame, with a tab for each block.\n * @overview\n * <p>Put <code>wc-code-highlighter</code> elements inside. Each block's <code>label</code> names its tab,\n * and only the selected block is shown. The group draws the frame, so the blocks drop their own\n * border and header, and their actions float at the top end.</p>\n *\n * @example\n * ```html\n * <wc-code-group>\n * <wc-code-highlighter label=\"greeting.ts\" language=\"typescript\"><pre><code>\n * export const greeting = 'Hello';</code></pre></wc-code-highlighter>\n * <wc-code-highlighter label=\"greeting.css\" language=\"css\"><pre><code>\n * p { color: var(--color-primary); }</code></pre></wc-code-highlighter>\n * </wc-code-group>\n * ```\n *\n * @slot - `wc-code-highlighter` elements, one per tab.\n *\n * @csspart container - The outer frame.\n * @csspart header - The tab bar.\n *\n * @fires {CustomEvent<{index: number}>} change - Dispatched when the user selects another tab.\n *\n * @tags display\n */\n@IndividualComponent\nexport class CodeGroup extends LitElement {\n // ── Static ────────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ────────────────────────────────────────────────────────────\n\n /** Index of the shown block. */\n @property({ attribute: 'selected-index', type: Number, reflect: true })\n selectedIndex: number = 0;\n\n /** The grouped code blocks, in slot order. */\n @state() private _blocks: CodeBlockElement[] = [];\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Re-renders the tabs when a block's label changes. */\n private __labelObserver?: MutationObserver;\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n connectedCallback() {\n super.connectedCallback();\n this.__labelObserver = new MutationObserver(() => this.requestUpdate());\n this.__labelObserver.observe(this, {\n subtree: true,\n attributes: true,\n attributeFilter: ['label', 'language'],\n });\n }\n\n disconnectedCallback() {\n this.__labelObserver?.disconnect();\n super.disconnectedCallback();\n }\n\n protected updated(changed: Map<PropertyKey, unknown>) {\n if (changed.has('selectedIndex') || changed.has('_blocks')) {\n this.__syncBlocks();\n }\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n /** The selected index, kept within the blocks. */\n private get __activeIndex(): number {\n const last = this._blocks.length - 1;\n return Math.min(Math.max(0, this.selectedIndex || 0), Math.max(0, last));\n }\n\n /** Marks every block as grouped and shows only the selected one. */\n private __syncBlocks() {\n const active = this.__activeIndex;\n this._blocks.forEach((block, index) => {\n block.setAttribute('grouped', '');\n block.toggleAttribute('hidden', index !== active);\n });\n }\n\n private __handleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n const blocks = slot\n .assignedElements({ flatten: true })\n .filter(\n element => element.localName === 'wc-code-highlighter',\n ) as CodeBlockElement[];\n\n // Blocks moved out of the group get their own frame back.\n for (const block of this._blocks) {\n if (!blocks.includes(block)) {\n block.removeAttribute('grouped');\n block.removeAttribute('hidden');\n }\n }\n this._blocks = blocks;\n }\n\n private __handleTabChange(event: CustomEvent<{ index: number }>) {\n event.stopPropagation();\n const { index } = event.detail;\n if (index < 0 || index === this.__activeIndex) return;\n this.selectedIndex = index;\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { index },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private __stopEvent(event: Event) {\n event.stopPropagation();\n }\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n // eslint-disable-next-line class-methods-use-this\n private __tabLabel(block: CodeBlockElement, index: number): string {\n return (\n block.label ||\n block.getAttribute('label') ||\n block.language ||\n `${index + 1}`\n );\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n render() {\n const active = this.__activeIndex;\n return html`\n <div class=\"code-group\" part=\"container\">\n <div class=\"header\" part=\"header\">\n <wc-tabs\n class=\"tabs\"\n variant=\"secondary\"\n @change=${this.__handleTabChange}\n @tab-click=${this.__stopEvent}\n >\n ${this._blocks.map(\n (block, index) =>\n html`<wc-tab .active=${index === active}\n >${this.__tabLabel(block, index)}</wc-tab\n >`,\n )}\n </wc-tabs>\n </div>\n <slot @slotchange=${this.__handleSlotChange}></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","styles","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQA,GAAU,CAAA;AAAlC,IAAA,WAAA,GAAA;;;;;QASL,IAAA,CAAA,aAAa,GAAW,CAAC;;QAGR,IAAA,CAAA,OAAO,GAAuB,EAAE;IAyHnD;;IAhHE,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE;AACzB,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI,gBAAgB,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;AACvE,QAAA,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE;AACjC,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,eAAe,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;AACvC,SAAA,CAAC;IACJ;IAEA,oBAAoB,GAAA;AAClB,QAAA,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE;QAClC,KAAK,CAAC,oBAAoB,EAAE;IAC9B;A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