react-native-nano-icons 1.0.0 → 1.1.0-beta.1

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 (120) hide show
  1. package/README.md +137 -21
  2. package/android/src/main/java/com/nanoicons/NanoIconFonts.kt +15 -0
  3. package/android/src/main/java/com/nanoicons/NanoIconView.kt +27 -4
  4. package/android/src/main/java/com/nanoicons/NanoIconViewManager.kt +9 -2
  5. package/android/src/main/java/com/nanoicons/NanoIconsFontLoaderModule.kt +3 -0
  6. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.cpp +122 -0
  7. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.h +60 -0
  8. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconViewShadowNode.cpp +0 -39
  9. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconViewShadowNode.h +2 -16
  10. package/ios/NanoIconView.mm +17 -5
  11. package/ios/NanoIconsFontLoader.mm +5 -0
  12. package/lib/commonjs/cli/build.d.ts +26 -0
  13. package/lib/commonjs/cli/build.js +174 -64
  14. package/lib/commonjs/cli/buildSymbols.d.ts +17 -0
  15. package/lib/commonjs/cli/buildSymbols.js +103 -42
  16. package/lib/commonjs/cli/expoConfig.d.ts +10 -0
  17. package/lib/commonjs/cli/expoConfig.js +22 -7
  18. package/lib/commonjs/cli/fingerprint.d.ts +15 -0
  19. package/lib/commonjs/cli/fingerprint.js +36 -0
  20. package/lib/commonjs/cli/index.d.ts +2 -2
  21. package/lib/commonjs/cli/index.js +3 -1
  22. package/lib/commonjs/cli/link.d.ts +4 -0
  23. package/lib/commonjs/cli/link.js +25 -0
  24. package/lib/commonjs/cli/sameOutputs.d.ts +5 -0
  25. package/lib/commonjs/cli/sameOutputs.js +45 -0
  26. package/lib/commonjs/index.node.js +1 -1
  27. package/lib/commonjs/plugin/src/buildFonts.d.ts +3 -2
  28. package/lib/commonjs/plugin/src/buildFonts.js +11 -3
  29. package/lib/commonjs/plugin/src/buildSymbols.d.ts +2 -2
  30. package/lib/commonjs/plugin/src/buildSymbols.js +10 -3
  31. package/lib/commonjs/plugin/src/frozen.d.ts +3 -0
  32. package/lib/commonjs/plugin/src/frozen.js +18 -0
  33. package/lib/commonjs/plugin/src/index.js +3 -3
  34. package/lib/commonjs/plugin/src/types.d.ts +10 -0
  35. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.d.ts +1 -1
  36. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.js +2 -2
  37. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.d.ts +3 -3
  38. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.js +8 -8
  39. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.d.ts +1 -1
  40. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.js +2 -2
  41. package/lib/commonjs/scripts/cli.js +31 -2
  42. package/lib/commonjs/src/core/flatten/dom.js +40 -5
  43. package/lib/commonjs/src/core/flatten/element.js +2 -1
  44. package/lib/commonjs/src/core/flatten/stages/collapse.js +12 -0
  45. package/lib/commonjs/src/core/font/compile.d.ts +0 -1
  46. package/lib/commonjs/src/core/font/compile.js +2 -8
  47. package/lib/commonjs/src/core/glyph/merge.d.ts +2 -1
  48. package/lib/commonjs/src/core/glyph/merge.js +27 -36
  49. package/lib/commonjs/src/core/glyph/parse.d.ts +1 -2
  50. package/lib/commonjs/src/core/glyph/parse.js +31 -18
  51. package/lib/commonjs/src/core/pathkit/winding.d.ts +7 -1
  52. package/lib/commonjs/src/core/pathkit/winding.js +172 -0
  53. package/lib/commonjs/src/core/pipeline/config.d.ts +1 -0
  54. package/lib/commonjs/src/core/pipeline/prepare.d.ts +1 -1
  55. package/lib/commonjs/src/core/pipeline/prepare.js +3 -16
  56. package/lib/commonjs/src/core/pipeline/prepareIcon.d.ts +1 -0
  57. package/lib/commonjs/src/core/pipeline/prepareIcon.js +1 -1
  58. package/lib/commonjs/src/core/pipeline/preparedSvgCache.js +1 -1
  59. package/lib/commonjs/src/core/pipeline/runFontPipeline.js +20 -12
  60. package/lib/commonjs/src/core/symbols/knockout.js +4 -3
  61. package/lib/commonjs/src/utils/fingerPrint.d.ts +1 -0
  62. package/lib/commonjs/src/utils/fingerPrint.js +3 -1
  63. package/lib/commonjs/src/utils/fontIdentity.d.ts +1 -1
  64. package/lib/commonjs/src/utils/fontIdentity.js +2 -2
  65. package/lib/module/createNanoIconsSet.js +0 -1
  66. package/lib/module/createNanoIconsSet.native.js +26 -21
  67. package/lib/module/createNanoIconsSet.shared.js +32 -18
  68. package/lib/module/createNanoIconsSet.web.js +103 -61
  69. package/lib/module/devServerFont.js +1 -1
  70. package/lib/module/devServerFont.web.js +3 -5
  71. package/lib/module/fontIntegrity.js +20 -38
  72. package/lib/module/fontIntegrity.web.js +48 -0
  73. package/lib/module/fontIntegrityStore.js +65 -0
  74. package/lib/module/index.js +1 -1
  75. package/lib/module/index.node.js +1 -1
  76. package/lib/module/index.web.js +4 -0
  77. package/lib/module/loadDynamicFont.js +3 -15
  78. package/lib/module/specs/NanoIconViewNativeComponent.ts +3 -2
  79. package/lib/module/utils/fingerPrint.js +3 -2
  80. package/lib/module/utils/fontIdentity.js +2 -2
  81. package/lib/module/utils/fontScale.js +23 -0
  82. package/lib/module/utils/glyphRuntime.js +13 -0
  83. package/lib/module/utils/iconAccessibility.js +26 -0
  84. package/lib/module/utils/iconPropsEqual.js +27 -0
  85. package/lib/module/utils/webCss.js +26 -0
  86. package/lib/module/utils/webStyle.js +86 -0
  87. package/lib/module/webFont.js +33 -0
  88. package/lib/typescript/src/const/codegenPrimitives.d.ts +1 -0
  89. package/lib/typescript/src/core/glyph/merge.d.ts +2 -1
  90. package/lib/typescript/src/core/glyph/parse.d.ts +1 -2
  91. package/lib/typescript/src/core/pathkit/winding.d.ts +7 -1
  92. package/lib/typescript/src/createNanoIconsSet.d.ts +0 -1
  93. package/lib/typescript/src/createNanoIconsSet.native.d.ts +0 -2
  94. package/lib/typescript/src/createNanoIconsSet.shared.d.ts +1 -3
  95. package/lib/typescript/src/createNanoIconsSet.web.d.ts +1 -2
  96. package/lib/typescript/src/fontIntegrity.d.ts +2 -14
  97. package/lib/typescript/src/fontIntegrity.web.d.ts +7 -0
  98. package/lib/typescript/src/fontIntegrityStore.d.ts +19 -0
  99. package/lib/typescript/src/index.d.ts +2 -1
  100. package/lib/typescript/src/index.web.d.ts +5 -0
  101. package/lib/typescript/src/loadDynamicFont.d.ts +0 -1
  102. package/lib/typescript/src/specs/NanoIconViewNativeComponent.d.ts +3 -2
  103. package/lib/typescript/src/specs/NativeNanoIconsFontLoader.d.ts +1 -0
  104. package/lib/typescript/src/types.d.ts +37 -9
  105. package/lib/typescript/src/utils/fingerPrint.d.ts +1 -0
  106. package/lib/typescript/src/utils/fontIdentity.d.ts +1 -1
  107. package/lib/typescript/src/utils/fontScale.d.ts +2 -0
  108. package/lib/typescript/src/utils/glyphRuntime.d.ts +8 -0
  109. package/lib/typescript/src/utils/iconAccessibility.d.ts +4 -0
  110. package/lib/typescript/src/utils/iconPropsEqual.d.ts +4 -0
  111. package/lib/typescript/src/utils/webCss.d.ts +9 -0
  112. package/lib/typescript/src/utils/webStyle.d.ts +3 -0
  113. package/lib/typescript/src/webFont.d.ts +6 -0
  114. package/package.json +19 -3
  115. package/src/const/codegenPrimitives.ts +3 -3
  116. package/src/specs/NanoIconViewNativeComponent.ts +3 -2
  117. package/src/specs/NativeNanoIconsFontLoader.ts +1 -0
  118. package/lib/commonjs/src/core/pathkit/evenodd.d.ts +0 -12
  119. package/lib/commonjs/src/core/pathkit/evenodd.js +0 -37
  120. package/lib/typescript/src/core/pathkit/evenodd.d.ts +0 -13
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertEvenoddToWinding = convertEvenoddToWinding;
4
- const contours_1 = require("./contours");
5
- /**
6
- * Convert a path `d` string with evenodd fill semantics to an equivalent
7
- * path that renders identically under nonzero winding.
8
- *
9
- * Steps:
10
- * 1. Parse via PathKit, set fill type to EVENODD, simplify (resolve topology)
11
- * 2. Split into contours, compute containment depths
12
- * 3. Fix winding: even depth = CCW (outer), odd depth = CW (hole)
13
- * 4. Reconstruct d string
14
- */
15
- function convertEvenoddToWinding(PathKit, d) {
16
- const V = (0, contours_1.verbMap)(PathKit);
17
- // 1. Parse and simplify with EVENODD fill type
18
- const p = PathKit.FromSVGString(d);
19
- if (!p)
20
- return d;
21
- p.setFillType((0, contours_1.fillTypes)(PathKit).EVENODD);
22
- p.simplify();
23
- // Get the simplified SVG string and re-parse for command access
24
- const simplified = p.toSVGString();
25
- p.delete?.();
26
- const p2 = PathKit.FromSVGString(simplified);
27
- if (!p2)
28
- return simplified;
29
- const cmds = p2.toCmds();
30
- p2.delete?.();
31
- if (cmds.length === 0)
32
- return simplified;
33
- // 2.+3. Split into contours and fix winding via containment analysis
34
- const allCmds = (0, contours_1.orientedContours)(cmds, V).flatMap((x) => x.cmds);
35
- // 4. Reconstruct d string from fixed commands
36
- return (0, contours_1.cmdsToPathData)(allCmds, V);
37
- }
@@ -1,13 +0,0 @@
1
- import type { PathKitModule } from './types';
2
- /**
3
- * Convert a path `d` string with evenodd fill semantics to an equivalent
4
- * path that renders identically under nonzero winding.
5
- *
6
- * Steps:
7
- * 1. Parse via PathKit, set fill type to EVENODD, simplify (resolve topology)
8
- * 2. Split into contours, compute containment depths
9
- * 3. Fix winding: even depth = CCW (outer), odd depth = CW (hole)
10
- * 4. Reconstruct d string
11
- */
12
- export declare function convertEvenoddToWinding(PathKit: PathKitModule, d: string): string;
13
- //# sourceMappingURL=evenodd.d.ts.map