@omegagrid/markdown 0.10.61 → 0.10.62

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.
@@ -1 +1 @@
1
- {"version":3,"file":"calloutBlock.d.ts","sourceRoot":"","sources":["../../../src/components/features/calloutBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAMzD,eAAO,MAAM,aAAa,6DAA8D,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,MAAM,CAAA;CAAE,CAMnF,CAAC;AA4FF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,QAAQ;;EAiFrD"}
1
+ {"version":3,"file":"calloutBlock.d.ts","sourceRoot":"","sources":["../../../src/components/features/calloutBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAMzD,eAAO,MAAM,aAAa,6DAA8D,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,MAAM,CAAA;CAAE,CAMnF,CAAC;AA4FF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,QAAQ;;EAwFrD"}
@@ -1 +1 @@
1
- var _CalloutBlockView_icon,_CalloutBlockView_select,_CalloutBlockView_label,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,l,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,l):o?o.value=l:t.set(e,l),l},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,l,i){if("a"===l&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===l?i:"a"===l?i.call(e):i?i.value:t.get(e)};import{msg}from"@omegagrid/localize";import{iconSvg}from"./utils";export const CALLOUT_KINDS=["note","tip","important","warning","caution"];export const CALLOUT_META={note:{icon:"circle-info",label:()=>msg("Note")},tip:{icon:"circle-check",label:()=>msg("Tip")},important:{icon:"comment",label:()=>msg("Important")},warning:{icon:"circle-exclamation",label:()=>msg("Warning")},caution:{icon:"circle-xmark",label:()=>msg("Caution")}};const KIND_SET=new Set(CALLOUT_KINDS),normalizeKind=e=>"string"==typeof e&&KIND_SET.has(e.toLowerCase())?e.toLowerCase():"note";function walkTree(e,t){if(e.children)for(let l=e.children.length-1;l>=0;l--)t(e.children[l],l,e),walkTree(e.children[l],t)}class CalloutBlockView{constructor(e,t,l,i){this.md=e,this.node=t,this.view=l,this.getPos=i,_CalloutBlockView_icon.set(this,void 0),_CalloutBlockView_select.set(this,void 0),_CalloutBlockView_label.set(this,void 0);const o=normalizeKind(t.attrs.kind);this.dom=document.createElement("div"),this.dom.className="og-callout",this.dom.setAttribute("data-kind",o);const a=document.createElement("div");if(a.className="og-callout-header",a.contentEditable="false",__classPrivateFieldSet(this,_CalloutBlockView_icon,document.createElement("span"),"f"),__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").className="og-callout-icon",__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").innerHTML=iconSvg(CALLOUT_META[o].icon),l.editable){const e=document.createElement("select");e.className="og-callout-select";for(const t of CALLOUT_KINDS){const l=document.createElement("option");l.value=t,l.textContent=CALLOUT_META[t].label(),t===o&&(l.selected=!0),e.appendChild(l)}e.addEventListener("change",(()=>{this.view.dispatch(this.view.state.tr.setNodeAttribute(this.getPos()??0,"kind",e.value))})),__classPrivateFieldSet(this,_CalloutBlockView_select,e,"f"),a.append(__classPrivateFieldGet(this,_CalloutBlockView_icon,"f"),e)}else __classPrivateFieldSet(this,_CalloutBlockView_label,document.createElement("span"),"f"),__classPrivateFieldGet(this,_CalloutBlockView_label,"f").className="og-callout-label",__classPrivateFieldGet(this,_CalloutBlockView_label,"f").textContent=CALLOUT_META[o].label(),a.append(__classPrivateFieldGet(this,_CalloutBlockView_icon,"f"),__classPrivateFieldGet(this,_CalloutBlockView_label,"f"));this.contentDOM=document.createElement("div"),this.contentDOM.className="og-callout-body",this.dom.append(a,this.contentDOM)}update(e){if(e.type!==this.node.type)return!1;this.node=e;const t=normalizeKind(e.attrs.kind);return this.dom.setAttribute("data-kind",t),__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").innerHTML=iconSvg(CALLOUT_META[t].icon),__classPrivateFieldGet(this,_CalloutBlockView_select,"f")&&__classPrivateFieldGet(this,_CalloutBlockView_select,"f").value!==t&&(__classPrivateFieldGet(this,_CalloutBlockView_select,"f").value=t),__classPrivateFieldGet(this,_CalloutBlockView_label,"f")&&(__classPrivateFieldGet(this,_CalloutBlockView_label,"f").textContent=CALLOUT_META[t].label()),!0}stopEvent(e){return!this.contentDOM.contains(e.target)}ignoreMutation(e){return"selection"!==e.type&&!this.contentDOM.contains(e.target)}}_CalloutBlockView_icon=new WeakMap,_CalloutBlockView_select=new WeakMap,_CalloutBlockView_label=new WeakMap;export function createCalloutBlock(e){const t=e.utils.$remark("remarkCalloutPlugin",(()=>()=>e=>{walkTree(e,((e,t,l)=>{if("blockquote"!==e.type||!e.children?.length)return;const i=e.children[0];if("paragraph"!==i.type||!i.children?.length)return;const o=i.children[0];if("text"!==o.type||"string"!=typeof o.value)return;const a=o.value.match(/^\[!(note|tip|important|warning|caution)\][^\S\n]*/i);if(!a)return;const n=a[1].toLowerCase(),c=i.children.slice(),s=o.value.slice(a[0].length).replace(/^\n/,"");s.length?c[0]={...o,value:s}:(c.shift(),"break"===c[0]?.type&&c.shift());const r=[];c.length&&r.push({...i,children:c}),r.push(...e.children.slice(1)),r.length||r.push({type:"paragraph",children:[]}),l.children[t]={type:"callout",kind:n,children:r}}))})),l=e.utils.$nodeSchema("callout",(()=>({content:"block+",group:"block",defining:!0,attrs:{kind:{default:"note"}},parseDOM:[{tag:"div[data-callout]",contentElement:".og-callout-body",getAttrs:e=>({kind:normalizeKind(e.getAttribute("data-callout"))})}],toDOM:e=>{const t=normalizeKind(e.attrs.kind);return["div",{"data-callout":t,class:`og-callout og-callout-${t}`},["div",{class:"og-callout-header",contenteditable:"false"},CALLOUT_META[t].label()],["div",{class:"og-callout-body"},0]]},parseMarkdown:{match:e=>"callout"===e.type,runner:(e,t,l)=>{e.openNode(l,{kind:normalizeKind(t.kind)}).next(t.children).closeNode()}},toMarkdown:{match:e=>"callout"===e.type.name,runner:(e,t)=>{const l=normalizeKind(t.attrs.kind).toUpperCase();e.openNode("blockquote"),e.openNode("paragraph"),e.addNode("text",void 0,`[!${l}]`),e.closeNode(),e.next(t.content),e.closeNode()}}}))),i=e.utils.$view(l.node,(()=>(t,l,i)=>new CalloutBlockView(e,t,l,i)));return{plugins:[...t,...l,i].flat()}}
1
+ var _CalloutBlockView_icon,_CalloutBlockView_select,_CalloutBlockView_label,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,l,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(e,l):i?i.value=l:t.set(e,l),l},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,l,o){if("a"===l&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===l?o:"a"===l?o.call(e):o?o.value:t.get(e)};import{msg}from"@omegagrid/localize";import{iconSvg}from"./utils";export const CALLOUT_KINDS=["note","tip","important","warning","caution"];export const CALLOUT_META={note:{icon:"circle-info",label:()=>msg("Note")},tip:{icon:"circle-check",label:()=>msg("Tip")},important:{icon:"comment",label:()=>msg("Important")},warning:{icon:"circle-exclamation",label:()=>msg("Warning")},caution:{icon:"circle-xmark",label:()=>msg("Caution")}};const KIND_SET=new Set(CALLOUT_KINDS),normalizeKind=e=>"string"==typeof e&&KIND_SET.has(e.toLowerCase())?e.toLowerCase():"note";function walkTree(e,t){if(e.children)for(let l=e.children.length-1;l>=0;l--)t(e.children[l],l,e),walkTree(e.children[l],t)}class CalloutBlockView{constructor(e,t,l,o){this.md=e,this.node=t,this.view=l,this.getPos=o,_CalloutBlockView_icon.set(this,void 0),_CalloutBlockView_select.set(this,void 0),_CalloutBlockView_label.set(this,void 0);const i=normalizeKind(t.attrs.kind);this.dom=document.createElement("div"),this.dom.className="og-callout",this.dom.setAttribute("data-kind",i);const a=document.createElement("div");if(a.className="og-callout-header",a.contentEditable="false",__classPrivateFieldSet(this,_CalloutBlockView_icon,document.createElement("span"),"f"),__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").className="og-callout-icon",__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").innerHTML=iconSvg(CALLOUT_META[i].icon),l.editable){const e=document.createElement("select");e.className="og-callout-select";for(const t of CALLOUT_KINDS){const l=document.createElement("option");l.value=t,l.textContent=CALLOUT_META[t].label(),t===i&&(l.selected=!0),e.appendChild(l)}e.addEventListener("change",(()=>{this.view.dispatch(this.view.state.tr.setNodeAttribute(this.getPos()??0,"kind",e.value))})),__classPrivateFieldSet(this,_CalloutBlockView_select,e,"f"),a.append(__classPrivateFieldGet(this,_CalloutBlockView_icon,"f"),e)}else __classPrivateFieldSet(this,_CalloutBlockView_label,document.createElement("span"),"f"),__classPrivateFieldGet(this,_CalloutBlockView_label,"f").className="og-callout-label",__classPrivateFieldGet(this,_CalloutBlockView_label,"f").textContent=CALLOUT_META[i].label(),a.append(__classPrivateFieldGet(this,_CalloutBlockView_icon,"f"),__classPrivateFieldGet(this,_CalloutBlockView_label,"f"));this.contentDOM=document.createElement("div"),this.contentDOM.className="og-callout-body",this.dom.append(a,this.contentDOM)}update(e){if(e.type!==this.node.type)return!1;this.node=e;const t=normalizeKind(e.attrs.kind);return this.dom.setAttribute("data-kind",t),__classPrivateFieldGet(this,_CalloutBlockView_icon,"f").innerHTML=iconSvg(CALLOUT_META[t].icon),__classPrivateFieldGet(this,_CalloutBlockView_select,"f")&&__classPrivateFieldGet(this,_CalloutBlockView_select,"f").value!==t&&(__classPrivateFieldGet(this,_CalloutBlockView_select,"f").value=t),__classPrivateFieldGet(this,_CalloutBlockView_label,"f")&&(__classPrivateFieldGet(this,_CalloutBlockView_label,"f").textContent=CALLOUT_META[t].label()),!0}stopEvent(e){return!this.contentDOM.contains(e.target)}ignoreMutation(e){return"selection"!==e.type&&!this.contentDOM.contains(e.target)}}_CalloutBlockView_icon=new WeakMap,_CalloutBlockView_select=new WeakMap,_CalloutBlockView_label=new WeakMap;export function createCalloutBlock(e){const t=e.utils.$remark("remarkCalloutPlugin",(()=>()=>e=>{walkTree(e,((e,t,l)=>{if("blockquote"!==e.type||!e.children?.length)return;const o=e.children[0];if("paragraph"!==o.type||!o.children?.length)return;const i=o.children[0];if("text"!==i.type||"string"!=typeof i.value)return;const a=i.value.match(/^\[!(note|tip|important|warning|caution)\][^\S\n]*/i);if(!a)return;const n=a[1].toLowerCase(),c=o.children.slice(),s=i.value.slice(a[0].length).replace(/^\n/,"");s.length?c[0]={...i,value:s}:(c.shift(),"break"===c[0]?.type&&c.shift());const r=[];c.length&&r.push({...o,children:c}),r.push(...e.children.slice(1)),r.length||r.push({type:"paragraph",children:[]}),l.children[t]={type:"callout",kind:n,children:r}}))})),l=e.utils.$nodeSchema("callout",(()=>({content:"block+",group:"block",defining:!0,attrs:{kind:{default:"note"}},parseDOM:[{tag:"blockquote[data-callout]",priority:70,contentElement:".og-callout-body",getAttrs:e=>({kind:normalizeKind(e.getAttribute("data-callout"))})},{tag:"div[data-callout]",contentElement:".og-callout-body",getAttrs:e=>({kind:normalizeKind(e.getAttribute("data-callout"))})}],toDOM:e=>{const t=normalizeKind(e.attrs.kind);return["blockquote",{"data-callout":t,class:`og-callout og-callout-${t}`},["p",{class:"og-callout-title"},CALLOUT_META[t].label()],["div",{class:"og-callout-body"},0]]},parseMarkdown:{match:e=>"callout"===e.type,runner:(e,t,l)=>{e.openNode(l,{kind:normalizeKind(t.kind)}).next(t.children).closeNode()}},toMarkdown:{match:e=>"callout"===e.type.name,runner:(e,t)=>{const l=normalizeKind(t.attrs.kind).toUpperCase();e.openNode("blockquote"),e.openNode("paragraph"),e.addNode("text",void 0,`[!${l}]`),e.closeNode(),e.next(t.content),e.closeNode()}}}))),o=e.utils.$view(l.node,(()=>(t,l,o)=>new CalloutBlockView(e,t,l,o)));return{plugins:[...t,...l,o].flat()}}
@@ -1 +1 @@
1
- {"version":3,"file":"calloutBlock.js","sourceRoot":"","sources":["../../../src/components/features/calloutBlock.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAGzF,MAAM,CAAC,MAAM,YAAY,GAA+D;IACvF,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;IACvD,GAAG,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACtD,SAAS,EAAE,EAAE,IAAI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AE,CACzE,IAAI,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IAElE,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import type * as milkdown from '@omegagrid/milkdown-kit';\nimport type { NodeView, EditorView } from '@omegagrid/milkdown-kit/dist/prose/view';\nimport type { Node } from '@omegagrid/milkdown-kit/dist/prose/model';\nimport { msg } from '@omegagrid/localize';\nimport { iconSvg } from './utils';\n\nexport const CALLOUT_KINDS = ['note', 'tip', 'important', 'warning', 'caution'] as const;\nexport type CalloutKind = (typeof CALLOUT_KINDS)[number];\n\nexport const CALLOUT_META: Record<CalloutKind, { icon: string; label: () => string }> = {\n\tnote: { icon: 'circle-info', label: () => msg('Note') },\n\ttip: { icon: 'circle-check', label: () => msg('Tip') },\n\timportant: { icon: 'comment', label: () => msg('Important') },\n\twarning: { icon: 'circle-exclamation', label: () => msg('Warning') },\n\tcaution: { icon: 'circle-xmark', label: () => msg('Caution') },\n};\n\nconst KIND_SET = new Set<string>(CALLOUT_KINDS);\nconst normalizeKind = (value: unknown): CalloutKind =>\n\ttypeof value === 'string' && KIND_SET.has(value.toLowerCase()) ? (value.toLowerCase() as CalloutKind) : 'note';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction walkTree(tree: any, callback: (node: any, index: number, parent: any) => void) {\n\tif (tree.children) {\n\t\tfor (let i = tree.children.length - 1; i >= 0; i--) {\n\t\t\tcallback(tree.children[i], i, tree);\n\t\t\twalkTree(tree.children[i], callback);\n\t\t}\n\t}\n}\n\nclass CalloutBlockView implements NodeView {\n\tdom: HTMLElement;\n\tcontentDOM: HTMLElement;\n\t#icon: HTMLElement;\n\t#select?: HTMLSelectElement;\n\t#label?: HTMLElement;\n\n\tconstructor(\n\t\tpublic md: typeof milkdown,\n\t\tpublic node: Node,\n\t\tpublic view: EditorView,\n\t\tpublic getPos: () => number | undefined\n\t) {\n\t\tconst kind = normalizeKind(node.attrs.kind);\n\n\t\tthis.dom = document.createElement('div');\n\t\tthis.dom.className = 'og-callout';\n\t\tthis.dom.setAttribute('data-kind', kind);\n\n\t\tconst header = document.createElement('div');\n\t\theader.className = 'og-callout-header';\n\t\theader.contentEditable = 'false';\n\n\t\tthis.#icon = document.createElement('span');\n\t\tthis.#icon.className = 'og-callout-icon';\n\t\tthis.#icon.innerHTML = iconSvg(CALLOUT_META[kind].icon);\n\n\t\tif (view.editable) {\n\t\t\tconst select = document.createElement('select');\n\t\t\tselect.className = 'og-callout-select';\n\t\t\tfor (const k of CALLOUT_KINDS) {\n\t\t\t\tconst opt = document.createElement('option');\n\t\t\t\topt.value = k;\n\t\t\t\topt.textContent = CALLOUT_META[k].label();\n\t\t\t\tif (k === kind) opt.selected = true;\n\t\t\t\tselect.appendChild(opt);\n\t\t\t}\n\t\t\tselect.addEventListener('change', () => {\n\t\t\t\tthis.view.dispatch(this.view.state.tr.setNodeAttribute(this.getPos() ?? 0, 'kind', select.value));\n\t\t\t});\n\t\t\tthis.#select = select;\n\t\t\theader.append(this.#icon, select);\n\t\t} else {\n\t\t\tthis.#label = document.createElement('span');\n\t\t\tthis.#label.className = 'og-callout-label';\n\t\t\tthis.#label.textContent = CALLOUT_META[kind].label();\n\t\t\theader.append(this.#icon, this.#label);\n\t\t}\n\n\t\tthis.contentDOM = document.createElement('div');\n\t\tthis.contentDOM.className = 'og-callout-body';\n\n\t\tthis.dom.append(header, this.contentDOM);\n\t}\n\n\tupdate(node: Node) {\n\t\tif (node.type !== this.node.type) return false;\n\t\tthis.node = node;\n\t\tconst kind = normalizeKind(node.attrs.kind);\n\t\tthis.dom.setAttribute('data-kind', kind);\n\t\tthis.#icon.innerHTML = iconSvg(CALLOUT_META[kind].icon);\n\t\tif (this.#select && this.#select.value !== kind) this.#select.value = kind;\n\t\tif (this.#label) this.#label.textContent = CALLOUT_META[kind].label();\n\t\treturn true;\n\t}\n\n\tstopEvent(e: Event) {\n\t\treturn !this.contentDOM.contains(e.target as HTMLElement);\n\t}\n\n\tignoreMutation(m: Parameters<NonNullable<NodeView['ignoreMutation']>>[0]) {\n\t\tif (m.type === 'selection') return false;\n\t\treturn !this.contentDOM.contains(m.target);\n\t}\n}\n\nexport function createCalloutBlock(md: typeof milkdown) {\n\tconst remarkPlugin = md.utils.$remark('remarkCalloutPlugin', () => () => (tree: unknown) => {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\twalkTree(tree, (node: any, index: number, parent: any) => {\n\t\t\tif (node.type !== 'blockquote' || !node.children?.length) return;\n\t\t\tconst first = node.children[0];\n\t\t\tif (first.type !== 'paragraph' || !first.children?.length) return;\n\t\t\tconst firstText = first.children[0];\n\t\t\tif (firstText.type !== 'text' || typeof firstText.value !== 'string') return;\n\n\t\t\tconst match = firstText.value.match(/^\\[!(note|tip|important|warning|caution)\\][^\\S\\n]*/i);\n\t\t\tif (!match) return;\n\t\t\tconst kind = match[1].toLowerCase();\n\n\t\t\t// Strip the \"[!KIND]\" marker from the first paragraph.\n\t\t\tconst paraChildren = first.children.slice();\n\t\t\tconst rest = firstText.value.slice(match[0].length).replace(/^\\n/, '');\n\t\t\tif (rest.length) {\n\t\t\t\tparaChildren[0] = { ...firstText, value: rest };\n\t\t\t} else {\n\t\t\t\tparaChildren.shift();\n\t\t\t\tif (paraChildren[0]?.type === 'break') paraChildren.shift();\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tconst calloutChildren: any[] = [];\n\t\t\tif (paraChildren.length) calloutChildren.push({ ...first, children: paraChildren });\n\t\t\tcalloutChildren.push(...node.children.slice(1));\n\t\t\tif (!calloutChildren.length) calloutChildren.push({ type: 'paragraph', children: [] });\n\n\t\t\tparent.children[index] = { type: 'callout', kind, children: calloutChildren };\n\t\t});\n\t});\n\n\tconst nodeSchema = md.utils.$nodeSchema('callout', () => ({\n\t\tcontent: 'block+',\n\t\tgroup: 'block',\n\t\tdefining: true,\n\t\tattrs: { kind: { default: 'note' } },\n\t\tparseDOM: [{\n\t\t\ttag: 'div[data-callout]',\n\t\t\tcontentElement: '.og-callout-body',\n\t\t\tgetAttrs: (dom: HTMLElement) => ({ kind: normalizeKind(dom.getAttribute('data-callout')) }),\n\t\t}],\n\t\ttoDOM: (node: Node) => {\n\t\t\tconst kind = normalizeKind(node.attrs.kind);\n\t\t\treturn ['div', { 'data-callout': kind, class: `og-callout og-callout-${kind}` },\n\t\t\t\t['div', { class: 'og-callout-header', contenteditable: 'false' }, CALLOUT_META[kind].label()],\n\t\t\t\t['div', { class: 'og-callout-body' }, 0],\n\t\t\t] as const;\n\t\t},\n\t\tparseMarkdown: {\n\t\t\tmatch: (mdNode: { type: string }) => mdNode.type === 'callout',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\trunner: (state: any, node: any, type: any) => {\n\t\t\t\tstate.openNode(type, { kind: normalizeKind(node.kind) }).next(node.children).closeNode();\n\t\t\t},\n\t\t},\n\t\ttoMarkdown: {\n\t\t\tmatch: (node: Node) => node.type.name === 'callout',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\trunner: (state: any, node: Node) => {\n\t\t\t\tconst kind = normalizeKind(node.attrs.kind).toUpperCase();\n\t\t\t\tstate.openNode('blockquote');\n\t\t\t\tstate.openNode('paragraph');\n\t\t\t\tstate.addNode('text', undefined, `[!${kind}]`);\n\t\t\t\tstate.closeNode();\n\t\t\t\tstate.next(node.content);\n\t\t\t\tstate.closeNode();\n\t\t\t},\n\t\t},\n\t}));\n\n\tconst nodeView = md.utils.$view(nodeSchema.node, () => {\n\t\treturn (node: Node, view: EditorView, getPos: () => number | undefined) =>\n\t\t\tnew CalloutBlockView(md, node, view, getPos);\n\t});\n\n\tconst plugins = [...remarkPlugin, ...nodeSchema, nodeView].flat();\n\n\treturn { plugins };\n}\n"]}
1
+ {"version":3,"file":"calloutBlock.js","sourceRoot":"","sources":["../../../src/components/features/calloutBlock.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAGzF,MAAM,CAAC,MAAM,YAAY,GAA+D;IACvF,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;IACvD,GAAG,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACtD,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;IAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;IACpE,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;CAC9D,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,aAAa,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,CAAC,KAAc,EAAe,EAAE,CACrD,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,WAAW,EAAkB,CAAC,CAAC,CAAC,MAAM,CAAC;AAEhH,8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AAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC;YAC1F,CAAC;SACD;QACD,UAAU,EAAE;YACX,KAAK,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;YACnD,8DAA8D;YAC9D,MAAM,EAAE,CAAC,KAAU,EAAE,IAAU,EAAE,EAAE;gBAClC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC1D,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;gBAC7B,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;gBAC5B,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC;gBAC/C,KAAK,CAAC,SAAS,EAAE,CAAC;gBAClB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzB,KAAK,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC;SACD;KACD,CAAC,CAAC,CAAC;IAEJ,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE;QACrD,OAAO,CAAC,IAAU,EAAE,IAAgB,EAAE,MAAgC,EAAE,EAAE,CACzE,IAAI,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IAElE,OAAO,EAAE,OAAO,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import type * as milkdown from '@omegagrid/milkdown-kit';\nimport type { NodeView, EditorView } from '@omegagrid/milkdown-kit/dist/prose/view';\nimport type { Node } from '@omegagrid/milkdown-kit/dist/prose/model';\nimport { msg } from '@omegagrid/localize';\nimport { iconSvg } from './utils';\n\nexport const CALLOUT_KINDS = ['note', 'tip', 'important', 'warning', 'caution'] as const;\nexport type CalloutKind = (typeof CALLOUT_KINDS)[number];\n\nexport const CALLOUT_META: Record<CalloutKind, { icon: string; label: () => string }> = {\n\tnote: { icon: 'circle-info', label: () => msg('Note') },\n\ttip: { icon: 'circle-check', label: () => msg('Tip') },\n\timportant: { icon: 'comment', label: () => msg('Important') },\n\twarning: { icon: 'circle-exclamation', label: () => msg('Warning') },\n\tcaution: { icon: 'circle-xmark', label: () => msg('Caution') },\n};\n\nconst KIND_SET = new Set<string>(CALLOUT_KINDS);\nconst normalizeKind = (value: unknown): CalloutKind =>\n\ttypeof value === 'string' && KIND_SET.has(value.toLowerCase()) ? (value.toLowerCase() as CalloutKind) : 'note';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction walkTree(tree: any, callback: (node: any, index: number, parent: any) => void) {\n\tif (tree.children) {\n\t\tfor (let i = tree.children.length - 1; i >= 0; i--) {\n\t\t\tcallback(tree.children[i], i, tree);\n\t\t\twalkTree(tree.children[i], callback);\n\t\t}\n\t}\n}\n\nclass CalloutBlockView implements NodeView {\n\tdom: HTMLElement;\n\tcontentDOM: HTMLElement;\n\t#icon: HTMLElement;\n\t#select?: HTMLSelectElement;\n\t#label?: HTMLElement;\n\n\tconstructor(\n\t\tpublic md: typeof milkdown,\n\t\tpublic node: Node,\n\t\tpublic view: EditorView,\n\t\tpublic getPos: () => number | undefined\n\t) {\n\t\tconst kind = normalizeKind(node.attrs.kind);\n\n\t\tthis.dom = document.createElement('div');\n\t\tthis.dom.className = 'og-callout';\n\t\tthis.dom.setAttribute('data-kind', kind);\n\n\t\tconst header = document.createElement('div');\n\t\theader.className = 'og-callout-header';\n\t\theader.contentEditable = 'false';\n\n\t\tthis.#icon = document.createElement('span');\n\t\tthis.#icon.className = 'og-callout-icon';\n\t\tthis.#icon.innerHTML = iconSvg(CALLOUT_META[kind].icon);\n\n\t\tif (view.editable) {\n\t\t\tconst select = document.createElement('select');\n\t\t\tselect.className = 'og-callout-select';\n\t\t\tfor (const k of CALLOUT_KINDS) {\n\t\t\t\tconst opt = document.createElement('option');\n\t\t\t\topt.value = k;\n\t\t\t\topt.textContent = CALLOUT_META[k].label();\n\t\t\t\tif (k === kind) opt.selected = true;\n\t\t\t\tselect.appendChild(opt);\n\t\t\t}\n\t\t\tselect.addEventListener('change', () => {\n\t\t\t\tthis.view.dispatch(this.view.state.tr.setNodeAttribute(this.getPos() ?? 0, 'kind', select.value));\n\t\t\t});\n\t\t\tthis.#select = select;\n\t\t\theader.append(this.#icon, select);\n\t\t} else {\n\t\t\tthis.#label = document.createElement('span');\n\t\t\tthis.#label.className = 'og-callout-label';\n\t\t\tthis.#label.textContent = CALLOUT_META[kind].label();\n\t\t\theader.append(this.#icon, this.#label);\n\t\t}\n\n\t\tthis.contentDOM = document.createElement('div');\n\t\tthis.contentDOM.className = 'og-callout-body';\n\n\t\tthis.dom.append(header, this.contentDOM);\n\t}\n\n\tupdate(node: Node) {\n\t\tif (node.type !== this.node.type) return false;\n\t\tthis.node = node;\n\t\tconst kind = normalizeKind(node.attrs.kind);\n\t\tthis.dom.setAttribute('data-kind', kind);\n\t\tthis.#icon.innerHTML = iconSvg(CALLOUT_META[kind].icon);\n\t\tif (this.#select && this.#select.value !== kind) this.#select.value = kind;\n\t\tif (this.#label) this.#label.textContent = CALLOUT_META[kind].label();\n\t\treturn true;\n\t}\n\n\tstopEvent(e: Event) {\n\t\treturn !this.contentDOM.contains(e.target as HTMLElement);\n\t}\n\n\tignoreMutation(m: Parameters<NonNullable<NodeView['ignoreMutation']>>[0]) {\n\t\tif (m.type === 'selection') return false;\n\t\treturn !this.contentDOM.contains(m.target);\n\t}\n}\n\nexport function createCalloutBlock(md: typeof milkdown) {\n\tconst remarkPlugin = md.utils.$remark('remarkCalloutPlugin', () => () => (tree: unknown) => {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\twalkTree(tree, (node: any, index: number, parent: any) => {\n\t\t\tif (node.type !== 'blockquote' || !node.children?.length) return;\n\t\t\tconst first = node.children[0];\n\t\t\tif (first.type !== 'paragraph' || !first.children?.length) return;\n\t\t\tconst firstText = first.children[0];\n\t\t\tif (firstText.type !== 'text' || typeof firstText.value !== 'string') return;\n\n\t\t\tconst match = firstText.value.match(/^\\[!(note|tip|important|warning|caution)\\][^\\S\\n]*/i);\n\t\t\tif (!match) return;\n\t\t\tconst kind = match[1].toLowerCase();\n\n\t\t\t// Strip the \"[!KIND]\" marker from the first paragraph.\n\t\t\tconst paraChildren = first.children.slice();\n\t\t\tconst rest = firstText.value.slice(match[0].length).replace(/^\\n/, '');\n\t\t\tif (rest.length) {\n\t\t\t\tparaChildren[0] = { ...firstText, value: rest };\n\t\t\t} else {\n\t\t\t\tparaChildren.shift();\n\t\t\t\tif (paraChildren[0]?.type === 'break') paraChildren.shift();\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tconst calloutChildren: any[] = [];\n\t\t\tif (paraChildren.length) calloutChildren.push({ ...first, children: paraChildren });\n\t\t\tcalloutChildren.push(...node.children.slice(1));\n\t\t\tif (!calloutChildren.length) calloutChildren.push({ type: 'paragraph', children: [] });\n\n\t\t\tparent.children[index] = { type: 'callout', kind, children: calloutChildren };\n\t\t});\n\t});\n\n\tconst nodeSchema = md.utils.$nodeSchema('callout', () => ({\n\t\tcontent: 'block+',\n\t\tgroup: 'block',\n\t\tdefining: true,\n\t\tattrs: { kind: { default: 'note' } },\n\t\tparseDOM: [{\n\t\t\ttag: 'blockquote[data-callout]',\n\t\t\tpriority: 70,\n\t\t\tcontentElement: '.og-callout-body',\n\t\t\tgetAttrs: (dom: HTMLElement) => ({ kind: normalizeKind(dom.getAttribute('data-callout')) }),\n\t\t}, {\n\t\t\ttag: 'div[data-callout]',\n\t\t\tcontentElement: '.og-callout-body',\n\t\t\tgetAttrs: (dom: HTMLElement) => ({ kind: normalizeKind(dom.getAttribute('data-callout')) }),\n\t\t}],\n\t\ttoDOM: (node: Node) => {\n\t\t\tconst kind = normalizeKind(node.attrs.kind);\n\t\t\t// ProseMirror requires the content hole (0) to be the only child of its\n\t\t\t// parent, so the body must be wrapped rather than placed on the blockquote.\n\t\t\treturn ['blockquote', { 'data-callout': kind, class: `og-callout og-callout-${kind}` },\n\t\t\t\t['p', { class: 'og-callout-title' }, CALLOUT_META[kind].label()],\n\t\t\t\t['div', { class: 'og-callout-body' }, 0],\n\t\t\t] as const;\n\t\t},\n\t\tparseMarkdown: {\n\t\t\tmatch: (mdNode: { type: string }) => mdNode.type === 'callout',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\trunner: (state: any, node: any, type: any) => {\n\t\t\t\tstate.openNode(type, { kind: normalizeKind(node.kind) }).next(node.children).closeNode();\n\t\t\t},\n\t\t},\n\t\ttoMarkdown: {\n\t\t\tmatch: (node: Node) => node.type.name === 'callout',\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\trunner: (state: any, node: Node) => {\n\t\t\t\tconst kind = normalizeKind(node.attrs.kind).toUpperCase();\n\t\t\t\tstate.openNode('blockquote');\n\t\t\t\tstate.openNode('paragraph');\n\t\t\t\tstate.addNode('text', undefined, `[!${kind}]`);\n\t\t\t\tstate.closeNode();\n\t\t\t\tstate.next(node.content);\n\t\t\t\tstate.closeNode();\n\t\t\t},\n\t\t},\n\t}));\n\n\tconst nodeView = md.utils.$view(nodeSchema.node, () => {\n\t\treturn (node: Node, view: EditorView, getPos: () => number | undefined) =>\n\t\t\tnew CalloutBlockView(md, node, view, getPos);\n\t});\n\n\tconst plugins = [...remarkPlugin, ...nodeSchema, nodeView].flat();\n\n\treturn { plugins };\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export * from './markdownView';
2
2
  export * from './markdownEditor';
3
3
  export * from './features';
4
+ export { markdownContentStyles } from './styles/content';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- export*from"./markdownView";export*from"./markdownEditor";export*from"./features";
1
+ export*from"./markdownView";export*from"./markdownEditor";export*from"./features";export{markdownContentStyles}from"./styles/content";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC","sourcesContent":["export * from './markdownView';\nexport * from './markdownEditor';\nexport * from './features';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export * from './markdownView';\nexport * from './markdownEditor';\nexport * from './features';\nexport { markdownContentStyles } from './styles/content';"]}
@@ -1,7 +1,7 @@
1
1
  import{css}from"lit";export const style=css`
2
2
  .og-callout {
3
3
  border-left: 4px solid var(--og-callout-color, #4a9eff);
4
- background-color: var(--og-callout-bg, rgba(74, 158, 255, 0.08));
4
+ background-color: var(--og-background-color-3);
5
5
  padding: 8px 12px;
6
6
  margin: 8px 0;
7
7
  border-radius: 0 4px 4px 0;
@@ -48,9 +48,9 @@ import{css}from"lit";export const style=css`
48
48
  .og-callout-body > :first-child { margin-top: 0; }
49
49
  .og-callout-body > :last-child { margin-bottom: 0; }
50
50
 
51
- .og-callout[data-kind="note"] { --og-callout-color: #4a9eff; --og-callout-bg: rgba(74, 158, 255, 0.08); }
52
- .og-callout[data-kind="tip"] { --og-callout-color: #3fb950; --og-callout-bg: rgba(63, 185, 80, 0.08); }
53
- .og-callout[data-kind="important"] { --og-callout-color: #a371f7; --og-callout-bg: rgba(163, 113, 247, 0.08); }
54
- .og-callout[data-kind="warning"] { --og-callout-color: #d29922; --og-callout-bg: rgba(210, 153, 34, 0.10); }
55
- .og-callout[data-kind="caution"] { --og-callout-color: #f85149; --og-callout-bg: rgba(248, 81, 73, 0.08); }
51
+ .og-callout[data-kind="note"] { --og-callout-color: var(--og-colortype-accent-background-color); }
52
+ .og-callout[data-kind="tip"] { --og-callout-color: var(--og-colortype-green-background-color); }
53
+ .og-callout[data-kind="important"] { --og-callout-color: var(--og-colortype-blue-background-color); }
54
+ .og-callout[data-kind="warning"] { --og-callout-color: var(--og-colortype-yellow-background-color); }
55
+ .og-callout[data-kind="caution"] { --og-callout-color: var(--og-colortype-red-background-color); }
56
56
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../src/components/styles/callout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t.og-callout {\n\t\tborder-left: 4px solid var(--og-callout-color, #4a9eff);\n\t\tbackground-color: var(--og-callout-bg, rgba(74, 158, 255, 0.08));\n\t\tpadding: 8px 12px;\n\t\tmargin: 8px 0;\n\t\tborder-radius: 0 4px 4px 0;\n\t}\n\n\t.og-callout-header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tfont-weight: 600;\n\t\tcolor: var(--og-callout-color, #4a9eff);\n\t\tmargin-bottom: 4px;\n\t\tuser-select: none;\n\t}\n\n\t.og-callout-icon {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t}\n\n\t.og-callout-icon svg {\n\t\twidth: 1em;\n\t\theight: 1em;\n\t\tfill: currentColor;\n\t}\n\n\t.og-callout-select {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tfont-size: 0.9em;\n\t\tcursor: pointer;\n\t\toutline: none;\n\t\tpadding: 0 2px;\n\t}\n\n\t.og-callout-select option {\n\t\tcolor: var(--og-text-color, inherit);\n\t\tbackground-color: var(--og-background-color);\n\t\tfont-weight: normal;\n\t}\n\n\t.og-callout-body > :first-child { margin-top: 0; }\n\t.og-callout-body > :last-child { margin-bottom: 0; }\n\n\t.og-callout[data-kind=\"note\"] { --og-callout-color: #4a9eff; --og-callout-bg: rgba(74, 158, 255, 0.08); }\n\t.og-callout[data-kind=\"tip\"] { --og-callout-color: #3fb950; --og-callout-bg: rgba(63, 185, 80, 0.08); }\n\t.og-callout[data-kind=\"important\"] { --og-callout-color: #a371f7; --og-callout-bg: rgba(163, 113, 247, 0.08); }\n\t.og-callout[data-kind=\"warning\"] { --og-callout-color: #d29922; --og-callout-bg: rgba(210, 153, 34, 0.10); }\n\t.og-callout[data-kind=\"caution\"] { --og-callout-color: #f85149; --og-callout-bg: rgba(248, 81, 73, 0.08); }\n`;\n"]}
1
+ {"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../src/components/styles/callout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t.og-callout {\n\t\tborder-left: 4px solid var(--og-callout-color, #4a9eff);\n\t\tbackground-color: var(--og-background-color-3);\n\t\tpadding: 8px 12px;\n\t\tmargin: 8px 0;\n\t\tborder-radius: 0 4px 4px 0;\n\t}\n\n\t.og-callout-header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tfont-weight: 600;\n\t\tcolor: var(--og-callout-color, #4a9eff);\n\t\tmargin-bottom: 4px;\n\t\tuser-select: none;\n\t}\n\n\t.og-callout-icon {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t}\n\n\t.og-callout-icon svg {\n\t\twidth: 1em;\n\t\theight: 1em;\n\t\tfill: currentColor;\n\t}\n\n\t.og-callout-select {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tfont-size: 0.9em;\n\t\tcursor: pointer;\n\t\toutline: none;\n\t\tpadding: 0 2px;\n\t}\n\n\t.og-callout-select option {\n\t\tcolor: var(--og-text-color, inherit);\n\t\tbackground-color: var(--og-background-color);\n\t\tfont-weight: normal;\n\t}\n\n\t.og-callout-body > :first-child { margin-top: 0; }\n\t.og-callout-body > :last-child { margin-bottom: 0; }\n\n\t.og-callout[data-kind=\"note\"] { --og-callout-color: var(--og-colortype-accent-background-color); }\n\t.og-callout[data-kind=\"tip\"] { --og-callout-color: var(--og-colortype-green-background-color); }\n\t.og-callout[data-kind=\"important\"] { --og-callout-color: var(--og-colortype-blue-background-color); }\n\t.og-callout[data-kind=\"warning\"] { --og-callout-color: var(--og-colortype-yellow-background-color); }\n\t.og-callout[data-kind=\"caution\"] { --og-callout-color: var(--og-colortype-red-background-color); }\n`;\n"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Standalone stylesheet for the HTML produced by `markdownToHtml`.
3
+ *
4
+ * The editor/view styles live in the shadow DOM of `og-markdown-view` and target
5
+ * the ProseMirror/NodeView DOM (`.ProseMirror`, `.milkdown-table-block`,
6
+ * `.og-callout-header`, `[data-kind]`, …). None of that applies to the *serialized*
7
+ * output of `markdownToHtml`, which is plain semantic HTML (`<h1>`, `<pre>`,
8
+ * `<table>`, …) plus the callout blockquote form
9
+ * (`<blockquote class="og-callout og-callout-note" data-callout="note">`).
10
+ *
11
+ * These rules are scoped under `.og-markdown-content` so a consumer includes them
12
+ * once and wraps the rendered HTML in that class — no global leakage, one source of
13
+ * truth for helpdesk / AI-module message rendering:
14
+ *
15
+ * const el = document.createElement('div');
16
+ * el.className = 'og-markdown-content';
17
+ * el.innerHTML = await markdownToHtml(md);
18
+ *
19
+ * and once per app / component:
20
+ *
21
+ * <style>${markdownContentStyles}</style> // raw consumer
22
+ * static styles = [unsafeCSS(markdownContentStyles)]; // Lit consumer
23
+ *
24
+ * Colours use the same `--og-*` theme variables as the editor, so it follows the
25
+ * host theme (light/dark) automatically.
26
+ */
27
+ export declare const markdownContentStyles = "\n.og-markdown-content {\n\tcolor: var(--og-text-color);\n\tfont-size: var(--og-font-size);\n\tline-height: 1.5;\n\tword-wrap: break-word;\n}\n\n.og-markdown-content h1 { font-size: 2em; }\n.og-markdown-content h2 { font-size: 1.7em; }\n.og-markdown-content h3 { font-size: 1.4em; }\n.og-markdown-content h4 { font-size: 1.2em; }\n.og-markdown-content h5 { font-size: 1.1em; }\n.og-markdown-content h6 { font-size: 1em; }\n\n.og-markdown-content p {\n\tfont-size: var(--og-font-size);\n\tmargin-block-start: 0.2em;\n\tmargin-block-end: 0.2em;\n}\n\n.og-markdown-content a {\n\tcolor: #688DC8;\n\ttext-decoration: underline;\n}\n\n.og-markdown-content img {\n\tvertical-align: bottom;\n\tmax-width: 100%;\n}\n\n.og-markdown-content code {\n\tpadding: 2px 4px;\n\tfont-size: 90%;\n\tcolor: #c7254e;\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0;\n}\n\n.og-markdown-content pre {\n\tbackground-color: var(--og-background-color-3);\n\tpadding: 10px;\n\tborder-radius: 4px;\n\twhite-space: pre-wrap;\n\toverflow-x: auto;\n}\n\n.og-markdown-content pre code {\n\tpadding: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n\tfont-size: inherit;\n}\n\n.og-markdown-content blockquote {\n\tposition: relative;\n\tpadding-left: 40px;\n\tmargin: 4px 0;\n}\n\n.og-markdown-content blockquote::before {\n\tcontent: '';\n\tposition: absolute;\n\tleft: 0;\n\ttop: 4px;\n\tbottom: 4px;\n\twidth: 4px;\n\tbackground: var(--og-accent-color);\n\tborder-radius: 100px;\n}\n\n.og-markdown-content hr {\n\tborder: none;\n\theight: 1px;\n\tmargin: 12px 0;\n\tbackground-color: color-mix(in srgb, var(--og-border-color), transparent 40%);\n}\n\n/* tables (serialized <table>, not the editor's .milkdown-table-block) */\n.og-markdown-content table {\n\tborder-collapse: collapse;\n\twidth: 100%;\n}\n\n.og-markdown-content th,\n.og-markdown-content td {\n\tborder: 1px solid color-mix(in srgb, var(--og-border-color-3), transparent 80%);\n\tpadding: 2px 10px;\n\tvertical-align: top;\n\ttext-align: left;\n}\n\n/* callouts \u2014 serialized GitHub-alert form emitted by the callout toDOM */\n.og-markdown-content .og-callout {\n\tpadding: 8px 12px;\n\tmargin: 8px 0;\n\tborder-left: 4px solid var(--og-callout-color, var(--og-accent-color));\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0 4px 4px 0;\n}\n\n/* override the generic blockquote bar for callouts */\n.og-markdown-content .og-callout::before {\n\tdisplay: none;\n}\n\n.og-markdown-content .og-callout-title {\n\tmargin: 0 0 4px;\n\tfont-weight: 600;\n\tcolor: var(--og-callout-color, var(--og-accent-color));\n}\n\n.og-markdown-content .og-callout-body > :first-child { margin-top: 0; }\n.og-markdown-content .og-callout-body > :last-child { margin-bottom: 0; }\n\n.og-markdown-content .og-callout[data-callout=\"note\"] { --og-callout-color: var(--og-colortype-accent-background-color); }\n.og-markdown-content .og-callout[data-callout=\"tip\"] { --og-callout-color: var(--og-colortype-green-background-color); }\n.og-markdown-content .og-callout[data-callout=\"important\"] { --og-callout-color: var(--og-colortype-blue-background-color); }\n.og-markdown-content .og-callout[data-callout=\"warning\"] { --og-callout-color: var(--og-colortype-yellow-background-color); }\n.og-markdown-content .og-callout[data-callout=\"caution\"] { --og-callout-color: var(--og-colortype-red-background-color); }\n";
28
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/components/styles/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,8zGAwHjC,CAAC"}
@@ -0,0 +1 @@
1
+ export const markdownContentStyles='\n.og-markdown-content {\n\tcolor: var(--og-text-color);\n\tfont-size: var(--og-font-size);\n\tline-height: 1.5;\n\tword-wrap: break-word;\n}\n\n.og-markdown-content h1 { font-size: 2em; }\n.og-markdown-content h2 { font-size: 1.7em; }\n.og-markdown-content h3 { font-size: 1.4em; }\n.og-markdown-content h4 { font-size: 1.2em; }\n.og-markdown-content h5 { font-size: 1.1em; }\n.og-markdown-content h6 { font-size: 1em; }\n\n.og-markdown-content p {\n\tfont-size: var(--og-font-size);\n\tmargin-block-start: 0.2em;\n\tmargin-block-end: 0.2em;\n}\n\n.og-markdown-content a {\n\tcolor: #688DC8;\n\ttext-decoration: underline;\n}\n\n.og-markdown-content img {\n\tvertical-align: bottom;\n\tmax-width: 100%;\n}\n\n.og-markdown-content code {\n\tpadding: 2px 4px;\n\tfont-size: 90%;\n\tcolor: #c7254e;\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0;\n}\n\n.og-markdown-content pre {\n\tbackground-color: var(--og-background-color-3);\n\tpadding: 10px;\n\tborder-radius: 4px;\n\twhite-space: pre-wrap;\n\toverflow-x: auto;\n}\n\n.og-markdown-content pre code {\n\tpadding: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n\tfont-size: inherit;\n}\n\n.og-markdown-content blockquote {\n\tposition: relative;\n\tpadding-left: 40px;\n\tmargin: 4px 0;\n}\n\n.og-markdown-content blockquote::before {\n\tcontent: \'\';\n\tposition: absolute;\n\tleft: 0;\n\ttop: 4px;\n\tbottom: 4px;\n\twidth: 4px;\n\tbackground: var(--og-accent-color);\n\tborder-radius: 100px;\n}\n\n.og-markdown-content hr {\n\tborder: none;\n\theight: 1px;\n\tmargin: 12px 0;\n\tbackground-color: color-mix(in srgb, var(--og-border-color), transparent 40%);\n}\n\n/* tables (serialized <table>, not the editor\'s .milkdown-table-block) */\n.og-markdown-content table {\n\tborder-collapse: collapse;\n\twidth: 100%;\n}\n\n.og-markdown-content th,\n.og-markdown-content td {\n\tborder: 1px solid color-mix(in srgb, var(--og-border-color-3), transparent 80%);\n\tpadding: 2px 10px;\n\tvertical-align: top;\n\ttext-align: left;\n}\n\n/* callouts — serialized GitHub-alert form emitted by the callout toDOM */\n.og-markdown-content .og-callout {\n\tpadding: 8px 12px;\n\tmargin: 8px 0;\n\tborder-left: 4px solid var(--og-callout-color, var(--og-accent-color));\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0 4px 4px 0;\n}\n\n/* override the generic blockquote bar for callouts */\n.og-markdown-content .og-callout::before {\n\tdisplay: none;\n}\n\n.og-markdown-content .og-callout-title {\n\tmargin: 0 0 4px;\n\tfont-weight: 600;\n\tcolor: var(--og-callout-color, var(--og-accent-color));\n}\n\n.og-markdown-content .og-callout-body > :first-child { margin-top: 0; }\n.og-markdown-content .og-callout-body > :last-child { margin-bottom: 0; }\n\n.og-markdown-content .og-callout[data-callout="note"] { --og-callout-color: var(--og-colortype-accent-background-color); }\n.og-markdown-content .og-callout[data-callout="tip"] { --og-callout-color: var(--og-colortype-green-background-color); }\n.og-markdown-content .og-callout[data-callout="important"] { --og-callout-color: var(--og-colortype-blue-background-color); }\n.og-markdown-content .og-callout[data-callout="warning"] { --og-callout-color: var(--og-colortype-yellow-background-color); }\n.og-markdown-content .og-callout[data-callout="caution"] { --og-callout-color: var(--og-colortype-red-background-color); }\n';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/components/styles/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHpC,CAAC","sourcesContent":["/**\n * Standalone stylesheet for the HTML produced by `markdownToHtml`.\n *\n * The editor/view styles live in the shadow DOM of `og-markdown-view` and target\n * the ProseMirror/NodeView DOM (`.ProseMirror`, `.milkdown-table-block`,\n * `.og-callout-header`, `[data-kind]`, …). None of that applies to the *serialized*\n * output of `markdownToHtml`, which is plain semantic HTML (`<h1>`, `<pre>`,\n * `<table>`, …) plus the callout blockquote form\n * (`<blockquote class=\"og-callout og-callout-note\" data-callout=\"note\">`).\n *\n * These rules are scoped under `.og-markdown-content` so a consumer includes them\n * once and wraps the rendered HTML in that class — no global leakage, one source of\n * truth for helpdesk / AI-module message rendering:\n *\n * const el = document.createElement('div');\n * el.className = 'og-markdown-content';\n * el.innerHTML = await markdownToHtml(md);\n *\n * and once per app / component:\n *\n * <style>${markdownContentStyles}</style> // raw consumer\n * static styles = [unsafeCSS(markdownContentStyles)]; // Lit consumer\n *\n * Colours use the same `--og-*` theme variables as the editor, so it follows the\n * host theme (light/dark) automatically.\n */\nexport const markdownContentStyles = `\n.og-markdown-content {\n\tcolor: var(--og-text-color);\n\tfont-size: var(--og-font-size);\n\tline-height: 1.5;\n\tword-wrap: break-word;\n}\n\n.og-markdown-content h1 { font-size: 2em; }\n.og-markdown-content h2 { font-size: 1.7em; }\n.og-markdown-content h3 { font-size: 1.4em; }\n.og-markdown-content h4 { font-size: 1.2em; }\n.og-markdown-content h5 { font-size: 1.1em; }\n.og-markdown-content h6 { font-size: 1em; }\n\n.og-markdown-content p {\n\tfont-size: var(--og-font-size);\n\tmargin-block-start: 0.2em;\n\tmargin-block-end: 0.2em;\n}\n\n.og-markdown-content a {\n\tcolor: #688DC8;\n\ttext-decoration: underline;\n}\n\n.og-markdown-content img {\n\tvertical-align: bottom;\n\tmax-width: 100%;\n}\n\n.og-markdown-content code {\n\tpadding: 2px 4px;\n\tfont-size: 90%;\n\tcolor: #c7254e;\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0;\n}\n\n.og-markdown-content pre {\n\tbackground-color: var(--og-background-color-3);\n\tpadding: 10px;\n\tborder-radius: 4px;\n\twhite-space: pre-wrap;\n\toverflow-x: auto;\n}\n\n.og-markdown-content pre code {\n\tpadding: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n\tfont-size: inherit;\n}\n\n.og-markdown-content blockquote {\n\tposition: relative;\n\tpadding-left: 40px;\n\tmargin: 4px 0;\n}\n\n.og-markdown-content blockquote::before {\n\tcontent: '';\n\tposition: absolute;\n\tleft: 0;\n\ttop: 4px;\n\tbottom: 4px;\n\twidth: 4px;\n\tbackground: var(--og-accent-color);\n\tborder-radius: 100px;\n}\n\n.og-markdown-content hr {\n\tborder: none;\n\theight: 1px;\n\tmargin: 12px 0;\n\tbackground-color: color-mix(in srgb, var(--og-border-color), transparent 40%);\n}\n\n/* tables (serialized <table>, not the editor's .milkdown-table-block) */\n.og-markdown-content table {\n\tborder-collapse: collapse;\n\twidth: 100%;\n}\n\n.og-markdown-content th,\n.og-markdown-content td {\n\tborder: 1px solid color-mix(in srgb, var(--og-border-color-3), transparent 80%);\n\tpadding: 2px 10px;\n\tvertical-align: top;\n\ttext-align: left;\n}\n\n/* callouts — serialized GitHub-alert form emitted by the callout toDOM */\n.og-markdown-content .og-callout {\n\tpadding: 8px 12px;\n\tmargin: 8px 0;\n\tborder-left: 4px solid var(--og-callout-color, var(--og-accent-color));\n\tbackground-color: var(--og-background-color-3);\n\tborder-radius: 0 4px 4px 0;\n}\n\n/* override the generic blockquote bar for callouts */\n.og-markdown-content .og-callout::before {\n\tdisplay: none;\n}\n\n.og-markdown-content .og-callout-title {\n\tmargin: 0 0 4px;\n\tfont-weight: 600;\n\tcolor: var(--og-callout-color, var(--og-accent-color));\n}\n\n.og-markdown-content .og-callout-body > :first-child { margin-top: 0; }\n.og-markdown-content .og-callout-body > :last-child { margin-bottom: 0; }\n\n.og-markdown-content .og-callout[data-callout=\"note\"] { --og-callout-color: var(--og-colortype-accent-background-color); }\n.og-markdown-content .og-callout[data-callout=\"tip\"] { --og-callout-color: var(--og-colortype-green-background-color); }\n.og-markdown-content .og-callout[data-callout=\"important\"] { --og-callout-color: var(--og-colortype-blue-background-color); }\n.og-markdown-content .og-callout[data-callout=\"warning\"] { --og-callout-color: var(--og-colortype-yellow-background-color); }\n.og-markdown-content .og-callout[data-callout=\"caution\"] { --og-callout-color: var(--og-colortype-red-background-color); }\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/markdown",
3
- "version": "0.10.61",
3
+ "version": "0.10.62",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Markdown view webcomponent",
6
6
  "main": "./dist/index.js",
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@fortawesome/fontawesome-svg-core": "^7.0.1",
31
- "@omegagrid/code": "^0.10.61",
32
- "@omegagrid/core": "^0.10.61",
33
- "@omegagrid/localize": "^0.10.61",
34
- "@omegagrid/milkdown-kit": "^0.10.61",
35
- "@omegagrid/tabs": "^0.10.61",
31
+ "@omegagrid/code": "^0.10.62",
32
+ "@omegagrid/core": "^0.10.62",
33
+ "@omegagrid/localize": "^0.10.62",
34
+ "@omegagrid/milkdown-kit": "^0.10.62",
35
+ "@omegagrid/tabs": "^0.10.62",
36
36
  "lit": "^3.1.1",
37
37
  "markdown-it": "^14.1.0",
38
38
  "ts-debounce": "^4.0.0"