@ds-mo/ui 15.10.1 → 15.10.2
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/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +2 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/{p-uAtciSyr.js → p-C0xrqZxm.js} +2 -2
- package/dist/components/p-DGIVqwT9.js +2 -0
- package/dist/components/p-DGIVqwT9.js.map +1 -0
- package/dist/docs/components.json +1 -1
- package/dist/mcp-data/registry/code-block.json +3 -2
- package/dist/mcp-data/registry/registry.json +1 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +8 -0
- package/package.json +1 -1
- package/dist/components/p-BE9ladwu.js +0 -2
- package/dist/components/p-BE9ladwu.js.map +0 -1
- /package/dist/components/{p-uAtciSyr.js.map → p-C0xrqZxm.js.map} +0 -0
package/dist/.package-ready.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"package":"@ds-mo/ui","version":"15.10.
|
|
1
|
+
{"schemaVersion":1,"package":"@ds-mo/ui","version":"15.10.2","components":101,"digest":"89569a53695b1123d73480e35fd40d8837ccfd8f6b911dbf9905f0fb185be815","completedAt":"2026-09-28T04:54:29.952Z"}
|
package/dist/agent-patterns.json
CHANGED
package/dist/agent.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"package": "@ds-mo/ui",
|
|
4
|
-
"packageVersion": "15.10.
|
|
4
|
+
"packageVersion": "15.10.2",
|
|
5
5
|
"kind": "components",
|
|
6
6
|
"entries": [
|
|
7
7
|
{
|
|
@@ -4986,6 +4986,7 @@
|
|
|
4986
4986
|
"component:ds-button-unfilled"
|
|
4987
4987
|
],
|
|
4988
4988
|
"accessibility": [
|
|
4989
|
+
"Overflowing code is a named keyboard scroll region with visible focus. Code that fits does not add a tab stop; focusability follows content, font loading, and container resizing.",
|
|
4989
4990
|
"The copy action has matching accessible-name and visible-tooltip status wording, and the code remains selectable text.",
|
|
4990
4991
|
"Language and filename labels supplement rather than replace the code content.",
|
|
4991
4992
|
"The semantic code-family token retains a system-monospace fallback when an application does not load Fira Code; applications may disable programming ligatures through the shared code-surface custom property."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as s,H as e,h as t,a,t as o}from"./index.js";import{d as
|
|
1
|
+
import{p as s,H as e,h as t,a,t as o}from"./index.js";import{d as r}from"./p-CsPqGA8B.js";import{d as i}from"./p-CHYYRdRJ.js";import{d as n}from"./p-87FjWil8.js";import{d}from"./p-CqfYCn-e.js";import{d as m}from"./p-CYRTkP1A.js";import{d as c}from"./p-CzTJAO2J.js";import{d as l}from"./p-DKg181YU.js";import{d as f}from"./p-BrB05_X8.js";import{d as u}from"./p-CgYDQSLW.js";import{d as p}from"./p-DGIVqwT9.js";import{d as b}from"./p-BVsVUnAw.js";import{d as k}from"./p-0XTyQNRG.js";import{d as h}from"./p-C0xrqZxm.js";import{d as g}from"./p-CEm0AoDR.js";import{d as y}from"./p-Cnzry0_v.js";import{d as E}from"./p-CTAF7SkL.js";import{d as w}from"./p-PNY7auMh.js";const j=()=>`.sc-ds-agent-response-h{display:block;width:100%;--ds-prose-text-max-inline-size:var(--dimension-panel-width-lg);-webkit-user-select:none;user-select:none}.agent-response.sc-ds-agent-response{display:grid;gap:var(--dimension-space-150);min-width:0;width:100%;color:var(--color-foreground-secondary);-webkit-user-select:none;user-select:none}`;const x=s(class s extends e{constructor(s){super();if(s!==false){this.__registerHost()}this.messageId="";this.author="";this.showAuthor=true;this.timestamp="";this.parts=[];this.renderMode="parts";this.streaming=false;this.metadataVisibility="always"}renderPart(s){switch(s.type){case"markdown":return t("ds-markdown",{key:s.id,content:s.content,streaming:s.state==="streaming"});case"activity":return t("ds-agent-activity",{key:s.id,items:s.items});case"tool":return t("ds-agent-tool-call",{key:s.id,name:s.name,label:s.label,state:s.state,input:s.input,output:s.output,error:s.error});case"attachments":return t("ds-attachment-list",{key:s.id,items:s.items});case"sources":return t("ds-agent-source-list",{key:s.id,items:s.items});case"questionnaire":return t("ds-agent-questionnaire",{key:s.id,requestId:s.requestId,questions:s.questions,answers:s.answers,status:"answered"})}}render(){return t(a,{key:"2089dc57dd6d6d666a9b837d3190dee679e3cdfa"},t("ds-message",{key:"0ced7a481ff50ffb873135cec47b6f6eddeebd0a",messageId:this.messageId,direction:"incoming",author:this.author,showAuthor:this.showAuthor,timestamp:this.timestamp,streaming:this.streaming,metadataVisibility:this.metadataVisibility},t("div",{key:"a32ae671bf4f142c6105f8ffa33ab867af900eeb",class:"agent-response"},this.renderMode==="composed"?t("slot",null):this.parts.map((s=>this.renderPart(s)))),t("slot",{key:"c207c31325f022a9c9aff7292dab2e2862ff6319",name:"footer",slot:"footer"}),t("slot",{key:"d7064c4f349a600d62895c030b0a59fe7d98f86f",name:"metadata-actions",slot:"metadata-actions"}),t("slot",{key:"6150e93507ecfee18212f064341d9a1d3de0a506",name:"actions",slot:"actions"})))}static get style(){return j()}},[262,"ds-agent-response",{messageId:[1,"message-id"],author:[1],showAuthor:[4,"show-author"],timestamp:[1],parts:[16],renderMode:[1,"render-mode"],streaming:[4],metadataVisibility:[1,"metadata-visibility"]}]);function C(){if(typeof customElements==="undefined"){return}const s=["ds-agent-response","ds-agent-activity","ds-agent-questionnaire","ds-agent-source-list","ds-agent-tool-call","ds-attachment-list","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-code-block","ds-icon","ds-loader","ds-markdown","ds-message","ds-radio","ds-text","ds-tooltip"];s.forEach((s=>{switch(s){case"ds-agent-response":if(!customElements.get(o(s))){customElements.define(o(s),x)}break;case"ds-agent-activity":if(!customElements.get(o(s))){r()}break;case"ds-agent-questionnaire":if(!customElements.get(o(s))){i()}break;case"ds-agent-source-list":if(!customElements.get(o(s))){n()}break;case"ds-agent-tool-call":if(!customElements.get(o(s))){d()}break;case"ds-attachment-list":if(!customElements.get(o(s))){m()}break;case"ds-badge":if(!customElements.get(o(s))){c()}break;case"ds-button-filled":if(!customElements.get(o(s))){l()}break;case"ds-button-unfilled":if(!customElements.get(o(s))){f()}break;case"ds-checkbox":if(!customElements.get(o(s))){u()}break;case"ds-code-block":if(!customElements.get(o(s))){p()}break;case"ds-icon":if(!customElements.get(o(s))){b()}break;case"ds-loader":if(!customElements.get(o(s))){k()}break;case"ds-markdown":if(!customElements.get(o(s))){h()}break;case"ds-message":if(!customElements.get(o(s))){g()}break;case"ds-radio":if(!customElements.get(o(s))){y()}break;case"ds-text":if(!customElements.get(o(s))){E()}break;case"ds-tooltip":if(!customElements.get(o(s))){w()}break}}))}C();const q=x;const v=C;export{q as DsAgentResponse,v as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-agent-response.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as o,d as s}from"./p-
|
|
1
|
+
import{C as o,d as s}from"./p-DGIVqwT9.js";const t=o;const p=s;export{t as DsCodeBlock,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-code-block.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as o,d as s}from"./p-
|
|
1
|
+
import{M as o,d as s}from"./p-C0xrqZxm.js";const r=o;const t=s;export{r as DsMarkdown,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-markdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{C as d}from"./p-DlsjHRU3.js";import{d as t}from"./p-CzTJAO2J.js";import{d as n}from"./p-BrB05_X8.js";import{d as i}from"./p-BE9ladwu.js";import{d as c}from"./p-BVsVUnAw.js";import{d as h}from"./p-0XTyQNRG.js";import{d as m}from"./p-CTAF7SkL.js";import{d as l}from"./p-PNY7auMh.js";import{r as w}from"./p-CbrDF2gA.js";const p=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6.sc-ds-markdown,p.sc-ds-markdown,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:var(--ds-prose-text-max-inline-size, 100%)}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h2):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(ol>li):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-block-end:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(ol>li:has(>:is(h3,h4).sc-ds-markdown:first-child)):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown::marker{color:var(--color-foreground-primary);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-bold-brand);text-decoration-line:none;text-decoration-color:currentcolor;text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}@media (hover: hover) and (pointer: fine){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown:hover{text-decoration-line:underline}}@media (forced-colors: active){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{text-decoration-line:underline}}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let f;function k(){f??(f=Promise.all([import("./p-ByLH5RAD.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return f}const g=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0;this.initialized=false;this.tasks=new d((()=>this.el.isConnected))}connectedCallback(){if(this.initialized)this.scheduleParse()}componentWillLoad(){this.initialized=true;if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;this.tasks.cancel();this.parseFrame=undefined}scheduleParse(){this.parseRevision+=1;if(typeof requestAnimationFrame!=="function")return;this.tasks.cancelFrame(this.parseFrame);this.parseFrame=this.tasks.frame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await k();if(e!==this.parseRevision||!this.el.isConnected)return;const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision&&this.el.isConnected)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=w(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=w(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"a748ececdb6bcdf106ff600cb475fc4d379211bb","aria-busy":this.streaming?"true":undefined},r("div",{key:"76217e9a7396b12ab9a64ec4738be84b57dad495",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}get el(){return this}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return p()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function u(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),g)}break;case"ds-badge":if(!customElements.get(a(e))){t()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){i()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){h()}break;case"ds-text":if(!customElements.get(a(e))){m()}break;case"ds-tooltip":if(!customElements.get(a(e))){l()}break}}))}u();export{g as M,u as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{C as d}from"./p-DlsjHRU3.js";import{d as t}from"./p-CzTJAO2J.js";import{d as n}from"./p-BrB05_X8.js";import{d as i}from"./p-DGIVqwT9.js";import{d as c}from"./p-BVsVUnAw.js";import{d as h}from"./p-0XTyQNRG.js";import{d as m}from"./p-CTAF7SkL.js";import{d as l}from"./p-PNY7auMh.js";import{r as w}from"./p-CbrDF2gA.js";const p=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6.sc-ds-markdown,p.sc-ds-markdown,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:var(--ds-prose-text-max-inline-size, 100%)}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h2):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(ol>li):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-block-end:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(ol>li:has(>:is(h3,h4).sc-ds-markdown:first-child)):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown::marker{color:var(--color-foreground-primary);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-bold-brand);text-decoration-line:none;text-decoration-color:currentcolor;text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}@media (hover: hover) and (pointer: fine){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown:hover{text-decoration-line:underline}}@media (forced-colors: active){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{text-decoration-line:underline}}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let f;function k(){f??(f=Promise.all([import("./p-ByLH5RAD.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return f}const g=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0;this.initialized=false;this.tasks=new d((()=>this.el.isConnected))}connectedCallback(){if(this.initialized)this.scheduleParse()}componentWillLoad(){this.initialized=true;if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;this.tasks.cancel();this.parseFrame=undefined}scheduleParse(){this.parseRevision+=1;if(typeof requestAnimationFrame!=="function")return;this.tasks.cancelFrame(this.parseFrame);this.parseFrame=this.tasks.frame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await k();if(e!==this.parseRevision||!this.el.isConnected)return;const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision&&this.el.isConnected)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=w(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=w(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"a748ececdb6bcdf106ff600cb475fc4d379211bb","aria-busy":this.streaming?"true":undefined},r("div",{key:"76217e9a7396b12ab9a64ec4738be84b57dad495",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}get el(){return this}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return p()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function u(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),g)}break;case"ds-badge":if(!customElements.get(a(e))){t()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){i()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){h()}break;case"ds-text":if(!customElements.get(a(e))){m()}break;case"ds-tooltip":if(!customElements.get(a(e))){l()}break}}))}u();export{g as M,u as d};
|
|
2
|
+
//# sourceMappingURL=p-C0xrqZxm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as s,H as o,h as e,a as c,t as i}from"./index.js";import{C as d}from"./p-BnhGV__o.js";import{d as t}from"./p-CzTJAO2J.js";import{d as n}from"./p-BrB05_X8.js";import{d as r}from"./p-BVsVUnAw.js";import{d as a}from"./p-0XTyQNRG.js";import{d as l}from"./p-CTAF7SkL.js";import{d as f}from"./p-PNY7auMh.js";const u=()=>`@media (forced-colors: active){.sc-ds-code-block:root,.sc-ds-code-block-h,.ds-forced-colors-scope.sc-ds-code-block{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-code-block-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-code-block-h,.ds-focus-ring.sc-ds-code-block,.ds-focus-ring-inset.sc-ds-code-block-h,.ds-focus-ring-inset.sc-ds-code-block{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-code-block-h:focus-visible,.ds-focus-ring.sc-ds-code-block:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-code-block-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-code-block{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-code-block-h:focus-visible,.ds-focus-ring-inset.sc-ds-code-block:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-code-block-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-code-block:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-code-block-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}`;const b=()=>`.sc-ds-code-block-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.code-block.sc-ds-code-block{width:100%;min-width:0;margin:0;overflow:hidden;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);box-sizing:border-box}.code-block__header.sc-ds-code-block{display:flex;align-items:center;justify-content:space-between;gap:var(--dimension-space-100);min-height:var(--dimension-size-400);padding:var(--dimension-space-050) var(--dimension-space-100);background:var(--color-background-strong-neutral);box-sizing:border-box}pre.sc-ds-code-block{--ds-focus-ring-offset:calc(-1 * var(--ds-focus-ring-width));margin:0;padding:var(--dimension-space-150);overflow:auto;font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2;-webkit-user-select:text;user-select:text}code.sc-ds-code-block{display:block;inline-size:max-content;font:inherit;white-space:pre}`;const h=s(class s extends o{constructor(s){super();if(s!==false){this.__registerHost()}this.code="";this.language="";this.filename="";this.copied=false;this.scrollable=false;this.copyFeedback=new d((s=>{this.copied=s}));this.syncOverflow=()=>{const s=this.viewport;if(!s?.isConnected)return;this.scrollable=s.scrollWidth>s.clientWidth||s.scrollHeight>s.clientHeight};this.copy=async()=>{await this.copyFeedback.copy(this.code)}}connectedCallback(){this.copyFeedback.connect();this.observeOverflow()}componentDidLoad(){this.observeOverflow()}componentDidRender(){this.syncOverflow()}observeOverflow(){if(!this.viewport?.isConnected||!this.content)return;this.resizeObserver??(this.resizeObserver=new ResizeObserver(this.syncOverflow));this.resizeObserver.observe(this.viewport);this.resizeObserver.observe(this.content);this.syncOverflow()}handleCodeChange(){this.copyFeedback.reset()}disconnectedCallback(){this.copyFeedback.disconnect();this.resizeObserver?.disconnect();this.resizeObserver=undefined}render(){const s=this.filename||this.language||"Code";return e(c,{key:"a52748baf4d3e9de97cdc43185d5dcf0897a5fb6"},e("figure",{key:"9b51d0550699ea1633097e571f08690c6b5c557f",class:"code-block"},e("figcaption",{key:"ee73c1f0c7f128746636580b4ec6f58b71ca9429",class:"code-block__header"},e("ds-text",{key:"d122455a1452531a2eadde214efc22054e485417",as:"span",variant:"text-caption",emphasis:true,color:"on-strong"},s),e("ds-tooltip",{key:"605707b242f782d48cc1986160ed82b7d3ccb682",label:this.copied?"Copied":"Copy code",side:"bottom",size:"sm"},e("ds-button-unfilled",{key:"c5c7d4ea37f65d76d940b638e867754cb0ca7868",variant:"icon",icon:this.copied?"Check":"Copy",size:"xs","aria-label":this.copied?"Copied":"Copy code",hasBorder:false,onDsClick:this.copy}))),e("pre",{key:"48d1a4adb2285e14b4e31c76ce2700d9b61b8cce",class:"ds-focus-ring",ref:s=>{this.viewport=s},tabIndex:this.scrollable?0:undefined,role:this.scrollable?"region":undefined,"aria-label":this.scrollable?s:undefined},e("code",{key:"c76d913c3cab144d7ef881f5641234c310ca767a",ref:s=>{this.content=s}},this.code))))}static get watchers(){return{code:[{handleCodeChange:0}]}}static get style(){return u()+b()}},[2,"ds-code-block",{code:[1],language:[1],filename:[1],copied:[32],scrollable:[32]},undefined,{code:[{handleCodeChange:0}]}]);function g(){if(typeof customElements==="undefined"){return}const s=["ds-code-block","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];s.forEach((s=>{switch(s){case"ds-code-block":if(!customElements.get(i(s))){customElements.define(i(s),h)}break;case"ds-badge":if(!customElements.get(i(s))){t()}break;case"ds-button-unfilled":if(!customElements.get(i(s))){n()}break;case"ds-icon":if(!customElements.get(i(s))){r()}break;case"ds-loader":if(!customElements.get(i(s))){a()}break;case"ds-text":if(!customElements.get(i(s))){l()}break;case"ds-tooltip":if(!customElements.get(i(s))){f()}break}}))}g();export{h as C,g as d};
|
|
2
|
+
//# sourceMappingURL=p-DGIVqwT9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["focusRingCss","codeBlockCss","CodeBlock","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","code","language","filename","copied","scrollable","copyFeedback","ClipboardFeedbackController","syncOverflow","viewport","isConnected","scrollWidth","clientWidth","scrollHeight","clientHeight","copy","async","connectedCallback","connect","observeOverflow","componentDidLoad","componentDidRender","content","resizeObserver","ResizeObserver","observe","handleCodeChange","reset","disconnectedCallback","disconnect","undefined","render","label","h","Host","key","class","as","variant","emphasis","color","side","size","icon","hasBorder","onDsClick","ref","element","tabIndex","role"],"sources":["src/wc/utils/focus-ring.css?tag=ds-code-block&encapsulation=scoped","src/wc/components/CodeBlock/CodeBlock.css?tag=ds-code-block&encapsulation=scoped","src/wc/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["@import './forced-colors.css';\n\n:host {\n --ds-focus-ring-width: var(--dimension-stroke-width-025, 2px);\n --ds-focus-ring-offset: var(--dimension-space-025, 2px);\n --ds-focus-ring-color: var(--color-interaction-focus);\n}\n\n:host(.ds-focus-ring),\n.ds-focus-ring,\n:host(.ds-focus-ring-inset),\n.ds-focus-ring-inset {\n outline: none;\n -webkit-tap-highlight-color: transparent;\n touch-action: manipulation;\n}\n\n:host(.ds-focus-ring:focus-visible),\n.ds-focus-ring:focus-visible {\n outline: var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);\n outline-offset: var(--ds-focus-ring-offset);\n}\n\n:host(.ds-focus-ring.ds-focus-ring--visible),\n.ds-focus-ring.ds-focus-ring--visible {\n outline: var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);\n outline-offset: var(--ds-focus-ring-offset);\n}\n\n:host(.ds-focus-ring-inset:focus-visible),\n.ds-focus-ring-inset:focus-visible {\n outline: none;\n}\n\n:host(.ds-focus-ring-inset:focus-visible)::after,\n.ds-focus-ring-inset:focus-visible::after {\n outline: var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);\n outline-offset: calc(-1 * var(--ds-focus-ring-width));\n}\n\n:host(.ds-focus-ring-inset.ds-focus-ring--visible),\n.ds-focus-ring-inset.ds-focus-ring--visible {\n outline: none;\n}\n\n:host(.ds-focus-ring-inset.ds-focus-ring--visible)::after,\n.ds-focus-ring-inset.ds-focus-ring--visible::after {\n outline: var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);\n outline-offset: calc(-1 * var(--ds-focus-ring-width));\n}\n\n@media (forced-colors: active) {\n :host {\n --ds-focus-ring-color: var(--ds-forced-color-selected);\n }\n}\n",":host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.code-block {\n width: 100%;\n min-width: 0;\n margin: 0;\n overflow: hidden;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-strong-neutral);\n color: var(--color-foreground-faint-neutral);\n box-sizing: border-box;\n}\n\n.code-block__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-100);\n min-height: var(--dimension-size-400);\n padding: var(--dimension-space-050) var(--dimension-space-100);\n background: var(--color-background-strong-neutral);\n box-sizing: border-box;\n}\n\npre {\n /* Keep the shared focus ring inside the clipped code surface. */\n --ds-focus-ring-offset: calc(-1 * var(--ds-focus-ring-width));\n margin: 0;\n padding: var(--dimension-space-150);\n overflow: auto;\n font-family: var(\n --typography-font-family-code,\n 'Fira Code',\n ui-monospace,\n 'SFMono-Regular',\n 'Cascadia Code',\n 'Roboto Mono',\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n monospace\n );\n font-size: var(--typography-fontsize-sm);\n font-variant-ligatures: var(--ds-code-font-variant-ligatures, normal);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-sm);\n letter-spacing: var(--typography-letterspacing-none);\n tab-size: 2;\n -webkit-user-select: text;\n user-select: text;\n}\n\ncode {\n /* Observe intrinsic text width even when font loading leaves the scrollport unchanged. */\n display: block;\n inline-size: max-content;\n font: inherit;\n white-space: pre;\n}\n","import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { ClipboardFeedbackController } from '../../utils/clipboard';\n\n@Component({\n tag: 'ds-code-block',\n styleUrls: ['../../utils/focus-ring.css', 'CodeBlock.css'],\n scoped: true,\n})\nexport class CodeBlock {\n @Prop() code: string = '';\n @Prop() language: string = '';\n @Prop() filename: string = '';\n\n @State() private copied: boolean = false;\n @State() private scrollable = false;\n private viewport?: HTMLPreElement;\n private content?: HTMLElement;\n private resizeObserver?: ResizeObserver;\n private readonly copyFeedback = new ClipboardFeedbackController(copied => {\n this.copied = copied;\n });\n\n connectedCallback() {\n this.copyFeedback.connect();\n this.observeOverflow();\n }\n\n componentDidLoad() {\n this.observeOverflow();\n }\n\n componentDidRender() {\n this.syncOverflow();\n }\n\n private observeOverflow() {\n if (!this.viewport?.isConnected || !this.content) return;\n this.resizeObserver ??= new ResizeObserver(this.syncOverflow);\n this.resizeObserver.observe(this.viewport);\n this.resizeObserver.observe(this.content);\n this.syncOverflow();\n }\n\n private syncOverflow = () => {\n const viewport = this.viewport;\n if (!viewport?.isConnected) return;\n this.scrollable =\n viewport.scrollWidth > viewport.clientWidth || viewport.scrollHeight > viewport.clientHeight;\n };\n\n @Watch('code')\n handleCodeChange() {\n this.copyFeedback.reset();\n }\n\n disconnectedCallback() {\n this.copyFeedback.disconnect();\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n }\n\n private copy = async () => {\n await this.copyFeedback.copy(this.code);\n };\n\n render() {\n const label = this.filename || this.language || 'Code';\n return (\n <Host>\n <figure class=\"code-block\">\n <figcaption class=\"code-block__header\">\n <ds-text as=\"span\" variant=\"text-caption\" emphasis color=\"on-strong\">\n {label}\n </ds-text>\n <ds-tooltip label={this.copied ? 'Copied' : 'Copy code'} side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n variant=\"icon\"\n icon={this.copied ? 'Check' : 'Copy'}\n size=\"xs\"\n aria-label={this.copied ? 'Copied' : 'Copy code'}\n hasBorder={false}\n onDsClick={this.copy}\n />\n </ds-tooltip>\n </figcaption>\n <pre\n class=\"ds-focus-ring\"\n ref={element => {\n this.viewport = element;\n }}\n tabIndex={this.scrollable ? 0 : undefined}\n role={this.scrollable ? 'region' : undefined}\n aria-label={this.scrollable ? label : undefined}\n >\n <code\n ref={element => {\n this.content = element;\n }}\n >\n {this.code}\n </code>\n </pre>\n </figure>\n </Host>\n );\n }\n}\n"],"mappings":"uTAAA,MAAMA,EAAe,IAAM,sgECA3B,MAAMC,EAAe,IAAM,24C,MCQdC,EAASC,EAAA,MAAAD,UAAAE,EALtB,WAAAC,CAAAC,G,4CAMUC,KAAAC,KAAe,GACfD,KAAAE,SAAmB,GACnBF,KAAAG,SAAmB,GAEVH,KAAAI,OAAkB,MAClBJ,KAAAK,WAAa,MAIbL,KAAAM,aAAe,IAAIC,GAA4BH,IAC9DJ,KAAKI,OAASA,CAAM,IAwBdJ,KAAAQ,aAAe,KACrB,MAAMC,EAAWT,KAAKS,SACtB,IAAKA,GAAUC,YAAa,OAC5BV,KAAKK,WACHI,EAASE,YAAcF,EAASG,aAAeH,EAASI,aAAeJ,EAASK,YAAY,EAcxFd,KAAAe,KAAOC,gBACPhB,KAAKM,aAAaS,KAAKf,KAAKC,KAAK,CA4C1C,CApFC,iBAAAgB,GACEjB,KAAKM,aAAaY,UAClBlB,KAAKmB,iB,CAGP,gBAAAC,GACEpB,KAAKmB,iB,CAGP,kBAAAE,GACErB,KAAKQ,c,CAGC,eAAAW,GACN,IAAKnB,KAAKS,UAAUC,cAAgBV,KAAKsB,QAAS,OAClDtB,KAAKuB,iBAALvB,KAAKuB,eAAmB,IAAIC,eAAexB,KAAKQ,eAChDR,KAAKuB,eAAeE,QAAQzB,KAAKS,UACjCT,KAAKuB,eAAeE,QAAQzB,KAAKsB,SACjCtB,KAAKQ,c,CAWP,gBAAAkB,GACE1B,KAAKM,aAAaqB,O,CAGpB,oBAAAC,GACE5B,KAAKM,aAAauB,aAClB7B,KAAKuB,gBAAgBM,aACrB7B,KAAKuB,eAAiBO,S,CAOxB,MAAAC,GACE,MAAMC,EAAQhC,KAAKG,UAAYH,KAAKE,UAAY,OAChD,OACE+B,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,UAAAE,IAAA,2CAAQC,MAAM,cACZH,EAAA,cAAAE,IAAA,2CAAYC,MAAM,sBAChBH,EAAA,WAAAE,IAAA,2CAASE,GAAG,OAAOC,QAAQ,eAAeC,SAAQ,KAACC,MAAM,aACtDR,GAEHC,EAAA,cAAAE,IAAA,2CAAYH,MAAOhC,KAAKI,OAAS,SAAW,YAAaqC,KAAK,SAASC,KAAK,MAC1ET,EAAA,sBAAAE,IAAA,2CACEG,QAAQ,OACRK,KAAM3C,KAAKI,OAAS,QAAU,OAC9BsC,KAAK,KAAI,aACG1C,KAAKI,OAAS,SAAW,YACrCwC,UAAW,MACXC,UAAW7C,KAAKe,SAItBkB,EAAA,OAAAE,IAAA,2CACEC,MAAM,gBACNU,IAAKC,IACH/C,KAAKS,SAAWsC,CAAO,EAEzBC,SAAUhD,KAAKK,WAAa,EAAIyB,UAChCmB,KAAMjD,KAAKK,WAAa,SAAWyB,UAAS,aAChC9B,KAAKK,WAAa2B,EAAQF,WAEtCG,EAAA,QAAAE,IAAA,2CACEW,IAAKC,IACH/C,KAAKsB,QAAUyB,CAAO,GAGvB/C,KAAKC,Q","ignoreList":[]}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"component:ds-button-unfilled"
|
|
26
26
|
],
|
|
27
27
|
"accessibility": [
|
|
28
|
+
"Overflowing code is a named keyboard scroll region with visible focus. Code that fits does not add a tab stop; focusability follows content, font loading, and container resizing.",
|
|
28
29
|
"The copy action has matching accessible-name and visible-tooltip status wording, and the code remains selectable text.",
|
|
29
30
|
"Language and filename labels supplement rather than replace the code content.",
|
|
30
31
|
"The semantic code-family token retains a system-monospace fallback when an application does not load Fira Code; applications may disable programming ligatures through the shared code-surface custom property."
|
|
@@ -181,12 +182,12 @@
|
|
|
181
182
|
"files": [
|
|
182
183
|
{
|
|
183
184
|
"path": "src/wc/components/CodeBlock/CodeBlock.css",
|
|
184
|
-
"content": ":host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.code-block {\n width: 100%;\n min-width: 0;\n margin: 0;\n overflow: hidden;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-strong-neutral);\n color: var(--color-foreground-faint-neutral);\n box-sizing: border-box;\n}\n\n.code-block__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-100);\n min-height: var(--dimension-size-400);\n padding: var(--dimension-space-050) var(--dimension-space-100);\n background: var(--color-background-strong-neutral);\n box-sizing: border-box;\n}\n\npre {\n margin: 0;\n padding: var(--dimension-space-150);\n overflow: auto;\n font-family: var(\n --typography-font-family-code,\n 'Fira Code',\n ui-monospace,\n 'SFMono-Regular',\n 'Cascadia Code',\n 'Roboto Mono',\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n monospace\n );\n font-size: var(--typography-fontsize-sm);\n font-variant-ligatures: var(--ds-code-font-variant-ligatures, normal);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-sm);\n letter-spacing: var(--typography-letterspacing-none);\n tab-size: 2;\n -webkit-user-select: text;\n user-select: text;\n}\n\ncode {\n font: inherit;\n white-space: pre;\n}\n",
|
|
185
|
+
"content": ":host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.code-block {\n width: 100%;\n min-width: 0;\n margin: 0;\n overflow: hidden;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-strong-neutral);\n color: var(--color-foreground-faint-neutral);\n box-sizing: border-box;\n}\n\n.code-block__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-100);\n min-height: var(--dimension-size-400);\n padding: var(--dimension-space-050) var(--dimension-space-100);\n background: var(--color-background-strong-neutral);\n box-sizing: border-box;\n}\n\npre {\n /* Keep the shared focus ring inside the clipped code surface. */\n --ds-focus-ring-offset: calc(-1 * var(--ds-focus-ring-width));\n margin: 0;\n padding: var(--dimension-space-150);\n overflow: auto;\n font-family: var(\n --typography-font-family-code,\n 'Fira Code',\n ui-monospace,\n 'SFMono-Regular',\n 'Cascadia Code',\n 'Roboto Mono',\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n monospace\n );\n font-size: var(--typography-fontsize-sm);\n font-variant-ligatures: var(--ds-code-font-variant-ligatures, normal);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-sm);\n letter-spacing: var(--typography-letterspacing-none);\n tab-size: 2;\n -webkit-user-select: text;\n user-select: text;\n}\n\ncode {\n /* Observe intrinsic text width even when font loading leaves the scrollport unchanged. */\n display: block;\n inline-size: max-content;\n font: inherit;\n white-space: pre;\n}\n",
|
|
185
186
|
"type": "registry:ui"
|
|
186
187
|
},
|
|
187
188
|
{
|
|
188
189
|
"path": "src/wc/components/CodeBlock/CodeBlock.tsx",
|
|
189
|
-
"content": "import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { ClipboardFeedbackController } from '../../utils/clipboard';\n\n@Component({\n tag: 'ds-code-block',\n
|
|
190
|
+
"content": "import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { ClipboardFeedbackController } from '../../utils/clipboard';\n\n@Component({\n tag: 'ds-code-block',\n styleUrls: ['../../utils/focus-ring.css', 'CodeBlock.css'],\n scoped: true,\n})\nexport class CodeBlock {\n @Prop() code: string = '';\n @Prop() language: string = '';\n @Prop() filename: string = '';\n\n @State() private copied: boolean = false;\n @State() private scrollable = false;\n private viewport?: HTMLPreElement;\n private content?: HTMLElement;\n private resizeObserver?: ResizeObserver;\n private readonly copyFeedback = new ClipboardFeedbackController(copied => {\n this.copied = copied;\n });\n\n connectedCallback() {\n this.copyFeedback.connect();\n this.observeOverflow();\n }\n\n componentDidLoad() {\n this.observeOverflow();\n }\n\n componentDidRender() {\n this.syncOverflow();\n }\n\n private observeOverflow() {\n if (!this.viewport?.isConnected || !this.content) return;\n this.resizeObserver ??= new ResizeObserver(this.syncOverflow);\n this.resizeObserver.observe(this.viewport);\n this.resizeObserver.observe(this.content);\n this.syncOverflow();\n }\n\n private syncOverflow = () => {\n const viewport = this.viewport;\n if (!viewport?.isConnected) return;\n this.scrollable =\n viewport.scrollWidth > viewport.clientWidth || viewport.scrollHeight > viewport.clientHeight;\n };\n\n @Watch('code')\n handleCodeChange() {\n this.copyFeedback.reset();\n }\n\n disconnectedCallback() {\n this.copyFeedback.disconnect();\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n }\n\n private copy = async () => {\n await this.copyFeedback.copy(this.code);\n };\n\n render() {\n const label = this.filename || this.language || 'Code';\n return (\n <Host>\n <figure class=\"code-block\">\n <figcaption class=\"code-block__header\">\n <ds-text as=\"span\" variant=\"text-caption\" emphasis color=\"on-strong\">\n {label}\n </ds-text>\n <ds-tooltip label={this.copied ? 'Copied' : 'Copy code'} side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n variant=\"icon\"\n icon={this.copied ? 'Check' : 'Copy'}\n size=\"xs\"\n aria-label={this.copied ? 'Copied' : 'Copy code'}\n hasBorder={false}\n onDsClick={this.copy}\n />\n </ds-tooltip>\n </figcaption>\n <pre\n class=\"ds-focus-ring\"\n ref={element => {\n this.viewport = element;\n }}\n tabIndex={this.scrollable ? 0 : undefined}\n role={this.scrollable ? 'region' : undefined}\n aria-label={this.scrollable ? label : undefined}\n >\n <code\n ref={element => {\n this.content = element;\n }}\n >\n {this.code}\n </code>\n </pre>\n </figure>\n </Host>\n );\n }\n}\n",
|
|
190
191
|
"type": "registry:ui"
|
|
191
192
|
}
|
|
192
193
|
]
|
|
@@ -5096,6 +5096,7 @@
|
|
|
5096
5096
|
"component:ds-button-unfilled"
|
|
5097
5097
|
],
|
|
5098
5098
|
"accessibility": [
|
|
5099
|
+
"Overflowing code is a named keyboard scroll region with visible focus. Code that fits does not add a tab stop; focusability follows content, font loading, and container resizing.",
|
|
5099
5100
|
"The copy action has matching accessible-name and visible-tooltip status wording, and the code remains selectable text.",
|
|
5100
5101
|
"Language and filename labels supplement rather than replace the code content.",
|
|
5101
5102
|
"The semantic code-family token retains a system-monospace fallback when an application does not load Fira Code; applications may disable programming ligatures through the shared code-surface custom property."
|
|
@@ -3,8 +3,16 @@ export declare class CodeBlock {
|
|
|
3
3
|
language: string;
|
|
4
4
|
filename: string;
|
|
5
5
|
private copied;
|
|
6
|
+
private scrollable;
|
|
7
|
+
private viewport?;
|
|
8
|
+
private content?;
|
|
9
|
+
private resizeObserver?;
|
|
6
10
|
private readonly copyFeedback;
|
|
7
11
|
connectedCallback(): void;
|
|
12
|
+
componentDidLoad(): void;
|
|
13
|
+
componentDidRender(): void;
|
|
14
|
+
private observeOverflow;
|
|
15
|
+
private syncOverflow;
|
|
8
16
|
handleCodeChange(): void;
|
|
9
17
|
disconnectedCallback(): void;
|
|
10
18
|
private copy;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e,H as o,h as s,a as t,t as a}from"./index.js";import{C as d}from"./p-BnhGV__o.js";import{d as i}from"./p-CzTJAO2J.js";import{d as n}from"./p-BrB05_X8.js";import{d as c}from"./p-BVsVUnAw.js";import{d as r}from"./p-0XTyQNRG.js";import{d as l}from"./p-CTAF7SkL.js";import{d as b}from"./p-PNY7auMh.js";const f=()=>`.sc-ds-code-block-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.code-block.sc-ds-code-block{width:100%;min-width:0;margin:0;overflow:hidden;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);box-sizing:border-box}.code-block__header.sc-ds-code-block{display:flex;align-items:center;justify-content:space-between;gap:var(--dimension-space-100);min-height:var(--dimension-size-400);padding:var(--dimension-space-050) var(--dimension-space-100);background:var(--color-background-strong-neutral);box-sizing:border-box}pre.sc-ds-code-block{margin:0;padding:var(--dimension-space-150);overflow:auto;font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2;-webkit-user-select:text;user-select:text}code.sc-ds-code-block{font:inherit;white-space:pre}`;const p=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.code="";this.language="";this.filename="";this.copied=false;this.copyFeedback=new d((e=>{this.copied=e}));this.copy=async()=>{await this.copyFeedback.copy(this.code)}}connectedCallback(){this.copyFeedback.connect()}handleCodeChange(){this.copyFeedback.reset()}disconnectedCallback(){this.copyFeedback.disconnect()}render(){const e=this.filename||this.language||"Code";return s(t,{key:"bf59b12fad24ccce0f645f96d7e3d165faa7a99e"},s("figure",{key:"a570ec37303143c6141a4d582f5e3d97d57d61b7",class:"code-block"},s("figcaption",{key:"53563363469413b4b8d6a203893b30902041653e",class:"code-block__header"},s("ds-text",{key:"e3e08fad862786ac543f206701693765e9d1402f",as:"span",variant:"text-caption",emphasis:true,color:"on-strong"},e),s("ds-tooltip",{key:"fd6d1a26fb85a706bcb0902dbe60923ad6c4265a",label:this.copied?"Copied":"Copy code",side:"bottom",size:"sm"},s("ds-button-unfilled",{key:"d878626be70801df24eb67899c38fdf52626124c",variant:"icon",icon:this.copied?"Check":"Copy",size:"xs","aria-label":this.copied?"Copied":"Copy code",hasBorder:false,onDsClick:this.copy}))),s("pre",{key:"46dac40da59cbb9650f1f7e8995d59a2f31c78e2"},s("code",{key:"2429b29d700529adc19cd6332f3de79741784442"},this.code))))}static get watchers(){return{code:[{handleCodeChange:0}]}}static get style(){return f()}},[2,"ds-code-block",{code:[1],language:[1],filename:[1],copied:[32]},undefined,{code:[{handleCodeChange:0}]}]);function m(){if(typeof customElements==="undefined"){return}const e=["ds-code-block","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-code-block":if(!customElements.get(a(e))){customElements.define(a(e),p)}break;case"ds-badge":if(!customElements.get(a(e))){i()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){r()}break;case"ds-text":if(!customElements.get(a(e))){l()}break;case"ds-tooltip":if(!customElements.get(a(e))){b()}break}}))}m();export{p as C,m as d};
|
|
2
|
-
//# sourceMappingURL=p-BE9ladwu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["codeBlockCss","CodeBlock","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","code","language","filename","copied","copyFeedback","ClipboardFeedbackController","copy","async","connectedCallback","connect","handleCodeChange","reset","disconnectedCallback","disconnect","render","label","h","Host","key","class","as","variant","emphasis","color","side","size","icon","hasBorder","onDsClick"],"sources":["src/wc/components/CodeBlock/CodeBlock.css?tag=ds-code-block&encapsulation=scoped","src/wc/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n -webkit-user-select: none;\n user-select: none;\n}\n\n.code-block {\n width: 100%;\n min-width: 0;\n margin: 0;\n overflow: hidden;\n border-radius: var(--dimension-radius-050);\n background: var(--color-background-strong-neutral);\n color: var(--color-foreground-faint-neutral);\n box-sizing: border-box;\n}\n\n.code-block__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--dimension-space-100);\n min-height: var(--dimension-size-400);\n padding: var(--dimension-space-050) var(--dimension-space-100);\n background: var(--color-background-strong-neutral);\n box-sizing: border-box;\n}\n\npre {\n margin: 0;\n padding: var(--dimension-space-150);\n overflow: auto;\n font-family: var(\n --typography-font-family-code,\n 'Fira Code',\n ui-monospace,\n 'SFMono-Regular',\n 'Cascadia Code',\n 'Roboto Mono',\n Menlo,\n Monaco,\n Consolas,\n 'Liberation Mono',\n monospace\n );\n font-size: var(--typography-fontsize-sm);\n font-variant-ligatures: var(--ds-code-font-variant-ligatures, normal);\n font-weight: var(--typography-weight-regular);\n line-height: var(--typography-lineheight-sm);\n letter-spacing: var(--typography-letterspacing-none);\n tab-size: 2;\n -webkit-user-select: text;\n user-select: text;\n}\n\ncode {\n font: inherit;\n white-space: pre;\n}\n","import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { ClipboardFeedbackController } from '../../utils/clipboard';\n\n@Component({\n tag: 'ds-code-block',\n styleUrl: 'CodeBlock.css',\n scoped: true,\n})\nexport class CodeBlock {\n @Prop() code: string = '';\n @Prop() language: string = '';\n @Prop() filename: string = '';\n\n @State() private copied: boolean = false;\n private readonly copyFeedback = new ClipboardFeedbackController(copied => {\n this.copied = copied;\n });\n\n connectedCallback() {\n this.copyFeedback.connect();\n }\n\n @Watch('code')\n handleCodeChange() {\n this.copyFeedback.reset();\n }\n\n disconnectedCallback() {\n this.copyFeedback.disconnect();\n }\n\n private copy = async () => {\n await this.copyFeedback.copy(this.code);\n };\n\n render() {\n const label = this.filename || this.language || 'Code';\n return (\n <Host>\n <figure class=\"code-block\">\n <figcaption class=\"code-block__header\">\n <ds-text as=\"span\" variant=\"text-caption\" emphasis color=\"on-strong\">\n {label}\n </ds-text>\n <ds-tooltip label={this.copied ? 'Copied' : 'Copy code'} side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n variant=\"icon\"\n icon={this.copied ? 'Check' : 'Copy'}\n size=\"xs\"\n aria-label={this.copied ? 'Copied' : 'Copy code'}\n hasBorder={false}\n onDsClick={this.copy}\n />\n </ds-tooltip>\n </figcaption>\n <pre>\n <code>{this.code}</code>\n </pre>\n </figure>\n </Host>\n );\n }\n}\n"],"mappings":"uTAAA,MAAMA,EAAe,IAAM,wyC,MCQdC,EAASC,EAAA,MAAAD,UAAAE,EALtB,WAAAC,CAAAC,G,4CAMUC,KAAAC,KAAe,GACfD,KAAAE,SAAmB,GACnBF,KAAAG,SAAmB,GAEVH,KAAAI,OAAkB,MAClBJ,KAAAK,aAAe,IAAIC,GAA4BF,IAC9DJ,KAAKI,OAASA,CAAM,IAgBdJ,KAAAO,KAAOC,gBACPR,KAAKK,aAAaE,KAAKP,KAAKC,KAAK,CA8B1C,CA5CC,iBAAAQ,GACET,KAAKK,aAAaK,S,CAIpB,gBAAAC,GACEX,KAAKK,aAAaO,O,CAGpB,oBAAAC,GACEb,KAAKK,aAAaS,Y,CAOpB,MAAAC,GACE,MAAMC,EAAQhB,KAAKG,UAAYH,KAAKE,UAAY,OAChD,OACEe,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,UAAAE,IAAA,2CAAQC,MAAM,cACZH,EAAA,cAAAE,IAAA,2CAAYC,MAAM,sBAChBH,EAAA,WAAAE,IAAA,2CAASE,GAAG,OAAOC,QAAQ,eAAeC,SAAQ,KAACC,MAAM,aACtDR,GAEHC,EAAA,cAAAE,IAAA,2CAAYH,MAAOhB,KAAKI,OAAS,SAAW,YAAaqB,KAAK,SAASC,KAAK,MAC1ET,EAAA,sBAAAE,IAAA,2CACEG,QAAQ,OACRK,KAAM3B,KAAKI,OAAS,QAAU,OAC9BsB,KAAK,KAAI,aACG1B,KAAKI,OAAS,SAAW,YACrCwB,UAAW,MACXC,UAAW7B,KAAKO,SAItBU,EAAA,OAAAE,IAAA,4CACEF,EAAA,QAAAE,IAAA,4CAAOnB,KAAKC,Q","ignoreList":[]}
|
|
File without changes
|