@momo-kits/calculator-keyboard 0.112.1-rn76.9 → 0.112.1-rn80.2
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.calculatorkeyboard
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
|
+
import android.content.res.ColorStateList
|
|
4
5
|
import android.graphics.Color
|
|
5
6
|
import android.graphics.drawable.GradientDrawable
|
|
6
7
|
import android.view.Gravity
|
|
@@ -11,11 +12,15 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|
|
11
12
|
import androidx.core.graphics.ColorUtils
|
|
12
13
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
13
14
|
import org.mariuszgromada.math.mxparser.Expression
|
|
15
|
+
import androidx.core.graphics.toColorInt
|
|
16
|
+
import com.facebook.react.uimanager.PixelUtil.dpToPx
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
@SuppressLint("SetTextI18n", "ViewConstructor")
|
|
17
|
-
class CustomKeyboardView(
|
|
18
|
-
|
|
20
|
+
class CustomKeyboardView(
|
|
21
|
+
context: ThemedReactContext,
|
|
22
|
+
private val editText: CalculatorEditText
|
|
23
|
+
) : ConstraintLayout(context) {
|
|
19
24
|
private val keys = listOf(
|
|
20
25
|
listOf("AC", "÷", "×", "back"),
|
|
21
26
|
listOf("7", "8", "9", "-"),
|
|
@@ -25,21 +30,21 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
25
30
|
)
|
|
26
31
|
private val specialKeys = listOf("=", "-", "×", "÷", "AC", "back", "+")
|
|
27
32
|
private val separatorWidth = 8f
|
|
28
|
-
private var
|
|
33
|
+
private var specialButtonColor: Int = "#D8D8D8".toColorInt()
|
|
29
34
|
|
|
30
35
|
init {
|
|
31
36
|
val activity = context.currentActivity as? AppCompatActivity
|
|
32
37
|
if (activity != null) {
|
|
33
38
|
val displayMetrics = resources.displayMetrics
|
|
34
39
|
val widthButton = (displayMetrics.widthPixels - separatorWidth * 2 - 3 * separatorWidth) / 4f
|
|
40
|
+
val heightButton = (290.dpToPx() - separatorWidth * 2 - 4 * separatorWidth) / 5
|
|
35
41
|
|
|
36
|
-
renderUI(widthButton)
|
|
42
|
+
renderUI(widthButton, heightButton)
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
private fun renderUI(buttonWidth: Float) {
|
|
42
|
-
val buttonHeight = buttonWidth / 2
|
|
47
|
+
private fun renderUI(buttonWidth: Float, buttonHeight: Float) {
|
|
43
48
|
var yOffset = separatorWidth
|
|
44
49
|
for ((_, row) in keys.withIndex()) {
|
|
45
50
|
var xOffset = separatorWidth
|
|
@@ -91,19 +96,12 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
if (specialKeys.contains(key)) {
|
|
94
|
-
if (key == "=") {
|
|
95
|
-
background = GradientDrawable().apply {
|
|
96
|
-
shape = GradientDrawable.RECTANGLE
|
|
97
|
-
cornerRadius = 24f
|
|
98
|
-
setColor(Color.parseColor("#EB2F96"))
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
99
|
background = GradientDrawable().apply {
|
|
102
100
|
shape = GradientDrawable.RECTANGLE
|
|
103
101
|
cornerRadius = 24f
|
|
104
|
-
setColor(
|
|
102
|
+
setColor(specialButtonColor)
|
|
105
103
|
}
|
|
106
|
-
setTextColor(Color.
|
|
104
|
+
setTextColor(Color.BLACK)
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
|
|
@@ -124,7 +122,7 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
124
122
|
val shapeInit = GradientDrawable().apply {
|
|
125
123
|
shape = GradientDrawable.RECTANGLE
|
|
126
124
|
cornerRadius = 24f
|
|
127
|
-
setColor(
|
|
125
|
+
setColor(specialButtonColor)
|
|
128
126
|
}
|
|
129
127
|
background = shapeInit
|
|
130
128
|
stateListAnimator = null
|
|
@@ -137,12 +135,13 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
137
135
|
translationX = xOffset
|
|
138
136
|
translationY = yOffset
|
|
139
137
|
setImageResource(android.R.drawable.ic_input_delete)
|
|
138
|
+
setImageTintList(ColorStateList.valueOf(Color.BLACK))
|
|
140
139
|
setOnClickListener { onKeyPress(key) }
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
fun updateButtonColors(color: Int) {
|
|
145
|
-
|
|
144
|
+
specialButtonColor = color
|
|
146
145
|
for (i in 0 until childCount) {
|
|
147
146
|
val child = getChildAt(i)
|
|
148
147
|
if (child is Button) {
|
|
@@ -152,22 +151,22 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
152
151
|
child.background = GradientDrawable().apply {
|
|
153
152
|
shape = GradientDrawable.RECTANGLE
|
|
154
153
|
cornerRadius = 24f
|
|
155
|
-
setColor(
|
|
154
|
+
setColor(specialButtonColor)
|
|
156
155
|
}
|
|
157
156
|
} else {
|
|
158
157
|
child.background = GradientDrawable().apply {
|
|
159
158
|
shape = GradientDrawable.RECTANGLE
|
|
160
159
|
cornerRadius = 24f
|
|
161
|
-
setColor(
|
|
160
|
+
setColor(specialButtonColor)
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
|
-
child.setTextColor(Color.
|
|
163
|
+
child.setTextColor(Color.BLACK)
|
|
165
164
|
}
|
|
166
165
|
} else if (child is ImageButton) {
|
|
167
166
|
child.background = GradientDrawable().apply {
|
|
168
167
|
shape = GradientDrawable.RECTANGLE
|
|
169
168
|
cornerRadius = 24f
|
|
170
|
-
setColor(
|
|
169
|
+
setColor(specialButtonColor)
|
|
171
170
|
}
|
|
172
171
|
}
|
|
173
172
|
}
|
|
@@ -188,6 +187,7 @@ class CustomKeyboardView(context: ThemedReactContext, private val editText: Calc
|
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
"×", "+", "-", "÷" -> keyDidPress(" $key ")
|
|
190
|
+
|
|
191
191
|
else -> {
|
|
192
192
|
editText.text?.insert(editText.selectionStart, key)
|
|
193
193
|
}
|
|
@@ -2,24 +2,35 @@ package com.calculatorkeyboard
|
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.app.Activity
|
|
5
|
-
import android.graphics.
|
|
5
|
+
import android.graphics.PixelFormat
|
|
6
|
+
import android.graphics.drawable.ColorDrawable
|
|
7
|
+
import android.view.Gravity
|
|
6
8
|
import android.view.KeyEvent
|
|
7
9
|
import android.view.View
|
|
8
|
-
import android.view.
|
|
10
|
+
import android.view.WindowInsets
|
|
9
11
|
import android.view.WindowManager
|
|
10
|
-
import android.
|
|
12
|
+
import android.widget.PopupWindow
|
|
11
13
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
14
|
+
import androidx.core.graphics.toColorInt
|
|
15
|
+
import com.facebook.react.bridge.ReadableArray
|
|
12
16
|
import com.facebook.react.bridge.UiThreadUtil
|
|
13
17
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
14
18
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
15
19
|
import com.facebook.react.views.textinput.ReactEditText
|
|
16
20
|
import com.facebook.react.views.textinput.ReactTextInputManager
|
|
17
|
-
|
|
21
|
+
import androidx.core.graphics.drawable.toDrawable
|
|
22
|
+
import androidx.core.view.ViewCompat
|
|
23
|
+
import androidx.core.view.WindowInsetsCompat
|
|
24
|
+
import com.facebook.react.uimanager.PixelUtil.dpToPx
|
|
18
25
|
|
|
19
26
|
class RCTInputCalculator : ReactTextInputManager() {
|
|
20
|
-
|
|
27
|
+
|
|
21
28
|
private var keyboardView: CustomKeyboardView? = null
|
|
22
|
-
private var calculatorHeight =
|
|
29
|
+
private var calculatorHeight: Int = 290.dpToPx().toInt()
|
|
30
|
+
private var popup: PopupWindow? = null
|
|
31
|
+
private val animationDuration = 250L
|
|
32
|
+
|
|
33
|
+
private lateinit var editText: CalculatorEditText
|
|
23
34
|
|
|
24
35
|
override fun getName() = REACT_CLASS
|
|
25
36
|
|
|
@@ -29,64 +40,38 @@ class RCTInputCalculator : ReactTextInputManager() {
|
|
|
29
40
|
|
|
30
41
|
@ReactProp(name = "value")
|
|
31
42
|
fun setValue(view: ReactEditText, value: String?) {
|
|
32
|
-
view.setText(value)
|
|
43
|
+
// view.setText(value)
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
@ReactProp(name = "keyboardColor")
|
|
36
47
|
fun setKeyboardColor(view: ReactEditText, color: String) {
|
|
37
|
-
keyboardView?.updateButtonColors(
|
|
48
|
+
keyboardView?.updateButtonColors(color.toColorInt())
|
|
38
49
|
}
|
|
39
50
|
|
|
51
|
+
@SuppressLint("ClickableViewAccessibility")
|
|
40
52
|
override fun createViewInstance(context: ThemedReactContext): ReactEditText {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
keyboardView = CustomKeyboardView(context, editText)
|
|
44
|
-
keyboardView?.setBackgroundColor(Color.parseColor("#f2f2f6"))
|
|
45
|
-
|
|
46
|
-
val displayMetrics = context.currentActivity!!.resources.displayMetrics
|
|
47
|
-
val screenHeight = displayMetrics.heightPixels
|
|
48
|
-
calculatorHeight = (displayMetrics.widthPixels * 0.675).toInt()
|
|
49
|
-
|
|
50
|
-
val lParams = ConstraintLayout.LayoutParams(
|
|
51
|
-
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
|
52
|
-
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
|
53
|
-
).apply {
|
|
54
|
-
height = calculatorHeight
|
|
55
|
-
bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID
|
|
56
|
-
setMargins(0, screenHeight - calculatorHeight, 0, 0)
|
|
57
|
-
}
|
|
58
|
-
if (context.currentActivity != null) {
|
|
59
|
-
(layout as ConstraintLayout).addView(keyboardView, lParams)
|
|
53
|
+
editText = CalculatorEditText(context).apply {
|
|
54
|
+
showSoftInputOnFocus = false
|
|
60
55
|
}
|
|
61
56
|
|
|
62
|
-
editText.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
v.windowToken,
|
|
66
|
-
0
|
|
67
|
-
)
|
|
68
|
-
editText.setShowSoftInputOnFocus(false)
|
|
69
|
-
if (!editText.isFocused) {
|
|
70
|
-
editText.requestFocusFromJS()
|
|
71
|
-
}
|
|
72
|
-
}
|
|
57
|
+
keyboardView = CustomKeyboardView(context, editText).apply {
|
|
58
|
+
setBackgroundColor("#f2f2f6".toColorInt())
|
|
59
|
+
elevation = 24f
|
|
73
60
|
}
|
|
74
61
|
|
|
75
62
|
editText.onFocusListener = object : CalculatorEditText.OnFocusChangeListener {
|
|
76
63
|
override fun onFocusChange(view: CalculatorEditText, hasFocus: Boolean) {
|
|
77
64
|
UiThreadUtil.runOnUiThread {
|
|
78
65
|
if (hasFocus) {
|
|
79
|
-
|
|
66
|
+
showKeyboardPopup(view)
|
|
80
67
|
} else {
|
|
81
|
-
|
|
68
|
+
hideKeyboardPopup()
|
|
82
69
|
}
|
|
83
|
-
view.setOnKeyListener {
|
|
70
|
+
view.setOnKeyListener { v, keyCode, _ ->
|
|
84
71
|
if (keyCode == KeyEvent.KEYCODE_BACK && hasFocus) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
false
|
|
72
|
+
v.clearFocus()
|
|
73
|
+
true
|
|
74
|
+
} else false
|
|
90
75
|
}
|
|
91
76
|
}
|
|
92
77
|
}
|
|
@@ -95,34 +80,87 @@ class RCTInputCalculator : ReactTextInputManager() {
|
|
|
95
80
|
return editText
|
|
96
81
|
}
|
|
97
82
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
layout!!.animate().translationY(0f).setDuration(250)
|
|
83
|
+
override fun getCommandsMap(): Map<String, Int> {
|
|
84
|
+
return mapOf(
|
|
85
|
+
"blur" to 1,
|
|
86
|
+
"focus" to 2
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun receiveCommand(reactEditText: ReactEditText, commandId: Int, args: ReadableArray?) {
|
|
91
|
+
when (commandId) {
|
|
92
|
+
1 -> blur()
|
|
93
|
+
2 -> focus()
|
|
111
94
|
}
|
|
112
95
|
}
|
|
113
96
|
|
|
114
|
-
private fun
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
97
|
+
private fun ensurePopup() {
|
|
98
|
+
if (popup != null) return
|
|
99
|
+
val content = keyboardView ?: return
|
|
100
|
+
|
|
101
|
+
popup = PopupWindow(
|
|
102
|
+
content,
|
|
103
|
+
WindowManager.LayoutParams.MATCH_PARENT,
|
|
104
|
+
calculatorHeight + bottomInsetFrom(editText.rootView),
|
|
105
|
+
false
|
|
106
|
+
).apply {
|
|
107
|
+
setBackgroundDrawable(android.graphics.Color.TRANSPARENT.toDrawable())
|
|
108
|
+
isOutsideTouchable = false
|
|
109
|
+
isClippingEnabled = false
|
|
110
|
+
softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING
|
|
111
|
+
inputMethodMode = PopupWindow.INPUT_METHOD_NOT_NEEDED
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private fun bottomInsetFrom(view: View): Int {
|
|
116
|
+
val insets = ViewCompat.getRootWindowInsets(view) ?: return 0
|
|
117
|
+
val mask = WindowInsetsCompat.Type.navigationBars() or WindowInsetsCompat.Type.displayCutout()
|
|
118
|
+
return insets.getInsets(mask).bottom
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private fun showKeyboardPopup(anchor: View) {
|
|
122
|
+
ensurePopup()
|
|
123
|
+
val p = popup ?: return
|
|
124
|
+
if (p.isShowing) return
|
|
125
|
+
|
|
126
|
+
val root = keyboardView ?: return
|
|
127
|
+
|
|
128
|
+
root.translationY = calculatorHeight.toFloat()
|
|
129
|
+
p.showAtLocation(anchor.rootView, Gravity.BOTTOM or Gravity.START, 0, 0)
|
|
130
|
+
|
|
131
|
+
root.animate()
|
|
132
|
+
?.translationY(0f)
|
|
133
|
+
?.setDuration(animationDuration)
|
|
134
|
+
?.start()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private fun hideKeyboardPopup() {
|
|
138
|
+
val p = popup ?: return
|
|
139
|
+
if (!p.isShowing) return
|
|
140
|
+
val root = keyboardView ?: return
|
|
141
|
+
|
|
142
|
+
root.animate()
|
|
143
|
+
.translationY(calculatorHeight.toFloat())
|
|
144
|
+
.setDuration(animationDuration)
|
|
145
|
+
.withEndAction {
|
|
146
|
+
try {
|
|
147
|
+
if (p.isShowing) p.dismiss()
|
|
148
|
+
} catch (_: Throwable) { }
|
|
123
149
|
}
|
|
150
|
+
.start()
|
|
151
|
+
|
|
152
|
+
popup = null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private fun focus() {
|
|
156
|
+
UiThreadUtil.runOnUiThread {
|
|
157
|
+
if (!editText.isFocused) editText.requestFocus()
|
|
124
158
|
}
|
|
125
159
|
}
|
|
126
160
|
|
|
161
|
+
private fun blur() {
|
|
162
|
+
UiThreadUtil.runOnUiThread {
|
|
163
|
+
if (editText.isFocused) editText.clearFocus()
|
|
164
|
+
}
|
|
165
|
+
}
|
|
127
166
|
}
|
|
128
|
-
|
|
@@ -30,7 +30,7 @@ class CalculatorKeyboardView: UIView {
|
|
|
30
30
|
self.setup(color)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
private func setup(_ color: UIColor = UIColor(hex: "#
|
|
33
|
+
private func setup(_ color: UIColor = UIColor(hex: "#d8d8d8")) {
|
|
34
34
|
self.subviews.forEach { $0.removeFromSuperview() }
|
|
35
35
|
|
|
36
36
|
backgroundColor = UIColor(hex: "#f2f2f6")
|
|
@@ -77,15 +77,12 @@ class CalculatorKeyboardView: UIView {
|
|
|
77
77
|
button.setTitle("", for: .normal)
|
|
78
78
|
let image = UIImage(systemName: "delete.backward", withConfiguration: UIImage.SymbolConfiguration(weight: .bold))
|
|
79
79
|
button.setImage(image, for: .normal)
|
|
80
|
-
button.tintColor = .
|
|
80
|
+
button.tintColor = .black
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if specialKeys.contains(key) {
|
|
84
|
-
button.setTitleColor(.
|
|
85
|
-
button.backgroundColor = color
|
|
86
|
-
if key == "=" {
|
|
87
|
-
button.backgroundColor = color
|
|
88
|
-
}
|
|
84
|
+
button.setTitleColor(.black, for: .normal)
|
|
85
|
+
button.backgroundColor = color
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
button.addTarget(self, action: #selector(keyPressed(_:)), for: .touchUpInside)
|
|
@@ -29,14 +29,18 @@ class InputCalculator: RCTSinglelineTextInputView {
|
|
|
29
29
|
super.init(bridge: bridge)
|
|
30
30
|
self.bridge = bridge
|
|
31
31
|
self.keyboardView = CalculatorKeyboardView()
|
|
32
|
-
self.keyboardView!.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 290)
|
|
32
|
+
self.keyboardView!.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 290 + getbottomInset())
|
|
33
33
|
self.keyboardView!.input = self
|
|
34
34
|
|
|
35
35
|
backedTextInputView.inputView = self.keyboardView
|
|
36
36
|
backedTextInputView.inputView?.reloadInputViews()
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
func getbottomInset() -> CGFloat {
|
|
39
|
+
let window = UIApplication.shared.windows.first?.rootViewController?.view
|
|
40
|
+
let bottom = (window?.safeAreaInsets.bottom ?? 0) > 0 ? 21 : 0
|
|
41
|
+
return CGFloat(bottom)
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
func keyDidPress(_ key: String) {
|
|
41
45
|
backedTextInputView.insertText(key)
|
|
42
46
|
value += key
|
|
@@ -87,7 +91,6 @@ class InputCalculator: RCTSinglelineTextInputView {
|
|
|
87
91
|
value = result.stringValue
|
|
88
92
|
if let bridge = bridge {
|
|
89
93
|
bridge.eventDispatcher().sendTextEvent(with: .change, reactTag: reactTag, text: value, key: "=", eventCount: 1)
|
|
90
|
-
textField.reactBlur()
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
}
|
package/package.json
CHANGED
|
@@ -1,189 +1,185 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"src",
|
|
22
|
-
"lib",
|
|
23
|
-
"android",
|
|
24
|
-
"ios",
|
|
25
|
-
"cpp",
|
|
26
|
-
"*.podspec",
|
|
27
|
-
"react-native.config.js",
|
|
28
|
-
"!ios/build",
|
|
29
|
-
"!android/build",
|
|
30
|
-
"!android/gradle",
|
|
31
|
-
"!android/gradlew",
|
|
32
|
-
"!android/gradlew.bat",
|
|
33
|
-
"!android/local.properties",
|
|
34
|
-
"!**/__tests__",
|
|
35
|
-
"!**/__fixtures__",
|
|
36
|
-
"!**/__mocks__",
|
|
37
|
-
"!**/.*"
|
|
38
|
-
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"example": "yarn workspace react-native-calculator-keyboard-example",
|
|
41
|
-
"test": "jest",
|
|
42
|
-
"typecheck": "tsc",
|
|
43
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
44
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
45
|
-
"prepare": "bob build",
|
|
46
|
-
"release": "release-it"
|
|
47
|
-
},
|
|
48
|
-
"keywords": [
|
|
49
|
-
"react-native",
|
|
50
|
-
"ios",
|
|
51
|
-
"android"
|
|
52
|
-
],
|
|
53
|
-
"repository": {
|
|
54
|
-
"type": "git",
|
|
55
|
-
"url": "git+https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard.git"
|
|
56
|
-
},
|
|
57
|
-
"author": "Dũng (Wem) <huynh.developer@gmail.com> (https://github.com/wem2017/react-native-calculator-keyboard.git)",
|
|
58
|
-
"license": "MIT",
|
|
59
|
-
"bugs": {
|
|
60
|
-
"url": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard/issues"
|
|
61
|
-
},
|
|
62
|
-
"homepage": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard#readme",
|
|
63
|
-
"publishConfig": {
|
|
64
|
-
"registry": "https://registry.npmjs.org/"
|
|
65
|
-
},
|
|
66
|
-
"devDependencies": {
|
|
67
|
-
"@commitlint/config-conventional": "^17.0.2",
|
|
68
|
-
"@evilmartians/lefthook": "^1.5.0",
|
|
69
|
-
"@react-native-community/cli": "15.0.1",
|
|
70
|
-
"@react-native/eslint-config": "^0.73.1",
|
|
71
|
-
"@release-it/conventional-changelog": "^9.0.2",
|
|
72
|
-
"@types/jest": "^29.5.5",
|
|
73
|
-
"@types/react": "^18.2.44",
|
|
74
|
-
"commitlint": "^17.0.2",
|
|
75
|
-
"del-cli": "^5.1.0",
|
|
76
|
-
"eslint": "^8.51.0",
|
|
77
|
-
"eslint-config-prettier": "^9.0.0",
|
|
78
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
79
|
-
"jest": "^29.7.0",
|
|
80
|
-
"prettier": "^3.0.3",
|
|
81
|
-
"react": "18.3.1",
|
|
82
|
-
"react-native": "0.76.5",
|
|
83
|
-
"react-native-builder-bob": "^0.32.0",
|
|
84
|
-
"release-it": "^17.10.0",
|
|
85
|
-
"turbo": "^1.10.7",
|
|
86
|
-
"typescript": "^5.2.2"
|
|
87
|
-
},
|
|
88
|
-
"resolutions": {
|
|
89
|
-
"@types/react": "^18.2.44"
|
|
90
|
-
},
|
|
91
|
-
"peerDependencies": {
|
|
92
|
-
"react": "*",
|
|
93
|
-
"react-native": "*"
|
|
94
|
-
},
|
|
95
|
-
"workspaces": [
|
|
96
|
-
"example"
|
|
97
|
-
],
|
|
98
|
-
"packageManager": "yarn@3.6.1",
|
|
99
|
-
"jest": {
|
|
100
|
-
"preset": "react-native",
|
|
101
|
-
"modulePathIgnorePatterns": [
|
|
102
|
-
"<rootDir>/example/node_modules",
|
|
103
|
-
"<rootDir>/lib/"
|
|
104
|
-
]
|
|
105
|
-
},
|
|
106
|
-
"commitlint": {
|
|
107
|
-
"extends": [
|
|
108
|
-
"@commitlint/config-conventional"
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
|
-
"release-it": {
|
|
112
|
-
"git": {
|
|
113
|
-
"commitMessage": "chore: release ${version}",
|
|
114
|
-
"tagName": "v${version}"
|
|
115
|
-
},
|
|
116
|
-
"npm": {
|
|
117
|
-
"publish": true
|
|
2
|
+
"name": "@momo-kits/calculator-keyboard",
|
|
3
|
+
"version": "0.112.1-rn80.2",
|
|
4
|
+
"description": "react native calculator keyboard",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
118
19
|
},
|
|
119
|
-
"
|
|
120
|
-
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"lib",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"cpp",
|
|
26
|
+
"*.podspec",
|
|
27
|
+
"react-native.config.js",
|
|
28
|
+
"!ios/build",
|
|
29
|
+
"!android/build",
|
|
30
|
+
"!android/gradle",
|
|
31
|
+
"!android/gradlew",
|
|
32
|
+
"!android/gradlew.bat",
|
|
33
|
+
"!android/local.properties",
|
|
34
|
+
"!**/__tests__",
|
|
35
|
+
"!**/__fixtures__",
|
|
36
|
+
"!**/__mocks__",
|
|
37
|
+
"!**/.*"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"typecheck": "tsc",
|
|
42
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
44
|
+
"build": "bob build",
|
|
45
|
+
"release": "release-it"
|
|
121
46
|
},
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"eslintConfig": {
|
|
129
|
-
"root": true,
|
|
130
|
-
"extends": [
|
|
131
|
-
"@react-native",
|
|
132
|
-
"prettier"
|
|
47
|
+
"keywords": [
|
|
48
|
+
"react-native",
|
|
49
|
+
"ios",
|
|
50
|
+
"android"
|
|
133
51
|
],
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard.git"
|
|
55
|
+
},
|
|
56
|
+
"author": "Dũng (Wem) <huynh.developer@gmail.com> (https://github.com/wem2017/react-native-calculator-keyboard.git)",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/wem2017/react-native-calculator-keyboard.git/react-native-calculator-keyboard#readme",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"registry": "https://registry.npmjs.org/"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
67
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
68
|
+
"@react-native-community/cli": "15.0.1",
|
|
69
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
70
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
71
|
+
"@types/jest": "^29.5.5",
|
|
72
|
+
"@types/react": "^18.2.44",
|
|
73
|
+
"commitlint": "^17.0.2",
|
|
74
|
+
"del-cli": "^5.1.0",
|
|
75
|
+
"eslint": "^8.51.0",
|
|
76
|
+
"eslint-config-prettier": "^9.0.0",
|
|
77
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
78
|
+
"jest": "^29.7.0",
|
|
79
|
+
"prettier": "^3.0.3",
|
|
80
|
+
"react": "18.3.1",
|
|
81
|
+
"react-native": "0.76.5",
|
|
82
|
+
"react-native-builder-bob": "^0.32.0",
|
|
83
|
+
"release-it": "^17.10.0",
|
|
84
|
+
"turbo": "^1.10.7",
|
|
85
|
+
"typescript": "^5.2.2"
|
|
86
|
+
},
|
|
87
|
+
"resolutions": {
|
|
88
|
+
"@types/react": "^18.2.44"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": "*",
|
|
92
|
+
"react-native": "*"
|
|
93
|
+
},
|
|
94
|
+
"jest": {
|
|
95
|
+
"preset": "react-native",
|
|
96
|
+
"modulePathIgnorePatterns": [
|
|
97
|
+
"<rootDir>/example/node_modules",
|
|
98
|
+
"<rootDir>/lib/"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"commitlint": {
|
|
102
|
+
"extends": [
|
|
103
|
+
"@commitlint/config-conventional"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"release-it": {
|
|
107
|
+
"git": {
|
|
108
|
+
"commitMessage": "chore: release ${version}",
|
|
109
|
+
"tagName": "v${version}"
|
|
110
|
+
},
|
|
111
|
+
"npm": {
|
|
112
|
+
"publish": true
|
|
113
|
+
},
|
|
114
|
+
"github": {
|
|
115
|
+
"release": true
|
|
116
|
+
},
|
|
117
|
+
"plugins": {
|
|
118
|
+
"@release-it/conventional-changelog": {
|
|
119
|
+
"preset": "angular"
|
|
120
|
+
}
|
|
173
121
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
122
|
+
},
|
|
123
|
+
"eslintConfig": {
|
|
124
|
+
"root": true,
|
|
125
|
+
"extends": [
|
|
126
|
+
"@react-native",
|
|
127
|
+
"prettier"
|
|
128
|
+
],
|
|
129
|
+
"rules": {
|
|
130
|
+
"react/react-in-jsx-scope": "off",
|
|
131
|
+
"prettier/prettier": [
|
|
132
|
+
"error",
|
|
133
|
+
{
|
|
134
|
+
"quoteProps": "consistent",
|
|
135
|
+
"singleQuote": true,
|
|
136
|
+
"tabWidth": 2,
|
|
137
|
+
"trailingComma": "es5",
|
|
138
|
+
"useTabs": false
|
|
139
|
+
}
|
|
140
|
+
]
|
|
180
141
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
142
|
+
},
|
|
143
|
+
"eslintIgnore": [
|
|
144
|
+
"node_modules/",
|
|
145
|
+
"lib/"
|
|
146
|
+
],
|
|
147
|
+
"prettier": {
|
|
148
|
+
"quoteProps": "consistent",
|
|
149
|
+
"singleQuote": true,
|
|
150
|
+
"tabWidth": 2,
|
|
151
|
+
"trailingComma": "es5",
|
|
152
|
+
"useTabs": false
|
|
153
|
+
},
|
|
154
|
+
"react-native-builder-bob": {
|
|
155
|
+
"source": "src",
|
|
156
|
+
"output": "lib",
|
|
157
|
+
"targets": [
|
|
158
|
+
[
|
|
159
|
+
"commonjs",
|
|
160
|
+
{
|
|
161
|
+
"esm": true
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"module",
|
|
166
|
+
{
|
|
167
|
+
"esm": true
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
"typescript",
|
|
172
|
+
{
|
|
173
|
+
"project": "tsconfig.build.json",
|
|
174
|
+
"esm": true
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"create-react-native-library": {
|
|
180
|
+
"type": "legacy-view",
|
|
181
|
+
"languages": "kotlin-swift",
|
|
182
|
+
"version": "0.45.5"
|
|
183
|
+
},
|
|
184
|
+
"dependencies": {}
|
|
185
|
+
}
|