@g9tm/lynxcontrols-native 2.6.19 → 2.7.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 (53) hide show
  1. package/README.md +40 -1
  2. package/android/build.gradle.kts +7 -0
  3. package/android/src/main/java/com/g9lynx/g9native/G9NativeImages.kt +16 -0
  4. package/android/src/main/java/com/g9lynx/g9native/canvas/G9CanvasModel.kt +2 -2
  5. package/android/src/main/java/com/g9lynx/g9native/canvas/G9CanvasPaths.kt +7 -26
  6. package/android/src/main/java/com/g9lynx/g9native/canvas/G9CanvasView.kt +9 -4
  7. package/android/src/main/java/com/g9lynx/g9native/generated/G9ImageModuleSpec.java +27 -0
  8. package/android/src/main/java/com/g9lynx/g9native/image/G9HostTypeface.kt +49 -0
  9. package/android/src/main/java/com/g9lynx/g9native/image/G9ImageDraw.kt +222 -0
  10. package/android/src/main/java/com/g9lynx/g9native/image/G9ImageModule.kt +54 -0
  11. package/android/src/main/java/com/g9lynx/g9native/image/G9ImageProcessor.kt +464 -0
  12. package/android/src/main/java/com/g9lynx/g9native/image/core/G9HostFont.kt +28 -0
  13. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageBudget.kt +54 -0
  14. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageColor.kt +48 -0
  15. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageError.kt +19 -0
  16. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageExifTags.kt +61 -0
  17. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageFiles.kt +99 -0
  18. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageGeometry.kt +150 -0
  19. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageJson.kt +200 -0
  20. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageQuality.kt +65 -0
  21. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageRedaction.kt +77 -0
  22. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageService.kt +102 -0
  23. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageSniff.kt +63 -0
  24. package/android/src/main/java/com/g9lynx/g9native/image/core/G9ImageSpec.kt +237 -0
  25. package/catalog/catalog.json +161 -1
  26. package/catalog/index.md +1 -1
  27. package/dist/.tsbuildinfo +1 -1
  28. package/dist/image.d.ts +219 -0
  29. package/dist/image.d.ts.map +1 -0
  30. package/dist/image.js +116 -0
  31. package/dist/image.js.map +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +1 -0
  35. package/dist/protocol.d.ts +12 -0
  36. package/dist/protocol.d.ts.map +1 -1
  37. package/generated/G9ImageModule.ts +64 -0
  38. package/ios/Tests/G9NativeTestSuite.h +8 -0
  39. package/ios/Tests/G9NativeTestSuite.m +350 -0
  40. package/ios/Tests/G9NativeTests.m +16 -0
  41. package/ios/g9lynx-native-swift.podspec +1 -1
  42. package/ios/g9lynx-native.podspec +5 -4
  43. package/ios/src/G9ImageModule.h +30 -0
  44. package/ios/src/G9ImageModule.m +986 -0
  45. package/ios/src/core/G9ImageCore.h +201 -0
  46. package/ios/src/core/G9ImageCore.m +1039 -0
  47. package/ios/src/generated/G9ImageModuleSpec.h +16 -0
  48. package/ios/src/generated/G9ImageModuleSpec.m +2 -0
  49. package/ios/swift/canvas/G9LCCanvasCore.swift +3 -2
  50. package/ios/swift/canvas/G9LCCanvasView.swift +15 -4
  51. package/ios/swift/shared/G9LCFonts.swift +18 -2
  52. package/package.json +4 -4
  53. package/types/platform-native-module.d.ts +18 -0
@@ -4,8 +4,8 @@
4
4
  # package version — the family's own LYNX_VERSION (scripts/lynx-version.mjs; npm run check:versions).
5
5
  Pod::Spec.new do |s|
6
6
  s.name = 'g9lynx-native'
7
- s.version = '2.6.19'
8
- s.summary = 'G9 SQLite, host and speech native modules, the <g9-video>, <g9-richtext>, <g9-canvas> and <g9-blurhash> elements and the digit-drawing <input>/<textarea> for Lynx (sqlite3, NSUserDefaults, UIKit, AVFoundation, Speech, Core Text).'
7
+ s.version = '2.7.0'
8
+ s.summary = 'G9 SQLite, host, speech and image native modules, the <g9-video>, <g9-richtext>, <g9-canvas> and <g9-blurhash> elements and the digit-drawing <input>/<textarea> for Lynx (sqlite3, NSUserDefaults, UIKit, AVFoundation, Speech, Core Text, ImageIO, Core Image).'
9
9
  s.homepage = 'https://github.com/imankari/g9lynxcontrols'
10
10
  s.license = { :type => 'MIT' }
11
11
  s.author = 'G9LynxControls'
@@ -22,7 +22,8 @@ Pod::Spec.new do |s|
22
22
  s.libraries = 'sqlite3'
23
23
  # Speech: G9SpeechModule (dictation; the host's Info.plist carries NSSpeechRecognitionUsageDescription).
24
24
  # Core Text: G9InputUI registers the digit fonts.
25
- s.frameworks = 'UIKit', 'AVFoundation', 'Speech', 'CoreText'
25
+ # ImageIO, Core Graphics, Core Image: G9ImageModule (decode, draw, redact, encode; G9PhotoEditor, 2.7.0).
26
+ s.frameworks = 'UIKit', 'AVFoundation', 'Speech', 'CoreText', 'ImageIO', 'CoreGraphics', 'CoreImage'
26
27
  # The digit fonts of `g9-digits` (G9InputUI.m; ios/fonts/build-digit-fonts.py, from Vazirmatn, SIL OFL 1.1 — the
27
28
  # license travels with them).
28
29
  s.resource_bundles = { 'G9LynxNativeFonts' => ['fonts/*.ttf', 'fonts/OFL.txt'] }
@@ -37,7 +38,7 @@ Pod::Spec.new do |s|
37
38
  # golden, interrupt, core edges, preferences and the digits plan (Tests/G9NativeTestSuite.m, also run on Linux by
38
39
  # test:ios-core), plus the UIKit checks: the hit-test patch and the digit fonts.
39
40
  s.test_spec 'Tests' do |t|
40
- t.source_files = 'Tests/G9NativeTestSuite.{h,m}', 'Tests/G9NativeTests.m'
41
+ t.source_files = 'Tests/G9NativeTestSuite.{h,m}', 'Tests/G9NativeTests.m', 'Tests/G9ImageModuleTests.m'
41
42
  t.frameworks = 'XCTest'
42
43
  end
43
44
  end
@@ -0,0 +1,30 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <UIKit/UIKit.h>
3
+ #import <Lynx/LynxModule.h>
4
+ #import "generated/G9ImageModuleSpec.h"
5
+
6
+ NS_ASSUME_NONNULL_BEGIN
7
+
8
+ // Hosts register the module on their LynxConfig (the pod does not self-register it)
9
+ // (`[config registerModule:G9ImageModule.class]`, apps/ios-host/Sources/GalleryViewController.m).
10
+
11
+ /**
12
+ * `NativeModules.G9ImageModule` on iOS (2.7.0): probe, preview, process and cancel for G9PhotoEditor and the headless
13
+ * "fit this photo" API (the native contract). Every method takes one JSON string and answers one JSON string
14
+ * (`{"ok":true,"value":…}` / `{"ok":false,"error":{"code","message"}}`) from a serial background queue. ImageIO
15
+ * decodes (subsampled, the orientation applied once), Core Graphics draws in sRGB, Core Image redacts, Core Text sets
16
+ * the text overlays (Persian shaping and RTL), ImageIO encodes (no WebP encoder on iOS: JPEG, and the result says
17
+ * `format: "jpeg"`). The platform-free rules are G9ImageCore. TWIN: G9ImageModule.kt.
18
+ */
19
+ @interface G9ImageModule : NSObject <G9ImageModuleSpec>
20
+
21
+ /**
22
+ * The font of a text overlay whose `font` is empty: the host's text font at a size and a CSS weight (100–900). It is
23
+ * also handed to the Swift elements' `G9LCFonts.textFont` (through `G9LCFontsBridge`), so one call sets the text font
24
+ * of every native element. nil restores the default, the system font.
25
+ */
26
+ + (void)setTextFontProvider:(nullable UIFont * (^)(CGFloat size, CGFloat weight))provider;
27
+
28
+ @end
29
+
30
+ NS_ASSUME_NONNULL_END