@ng-native/icons 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/parse-svg.js CHANGED
@@ -17,11 +17,30 @@ const TEXT_CONTAINERS = new Set(['text', 'tspan']);
17
17
  const ENTITIES = { amp: '&', lt: '<', gt: '>', quot: '"', apos: "'" };
18
18
  /** Characters as SVG draws them by default: runs of white space as one space, entities read. */
19
19
  const characters = (raw) => raw.replace(/\s+/g, ' ').replace(/&(amp|lt|gt|quot|apos);/g, (_, name) => ENTITIES[name]);
20
- /** `<tag`, `/>`, `</tag>` and the attribute soup between them. */
21
- const TAG = /<\s*(\/)?\s*([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)(\/)?>/g;
22
- const ATTRIBUTE = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
23
- /** Comments and processing instructions, which carry nothing a renderer needs. */
24
- const IGNORED = /<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[[\s\S]*?\]\]>/g;
20
+ /**
21
+ * `<tag`, `/>`, `</tag>` and the attribute soup between them, each read one way only, so that a tag
22
+ * that never closes is given up once rather than tried again split another way. The soup stops at
23
+ * a `<` outside quotes: `<a<a<a…` is given up at the next `<`. The name is all of the word, not
24
+ * a part of it with the rest read as soup, and the space before it is all on one side of a `/`.
25
+ */
26
+ const TAG = /<\s*(?:(\/)\s*)?([a-zA-Z][\w:-]*)(?![\w:-])((?:[^<>"']|"[^"]*"|'[^']*')*)(\/)?>/g;
27
+ /**
28
+ * A name, `=` and a quoted value. The name starts after a space, so a long word with no `=` after
29
+ * it is tried once, not again from each of its letters.
30
+ */
31
+ const ATTRIBUTE = /(?:^|\s)([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
32
+ /**
33
+ * How deep elements may nest for an icon to keep them. Each level is a view in the tree and a call
34
+ * deeper wherever the tree is walked, so `[svg]` markup from a server nested a few thousand deep
35
+ * would overflow the stack. The icon sets nest two or three.
36
+ */
37
+ const MAX_DEPTH = 32;
38
+ /**
39
+ * Comments and processing instructions, which carry nothing a renderer needs. One left open runs
40
+ * to the end, as an open comment does in a browser: looking for its end again from each `<!--` in
41
+ * `<!--<!--<!--…` took as long as the markup's length squared.
42
+ */
43
+ const IGNORED = /<!--[\s\S]*?(?:-->|$)|<\?[\s\S]*?(?:\?>|$)|<!\[CDATA\[[\s\S]*?(?:\]\]>|$)/g;
25
44
  function attributesOf(source) {
26
45
  const attrs = {};
27
46
  ATTRIBUTE.lastIndex = 0;
@@ -31,6 +50,15 @@ function attributesOf(source) {
31
50
  }
32
51
  return attrs;
33
52
  }
53
+ /**
54
+ * A new element as the last child of the one it is in, unless that is `MAX_DEPTH` deep: then it,
55
+ * and everything in it, is left out of the tree. It still goes on the stack after this, so the
56
+ * tags that close it close it and not one of its ancestors.
57
+ */
58
+ function placeUnder(stack, node) {
59
+ if (stack.length < MAX_DEPTH)
60
+ stack[stack.length - 1]?.children.push(node);
61
+ }
34
62
  /**
35
63
  * The root element, or null when there is nothing renderable.
36
64
  *
@@ -58,7 +86,7 @@ export function parseSvg(markup) {
58
86
  continue;
59
87
  }
60
88
  const node = { tag: tag, attrs: attributesOf(attributes ?? ''), children: [] };
61
- stack[stack.length - 1]?.children.push(node);
89
+ placeUnder(stack, node);
62
90
  root ??= node;
63
91
  // The attribute run is greedy and swallows the `/` of `<path/>`, so the closing slash is
64
92
  // recognised at either end of it. Miss this and every sibling nests inside the one before it,
@@ -1 +1 @@
1
- {"version":3,"file":"parse-svg.js","sourceRoot":"","sources":["../src/parse-svg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,wFAAwF;AACxF,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAExE,MAAM,QAAQ,GAA2B,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAA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**\n * SVG markup to a tree, for the one kind of SVG an icon set ships.\n *\n * This is not a general XML parser and does not want to be. An icon is a build-time constant from\n * a package like `@ng-icons/heroicons`: no namespaces to resolve, no entities, no CDATA, no\n * external references, and across heroicons, lucide and bootstrap-icons - some five thousand\n * icons - the entire tag surface is `svg`, `path`, `circle`, `rect`, `line`, `ellipse`,\n * `polyline`, `polygon` and `g`.\n *\n * ponytail: a scanner rather than a parser. It ignores anything it does not recognise, which for\n * a trusted constant is the right trade; the failure mode for markup outside that surface is a\n * missing shape rather than a wrong one. An icon with a `<style>` block or a CSS class would need\n * a real parser, and no set in ng-icons ships one.\n */\n\nexport interface SvgNode {\n readonly tag: string;\n readonly attrs: Readonly<Record<string, string>>;\n readonly children: SvgNode[];\n /** The characters of a `#text` node, which only a `text` or a `tspan` has. */\n readonly text?: string;\n}\n\n/** The elements whose characters are drawn. Between any others they are indentation. */\nconst TEXT_CONTAINERS: ReadonlySet<string> = new Set(['text', 'tspan']);\n\nconst ENTITIES: Record<string, string> = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: \"'\" };\n\n/** Characters as SVG draws them by default: runs of white space as one space, entities read. */\nconst characters = (raw: string): string =>\n raw.replace(/\\s+/g, ' ').replace(/&(amp|lt|gt|quot|apos);/g, (_, name) => ENTITIES[name]!);\n\n/** `<tag`, `/>`, `</tag>` and the attribute soup between them. */\nconst TAG = /<\\s*(\\/)?\\s*([a-zA-Z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)(\\/)?>/g;\nconst ATTRIBUTE = /([\\w:-]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g;\n/** Comments and processing instructions, which carry nothing a renderer needs. */\nconst IGNORED = /<!--[\\s\\S]*?-->|<\\?[\\s\\S]*?\\?>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/g;\n\nfunction attributesOf(source: string): Record<string, string> {\n const attrs: Record<string, string> = {};\n ATTRIBUTE.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = ATTRIBUTE.exec(source)) !== null) {\n attrs[match[1]!] = match[2] ?? match[3] ?? '';\n }\n return attrs;\n}\n\n/**\n * The root element, or null when there is nothing renderable.\n *\n * Only elements are kept, and the characters inside a `text` or a `tspan`: an icon's other text\n * nodes are whitespace, and a `<title>` is a label a screen reader on the web would read, which\n * here is `accessibilityLabel` on the host.\n */\nexport function parseSvg(markup: string): SvgNode | null {\n const source = markup.replace(IGNORED, '');\n const stack: SvgNode[] = [];\n let root: SvgNode | null = null;\n\n TAG.lastIndex = 0;\n let match: RegExpExecArray | null;\n let from = 0;\n while ((match = TAG.exec(source)) !== null) {\n const [, closing, tag, attributes, selfClosing] = match;\n const parent = stack[stack.length - 1];\n const text = characters(source.slice(from, match.index));\n from = TAG.lastIndex;\n if (parent && TEXT_CONTAINERS.has(parent.tag) && text.trim()) {\n parent.children.push({ tag: '#text', attrs: {}, children: [], text });\n }\n\n if (closing) {\n stack.pop();\n continue;\n }\n\n const node: SvgNode = { tag: tag!, attrs: attributesOf(attributes ?? ''), children: [] };\n stack[stack.length - 1]?.children.push(node);\n root ??= node;\n // The attribute run is greedy and swallows the `/` of `<path/>`, so the closing slash is\n // recognised at either end of it. Miss this and every sibling nests inside the one before it,\n // which draws the same icon and inherits paint that was never meant for it.\n if (!selfClosing && !/\\/\\s*$/.test(attributes ?? '')) stack.push(node);\n }\n\n return root;\n}\n"]}
1
+ {"version":3,"file":"parse-svg.js","sourceRoot":"","sources":["../src/parse-svg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,wFAAwF;AACxF,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAExE,MAAM,QAAQ,GAA2B,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAE9F,gGAAg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U,IAAI,EAAE,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * SVG markup to a tree, for the one kind of SVG an icon set ships.\n *\n * This is not a general XML parser and does not want to be. An icon is a build-time constant from\n * a package like `@ng-icons/heroicons`: no namespaces to resolve, no entities, no CDATA, no\n * external references, and across heroicons, lucide and bootstrap-icons - some five thousand\n * icons - the entire tag surface is `svg`, `path`, `circle`, `rect`, `line`, `ellipse`,\n * `polyline`, `polygon` and `g`.\n *\n * ponytail: a scanner rather than a parser. It ignores anything it does not recognise, which for\n * a trusted constant is the right trade; the failure mode for markup outside that surface is a\n * missing shape rather than a wrong one. An icon with a `<style>` block or a CSS class would need\n * a real parser, and no set in ng-icons ships one.\n */\n\nexport interface SvgNode {\n readonly tag: string;\n readonly attrs: Readonly<Record<string, string>>;\n readonly children: SvgNode[];\n /** The characters of a `#text` node, which only a `text` or a `tspan` has. */\n readonly text?: string;\n}\n\n/** The elements whose characters are drawn. Between any others they are indentation. */\nconst TEXT_CONTAINERS: ReadonlySet<string> = new Set(['text', 'tspan']);\n\nconst ENTITIES: Record<string, string> = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: \"'\" };\n\n/** Characters as SVG draws them by default: runs of white space as one space, entities read. */\nconst characters = (raw: string): string =>\n raw.replace(/\\s+/g, ' ').replace(/&(amp|lt|gt|quot|apos);/g, (_, name) => ENTITIES[name]!);\n\n/**\n * `<tag`, `/>`, `</tag>` and the attribute soup between them, each read one way only, so that a tag\n * that never closes is given up once rather than tried again split another way. The soup stops at\n * a `<` outside quotes: `<a<a<a…` is given up at the next `<`. The name is all of the word, not\n * a part of it with the rest read as soup, and the space before it is all on one side of a `/`.\n */\nconst TAG = /<\\s*(?:(\\/)\\s*)?([a-zA-Z][\\w:-]*)(?![\\w:-])((?:[^<>\"']|\"[^\"]*\"|'[^']*')*)(\\/)?>/g;\n/**\n * A name, `=` and a quoted value. The name starts after a space, so a long word with no `=` after\n * it is tried once, not again from each of its letters.\n */\nconst ATTRIBUTE = /(?:^|\\s)([\\w:-]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g;\n/**\n * How deep elements may nest for an icon to keep them. Each level is a view in the tree and a call\n * deeper wherever the tree is walked, so `[svg]` markup from a server nested a few thousand deep\n * would overflow the stack. The icon sets nest two or three.\n */\nconst MAX_DEPTH = 32;\n/**\n * Comments and processing instructions, which carry nothing a renderer needs. One left open runs\n * to the end, as an open comment does in a browser: looking for its end again from each `<!--` in\n * `<!--<!--<!--…` took as long as the markup's length squared.\n */\nconst IGNORED = /<!--[\\s\\S]*?(?:-->|$)|<\\?[\\s\\S]*?(?:\\?>|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>|$)/g;\n\nfunction attributesOf(source: string): Record<string, string> {\n const attrs: Record<string, string> = {};\n ATTRIBUTE.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = ATTRIBUTE.exec(source)) !== null) {\n attrs[match[1]!] = match[2] ?? match[3] ?? '';\n }\n return attrs;\n}\n\n/**\n * A new element as the last child of the one it is in, unless that is `MAX_DEPTH` deep: then it,\n * and everything in it, is left out of the tree. It still goes on the stack after this, so the\n * tags that close it close it and not one of its ancestors.\n */\nfunction placeUnder(stack: readonly SvgNode[], node: SvgNode): void {\n if (stack.length < MAX_DEPTH) stack[stack.length - 1]?.children.push(node);\n}\n\n/**\n * The root element, or null when there is nothing renderable.\n *\n * Only elements are kept, and the characters inside a `text` or a `tspan`: an icon's other text\n * nodes are whitespace, and a `<title>` is a label a screen reader on the web would read, which\n * here is `accessibilityLabel` on the host.\n */\nexport function parseSvg(markup: string): SvgNode | null {\n const source = markup.replace(IGNORED, '');\n const stack: SvgNode[] = [];\n let root: SvgNode | null = null;\n\n TAG.lastIndex = 0;\n let match: RegExpExecArray | null;\n let from = 0;\n while ((match = TAG.exec(source)) !== null) {\n const [, closing, tag, attributes, selfClosing] = match;\n const parent = stack[stack.length - 1];\n const text = characters(source.slice(from, match.index));\n from = TAG.lastIndex;\n if (parent && TEXT_CONTAINERS.has(parent.tag) && text.trim()) {\n parent.children.push({ tag: '#text', attrs: {}, children: [], text });\n }\n\n if (closing) {\n stack.pop();\n continue;\n }\n\n const node: SvgNode = { tag: tag!, attrs: attributesOf(attributes ?? ''), children: [] };\n placeUnder(stack, node);\n root ??= node;\n // The attribute run is greedy and swallows the `/` of `<path/>`, so the closing slash is\n // recognised at either end of it. Miss this and every sibling nests inside the one before it,\n // which draws the same icon and inherits paint that was never meant for it.\n if (!selfClosing && !/\\/\\s*$/.test(attributes ?? '')) stack.push(node);\n }\n\n return root;\n}\n"]}
package/dist/svg-props.js CHANGED
@@ -306,7 +306,12 @@ export function viewBoxProps(viewBox) {
306
306
  const [minX, minY, vbWidth, vbHeight] = parts;
307
307
  return { minX, minY, vbWidth, vbHeight, align: 'xMidYMid', meetOrSlice: 0 };
308
308
  }
309
- const TRANSFORM = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
309
+ /**
310
+ * One function of a `transform`: its name, from the start of a word, and what is in its brackets,
311
+ * which stop at the next `(`. A run of letters, or of `a(`, that never closes is then tried once,
312
+ * not again from each place in it.
313
+ */
314
+ const TRANSFORM = /\b([a-zA-Z]+)\s*\(([^()]*)\)/g;
310
315
  /**
311
316
  * A `transform` attribute as a 2x3 matrix, which is the only form native takes.
312
317
  *
@@ -1 +1 @@
1
- {"version":3,"file":"svg-props.js","sourceRoot":"","sources":["../src/svg-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,OAAO,GAA2B,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzE,MAAM,QAAQ,GAA2B,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC1E,MAAM,SAAS,G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AA0F;AAC1F,SAAS,SAAS,CAAC,IAAY,EAAE,KAAa;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC,IAAI,CAAE,CAAC;IAChD,kFAAkF;IAClF,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACjF,CAAC","sourcesContent":["/**\n * SVG attributes to the props react-native-svg's native views actually take.\n *\n * They are not the same thing, and the difference is the whole reason this file exists. `fill`\n * and `stroke` are not colours but *brushes*, a tagged struct that says whether the paint is a\n * colour, the view's own `color`, or a reference to a gradient. `stroke-linecap`, `stroke-linejoin`\n * and `fill-rule` are integers, not the keywords they are written as. And a shape has to declare\n * which props it set - `propList` - because anything absent is inherited from the group above it,\n * which is exactly how an icon whose root carries `stroke=\"currentColor\"` paints its paths.\n *\n * Send the attributes through unchanged and every one of those reads as nothing at all, with no\n * error: the shape draws in the default black, or does not draw.\n *\n * All of this is what react-native-svg does in JavaScript before its props reach native. Its\n * components are React, so this is the same translation rather than a call into it.\n */\n\n/** The paint on a shape: a colour, the view's own colour, or a reference to a gradient. */\nexport type Brush =\n | null\n | { readonly type: 0; readonly payload: unknown }\n | { readonly type: 1; readonly brushRef: string }\n | { readonly type: 2 };\n\nconst LINECAP: Record<string, number> = { butt: 0, round: 1, square: 2 };\nconst LINEJOIN: Record<string, number> = { miter: 0, round: 1, bevel: 2 };\nconst FILL_RULE: Record<string, number> = { evenodd: 0, nonzero: 1 };\n\nconst URL_REFERENCE = /^url\\(#(.+)\\)$/;\n\n/** `table[key]`, but never off `Object.prototype`: a tag or attribute named `constructor` is unknown. */\nexport function own<T>(table: Readonly<Record<string, T>>, key: string): T | undefined {\n return Object.hasOwn(table, key) ? table[key] : undefined;\n}\n\n/**\n * Which element each SVG tag commits as. `polyline` and `polygon` are paths: react-native-svg has\n * no component for either and converts their points to a `d`, so this does too.\n */\nexport const SVG_ELEMENTS: Record<string, string> = {\n g: 'svg-g',\n path: 'svg-path',\n circle: 'svg-circle',\n ellipse: 'svg-ellipse',\n rect: 'svg-rect',\n line: 'svg-line',\n polyline: 'svg-path',\n polygon: 'svg-path',\n defs: 'svg-defs',\n mask: 'svg-mask',\n clipPath: 'svg-clip-path',\n use: 'svg-use',\n linearGradient: 'svg-linear-gradient',\n radialGradient: 'svg-radial-gradient',\n text: 'svg-text',\n tspan: 'svg-tspan',\n // The characters of a text: react-native-svg draws them as a span of their own.\n '#text': 'svg-tspan',\n};\n\n/** The tags that are no view and are not missed: a label, and what a gradient reads itself. */\nexport const UNDRAWN: ReadonlySet<string> = new Set(['title', 'desc', 'stop']);\n\n/** Geometry, per tag. Everything else on a shape is presentation and shared. */\nconst GEOMETRY: Record<string, readonly string[]> = {\n path: ['d'],\n circle: ['cx', 'cy', 'r'],\n ellipse: ['cx', 'cy', 'rx', 'ry'],\n rect: ['x', 'y', 'width', 'height', 'rx', 'ry'],\n line: ['x1', 'y1', 'x2', 'y2'],\n mask: ['x', 'y', 'width', 'height'],\n use: ['x', 'y', 'width', 'height'],\n};\n\n/** A shape's geometry, as written, and the default for what it left out. */\nfunction geometry(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n props: Record<string, unknown>,\n): void {\n for (const name of own(GEOMETRY, tag) ?? []) {\n if (attrs[name] !== undefined) props[name] = attrs[name];\n }\n for (const name of own(ZERO_BY_DEFAULT, tag) ?? []) props[name] ??= 0;\n if (tag !== 'mask') return;\n for (const [name, value] of Object.entries(MASK_AREA)) props[name] ??= value;\n}\n\n/**\n * The geometry each shape defaults to 0 when absent, as react-native-svg's `Rect`, `Circle`,\n * `Ellipse` and `Line` do before they commit. Android's shape views read a missing length as null\n * and crash drawing it, and design tools often leave out a `y=\"0\"`.\n */\nconst ZERO_BY_DEFAULT: Record<string, readonly string[]> = {\n circle: ['cx', 'cy', 'r'],\n ellipse: ['cx', 'cy', 'rx', 'ry'],\n rect: ['x', 'y', 'width', 'height'],\n line: ['x1', 'y1', 'x2', 'y2'],\n use: ['x', 'y', 'width', 'height'],\n};\n\n/** The area a mask covers when the markup does not say, which is SVG's default. */\nconst MASK_AREA = { x: '-10%', y: '-10%', width: '120%', height: '120%' };\n\nconst MASK_TYPE: Record<string, number> = { luminance: 0, alpha: 1 };\n\n/** A mask's units and type, as the integers react-native-svg's `Mask` sends. */\nfunction maskProps(attrs: Readonly<Record<string, string>>): Record<string, number> {\n return {\n maskUnits: own(GRADIENT_UNITS, attrs['maskUnits'] ?? '') ?? 0,\n maskContentUnits: own(GRADIENT_UNITS, attrs['maskContentUnits'] ?? '') ?? 1,\n maskType: own(MASK_TYPE, attrs['mask-type'] ?? '') ?? 0,\n };\n}\n\n/** The id in `url(#id)` or `#id`, the form a reference to another element is written in. */\nconst referenceOf = (value: string | undefined): string | undefined =>\n value === undefined ? undefined : (URL_REFERENCE.exec(value) ?? /^#(.+)$/.exec(value))?.[1];\n\n/** SVG attribute -> native prop, for the presentation attributes shapes and groups share. */\nconst PRESENTATION: Record<string, string> = {\n fill: 'fill',\n 'fill-opacity': 'fillOpacity',\n 'fill-rule': 'fillRule',\n stroke: 'stroke',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'stroke-dasharray': 'strokeDasharray',\n 'stroke-dashoffset': 'strokeDashoffset',\n 'stroke-miterlimit': 'strokeMiterlimit',\n 'clip-rule': 'clipRule',\n opacity: 'opacity',\n};\n\n/** The presentation attributes that are a paint. */\nexport const PAINT: ReadonlySet<string> = new Set(['fill', 'stroke']);\n\n/** Whether a paint is a `var()`, which only the cascade can settle. */\nexport const isTokenPaint = (value: string | undefined): value is string =>\n value !== undefined && /^\\s*var\\(/i.test(value);\n\nexport interface SvgContext {\n /** The host's colour conversion, which a brush payload is the result of. */\n color(value: string): unknown;\n}\n\nexport function brushOf(value: string, context: SvgContext): Brush {\n if (value === 'none') return null;\n // Deliberately kept as a brush rather than resolved here: native paints it from the view's own\n // `color`, so a bound `[color]` on the icon changes every `currentColor` shape without a\n // re-parse.\n if (value === 'currentColor') return { type: 2 };\n const reference = URL_REFERENCE.exec(value);\n if (reference) return { type: 1, brushRef: reference[1]! };\n return { type: 0, payload: context.color(value) };\n}\n\nconst GRADIENT_UNITS: Record<string, number> = { objectBoundingBox: 0, userSpaceOnUse: 1 };\n\n/** Where a gradient runs when the markup does not say, as react-native-svg's components default. */\nconst GRADIENT_LINE: Record<string, Readonly<Record<string, string>>> = {\n linearGradient: { x1: '0%', y1: '0%', x2: '100%', y2: '0%' },\n radialGradient: { cx: '50%', cy: '50%' },\n};\n\nexport const isGradient = (tag: string): boolean => Object.hasOwn(GRADIENT_LINE, tag);\n\n/**\n * A gradient's native props: its name, where it runs, and its stops.\n *\n * A `<stop>` is not a view. react-native-svg reads the stops in JavaScript and hands the gradient\n * one flat list, `[offset, colour, offset, colour]`, in offset order, each colour a single number\n * with the stop's opacity in its alpha. `currentColor` is the colour passed in: native has no\n * brush for it inside a gradient, so it is settled here.\n */\nexport function gradientProps(\n node: { tag: string; attrs: Readonly<Record<string, string>>; children: readonly SvgNodeLike[] },\n context: SvgContext,\n currentColor?: string,\n): Record<string, unknown> {\n const { attrs } = node;\n const stops = node.children\n .filter((child) => child.tag === 'stop')\n .map((stop) => stopOf(stop.attrs, context, currentColor))\n .filter((stop) => stop !== null)\n .sort((a, b) => a[0] - b[0]);\n return {\n name: attrs['id'],\n ...gradientLine(node.tag, attrs),\n gradient: stops.flat(),\n gradientUnits: own(GRADIENT_UNITS, attrs['gradientUnits'] ?? '') ?? 0,\n gradientTransform: transformMatrix(attrs['gradientTransform'] ?? '') ?? null,\n };\n}\n\n/** Where a gradient runs: what the markup set, over what react-native-svg defaults. */\nfunction gradientLine(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n): Record<string, unknown> {\n const line: Record<string, unknown> = { ...own(GRADIENT_LINE, tag) };\n for (const name of Object.keys(line)) line[name] = attrs[name] ?? line[name];\n if (tag !== 'radialGradient') return line;\n const radius = attrs['r'] ?? '50%';\n return {\n ...line,\n rx: attrs['rx'] ?? radius,\n ry: attrs['ry'] ?? radius,\n fx: attrs['fx'] ?? line['cx'],\n fy: attrs['fy'] ?? line['cy'],\n };\n}\n\ninterface SvgNodeLike {\n readonly tag: string;\n readonly attrs: Readonly<Record<string, string>>;\n}\n\n/** The stop colour of a stop, from its attribute or its `style`. */\nexport const stopColor = (attrs: Readonly<Record<string, string>>): string =>\n /(?:^|;)\\s*stop-color\\s*:\\s*([^;]+)/.exec(attrs['style'] ?? '')?.[1]?.trim() ??\n attrs['stop-color'] ??\n '#000';\n\n/**\n * One stop as `[offset, colour]`, its attributes read from its `style` where they are there, or\n * null for a colour the host cannot convert, such as a `var()`: native takes a list of numbers,\n * and one that is not there would be worse than a stop left out.\n */\nfunction stopOf(\n attrs: Readonly<Record<string, string>>,\n context: SvgContext,\n currentColor: string | undefined,\n): [number, unknown] | null {\n const all = { ...attrs, ...styleAttributes(attrs['style'] ?? '', {}) };\n const written = stopColor(attrs);\n const colour = context.color(written === 'currentColor' ? (currentColor ?? '#000') : written);\n if (colour === null || colour === undefined) return null;\n return [fraction(all['offset'], 0), withOpacity(colour, fraction(all['stop-opacity'], 1))];\n}\n\n/** A number or a percentage as a fraction, or the fallback for one that is neither. */\nfunction fraction(value: string | undefined, fallback: number): number {\n const number = Number.parseFloat(value ?? '');\n if (Number.isNaN(number)) return fallback;\n return value!.trim().endsWith('%') ? number / 100 : number;\n}\n\n/**\n * A processed colour at a fraction of its own opacity: a device's is one number, AARRGGBB, and\n * the web host's is the CSS colour it was given, which a mix with nothing fades the same way.\n */\nfunction withOpacity(colour: unknown, fraction: number): unknown {\n const opacity = Math.min(1, Math.max(0, fraction));\n if (typeof colour !== 'number') {\n return opacity === 1 ? colour : `color-mix(in srgb, ${colour} ${opacity * 100}%, transparent)`;\n }\n const alpha = Math.round((colour >>> 24) * opacity);\n return (colour & 0x00ffffff) | (alpha << 24);\n}\n\n/** SVG attribute -> key of the `font` object react-native-svg's text views read. */\nconst FONT: Record<string, string> = {\n 'font-size': 'fontSize',\n 'font-weight': 'fontWeight',\n 'font-style': 'fontStyle',\n 'font-family': 'fontFamily',\n 'font-variant': 'fontVariant',\n 'font-stretch': 'fontStretch',\n 'text-anchor': 'textAnchor',\n 'text-decoration': 'textDecoration',\n 'letter-spacing': 'letterSpacing',\n 'word-spacing': 'wordSpacing',\n kerning: 'kerning',\n};\n\nconst lengthList = (value: string | undefined): string[] =>\n value === undefined\n ? []\n : value\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n\n/**\n * What a `text` or a `tspan` takes beside its paint: its font as one object, and each of its\n * positions as a list, since SVG places a glyph at a time. The first family of a `font-family` is\n * the one asked for, as react-native-svg reads it.\n */\nexport function textProps(attrs: Readonly<Record<string, string>>): Record<string, unknown> {\n const font: Record<string, string> = {};\n for (const [name, value] of Object.entries(attrs)) {\n const key = own(FONT, name);\n if (!key) continue;\n font[key] =\n key === 'fontFamily'\n ? value\n .split(',')[0]!\n .trim()\n .replace(/^[\"']|[\"']$/g, '')\n : value;\n }\n return {\n x: lengthList(attrs['x']),\n y: lengthList(attrs['y']),\n dx: lengthList(attrs['dx']),\n dy: lengthList(attrs['dy']),\n rotate: lengthList(attrs['rotate']),\n font,\n };\n}\n\n/** `M x,y L x,y ...`, which is what a polyline or polygon is once native sees it. */\nexport function pointsToPath(points: string, close: boolean): string {\n const numbers = points\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n let path = '';\n for (let index = 0; index + 1 < numbers.length; index += 2) {\n path += `${index === 0 ? 'M' : 'L'}${numbers[index]},${numbers[index + 1]}`;\n }\n return close && path ? `${path}Z` : path;\n}\n\n/** `stroke-width:2;opacity:.5` as attributes, with `var(--name, fallback)` resolved. */\nexport function styleAttributes(\n style: string,\n variables: Readonly<Record<string, string | number | undefined>>,\n): Record<string, string> {\n const attrs: Record<string, string> = {};\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n const name = declaration.slice(0, colon).trim();\n const value = declaration.slice(colon + 1).trim();\n // A paint's `var()` is kept as written: the cascade settles it, with the tokens in scope.\n const resolved = resolveVar(value, variables) ?? (PAINT.has(name) ? value : undefined);\n if (name && resolved !== undefined) attrs[name] = resolved;\n }\n return attrs;\n}\n\nfunction resolveVar(\n value: string,\n variables: Readonly<Record<string, string | number | undefined>>,\n): string | undefined {\n const match = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*([^)]*))?\\)$/.exec(value);\n if (!match) return value;\n const supplied = variables[match[1]!];\n if (supplied !== undefined) return String(supplied);\n return match[2]?.trim() || undefined;\n}\n\n/** The four numbers of a `viewBox`, as the props the svg view takes them as. */\nexport function viewBoxProps(viewBox: string | undefined): Record<string, unknown> {\n if (!viewBox) return {};\n const parts = viewBox.trim().replace(/,/g, ' ').split(/\\s+/).map(Number);\n if (parts.length !== 4 || parts.some(Number.isNaN)) return {};\n const [minX, minY, vbWidth, vbHeight] = parts;\n return { minX, minY, vbWidth, vbHeight, align: 'xMidYMid', meetOrSlice: 0 };\n}\n\nconst TRANSFORM = /([a-zA-Z]+)\\s*\\(([^)]*)\\)/g;\n\n/**\n * A `transform` attribute as a 2x3 matrix, which is the only form native takes.\n *\n * Rare in icon sets - one occurrence across bootstrap-icons and lucide, and that one is already a\n * `matrix()` - but a shape drawn in the wrong place is worse than one not drawn, so the other\n * three forms compose rather than being ignored.\n */\nexport function transformMatrix(transform: string): number[] | undefined {\n let matrix: number[] | undefined;\n TRANSFORM.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = TRANSFORM.exec(transform)) !== null) {\n const values = match[2]!\n .trim()\n .split(/[\\s,]+/)\n .map(Number);\n const next = matrixFor(match[1]!, values);\n if (next) matrix = matrix ? multiply(matrix, next) : next;\n }\n return matrix;\n}\n\n/** `translate(4)` and `scale(2)` mean something for the missing argument; `rotate(90)` means 0. */\nconst at = (values: number[], index: number, fallback: number) => values[index] ?? fallback;\n\nfunction matrixFor(name: string, values: number[]): number[] | undefined {\n const first = at(values, 0, 0);\n if (name === 'matrix') return values.length === 6 ? values : undefined;\n if (name === 'translate') return [1, 0, 0, 1, first, at(values, 1, 0)];\n if (name === 'scale') return [first, 0, 0, at(values, 1, first), 0, 0];\n if (name === 'rotate') return rotation(first, at(values, 1, 0), at(values, 2, 0));\n return undefined;\n}\n\nfunction rotation(degrees: number, cx: number, cy: number): number[] {\n const radians = (degrees * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n // Rotating about a point is the rotation with the point moved to the origin and back.\n return [cos, sin, -sin, cos, cx - cos * cx + sin * cy, cy - sin * cx - cos * cy];\n}\n\n/** `[a, b, c, d, tx, ty]`, in SVG's own order. */\nfunction multiply(left: number[], right: number[]): number[] {\n const [a1, b1, c1, d1, e1, f1] = left as [number, number, number, number, number, number];\n const [a2, b2, c2, d2, e2, f2] = right as [number, number, number, number, number, number];\n return [\n a1 * a2 + c1 * b2,\n b1 * a2 + d1 * b2,\n a1 * c2 + c1 * d2,\n b1 * c2 + d1 * d2,\n a1 * e2 + c1 * f2 + e1,\n b1 * e2 + d1 * f2 + f1,\n ];\n}\n\n/**\n * The paint a shape inherits from the group around it where it sets none of its own, and so the\n * only names `propList` may hold: react-native-svg's own list (`extractFill`, `extractStroke`).\n * Android reads each name in the list off the shape by reflection, and one that is no field of\n * its paint, `opacity` or `clipRule`, throws and stops the app.\n */\nconst INHERITED: ReadonlySet<string> = new Set([\n ...['fill', 'fillOpacity', 'fillRule', 'stroke', 'strokeWidth', 'strokeOpacity'],\n ...['strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin'],\n 'strokeMiterlimit',\n]);\n\n/**\n * One element's native props.\n *\n * `propList` is the load-bearing part: it names the props this element set itself, and native\n * inherits everything else from the group above. Omit it and a path with no `fill` of its own\n * paints black instead of the colour its parent carries.\n */\nexport function nativeProps(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n context: SvgContext,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n const propList: string[] = [];\n\n for (const [name, value] of Object.entries(attrs)) {\n const prop = own(PRESENTATION, name);\n if (!prop) continue;\n props[prop] = presentationValue(prop, value, context);\n if (INHERITED.has(prop)) propList.push(prop);\n }\n if (propList.length > 0) props['propList'] = propList;\n\n geometry(tag, attrs, props);\n references(tag, attrs, props);\n if (tag === 'polyline' || tag === 'polygon') {\n props['d'] = pointsToPath(attrs['points'] ?? '', tag === 'polygon');\n }\n if (attrs['transform']) {\n const matrix = transformMatrix(attrs['transform']);\n if (matrix) props['matrix'] = matrix;\n }\n return props;\n}\n\n/**\n * How elements point at each other: an element's `id` is the `name` native knows it by, and a\n * `mask`, a `clip-path` and a `<use>` name the element they use, as react-native-svg sends them.\n */\nfunction references(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n props: Record<string, unknown>,\n): void {\n if (attrs['id']) props['name'] = attrs['id'];\n const mask = referenceOf(attrs['mask']);\n if (mask) props['mask'] = mask;\n const clipPath = referenceOf(attrs['clip-path']);\n if (clipPath) props['clipPath'] = clipPath;\n if (tag === 'mask') Object.assign(props, maskProps(attrs));\n if (tag === 'use') props['href'] = referenceOf(attrs['href'] ?? attrs['xlink:href']);\n}\n\n/**\n * The props react-native-svg's Android view manager declares as `float` rather than `Dynamic`,\n * with the default it applies when the prop is absent.\n *\n * `Dynamic` reads whatever arrives, so an SVG attribute can stay the string it was written as -\n * which is what `strokeWidth` and every geometry attribute do. These five cannot: the Android\n * manager takes a `float` parameter, and a string reaching one throws `java.lang.String cannot be\n * cast to java.lang.Double` out of `setProperty` while the view is being created, which takes the\n * whole screen down. iOS never noticed, because folly's `dynamic` coerces a numeric string on the\n * way into a `Float` prop. react-native-svg's own JavaScript sends numbers here too, through\n * `extractOpacity`, so this is the same translation and not an Android workaround.\n */\nconst NUMERIC: Record<string, number> = {\n opacity: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n strokeDashoffset: 0,\n strokeMiterlimit: 4,\n};\n\nfunction presentationValue(prop: string, value: string, context: SvgContext): unknown {\n if (prop === 'fill' || prop === 'stroke') return brushOf(value, context);\n if (prop === 'strokeLinecap') return own(LINECAP, value) ?? 0;\n if (prop === 'strokeLinejoin') return own(LINEJOIN, value) ?? 0;\n if (prop === 'fillRule' || prop === 'clipRule') return own(FILL_RULE, value) ?? 1;\n if (prop === 'strokeDasharray') return dashes(value);\n return prop in NUMERIC ? numberFor(prop, value) : value;\n}\n\n/** A dash pattern as a list of lengths, or null for `none`, which is a solid line. */\nfunction dashes(value: string): string[] | null {\n if (value.trim() === 'none') return null;\n return value\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n}\n\nconst OPACITY: ReadonlySet<string> = new Set(['opacity', 'fillOpacity', 'strokeOpacity']);\n\n/** The attribute as the float Android's view manager takes, or the default it applies. */\nfunction numberFor(prop: string, value: string): number {\n const number = Number.parseFloat(value);\n if (Number.isNaN(number)) return NUMERIC[prop]!;\n // `50%` is half, for an opacity, as react-native-svg's `extractOpacity` reads it.\n return OPACITY.has(prop) && value.trim().endsWith('%') ? number / 100 : number;\n}\n"]}
1
+ {"version":3,"file":"svg-props.js","sourceRoot":"","sources":["../src/svg-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,OAAO,GAA2B,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzE,MAAM,QAAQ,GAA2B,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC1E,MAAM,SAAS,GAA2B,EAAE,OAAO,EAAE,CAAC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AS,SAAS,CAAC,IAAY,EAAE,KAAa;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC,IAAI,CAAE,CAAC;IAChD,kFAAkF;IAClF,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AACjF,CAAC","sourcesContent":["/**\n * SVG attributes to the props react-native-svg's native views actually take.\n *\n * They are not the same thing, and the difference is the whole reason this file exists. `fill`\n * and `stroke` are not colours but *brushes*, a tagged struct that says whether the paint is a\n * colour, the view's own `color`, or a reference to a gradient. `stroke-linecap`, `stroke-linejoin`\n * and `fill-rule` are integers, not the keywords they are written as. And a shape has to declare\n * which props it set - `propList` - because anything absent is inherited from the group above it,\n * which is exactly how an icon whose root carries `stroke=\"currentColor\"` paints its paths.\n *\n * Send the attributes through unchanged and every one of those reads as nothing at all, with no\n * error: the shape draws in the default black, or does not draw.\n *\n * All of this is what react-native-svg does in JavaScript before its props reach native. Its\n * components are React, so this is the same translation rather than a call into it.\n */\n\n/** The paint on a shape: a colour, the view's own colour, or a reference to a gradient. */\nexport type Brush =\n | null\n | { readonly type: 0; readonly payload: unknown }\n | { readonly type: 1; readonly brushRef: string }\n | { readonly type: 2 };\n\nconst LINECAP: Record<string, number> = { butt: 0, round: 1, square: 2 };\nconst LINEJOIN: Record<string, number> = { miter: 0, round: 1, bevel: 2 };\nconst FILL_RULE: Record<string, number> = { evenodd: 0, nonzero: 1 };\n\nconst URL_REFERENCE = /^url\\(#(.+)\\)$/;\n\n/** `table[key]`, but never off `Object.prototype`: a tag or attribute named `constructor` is unknown. */\nexport function own<T>(table: Readonly<Record<string, T>>, key: string): T | undefined {\n return Object.hasOwn(table, key) ? table[key] : undefined;\n}\n\n/**\n * Which element each SVG tag commits as. `polyline` and `polygon` are paths: react-native-svg has\n * no component for either and converts their points to a `d`, so this does too.\n */\nexport const SVG_ELEMENTS: Record<string, string> = {\n g: 'svg-g',\n path: 'svg-path',\n circle: 'svg-circle',\n ellipse: 'svg-ellipse',\n rect: 'svg-rect',\n line: 'svg-line',\n polyline: 'svg-path',\n polygon: 'svg-path',\n defs: 'svg-defs',\n mask: 'svg-mask',\n clipPath: 'svg-clip-path',\n use: 'svg-use',\n linearGradient: 'svg-linear-gradient',\n radialGradient: 'svg-radial-gradient',\n text: 'svg-text',\n tspan: 'svg-tspan',\n // The characters of a text: react-native-svg draws them as a span of their own.\n '#text': 'svg-tspan',\n};\n\n/** The tags that are no view and are not missed: a label, and what a gradient reads itself. */\nexport const UNDRAWN: ReadonlySet<string> = new Set(['title', 'desc', 'stop']);\n\n/** Geometry, per tag. Everything else on a shape is presentation and shared. */\nconst GEOMETRY: Record<string, readonly string[]> = {\n path: ['d'],\n circle: ['cx', 'cy', 'r'],\n ellipse: ['cx', 'cy', 'rx', 'ry'],\n rect: ['x', 'y', 'width', 'height', 'rx', 'ry'],\n line: ['x1', 'y1', 'x2', 'y2'],\n mask: ['x', 'y', 'width', 'height'],\n use: ['x', 'y', 'width', 'height'],\n};\n\n/** A shape's geometry, as written, and the default for what it left out. */\nfunction geometry(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n props: Record<string, unknown>,\n): void {\n for (const name of own(GEOMETRY, tag) ?? []) {\n if (attrs[name] !== undefined) props[name] = attrs[name];\n }\n for (const name of own(ZERO_BY_DEFAULT, tag) ?? []) props[name] ??= 0;\n if (tag !== 'mask') return;\n for (const [name, value] of Object.entries(MASK_AREA)) props[name] ??= value;\n}\n\n/**\n * The geometry each shape defaults to 0 when absent, as react-native-svg's `Rect`, `Circle`,\n * `Ellipse` and `Line` do before they commit. Android's shape views read a missing length as null\n * and crash drawing it, and design tools often leave out a `y=\"0\"`.\n */\nconst ZERO_BY_DEFAULT: Record<string, readonly string[]> = {\n circle: ['cx', 'cy', 'r'],\n ellipse: ['cx', 'cy', 'rx', 'ry'],\n rect: ['x', 'y', 'width', 'height'],\n line: ['x1', 'y1', 'x2', 'y2'],\n use: ['x', 'y', 'width', 'height'],\n};\n\n/** The area a mask covers when the markup does not say, which is SVG's default. */\nconst MASK_AREA = { x: '-10%', y: '-10%', width: '120%', height: '120%' };\n\nconst MASK_TYPE: Record<string, number> = { luminance: 0, alpha: 1 };\n\n/** A mask's units and type, as the integers react-native-svg's `Mask` sends. */\nfunction maskProps(attrs: Readonly<Record<string, string>>): Record<string, number> {\n return {\n maskUnits: own(GRADIENT_UNITS, attrs['maskUnits'] ?? '') ?? 0,\n maskContentUnits: own(GRADIENT_UNITS, attrs['maskContentUnits'] ?? '') ?? 1,\n maskType: own(MASK_TYPE, attrs['mask-type'] ?? '') ?? 0,\n };\n}\n\n/** The id in `url(#id)` or `#id`, the form a reference to another element is written in. */\nconst referenceOf = (value: string | undefined): string | undefined =>\n value === undefined ? undefined : (URL_REFERENCE.exec(value) ?? /^#(.+)$/.exec(value))?.[1];\n\n/** SVG attribute -> native prop, for the presentation attributes shapes and groups share. */\nconst PRESENTATION: Record<string, string> = {\n fill: 'fill',\n 'fill-opacity': 'fillOpacity',\n 'fill-rule': 'fillRule',\n stroke: 'stroke',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'stroke-dasharray': 'strokeDasharray',\n 'stroke-dashoffset': 'strokeDashoffset',\n 'stroke-miterlimit': 'strokeMiterlimit',\n 'clip-rule': 'clipRule',\n opacity: 'opacity',\n};\n\n/** The presentation attributes that are a paint. */\nexport const PAINT: ReadonlySet<string> = new Set(['fill', 'stroke']);\n\n/** Whether a paint is a `var()`, which only the cascade can settle. */\nexport const isTokenPaint = (value: string | undefined): value is string =>\n value !== undefined && /^\\s*var\\(/i.test(value);\n\nexport interface SvgContext {\n /** The host's colour conversion, which a brush payload is the result of. */\n color(value: string): unknown;\n}\n\nexport function brushOf(value: string, context: SvgContext): Brush {\n if (value === 'none') return null;\n // Deliberately kept as a brush rather than resolved here: native paints it from the view's own\n // `color`, so a bound `[color]` on the icon changes every `currentColor` shape without a\n // re-parse.\n if (value === 'currentColor') return { type: 2 };\n const reference = URL_REFERENCE.exec(value);\n if (reference) return { type: 1, brushRef: reference[1]! };\n return { type: 0, payload: context.color(value) };\n}\n\nconst GRADIENT_UNITS: Record<string, number> = { objectBoundingBox: 0, userSpaceOnUse: 1 };\n\n/** Where a gradient runs when the markup does not say, as react-native-svg's components default. */\nconst GRADIENT_LINE: Record<string, Readonly<Record<string, string>>> = {\n linearGradient: { x1: '0%', y1: '0%', x2: '100%', y2: '0%' },\n radialGradient: { cx: '50%', cy: '50%' },\n};\n\nexport const isGradient = (tag: string): boolean => Object.hasOwn(GRADIENT_LINE, tag);\n\n/**\n * A gradient's native props: its name, where it runs, and its stops.\n *\n * A `<stop>` is not a view. react-native-svg reads the stops in JavaScript and hands the gradient\n * one flat list, `[offset, colour, offset, colour]`, in offset order, each colour a single number\n * with the stop's opacity in its alpha. `currentColor` is the colour passed in: native has no\n * brush for it inside a gradient, so it is settled here.\n */\nexport function gradientProps(\n node: { tag: string; attrs: Readonly<Record<string, string>>; children: readonly SvgNodeLike[] },\n context: SvgContext,\n currentColor?: string,\n): Record<string, unknown> {\n const { attrs } = node;\n const stops = node.children\n .filter((child) => child.tag === 'stop')\n .map((stop) => stopOf(stop.attrs, context, currentColor))\n .filter((stop) => stop !== null)\n .sort((a, b) => a[0] - b[0]);\n return {\n name: attrs['id'],\n ...gradientLine(node.tag, attrs),\n gradient: stops.flat(),\n gradientUnits: own(GRADIENT_UNITS, attrs['gradientUnits'] ?? '') ?? 0,\n gradientTransform: transformMatrix(attrs['gradientTransform'] ?? '') ?? null,\n };\n}\n\n/** Where a gradient runs: what the markup set, over what react-native-svg defaults. */\nfunction gradientLine(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n): Record<string, unknown> {\n const line: Record<string, unknown> = { ...own(GRADIENT_LINE, tag) };\n for (const name of Object.keys(line)) line[name] = attrs[name] ?? line[name];\n if (tag !== 'radialGradient') return line;\n const radius = attrs['r'] ?? '50%';\n return {\n ...line,\n rx: attrs['rx'] ?? radius,\n ry: attrs['ry'] ?? radius,\n fx: attrs['fx'] ?? line['cx'],\n fy: attrs['fy'] ?? line['cy'],\n };\n}\n\ninterface SvgNodeLike {\n readonly tag: string;\n readonly attrs: Readonly<Record<string, string>>;\n}\n\n/** The stop colour of a stop, from its attribute or its `style`. */\nexport const stopColor = (attrs: Readonly<Record<string, string>>): string =>\n /(?:^|;)\\s*stop-color\\s*:\\s*([^;]+)/.exec(attrs['style'] ?? '')?.[1]?.trim() ??\n attrs['stop-color'] ??\n '#000';\n\n/**\n * One stop as `[offset, colour]`, its attributes read from its `style` where they are there, or\n * null for a colour the host cannot convert, such as a `var()`: native takes a list of numbers,\n * and one that is not there would be worse than a stop left out.\n */\nfunction stopOf(\n attrs: Readonly<Record<string, string>>,\n context: SvgContext,\n currentColor: string | undefined,\n): [number, unknown] | null {\n const all = { ...attrs, ...styleAttributes(attrs['style'] ?? '', {}) };\n const written = stopColor(attrs);\n const colour = context.color(written === 'currentColor' ? (currentColor ?? '#000') : written);\n if (colour === null || colour === undefined) return null;\n return [fraction(all['offset'], 0), withOpacity(colour, fraction(all['stop-opacity'], 1))];\n}\n\n/** A number or a percentage as a fraction, or the fallback for one that is neither. */\nfunction fraction(value: string | undefined, fallback: number): number {\n const number = Number.parseFloat(value ?? '');\n if (Number.isNaN(number)) return fallback;\n return value!.trim().endsWith('%') ? number / 100 : number;\n}\n\n/**\n * A processed colour at a fraction of its own opacity: a device's is one number, AARRGGBB, and\n * the web host's is the CSS colour it was given, which a mix with nothing fades the same way.\n */\nfunction withOpacity(colour: unknown, fraction: number): unknown {\n const opacity = Math.min(1, Math.max(0, fraction));\n if (typeof colour !== 'number') {\n return opacity === 1 ? colour : `color-mix(in srgb, ${colour} ${opacity * 100}%, transparent)`;\n }\n const alpha = Math.round((colour >>> 24) * opacity);\n return (colour & 0x00ffffff) | (alpha << 24);\n}\n\n/** SVG attribute -> key of the `font` object react-native-svg's text views read. */\nconst FONT: Record<string, string> = {\n 'font-size': 'fontSize',\n 'font-weight': 'fontWeight',\n 'font-style': 'fontStyle',\n 'font-family': 'fontFamily',\n 'font-variant': 'fontVariant',\n 'font-stretch': 'fontStretch',\n 'text-anchor': 'textAnchor',\n 'text-decoration': 'textDecoration',\n 'letter-spacing': 'letterSpacing',\n 'word-spacing': 'wordSpacing',\n kerning: 'kerning',\n};\n\nconst lengthList = (value: string | undefined): string[] =>\n value === undefined\n ? []\n : value\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n\n/**\n * What a `text` or a `tspan` takes beside its paint: its font as one object, and each of its\n * positions as a list, since SVG places a glyph at a time. The first family of a `font-family` is\n * the one asked for, as react-native-svg reads it.\n */\nexport function textProps(attrs: Readonly<Record<string, string>>): Record<string, unknown> {\n const font: Record<string, string> = {};\n for (const [name, value] of Object.entries(attrs)) {\n const key = own(FONT, name);\n if (!key) continue;\n font[key] =\n key === 'fontFamily'\n ? value\n .split(',')[0]!\n .trim()\n .replace(/^[\"']|[\"']$/g, '')\n : value;\n }\n return {\n x: lengthList(attrs['x']),\n y: lengthList(attrs['y']),\n dx: lengthList(attrs['dx']),\n dy: lengthList(attrs['dy']),\n rotate: lengthList(attrs['rotate']),\n font,\n };\n}\n\n/** `M x,y L x,y ...`, which is what a polyline or polygon is once native sees it. */\nexport function pointsToPath(points: string, close: boolean): string {\n const numbers = points\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n let path = '';\n for (let index = 0; index + 1 < numbers.length; index += 2) {\n path += `${index === 0 ? 'M' : 'L'}${numbers[index]},${numbers[index + 1]}`;\n }\n return close && path ? `${path}Z` : path;\n}\n\n/** `stroke-width:2;opacity:.5` as attributes, with `var(--name, fallback)` resolved. */\nexport function styleAttributes(\n style: string,\n variables: Readonly<Record<string, string | number | undefined>>,\n): Record<string, string> {\n const attrs: Record<string, string> = {};\n for (const declaration of style.split(';')) {\n const colon = declaration.indexOf(':');\n if (colon === -1) continue;\n const name = declaration.slice(0, colon).trim();\n const value = declaration.slice(colon + 1).trim();\n // A paint's `var()` is kept as written: the cascade settles it, with the tokens in scope.\n const resolved = resolveVar(value, variables) ?? (PAINT.has(name) ? value : undefined);\n if (name && resolved !== undefined) attrs[name] = resolved;\n }\n return attrs;\n}\n\nfunction resolveVar(\n value: string,\n variables: Readonly<Record<string, string | number | undefined>>,\n): string | undefined {\n const match = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*([^)]*))?\\)$/.exec(value);\n if (!match) return value;\n const supplied = variables[match[1]!];\n if (supplied !== undefined) return String(supplied);\n return match[2]?.trim() || undefined;\n}\n\n/** The four numbers of a `viewBox`, as the props the svg view takes them as. */\nexport function viewBoxProps(viewBox: string | undefined): Record<string, unknown> {\n if (!viewBox) return {};\n const parts = viewBox.trim().replace(/,/g, ' ').split(/\\s+/).map(Number);\n if (parts.length !== 4 || parts.some(Number.isNaN)) return {};\n const [minX, minY, vbWidth, vbHeight] = parts;\n return { minX, minY, vbWidth, vbHeight, align: 'xMidYMid', meetOrSlice: 0 };\n}\n\n/**\n * One function of a `transform`: its name, from the start of a word, and what is in its brackets,\n * which stop at the next `(`. A run of letters, or of `a(`, that never closes is then tried once,\n * not again from each place in it.\n */\nconst TRANSFORM = /\\b([a-zA-Z]+)\\s*\\(([^()]*)\\)/g;\n\n/**\n * A `transform` attribute as a 2x3 matrix, which is the only form native takes.\n *\n * Rare in icon sets - one occurrence across bootstrap-icons and lucide, and that one is already a\n * `matrix()` - but a shape drawn in the wrong place is worse than one not drawn, so the other\n * three forms compose rather than being ignored.\n */\nexport function transformMatrix(transform: string): number[] | undefined {\n let matrix: number[] | undefined;\n TRANSFORM.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = TRANSFORM.exec(transform)) !== null) {\n const values = match[2]!\n .trim()\n .split(/[\\s,]+/)\n .map(Number);\n const next = matrixFor(match[1]!, values);\n if (next) matrix = matrix ? multiply(matrix, next) : next;\n }\n return matrix;\n}\n\n/** `translate(4)` and `scale(2)` mean something for the missing argument; `rotate(90)` means 0. */\nconst at = (values: number[], index: number, fallback: number) => values[index] ?? fallback;\n\nfunction matrixFor(name: string, values: number[]): number[] | undefined {\n const first = at(values, 0, 0);\n if (name === 'matrix') return values.length === 6 ? values : undefined;\n if (name === 'translate') return [1, 0, 0, 1, first, at(values, 1, 0)];\n if (name === 'scale') return [first, 0, 0, at(values, 1, first), 0, 0];\n if (name === 'rotate') return rotation(first, at(values, 1, 0), at(values, 2, 0));\n return undefined;\n}\n\nfunction rotation(degrees: number, cx: number, cy: number): number[] {\n const radians = (degrees * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n // Rotating about a point is the rotation with the point moved to the origin and back.\n return [cos, sin, -sin, cos, cx - cos * cx + sin * cy, cy - sin * cx - cos * cy];\n}\n\n/** `[a, b, c, d, tx, ty]`, in SVG's own order. */\nfunction multiply(left: number[], right: number[]): number[] {\n const [a1, b1, c1, d1, e1, f1] = left as [number, number, number, number, number, number];\n const [a2, b2, c2, d2, e2, f2] = right as [number, number, number, number, number, number];\n return [\n a1 * a2 + c1 * b2,\n b1 * a2 + d1 * b2,\n a1 * c2 + c1 * d2,\n b1 * c2 + d1 * d2,\n a1 * e2 + c1 * f2 + e1,\n b1 * e2 + d1 * f2 + f1,\n ];\n}\n\n/**\n * The paint a shape inherits from the group around it where it sets none of its own, and so the\n * only names `propList` may hold: react-native-svg's own list (`extractFill`, `extractStroke`).\n * Android reads each name in the list off the shape by reflection, and one that is no field of\n * its paint, `opacity` or `clipRule`, throws and stops the app.\n */\nconst INHERITED: ReadonlySet<string> = new Set([\n ...['fill', 'fillOpacity', 'fillRule', 'stroke', 'strokeWidth', 'strokeOpacity'],\n ...['strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin'],\n 'strokeMiterlimit',\n]);\n\n/**\n * One element's native props.\n *\n * `propList` is the load-bearing part: it names the props this element set itself, and native\n * inherits everything else from the group above. Omit it and a path with no `fill` of its own\n * paints black instead of the colour its parent carries.\n */\nexport function nativeProps(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n context: SvgContext,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n const propList: string[] = [];\n\n for (const [name, value] of Object.entries(attrs)) {\n const prop = own(PRESENTATION, name);\n if (!prop) continue;\n props[prop] = presentationValue(prop, value, context);\n if (INHERITED.has(prop)) propList.push(prop);\n }\n if (propList.length > 0) props['propList'] = propList;\n\n geometry(tag, attrs, props);\n references(tag, attrs, props);\n if (tag === 'polyline' || tag === 'polygon') {\n props['d'] = pointsToPath(attrs['points'] ?? '', tag === 'polygon');\n }\n if (attrs['transform']) {\n const matrix = transformMatrix(attrs['transform']);\n if (matrix) props['matrix'] = matrix;\n }\n return props;\n}\n\n/**\n * How elements point at each other: an element's `id` is the `name` native knows it by, and a\n * `mask`, a `clip-path` and a `<use>` name the element they use, as react-native-svg sends them.\n */\nfunction references(\n tag: string,\n attrs: Readonly<Record<string, string>>,\n props: Record<string, unknown>,\n): void {\n if (attrs['id']) props['name'] = attrs['id'];\n const mask = referenceOf(attrs['mask']);\n if (mask) props['mask'] = mask;\n const clipPath = referenceOf(attrs['clip-path']);\n if (clipPath) props['clipPath'] = clipPath;\n if (tag === 'mask') Object.assign(props, maskProps(attrs));\n if (tag === 'use') props['href'] = referenceOf(attrs['href'] ?? attrs['xlink:href']);\n}\n\n/**\n * The props react-native-svg's Android view manager declares as `float` rather than `Dynamic`,\n * with the default it applies when the prop is absent.\n *\n * `Dynamic` reads whatever arrives, so an SVG attribute can stay the string it was written as -\n * which is what `strokeWidth` and every geometry attribute do. These five cannot: the Android\n * manager takes a `float` parameter, and a string reaching one throws `java.lang.String cannot be\n * cast to java.lang.Double` out of `setProperty` while the view is being created, which takes the\n * whole screen down. iOS never noticed, because folly's `dynamic` coerces a numeric string on the\n * way into a `Float` prop. react-native-svg's own JavaScript sends numbers here too, through\n * `extractOpacity`, so this is the same translation and not an Android workaround.\n */\nconst NUMERIC: Record<string, number> = {\n opacity: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n strokeDashoffset: 0,\n strokeMiterlimit: 4,\n};\n\nfunction presentationValue(prop: string, value: string, context: SvgContext): unknown {\n if (prop === 'fill' || prop === 'stroke') return brushOf(value, context);\n if (prop === 'strokeLinecap') return own(LINECAP, value) ?? 0;\n if (prop === 'strokeLinejoin') return own(LINEJOIN, value) ?? 0;\n if (prop === 'fillRule' || prop === 'clipRule') return own(FILL_RULE, value) ?? 1;\n if (prop === 'strokeDasharray') return dashes(value);\n return prop in NUMERIC ? numberFor(prop, value) : value;\n}\n\n/** A dash pattern as a list of lengths, or null for `none`, which is a solid line. */\nfunction dashes(value: string): string[] | null {\n if (value.trim() === 'none') return null;\n return value\n .trim()\n .split(/[\\s,]+/)\n .filter(Boolean);\n}\n\nconst OPACITY: ReadonlySet<string> = new Set(['opacity', 'fillOpacity', 'strokeOpacity']);\n\n/** The attribute as the float Android's view manager takes, or the default it applies. */\nfunction numberFor(prop: string, value: string): number {\n const number = Number.parseFloat(value);\n if (Number.isNaN(number)) return NUMERIC[prop]!;\n // `50%` is half, for an opacity, as react-native-svg's `extractOpacity` reads it.\n return OPACITY.has(prop) && value.trim().endsWith('%') ? number / 100 : number;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/icons",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "@ng-icons rendered as native react-native-svg shapes in Angular Native.",
5
5
  "keywords": [
6
6
  "angular",
@@ -17,7 +17,7 @@
17
17
  "type": "module",
18
18
  "main": "dist/index.js",
19
19
  "dependencies": {
20
- "@ng-native/fabric": "0.17.1"
20
+ "@ng-native/fabric": "0.18.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@angular/core": "^22.0.0",