@ng-native/icons 0.13.0 → 0.14.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/index.d.ts CHANGED
@@ -7,4 +7,5 @@
7
7
  */
8
8
  export { NgIcon } from './ng-icon.ts';
9
9
  export { type SvgNode } from './parse-svg.ts';
10
+ export { SvgImages, type SvgImagesNative } from './svg-images.ts';
10
11
  export { brushOf, nativeProps, viewBoxProps, type Brush, type SvgContext } from './svg-props.ts';
package/dist/index.js CHANGED
@@ -7,5 +7,6 @@
7
7
  */
8
8
  export { NgIcon } from "./ng-icon.js";
9
9
  export {} from "./parse-svg.js";
10
+ export { SvgImages } from "./svg-images.js";
10
11
  export { brushOf, nativeProps, viewBoxProps } from "./svg-props.js";
11
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAA+B,MAAM,gBAAgB,CAAC","sourcesContent":["/**\n * Icons, from the `@ng-icons` packages a web app already uses.\n *\n * The icon sets are plain strings of SVG markup and `provideIcons` is ordinary DI, so both come\n * across untouched; what this replaces is the rendering, which on the web is `innerHTML` and here\n * is react-native-svg's native shapes.\n */\nexport { NgIcon } from './ng-icon.ts';\nexport { type SvgNode } from './parse-svg.ts';\nexport { brushOf, nativeProps, viewBoxProps, type Brush, type SvgContext } from './svg-props.ts';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAA+B,MAAM,gBAAgB,CAAC","sourcesContent":["/**\n * Icons, from the `@ng-icons` packages a web app already uses.\n *\n * The icon sets are plain strings of SVG markup and `provideIcons` is ordinary DI, so both come\n * across untouched; what this replaces is the rendering, which on the web is `innerHTML` and here\n * is react-native-svg's native shapes.\n */\nexport { NgIcon } from './ng-icon.ts';\nexport { type SvgNode } from './parse-svg.ts';\nexport { SvgImages, type SvgImagesNative } from './svg-images.ts';\nexport { brushOf, nativeProps, viewBoxProps, type Brush, type SvgContext } from './svg-props.ts';\n"]}
package/dist/ng-icon.d.ts CHANGED
@@ -48,10 +48,11 @@ export declare class NgIcon {
48
48
  readonly svg: import("@angular/core").InputSignal<string | undefined>;
49
49
  /**
50
50
  * Points, square. Icons are drawn from a `viewBox`, so this is the size on screen. A static
51
- * `size="32"` is read as the number it spells. With none, the icon is `1em`: as big as the
52
- * text around it, and sized by a `font-size` on it or above it, or by a width and height.
51
+ * `size="32"` is read as the number it spells, and `size="2em"` against the font size in scope,
52
+ * as on the web. With none, the icon is `1em`: as big as the text around it, and sized by a
53
+ * `font-size` on it or above it, or by a width and height.
53
54
  */
54
- readonly size: import("@angular/core").InputSignalWithTransform<number | undefined, string | number | undefined>;
55
+ readonly size: import("@angular/core").InputSignalWithTransform<string | number | undefined, string | number | undefined>;
55
56
  /**
56
57
  * What a `currentColor` stroke or fill paints as. It is the host's `color` style, so a `var()`
57
58
  * resolves against the tokens in scope, and native paints it, so binding is cheap.
@@ -72,8 +73,8 @@ export declare class NgIcon {
72
73
  width?: undefined;
73
74
  height?: undefined;
74
75
  } | {
75
- width: number;
76
- height: number;
76
+ width: string | number;
77
+ height: string | number;
77
78
  }>;
78
79
  /** What the view scales its drawing to: the size, or the whole of the box it is laid out as. */
79
80
  protected readonly box: Signal<number | "100%">;
package/dist/ng-icon.js CHANGED
@@ -42,12 +42,15 @@ function toPropertyName(name) {
42
42
  }
43
43
  /**
44
44
  * A size in points: a number, a number as a string, or one with the unit a web app writes it
45
- * with, `18px` or `1.5rem`. Anything else is no size, and the icon is as big as the text around it.
45
+ * with, `18px` or `1.5rem`. One in `em` is kept as written, for the engine to measure against the
46
+ * font size in scope. Anything else is no size, and the icon is as big as the text around it.
46
47
  */
47
48
  function pointsOf(value) {
48
49
  if (value === undefined || value === '')
49
50
  return undefined;
50
51
  const text = typeof value === 'string' ? value.trim() : '';
52
+ if (/^\d*\.?\d+em$/i.test(text))
53
+ return text;
51
54
  const rem = /^([\d.]+)rem$/.exec(text);
52
55
  const px = /^([\d.]+)px$/.exec(text);
53
56
  // `..rem` fits the pattern and is no number: NaN either way, and so no size.
@@ -95,8 +98,9 @@ export class NgIcon {
95
98
  ...(ngDevMode ? [undefined, { debugName: "svg" }] : /* istanbul ignore next */ []));
96
99
  /**
97
100
  * Points, square. Icons are drawn from a `viewBox`, so this is the size on screen. A static
98
- * `size="32"` is read as the number it spells. With none, the icon is `1em`: as big as the
99
- * text around it, and sized by a `font-size` on it or above it, or by a width and height.
101
+ * `size="32"` is read as the number it spells, and `size="2em"` against the font size in scope,
102
+ * as on the web. With none, the icon is `1em`: as big as the text around it, and sized by a
103
+ * `font-size` on it or above it, or by a width and height.
100
104
  */
101
105
  size = input(pointsOf(this.config.size), { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), transform: (value) => pointsOf(value) });
102
106
  /**
@@ -126,7 +130,10 @@ export class NgIcon {
126
130
  }, /* @ts-ignore */
127
131
  ...(ngDevMode ? [{ debugName: "style" }] : /* istanbul ignore next */ []));
128
132
  /** What the view scales its drawing to: the size, or the whole of the box it is laid out as. */
129
- box = computed(() => this.size() ?? '100%', /* @ts-ignore */
133
+ box = computed(() => {
134
+ const size = this.size();
135
+ return typeof size === 'number' ? size : '100%';
136
+ }, /* @ts-ignore */
130
137
  ...(ngDevMode ? [{ debugName: "box" }] : /* istanbul ignore next */ []));
131
138
  markup = computed(() => {
132
139
  const svg = this.svg();
@@ -1 +1 @@
1
- {"version":3,"file":"ng-icon.js","sourceRoot":"","sources":["../src/ng-icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,MAAM,EACN,SAAS,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAgC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,EACL,YAAY,EACZ,OAAO,EACP,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,GAAG,EACH,SAAS,EACT,eAAe,EACf,SAAS,EACT,YAAY,GACb,MAAM,gBAAgB,CAAC;;AAExB,+EAA+E;AAC/E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;AAEnC,+FAA+F;AAC/F,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI;SACR,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,SAA6B,EAAE,EAAE,CACxE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CACzC;SACA,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,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AAK,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;uGA7OU,MAAM;2FAAN,MAAM,mwCA7BP,EAAE;;2FA6BD,MAAM;kBA/BlB,SAAS;+BACE,SAAS,YACT,EAAE,QAaN;wBACJ,SAAS,EAAE,SAAS;wBACpB,eAAe,EAAE,SAAS;wBAC1B,WAAW,EAAE,OAAO;wBACpB,YAAY,EAAE,OAAO;wBACrB,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,gBAAgB;wBAC1B,WAAW,EAAE,mBAAmB;wBAChC,YAAY,EAAE,oBAAoB;wBAClC,SAAS,EAAE,iBAAiB;wBAC5B,eAAe,EAAE,uBAAuB;wBACxC,cAAc,EAAE,uBAAuB;wBACvC,qBAAqB,EAAE,6CAA6C;wBACpE,sBAAsB,EAAE,SAAS;qBAClC","sourcesContent":["/**\n * An icon, from the same `@ng-icons` packages a web app uses.\n *\n * An app imports `NgIcon`, provides the icons it uses with ng-icons' own `provideIcons`, and\n * writes `<ng-icon name=\"heroBookOpen\" [size]=\"28\" color=\"#ff9f0a\" />`. The imports are the same\n * ones a web app writes:\n *\n * ```ts\n * import { NgIcon } from '@ng-native/icons';\n * import { provideIcons } from '@ng-icons/core';\n * import { heroBookOpen } from '@ng-icons/heroicons/outline';\n * ```\n *\n * The icon *packages* are the reusable part: each set ships its icons as plain strings of SVG\n * markup, and `provideIcons` is ordinary dependency injection. What cannot be reused is\n * `@ng-icons/core`'s own `NgIcon`, which inserts that markup with `innerHTML` and sizes it with\n * CSS custom properties. This is the same component against react-native-svg's native views: the\n * markup is parsed, translated, and committed as real shapes.\n *\n * The two things ng-icons expresses in CSS become inputs here. `color` is set on the host, which\n * is what native paints a `currentColor` brush from - so a bound colour changes every stroke in\n * the icon without re-parsing it. `strokeWidth` fills in `var(--ng-icon__stroke-width, 1.5)`,\n * which is how the heroicons outline set carries its weight. `provideNgIconsConfig` sets the\n * defaults of both and of `size`, and `provideNgIconLoader` is asked for a name no `provideIcons`\n * has, as on the web.\n */\nimport {\n Component,\n ElementRef,\n ErrorHandler,\n HostAttributeToken,\n Injector,\n Renderer2,\n computed,\n effect,\n inject,\n input,\n numberAttribute,\n runInInjectionContext,\n signal,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { claimHost, type Engine, type EngineNode, HostEngine } from '@ng-native/fabric';\nimport {\n NgIconCacheToken,\n NgIconConfigToken,\n NgIconLoaderToken,\n NgIconsToken,\n type NgIconLoader,\n} from '@ng-icons/core';\nimport { parseSvg, type SvgNode } from './parse-svg.ts';\nimport { registerSvgComponents } from './svg-elements.ts';\nimport {\n PAINT,\n SVG_ELEMENTS,\n UNDRAWN,\n gradientProps,\n isGradient,\n isTokenPaint,\n nativeProps,\n own,\n stopColor,\n styleAttributes,\n textProps,\n viewBoxProps,\n} from './svg-props.ts';\n\n/** The tags already reported as not drawn, so a list of icons says it once. */\nconst reported = new Set<string>();\n\n/** ng-icons stores icons under a camel-cased key, so `hero-book-open` finds `heroBookOpen`. */\nfunction toPropertyName(name: string): string {\n return name\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, character: string | undefined) =>\n character ? character.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, (match) => match.toLowerCase());\n}\n\n/**\n * A size in points: a number, a number as a string, or one with the unit a web app writes it\n * with, `18px` or `1.5rem`. Anything else is no size, and the icon is as big as the text around it.\n */\nfunction pointsOf(value: number | string | undefined): number | undefined {\n if (value === undefined || value === '') return undefined;\n const text = typeof value === 'string' ? value.trim() : '';\n const rem = /^([\\d.]+)rem$/.exec(text);\n const px = /^([\\d.]+)px$/.exec(text);\n // `..rem` fits the pattern and is no number: NaN either way, and so no size.\n const points = rem ? Number(rem[1]) * 16 : numberAttribute(px ? px[1] : value, Number.NaN);\n return Number.isNaN(points) ? undefined : points;\n}\n\n/** A loader's answer as a promise: it may be a string, a promise or an observable. */\nfunction settled(result: unknown): Promise<string | undefined> {\n if (typeof result === 'string') return Promise.resolve(result);\n const observable = result as { subscribe?: unknown } | null;\n if (typeof observable?.subscribe !== 'function')\n return Promise.resolve(result as Promise<string>);\n // The last value once it completes, which is what ng-icons' `toPromise()` waits for.\n return new Promise((resolve, reject) => {\n let last: string | undefined;\n (result as { subscribe(observer: object): void }).subscribe({\n next: (value: string) => (last = value),\n error: reject,\n complete: () => resolve(last),\n });\n });\n}\n\n@Component({\n selector: 'ng-icon',\n template: '',\n /*\n * With no size it is as big as the text around it, which is what an icon is on the web:\n * `@ng-icons/core` sizes one `1em`, and a library sizes its icons with a font size. An\n * `<ng-icon-stack size>` sets `--ng-icon__size` for the icons in it. A `size` is an inline\n * style, which beats both.\n */\n styles: `\n :host {\n width: var(--ng-icon__size, 1em);\n height: var(--ng-icon__size, 1em);\n }\n `,\n host: {\n '[style]': 'style()',\n '[style.color]': 'color()',\n '[bbWidth]': 'box()',\n '[bbHeight]': 'box()',\n '[minX]': 'viewBox().minX',\n '[minY]': 'viewBox().minY',\n '[vbWidth]': 'viewBox().vbWidth',\n '[vbHeight]': 'viewBox().vbHeight',\n '[align]': 'viewBox().align',\n '[meetOrSlice]': 'viewBox().meetOrSlice',\n '[accessible]': 'label() !== undefined',\n '[accessibilityRole]': \"label() === undefined ? undefined : 'image'\",\n '[accessibilityLabel]': 'label()',\n },\n})\nexport class NgIcon {\n private readonly host = inject(ElementRef).nativeElement as EngineNode;\n private readonly renderer = inject(Renderer2);\n private readonly engine = inject(HostEngine);\n /** Every `provideIcons` in scope, innermost last, which is how ng-icons layers them. */\n private readonly icons = inject(NgIconsToken, { optional: true }) ?? [];\n /** `provideNgIconsConfig`: the size, colour and stroke width an icon has without its own. */\n private readonly config = inject(NgIconConfigToken, { optional: true }) ?? {};\n /** `provideNgIconLoader`: where an icon no `provideIcons` has comes from. */\n private readonly loader = inject(NgIconLoaderToken, { optional: true });\n /** `withCaching()`: what the loader already answered, so it is asked once per name. */\n private readonly cache = inject(NgIconCacheToken, { optional: true });\n private readonly injector = inject(Injector);\n private readonly errors = inject(ErrorHandler);\n /** A static `aria-label`, which labels the icon as `accessibilityLabel` does. */\n private readonly ariaLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n\n /** The key the icon was provided under: `heroBookOpen`, or `hero-book-open`. */\n readonly name = input<string>();\n /** Markup, for an icon that comes from somewhere other than a provider. */\n readonly svg = input<string>();\n /**\n * Points, square. Icons are drawn from a `viewBox`, so this is the size on screen. A static\n * `size=\"32\"` is read as the number it spells. With none, the icon is `1em`: as big as the\n * text around it, and sized by a `font-size` on it or above it, or by a width and height.\n */\n readonly size = input(pointsOf(this.config.size), {\n transform: (value: number | string | undefined) => pointsOf(value),\n });\n /**\n * What a `currentColor` stroke or fill paints as. It is the host's `color` style, so a `var()`\n * resolves against the tokens in scope, and native paints it, so binding is cheap.\n */\n readonly color = input<string | undefined>(this.config.color);\n /** Fills in `var(--ng-icon__stroke-width, …)`, which is how an outline set carries its weight. */\n readonly strokeWidth = input<number | string | undefined>(this.config.strokeWidth);\n /** Absent leaves the icon out of the accessibility tree, which is right for a decorative one. */\n readonly accessibilityLabel = input<string>();\n\n /** The label a screen reader reads: the input, or a static `aria-label`. */\n protected readonly label = computed(\n () => this.accessibilityLabel() ?? this.ariaLabel ?? undefined,\n );\n /** How many times the icon has asked the loader, so only the newest answer is drawn. */\n private asks = 0;\n /** The markup the loader answered with, and the name it was asked for. */\n private readonly loaded = signal<{ name: string; svg: string | undefined } | undefined>(\n undefined,\n );\n\n /** The size as an inline style, or nothing for the stylesheet's size to stand. */\n protected readonly style = computed(() => {\n const size = this.size();\n return size === undefined ? {} : { width: size, height: size };\n });\n /** What the view scales its drawing to: the size, or the whole of the box it is laid out as. */\n protected readonly box = computed(() => this.size() ?? '100%');\n\n private readonly markup: Signal<string | undefined> = computed(() => {\n const svg = this.svg();\n if (svg !== undefined) return svg;\n const name = this.name();\n if (name === undefined) return undefined;\n\n const provided = this.provided(name);\n if (provided) return provided;\n const loaded = this.loaded();\n if (loaded?.name === name && loaded.svg) return loaded.svg;\n // Still loading: the warning waits for the loader's answer.\n if (this.loader && loaded?.name !== name) return undefined;\n this.reportMissing(name);\n return undefined;\n });\n\n private readonly root = computed(() => {\n const markup = this.markup();\n return markup === undefined ? null : parseSvg(markup);\n });\n\n protected readonly viewBox = computed(() => viewBoxProps(this.root()?.attrs['viewBox']));\n\n constructor() {\n // Before the first shape is created, which is before this component's own commit.\n registerSvgComponents();\n // Claimed, and stripped of the attributes Angular wrote from static inputs: `name` is one of\n // ours *and* one of react-native-svg's, so leaving it there hands native an element name.\n claimHost(this.host);\n for (const input of Object.keys(\n (NgIcon as { ɵcmp?: { inputs?: object } }).ɵcmp?.inputs ?? {},\n )) {\n delete this.host.props[input];\n }\n // The shapes are created rather than templated: an icon's tree is data, and a template that\n // could express it would be a component per tag with a recursive switch between them.\n effect(() => this.draw());\n effect(() => this.load());\n }\n\n /** The icon `provideIcons` has under this name, the nearest one first. */\n private provided(name: string): string | undefined {\n const key = toPropertyName(name);\n // Reversed, because a nearer `provideIcons` should win over one further up the tree.\n for (const set of [...this.icons].reverse()) {\n const markup = own(set, key);\n if (markup) return markup;\n }\n return undefined;\n }\n\n /** Asks the loader for an icon no `provideIcons` has, as `@ng-icons/core` does. */\n private load(): void {\n const name = this.name();\n const ask = ++this.asks;\n if (!this.loader || this.svg() !== undefined || name === undefined) return;\n if (this.provided(name)) return;\n this.request(this.loader, name).then(\n (svg) => {\n // The icon asked again while the loader was answering, so this answer is out of date.\n if (ask === this.asks) this.loaded.set({ name, svg });\n },\n (error: unknown) => this.errors.handleError(error),\n );\n }\n\n /** The loader's answer for a name, through the `withCaching()` cache when there is one. */\n private async request(loader: NgIconLoader, name: string): Promise<string | undefined> {\n const cached = this.cache?.get(name);\n if (cached !== undefined) return cached;\n // Untracked, so a signal the loader reads does not ask it again when that signal changes.\n const answer = settled(\n untracked(() => runInInjectionContext(this.injector, () => loader(name))),\n );\n this.cache?.set(name, answer as Promise<string>);\n try {\n const svg = await answer;\n if (svg !== undefined) this.cache?.set(name, svg);\n return svg;\n } catch (error) {\n // Not kept, so the next icon with this name asks again.\n this.cache?.delete(name);\n throw error;\n }\n }\n\n private reportMissing(name: string): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n console.warn(\n `[angular-native] no icon named ${name}. Pass it to provideIcons() from the set it ` +\n `belongs to, the same way you would on the web, or load it with provideNgIconLoader().`,\n );\n }\n\n private draw(): void {\n const root = this.root();\n for (const child of [...this.host.children]) this.renderer.removeChild(this.host, child);\n if (!root) return;\n\n // Everything hangs off one group carrying the root's presentation attributes, which is how\n // react-native-svg's own `Svg` does it: the svg view itself holds no paint, so a root that\n // says `stroke=\"currentColor\"` needs a group for its children to inherit from.\n const group = this.create('svg-g', root);\n for (const child of root.children) this.append(group, child);\n this.renderer.appendChild(this.host, group);\n }\n\n private append(parent: unknown, node: SvgNode): void {\n const element = own(SVG_ELEMENTS, node.tag);\n if (!element) return this.reportUndrawn(node.tag);\n const shape = this.create(element, node);\n for (const child of node.children) this.append(shape, child);\n this.renderer.appendChild(parent, shape);\n }\n\n /**\n * A `currentColor` stop is settled here from the `color` input, where a `currentColor` brush is\n * painted by native from the colour the cascade gives the icon. With no input it is black.\n */\n private reportUntintedStop(gradient: SvgNode): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n if (this.color() !== undefined || reported.has('currentColor')) return;\n if (!gradient.children.some((stop) => stopColor(stop.attrs) === 'currentColor')) return;\n reported.add('currentColor');\n console.warn(\n '[angular-native] <ng-icon> paints a gradient stop written as currentColor from its ' +\n '`color` input, and this icon has none, so the stop is black. Set `color` on the icon.',\n );\n }\n\n /** An incomplete drawing with no message is the hardest failure to track down. */\n private reportUndrawn(tag: string): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n if (UNDRAWN.has(tag) || reported.has(tag)) return;\n reported.add(tag);\n const drawn = ['svg', ...Object.keys(SVG_ELEMENTS), 'stop'].filter((name) => name !== '#text');\n console.warn(\n `[angular-native] <ng-icon> does not draw <${tag}>, so it is left out of the icon. ` +\n `It draws ${drawn.slice(0, -1).join(', ')} and ${drawn.at(-1)}.`,\n );\n }\n\n /** The native props of one element: a gradient's, a text's, or a shape's. */\n private propsOf(node: SvgNode, attrs: Record<string, string>): Record<string, unknown> {\n const context = { color: (value: string) => this.engine.color(value) };\n if (isGradient(node.tag)) {\n this.reportUntintedStop(node);\n return gradientProps(node, context, this.color());\n }\n const props = nativeProps(node.tag, attrs, context);\n if (node.tag === '#text') return { ...props, content: node.text };\n return node.tag === 'text' || node.tag === 'tspan' ? { ...props, ...textProps(attrs) } : props;\n }\n\n private create(element: string, node: SvgNode): unknown {\n const shape = this.renderer.createElement(element) as EngineNode;\n // Created here rather than by a template, so nothing else will account for it: without this\n // the engine reports every shape as an element whose component was forgotten.\n claimHost(shape);\n const attrs = {\n ...node.attrs,\n // A `style` attribute is where ng-icons puts the stroke width, as a custom property.\n ...styleAttributes(node.attrs['style'] ?? '', {\n '--ng-icon__stroke-width': this.strokeWidth(),\n }),\n };\n const props = this.propsOf(node, attrs);\n // A paint that reads a custom property is settled by the cascade, with the tokens in scope\n // for the shape, and follows them. It stays in `propList`, which says the shape has one.\n const cascade = this.engine as Partial<Pick<Engine, 'setBoundStyle'>>;\n for (const paint of PAINT) {\n if (!isTokenPaint(attrs[paint]) || !cascade.setBoundStyle?.(shape, paint, attrs[paint]))\n continue;\n delete props[paint];\n }\n for (const [prop, value] of Object.entries(props)) {\n this.renderer.setProperty(shape, prop, value);\n }\n return shape;\n }\n}\n"]}
1
+ {"version":3,"file":"ng-icon.js","sourceRoot":"","sources":["../src/ng-icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,MAAM,EACN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S,YACT,EAAE,QAaN;wBACJ,SAAS,EAAE,SAAS;wBACpB,eAAe,EAAE,SAAS;wBAC1B,WAAW,EAAE,OAAO;wBACpB,YAAY,EAAE,OAAO;wBACrB,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,gBAAgB;wBAC1B,WAAW,EAAE,mBAAmB;wBAChC,YAAY,EAAE,oBAAoB;wBAClC,SAAS,EAAE,iBAAiB;wBAC5B,eAAe,EAAE,uBAAuB;wBACxC,cAAc,EAAE,uBAAuB;wBACvC,qBAAqB,EAAE,6CAA6C;wBACpE,sBAAsB,EAAE,SAAS;qBAClC","sourcesContent":["/**\n * An icon, from the same `@ng-icons` packages a web app uses.\n *\n * An app imports `NgIcon`, provides the icons it uses with ng-icons' own `provideIcons`, and\n * writes `<ng-icon name=\"heroBookOpen\" [size]=\"28\" color=\"#ff9f0a\" />`. The imports are the same\n * ones a web app writes:\n *\n * ```ts\n * import { NgIcon } from '@ng-native/icons';\n * import { provideIcons } from '@ng-icons/core';\n * import { heroBookOpen } from '@ng-icons/heroicons/outline';\n * ```\n *\n * The icon *packages* are the reusable part: each set ships its icons as plain strings of SVG\n * markup, and `provideIcons` is ordinary dependency injection. What cannot be reused is\n * `@ng-icons/core`'s own `NgIcon`, which inserts that markup with `innerHTML` and sizes it with\n * CSS custom properties. This is the same component against react-native-svg's native views: the\n * markup is parsed, translated, and committed as real shapes.\n *\n * The two things ng-icons expresses in CSS become inputs here. `color` is set on the host, which\n * is what native paints a `currentColor` brush from - so a bound colour changes every stroke in\n * the icon without re-parsing it. `strokeWidth` fills in `var(--ng-icon__stroke-width, 1.5)`,\n * which is how the heroicons outline set carries its weight. `provideNgIconsConfig` sets the\n * defaults of both and of `size`, and `provideNgIconLoader` is asked for a name no `provideIcons`\n * has, as on the web.\n */\nimport {\n Component,\n ElementRef,\n ErrorHandler,\n HostAttributeToken,\n Injector,\n Renderer2,\n computed,\n effect,\n inject,\n input,\n numberAttribute,\n runInInjectionContext,\n signal,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { claimHost, type Engine, type EngineNode, HostEngine } from '@ng-native/fabric';\nimport {\n NgIconCacheToken,\n NgIconConfigToken,\n NgIconLoaderToken,\n NgIconsToken,\n type NgIconLoader,\n} from '@ng-icons/core';\nimport { parseSvg, type SvgNode } from './parse-svg.ts';\nimport { registerSvgComponents } from './svg-elements.ts';\nimport {\n PAINT,\n SVG_ELEMENTS,\n UNDRAWN,\n gradientProps,\n isGradient,\n isTokenPaint,\n nativeProps,\n own,\n stopColor,\n styleAttributes,\n textProps,\n viewBoxProps,\n} from './svg-props.ts';\n\n/** The tags already reported as not drawn, so a list of icons says it once. */\nconst reported = new Set<string>();\n\n/** ng-icons stores icons under a camel-cased key, so `hero-book-open` finds `heroBookOpen`. */\nfunction toPropertyName(name: string): string {\n return name\n .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, character: string | undefined) =>\n character ? character.toUpperCase() : '',\n )\n .replace(/[^a-zA-Z\\d]/g, '')\n .replace(/^([A-Z])/, (match) => match.toLowerCase());\n}\n\n/**\n * A size in points: a number, a number as a string, or one with the unit a web app writes it\n * with, `18px` or `1.5rem`. One in `em` is kept as written, for the engine to measure against the\n * font size in scope. Anything else is no size, and the icon is as big as the text around it.\n */\nfunction pointsOf(value: number | string | undefined): number | string | undefined {\n if (value === undefined || value === '') return undefined;\n const text = typeof value === 'string' ? value.trim() : '';\n if (/^\\d*\\.?\\d+em$/i.test(text)) return text;\n const rem = /^([\\d.]+)rem$/.exec(text);\n const px = /^([\\d.]+)px$/.exec(text);\n // `..rem` fits the pattern and is no number: NaN either way, and so no size.\n const points = rem ? Number(rem[1]) * 16 : numberAttribute(px ? px[1] : value, Number.NaN);\n return Number.isNaN(points) ? undefined : points;\n}\n\n/** A loader's answer as a promise: it may be a string, a promise or an observable. */\nfunction settled(result: unknown): Promise<string | undefined> {\n if (typeof result === 'string') return Promise.resolve(result);\n const observable = result as { subscribe?: unknown } | null;\n if (typeof observable?.subscribe !== 'function')\n return Promise.resolve(result as Promise<string>);\n // The last value once it completes, which is what ng-icons' `toPromise()` waits for.\n return new Promise((resolve, reject) => {\n let last: string | undefined;\n (result as { subscribe(observer: object): void }).subscribe({\n next: (value: string) => (last = value),\n error: reject,\n complete: () => resolve(last),\n });\n });\n}\n\n@Component({\n selector: 'ng-icon',\n template: '',\n /*\n * With no size it is as big as the text around it, which is what an icon is on the web:\n * `@ng-icons/core` sizes one `1em`, and a library sizes its icons with a font size. An\n * `<ng-icon-stack size>` sets `--ng-icon__size` for the icons in it. A `size` is an inline\n * style, which beats both.\n */\n styles: `\n :host {\n width: var(--ng-icon__size, 1em);\n height: var(--ng-icon__size, 1em);\n }\n `,\n host: {\n '[style]': 'style()',\n '[style.color]': 'color()',\n '[bbWidth]': 'box()',\n '[bbHeight]': 'box()',\n '[minX]': 'viewBox().minX',\n '[minY]': 'viewBox().minY',\n '[vbWidth]': 'viewBox().vbWidth',\n '[vbHeight]': 'viewBox().vbHeight',\n '[align]': 'viewBox().align',\n '[meetOrSlice]': 'viewBox().meetOrSlice',\n '[accessible]': 'label() !== undefined',\n '[accessibilityRole]': \"label() === undefined ? undefined : 'image'\",\n '[accessibilityLabel]': 'label()',\n },\n})\nexport class NgIcon {\n private readonly host = inject(ElementRef).nativeElement as EngineNode;\n private readonly renderer = inject(Renderer2);\n private readonly engine = inject(HostEngine);\n /** Every `provideIcons` in scope, innermost last, which is how ng-icons layers them. */\n private readonly icons = inject(NgIconsToken, { optional: true }) ?? [];\n /** `provideNgIconsConfig`: the size, colour and stroke width an icon has without its own. */\n private readonly config = inject(NgIconConfigToken, { optional: true }) ?? {};\n /** `provideNgIconLoader`: where an icon no `provideIcons` has comes from. */\n private readonly loader = inject(NgIconLoaderToken, { optional: true });\n /** `withCaching()`: what the loader already answered, so it is asked once per name. */\n private readonly cache = inject(NgIconCacheToken, { optional: true });\n private readonly injector = inject(Injector);\n private readonly errors = inject(ErrorHandler);\n /** A static `aria-label`, which labels the icon as `accessibilityLabel` does. */\n private readonly ariaLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n\n /** The key the icon was provided under: `heroBookOpen`, or `hero-book-open`. */\n readonly name = input<string>();\n /** Markup, for an icon that comes from somewhere other than a provider. */\n readonly svg = input<string>();\n /**\n * Points, square. Icons are drawn from a `viewBox`, so this is the size on screen. A static\n * `size=\"32\"` is read as the number it spells, and `size=\"2em\"` against the font size in scope,\n * as on the web. With none, the icon is `1em`: as big as the text around it, and sized by a\n * `font-size` on it or above it, or by a width and height.\n */\n readonly size = input(pointsOf(this.config.size), {\n transform: (value: number | string | undefined) => pointsOf(value),\n });\n /**\n * What a `currentColor` stroke or fill paints as. It is the host's `color` style, so a `var()`\n * resolves against the tokens in scope, and native paints it, so binding is cheap.\n */\n readonly color = input<string | undefined>(this.config.color);\n /** Fills in `var(--ng-icon__stroke-width, …)`, which is how an outline set carries its weight. */\n readonly strokeWidth = input<number | string | undefined>(this.config.strokeWidth);\n /** Absent leaves the icon out of the accessibility tree, which is right for a decorative one. */\n readonly accessibilityLabel = input<string>();\n\n /** The label a screen reader reads: the input, or a static `aria-label`. */\n protected readonly label = computed(\n () => this.accessibilityLabel() ?? this.ariaLabel ?? undefined,\n );\n /** How many times the icon has asked the loader, so only the newest answer is drawn. */\n private asks = 0;\n /** The markup the loader answered with, and the name it was asked for. */\n private readonly loaded = signal<{ name: string; svg: string | undefined } | undefined>(\n undefined,\n );\n\n /** The size as an inline style, or nothing for the stylesheet's size to stand. */\n protected readonly style = computed(() => {\n const size = this.size();\n return size === undefined ? {} : { width: size, height: size };\n });\n /** What the view scales its drawing to: the size, or the whole of the box it is laid out as. */\n protected readonly box = computed(() => {\n const size = this.size();\n return typeof size === 'number' ? size : '100%';\n });\n\n private readonly markup: Signal<string | undefined> = computed(() => {\n const svg = this.svg();\n if (svg !== undefined) return svg;\n const name = this.name();\n if (name === undefined) return undefined;\n\n const provided = this.provided(name);\n if (provided) return provided;\n const loaded = this.loaded();\n if (loaded?.name === name && loaded.svg) return loaded.svg;\n // Still loading: the warning waits for the loader's answer.\n if (this.loader && loaded?.name !== name) return undefined;\n this.reportMissing(name);\n return undefined;\n });\n\n private readonly root = computed(() => {\n const markup = this.markup();\n return markup === undefined ? null : parseSvg(markup);\n });\n\n protected readonly viewBox = computed(() => viewBoxProps(this.root()?.attrs['viewBox']));\n\n constructor() {\n // Before the first shape is created, which is before this component's own commit.\n registerSvgComponents();\n // Claimed, and stripped of the attributes Angular wrote from static inputs: `name` is one of\n // ours *and* one of react-native-svg's, so leaving it there hands native an element name.\n claimHost(this.host);\n for (const input of Object.keys(\n (NgIcon as { ɵcmp?: { inputs?: object } }).ɵcmp?.inputs ?? {},\n )) {\n delete this.host.props[input];\n }\n // The shapes are created rather than templated: an icon's tree is data, and a template that\n // could express it would be a component per tag with a recursive switch between them.\n effect(() => this.draw());\n effect(() => this.load());\n }\n\n /** The icon `provideIcons` has under this name, the nearest one first. */\n private provided(name: string): string | undefined {\n const key = toPropertyName(name);\n // Reversed, because a nearer `provideIcons` should win over one further up the tree.\n for (const set of [...this.icons].reverse()) {\n const markup = own(set, key);\n if (markup) return markup;\n }\n return undefined;\n }\n\n /** Asks the loader for an icon no `provideIcons` has, as `@ng-icons/core` does. */\n private load(): void {\n const name = this.name();\n const ask = ++this.asks;\n if (!this.loader || this.svg() !== undefined || name === undefined) return;\n if (this.provided(name)) return;\n this.request(this.loader, name).then(\n (svg) => {\n // The icon asked again while the loader was answering, so this answer is out of date.\n if (ask === this.asks) this.loaded.set({ name, svg });\n },\n (error: unknown) => this.errors.handleError(error),\n );\n }\n\n /** The loader's answer for a name, through the `withCaching()` cache when there is one. */\n private async request(loader: NgIconLoader, name: string): Promise<string | undefined> {\n const cached = this.cache?.get(name);\n if (cached !== undefined) return cached;\n // Untracked, so a signal the loader reads does not ask it again when that signal changes.\n const answer = settled(\n untracked(() => runInInjectionContext(this.injector, () => loader(name))),\n );\n this.cache?.set(name, answer as Promise<string>);\n try {\n const svg = await answer;\n if (svg !== undefined) this.cache?.set(name, svg);\n return svg;\n } catch (error) {\n // Not kept, so the next icon with this name asks again.\n this.cache?.delete(name);\n throw error;\n }\n }\n\n private reportMissing(name: string): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n console.warn(\n `[angular-native] no icon named ${name}. Pass it to provideIcons() from the set it ` +\n `belongs to, the same way you would on the web, or load it with provideNgIconLoader().`,\n );\n }\n\n private draw(): void {\n const root = this.root();\n for (const child of [...this.host.children]) this.renderer.removeChild(this.host, child);\n if (!root) return;\n\n // Everything hangs off one group carrying the root's presentation attributes, which is how\n // react-native-svg's own `Svg` does it: the svg view itself holds no paint, so a root that\n // says `stroke=\"currentColor\"` needs a group for its children to inherit from.\n const group = this.create('svg-g', root);\n for (const child of root.children) this.append(group, child);\n this.renderer.appendChild(this.host, group);\n }\n\n private append(parent: unknown, node: SvgNode): void {\n const element = own(SVG_ELEMENTS, node.tag);\n if (!element) return this.reportUndrawn(node.tag);\n const shape = this.create(element, node);\n for (const child of node.children) this.append(shape, child);\n this.renderer.appendChild(parent, shape);\n }\n\n /**\n * A `currentColor` stop is settled here from the `color` input, where a `currentColor` brush is\n * painted by native from the colour the cascade gives the icon. With no input it is black.\n */\n private reportUntintedStop(gradient: SvgNode): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n if (this.color() !== undefined || reported.has('currentColor')) return;\n if (!gradient.children.some((stop) => stopColor(stop.attrs) === 'currentColor')) return;\n reported.add('currentColor');\n console.warn(\n '[angular-native] <ng-icon> paints a gradient stop written as currentColor from its ' +\n '`color` input, and this icon has none, so the stop is black. Set `color` on the icon.',\n );\n }\n\n /** An incomplete drawing with no message is the hardest failure to track down. */\n private reportUndrawn(tag: string): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n if (UNDRAWN.has(tag) || reported.has(tag)) return;\n reported.add(tag);\n const drawn = ['svg', ...Object.keys(SVG_ELEMENTS), 'stop'].filter((name) => name !== '#text');\n console.warn(\n `[angular-native] <ng-icon> does not draw <${tag}>, so it is left out of the icon. ` +\n `It draws ${drawn.slice(0, -1).join(', ')} and ${drawn.at(-1)}.`,\n );\n }\n\n /** The native props of one element: a gradient's, a text's, or a shape's. */\n private propsOf(node: SvgNode, attrs: Record<string, string>): Record<string, unknown> {\n const context = { color: (value: string) => this.engine.color(value) };\n if (isGradient(node.tag)) {\n this.reportUntintedStop(node);\n return gradientProps(node, context, this.color());\n }\n const props = nativeProps(node.tag, attrs, context);\n if (node.tag === '#text') return { ...props, content: node.text };\n return node.tag === 'text' || node.tag === 'tspan' ? { ...props, ...textProps(attrs) } : props;\n }\n\n private create(element: string, node: SvgNode): unknown {\n const shape = this.renderer.createElement(element) as EngineNode;\n // Created here rather than by a template, so nothing else will account for it: without this\n // the engine reports every shape as an element whose component was forgotten.\n claimHost(shape);\n const attrs = {\n ...node.attrs,\n // A `style` attribute is where ng-icons puts the stroke width, as a custom property.\n ...styleAttributes(node.attrs['style'] ?? '', {\n '--ng-icon__stroke-width': this.strokeWidth(),\n }),\n };\n const props = this.propsOf(node, attrs);\n // A paint that reads a custom property is settled by the cascade, with the tokens in scope\n // for the shape, and follows them. It stays in `propList`, which says the shape has one.\n const cascade = this.engine as Partial<Pick<Engine, 'setBoundStyle'>>;\n for (const paint of PAINT) {\n if (!isTokenPaint(attrs[paint]) || !cascade.setBoundStyle?.(shape, paint, attrs[paint]))\n continue;\n delete props[paint];\n }\n for (const [prop, value] of Object.entries(props)) {\n this.renderer.setProperty(shape, prop, value);\n }\n return shape;\n }\n}\n"]}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * SVG markup drawn once into a PNG, for a place that takes an image and not a view: a tab bar
3
+ * item, which neither platform lets hold a view. `withSvgIcons(SvgImages)` from
4
+ * `@ng-native/router` uses it for `<native-tab [icon]="{ svg }">`.
5
+ *
6
+ * react-native-svg draws one of its own views into a PNG, so the markup is drawn as an `ng-icon`
7
+ * for as long as that takes, nearly transparent and out of the way, and then taken away. Android
8
+ * draws nothing that is off screen, so the view goes where the caller says, which is on screen.
9
+ */
10
+ import { InjectionToken, type ViewContainerRef } from '@angular/core';
11
+ import * as i0 from "@angular/core";
12
+ /** What of react-native-svg's native module this needs, and the screen's scale. */
13
+ export interface SvgImagesNative {
14
+ /** `RNSVGSvgViewModule.toDataURL`: the view drawn as a base64 PNG, or nothing. */
15
+ toDataURL(tag: number, options: {
16
+ width: number;
17
+ height: number;
18
+ }, done: (b64?: string) => void): void;
19
+ /** Pixels to a point. */
20
+ readonly scale: number;
21
+ }
22
+ export declare class SvgImages {
23
+ /**
24
+ * react-native-svg's module and the screen's scale, or null where react-native-svg is not in
25
+ * the build. Overridden in a test.
26
+ */
27
+ static readonly NATIVE: InjectionToken<SvgImagesNative | null>;
28
+ /** How long native has to answer: iOS logs and never calls back for a view it cannot find. */
29
+ static answerWithinMs: number;
30
+ private readonly native;
31
+ private readonly engine;
32
+ /**
33
+ * `svg` drawn `size` points square, as an image source: a PNG data URI with its scale. Null
34
+ * when it could not be drawn. The view it is drawn in goes in `at`, which has to be on screen.
35
+ */
36
+ render(svg: string, size: number, at: ViewContainerRef): Promise<unknown>;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<SvgImages, never>;
38
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
39
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * SVG markup drawn once into a PNG, for a place that takes an image and not a view: a tab bar
3
+ * item, which neither platform lets hold a view. `withSvgIcons(SvgImages)` from
4
+ * `@ng-native/router` uses it for `<native-tab [icon]="{ svg }">`.
5
+ *
6
+ * react-native-svg draws one of its own views into a PNG, so the markup is drawn as an `ng-icon`
7
+ * for as long as that takes, nearly transparent and out of the way, and then taken away. Android
8
+ * draws nothing that is off screen, so the view goes where the caller says, which is on screen.
9
+ */
10
+ import { Component, ElementRef, Injectable, InjectionToken, afterNextRender, inject, input, viewChild, } from '@angular/core';
11
+ import { Engine, nativePlatform } from '@ng-native/fabric';
12
+ import { NgIcon } from "./ng-icon.js";
13
+ import * as i0 from "@angular/core";
14
+ /** The markup, drawn where it is seen by nobody: a hundredth opaque, above the rest. */
15
+ class SvgDrawing {
16
+ svg = input.required(/* @ts-ignore */
17
+ ...(ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []));
18
+ size = input.required(/* @ts-ignore */
19
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
20
+ icon = viewChild.required('icon', { ...(ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {}), read: ElementRef });
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: SvgDrawing, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: SvgDrawing, isStandalone: true, selector: "ng-icon-drawing", inputs: { svg: { classPropertyName: "svg", publicName: "svg", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "pointerEvents": "none" }, styleAttribute: "position: absolute; opacity: 0.01" }, viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: '<ng-icon #icon [svg]="svg()" [size]="size()" />', isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "color", "strokeWidth", "accessibilityLabel"] }] });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: SvgDrawing, decorators: [{
25
+ type: Component,
26
+ args: [{
27
+ selector: 'ng-icon-drawing',
28
+ imports: [NgIcon],
29
+ template: '<ng-icon #icon [svg]="svg()" [size]="size()" />',
30
+ host: { style: 'position: absolute; opacity: 0.01', pointerEvents: 'none' },
31
+ }]
32
+ }], propDecorators: { svg: [{ type: i0.Input, args: [{ isSignal: true, alias: "svg", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], icon: [{ type: i0.ViewChild, args: ['icon', { ...{ read: ElementRef }, isSignal: true }] }] } });
33
+ export class SvgImages {
34
+ /**
35
+ * react-native-svg's module and the screen's scale, or null where react-native-svg is not in
36
+ * the build. Overridden in a test.
37
+ */
38
+ static NATIVE = new InjectionToken('angular-native.svgImages', {
39
+ factory: () => {
40
+ const host = globalThis;
41
+ const find = (name) => (host.__turboModuleProxy?.(name) ?? host.nativeModuleProxy?.[name]);
42
+ const svg = find('RNSVGSvgViewModule');
43
+ if (!svg?.toDataURL)
44
+ return null;
45
+ const info = find('DeviceInfo');
46
+ const dimensions = info?.getConstants?.().Dimensions;
47
+ const scale = dimensions?.window?.scale ?? dimensions?.windowPhysicalPixels?.scale ?? 1;
48
+ return { toDataURL: (...args) => svg.toDataURL(...args), scale };
49
+ },
50
+ });
51
+ /** How long native has to answer: iOS logs and never calls back for a view it cannot find. */
52
+ static answerWithinMs = 3000;
53
+ native = inject(SvgImages.NATIVE);
54
+ engine = inject(Engine, { optional: true });
55
+ /**
56
+ * `svg` drawn `size` points square, as an image source: a PNG data URI with its scale. Null
57
+ * when it could not be drawn. The view it is drawn in goes in `at`, which has to be on screen.
58
+ */
59
+ render(svg, size, at) {
60
+ const native = this.native;
61
+ if (!native)
62
+ return Promise.resolve(null);
63
+ const drawing = at.createComponent(SvgDrawing);
64
+ drawing.setInput('svg', svg);
65
+ drawing.setInput('size', size);
66
+ // iOS draws at the screen's scale and is asked in points; Android is asked in pixels.
67
+ const asked = nativePlatform() === 'android' ? Math.round(size * native.scale) : size;
68
+ return new Promise((resolve) => {
69
+ const finish = (base64) => {
70
+ clearTimeout(timer);
71
+ if (!drawing.hostView.destroyed)
72
+ drawing.destroy();
73
+ resolve(base64
74
+ ? {
75
+ uri: `data:image/png;base64,${base64}`,
76
+ scale: native.scale,
77
+ width: size,
78
+ height: size,
79
+ }
80
+ : null);
81
+ };
82
+ const timer = setTimeout(finish, SvgImages.answerWithinMs);
83
+ afterNextRender(() => {
84
+ const tag = this.engine?.tagOf(drawing.instance.icon().nativeElement);
85
+ if (tag == null)
86
+ return finish();
87
+ native.toDataURL(tag, { width: asked, height: asked }, finish);
88
+ }, { injector: drawing.injector });
89
+ });
90
+ }
91
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: SvgImages, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
92
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: SvgImages, providedIn: 'root' });
93
+ }
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: SvgImages, decorators: [{
95
+ type: Injectable,
96
+ args: [{ providedIn: 'root' }]
97
+ }] });
98
+ //# sourceMappingURL=svg-images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-images.js","sourceRoot":"","sources":["../src/svg-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,MAAM,EACN,KAAK,EACL,SAAS,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;;AActC,wFAAwF;AACxF,MAMM,UAAU;IACL,GAAG,GAAG,KAAK,CAAC,QAAQ;4EAAU,CAAC;IAC/B,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU,CAAC;IAChC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,4EAAI,IAAI,EAAE,UAAU,GAAG,CAAC;uGAH7D,UAAU;2FAAV,UAAU,6eAGqC,UAAU,6CANnD,iDAAiD,4DADjD,MAAM;;2FAIZ,UAAU;kBANf,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;o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AC,IAAI,EAAE,CAAC,aAA2B,CAAC,CAAC;gBACpF,IAAI,GAAG,IAAI,IAAI;oBAAE,OAAO,MAAM,EAAE,CAAC;gBACjC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;YACjE,CAAC,EACD,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAC/B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;uGA1EU,SAAS;2GAAT,SAAS,cADI,MAAM;;2FACnB,SAAS;kBADrB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * SVG markup drawn once into a PNG, for a place that takes an image and not a view: a tab bar\n * item, which neither platform lets hold a view. `withSvgIcons(SvgImages)` from\n * `@ng-native/router` uses it for `<native-tab [icon]=\"{ svg }\">`.\n *\n * react-native-svg draws one of its own views into a PNG, so the markup is drawn as an `ng-icon`\n * for as long as that takes, nearly transparent and out of the way, and then taken away. Android\n * draws nothing that is off screen, so the view goes where the caller says, which is on screen.\n */\nimport {\n Component,\n ElementRef,\n Injectable,\n InjectionToken,\n afterNextRender,\n inject,\n input,\n viewChild,\n type ViewContainerRef,\n} from '@angular/core';\nimport { Engine, type EngineNode, nativePlatform } from '@ng-native/fabric';\nimport { NgIcon } from './ng-icon.ts';\n\n/** What of react-native-svg's native module this needs, and the screen's scale. */\nexport interface SvgImagesNative {\n /** `RNSVGSvgViewModule.toDataURL`: the view drawn as a base64 PNG, or nothing. */\n toDataURL(\n tag: number,\n options: { width: number; height: number },\n done: (b64?: string) => void,\n ): void;\n /** Pixels to a point. */\n readonly scale: number;\n}\n\n/** The markup, drawn where it is seen by nobody: a hundredth opaque, above the rest. */\n@Component({\n selector: 'ng-icon-drawing',\n imports: [NgIcon],\n template: '<ng-icon #icon [svg]=\"svg()\" [size]=\"size()\" />',\n host: { style: 'position: absolute; opacity: 0.01', pointerEvents: 'none' },\n})\nclass SvgDrawing {\n readonly svg = input.required<string>();\n readonly size = input.required<number>();\n readonly icon = viewChild.required('icon', { read: ElementRef });\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SvgImages {\n /**\n * react-native-svg's module and the screen's scale, or null where react-native-svg is not in\n * the build. Overridden in a test.\n */\n static readonly NATIVE = new InjectionToken<SvgImagesNative | null>('angular-native.svgImages', {\n factory: () => {\n const host = globalThis as {\n __turboModuleProxy?: (name: string) => unknown;\n nativeModuleProxy?: Record<string, unknown>;\n };\n const find = (name: string) =>\n (host.__turboModuleProxy?.(name) ?? host.nativeModuleProxy?.[name]) as\n Record<string, unknown> | undefined;\n const svg = find('RNSVGSvgViewModule') as Pick<SvgImagesNative, 'toDataURL'> | undefined;\n if (!svg?.toDataURL) return null;\n // iOS gives the window in points with its scale, Android in physical pixels with its.\n type Window = { scale?: number };\n const info = find('DeviceInfo') as\n | {\n getConstants?(): {\n Dimensions?: { window?: Window; windowPhysicalPixels?: Window };\n };\n }\n | undefined;\n const dimensions = info?.getConstants?.().Dimensions;\n const scale = dimensions?.window?.scale ?? dimensions?.windowPhysicalPixels?.scale ?? 1;\n return { toDataURL: (...args) => svg.toDataURL(...args), scale };\n },\n });\n\n /** How long native has to answer: iOS logs and never calls back for a view it cannot find. */\n static answerWithinMs = 3000;\n\n private readonly native = inject(SvgImages.NATIVE);\n private readonly engine = inject(Engine, { optional: true });\n\n /**\n * `svg` drawn `size` points square, as an image source: a PNG data URI with its scale. Null\n * when it could not be drawn. The view it is drawn in goes in `at`, which has to be on screen.\n */\n render(svg: string, size: number, at: ViewContainerRef): Promise<unknown> {\n const native = this.native;\n if (!native) return Promise.resolve(null);\n const drawing = at.createComponent(SvgDrawing);\n drawing.setInput('svg', svg);\n drawing.setInput('size', size);\n // iOS draws at the screen's scale and is asked in points; Android is asked in pixels.\n const asked = nativePlatform() === 'android' ? Math.round(size * native.scale) : size;\n return new Promise<unknown>((resolve) => {\n const finish = (base64?: string) => {\n clearTimeout(timer);\n if (!drawing.hostView.destroyed) drawing.destroy();\n resolve(\n base64\n ? {\n uri: `data:image/png;base64,${base64}`,\n scale: native.scale,\n width: size,\n height: size,\n }\n : null,\n );\n };\n const timer = setTimeout(finish, SvgImages.answerWithinMs);\n afterNextRender(\n () => {\n const tag = this.engine?.tagOf(drawing.instance.icon().nativeElement as EngineNode);\n if (tag == null) return finish();\n native.toDataURL(tag, { width: asked, height: asked }, finish);\n },\n { injector: drawing.injector },\n );\n });\n }\n}\n"]}
package/dist/svg-props.js CHANGED
@@ -363,6 +363,17 @@ function multiply(left, right) {
363
363
  b1 * e2 + d1 * f2 + f1,
364
364
  ];
365
365
  }
366
+ /**
367
+ * The paint a shape inherits from the group around it where it sets none of its own, and so the
368
+ * only names `propList` may hold: react-native-svg's own list (`extractFill`, `extractStroke`).
369
+ * Android reads each name in the list off the shape by reflection, and one that is no field of
370
+ * its paint, `opacity` or `clipRule`, throws and stops the app.
371
+ */
372
+ const INHERITED = new Set([
373
+ ...['fill', 'fillOpacity', 'fillRule', 'stroke', 'strokeWidth', 'strokeOpacity'],
374
+ ...['strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin'],
375
+ 'strokeMiterlimit',
376
+ ]);
366
377
  /**
367
378
  * One element's native props.
368
379
  *
@@ -378,7 +389,8 @@ export function nativeProps(tag, attrs, context) {
378
389
  if (!prop)
379
390
  continue;
380
391
  props[prop] = presentationValue(prop, value, context);
381
- propList.push(prop);
392
+ if (INHERITED.has(prop))
393
+ propList.push(prop);
382
394
  }
383
395
  if (propList.length > 0)
384
396
  props['propList'] = propList;
@@ -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,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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 * 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 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,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAErE,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,yGAAyG;AACzG,MAAM,UAAU,GAAG,CAAI,KAAkC,EAAE,GAAW;IACpE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,CAAC,EAAE,OAAO;IACV,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,UAA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C,IAAI,CAAC,CAAC;IAChE,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClF,IAAI,IAAI,KAAK,iBAAiB;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,OAAO,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1D,CAAC;AAED,sFAAsF;AACtF,SAAS,MAAM,CAAC,KAAa;IAC3B,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,KAAK;SACT,IAAI,EAAE;SACN,KAAK,CAAC,QAAQ,CAAC;SACf,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,MAAM,OAAO,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;AAE1F,0FAA0F;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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/icons",
3
- "version": "0.13.0",
3
+ "version": "0.14.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.13.0"
20
+ "@ng-native/fabric": "0.14.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@angular/core": "^22.0.0",