@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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/build/angular/index.d.ts +2 -0
  4. package/build/angular/index.js +3 -0
  5. package/build/angular/symbol-view.d.ts +22 -0
  6. package/build/angular/symbol-view.js +147 -0
  7. package/build/core/android/index.d.ts +11 -0
  8. package/build/core/android/index.js +10 -0
  9. package/build/core/android/symbols.json +4057 -0
  10. package/build/core/android/weights/bold/index.d.ts +3 -0
  11. package/build/core/android/weights/bold/index.js +6 -0
  12. package/build/core/android/weights/extraLight/index.d.ts +3 -0
  13. package/build/core/android/weights/extraLight/index.js +6 -0
  14. package/build/core/android/weights/light/index.d.ts +3 -0
  15. package/build/core/android/weights/light/index.js +6 -0
  16. package/build/core/android/weights/medium/index.d.ts +3 -0
  17. package/build/core/android/weights/medium/index.js +6 -0
  18. package/build/core/android/weights/regular/index.d.ts +3 -0
  19. package/build/core/android/weights/regular/index.js +6 -0
  20. package/build/core/android/weights/semiBold/index.d.ts +3 -0
  21. package/build/core/android/weights/semiBold/index.js +6 -0
  22. package/build/core/android/weights/thin/index.d.ts +3 -0
  23. package/build/core/android/weights/thin/index.js +6 -0
  24. package/build/core/index.d.ts +5 -0
  25. package/build/core/index.js +2 -0
  26. package/build/core/symbol-types.d.ts +95 -0
  27. package/build/core/symbol-types.js +1 -0
  28. package/build/core/symbols.d.ts +29 -0
  29. package/build/core/symbols.js +153 -0
  30. package/build/react/index.d.ts +3 -0
  31. package/build/react/index.js +3 -0
  32. package/build/react/symbol-view.d.ts +10 -0
  33. package/build/react/symbol-view.js +14 -0
  34. package/build/solid/index.d.ts +3 -0
  35. package/build/solid/index.js +3 -0
  36. package/build/solid/symbol-view.d.ts +11 -0
  37. package/build/solid/symbol-view.js +28 -0
  38. package/build/svelte/index.d.ts +3 -0
  39. package/build/svelte/index.js +3 -0
  40. package/build/svelte/symbol-props.d.ts +7 -0
  41. package/build/svelte/symbol-props.js +1 -0
  42. package/build/svelte/symbol-view.svelte +26 -0
  43. package/build/svelte/symbol-view.svelte.d.ts +4 -0
  44. package/build/vue/index.d.ts +3 -0
  45. package/build/vue/index.js +3 -0
  46. package/build/vue/symbol-view.d.ts +6 -0
  47. package/build/vue/symbol-view.js +26 -0
  48. package/build-ngc/angular/index.d.ts +2 -0
  49. package/build-ngc/angular/index.js +4 -0
  50. package/build-ngc/angular/index.js.map +1 -0
  51. package/build-ngc/angular/symbol-view.d.ts +25 -0
  52. package/build-ngc/angular/symbol-view.js +82 -0
  53. package/build-ngc/angular/symbol-view.js.map +1 -0
  54. package/build-ngc/core/android/index.d.ts +11 -0
  55. package/build-ngc/core/android/index.js +11 -0
  56. package/build-ngc/core/android/index.js.map +1 -0
  57. package/build-ngc/core/android/symbols.json +4057 -0
  58. package/build-ngc/core/android/weights/bold/index.d.ts +3 -0
  59. package/build-ngc/core/android/weights/bold/index.js +7 -0
  60. package/build-ngc/core/android/weights/bold/index.js.map +1 -0
  61. package/build-ngc/core/android/weights/extraLight/index.d.ts +3 -0
  62. package/build-ngc/core/android/weights/extraLight/index.js +7 -0
  63. package/build-ngc/core/android/weights/extraLight/index.js.map +1 -0
  64. package/build-ngc/core/android/weights/light/index.d.ts +3 -0
  65. package/build-ngc/core/android/weights/light/index.js +7 -0
  66. package/build-ngc/core/android/weights/light/index.js.map +1 -0
  67. package/build-ngc/core/android/weights/medium/index.d.ts +3 -0
  68. package/build-ngc/core/android/weights/medium/index.js +7 -0
  69. package/build-ngc/core/android/weights/medium/index.js.map +1 -0
  70. package/build-ngc/core/android/weights/regular/index.d.ts +3 -0
  71. package/build-ngc/core/android/weights/regular/index.js +7 -0
  72. package/build-ngc/core/android/weights/regular/index.js.map +1 -0
  73. package/build-ngc/core/android/weights/semiBold/index.d.ts +3 -0
  74. package/build-ngc/core/android/weights/semiBold/index.js +7 -0
  75. package/build-ngc/core/android/weights/semiBold/index.js.map +1 -0
  76. package/build-ngc/core/android/weights/thin/index.d.ts +3 -0
  77. package/build-ngc/core/android/weights/thin/index.js +7 -0
  78. package/build-ngc/core/android/weights/thin/index.js.map +1 -0
  79. package/build-ngc/core/index.d.ts +5 -0
  80. package/build-ngc/core/index.js +3 -0
  81. package/build-ngc/core/index.js.map +1 -0
  82. package/build-ngc/core/symbol-types.d.ts +95 -0
  83. package/build-ngc/core/symbol-types.js +2 -0
  84. package/build-ngc/core/symbol-types.js.map +1 -0
  85. package/build-ngc/core/symbols.d.ts +29 -0
  86. package/build-ngc/core/symbols.js +154 -0
  87. package/build-ngc/core/symbols.js.map +1 -0
  88. package/native-link.json +5 -0
  89. package/package.json +155 -0
  90. package/src/angular/index.ts +18 -0
  91. package/src/angular/symbol-view.ts +71 -0
  92. package/src/core/android/index.ts +15 -0
  93. package/src/core/android/symbols.json +4057 -0
  94. package/src/core/android/weights/bold/index.ts +8 -0
  95. package/src/core/android/weights/extraLight/index.ts +8 -0
  96. package/src/core/android/weights/light/index.ts +8 -0
  97. package/src/core/android/weights/medium/index.ts +8 -0
  98. package/src/core/android/weights/regular/index.ts +8 -0
  99. package/src/core/android/weights/semiBold/index.ts +8 -0
  100. package/src/core/android/weights/thin/index.ts +8 -0
  101. package/src/core/index.ts +25 -0
  102. package/src/core/symbol-types.ts +147 -0
  103. package/src/core/symbols.ts +192 -0
  104. package/src/react/index.ts +18 -0
  105. package/src/react/symbol-view.ts +33 -0
  106. package/src/solid/index.ts +18 -0
  107. package/src/solid/symbol-view.ts +53 -0
  108. package/src/svelte/index.ts +18 -0
  109. package/src/svelte/svelte-ambient.d.ts +6 -0
  110. package/src/svelte/svelte-compile.test-helper.ts +6 -0
  111. package/src/svelte/symbol-props.ts +10 -0
  112. package/src/svelte/symbol-view.svelte +26 -0
  113. package/src/vue/index.ts +18 -0
  114. 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,uGAAuG;AAYvG,MAAM,OAAO,UAAW,SAAQ,cAAc;IACjB,IAAI,CAA4B;IAClD,IAAI,CAA4B;IAChC,KAAK,CAA6B;IAClC,MAAM,CAA8B;IACpC,MAAM,CAA8B;IACpC,IAAI,CAA4B;IAChC,SAAS,CAAiC;IAC1C,UAAU,CAAkC;IAC5C,aAAa,CAAqC;IAE/B,SAAS,GAAG;QACtC,MAAM;QACN,MAAM;QACN,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,MAAM;QACN,WAAW;QACX,YAAY;QACZ,eAAe;KACiC,CAAC;IAE3C,YAAY,GAAG,KAAK,CAAC;IACrB,WAAW,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;IAElB,UAAU,CAAC,KAAa;QACzC,OAAO,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;IAED,uDAAuD;IACvD,QAAQ;QACN,IAAI,CAAC,WAAW,GAAG,eAAe,CAChC,MAAM,CAAC,WAAW,CAChB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CACxE,EACD,QAAQ,CAAC,EAAE;YACT,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QACrC,CAAC,CACF,CAAC;IACJ,CAAC;IAEkB,WAAW;QAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;uGA7CU,UAAU;2FAAV,UAAU,yRANX;;;;IAIR,4DANQ,gBAAgB;;2FAQf,UAAU;kBAXtB,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,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"}