@ng-native/icons 0.16.0 → 0.17.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/ng-icon.js +1 -1
- package/dist/ng-icon.js.map +1 -1
- package/dist/svg-images.js +9 -2
- package/dist/svg-images.js.map +1 -1
- package/package.json +2 -2
package/dist/ng-icon.js
CHANGED
package/dist/ng-icon.js.map
CHANGED
|
@@ -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,SA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M,KAAK,IAAI,KAAK,EAAE,CAAC;YAC1B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrF,SAAS;YACX,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;uGAjPU,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`. 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"]}
|
|
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,E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K,IAAI,KAAK,EAAE,CAAC;YAC1B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBACrF,SAAS;YACX,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;uGAjPU,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`. 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.childList]) 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"]}
|
package/dist/svg-images.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* draws nothing that is off screen, so the view goes where the caller says, which is on screen.
|
|
9
9
|
*/
|
|
10
10
|
import { Component, ElementRef, Injectable, InjectionToken, afterNextRender, inject, input, viewChild, } from '@angular/core';
|
|
11
|
-
import { Engine, nativePlatform } from '@ng-native/fabric';
|
|
11
|
+
import { Engine, nativePlatform, nextFrame } from '@ng-native/fabric';
|
|
12
12
|
import { NgIcon } from "./ng-icon.js";
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
/** The markup, drawn where it is seen by nobody: a hundredth opaque, above the rest. */
|
|
@@ -84,7 +84,14 @@ export class SvgImages {
|
|
|
84
84
|
const tag = this.engine?.tagOf(drawing.instance.icon().nativeElement);
|
|
85
85
|
if (tag == null)
|
|
86
86
|
return finish();
|
|
87
|
-
|
|
87
|
+
// Fabric mounts the commit on the main thread once this task is over, and iOS asked for
|
|
88
|
+
// a view before then finds none: it logs an error, a red box in development, and never
|
|
89
|
+
// calls back. react-native-svg retries only a view it found, so this asks a frame later.
|
|
90
|
+
void nextFrame().then(() => {
|
|
91
|
+
if (!drawing.hostView.destroyed) {
|
|
92
|
+
native.toDataURL(tag, { width: asked, height: asked }, finish);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
88
95
|
}, { injector: drawing.injector });
|
|
89
96
|
});
|
|
90
97
|
}
|
package/dist/svg-images.js.map
CHANGED
|
@@ -1 +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;
|
|
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,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvF,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;oBAC3B,OAAO,EAAE,CAAC,MAAM,CAAC;oBACjB,QAAQ,EAAE,iDAAiD;oBAC3D,IAAI,EAAE,EAAE,KAAK,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,EAAE;iBAC5E;8OAIoC,MAAM,OAAE,EAAE,IAAI,EAAE,UAAU,EAAE;AAIjE,MAAM,OAAO,SAAS;IACpB;;;OAGG;IACH,MAAM,CAAU,MAAM,GAAG,IAAI,cAAc,CAAyB,0BAA0B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C,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,EACD,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAC/B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;uGAjFU,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, nextFrame } 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 // Fabric mounts the commit on the main thread once this task is over, and iOS asked for\n // a view before then finds none: it logs an error, a red box in development, and never\n // calls back. react-native-svg retries only a view it found, so this asks a frame later.\n void nextFrame().then(() => {\n if (!drawing.hostView.destroyed) {\n native.toDataURL(tag, { width: asked, height: asked }, finish);\n }\n });\n },\n { injector: drawing.injector },\n );\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/icons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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.
|
|
20
|
+
"@ng-native/fabric": "0.17.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@angular/core": "^22.0.0",
|