@vielzeug/refine 26.10.10 → 26.10.12
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/README.md +2 -0
- package/THIRD_PARTY_NOTICES +116 -0
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +1 -1
- package/dist/carousel.js.map +1 -1
- package/dist/content/carousel/carousel.css.cjs +1 -1
- package/dist/content/carousel/carousel.css.cjs.map +1 -1
- package/dist/content/carousel/carousel.css.js +1 -1
- package/dist/content/carousel/carousel.css.js.map +1 -1
- package/dist/content/icon/icon.d.ts +8 -9
- package/dist/content/icon/icon.d.ts.map +1 -1
- package/dist/content/index.d.ts +6 -1
- package/dist/content/index.d.ts.map +1 -1
- package/dist/custom-elements.json +896 -450
- package/dist/icon.cjs +4 -4
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +4 -4
- package/dist/icon.js.map +1 -1
- package/dist/icons/_iconify-map.cjs +2 -0
- package/dist/icons/_iconify-map.cjs.map +1 -0
- package/dist/icons/_iconify-map.d.ts +5 -0
- package/dist/icons/_iconify-map.d.ts.map +1 -0
- package/dist/icons/_iconify-map.js +2 -0
- package/dist/icons/_iconify-map.js.map +1 -0
- package/dist/icons/defaults.cjs +2 -0
- package/dist/icons/defaults.cjs.map +1 -0
- package/dist/icons/defaults.d.ts +2 -0
- package/dist/icons/defaults.d.ts.map +1 -0
- package/dist/icons/defaults.js +2 -0
- package/dist/icons/defaults.js.map +1 -0
- package/dist/icons/definition.d.ts +13 -0
- package/dist/icons/definition.d.ts.map +1 -0
- package/dist/icons/heroicons.cjs +2 -0
- package/dist/icons/heroicons.cjs.map +1 -0
- package/dist/icons/heroicons.d.ts +9 -0
- package/dist/icons/heroicons.d.ts.map +1 -0
- package/dist/icons/heroicons.js +2 -0
- package/dist/icons/heroicons.js.map +1 -0
- package/dist/icons/iconify.cjs +2 -0
- package/dist/icons/iconify.cjs.map +1 -0
- package/dist/icons/iconify.d.ts +34 -0
- package/dist/icons/iconify.d.ts.map +1 -0
- package/dist/icons/iconify.js +2 -0
- package/dist/icons/iconify.js.map +1 -0
- package/dist/icons/index.cjs +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/lucide/all.cjs +2 -0
- package/dist/icons/lucide/all.cjs.map +1 -0
- package/dist/icons/lucide/all.d.ts +2 -0
- package/dist/icons/lucide/all.d.ts.map +1 -0
- package/dist/icons/lucide/all.js +2 -0
- package/dist/icons/lucide/all.js.map +1 -0
- package/dist/icons/lucide.cjs +2 -0
- package/dist/icons/lucide.cjs.map +1 -0
- package/dist/icons/lucide.d.ts +5 -0
- package/dist/icons/lucide.d.ts.map +1 -0
- package/dist/icons/lucide.js +2 -0
- package/dist/icons/lucide.js.map +1 -0
- package/dist/icons/mdi.cjs +2 -0
- package/dist/icons/mdi.cjs.map +1 -0
- package/dist/icons/mdi.d.ts +9 -0
- package/dist/icons/mdi.d.ts.map +1 -0
- package/dist/icons/mdi.js +2 -0
- package/dist/icons/mdi.js.map +1 -0
- package/dist/icons/registry.cjs +2 -0
- package/dist/icons/registry.cjs.map +1 -0
- package/dist/icons/registry.d.ts +7 -0
- package/dist/icons/registry.d.ts.map +1 -0
- package/dist/icons/registry.js +2 -0
- package/dist/icons/registry.js.map +1 -0
- package/dist/icons/svg.cjs +2 -0
- package/dist/icons/svg.cjs.map +1 -0
- package/dist/icons/svg.d.ts +8 -0
- package/dist/icons/svg.d.ts.map +1 -0
- package/dist/icons/svg.js +2 -0
- package/dist/icons/svg.js.map +1 -0
- package/dist/icons/tabler.cjs +2 -0
- package/dist/icons/tabler.cjs.map +1 -0
- package/dist/icons/tabler.d.ts +9 -0
- package/dist/icons/tabler.d.ts.map +1 -0
- package/dist/icons/tabler.js +2 -0
- package/dist/icons/tabler.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/inputs/message-composer/message-composer.d.ts +2 -2
- package/dist/inputs/message-composer/message-composer.d.ts.map +1 -1
- package/dist/inputs/select/select.d.ts +1 -1
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/layout/navbar/navbar.d.ts.map +1 -1
- package/dist/message-composer.cjs.map +1 -1
- package/dist/message-composer.js.map +1 -1
- package/dist/navbar.cjs +1 -1
- package/dist/navbar.cjs.map +1 -1
- package/dist/navbar.js +1 -1
- package/dist/navbar.js.map +1 -1
- package/dist/overlay/command-palette/command-palette.types.d.ts +1 -1
- package/dist/overlay/command-palette/command-palette.types.d.ts.map +1 -1
- package/dist/refine.cjs +153 -153
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +153 -153
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +129 -129
- package/dist/refine.js.map +1 -1
- package/dist/select.cjs.map +1 -1
- package/dist/select.js.map +1 -1
- package/dist/shared/prop-bundles.d.ts +3 -3
- package/package.json +81 -22
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/core/icon-registry.cjs +0 -2
- package/dist/core/icon-registry.cjs.map +0 -1
- package/dist/core/icon-registry.d.ts +0 -15
- package/dist/core/icon-registry.d.ts.map +0 -1
- package/dist/core/icon-registry.js +0 -2
- package/dist/core/icon-registry.js.map +0 -1
- package/dist/core/icons.cjs +0 -2
- package/dist/core/icons.cjs.map +0 -1
- package/dist/core/icons.d.ts +0 -2
- package/dist/core/icons.d.ts.map +0 -1
- package/dist/core/icons.js +0 -2
- package/dist/core/icons.js.map +0 -1
- package/dist/icon-lucide.cjs +0 -2
- package/dist/icon-lucide.cjs.map +0 -1
- package/dist/icon-lucide.d.ts +0 -2
- package/dist/icon-lucide.d.ts.map +0 -1
- package/dist/icon-lucide.js +0 -2
- package/dist/icon-lucide.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RefineError as e}from"../errors.js";import{SVG_NS as t,validateIcon as n}from"./svg.js";function iconifyIcon(r){if(!r||typeof r!=`object`)throw new e(`Invalid Iconify icon`);let{left:i=0,top:a=0,width:o=16,height:s=16}=r;if(![i,a,o,s].every(Number.isFinite)||o<=0||s<=0)throw new e(`Invalid Iconify geometry`);if(typeof r.body!=`string`||/<!|<\?/.test(r.body))throw new e(`Invalid Iconify SVG body`);let c=new DOMParser().parseFromString(`<svg xmlns="${t}" xmlns:xlink="http://www.w3.org/1999/xlink">${r.body}</svg>`,`image/svg+xml`);if(c.querySelector(`parsererror`))throw new e(`Malformed Iconify SVG body`);for(let t of c.documentElement.childNodes)if(t.nodeType!==1&&t.nodeType!==8&&t.textContent?.trim())throw new e(`SVG text is not supported in icon data`);let parse=t=>{if(t.namespaceURI!==`http://www.w3.org/2000/svg`)throw new e(`Unsupported SVG namespace`);for(let n of t.childNodes)if(n.nodeType!==1&&n.nodeType!==8&&n.textContent?.trim())throw new e(`SVG text is not supported in icon data`);return{attrs:Object.fromEntries([...t.attributes].filter(e=>e.name!==`class`).map(e=>[e.name,e.value])),children:[...t.children].map(parse),tag:t.localName}},l=[...c.documentElement.children].map(parse),{rotate:u=0,hFlip:d=!1,vFlip:f=!1}=r;if(!Number.isInteger(u)||typeof d!=`boolean`||typeof f!=`boolean`)throw new e(`Invalid Iconify transform`);let p=i,m=a,h=[],g=((u+(d&&f?2:0))%4+4)%4;d!==f&&(h.push(d?`translate(${o+p} ${-m}) scale(-1 1)`:`translate(${-p} ${s+m}) scale(1 -1)`),p=m=0),g===1&&h.unshift(`rotate(90 ${s/2+m} ${s/2+m})`),g===2&&h.unshift(`rotate(180 ${o/2+p} ${s/2+m})`),g===3&&h.unshift(`rotate(-90 ${o/2+p} ${o/2+p})`),h.length&&(l=[{attrs:{transform:h.join(` `)},children:l,tag:`g`}]);let _={children:l,presentation:{fill:`currentColor`},viewBox:g%2?[m,p,s,o]:[p,m,o,s]};return n(_),_}function iconifyIcons(t,n){if(!t||typeof t.icons!=`object`||!t.icons||Array.isArray(t.icons))throw new e(`Invalid Iconify collection`);let resolve=(n,r=new Set)=>{if(r.has(n))throw new e(`Cyclic Iconify alias: ${n}`);r.add(n);let i=Object.hasOwn(t.icons,n)?t.icons[n]:void 0;if(i)return{...t,...i};let a=t.aliases&&Object.hasOwn(t.aliases,n)?t.aliases[n]:void 0;if(!a)throw new e(`Unknown Iconify icon: ${n}`);if(a.rotate!==void 0&&!Number.isInteger(a.rotate)||a.hFlip!==void 0&&typeof a.hFlip!=`boolean`||a.vFlip!==void 0&&typeof a.vFlip!=`boolean`)throw new e(`Invalid Iconify alias transform: ${n}`);let o=resolve(a.parent,r);return{...o,...a,hFlip:!!o.hFlip!=!!a.hFlip,rotate:(o.rotate??0)+(a.rotate??0),vFlip:!!o.vFlip!=!!a.vFlip}};return Object.fromEntries((n??[...Object.keys(t.icons),...Object.keys(t.aliases??{})]).map(e=>[t.prefix?`${t.prefix}:${e}`:e,iconifyIcon(resolve(e))]))}export{iconifyIcon,iconifyIcons};
|
|
2
|
+
//# sourceMappingURL=iconify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconify.js","names":[],"sources":["../../src/icons/iconify.ts"],"sourcesContent":["import { RefineError } from '../errors';\nimport type { IconDefinition, IconElement } from './definition';\nimport { SVG_NS, validateIcon } from './svg';\n\nexport type IconifyTransform = {\n readonly rotate?: number;\n readonly hFlip?: boolean;\n readonly vFlip?: boolean;\n};\nexport type IconifyIcon = IconifyTransform & {\n readonly body: string;\n readonly left?: number;\n readonly top?: number;\n readonly width?: number;\n readonly height?: number;\n};\nexport type IconifyAlias = IconifyTransform & {\n readonly parent: string;\n readonly left?: number;\n readonly top?: number;\n readonly width?: number;\n readonly height?: number;\n};\nexport type IconifyCollection = {\n readonly prefix?: string;\n readonly width?: number;\n readonly height?: number;\n readonly left?: number;\n readonly top?: number;\n readonly icons: Readonly<Record<string, IconifyIcon>>;\n readonly aliases?: Readonly<Record<string, IconifyAlias>>;\n};\n\n/** Convert trusted local Iconify data using the browser DOMParser, never HTML injection. */\nexport function iconifyIcon(data: IconifyIcon): IconDefinition {\n if (!data || typeof data !== 'object') throw new RefineError('Invalid Iconify icon');\n const { left = 0, top = 0, width = 16, height = 16 } = data;\n if (![left, top, width, height].every(Number.isFinite) || width <= 0 || height <= 0) {\n throw new RefineError('Invalid Iconify geometry');\n }\n if (typeof data.body !== 'string' || /<!|<\\?/.test(data.body)) throw new RefineError('Invalid Iconify SVG body');\n const doc = new DOMParser().parseFromString(\n `<svg xmlns=\"${SVG_NS}\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">${data.body}</svg>`,\n 'image/svg+xml',\n );\n if (doc.querySelector('parsererror')) throw new RefineError('Malformed Iconify SVG body');\n for (const node of doc.documentElement.childNodes) {\n if (node.nodeType !== 1 && node.nodeType !== 8 && node.textContent?.trim()) {\n throw new RefineError('SVG text is not supported in icon data');\n }\n }\n const parse = (element: Element): IconElement => {\n if (element.namespaceURI !== SVG_NS) throw new RefineError('Unsupported SVG namespace');\n for (const node of element.childNodes) {\n if (node.nodeType !== 1 && node.nodeType !== 8 && node.textContent?.trim()) {\n throw new RefineError('SVG text is not supported in icon data');\n }\n }\n return {\n // Provider classes are metadata, not portable SVG presentation.\n attrs: Object.fromEntries(\n [...element.attributes].filter((attr) => attr.name !== 'class').map((attr) => [attr.name, attr.value]),\n ),\n children: [...element.children].map(parse),\n tag: element.localName,\n };\n };\n let children: readonly IconElement[] = [...doc.documentElement.children].map(parse);\n const { rotate = 0, hFlip = false, vFlip = false } = data;\n if (!Number.isInteger(rotate) || typeof hFlip !== 'boolean' || typeof vFlip !== 'boolean') {\n throw new RefineError('Invalid Iconify transform');\n }\n let x = left;\n let y = top;\n const transforms: string[] = [];\n const turn = (((rotate + (hFlip && vFlip ? 2 : 0)) % 4) + 4) % 4;\n // Iconify applies flips before rotation and normalizes the origin for a single flip.\n if (hFlip !== vFlip) {\n transforms.push(hFlip ? `translate(${width + x} ${-y}) scale(-1 1)` : `translate(${-x} ${height + y}) scale(1 -1)`);\n x = y = 0;\n }\n if (turn === 1) transforms.unshift(`rotate(90 ${height / 2 + y} ${height / 2 + y})`);\n if (turn === 2) transforms.unshift(`rotate(180 ${width / 2 + x} ${height / 2 + y})`);\n if (turn === 3) transforms.unshift(`rotate(-90 ${width / 2 + x} ${width / 2 + x})`);\n if (transforms.length) {\n children = [\n {\n attrs: { transform: transforms.join(' ') },\n children,\n tag: 'g',\n },\n ];\n }\n const icon: IconDefinition = {\n children,\n presentation: { fill: 'currentColor' },\n viewBox: turn % 2 ? [y, x, height, width] : [x, y, width, height],\n };\n validateIcon(icon);\n return icon;\n}\n\n/** Convert selected names (including aliases), or the entire explicitly imported collection. */\nexport function iconifyIcons(collection: IconifyCollection, names?: readonly string[]): Record<string, IconDefinition> {\n if (!collection || typeof collection.icons !== 'object' || !collection.icons || Array.isArray(collection.icons)) {\n throw new RefineError('Invalid Iconify collection');\n }\n const resolve = (name: string, seen = new Set<string>()): IconifyIcon => {\n if (seen.has(name)) throw new RefineError(`Cyclic Iconify alias: ${name}`);\n seen.add(name);\n const icon = Object.hasOwn(collection.icons, name) ? collection.icons[name] : undefined;\n if (icon) return { ...collection, ...icon };\n const alias = collection.aliases && Object.hasOwn(collection.aliases, name) ? collection.aliases[name] : undefined;\n if (!alias) throw new RefineError(`Unknown Iconify icon: ${name}`);\n if (\n (alias.rotate !== undefined && !Number.isInteger(alias.rotate)) ||\n (alias.hFlip !== undefined && typeof alias.hFlip !== 'boolean') ||\n (alias.vFlip !== undefined && typeof alias.vFlip !== 'boolean')\n )\n throw new RefineError(`Invalid Iconify alias transform: ${name}`);\n const parent = resolve(alias.parent, seen);\n return {\n ...parent,\n ...alias,\n hFlip: !!parent.hFlip !== !!alias.hFlip,\n rotate: (parent.rotate ?? 0) + (alias.rotate ?? 0),\n vFlip: !!parent.vFlip !== !!alias.vFlip,\n };\n };\n return Object.fromEntries(\n (names ?? [...Object.keys(collection.icons), ...Object.keys(collection.aliases ?? {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|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerIcons as e}from"./registry.js";export{e as registerIcons};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.cjs","names":[],"sources":["../../../src/icons/lucide/all.ts"],"sourcesContent":["import { icons } from 'lucide';\n\nimport { lucideIcons } from '../lucide';\nimport { registerIcons } from '../registry';\n\nregisterIcons(lucideIcons(icons));\n"],"mappings":"sFAKA,EAAA,cAAc,EAAA,YAAY,EAAA,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../src/icons/lucide/all.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.js","names":[],"sources":["../../../src/icons/lucide/all.ts"],"sourcesContent":["import { icons } from 'lucide';\n\nimport { lucideIcons } from '../lucide';\nimport { registerIcons } from '../registry';\n\nregisterIcons(lucideIcons(icons));\n"],"mappings":"yHAKA,EAAc,EAAY,CAAK,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function lucideIcons(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{children:t.map(([e,t])=>({attrs:t,tag:e})),presentation:{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":2},viewBox:[0,0,24,24]}]))}exports.lucideIcons=lucideIcons;
|
|
2
|
+
//# sourceMappingURL=lucide.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucide.cjs","names":[],"sources":["../../src/icons/lucide.ts"],"sourcesContent":["import type { IconDefinition } from './definition';\n\n/** Structural Lucide data: no Lucide runtime or full icon pack is imported. */\nexport type LucideIconData = readonly (readonly [string, Readonly<Record<string, string | number | undefined>>])[];\n\nexport function lucideIcons(icons: Readonly<Record<string, LucideIconData>>): Record<string, IconDefinition> {\n return Object.fromEntries(\n Object.entries(icons).map(([name, nodes]) => [\n name,\n {\n children: nodes.map(([tag, attrs]) => ({ attrs, tag })),\n presentation: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': 2,\n },\n viewBox: [0, 0, 24, 24],\n },\n ]),\n );\n}\n"],"mappings":"mEAKA,SAAgB,YAAY,EAAiF,CAC3G,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAK,CAAC,CAAC,KAAK,CAAC,EAAM,KAAW,CAC3C,EACA,CACE,SAAU,EAAM,KAAK,CAAC,EAAK,MAAY,CAAE,QAAO,KAAI,EAAE,EACtD,aAAc,CACZ,KAAM,OACN,OAAQ,eACR,iBAAkB,QAClB,kBAAmB,QACnB,eAAgB,CAClB,EACA,QAAS,CAAC,EAAG,EAAG,GAAI,EAAE,CACxB,CACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IconDefinition } from './definition';
|
|
2
|
+
/** Structural Lucide data: no Lucide runtime or full icon pack is imported. */
|
|
3
|
+
export type LucideIconData = readonly (readonly [string, Readonly<Record<string, string | number | undefined>>])[];
|
|
4
|
+
export declare function lucideIcons(icons: Readonly<Record<string, LucideIconData>>): Record<string, IconDefinition>;
|
|
5
|
+
//# sourceMappingURL=lucide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucide.d.ts","sourceRoot":"","sources":["../../src/icons/lucide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,+EAA+E;AAC/E,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAEnH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiB3G"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function lucideIcons(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{children:t.map(([e,t])=>({attrs:t,tag:e})),presentation:{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":2},viewBox:[0,0,24,24]}]))}export{lucideIcons};
|
|
2
|
+
//# sourceMappingURL=lucide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucide.js","names":[],"sources":["../../src/icons/lucide.ts"],"sourcesContent":["import type { IconDefinition } from './definition';\n\n/** Structural Lucide data: no Lucide runtime or full icon pack is imported. */\nexport type LucideIconData = readonly (readonly [string, Readonly<Record<string, string | number | undefined>>])[];\n\nexport function lucideIcons(icons: Readonly<Record<string, LucideIconData>>): Record<string, IconDefinition> {\n return Object.fromEntries(\n Object.entries(icons).map(([name, nodes]) => [\n name,\n {\n children: nodes.map(([tag, attrs]) => ({ attrs, tag })),\n presentation: {\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n 'stroke-width': 2,\n },\n viewBox: [0, 0, 24, 24],\n },\n ]),\n );\n}\n"],"mappings":"AAKA,SAAgB,YAAY,EAAiF,CAC3G,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAK,CAAC,CAAC,KAAK,CAAC,EAAM,KAAW,CAC3C,EACA,CACE,SAAU,EAAM,KAAK,CAAC,EAAK,MAAY,CAAE,QAAO,KAAI,EAAE,EACtD,aAAc,CACZ,KAAM,OACN,OAAQ,eACR,iBAAkB,QAClB,kBAAmB,QACnB,eAAgB,CAClB,EACA,QAAS,CAAC,EAAG,EAAG,GAAI,EAAE,CACxB,CACF,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdi.cjs","names":[],"sources":["../../src/icons/mdi.ts"],"sourcesContent":["import { mapIconifyIcons } from './_iconify-map.js';\nimport type { IconDefinition } from './definition.js';\nimport type { IconifyIcon } from './iconify.js';\n\nexport type { IconifyIcon } from './iconify.js';\n\n/**\n * Convert caller-named individual `@iconify-icons/mdi` data, not framework components or raw path strings.\n * Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.\n */\nexport function mdiIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition> {\n return mapIconifyIcons(icons);\n}\n"],"mappings":"yGAUA,SAAgB,SAAS,EAA8E,CACrG,OAAO,EAAA,gBAAgB,CAAK,CAC9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconDefinition } from './definition.js';
|
|
2
|
+
import type { IconifyIcon } from './iconify.js';
|
|
3
|
+
export type { IconifyIcon } from './iconify.js';
|
|
4
|
+
/**
|
|
5
|
+
* Convert caller-named individual `@iconify-icons/mdi` data, not framework components or raw path strings.
|
|
6
|
+
* Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mdiIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition>;
|
|
9
|
+
//# sourceMappingURL=mdi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdi.d.ts","sourceRoot":"","sources":["../../src/icons/mdi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAErG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdi.js","names":[],"sources":["../../src/icons/mdi.ts"],"sourcesContent":["import { mapIconifyIcons } from './_iconify-map.js';\nimport type { IconDefinition } from './definition.js';\nimport type { IconifyIcon } from './iconify.js';\n\nexport type { IconifyIcon } from './iconify.js';\n\n/**\n * Convert caller-named individual `@iconify-icons/mdi` data, not framework components or raw path strings.\n * Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.\n */\nexport function mdiIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition> {\n return mapIconifyIcons(icons);\n}\n"],"mappings":"oDAUA,SAAgB,SAAS,EAA8E,CACrG,OAAO,EAAgB,CAAK,CAC9B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../errors.cjs"),t=require("./svg.cjs");var n=new Map,r=new Map,keyOf=e=>e.replace(/[-_]/g,``).toLowerCase();function registerIcons(r){let i=Object.entries(r).map(([n,r])=>{if(!/^[a-zA-Z0-9][\w:.-]*$/.test(n))throw new e.RefineError(`Invalid icon name`);return t.validateIcon(r),[keyOf(n),structuredClone(r)]});for(let[e,t]of i)n.set(e,t)}function registerDefaultIcons(e){for(let[n,i]of Object.entries(e))t.validateIcon(i),r.set(keyOf(n),i)}var resolveIcon=e=>n.get(keyOf(e))??r.get(keyOf(e));exports.registerDefaultIcons=registerDefaultIcons,exports.registerIcons=registerIcons,exports.resolveIcon=resolveIcon;
|
|
2
|
+
//# sourceMappingURL=registry.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.cjs","names":[],"sources":["../../src/icons/registry.ts"],"sourcesContent":["import { RefineError } from '../errors';\nimport type { IconDefinition } from './definition';\nimport { validateIcon } from './svg';\n\nconst registry = new Map<string, IconDefinition>();\nconst defaults = new Map<string, IconDefinition>();\nconst keyOf = (name: string): string => name.replace(/[-_]/g, '').toLowerCase();\n\n/** Register trusted, synchronous SVG data. Re-registration replaces an application icon. */\nexport function registerIcons(icons: Readonly<Record<string, IconDefinition>>): void {\n const entries = Object.entries(icons).map(([name, icon]) => {\n if (!/^[a-zA-Z0-9][\\w:.-]*$/.test(name)) throw new RefineError('Invalid icon name');\n validateIcon(icon);\n return [keyOf(name), structuredClone(icon)] as const;\n });\n\n for (const [name, icon] of entries) registry.set(name, icon);\n}\n\n/** Internal defaults never replace application registrations, in either import order. */\nexport function registerDefaultIcons(icons: Readonly<Record<string, IconDefinition>>): void {\n for (const [name, icon] of Object.entries(icons)) {\n validateIcon(icon);\n defaults.set(keyOf(name), icon);\n }\n}\n\nexport const resolveIcon = (name: string): IconDefinition | undefined =>\n registry.get(keyOf(name)) ?? defaults.get(keyOf(name));\n"],"mappings":"wDAIA,IAAM,EAAW,IAAI,IACf,EAAW,IAAI,IACf,MAAS,GAAyB,EAAK,QAAQ,QAAS,EAAE,CAAC,CAAC,YAAY,EAG9E,SAAgB,cAAc,EAAuD,CACnF,IAAM,EAAU,OAAO,QAAQ,CAAK,CAAC,CAAC,KAAK,CAAC,EAAM,KAAU,CAC1D,GAAI,CAAC,wBAAwB,KAAK,CAAI,EAAG,MAAM,IAAI,EAAA,YAAY,mBAAmB,EAElF,OADA,EAAA,aAAa,CAAI,EACV,CAAC,MAAM,CAAI,EAAG,gBAAgB,CAAI,CAAC,CAC5C,CAAC,EAED,IAAK,GAAM,CAAC,EAAM,KAAS,EAAS,EAAS,IAAI,EAAM,CAAI,CAC7D,CAGA,SAAgB,qBAAqB,EAAuD,CAC1F,IAAK,GAAM,CAAC,EAAM,KAAS,OAAO,QAAQ,CAAK,EAC7C,EAAA,aAAa,CAAI,EACjB,EAAS,IAAI,MAAM,CAAI,EAAG,CAAI,CAElC,CAEA,IAAa,YAAe,GAC1B,EAAS,IAAI,MAAM,CAAI,CAAC,GAAK,EAAS,IAAI,MAAM,CAAI,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IconDefinition } from './definition';
|
|
2
|
+
/** Register trusted, synchronous SVG data. Re-registration replaces an application icon. */
|
|
3
|
+
export declare function registerIcons(icons: Readonly<Record<string, IconDefinition>>): void;
|
|
4
|
+
/** Internal defaults never replace application registrations, in either import order. */
|
|
5
|
+
export declare function registerDefaultIcons(icons: Readonly<Record<string, IconDefinition>>): void;
|
|
6
|
+
export declare const resolveIcon: (name: string) => IconDefinition | undefined;
|
|
7
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/icons/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAOnD,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,IAAI,CAQnF;AAED,yFAAyF;AACzF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,IAAI,CAK1F;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,cAAc,GAAG,SACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RefineError as e}from"../errors.js";import{validateIcon as t}from"./svg.js";var n=new Map,r=new Map,keyOf=e=>e.replace(/[-_]/g,``).toLowerCase();function registerIcons(r){let i=Object.entries(r).map(([n,r])=>{if(!/^[a-zA-Z0-9][\w:.-]*$/.test(n))throw new e(`Invalid icon name`);return t(r),[keyOf(n),structuredClone(r)]});for(let[e,t]of i)n.set(e,t)}function registerDefaultIcons(e){for(let[n,i]of Object.entries(e))t(i),r.set(keyOf(n),i)}var resolveIcon=e=>n.get(keyOf(e))??r.get(keyOf(e));export{registerDefaultIcons,registerIcons,resolveIcon};
|
|
2
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","names":[],"sources":["../../src/icons/registry.ts"],"sourcesContent":["import { RefineError } from '../errors';\nimport type { IconDefinition } from './definition';\nimport { validateIcon } from './svg';\n\nconst registry = new Map<string, IconDefinition>();\nconst defaults = new Map<string, IconDefinition>();\nconst keyOf = (name: string): string => name.replace(/[-_]/g, '').toLowerCase();\n\n/** Register trusted, synchronous SVG data. Re-registration replaces an application icon. */\nexport function registerIcons(icons: Readonly<Record<string, IconDefinition>>): void {\n const entries = Object.entries(icons).map(([name, icon]) => {\n if (!/^[a-zA-Z0-9][\\w:.-]*$/.test(name)) throw new RefineError('Invalid icon name');\n validateIcon(icon);\n return [keyOf(name), structuredClone(icon)] as const;\n });\n\n for (const [name, icon] of entries) registry.set(name, icon);\n}\n\n/** Internal defaults never replace application registrations, in either import order. */\nexport function registerDefaultIcons(icons: Readonly<Record<string, IconDefinition>>): void {\n for (const [name, icon] of Object.entries(icons)) {\n validateIcon(icon);\n defaults.set(keyOf(name), icon);\n }\n}\n\nexport const resolveIcon = (name: string): IconDefinition | undefined =>\n registry.get(keyOf(name)) ?? defaults.get(keyOf(name));\n"],"mappings":"mFAIA,IAAM,EAAW,IAAI,IACf,EAAW,IAAI,IACf,MAAS,GAAyB,EAAK,QAAQ,QAAS,EAAE,CAAC,CAAC,YAAY,EAG9E,SAAgB,cAAc,EAAuD,CACnF,IAAM,EAAU,OAAO,QAAQ,CAAK,CAAC,CAAC,KAAK,CAAC,EAAM,KAAU,CAC1D,GAAI,CAAC,wBAAwB,KAAK,CAAI,EAAG,MAAM,IAAI,EAAY,mBAAmB,EAElF,OADA,EAAa,CAAI,EACV,CAAC,MAAM,CAAI,EAAG,gBAAgB,CAAI,CAAC,CAC5C,CAAC,EAED,IAAK,GAAM,CAAC,EAAM,KAAS,EAAS,EAAS,IAAI,EAAM,CAAI,CAC7D,CAGA,SAAgB,qBAAqB,EAAuD,CAC1F,IAAK,GAAM,CAAC,EAAM,KAAS,OAAO,QAAQ,CAAK,EAC7C,EAAa,CAAI,EACjB,EAAS,IAAI,MAAM,CAAI,EAAG,CAAI,CAElC,CAEA,IAAa,YAAe,GAC1B,EAAS,IAAI,MAAM,CAAI,CAAC,GAAK,EAAS,IAAI,MAAM,CAAI,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../errors.cjs");var t=`http://www.w3.org/2000/svg`,n=new Set([`circle`,`clipPath`,`defs`,`ellipse`,`g`,`line`,`linearGradient`,`mask`,`path`,`polygon`,`polyline`,`radialGradient`,`rect`,`stop`,`symbol`,`use`]),r=new Set(`id.d.points.x.y.x1.x2.y1.y2.cx.cy.r.rx.ry.width.height.fill.fill-rule.fill-opacity.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.stroke-opacity.opacity.transform.clip-path.clip-rule.clipPathUnits.mask.maskUnits.maskContentUnits.offset.stop-color.stop-opacity.gradientUnits.gradientTransform.spreadMethod.fx.fy.fr.href.xlink:href.viewBox.preserveAspectRatio.vector-effect`.split(`.`));function validateAttributes(t={}){if(!t||typeof t!=`object`||Array.isArray(t))throw new e.RefineError(`Invalid SVG attributes`);for(let[n,i]of Object.entries(t)){if(i===void 0)continue;if(!r.has(n)||typeof i!=`string`&&typeof i!=`number`||typeof i==`number`&&!Number.isFinite(i))throw new e.RefineError(`Unsupported SVG attribute: ${n}`);let t=String(i);if(/^(?:xlink:)?href$/.test(n)&&!/^#[\w:.-]+$/.test(t)||/url\s*\(/i.test(t)&&!/^url\(#[\w:.-]+\)$/.test(t)||/(?:javascript|data|https?):/i.test(t))throw new e.RefineError(`External SVG reference is not supported: ${n}`)}}function validateElement(t){if(!t||typeof t!=`object`||t.children!==void 0&&!Array.isArray(t.children))throw new e.RefineError(`Invalid SVG element`);if(!n.has(t.tag))throw new e.RefineError(`Unsupported SVG element: ${t.tag}`);validateAttributes(t.attrs);for(let e of t.children??[])validateElement(e)}function validateIcon(t){if(!t||!Array.isArray(t.viewBox)||t.viewBox.length!==4||!t.viewBox.every(Number.isFinite)||t.viewBox[2]<=0||t.viewBox[3]<=0||!Array.isArray(t.children))throw new e.RefineError(`Invalid icon definition or viewBox`);if(validateAttributes(t.presentation),t.presentation?.id!==void 0||t.presentation?.href!==void 0||t.presentation?.[`xlink:href`]!==void 0)throw new e.RefineError(`SVG ids and references belong on child elements`);for(let e of t.children)validateElement(e);let n=new Set,visit=t=>{for(let r of t){if(r.attrs?.id!==void 0){let t=String(r.attrs.id);if(!/^[\w:.-]+$/.test(t)||n.has(t))throw new e.RefineError(`Invalid or duplicate SVG id: ${t}`);n.add(t)}visit(r.children??[])}};visit(t.children)}function createIconChildren(e,n){let create=e=>{let r=document.createElementNS(t,e.tag);for(let[t,i]of Object.entries(e.attrs??{})){if(i===void 0)continue;let e=String(i);e=t===`id`?`${n}${e}`:/^(?:xlink:)?href$/.test(t)?`#${n}${e.slice(1)}`:e.replace(/url\(#([\w:.-]+)\)/g,`url(#${n}$1)`),t===`xlink:href`?r.setAttributeNS(`http://www.w3.org/1999/xlink`,t,e):r.setAttribute(t,e)}return r.replaceChildren(...(e.children??[]).map(create)),r};return e.children.map(create)}exports.SVG_NS=t,exports.createIconChildren=createIconChildren,exports.validateAttributes=validateAttributes,exports.validateElement=validateElement,exports.validateIcon=validateIcon;
|
|
2
|
+
//# sourceMappingURL=svg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.cjs","names":[],"sources":["../../src/icons/svg.ts"],"sourcesContent":["import { RefineError } from '../errors';\nimport type { IconAttributes, IconDefinition, IconElement } from './definition';\n\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\nconst tags = new Set([\n 'circle',\n 'clipPath',\n 'defs',\n 'ellipse',\n 'g',\n 'line',\n 'linearGradient',\n 'mask',\n 'path',\n 'polygon',\n 'polyline',\n 'radialGradient',\n 'rect',\n 'stop',\n 'symbol',\n 'use',\n]);\nconst attributes = new Set([\n 'id',\n 'd',\n 'points',\n 'x',\n 'y',\n 'x1',\n 'x2',\n 'y1',\n 'y2',\n 'cx',\n 'cy',\n 'r',\n 'rx',\n 'ry',\n 'width',\n 'height',\n 'fill',\n 'fill-rule',\n 'fill-opacity',\n 'stroke',\n 'stroke-width',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-opacity',\n 'opacity',\n 'transform',\n 'clip-path',\n 'clip-rule',\n 'clipPathUnits',\n 'mask',\n 'maskUnits',\n 'maskContentUnits',\n 'offset',\n 'stop-color',\n 'stop-opacity',\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n 'fx',\n 'fy',\n 'fr',\n 'href',\n 'xlink:href',\n 'viewBox',\n 'preserveAspectRatio',\n 'vector-effect',\n]);\n\nexport function validateAttributes(attrs: IconAttributes = {}): void {\n if (!attrs || typeof attrs !== 'object' || Array.isArray(attrs)) throw new RefineError('Invalid SVG attributes');\n for (const [key, value] of Object.entries(attrs)) {\n if (value === undefined) continue;\n if (\n !attributes.has(key) ||\n (typeof value !== 'string' && typeof value !== 'number') ||\n (typeof value === 'number' && !Number.isFinite(value))\n ) {\n throw new RefineError(`Unsupported SVG attribute: ${key}`);\n }\n const text = String(value);\n if (\n (/^(?:xlink:)?href$/.test(key) && !/^#[\\w:.-]+$/.test(text)) ||\n (/url\\s*\\(/i.test(text) && !/^url\\(#[\\w:.-]+\\)$/.test(text)) ||\n /(?:javascript|data|https?):/i.test(text)\n ) {\n throw new RefineError(`External SVG reference is not supported: ${key}`);\n }\n }\n}\n\nexport function validateElement(node: IconElement): void {\n if (!node || typeof node !== 'object' || (node.children !== undefined && !Array.isArray(node.children))) {\n throw new RefineError('Invalid SVG element');\n }\n if (!tags.has(node.tag)) throw new RefineError(`Unsupported SVG element: ${node.tag}`);\n validateAttributes(node.attrs);\n for (const child of node.children ?? []) validateElement(child);\n}\n\nexport function validateIcon(icon: IconDefinition): void {\n if (\n !icon ||\n !Array.isArray(icon.viewBox) ||\n icon.viewBox.length !== 4 ||\n !icon.viewBox.every(Number.isFinite) ||\n icon.viewBox[2] <= 0 ||\n icon.viewBox[3] <= 0 ||\n !Array.isArray(icon.children)\n )\n throw new RefineError('Invalid icon definition or viewBox');\n validateAttributes(icon.presentation);\n if (\n icon.presentation?.id !== undefined ||\n icon.presentation?.href !== undefined ||\n icon.presentation?.['xlink:href'] !== undefined\n )\n throw new RefineError('SVG ids and references belong on child elements');\n for (const child of icon.children) validateElement(child);\n const ids = new Set<string>();\n const visit = (nodes: readonly IconElement[]) => {\n for (const node of nodes) {\n if (node.attrs?.id !== undefined) {\n const id = String(node.attrs.id);\n if (!/^[\\w:.-]+$/.test(id) || ids.has(id)) throw new RefineError(`Invalid or duplicate SVG id: ${id}`);\n ids.add(id);\n }\n visit(node.children ?? []);\n }\n };\n visit(icon.children);\n}\n\n/** Prefix local IDs and references per rendered instance, including nested gradients/masks. */\nexport function createIconChildren(icon: IconDefinition, prefix: string): SVGElement[] {\n const create = (node: IconElement): SVGElement => {\n const element = document.createElementNS(SVG_NS, node.tag);\n for (const [key, value] of Object.entries(node.attrs ?? {})) {\n if (value === undefined) continue;\n let text = String(value);\n if (key === 'id') text = `${prefix}${text}`;\n else if (/^(?:xlink:)?href$/.test(key)) text = `#${prefix}${text.slice(1)}`;\n else text = text.replace(/url\\(#([\\w:.-]+)\\)/g, `url(#${prefix}$1)`);\n if (key === 'xlink:href') element.setAttributeNS('http://www.w3.org/1999/xlink', key, text);\n else element.setAttribute(key, text);\n }\n element.replaceChildren(...(node.children ?? []).map(create));\n return element;\n };\n return icon.children.map(create);\n}\n"],"mappings":"iCA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,eAAe,+BAAgC,EAAK,CAAI,EACrF,EAAQ,aAAa,EAAK,CAAI,CACrC,CAEA,OADA,EAAQ,gBAAgB,IAAI,EAAK,UAAY,CAAC,EAAA,CAAG,IAAI,MAAM,CAAC,EACrD,CACT,EACA,OAAO,EAAK,SAAS,IAAI,MAAM,CACjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconAttributes, IconDefinition, IconElement } from './definition';
|
|
2
|
+
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
export declare function validateAttributes(attrs?: IconAttributes): void;
|
|
4
|
+
export declare function validateElement(node: IconElement): void;
|
|
5
|
+
export declare function validateIcon(icon: IconDefinition): void;
|
|
6
|
+
/** Prefix local IDs and references per rendered instance, including nested gradients/masks. */
|
|
7
|
+
export declare function createIconChildren(icon: IconDefinition, prefix: string): SVGElement[];
|
|
8
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/icons/svg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhF,eAAO,MAAM,MAAM,+BAA+B,CAAC;AAuEnD,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,cAAmB,GAAG,IAAI,CAoBnE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAOvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CA+BvD;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAgBrF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RefineError as e}from"../errors.js";var t=`http://www.w3.org/2000/svg`,n=new Set([`circle`,`clipPath`,`defs`,`ellipse`,`g`,`line`,`linearGradient`,`mask`,`path`,`polygon`,`polyline`,`radialGradient`,`rect`,`stop`,`symbol`,`use`]),r=new Set(`id.d.points.x.y.x1.x2.y1.y2.cx.cy.r.rx.ry.width.height.fill.fill-rule.fill-opacity.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.stroke-opacity.opacity.transform.clip-path.clip-rule.clipPathUnits.mask.maskUnits.maskContentUnits.offset.stop-color.stop-opacity.gradientUnits.gradientTransform.spreadMethod.fx.fy.fr.href.xlink:href.viewBox.preserveAspectRatio.vector-effect`.split(`.`));function validateAttributes(t={}){if(!t||typeof t!=`object`||Array.isArray(t))throw new e(`Invalid SVG attributes`);for(let[n,i]of Object.entries(t)){if(i===void 0)continue;if(!r.has(n)||typeof i!=`string`&&typeof i!=`number`||typeof i==`number`&&!Number.isFinite(i))throw new e(`Unsupported SVG attribute: ${n}`);let t=String(i);if(/^(?:xlink:)?href$/.test(n)&&!/^#[\w:.-]+$/.test(t)||/url\s*\(/i.test(t)&&!/^url\(#[\w:.-]+\)$/.test(t)||/(?:javascript|data|https?):/i.test(t))throw new e(`External SVG reference is not supported: ${n}`)}}function validateElement(t){if(!t||typeof t!=`object`||t.children!==void 0&&!Array.isArray(t.children))throw new e(`Invalid SVG element`);if(!n.has(t.tag))throw new e(`Unsupported SVG element: ${t.tag}`);validateAttributes(t.attrs);for(let e of t.children??[])validateElement(e)}function validateIcon(t){if(!t||!Array.isArray(t.viewBox)||t.viewBox.length!==4||!t.viewBox.every(Number.isFinite)||t.viewBox[2]<=0||t.viewBox[3]<=0||!Array.isArray(t.children))throw new e(`Invalid icon definition or viewBox`);if(validateAttributes(t.presentation),t.presentation?.id!==void 0||t.presentation?.href!==void 0||t.presentation?.[`xlink:href`]!==void 0)throw new e(`SVG ids and references belong on child elements`);for(let e of t.children)validateElement(e);let n=new Set,visit=t=>{for(let r of t){if(r.attrs?.id!==void 0){let t=String(r.attrs.id);if(!/^[\w:.-]+$/.test(t)||n.has(t))throw new e(`Invalid or duplicate SVG id: ${t}`);n.add(t)}visit(r.children??[])}};visit(t.children)}function createIconChildren(e,n){let create=e=>{let r=document.createElementNS(t,e.tag);for(let[t,i]of Object.entries(e.attrs??{})){if(i===void 0)continue;let e=String(i);e=t===`id`?`${n}${e}`:/^(?:xlink:)?href$/.test(t)?`#${n}${e.slice(1)}`:e.replace(/url\(#([\w:.-]+)\)/g,`url(#${n}$1)`),t===`xlink:href`?r.setAttributeNS(`http://www.w3.org/1999/xlink`,t,e):r.setAttribute(t,e)}return r.replaceChildren(...(e.children??[]).map(create)),r};return e.children.map(create)}export{t as SVG_NS,createIconChildren,validateAttributes,validateElement,validateIcon};
|
|
2
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","names":[],"sources":["../../src/icons/svg.ts"],"sourcesContent":["import { RefineError } from '../errors';\nimport type { IconAttributes, IconDefinition, IconElement } from './definition';\n\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\nconst tags = new Set([\n 'circle',\n 'clipPath',\n 'defs',\n 'ellipse',\n 'g',\n 'line',\n 'linearGradient',\n 'mask',\n 'path',\n 'polygon',\n 'polyline',\n 'radialGradient',\n 'rect',\n 'stop',\n 'symbol',\n 'use',\n]);\nconst attributes = new Set([\n 'id',\n 'd',\n 'points',\n 'x',\n 'y',\n 'x1',\n 'x2',\n 'y1',\n 'y2',\n 'cx',\n 'cy',\n 'r',\n 'rx',\n 'ry',\n 'width',\n 'height',\n 'fill',\n 'fill-rule',\n 'fill-opacity',\n 'stroke',\n 'stroke-width',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-opacity',\n 'opacity',\n 'transform',\n 'clip-path',\n 'clip-rule',\n 'clipPathUnits',\n 'mask',\n 'maskUnits',\n 'maskContentUnits',\n 'offset',\n 'stop-color',\n 'stop-opacity',\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n 'fx',\n 'fy',\n 'fr',\n 'href',\n 'xlink:href',\n 'viewBox',\n 'preserveAspectRatio',\n 'vector-effect',\n]);\n\nexport function validateAttributes(attrs: IconAttributes = {}): void {\n if (!attrs || typeof attrs !== 'object' || Array.isArray(attrs)) throw new RefineError('Invalid SVG attributes');\n for (const [key, value] of Object.entries(attrs)) {\n if (value === undefined) continue;\n if (\n !attributes.has(key) ||\n (typeof value !== 'string' && typeof value !== 'number') ||\n (typeof value === 'number' && !Number.isFinite(value))\n ) {\n throw new RefineError(`Unsupported SVG attribute: ${key}`);\n }\n const text = String(value);\n if (\n (/^(?:xlink:)?href$/.test(key) && !/^#[\\w:.-]+$/.test(text)) ||\n (/url\\s*\\(/i.test(text) && !/^url\\(#[\\w:.-]+\\)$/.test(text)) ||\n /(?:javascript|data|https?):/i.test(text)\n ) {\n throw new RefineError(`External SVG reference is not supported: ${key}`);\n }\n }\n}\n\nexport function validateElement(node: IconElement): void {\n if (!node || typeof node !== 'object' || (node.children !== undefined && !Array.isArray(node.children))) {\n throw new RefineError('Invalid SVG element');\n }\n if (!tags.has(node.tag)) throw new RefineError(`Unsupported SVG element: ${node.tag}`);\n validateAttributes(node.attrs);\n for (const child of node.children ?? []) validateElement(child);\n}\n\nexport function validateIcon(icon: IconDefinition): void {\n if (\n !icon ||\n !Array.isArray(icon.viewBox) ||\n icon.viewBox.length !== 4 ||\n !icon.viewBox.every(Number.isFinite) ||\n icon.viewBox[2] <= 0 ||\n icon.viewBox[3] <= 0 ||\n !Array.isArray(icon.children)\n )\n throw new RefineError('Invalid icon definition or viewBox');\n validateAttributes(icon.presentation);\n if (\n icon.presentation?.id !== undefined ||\n icon.presentation?.href !== undefined ||\n icon.presentation?.['xlink:href'] !== undefined\n )\n throw new RefineError('SVG ids and references belong on child elements');\n for (const child of icon.children) validateElement(child);\n const ids = new Set<string>();\n const visit = (nodes: readonly IconElement[]) => {\n for (const node of nodes) {\n if (node.attrs?.id !== undefined) {\n const id = String(node.attrs.id);\n if (!/^[\\w:.-]+$/.test(id) || ids.has(id)) throw new RefineError(`Invalid or duplicate SVG id: ${id}`);\n ids.add(id);\n }\n visit(node.children ?? []);\n }\n };\n visit(icon.children);\n}\n\n/** Prefix local IDs and references per rendered instance, including nested gradients/masks. */\nexport function createIconChildren(icon: IconDefinition, prefix: string): SVGElement[] {\n const create = (node: IconElement): SVGElement => {\n const element = document.createElementNS(SVG_NS, node.tag);\n for (const [key, value] of Object.entries(node.attrs ?? {})) {\n if (value === undefined) continue;\n let text = String(value);\n if (key === 'id') text = `${prefix}${text}`;\n else if (/^(?:xlink:)?href$/.test(key)) text = `#${prefix}${text.slice(1)}`;\n else text = text.replace(/url\\(#([\\w:.-]+)\\)/g, `url(#${prefix}$1)`);\n if (key === 'xlink:href') element.setAttributeNS('http://www.w3.org/1999/xlink', key, text);\n else element.setAttribute(key, text);\n }\n element.replaceChildren(...(node.children ?? []).map(create));\n return element;\n };\n return icon.children.map(create);\n}\n"],"mappings":"2CAGA,IAAa,EAAS,6BAChB,EAAO,IAAI,IAAI,CACnB,SACA,WACA,OACA,UACA,IACA,OACA,iBACA,OACA,OACA,UACA,WACA,iBACA,OACA,OACA,SACA,KACF,CAAC,EACK,EAAa,IAAI,IAAI,wbAkD3B,CAAC,EAED,SAAgB,mBAAmB,EAAwB,CAAC,EAAS,CACnE,GAAI,CAAC,GAAS,OAAO,GAAU,UAAY,MAAM,QAAQ,CAAK,EAAG,MAAM,IAAI,EAAY,wBAAwB,EAC/G,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAK,EAAG,CAChD,GAAI,IAAU,IAAA,GAAW,SACzB,GACE,CAAC,EAAW,IAAI,CAAG,GAClB,OAAO,GAAU,UAAY,OAAO,GAAU,UAC9C,OAAO,GAAU,UAAY,CAAC,OAAO,SAAS,CAAK,EAEpD,MAAM,IAAI,EAAY,8BAA8B,GAAK,EAE3D,IAAM,EAAO,OAAO,CAAK,E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,IAAI,CAAE,EAAG,MAAM,IAAI,EAAY,gCAAgC,GAAI,EACrG,EAAI,IAAI,CAAE,CACZ,CACA,MAAM,EAAK,UAAY,CAAC,CAAC,CAC3B,CACF,EACA,MAAM,EAAK,QAAQ,CACrB,CAGA,SAAgB,mBAAmB,EAAsB,EAA8B,CACrF,IAAM,OAAU,GAAkC,CAChD,IAAM,EAAU,SAAS,gBAAgB,EAAQ,EAAK,GAAG,EACzD,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAK,OAAS,CAAC,CAAC,EAAG,CAC3D,GAAI,IAAU,IAAA,GAAW,SACzB,IAAI,EAAO,OAAO,CAAK,EACvB,AAEK,EAFD,IAAQ,KAAa,GAAG,IAAS,IAC5B,oBAAoB,KAAK,CAAG,EAAU,IAAI,IAAS,EAAK,MAAM,CAAC,IAC5D,EAAK,QAAQ,sBAAuB,QAAQ,EAAO,IAAI,EAC/D,IAAQ,aAAc,EAAQ,eAAe,+BAAgC,EAAK,CAAI,EACrF,EAAQ,aAAa,EAAK,CAAI,CACrC,CAEA,OADA,EAAQ,gBAAgB,IAAI,EAAK,UAAY,CAAC,EAAA,CAAG,IAAI,MAAM,CAAC,EACrD,CACT,EACA,OAAO,EAAK,SAAS,IAAI,MAAM,CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabler.cjs","names":[],"sources":["../../src/icons/tabler.ts"],"sourcesContent":["import { mapIconifyIcons } from './_iconify-map.js';\nimport type { IconDefinition } from './definition.js';\nimport type { IconifyIcon } from './iconify.js';\n\nexport type { IconifyIcon } from './iconify.js';\n\n/**\n * Convert caller-named individual `@iconify-icons/tabler` data, not native Tabler framework components.\n * Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.\n */\nexport function tablerIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition> {\n return mapIconifyIcons(icons);\n}\n"],"mappings":"yGAUA,SAAgB,YAAY,EAA8E,CACxG,OAAO,EAAA,gBAAgB,CAAK,CAC9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconDefinition } from './definition.js';
|
|
2
|
+
import type { IconifyIcon } from './iconify.js';
|
|
3
|
+
export type { IconifyIcon } from './iconify.js';
|
|
4
|
+
/**
|
|
5
|
+
* Convert caller-named individual `@iconify-icons/tabler` data, not native Tabler framework components.
|
|
6
|
+
* Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.
|
|
7
|
+
*/
|
|
8
|
+
export declare function tablerIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition>;
|
|
9
|
+
//# sourceMappingURL=tabler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabler.d.ts","sourceRoot":"","sources":["../../src/icons/tabler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAExG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabler.js","names":[],"sources":["../../src/icons/tabler.ts"],"sourcesContent":["import { mapIconifyIcons } from './_iconify-map.js';\nimport type { IconDefinition } from './definition.js';\nimport type { IconifyIcon } from './iconify.js';\n\nexport type { IconifyIcon } from './iconify.js';\n\n/**\n * Convert caller-named individual `@iconify-icons/tabler` data, not native Tabler framework components.\n * Preserves app keys and SVG presentation; requires DOMParser. No imports or registration of icon sets.\n */\nexport function tablerIcons(icons: Readonly<Record<string, IconifyIcon>>): Record<string, IconDefinition> {\n return mapIconifyIcons(icons);\n}\n"],"mappings":"oDAUA,SAAgB,YAAY,EAA8E,CACxG,OAAO,EAAgB,CAAK,CAC9B"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./errors.cjs"),t=require("./inputs/shared/native-field-event.cjs");exports.RefineError=e.RefineError,exports.eventFieldChecked=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./errors.cjs"),t=require("./icons/registry.cjs"),n=require("./inputs/shared/native-field-event.cjs");exports.RefineError=e.RefineError,exports.eventFieldChecked=n.eventFieldChecked,exports.eventFieldValue=n.eventFieldValue,exports.registerIcons=t.registerIcons;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* ownership and bundle contents obvious to application code.
|
|
6
6
|
*/
|
|
7
7
|
export { RefineError } from './errors';
|
|
8
|
+
export type { IconAttributes, IconDefinition, IconElement } from './icons';
|
|
9
|
+
export { registerIcons } from './icons';
|
|
8
10
|
export { eventFieldChecked, eventFieldValue } from './inputs/shared/native-field-event';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RefineError as e}from"./errors.js";import{eventFieldChecked as
|
|
1
|
+
import{RefineError as e}from"./errors.js";import{registerIcons as t}from"./icons/registry.js";import{eventFieldChecked as n,eventFieldValue as r}from"./inputs/shared/native-field-event.js";export{e as RefineError,n as eventFieldChecked,r as eventFieldValue,t as registerIcons};
|
|
@@ -52,7 +52,7 @@ export type OreMessageComposerProps = {
|
|
|
52
52
|
required?: boolean;
|
|
53
53
|
/** Number of visible rows before auto-resize grows the field */
|
|
54
54
|
rows?: number;
|
|
55
|
-
/**
|
|
55
|
+
/** Registered icon name for the default send button (default `'arrow-up'`) */
|
|
56
56
|
'send-icon'?: string;
|
|
57
57
|
/** Accessible label for the send button (default `'Send message'`) */
|
|
58
58
|
'send-label'?: string;
|
|
@@ -100,7 +100,7 @@ export type OreMessageComposerProps = {
|
|
|
100
100
|
* @attr {string} variant - Visual variant of the card: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'
|
|
101
101
|
* @attr {string} size - 'sm' | 'md' | 'lg'
|
|
102
102
|
* @attr {boolean} fullwidth - Stretch to the full width of the container
|
|
103
|
-
* @attr {string} send-icon -
|
|
103
|
+
* @attr {string} send-icon - Registered icon name for the default send button (default 'arrow-up')
|
|
104
104
|
* @attr {string} send-label - Accessible label for the send button (default 'Send message')
|
|
105
105
|
* @attr {string} send-shortcut - 'enter' (default) | 'mod+enter'
|
|
106
106
|
* @attr {boolean} clear-on-send - Clear the value and refocus after a non-cancelled send (default true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../../src/inputs/message-composer/message-composer.ts"],"names":[],"mappings":"AAeA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAkBpB,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhE,OAAO,EAAE,QAAQ,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{"version":3,"file":"message-composer.d.ts","sourceRoot":"","sources":["../../../src/inputs/message-composer/message-composer.ts"],"names":[],"mappings":"AAeA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAkBpB,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,6CAA6C;AAC7C,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,IAAI,EAAE;QAAE,aAAa,EAAE,aAAa,GAAG,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACpE,CAAC;AAEF,kCAAkC;AAClC,MAAM,MAAM,uBAAuB,GAAG;IACpC,gFAAgF;IAChF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACxD,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8IAA8I;IAC9I,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,qBAAqB;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,eAAO,MAAM,oBAAoB,EAAG,sBAA+B,CAAC"}
|
|
@@ -9,7 +9,7 @@ export type OreSelectOptionInput = {
|
|
|
9
9
|
/** Explanation displayed and announced when the option is disabled. */
|
|
10
10
|
disabledReason?: string;
|
|
11
11
|
group?: string;
|
|
12
|
-
/** Icon(s) rendered before the option label:
|
|
12
|
+
/** Icon(s) rendered before the option label: registered name(s) or image URL(s). */
|
|
13
13
|
icon?: string | string[];
|
|
14
14
|
label?: string;
|
|
15
15
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/inputs/select/select.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAqB,MAAM,YAAY,CAAC;AAE7E,OAAO,KAAK,EAAE,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AC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,eAAO,MAAM,UAAU,EAAG,YAAqB,CAAC;AAgjBhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,eAAe,EAAG,iBAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-composer.cjs","names":[],"sources":["../src/inputs/message-composer/message-composer.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n model,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed } from '@vielzeug/ripple';\nimport {\n bindRefCallback,\n createAutoResize,\n createComposerControl,\n createTextField,\n lifecycleSignal,\n type SendShortcut,\n} from '../../core';\nimport {\n disablableBundle,\n loadableBundle,\n MESSAGE_COMPOSER_SIZE_PRESET,\n sizableBundle,\n themableBundle,\n} from '../../shared';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n forcedColorsMixin,\n reducedMotionMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport type { ComponentSize, ThemeColor } from '../../types';\nimport { FIELD_VARIANTS, type FieldVariant } from '../../types';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderFieldStatusRegion, renderStatusIcon } from '../shared/templates';\n\nimport componentStyles from './message-composer.css?inline';\n\nexport { ICON_TAG } from '../../content/icon/icon';\nexport type { SendShortcut } from '../../core';\nexport { BUTTON_TAG } from '../button/button';\n\nconst DEFAULT_SEND_LABEL = 'Send message';\nconst SEND_ICON = 'arrow-up';\n\n/** Events emitted by the message composer */\nexport type OreMessageComposerEvents = {\n input: InputEvent;\n /**\n * Fired for a send attempt (the resolved `send-shortcut` or the send button) while the\n * composer isn't blank/disabled/loading. Cancelable: call `preventDefault()` to keep the\n * current text in the field instead of the default clear + refocus.\n */\n send: { originalEvent: KeyboardEvent | MouseEvent; value: string };\n};\n\n/** Message composer properties */\nexport type OreMessageComposerProps = {\n /** Clear the value and refocus after a non-cancelled `send` (default `true`) */\n 'clear-on-send'?: boolean;\n /** Theme color (card focus ring + default send button color) */\n color?: ThemeColor;\n /** Disable the whole composer (field, slots, and send action) */\n disabled?: boolean;\n /** Error message shown below the field */\n error?: string;\n /** Stretch the composer to the full width of its container */\n fullwidth?: boolean;\n /** Helper text shown below the field */\n helper?: string;\n /** Accessible name for the field: never rendered visually, only as `aria-label` */\n label?: string;\n /** Blocks further sends (e.g. a send is already in flight) without disabling editing */\n loading?: boolean;\n /** Maximum character count; shows a counter */\n maxlength?: number;\n /** Form field name */\n name?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Make the field read-only */\n readonly?: boolean;\n /**\n * JS-only callback fired with the inner `<textarea>` element when it mounts, and with\n * `null` when it unmounts. Set as a JS property: `composer.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLTextAreaElement | null) => void) | null;\n /** Require a non-blank value for native form validation */\n required?: boolean;\n /** Number of visible rows before auto-resize grows the field */\n rows?: number;\n /** Lucide icon name for the default send button (default `'arrow-up'`) */\n 'send-icon'?: string;\n /** Accessible label for the send button (default `'Send message'`) */\n 'send-label'?: string;\n /** Keyboard shortcut that sends: 'enter' (Shift+Enter for a newline) or 'mod+enter' (Enter always inserts a newline; Ctrl/Cmd+Enter sends) */\n 'send-shortcut'?: SendShortcut;\n /** Component size */\n size?: ComponentSize;\n /**\n * Shows an inline green check icon inside the field to confirm the value has\n * passed validation. Ignored while `error` is set: an error always wins.\n */\n success?: boolean;\n /** Current text value */\n value?: string;\n /** Visual variant of the card: same variant set as `ore-textarea`, applied to the card. */\n variant?: FieldVariant;\n};\n\n/**\n * A message/comment composer: a card with an auto-resizing field on top and a toolbar row\n * below it, built directly on the same core primitives as `ore-textarea` (`createTextField`,\n * `createAutoResize`) rather than composing `ore-textarea` itself. Nesting a fully-styled sibling\n * component and suppressing most of its chrome (as an earlier version of this component did) is\n * a leaky composition: this owns its single `<textarea>` outright, so there's exactly one\n * implementation of the field's appearance to reason about, not two fighting each other.\n *\n * Handles the send gesture (Enter to send, Shift+Enter for a newline, or a Ctrl/Cmd+Enter\n * alternative), IME-safe composition, and clear-and-refocus after sending.\n *\n * @element ore-message-composer\n *\n * @attr {string} value - Current text value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} label - Accessible name for the field (not rendered visually)\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text shown below the field\n * @attr {string} error - Error message shown below the field\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {boolean} disabled - Disable the whole composer\n * @attr {boolean} readonly - Read-only mode\n * @attr {boolean} required - Require a non-blank value for native form validation\n * @attr {boolean} loading - Blocks further sends without disabling editing\n * @attr {number} maxlength - Max character count; shows a counter\n * @attr {number} rows - Visible rows before auto-resize grows the field (default 1)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant of the card: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n * @attr {string} size - 'sm' | 'md' | 'lg'\n * @attr {boolean} fullwidth - Stretch to the full width of the container\n * @attr {string} send-icon - Lucide icon name for the default send button (default 'arrow-up')\n * @attr {string} send-label - Accessible label for the send button (default 'Send message')\n * @attr {string} send-shortcut - 'enter' (default) | 'mod+enter'\n * @attr {boolean} clear-on-send - Clear the value and refocus after a non-cancelled send (default true)\n *\n * @fires input - Fired on every keystroke. detail: { value, originalEvent }\n * @fires send - Fired on a send attempt. Cancelable. detail: { value, originalEvent }\n *\n * @slot prefix - Content at the start of the toolbar row (e.g. an attach menu)\n * @slot suffix - Content at the end of the toolbar row, before the send button (e.g. a model picker)\n * @slot send - Replaces the default send button entirely: the only supported way to customize it\n *\n * @cssprop --message-composer-bg - Card background color\n * @cssprop --message-composer-border-color - Card border color\n * @cssprop --message-composer-radius - Card border radius\n * @cssprop --message-composer-padding - Card inner padding\n * @cssprop --message-composer-gap - Gap between the field/toolbar rows and between toolbar items\n * @cssprop --message-composer-placeholder-color - Field placeholder text color\n * @cssprop --message-composer-min-height - Minimum field height (default one line)\n * @cssprop --message-composer-hover-bg - Card background on hover (flat/ghost variants)\n * @cssprop --message-composer-hover-border-color - Card border on hover (flat/bordered variants)\n * @cssprop --message-composer-focus-bg - Card background when focused (flat variant)\n * @cssprop --message-composer-focus-border-color - Card border when focused (flat variant)\n *\n * @part composer - Root card container\n * @part field - The native `<textarea>` element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part helper - Helper text element\n * @part error - Error text element (`role=\"alert\"`)\n * @part toolbar - Toolbar row below the field\n * @part toolbar-start - Toolbar group holding the `prefix` slot\n * @part toolbar-end - Toolbar group holding the `suffix` slot and the send button\n * @part send-button - The default send button (absent when the `send` slot is used)\n *\n * @example\n * ```html\n * <ore-message-composer placeholder=\"Message…\" send-shortcut=\"mod+enter\"></ore-message-composer>\n * ```\n */\nexport const MESSAGE_COMPOSER_TAG = 'ore-message-composer' as const;\ndefine<OreMessageComposerProps>(MESSAGE_COMPOSER_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...loadableBundle,\n 'clear-on-send': prop.bool(true),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n maxlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLTextAreaElement | null) => void) | null>(),\n required: prop.bool(false),\n rows: prop.json(undefined as number | undefined),\n 'send-icon': prop.string(),\n 'send-label': prop.string(),\n 'send-shortcut': prop.oneOf(['enter', 'mod+enter'] as const, 'enter'),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.oneOf(FIELD_VARIANTS),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreMessageComposerEvents>();\n const slots = useSlots<'prefix' | 'send' | 'suffix'>();\n\n const isDisabled = props.disabled;\n\n const abortSignal = lifecycleSignal(onCleanup);\n const textareaRef = ref<HTMLTextAreaElement>();\n const autoResize = createAutoResize();\n\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n helper: props.helper,\n maxLength: props.maxlength,\n onInput: (_event, value) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'composer',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n // Directly form-associated now that the field is owned here rather than borrowed from a\n // nested `ore-textarea` (which previously registered with the ancestor `<form>` on this\n // component's behalf).\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: () => {\n tf.reset();\n autoResize.recompute();\n },\n toFormValue: (v) => v,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n function attemptSend(event: KeyboardEvent | MouseEvent): void {\n const notPrevented = emit('send', { originalEvent: event, value: tf.value.value.trim() });\n\n // `preventDefault()` on `send` means \"keep the current text: skip the default clear\n // + refocus\" (see the event's own doc comment): both halves of that default are gated on\n // the same condition, not just the clear.\n if (notPrevented && props['clear-on-send'].value !== false) {\n tf.clear();\n autoResize.recompute();\n textareaRef.value?.focus();\n }\n }\n\n const composer = createComposerControl({\n disabled: isDisabled,\n loading: computed(() => Boolean(props.loading.value)),\n onSend: attemptSend,\n sendShortcut: props['send-shortcut'],\n value: tf.value,\n });\n\n onElement(textareaRef, (textareaEl) => {\n const unwireField = tf.wire(textareaEl);\n const unwireAutoResize = autoResize.wire(textareaEl);\n const unwireRef = bindRefCallback(props.ref, textareaEl);\n const handleKeydown = (e: KeyboardEvent) => composer.handleKeydown(e);\n\n textareaEl.addEventListener('keydown', handleKeydown);\n\n return () => {\n textareaEl.removeEventListener('keydown', handleKeydown);\n unwireField();\n unwireAutoResize();\n unwireRef();\n };\n });\n\n bind({\n attr: {\n error: errorAttr(tf.errorText),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty: keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !tf.errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n return html`\n <div class=\"composer\" part=\"composer\">\n <textarea\n class=\"field\"\n part=\"field\"\n ref=\"${textareaRef}\"\n rows=\"${() => props.rows.value ?? 1}\"\n name=\"${() => props.name.value ?? ''}\"\n placeholder=\"${() => props.placeholder.value ?? 'Message…'}\"\n maxlength=\"${() => props.maxlength.value}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${() => Boolean(props.readonly.value)}\"\n ?required=\"${() => Boolean(props.required.value)}\"\n value=\"${model(tf.value)}\"\n aria-label=\"${() => props.label.value || 'Message'}\"\n aria-keyshortcuts=\"${composer.keyShortcutsHint}\"\n aria-describedby=\"${tf.ariaDescribedBy}\"\n aria-errormessage=\"${tf.ariaErrorMessage}\"\n aria-invalid=\"${tf.ariaInvalid}\"></textarea>\n ${renderStatusIcon(tf.errorText)} ${renderFieldStatusRegion(tf)}\n <div class=\"toolbar\" part=\"toolbar\">\n <div class=\"toolbar-start\" part=\"toolbar-start\">\n <slot name=\"prefix\"></slot>\n </div>\n <div class=\"toolbar-end\" part=\"toolbar-end\">\n <slot name=\"suffix\"></slot>\n <slot name=\"send\"></slot>\n ${() =>\n slots.has('send').value\n ? ''\n : html`\n <ore-button\n class=\"send-btn\"\n part=\"send-button\"\n type=\"button\"\n icon-only\n variant=\"solid\"\n color=\"${() => props.color.value || 'primary'}\"\n size=\"${props.size}\"\n label=\"${() => props['send-label'].value || DEFAULT_SEND_LABEL}\"\n ?loading=\"${() => Boolean(props.loading.value)}\"\n ?disabled=\"${() => !composer.canSend.value}\"\n @click=\"${(e: MouseEvent) => composer.send(e)}\">\n <ore-icon name=\"${() => props['send-icon'].value || SEND_ICON}\" size=\"16\"></ore-icon>\n </ore-button>\n `}\n </div>\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n disabledLoadingMixin,\n forcedColorsMixin,\n forcedColorsFocusMixin('.field'),\n sizeVariantMixin(MESSAGE_COMPOSER_SIZE_PRESET),\n componentStyles,\n // Must come after `componentStyles`: see `ore-input`'s identical ordering note for why\n // (`@layer` precedence is fixed by which layer name is *first* referenced across this whole\n // array; `componentStyles` establishes `refine.base`, which this mixin's `refine.variants`\n // rules need to win over).\n fieldVariantMixin({ container: '.composer', text: '.field', tokenPrefix: 'message-composer' }),\n ],\n});\n"],"mappings":"s4BAoDA,IAAM,EAAqB,eACrB,EAAY,WAwIL,EAAuB,wBACpC,EAAA,EAAA,OAAA,CAAgC,EAAsB,CACpD,eAAgB,GAChB,MAAO,CACL,GAAG,EAAA,eACH,GAAG,EAAA,cACH,GAAG,EAAA,iBACH,GAAG,EAAA,eACH,gBAAiB,EAAA,KAAK,KAAK,EAAI,EAC/B,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,OAAQ,EAAA,KAAK,OAAO,EACpB,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,IAAA,EAA+B,EACpD,KAAM,EAAA,KAAK,OAAO,EAClB,YAAa,EAAA,KAAK,OAAO,EACzB,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,IAAK,EAAA,KAAK,KAAwD,EAClE,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,KAAM,EAAA,KAAK,KAAK,IAAA,EAA+B,EAC/C,YAAa,EAAA,KAAK,OAAO,EACzB,aAAc,EAAA,KAAK,OAAO,EAC1B,gBAAiB,EAAA,KAAK,MAAM,CAAC,QAAS,W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;sCAC7C,EAAQ,EAAM,QAAQ,MAAO;uCAC5B,CAAC,EAAS,QAAQ,MAAM;gCAChC,GAAkB,EAAS,KAAK,CAAC,EAAE;4CACtB,EAAM,YAAY,CAAC,OAAS,EAAU;;oBAEhE;;;;KAKlB,EACA,OAAQ,CAAE,eAAgB,EAAK,EAC/B,OAAQ,CACN,EAAA,gBACA,EAAA,mBACA,EAAA,mBACA,EAAA,qBACA,EAAA,kBACA,EAAA,uBAAuB,QAAQ,EAC/B,EAAA,iBAAiB,EAAA,4BAA4B,EAC7C,EAAA,QAKA,EAAA,kBAAkB,CAAE,UAAW,YAAa,KAAM,SAAU,YAAa,kBAAmB,CAAC,CAC/F,CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"message-composer.cjs","names":[],"sources":["../src/inputs/message-composer/message-composer.ts"],"sourcesContent":["import {\n bind,\n define,\n getHost,\n html,\n model,\n onCleanup,\n onElement,\n prop,\n ref,\n useEmit,\n useField,\n useSlots,\n} from '@vielzeug/ore';\nimport { computed } from '@vielzeug/ripple';\nimport {\n bindRefCallback,\n createAutoResize,\n createComposerControl,\n createTextField,\n lifecycleSignal,\n type SendShortcut,\n} from '../../core';\nimport {\n disablableBundle,\n loadableBundle,\n MESSAGE_COMPOSER_SIZE_PRESET,\n sizableBundle,\n themableBundle,\n} from '../../shared';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n forcedColorsMixin,\n reducedMotionMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport type { ComponentSize, ThemeColor } from '../../types';\nimport { FIELD_VARIANTS, type FieldVariant } from '../../types';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderFieldStatusRegion, renderStatusIcon } from '../shared/templates';\n\nimport componentStyles from './message-composer.css?inline';\n\nexport { ICON_TAG } from '../../content/icon/icon';\nexport type { SendShortcut } from '../../core';\nexport { BUTTON_TAG } from '../button/button';\n\nconst DEFAULT_SEND_LABEL = 'Send message';\nconst SEND_ICON = 'arrow-up';\n\n/** Events emitted by the message composer */\nexport type OreMessageComposerEvents = {\n input: InputEvent;\n /**\n * Fired for a send attempt (the resolved `send-shortcut` or the send button) while the\n * composer isn't blank/disabled/loading. Cancelable: call `preventDefault()` to keep the\n * current text in the field instead of the default clear + refocus.\n */\n send: { originalEvent: KeyboardEvent | MouseEvent; value: string };\n};\n\n/** Message composer properties */\nexport type OreMessageComposerProps = {\n /** Clear the value and refocus after a non-cancelled `send` (default `true`) */\n 'clear-on-send'?: boolean;\n /** Theme color (card focus ring + default send button color) */\n color?: ThemeColor;\n /** Disable the whole composer (field, slots, and send action) */\n disabled?: boolean;\n /** Error message shown below the field */\n error?: string;\n /** Stretch the composer to the full width of its container */\n fullwidth?: boolean;\n /** Helper text shown below the field */\n helper?: string;\n /** Accessible name for the field: never rendered visually, only as `aria-label` */\n label?: string;\n /** Blocks further sends (e.g. a send is already in flight) without disabling editing */\n loading?: boolean;\n /** Maximum character count; shows a counter */\n maxlength?: number;\n /** Form field name */\n name?: string;\n /** Placeholder text */\n placeholder?: string;\n /** Make the field read-only */\n readonly?: boolean;\n /**\n * JS-only callback fired with the inner `<textarea>` element when it mounts, and with\n * `null` when it unmounts. Set as a JS property: `composer.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLTextAreaElement | null) => void) | null;\n /** Require a non-blank value for native form validation */\n required?: boolean;\n /** Number of visible rows before auto-resize grows the field */\n rows?: number;\n /** Registered icon name for the default send button (default `'arrow-up'`) */\n 'send-icon'?: string;\n /** Accessible label for the send button (default `'Send message'`) */\n 'send-label'?: string;\n /** Keyboard shortcut that sends: 'enter' (Shift+Enter for a newline) or 'mod+enter' (Enter always inserts a newline; Ctrl/Cmd+Enter sends) */\n 'send-shortcut'?: SendShortcut;\n /** Component size */\n size?: ComponentSize;\n /**\n * Shows an inline green check icon inside the field to confirm the value has\n * passed validation. Ignored while `error` is set: an error always wins.\n */\n success?: boolean;\n /** Current text value */\n value?: string;\n /** Visual variant of the card: same variant set as `ore-textarea`, applied to the card. */\n variant?: FieldVariant;\n};\n\n/**\n * A message/comment composer: a card with an auto-resizing field on top and a toolbar row\n * below it, built directly on the same core primitives as `ore-textarea` (`createTextField`,\n * `createAutoResize`) rather than composing `ore-textarea` itself. Nesting a fully-styled sibling\n * component and suppressing most of its chrome (as an earlier version of this component did) is\n * a leaky composition: this owns its single `<textarea>` outright, so there's exactly one\n * implementation of the field's appearance to reason about, not two fighting each other.\n *\n * Handles the send gesture (Enter to send, Shift+Enter for a newline, or a Ctrl/Cmd+Enter\n * alternative), IME-safe composition, and clear-and-refocus after sending.\n *\n * @element ore-message-composer\n *\n * @attr {string} value - Current text value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} label - Accessible name for the field (not rendered visually)\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text shown below the field\n * @attr {string} error - Error message shown below the field\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {boolean} disabled - Disable the whole composer\n * @attr {boolean} readonly - Read-only mode\n * @attr {boolean} required - Require a non-blank value for native form validation\n * @attr {boolean} loading - Blocks further sends without disabling editing\n * @attr {number} maxlength - Max character count; shows a counter\n * @attr {number} rows - Visible rows before auto-resize grows the field (default 1)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant of the card: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n * @attr {string} size - 'sm' | 'md' | 'lg'\n * @attr {boolean} fullwidth - Stretch to the full width of the container\n * @attr {string} send-icon - Registered icon name for the default send button (default 'arrow-up')\n * @attr {string} send-label - Accessible label for the send button (default 'Send message')\n * @attr {string} send-shortcut - 'enter' (default) | 'mod+enter'\n * @attr {boolean} clear-on-send - Clear the value and refocus after a non-cancelled send (default true)\n *\n * @fires input - Fired on every keystroke. detail: { value, originalEvent }\n * @fires send - Fired on a send attempt. Cancelable. detail: { value, originalEvent }\n *\n * @slot prefix - Content at the start of the toolbar row (e.g. an attach menu)\n * @slot suffix - Content at the end of the toolbar row, before the send button (e.g. a model picker)\n * @slot send - Replaces the default send button entirely: the only supported way to customize it\n *\n * @cssprop --message-composer-bg - Card background color\n * @cssprop --message-composer-border-color - Card border color\n * @cssprop --message-composer-radius - Card border radius\n * @cssprop --message-composer-padding - Card inner padding\n * @cssprop --message-composer-gap - Gap between the field/toolbar rows and between toolbar items\n * @cssprop --message-composer-placeholder-color - Field placeholder text color\n * @cssprop --message-composer-min-height - Minimum field height (default one line)\n * @cssprop --message-composer-hover-bg - Card background on hover (flat/ghost variants)\n * @cssprop --message-composer-hover-border-color - Card border on hover (flat/bordered variants)\n * @cssprop --message-composer-focus-bg - Card background when focused (flat variant)\n * @cssprop --message-composer-focus-border-color - Card border when focused (flat variant)\n *\n * @part composer - Root card container\n * @part field - The native `<textarea>` element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part helper - Helper text element\n * @part error - Error text element (`role=\"alert\"`)\n * @part toolbar - Toolbar row below the field\n * @part toolbar-start - Toolbar group holding the `prefix` slot\n * @part toolbar-end - Toolbar group holding the `suffix` slot and the send button\n * @part send-button - The default send button (absent when the `send` slot is used)\n *\n * @example\n * ```html\n * <ore-message-composer placeholder=\"Message…\" send-shortcut=\"mod+enter\"></ore-message-composer>\n * ```\n */\nexport const MESSAGE_COMPOSER_TAG = 'ore-message-composer' as const;\ndefine<OreMessageComposerProps>(MESSAGE_COMPOSER_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...loadableBundle,\n 'clear-on-send': prop.bool(true),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n label: prop.string(),\n maxlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLTextAreaElement | null) => void) | null>(),\n required: prop.bool(false),\n rows: prop.json(undefined as number | undefined),\n 'send-icon': prop.string(),\n 'send-label': prop.string(),\n 'send-shortcut': prop.oneOf(['enter', 'mod+enter'] as const, 'enter'),\n success: prop.bool(false),\n value: prop.string(),\n variant: prop.oneOf(FIELD_VARIANTS),\n },\n setup(props) {\n const el = getHost();\n const emit = useEmit<OreMessageComposerEvents>();\n const slots = useSlots<'prefix' | 'send' | 'suffix'>();\n\n const isDisabled = props.disabled;\n\n const abortSignal = lifecycleSignal(onCleanup);\n const textareaRef = ref<HTMLTextAreaElement>();\n const autoResize = createAutoResize();\n\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n helper: props.helper,\n maxLength: props.maxlength,\n onInput: (_event, value) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'composer',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n // Directly form-associated now that the field is owned here rather than borrowed from a\n // nested `ore-textarea` (which previously registered with the ancestor `<form>` on this\n // component's behalf).\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: () => {\n tf.reset();\n autoResize.recompute();\n },\n toFormValue: (v) => v,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n function attemptSend(event: KeyboardEvent | MouseEvent): void {\n const notPrevented = emit('send', { originalEvent: event, value: tf.value.value.trim() });\n\n // `preventDefault()` on `send` means \"keep the current text: skip the default clear\n // + refocus\" (see the event's own doc comment): both halves of that default are gated on\n // the same condition, not just the clear.\n if (notPrevented && props['clear-on-send'].value !== false) {\n tf.clear();\n autoResize.recompute();\n textareaRef.value?.focus();\n }\n }\n\n const composer = createComposerControl({\n disabled: isDisabled,\n loading: computed(() => Boolean(props.loading.value)),\n onSend: attemptSend,\n sendShortcut: props['send-shortcut'],\n value: tf.value,\n });\n\n onElement(textareaRef, (textareaEl) => {\n const unwireField = tf.wire(textareaEl);\n const unwireAutoResize = autoResize.wire(textareaEl);\n const unwireRef = bindRefCallback(props.ref, textareaEl);\n const handleKeydown = (e: KeyboardEvent) => composer.handleKeydown(e);\n\n textareaEl.addEventListener('keydown', handleKeydown);\n\n return () => {\n textareaEl.removeEventListener('keydown', handleKeydown);\n unwireField();\n unwireAutoResize();\n unwireRef();\n };\n });\n\n bind({\n attr: {\n error: errorAttr(tf.errorText),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty: keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !tf.errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n return html`\n <div class=\"composer\" part=\"composer\">\n <textarea\n class=\"field\"\n part=\"field\"\n ref=\"${textareaRef}\"\n rows=\"${() => props.rows.value ?? 1}\"\n name=\"${() => props.name.value ?? ''}\"\n placeholder=\"${() => props.placeholder.value ?? 'Message…'}\"\n maxlength=\"${() => props.maxlength.value}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${() => Boolean(props.readonly.value)}\"\n ?required=\"${() => Boolean(props.required.value)}\"\n value=\"${model(tf.value)}\"\n aria-label=\"${() => props.label.value || 'Message'}\"\n aria-keyshortcuts=\"${composer.keyShortcutsHint}\"\n aria-describedby=\"${tf.ariaDescribedBy}\"\n aria-errormessage=\"${tf.ariaErrorMessage}\"\n aria-invalid=\"${tf.ariaInvalid}\"></textarea>\n ${renderStatusIcon(tf.errorText)} ${renderFieldStatusRegion(tf)}\n <div class=\"toolbar\" part=\"toolbar\">\n <div class=\"toolbar-start\" part=\"toolbar-start\">\n <slot name=\"prefix\"></slot>\n </div>\n <div class=\"toolbar-end\" part=\"toolbar-end\">\n <slot name=\"suffix\"></slot>\n <slot name=\"send\"></slot>\n ${() =>\n slots.has('send').value\n ? ''\n : html`\n <ore-button\n class=\"send-btn\"\n part=\"send-button\"\n type=\"button\"\n icon-only\n variant=\"solid\"\n color=\"${() => props.color.value || 'primary'}\"\n size=\"${props.size}\"\n label=\"${() => props['send-label'].value || DEFAULT_SEND_LABEL}\"\n ?loading=\"${() => Boolean(props.loading.value)}\"\n ?disabled=\"${() => !composer.canSend.value}\"\n @click=\"${(e: MouseEvent) => composer.send(e)}\">\n <ore-icon name=\"${() => props['send-icon'].value || SEND_ICON}\" size=\"16\"></ore-icon>\n </ore-button>\n `}\n </div>\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n disabledLoadingMixin,\n forcedColorsMixin,\n forcedColorsFocusMixin('.field'),\n sizeVariantMixin(MESSAGE_COMPOSER_SIZE_PRESET),\n componentStyles,\n // Must come after `componentStyles`: see `ore-input`'s identical ordering note for why\n // (`@layer` precedence is fixed by which layer name is *first* referenced across this whole\n // array; `componentStyles` establishes `refine.base`, which this mixin's `refine.variants`\n // rules need to win over).\n fieldVariantMixin({ container: '.composer', text: '.field', tokenPrefix: 'message-composer' }),\n ],\n});\n"],"mappings":"s4BAoDA,IAAM,EAAqB,eACrB,EAAY,WAwIL,EAAuB,wBACpC,EAAA,EAAA,OAAA,CAAgC,EAAsB,CACpD,eAAgB,GAChB,MAAO,CACL,GAAG,EAAA,eACH,GAAG,EAAA,cACH,GAAG,EAAA,iBACH,GAAG,EAAA,eACH,gBAAiB,EAAA,KAAK,KAAK,EAAI,EAC/B,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,OAAQ,EAAA,KAAK,OAAO,EACpB,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,IAAA,EAA+B,EACpD,KAAM,EAAA,KAAK,OAAO,EAClB,YAAa,EAAA,KAAK,OAAO,EACzB,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,IAAK,EAAA,KAAK,KAAwD,EAClE,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,KAAM,EAAA,KAAK,KAAK,IAAA,EAA+B,EAC/C,YAAa,EAAA,KA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