@symbiote-native/symbols 0.0.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/LICENSE +21 -0
- package/README.md +52 -0
- package/build/angular/index.d.ts +2 -0
- package/build/angular/index.js +3 -0
- package/build/angular/symbol-view.d.ts +22 -0
- package/build/angular/symbol-view.js +147 -0
- package/build/core/android/index.d.ts +11 -0
- package/build/core/android/index.js +10 -0
- package/build/core/android/symbols.json +4057 -0
- package/build/core/android/weights/bold/index.d.ts +3 -0
- package/build/core/android/weights/bold/index.js +6 -0
- package/build/core/android/weights/extraLight/index.d.ts +3 -0
- package/build/core/android/weights/extraLight/index.js +6 -0
- package/build/core/android/weights/light/index.d.ts +3 -0
- package/build/core/android/weights/light/index.js +6 -0
- package/build/core/android/weights/medium/index.d.ts +3 -0
- package/build/core/android/weights/medium/index.js +6 -0
- package/build/core/android/weights/regular/index.d.ts +3 -0
- package/build/core/android/weights/regular/index.js +6 -0
- package/build/core/android/weights/semiBold/index.d.ts +3 -0
- package/build/core/android/weights/semiBold/index.js +6 -0
- package/build/core/android/weights/thin/index.d.ts +3 -0
- package/build/core/android/weights/thin/index.js +6 -0
- package/build/core/index.d.ts +5 -0
- package/build/core/index.js +2 -0
- package/build/core/symbol-types.d.ts +95 -0
- package/build/core/symbol-types.js +1 -0
- package/build/core/symbols.d.ts +29 -0
- package/build/core/symbols.js +153 -0
- package/build/react/index.d.ts +3 -0
- package/build/react/index.js +3 -0
- package/build/react/symbol-view.d.ts +10 -0
- package/build/react/symbol-view.js +14 -0
- package/build/solid/index.d.ts +3 -0
- package/build/solid/index.js +3 -0
- package/build/solid/symbol-view.d.ts +11 -0
- package/build/solid/symbol-view.js +28 -0
- package/build/svelte/index.d.ts +3 -0
- package/build/svelte/index.js +3 -0
- package/build/svelte/symbol-props.d.ts +7 -0
- package/build/svelte/symbol-props.js +1 -0
- package/build/svelte/symbol-view.svelte +26 -0
- package/build/svelte/symbol-view.svelte.d.ts +4 -0
- package/build/vue/index.d.ts +3 -0
- package/build/vue/index.js +3 -0
- package/build/vue/symbol-view.d.ts +6 -0
- package/build/vue/symbol-view.js +26 -0
- package/build-ngc/angular/index.d.ts +2 -0
- package/build-ngc/angular/index.js +4 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/angular/symbol-view.d.ts +25 -0
- package/build-ngc/angular/symbol-view.js +82 -0
- package/build-ngc/angular/symbol-view.js.map +1 -0
- package/build-ngc/core/android/index.d.ts +11 -0
- package/build-ngc/core/android/index.js +11 -0
- package/build-ngc/core/android/index.js.map +1 -0
- package/build-ngc/core/android/symbols.json +4057 -0
- package/build-ngc/core/android/weights/bold/index.d.ts +3 -0
- package/build-ngc/core/android/weights/bold/index.js +7 -0
- package/build-ngc/core/android/weights/bold/index.js.map +1 -0
- package/build-ngc/core/android/weights/extraLight/index.d.ts +3 -0
- package/build-ngc/core/android/weights/extraLight/index.js +7 -0
- package/build-ngc/core/android/weights/extraLight/index.js.map +1 -0
- package/build-ngc/core/android/weights/light/index.d.ts +3 -0
- package/build-ngc/core/android/weights/light/index.js +7 -0
- package/build-ngc/core/android/weights/light/index.js.map +1 -0
- package/build-ngc/core/android/weights/medium/index.d.ts +3 -0
- package/build-ngc/core/android/weights/medium/index.js +7 -0
- package/build-ngc/core/android/weights/medium/index.js.map +1 -0
- package/build-ngc/core/android/weights/regular/index.d.ts +3 -0
- package/build-ngc/core/android/weights/regular/index.js +7 -0
- package/build-ngc/core/android/weights/regular/index.js.map +1 -0
- package/build-ngc/core/android/weights/semiBold/index.d.ts +3 -0
- package/build-ngc/core/android/weights/semiBold/index.js +7 -0
- package/build-ngc/core/android/weights/semiBold/index.js.map +1 -0
- package/build-ngc/core/android/weights/thin/index.d.ts +3 -0
- package/build-ngc/core/android/weights/thin/index.js +7 -0
- package/build-ngc/core/android/weights/thin/index.js.map +1 -0
- package/build-ngc/core/index.d.ts +5 -0
- package/build-ngc/core/index.js +3 -0
- package/build-ngc/core/index.js.map +1 -0
- package/build-ngc/core/symbol-types.d.ts +95 -0
- package/build-ngc/core/symbol-types.js +2 -0
- package/build-ngc/core/symbol-types.js.map +1 -0
- package/build-ngc/core/symbols.d.ts +29 -0
- package/build-ngc/core/symbols.js +154 -0
- package/build-ngc/core/symbols.js.map +1 -0
- package/native-link.json +5 -0
- package/package.json +155 -0
- package/src/angular/index.ts +18 -0
- package/src/angular/symbol-view.ts +71 -0
- package/src/core/android/index.ts +15 -0
- package/src/core/android/symbols.json +4057 -0
- package/src/core/android/weights/bold/index.ts +8 -0
- package/src/core/android/weights/extraLight/index.ts +8 -0
- package/src/core/android/weights/light/index.ts +8 -0
- package/src/core/android/weights/medium/index.ts +8 -0
- package/src/core/android/weights/regular/index.ts +8 -0
- package/src/core/android/weights/semiBold/index.ts +8 -0
- package/src/core/android/weights/thin/index.ts +8 -0
- package/src/core/index.ts +25 -0
- package/src/core/symbol-types.ts +147 -0
- package/src/core/symbols.ts +192 -0
- package/src/react/index.ts +18 -0
- package/src/react/symbol-view.ts +33 -0
- package/src/solid/index.ts +18 -0
- package/src/solid/symbol-view.ts +53 -0
- package/src/svelte/index.ts +18 -0
- package/src/svelte/svelte-ambient.d.ts +6 -0
- package/src/svelte/svelte-compile.test-helper.ts +6 -0
- package/src/svelte/symbol-props.ts +10 -0
- package/src/svelte/symbol-view.svelte +26 -0
- package/src/vue/index.ts +18 -0
- package/src/vue/symbol-view.ts +45 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input, } from '@angular/core';
|
|
2
|
+
import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
|
|
3
|
+
import { renderSymbolView, watchSymbolFont } from '../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** Angular twin of `expo-symbols`' `SymbolView`, projected content is the fallback without a symbol */
|
|
6
|
+
export class SymbolView extends NativeViewBase {
|
|
7
|
+
name;
|
|
8
|
+
type;
|
|
9
|
+
scale;
|
|
10
|
+
weight;
|
|
11
|
+
colors;
|
|
12
|
+
size;
|
|
13
|
+
tintColor;
|
|
14
|
+
resizeMode;
|
|
15
|
+
animationSpec;
|
|
16
|
+
propNames = [
|
|
17
|
+
'name',
|
|
18
|
+
'type',
|
|
19
|
+
'scale',
|
|
20
|
+
'weight',
|
|
21
|
+
'colors',
|
|
22
|
+
'size',
|
|
23
|
+
'tintColor',
|
|
24
|
+
'resizeMode',
|
|
25
|
+
'animationSpec',
|
|
26
|
+
];
|
|
27
|
+
isFontLoaded = false;
|
|
28
|
+
cancelWatch = () => { };
|
|
29
|
+
renderView(props) {
|
|
30
|
+
return renderSymbolView(props, this.isFontLoaded);
|
|
31
|
+
}
|
|
32
|
+
// Шрифт грузится один раз при создании, как в upstream
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
this.cancelWatch = watchSymbolFont(Object.fromEntries(this.propNames.map(propName => [propName, Reflect.get(this, propName)])), isLoaded => {
|
|
35
|
+
this.isFontLoaded = isLoaded;
|
|
36
|
+
this.changeDetector.markForCheck();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
disposeView() {
|
|
40
|
+
this.cancelWatch();
|
|
41
|
+
}
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SymbolView, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SymbolView, isStandalone: true, selector: "SymbolView", inputs: { name: "name", type: "type", scale: "scale", weight: "weight", colors: "colors", size: "size", tintColor: "tintColor", resizeMode: "resizeMode", animationSpec: "animationSpec" }, usesInheritance: true, ngImport: i0, template: `@if (descriptor; as node) {
|
|
44
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
45
|
+
} @else {
|
|
46
|
+
<ng-content />
|
|
47
|
+
}`, isInline: true, dependencies: [{ kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SymbolView, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: 'SymbolView',
|
|
53
|
+
standalone: true,
|
|
54
|
+
imports: [DescriptorOutlet],
|
|
55
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
56
|
+
template: `@if (descriptor; as node) {
|
|
57
|
+
<symbiote-descriptor-outlet [node]="node" />
|
|
58
|
+
} @else {
|
|
59
|
+
<ng-content />
|
|
60
|
+
}`,
|
|
61
|
+
}]
|
|
62
|
+
}], propDecorators: { name: [{
|
|
63
|
+
type: Input,
|
|
64
|
+
args: [{ required: true }]
|
|
65
|
+
}], type: [{
|
|
66
|
+
type: Input
|
|
67
|
+
}], scale: [{
|
|
68
|
+
type: Input
|
|
69
|
+
}], weight: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}], colors: [{
|
|
72
|
+
type: Input
|
|
73
|
+
}], size: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}], tintColor: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], resizeMode: [{
|
|
78
|
+
type: Input
|
|
79
|
+
}], animationSpec: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}] } });
|
|
82
|
+
//# sourceMappingURL=symbol-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-view.js","sourceRoot":"","sources":["../../src/angular/symbol-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,GAGN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;;AAG5D,uG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EAAE;;;;IAIR;iBACH;;sBAEE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regenerate this file using a request captured from https://fonts.google.com/icons and this script:
|
|
3
|
+
* https://gist.github.com/aleqsio/63a2f378286c727780ef6056d66d8e43
|
|
4
|
+
*/
|
|
5
|
+
import symbols from './symbols.json';
|
|
6
|
+
export type IAndroidSymbol = keyof typeof symbols;
|
|
7
|
+
export type IAndroidSymbolWeight = {
|
|
8
|
+
name: string;
|
|
9
|
+
font: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function androidSymbolToString(symbol: IAndroidSymbol | null): string | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regenerate this file using a request captured from https://fonts.google.com/icons and this script:
|
|
3
|
+
* https://gist.github.com/aleqsio/63a2f378286c727780ef6056d66d8e43
|
|
4
|
+
*/
|
|
5
|
+
import symbols from './symbols.json';
|
|
6
|
+
export function androidSymbolToString(symbol) {
|
|
7
|
+
if (!symbol)
|
|
8
|
+
return null;
|
|
9
|
+
return String.fromCharCode(symbols[symbol]);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/android/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAOrC,MAAM,UAAU,qBAAqB,CAAC,MAA6B;IACjE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|