@ng-native/components 0.28.0 → 0.29.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 (52) hide show
  1. package/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/menu.d.ts +11 -5
  6. package/dist/menu.js +12 -32
  7. package/dist/menu.js.map +1 -1
  8. package/dist/native-button.d.ts +25 -3
  9. package/dist/native-button.js +101 -7
  10. package/dist/native-button.js.map +1 -1
  11. package/dist/press-menu.d.ts +29 -8
  12. package/dist/press-menu.js +56 -16
  13. package/dist/press-menu.js.map +1 -1
  14. package/dist/pressable.js +2 -1
  15. package/dist/pressable.js.map +1 -1
  16. package/dist/scroll-view.d.ts +3 -1
  17. package/dist/scroll-view.js +7 -2
  18. package/dist/scroll-view.js.map +1 -1
  19. package/dist/sidebar.js +4 -3
  20. package/dist/sidebar.js.map +1 -1
  21. package/dist/split-view.d.ts +23 -2
  22. package/dist/split-view.js +32 -5
  23. package/dist/split-view.js.map +1 -1
  24. package/dist/sticky-headers.d.ts +19 -0
  25. package/dist/sticky-headers.js +67 -10
  26. package/dist/sticky-headers.js.map +1 -1
  27. package/dist/sticky-rows.d.ts +13 -11
  28. package/dist/sticky-rows.js +35 -21
  29. package/dist/sticky-rows.js.map +1 -1
  30. package/dist/svg-icon.d.ts +16 -2
  31. package/dist/svg-icon.js +19 -3
  32. package/dist/svg-icon.js.map +1 -1
  33. package/dist/tray-icon.d.ts +7 -1
  34. package/dist/tray-icon.js +15 -3
  35. package/dist/tray-icon.js.map +1 -1
  36. package/dist/virtual-list-sticky-level.d.ts +0 -6
  37. package/dist/virtual-list-sticky-level.js +2 -26
  38. package/dist/virtual-list-sticky-level.js.map +1 -1
  39. package/dist/virtual-list.d.ts +24 -6
  40. package/dist/virtual-list.js +79 -28
  41. package/dist/virtual-list.js.map +1 -1
  42. package/dist/written-props.js +2 -0
  43. package/dist/written-props.js.map +1 -1
  44. package/ios/NgNativeButtonComponentView.mm +8 -4
  45. package/ios/NgNativeButtonMetrics.h +9 -2
  46. package/ios/NgNativeButtonMetrics.mm +33 -4
  47. package/ios/NgNativeButtonShadowNode.h +2 -0
  48. package/ios/NgNativeButtonShadowNode.mm +5 -1
  49. package/ios/NgNativeMenus.mm +42 -2
  50. package/ios/NgNativePressMenu.h +28 -0
  51. package/ios/NgNativePressMenu.mm +45 -0
  52. package/package.json +3 -3
@@ -65,6 +65,7 @@ export const WRITTEN_PROPS = [
65
65
  'contentInset',
66
66
  'contentInsetAdjustmentBehavior',
67
67
  'contentOffset',
68
+ 'contentStyle',
68
69
  'contextMenu',
69
70
  'contextMenuHidden',
70
71
  'controlSize',
@@ -95,6 +96,7 @@ export const WRITTEN_PROPS = [
95
96
  'hidesWhenStopped',
96
97
  'hitSlop',
97
98
  'horizontal',
99
+ 'iconImage',
98
100
  'importantForAutofill',
99
101
  'indeterminate',
100
102
  'indicatorStyle',
@@ -1 +1 @@
1
- {"version":3,"file":"written-props.js","sourceRoot":"","sources":["../src/written-props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,sBAAsB;IACtB,0BAA0B;IAC1B,0BAA0B;IAC1B,6BAA6B;IAC7B,mBAAmB;IACnB,kCAAkC;IAClC,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,gCAAgC;IAChC,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,uBAAuB;IACvB,wCAAwC;IACxC,mBAAmB;IACnB,uBAAuB;IACvB,sBAAsB;IACtB,sCAAsC;IACtC,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,YAAY;IACZ,sBAAsB;IACtB,kBAAkB;IAClB,qBAAqB;IACrB,QAAQ;IACR,wBAAwB;IACxB,sBAAsB;IACtB,8BAA8B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,qBAAqB;IACrB,qBAAqB;IACrB,aAAa;IACb,sBAAsB;IACtB,eAAe;IACf,mBAAmB;IACnB,yBAAyB;IACzB,oBAAoB;IACpB,6BAA6B;IAC7B,YAAY;IACZ,uBAAuB;IACvB,gCAAgC;IAChC,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,MAAM;IACN,MAAM;IACN,eAAe;IACf,qBAAqB;IACrB,uBAAuB;IACvB,yBAAyB;IACzB,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;IACZ,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,sBAAsB;IACtB,oBAAoB;IACpB,UAAU;IACV,oBAAoB;IACpB,sBAAsB;IACtB,gCAAgC;IAChC,8BAA8B;IAC9B,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,sBAAsB;IACtB,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,SAAS;IACT,QAAQ;IACR,MAAM;IACN,WAAW;IACX,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,YAAY;IACZ,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,uBAAuB;IACvB,OAAO;IACP,SAAS;IACT,QAAQ;IACR,WAAW;CACZ,CAAC","sourcesContent":["/**\n * Every prop the components send through a host binding or a write from code, under the native\n * view's own name, which is often not the name of any input. `native-props.test.ts` holds it to\n * the sources.\n */\nexport const WRITTEN_PROPS: readonly string[] = [\n 'accessibilityActions',\n 'accessibilityColumnCount',\n 'accessibilityDescribedBy',\n 'accessibilityElementsHidden',\n 'accessibilityHint',\n 'accessibilityIgnoresInvertColors',\n 'accessibilityInvalid',\n 'accessibilityLabel',\n 'accessibilityLabelledBy',\n 'accessibilityLanguage',\n 'accessibilityLargeContentTitle',\n 'accessibilityLevel',\n 'accessibilityLiveRegion',\n 'accessibilityPosInSet',\n 'accessibilityRequired',\n 'accessibilityRespondsToUserInteraction',\n 'accessibilityRole',\n 'accessibilityRowCount',\n 'accessibilitySetSize',\n 'accessibilityShowsLargeContentViewer',\n 'accessibilityState',\n 'accessibilityValue',\n 'accessibilityViewIsModal',\n 'accessible',\n 'adjustsFontSizeToFit',\n 'allowFontScaling',\n 'allowSwipeDismissal',\n 'anchor',\n 'alwaysBounceHorizontal',\n 'alwaysBounceVertical',\n 'android_hyphenationFrequency',\n 'animating',\n 'animationType',\n 'autoCapitalize',\n 'autoComplete',\n 'autoCorrect',\n 'autoFocus',\n 'automaticallyAdjustContentInsets',\n 'automaticallyAdjustKeyboardInsets',\n 'automaticallyAdjustsScrollIndicatorInsets',\n 'autosaveName',\n 'backgroundColor',\n 'badge',\n 'blurRadius',\n 'bounces',\n 'bouncesZoom',\n 'canCancelContentTouches',\n 'capInsets',\n 'caretHidden',\n 'centerContent',\n 'clearButtonMode',\n 'clearTextOnFocus',\n 'collapsable',\n 'collapsableChildren',\n 'collapsed',\n 'collapsible',\n 'color',\n 'colors',\n 'contentInset',\n 'contentInsetAdjustmentBehavior',\n 'contentOffset',\n 'contextMenu',\n 'contextMenuHidden',\n 'controlSize',\n 'cursorColor',\n 'dataDetectorType',\n 'dataDetectorTypes',\n 'decelerationRate',\n 'defaultSource',\n 'directionalLockEnabled',\n 'disableFullscreenUI',\n 'disableIntervalMomentum',\n 'disabled',\n 'dragItem',\n 'drawable',\n 'dynamicTypeRamp',\n 'edges',\n 'editable',\n 'ellipsizeMode',\n 'enabled',\n 'enablesReturnKeyAutomatically',\n 'endFillColor',\n 'fadeDuration',\n 'fadingEdgeLength',\n 'fileDrop',\n 'flexDirection',\n 'focusable',\n 'hardwareAccelerated',\n 'hidesWhenStopped',\n 'hitSlop',\n 'horizontal',\n 'importantForAutofill',\n 'indeterminate',\n 'indicatorStyle',\n 'inlineImageLeft',\n 'inlineImagePadding',\n 'inputAccessoryViewID',\n 'isHighlighted',\n 'isPressable',\n 'keyboardAppearance',\n 'keyboardDismissMode',\n 'keyboardType',\n 'kind',\n 'label',\n 'lineBreakStrategyIOS',\n 'loadingIndicatorSource',\n 'maintainVisibleContentPosition',\n 'maxFontSizeMultiplier',\n 'maxLength',\n 'maximumZoomScale',\n 'minimumFontScale',\n 'minimumZoomScale',\n 'mode',\n 'mostRecentEventCount',\n 'multiline',\n 'nativeBackgroundAndroid',\n 'nativeForegroundAndroid',\n 'nativeID',\n 'navigationBarTranslucent',\n 'needsOffscreenAlphaCompositing',\n 'nestedScrollEnabled',\n 'numberOfLines',\n 'on',\n 'onTintColor',\n 'overScrollMode',\n 'pagingEnabled',\n 'paneMaxWidth',\n 'paneMinWidth',\n 'passwordRules',\n 'persistentScrollbar',\n 'pinchGestureEnabled',\n 'placeholder',\n 'placeholderTextColor',\n 'pointerEvents',\n 'presentationStyle',\n 'progressBackgroundColor',\n 'progressViewOffset',\n 'progressiveRenderingEnabled',\n 'refreshing',\n 'removeClippedSubviews',\n 'renderToHardwareTextureAndroid',\n 'resizeMethod',\n 'resizeMode',\n 'resizeMultiplier',\n 'returnKeyType',\n 'role',\n 'rows',\n 'scrollEnabled',\n 'scrollEventThrottle',\n 'scrollIndicatorInsets',\n 'scrollToOverflowEnabled',\n 'scrollsToTop',\n 'secureTextEntry',\n 'selectTextOnFocus',\n 'selectable',\n 'selected',\n 'selection',\n 'selectionColor',\n 'selectionHandleColor',\n 'sendMomentumEvents',\n 'sfSymbol',\n 'shouldRasterizeIOS',\n 'showSoftInputOnFocus',\n 'showsHorizontalScrollIndicator',\n 'showsVerticalScrollIndicator',\n 'size',\n 'smartInsertDelete',\n 'smartQuotes',\n 'snapToAlignment',\n 'snapToEnd',\n 'snapToInterval',\n 'snapToOffsets',\n 'snapToStart',\n 'source',\n 'spellCheck',\n 'statusBarTranslucent',\n 'styleAttr',\n 'submitBehavior',\n 'supportedOrientations',\n 'svgIcon',\n 'testID',\n 'text',\n 'textAlign',\n 'textAlignVertical',\n 'textBreakStrategy',\n 'textContentType',\n 'thumbTintColor',\n 'tintColor',\n 'title',\n 'titleColor',\n 'trackColorForFalse',\n 'trackColorForTrue',\n 'trackTintColor',\n 'transform',\n 'transparent',\n 'underlineColorAndroid',\n 'value',\n 'visible',\n 'zIndex',\n 'zoomScale',\n];\n"]}
1
+ {"version":3,"file":"written-props.js","sourceRoot":"","sources":["../src/written-props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,sBAAsB;IACtB,0BAA0B;IAC1B,0BAA0B;IAC1B,6BAA6B;IAC7B,mBAAmB;IACnB,kCAAkC;IAClC,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,gCAAgC;IAChC,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,uBAAuB;IACvB,wCAAwC;IACxC,mBAAmB;IACnB,uBAAuB;IACvB,sBAAsB;IACtB,sCAAsC;IACtC,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,YAAY;IACZ,sBAAsB;IACtB,kBAAkB;IAClB,qBAAqB;IACrB,QAAQ;IACR,wBAAwB;IACxB,sBAAsB;IACtB,8BAA8B;IAC9B,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,WAAW;IACX,kCAAkC;IAClC,mCAAmC;IACnC,2CAA2C;IAC3C,cAAc;IACd,iBAAiB;IACjB,OAAO;IACP,YAAY;IACZ,SAAS;IACT,aAAa;IACb,yBAAyB;IACzB,WAAW;IACX,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;IACb,qBAAqB;IACrB,WAAW;IACX,aAAa;IACb,OAAO;IACP,QAAQ;IACR,cAAc;IACd,gCAAgC;IAChC,eAAe;IACf,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,aAAa;IACb,aAAa;IACb,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AU;IACV,oBAAoB;IACpB,sBAAsB;IACtB,gCAAgC;IAChC,8BAA8B;IAC9B,MAAM;IACN,mBAAmB;IACnB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,sBAAsB;IACtB,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,SAAS;IACT,QAAQ;IACR,MAAM;IACN,WAAW;IACX,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,YAAY;IACZ,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,uBAAuB;IACvB,OAAO;IACP,SAAS;IACT,QAAQ;IACR,WAAW;CACZ,CAAC","sourcesContent":["/**\n * Every prop the components send through a host binding or a write from code, under the native\n * view's own name, which is often not the name of any input. `native-props.test.ts` holds it to\n * the sources.\n */\nexport const WRITTEN_PROPS: readonly string[] = [\n 'accessibilityActions',\n 'accessibilityColumnCount',\n 'accessibilityDescribedBy',\n 'accessibilityElementsHidden',\n 'accessibilityHint',\n 'accessibilityIgnoresInvertColors',\n 'accessibilityInvalid',\n 'accessibilityLabel',\n 'accessibilityLabelledBy',\n 'accessibilityLanguage',\n 'accessibilityLargeContentTitle',\n 'accessibilityLevel',\n 'accessibilityLiveRegion',\n 'accessibilityPosInSet',\n 'accessibilityRequired',\n 'accessibilityRespondsToUserInteraction',\n 'accessibilityRole',\n 'accessibilityRowCount',\n 'accessibilitySetSize',\n 'accessibilityShowsLargeContentViewer',\n 'accessibilityState',\n 'accessibilityValue',\n 'accessibilityViewIsModal',\n 'accessible',\n 'adjustsFontSizeToFit',\n 'allowFontScaling',\n 'allowSwipeDismissal',\n 'anchor',\n 'alwaysBounceHorizontal',\n 'alwaysBounceVertical',\n 'android_hyphenationFrequency',\n 'animating',\n 'animationType',\n 'autoCapitalize',\n 'autoComplete',\n 'autoCorrect',\n 'autoFocus',\n 'automaticallyAdjustContentInsets',\n 'automaticallyAdjustKeyboardInsets',\n 'automaticallyAdjustsScrollIndicatorInsets',\n 'autosaveName',\n 'backgroundColor',\n 'badge',\n 'blurRadius',\n 'bounces',\n 'bouncesZoom',\n 'canCancelContentTouches',\n 'capInsets',\n 'caretHidden',\n 'centerContent',\n 'clearButtonMode',\n 'clearTextOnFocus',\n 'collapsable',\n 'collapsableChildren',\n 'collapsed',\n 'collapsible',\n 'color',\n 'colors',\n 'contentInset',\n 'contentInsetAdjustmentBehavior',\n 'contentOffset',\n 'contentStyle',\n 'contextMenu',\n 'contextMenuHidden',\n 'controlSize',\n 'cursorColor',\n 'dataDetectorType',\n 'dataDetectorTypes',\n 'decelerationRate',\n 'defaultSource',\n 'directionalLockEnabled',\n 'disableFullscreenUI',\n 'disableIntervalMomentum',\n 'disabled',\n 'dragItem',\n 'drawable',\n 'dynamicTypeRamp',\n 'edges',\n 'editable',\n 'ellipsizeMode',\n 'enabled',\n 'enablesReturnKeyAutomatically',\n 'endFillColor',\n 'fadeDuration',\n 'fadingEdgeLength',\n 'fileDrop',\n 'flexDirection',\n 'focusable',\n 'hardwareAccelerated',\n 'hidesWhenStopped',\n 'hitSlop',\n 'horizontal',\n 'iconImage',\n 'importantForAutofill',\n 'indeterminate',\n 'indicatorStyle',\n 'inlineImageLeft',\n 'inlineImagePadding',\n 'inputAccessoryViewID',\n 'isHighlighted',\n 'isPressable',\n 'keyboardAppearance',\n 'keyboardDismissMode',\n 'keyboardType',\n 'kind',\n 'label',\n 'lineBreakStrategyIOS',\n 'loadingIndicatorSource',\n 'maintainVisibleContentPosition',\n 'maxFontSizeMultiplier',\n 'maxLength',\n 'maximumZoomScale',\n 'minimumFontScale',\n 'minimumZoomScale',\n 'mode',\n 'mostRecentEventCount',\n 'multiline',\n 'nativeBackgroundAndroid',\n 'nativeForegroundAndroid',\n 'nativeID',\n 'navigationBarTranslucent',\n 'needsOffscreenAlphaCompositing',\n 'nestedScrollEnabled',\n 'numberOfLines',\n 'on',\n 'onTintColor',\n 'overScrollMode',\n 'pagingEnabled',\n 'paneMaxWidth',\n 'paneMinWidth',\n 'passwordRules',\n 'persistentScrollbar',\n 'pinchGestureEnabled',\n 'placeholder',\n 'placeholderTextColor',\n 'pointerEvents',\n 'presentationStyle',\n 'progressBackgroundColor',\n 'progressViewOffset',\n 'progressiveRenderingEnabled',\n 'refreshing',\n 'removeClippedSubviews',\n 'renderToHardwareTextureAndroid',\n 'resizeMethod',\n 'resizeMode',\n 'resizeMultiplier',\n 'returnKeyType',\n 'role',\n 'rows',\n 'scrollEnabled',\n 'scrollEventThrottle',\n 'scrollIndicatorInsets',\n 'scrollToOverflowEnabled',\n 'scrollsToTop',\n 'secureTextEntry',\n 'selectTextOnFocus',\n 'selectable',\n 'selected',\n 'selection',\n 'selectionColor',\n 'selectionHandleColor',\n 'sendMomentumEvents',\n 'sfSymbol',\n 'shouldRasterizeIOS',\n 'showSoftInputOnFocus',\n 'showsHorizontalScrollIndicator',\n 'showsVerticalScrollIndicator',\n 'size',\n 'smartInsertDelete',\n 'smartQuotes',\n 'snapToAlignment',\n 'snapToEnd',\n 'snapToInterval',\n 'snapToOffsets',\n 'snapToStart',\n 'source',\n 'spellCheck',\n 'statusBarTranslucent',\n 'styleAttr',\n 'submitBehavior',\n 'supportedOrientations',\n 'svgIcon',\n 'testID',\n 'text',\n 'textAlign',\n 'textAlignVertical',\n 'textBreakStrategy',\n 'textContentType',\n 'thumbTintColor',\n 'tintColor',\n 'title',\n 'titleColor',\n 'trackColorForFalse',\n 'trackColorForTrue',\n 'trackTintColor',\n 'transform',\n 'transparent',\n 'underlineColorAndroid',\n 'value',\n 'visible',\n 'zIndex',\n 'zoomScale',\n];\n"]}
@@ -11,8 +11,10 @@ using namespace facebook::react;
11
11
  `<native-button>` on iOS: a UIButton drawn from a button configuration, the glass ones on iOS 26
12
12
  and later. `kind` picks the style (`default` the prominent one, `destructive` in red, `plain`
13
13
  borderless, anything else the plain push button), `controlSize` UIButton's own size with the
14
- metrics the shadow node measures with, and a tap sends `topButtonPress`. The title follows the
15
- user's text size: the button is configured again as it changes, and React Native measures it again.
14
+ metrics the shadow node measures with, and a tap sends `topButtonPress`. The picture before the
15
+ title is the SF Symbol, or else `iconImage`, an icon's SVG markup drawn as a PNG, tinted as the
16
+ title is. The title follows the user's text size: the button is configured again as it changes,
17
+ and React Native measures it again.
16
18
  Return and Escape press no button on iOS: `default` and `cancel` are only styles there.
17
19
  */
18
20
  @interface NgNativeButtonComponentView : RCTViewComponentView
@@ -78,7 +80,8 @@ static UIButtonConfiguration *configurationForKind(NSString *kind)
78
80
  const auto &newProps = static_cast<const NgNativeButtonProps &>(*props);
79
81
  const auto &previous = static_cast<const NgNativeButtonProps &>(*_props);
80
82
  BOOL changed = newProps.title != previous.title || newProps.kind != previous.kind ||
81
- newProps.controlSize != previous.controlSize || newProps.sfSymbol != previous.sfSymbol;
83
+ newProps.controlSize != previous.controlSize || newProps.sfSymbol != previous.sfSymbol ||
84
+ newProps.iconImage != previous.iconImage;
82
85
  [super updateProps:props oldProps:oldProps];
83
86
  if (changed) {
84
87
  [self ngn_configureWith:newProps];
@@ -95,7 +98,8 @@ static UIButtonConfiguration *configurationForKind(NSString *kind)
95
98
  configuration.contentInsets = NgNativeButtonInsets(controlSize);
96
99
  configuration.title = string(props.title);
97
100
  configuration.titleLineBreakMode = NSLineBreakByTruncatingTail;
98
- configuration.image = NgNativeButtonSymbol(string(props.sfSymbol), controlSize);
101
+ configuration.image = NgNativeButtonSymbol(string(props.sfSymbol), controlSize)
102
+ ?: NgNativeButtonImage(string(props.iconImage), controlSize);
99
103
  configuration.imagePadding = NgNativeButtonImagePadding;
100
104
  UIFont *font = NgNativeButtonFont(controlSize);
101
105
  configuration.titleTextAttributesTransformer = ^NSDictionary<NSAttributedStringKey, id> *(
@@ -22,7 +22,14 @@ extern const CGFloat NgNativeButtonImagePadding;
22
22
  // The symbol drawn beside the title, or nil for none or a name the OS lacks.
23
23
  UIImage *_Nullable NgNativeButtonSymbol(NSString *sfSymbol, NSString *controlSize);
24
24
 
25
- // The button's natural size: one line of title, the symbol, and the insets.
26
- CGSize NgNativeButtonNaturalSize(NSString *title, NSString *controlSize, NSString *sfSymbol);
25
+ // The side of an icon image drawn beside the title, in points: a symbol's height in the title's font.
26
+ CGFloat NgNativeButtonImageSide(NSString *controlSize);
27
+
28
+ // An icon image from a PNG `data:` URI, a template image `NgNativeButtonImageSide` square that the
29
+ // button tints as it does a symbol, or nil for none or data that is no image.
30
+ UIImage *_Nullable NgNativeButtonImage(NSString *uri, NSString *controlSize);
31
+
32
+ // The button's natural size: one line of title, the symbol or else an icon image, and the insets.
33
+ CGSize NgNativeButtonNaturalSize(NSString *title, NSString *controlSize, NSString *sfSymbol, BOOL hasImage);
27
34
 
28
35
  NS_ASSUME_NONNULL_END
@@ -52,16 +52,45 @@ UIImage *_Nullable NgNativeButtonSymbol(NSString *sfSymbol, NSString *controlSiz
52
52
  return [UIImage systemImageNamed:sfSymbol withConfiguration:configuration];
53
53
  }
54
54
 
55
- CGSize NgNativeButtonNaturalSize(NSString *title, NSString *controlSize, NSString *sfSymbol)
55
+ CGFloat NgNativeButtonImageSide(NSString *controlSize)
56
+ {
57
+ return round(NgNativeButtonFont(controlSize).pointSize * 1.2);
58
+ }
59
+
60
+ UIImage *_Nullable NgNativeButtonImage(NSString *uri, NSString *controlSize)
61
+ {
62
+ NSRange comma = [uri rangeOfString:@";base64,"];
63
+ if (![uri hasPrefix:@"data:"] || comma.location == NSNotFound) {
64
+ return nil;
65
+ }
66
+ NSData *data = [[NSData alloc] initWithBase64EncodedString:[uri substringFromIndex:NSMaxRange(comma)]
67
+ options:NSDataBase64DecodingIgnoreUnknownCharacters];
68
+ UIImage *decoded = data != nil ? [UIImage imageWithData:data] : nil;
69
+ CGImageRef pixels = decoded.CGImage;
70
+ if (pixels == NULL) {
71
+ return nil;
72
+ }
73
+ // Its pixels to a point chosen so that it is the side square, whatever size it was drawn at.
74
+ CGFloat longest = MAX(CGImageGetWidth(pixels), CGImageGetHeight(pixels));
75
+ UIImage *sized = [UIImage imageWithCGImage:pixels
76
+ scale:longest / NgNativeButtonImageSide(controlSize)
77
+ orientation:UIImageOrientationUp];
78
+ return [sized imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
79
+ }
80
+
81
+ CGSize NgNativeButtonNaturalSize(NSString *title, NSString *controlSize, NSString *sfSymbol, BOOL hasImage)
56
82
  {
57
83
  UIFont *font = NgNativeButtonFont(controlSize);
58
84
  CGSize text = title.length > 0 ? [title sizeWithAttributes:@{NSFontAttributeName : font}] : CGSizeZero;
59
85
  CGFloat width = ceil(text.width);
60
86
  CGFloat height = ceil(MAX(text.height, font.lineHeight));
61
87
  UIImage *symbol = NgNativeButtonSymbol(sfSymbol, controlSize);
62
- if (symbol != nil) {
63
- width += ceil(symbol.size.width) + (title.length > 0 ? NgNativeButtonImagePadding : 0);
64
- height = MAX(height, ceil(symbol.size.height));
88
+ CGSize picture = symbol != nil ? symbol.size
89
+ : hasImage ? CGSizeMake(NgNativeButtonImageSide(controlSize), NgNativeButtonImageSide(controlSize))
90
+ : CGSizeZero;
91
+ if (picture.width > 0) {
92
+ width += ceil(picture.width) + (title.length > 0 ? NgNativeButtonImagePadding : 0);
93
+ height = MAX(height, ceil(picture.height));
65
94
  }
66
95
  NSDirectionalEdgeInsets insets = NgNativeButtonInsets(controlSize);
67
96
  return CGSizeMake(width + insets.leading + insets.trailing, height + insets.top + insets.bottom);
@@ -30,6 +30,8 @@ class NgNativeButtonProps final : public ViewProps {
30
30
  // `mini`, `small`, `regular` or `large`; empty is `regular`.
31
31
  std::string controlSize{};
32
32
  std::string sfSymbol{};
33
+ // An icon's SVG markup drawn as a PNG, as a `data:` URI, which a symbol wins over.
34
+ std::string iconImage{};
33
35
  bool enabled{true};
34
36
  };
35
37
 
@@ -18,6 +18,7 @@ NgNativeButtonProps::NgNativeButtonProps(
18
18
  kind(convertRawProp(context, rawProps, "kind", sourceProps.kind, {})),
19
19
  controlSize(convertRawProp(context, rawProps, "controlSize", sourceProps.controlSize, {})),
20
20
  sfSymbol(convertRawProp(context, rawProps, "sfSymbol", sourceProps.sfSymbol, {})),
21
+ iconImage(convertRawProp(context, rawProps, "iconImage", sourceProps.iconImage, {})),
21
22
  enabled(convertRawProp(context, rawProps, "enabled", sourceProps.enabled, true))
22
23
  {
23
24
  }
@@ -32,7 +33,10 @@ Size NgNativeButtonShadowNode::measureContent(
32
33
  const LayoutConstraints &layoutConstraints) const
33
34
  {
34
35
  const auto &props = getConcreteProps();
35
- CGSize size = NgNativeButtonNaturalSize(string(props.title), string(props.controlSize), string(props.sfSymbol));
36
+ NSString *controlSize = string(props.controlSize);
37
+ // Room is kept for an image only when the button can decode it, as NgNativeButtonComponentView does.
38
+ BOOL hasImage = !props.iconImage.empty() && NgNativeButtonImage(string(props.iconImage), controlSize) != nil;
39
+ CGSize size = NgNativeButtonNaturalSize(string(props.title), controlSize, string(props.sfSymbol), hasImage);
36
40
  // A narrower box truncates the title rather than wrapping it.
37
41
  return layoutConstraints.clamp({.width = (Float)size.width, .height = (Float)size.height});
38
42
  }
@@ -3,6 +3,7 @@
3
3
  #import <UIKit/UIKit.h>
4
4
 
5
5
  #import "NgNativeMenuBuilding.h"
6
+ #import "NgNativePressMenu.h"
6
7
  #import "NgNativeResponderHooks.h"
7
8
  #import "NgNativeViewBinder.h"
8
9
 
@@ -21,9 +22,14 @@
21
22
  that `nativeID`, added once the view is mounted, its menu read as it opens, and removed with
22
23
  null, or as the view is unmounted, recycled or renamed. A long press opens it, and a secondary
23
24
  click from an iPad pointer.
25
+ - `setPressMenu(nativeID, entries)`: a menu a press opens on React Native's view with that
26
+ `nativeID`, as a clear button over the view (NgNativePressMenu.h), added once the view is
27
+ mounted, its menu made again as the entries change, and removed with null, or as the view is
28
+ unmounted, recycled or renamed.
24
29
  - Events on `ngNativeMenus`: `menuSelect` for a menu bar item, `shortcut` with
25
- `textInputFocused`, `navigate` for the Back and Forward roles, and `contextMenuSelect` with the
26
- view's `nativeID` and the item's `id`, since React Native's view sends no event it does not know.
30
+ `textInputFocused`, `navigate` for the Back and Forward roles, and `contextMenuSelect` and
31
+ `pressMenuSelect` with the view's `nativeID` and the item's `id`, since React Native's view sends
32
+ no event it does not know.
27
33
  - `menuBar` is true on an iPad and false on an iPhone; `appName` is the bundle's display name.
28
34
  */
29
35
  @interface NgNativeMenus : NSObject <RCTBridgeModule, RCTInvalidating, NgNativeMenusHost>
@@ -106,6 +112,8 @@ static UIMenuIdentifier standardMenu(NSString *role)
106
112
  NSArray<UIKeyCommand *> *_shortcuts;
107
113
  NSMutableDictionary<NSString *, NSArray *> *_contextMenus;
108
114
  NgNativeViewBinder *_contextMenuViews;
115
+ NSMutableDictionary<NSString *, NSArray *> *_pressMenus;
116
+ NgNativeViewBinder *_pressMenuViews;
109
117
  // The views inside a context menu's that take a long press themselves, by `nativeID`.
110
118
  NSMutableSet<NSString *> *_longPressTakers;
111
119
  }
@@ -146,6 +154,21 @@ RCT_EXPORT_MODULE()
146
154
  detach:^(UIView *view, NgNativeContextMenuTarget *target) {
147
155
  [view removeInteraction:target.interaction];
148
156
  }];
157
+ _pressMenus = [NSMutableDictionary dictionary];
158
+ _pressMenuViews = [[NgNativeViewBinder alloc]
159
+ initWithAttach:^id(UIView *view, NSString *nativeID) {
160
+ NgNativeMenus *module = weakSelf;
161
+ NSArray *entries = module == nil ? nil : module->_pressMenus[nativeID];
162
+ if (entries == nil) {
163
+ return nil;
164
+ }
165
+ return NgNativeAddPressMenu(view, entries, ^(NSString *itemId) {
166
+ [weakSelf send:@{@"type" : @"pressMenuSelect", @"nativeID" : nativeID, @"id" : itemId}];
167
+ });
168
+ }
169
+ detach:^(UIView *view, NgNativePressMenuButton *button) {
170
+ [button removeFromSuperview];
171
+ }];
149
172
  dispatch_async(dispatch_get_main_queue(), ^{
150
173
  NgNativeInstallResponderHooks();
151
174
  NgNativeSetMenusHost(self);
@@ -161,6 +184,8 @@ RCT_EXPORT_MODULE()
161
184
  dispatch_async(dispatch_get_main_queue(), ^{
162
185
  [self->_contextMenuViews unbindAll];
163
186
  [self->_contextMenus removeAllObjects];
187
+ [self->_pressMenuViews unbindAll];
188
+ [self->_pressMenus removeAllObjects];
164
189
  [self->_longPressTakers removeAllObjects];
165
190
  self->_menuBar = @[];
166
191
  self->_shortcuts = @[];
@@ -223,6 +248,21 @@ RCT_EXPORT_METHOD(setContextMenu : (NSString *)nativeID entries : (nullable NSAr
223
248
  }
224
249
  }
225
250
 
251
+ RCT_EXPORT_METHOD(setPressMenu : (NSString *)nativeID entries : (nullable NSArray *)entries)
252
+ {
253
+ if (![nativeID isKindOfClass:[NSString class]] || nativeID.length == 0) {
254
+ return;
255
+ }
256
+ if ([entries isKindOfClass:[NSArray class]] && entries.count > 0) {
257
+ _pressMenus[nativeID] = entries;
258
+ ((NgNativePressMenuButton *)[_pressMenuViews tokenFor:nativeID]).entries = entries;
259
+ [_pressMenuViews bind:nativeID];
260
+ } else {
261
+ [_pressMenus removeObjectForKey:nativeID];
262
+ [_pressMenuViews unbind:nativeID];
263
+ }
264
+ }
265
+
226
266
  RCT_EXPORT_METHOD(setTakesLongPress : (NSString *)nativeID takes : (BOOL)takes)
227
267
  {
228
268
  if (![nativeID isKindOfClass:[NSString class]] || nativeID.length == 0) {
@@ -0,0 +1,28 @@
1
+ // A menu a press opens on React Native's view. UIKit opens a menu on a touch only from a control
2
+ // of its own, so a clear button with `showsMenuAsPrimaryAction` is laid over the whole view, in the
3
+ // view that holds its children and above them. A touch then opens the menu, and VoiceOver's
4
+ // activation of the view, which taps its middle, opens it too. UIKit has no way to open it from
5
+ // code.
6
+ #pragma once
7
+
8
+ #import <UIKit/UIKit.h>
9
+
10
+ #import "NgNativeMenuBuilding.h"
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface NgNativePressMenuButton : UIButton
15
+
16
+ - (instancetype)initWithChoose:(NgNativeMenuChoose)choose;
17
+ - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
18
+ - (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
19
+
20
+ // The menu, as the app sends it; setting it makes the button's menu again.
21
+ @property (nonatomic, copy) NSArray *entries;
22
+
23
+ @end
24
+
25
+ // A press menu button with `entries` laid over `view`, whose choice runs `choose`.
26
+ NgNativePressMenuButton *NgNativeAddPressMenu(UIView *view, NSArray *entries, NgNativeMenuChoose choose);
27
+
28
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,45 @@
1
+ #import "NgNativePressMenu.h"
2
+
3
+ /** React Native's view holds its children in a view of its own while its style clips overflow ink. */
4
+ @interface UIView (NgNativeContainerView)
5
+ - (UIView *)currentContainerView;
6
+ @end
7
+
8
+ @implementation NgNativePressMenuButton {
9
+ NgNativeMenuChoose _choose;
10
+ }
11
+
12
+ - (instancetype)initWithChoose:(NgNativeMenuChoose)choose
13
+ {
14
+ if (self = [super initWithFrame:CGRectZero]) {
15
+ _choose = [choose copy];
16
+ _entries = @[];
17
+ self.backgroundColor = UIColor.clearColor;
18
+ self.showsMenuAsPrimaryAction = YES;
19
+ self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
20
+ // React Native's view is the accessibility element, with the app's label, role and state;
21
+ // VoiceOver's activation of it taps its middle, which lands here.
22
+ self.isAccessibilityElement = NO;
23
+ }
24
+ return self;
25
+ }
26
+
27
+ - (void)setEntries:(NSArray *)entries
28
+ {
29
+ _entries = [entries copy];
30
+ self.menu = [UIMenu menuWithTitle:@"" children:NgNativeMenuElements(_entries, _choose, NULL)];
31
+ }
32
+
33
+ @end
34
+
35
+ NgNativePressMenuButton *NgNativeAddPressMenu(UIView *view, NSArray *entries, NgNativeMenuChoose choose)
36
+ {
37
+ // React Native hit-tests only the children of the view that holds them, and moves every child
38
+ // with it as that view comes and goes, so the button stays in it, last.
39
+ UIView *holder = [view respondsToSelector:@selector(currentContainerView)] ? view.currentContainerView : view;
40
+ NgNativePressMenuButton *button = [[NgNativePressMenuButton alloc] initWithChoose:choose];
41
+ button.entries = entries;
42
+ button.frame = holder.bounds;
43
+ [holder addSubview:button];
44
+ return button;
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/components",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Angular Native's core components: view, text, image, pressable, scroll-view, virtual-list, text-input and the rest of React Native's set.",
5
5
  "keywords": [
6
6
  "angular",
@@ -61,8 +61,8 @@
61
61
  "access": "public"
62
62
  },
63
63
  "dependencies": {
64
- "@ng-native/device": "0.28.0",
65
- "@ng-native/fabric": "0.28.0"
64
+ "@ng-native/device": "0.29.0",
65
+ "@ng-native/fabric": "0.29.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@angular/core": "^22.0.0",