react-native-tinyui 2.0.0 → 3.1.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.
- package/README.md +177 -42
- package/ios/Core/Tinyui.mm +3 -0
- package/ios/Core/TinyuiComponentClasses.mm +18 -0
- package/ios/SwipeActions/TinyuiSwipeActionsView.h +12 -0
- package/ios/SwipeActions/TinyuiSwipeActionsView.mm +289 -0
- package/ios/TipKit/TinyuiTip.swift +16 -0
- package/ios/TipKit/TinyuiTipPopoverProvider.swift +66 -135
- package/ios/TipKit/TinyuiTipPopoverView.mm +0 -18
- package/ios/TipKit/TinyuiTipView.h +8 -0
- package/ios/TipKit/TinyuiTipView.mm +93 -0
- package/ios/TipKit/TinyuiTipViewProvider.swift +140 -0
- package/ios/TipKit/TinyuiTipViewShadowNode.h +48 -0
- package/ios/TipKit/TinyuiTipsRuntime.swift +2 -74
- package/lib/module/SwipeActions/SwipeActionsNativeComponent.ts +19 -0
- package/lib/module/SwipeActions/actions.js +21 -0
- package/lib/module/SwipeActions/actions.js.map +1 -0
- package/lib/module/SwipeActions/index.js +43 -0
- package/lib/module/SwipeActions/index.js.map +1 -0
- package/lib/module/SwipeActions/types.js +4 -0
- package/lib/module/SwipeActions/types.js.map +1 -0
- package/lib/module/TipKit/Popover.js +0 -22
- package/lib/module/TipKit/Popover.js.map +1 -1
- package/lib/module/TipKit/TipPopoverNativeComponent.ts +0 -6
- package/lib/module/TipKit/TipViewNativeComponent.ts +28 -0
- package/lib/module/TipKit/View.js +62 -0
- package/lib/module/TipKit/View.js.map +1 -0
- package/lib/module/TipKit/index.js +2 -0
- package/lib/module/TipKit/index.js.map +1 -1
- package/lib/module/TipKit/validation.js +4 -4
- package/lib/module/TipKit/validation.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/getNativeTinyui.js.map +1 -1
- package/lib/typescript/src/SwipeActions/SwipeActionsNativeComponent.d.ts +15 -0
- package/lib/typescript/src/SwipeActions/SwipeActionsNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/SwipeActions/actions.d.ts +9 -0
- package/lib/typescript/src/SwipeActions/actions.d.ts.map +1 -0
- package/lib/typescript/src/SwipeActions/index.d.ts +4 -0
- package/lib/typescript/src/SwipeActions/index.d.ts.map +1 -0
- package/lib/typescript/src/SwipeActions/types.d.ts +37 -0
- package/lib/typescript/src/SwipeActions/types.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/Popover.d.ts.map +1 -1
- package/lib/typescript/src/TipKit/TipPopoverNativeComponent.d.ts +0 -9
- package/lib/typescript/src/TipKit/TipPopoverNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/TipKit/TipViewNativeComponent.d.ts +29 -0
- package/lib/typescript/src/TipKit/TipViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/View.d.ts +3 -0
- package/lib/typescript/src/TipKit/View.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/index.d.ts +2 -1
- package/lib/typescript/src/TipKit/index.d.ts.map +1 -1
- package/lib/typescript/src/TipKit/types.d.ts +17 -15
- package/lib/typescript/src/TipKit/types.d.ts.map +1 -1
- package/lib/typescript/src/TipKit/validation.d.ts +2 -2
- package/lib/typescript/src/TipKit/validation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/getNativeTinyui.d.ts +1 -1
- package/lib/typescript/src/utils/getNativeTinyui.d.ts.map +1 -1
- package/package.json +13 -2
- package/react-native-tinyui.podspec +6 -1
- package/src/SwipeActions/SwipeActionsNativeComponent.ts +19 -0
- package/src/SwipeActions/actions.ts +26 -0
- package/src/SwipeActions/index.tsx +54 -0
- package/src/SwipeActions/types.ts +37 -0
- package/src/TipKit/Popover.tsx +1 -21
- package/src/TipKit/TipPopoverNativeComponent.ts +0 -6
- package/src/TipKit/TipViewNativeComponent.ts +28 -0
- package/src/TipKit/View.tsx +64 -0
- package/src/TipKit/index.ts +3 -1
- package/src/TipKit/types.ts +19 -20
- package/src/TipKit/validation.ts +8 -5
- package/src/index.tsx +8 -1
- package/src/utils/getNativeTinyui.ts +1 -0
|
@@ -1,32 +1,15 @@
|
|
|
1
1
|
import TipKit
|
|
2
|
-
import
|
|
2
|
+
import Foundation
|
|
3
3
|
|
|
4
4
|
/// Shared across RN surfaces and Fast Refresh. TipKit's datastore owns history.
|
|
5
5
|
@MainActor
|
|
6
6
|
@objc public final class TinyuiTipsRuntime: NSObject {
|
|
7
7
|
static let shared = TinyuiTipsRuntime()
|
|
8
8
|
|
|
9
|
-
private final class WeakProvider {
|
|
10
|
-
weak var value: TinyuiTipPopoverProvider?
|
|
11
|
-
init(_ value: TinyuiTipPopoverProvider) { self.value = value }
|
|
12
|
-
}
|
|
13
|
-
|
|
14
9
|
private var frequency: String?
|
|
15
|
-
private var providers: [WeakProvider] = []
|
|
16
|
-
private var timer: Timer?
|
|
17
|
-
private var updateScheduled = false
|
|
18
10
|
private var knownTips: [String: TinyuiTip] = [:]
|
|
19
|
-
// Keep an in-flight presentation alive long enough to dismiss it even if
|
|
20
|
-
// Fabric unmounts/recycles its owning component during the animation.
|
|
21
|
-
var activeProvider: TinyuiTipPopoverProvider?
|
|
22
11
|
|
|
23
|
-
private override init() {
|
|
24
|
-
super.init()
|
|
25
|
-
NotificationCenter.default.addObserver(self, selector: #selector(applicationStateChanged), name: UIApplication.didBecomeActiveNotification, object: nil)
|
|
26
|
-
NotificationCenter.default.addObserver(self, selector: #selector(applicationStateChanged), name: UIApplication.willResignActiveNotification, object: nil)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@objc private func applicationStateChanged() { requestUpdate() }
|
|
12
|
+
private override init() { super.init() }
|
|
30
13
|
|
|
31
14
|
var isConfigured: Bool { frequency != nil }
|
|
32
15
|
|
|
@@ -67,7 +50,6 @@ import UIKit
|
|
|
67
50
|
// before the tip mounts, when the feature is discovered without a tip.
|
|
68
51
|
let tip = shared.knownTips[tipId] ?? TinyuiTip(id: tipId)
|
|
69
52
|
tip.invalidate(reason: reason == "tipClosed" ? .tipClosed : .actionPerformed)
|
|
70
|
-
shared.requestUpdate()
|
|
71
53
|
completion(nil)
|
|
72
54
|
}
|
|
73
55
|
|
|
@@ -89,7 +71,6 @@ import UIKit
|
|
|
89
71
|
}
|
|
90
72
|
try Tips.configure([.displayFrequency(nativeFrequency)])
|
|
91
73
|
self.frequency = frequency
|
|
92
|
-
requestUpdate()
|
|
93
74
|
}
|
|
94
75
|
|
|
95
76
|
static func error(_ code: String, _ message: String) -> NSError {
|
|
@@ -99,19 +80,6 @@ import UIKit
|
|
|
99
80
|
])
|
|
100
81
|
}
|
|
101
82
|
|
|
102
|
-
func register(_ provider: TinyuiTipPopoverProvider) {
|
|
103
|
-
providers.removeAll { $0.value == nil }
|
|
104
|
-
if !providers.contains(where: { $0.value === provider }) {
|
|
105
|
-
providers.append(WeakProvider(provider))
|
|
106
|
-
}
|
|
107
|
-
requestUpdate()
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
func unregister(_ provider: TinyuiTipPopoverProvider) {
|
|
111
|
-
providers.removeAll { $0.value == nil || $0.value === provider }
|
|
112
|
-
requestUpdate()
|
|
113
|
-
}
|
|
114
|
-
|
|
115
83
|
func remember(_ tip: TinyuiTip) throws {
|
|
116
84
|
if let previous = knownTips[tip.id],
|
|
117
85
|
previous.maximumDisplayCount != tip.maximumDisplayCount || previous.ignoresFrequency != tip.ignoresFrequency {
|
|
@@ -119,44 +87,4 @@ import UIKit
|
|
|
119
87
|
}
|
|
120
88
|
knownTips[tip.id] = tip
|
|
121
89
|
}
|
|
122
|
-
|
|
123
|
-
func release(_ provider: TinyuiTipPopoverProvider) {
|
|
124
|
-
if activeProvider === provider { activeProvider = nil }
|
|
125
|
-
requestUpdate()
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
func requestUpdate() {
|
|
129
|
-
guard !updateScheduled else { return }
|
|
130
|
-
updateScheduled = true
|
|
131
|
-
DispatchQueue.main.async { [weak self] in
|
|
132
|
-
guard let self else { return }
|
|
133
|
-
self.updateScheduled = false
|
|
134
|
-
self.update()
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private func update() {
|
|
139
|
-
providers.removeAll { $0.value == nil }
|
|
140
|
-
// Finish dismissing an old presentation before offering its slot to another.
|
|
141
|
-
activeProvider?.updatePresentation()
|
|
142
|
-
for provider in providers.compactMap(\.value) where provider !== activeProvider {
|
|
143
|
-
provider.updatePresentation()
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// UIKit has no single notification for an anchor being scrolled offscreen,
|
|
147
|
-
// a navigation transition ending, or another modal being dismissed. Poll
|
|
148
|
-
// only while a tip is eligible/on screen; idle or disabled tips do no work.
|
|
149
|
-
let needsMonitoring = activeProvider != nil || providers.contains { $0.value?.needsMonitoring == true }
|
|
150
|
-
if needsMonitoring && timer == nil {
|
|
151
|
-
let timer = Timer(timeInterval: 0.25, repeats: true) { [weak self] _ in
|
|
152
|
-
Task { @MainActor [weak self] in self?.update() }
|
|
153
|
-
}
|
|
154
|
-
timer.tolerance = 0.05
|
|
155
|
-
RunLoop.main.add(timer, forMode: .common)
|
|
156
|
-
self.timer = timer
|
|
157
|
-
} else if !needsMonitoring {
|
|
158
|
-
timer?.invalidate()
|
|
159
|
-
timer = nil
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
90
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
|
+
|
|
8
|
+
export interface NativeSwipeActionsProps extends ViewProps {
|
|
9
|
+
actionsConfig: CodegenTypes.UnsafeMixed;
|
|
10
|
+
edge?: CodegenTypes.WithDefault<'leading' | 'trailing', 'trailing'>;
|
|
11
|
+
allowsFullSwipe?: CodegenTypes.WithDefault<boolean, true>;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onActionPress?: DirectEventHandler<Readonly<{ id: string; title: string }>>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default codegenNativeComponent<NativeSwipeActionsProps>(
|
|
17
|
+
'TinyuiSwipeActionsView',
|
|
18
|
+
{ excludedPlatforms: ['android'] }
|
|
19
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { processColor } from 'react-native';
|
|
4
|
+
export function serializeSwipeActions(actions) {
|
|
5
|
+
const ids = new Set();
|
|
6
|
+
return actions.map((action, index) => {
|
|
7
|
+
const id = action.id ?? `item.${index}`;
|
|
8
|
+
if (ids.has(id)) {
|
|
9
|
+
throw new Error(`SwipeActions action id "${id}" must be unique.`);
|
|
10
|
+
}
|
|
11
|
+
ids.add(id);
|
|
12
|
+
return {
|
|
13
|
+
id,
|
|
14
|
+
title: action.title,
|
|
15
|
+
systemImage: action.systemImage,
|
|
16
|
+
tintColor: action.tintColor === undefined ? undefined : processColor(action.tintColor),
|
|
17
|
+
destructive: action.destructive ?? false
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["processColor","serializeSwipeActions","actions","ids","Set","map","action","index","id","has","Error","add","title","systemImage","tintColor","undefined","destructive"],"sourceRoot":"../../../src","sources":["SwipeActions/actions.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAI3C,OAAO,SAASC,qBAAqBA,CAACC,OAA+B,EAAE;EACrE,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAS,CAAC;EAE7B,OAAOF,OAAO,CAACG,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,KAAK;IACpC,MAAMC,EAAE,GAAGF,MAAM,CAACE,EAAE,IAAI,QAAQD,KAAK,EAAE;IACvC,IAAIJ,GAAG,CAACM,GAAG,CAACD,EAAE,CAAC,EAAE;MACf,MAAM,IAAIE,KAAK,CAAC,2BAA2BF,EAAE,mBAAmB,CAAC;IACnE;IACAL,GAAG,CAACQ,GAAG,CAACH,EAAE,CAAC;IAEX,OAAO;MACLA,EAAE;MACFI,KAAK,EAAEN,MAAM,CAACM,KAAK;MACnBC,WAAW,EAAEP,MAAM,CAACO,WAAW;MAC/BC,SAAS,EACPR,MAAM,CAACQ,SAAS,KAAKC,SAAS,GAC1BA,SAAS,GACTf,YAAY,CAACM,MAAM,CAACQ,SAAS,CAAC;MACpCE,WAAW,EAAEV,MAAM,CAACU,WAAW,IAAI;IACrC,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { assertComponentEnabled } from "../utils/index.js";
|
|
6
|
+
import { serializeSwipeActions } from "./actions.js";
|
|
7
|
+
import NativeSwipeActionsView from './SwipeActionsNativeComponent';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export const SwipeActions = /*#__PURE__*/forwardRef(function SwipeActionsRoot({
|
|
10
|
+
actions,
|
|
11
|
+
children,
|
|
12
|
+
contentContainerStyle,
|
|
13
|
+
edge = 'trailing',
|
|
14
|
+
allowsFullSwipe = true,
|
|
15
|
+
disabled = false,
|
|
16
|
+
style,
|
|
17
|
+
...viewProps
|
|
18
|
+
}, ref) {
|
|
19
|
+
assertComponentEnabled('SwipeActions');
|
|
20
|
+
return /*#__PURE__*/_jsx(NativeSwipeActionsView, {
|
|
21
|
+
...viewProps,
|
|
22
|
+
ref: ref,
|
|
23
|
+
actionsConfig: serializeSwipeActions(actions),
|
|
24
|
+
edge: edge,
|
|
25
|
+
allowsFullSwipe: allowsFullSwipe,
|
|
26
|
+
disabled: disabled,
|
|
27
|
+
style: [styles.container, style],
|
|
28
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
29
|
+
collapsable: false,
|
|
30
|
+
style: [styles.content, contentContainerStyle],
|
|
31
|
+
children: children
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
overflow: 'hidden'
|
|
38
|
+
},
|
|
39
|
+
content: {
|
|
40
|
+
flexGrow: 1
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","StyleSheet","View","assertComponentEnabled","serializeSwipeActions","NativeSwipeActionsView","jsx","_jsx","SwipeActions","SwipeActionsRoot","actions","children","contentContainerStyle","edge","allowsFullSwipe","disabled","style","viewProps","ref","actionsConfig","styles","container","collapsable","content","create","overflow","flexGrow"],"sourceRoot":"../../../src","sources":["SwipeActions/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA2B,OAAO;AACrD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,sBAAsB,QAAQ,mBAAU;AACjD,SAASC,qBAAqB,QAAQ,cAAW;AACjD,OAAOC,sBAAsB,MAAM,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnE,OAAO,MAAMC,YAAY,gBAAGR,UAAU,CAGpC,SAASS,gBAAgBA,CACzB;EACEC,OAAO;EACPC,QAAQ;EACRC,qBAAqB;EACrBC,IAAI,GAAG,UAAU;EACjBC,eAAe,GAAG,IAAI;EACtBC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACL,GAAGC;AACL,CAAC,EACDC,GAAG,EACH;EACAf,sBAAsB,CAAC,cAAc,CAAC;EAEtC,oBACEI,IAAA,CAACF,sBAAsB;IAAA,GACjBY,SAAS;IACbC,GAAG,EAAEA,GAAI;IACTC,aAAa,EAAEf,qBAAqB,CAACM,OAAO,CAAE;IAC9CG,IAAI,EAAEA,IAAK;IACXC,eAAe,EAAEA,eAAgB;IACjCC,QAAQ,EAAEA,QAAS;IACnBC,KAAK,EAAE,CAACI,MAAM,CAACC,SAAS,EAAEL,KAAK,CAAE;IAAAL,QAAA,eAEjCJ,IAAA,CAACL,IAAI;MAACoB,WAAW,EAAE,KAAM;MAACN,KAAK,EAAE,CAACI,MAAM,CAACG,OAAO,EAAEX,qBAAqB,CAAE;MAAAD,QAAA,EACtEA;IAAQ,CACL;EAAC,CACe,CAAC;AAE7B,CAAC,CAAC;AAEF,MAAMS,MAAM,GAAGnB,UAAU,CAACuB,MAAM,CAAC;EAC/BH,SAAS,EAAE;IAAEI,QAAQ,EAAE;EAAS,CAAC;EACjCF,OAAO,EAAE;IAAEG,QAAQ,EAAE;EAAE;AACzB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["SwipeActions/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -20,8 +20,6 @@ export const Popover = /*#__PURE__*/forwardRef(function TipPopoverRoot(props, re
|
|
|
20
20
|
maxDisplayCount,
|
|
21
21
|
ignoresDisplayFrequency = false,
|
|
22
22
|
arrowEdge = 'auto',
|
|
23
|
-
onStatusChange,
|
|
24
|
-
onVisibleChange,
|
|
25
23
|
onActionPress,
|
|
26
24
|
onError,
|
|
27
25
|
...viewProps
|
|
@@ -39,26 +37,6 @@ export const Popover = /*#__PURE__*/forwardRef(function TipPopoverRoot(props, re
|
|
|
39
37
|
maxDisplayCount: maxDisplayCount ?? 0,
|
|
40
38
|
ignoresDisplayFrequency: ignoresDisplayFrequency,
|
|
41
39
|
arrowEdge: arrowEdge,
|
|
42
|
-
onTipStatusChange: ({
|
|
43
|
-
nativeEvent
|
|
44
|
-
}) => {
|
|
45
|
-
if (nativeEvent.tipId !== tipId) return;
|
|
46
|
-
if (nativeEvent.status === 'invalidated') {
|
|
47
|
-
onStatusChange?.({
|
|
48
|
-
status: 'invalidated',
|
|
49
|
-
reason: nativeEvent.reason
|
|
50
|
-
});
|
|
51
|
-
} else if (nativeEvent.status === 'pending' || nativeEvent.status === 'available') {
|
|
52
|
-
onStatusChange?.({
|
|
53
|
-
status: nativeEvent.status
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
onTipVisibleChange: ({
|
|
58
|
-
nativeEvent
|
|
59
|
-
}) => {
|
|
60
|
-
if (nativeEvent.tipId === tipId) onVisibleChange?.(nativeEvent.visible);
|
|
61
|
-
},
|
|
62
40
|
onTipAction: ({
|
|
63
41
|
nativeEvent
|
|
64
42
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","View","assertComponentEnabled","NativeTipPopoverView","validateTip","jsx","_jsx","Popover","TipPopoverRoot","props","ref","children","tipId","title","message","systemImage","actions","enabled","maxDisplayCount","ignoresDisplayFrequency","arrowEdge","
|
|
1
|
+
{"version":3,"names":["forwardRef","View","assertComponentEnabled","NativeTipPopoverView","validateTip","jsx","_jsx","Popover","TipPopoverRoot","props","ref","children","tipId","title","message","systemImage","actions","enabled","maxDisplayCount","ignoresDisplayFrequency","arrowEdge","onActionPress","onError","viewProps","collapsable","onTipAction","nativeEvent","id","onTipError","error","code","console","warn","displayName"],"sourceRoot":"../../../src","sources":["TipKit/Popover.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA2B,OAAO;AACrD,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,sBAAsB,QAAQ,mBAAU;AACjD,OAAOC,oBAAoB,MAAM,6BAA6B;AAE9D,SAASC,WAAW,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,OAAO,MAAMC,OAAO,gBAAGP,UAAU,CAC/B,SAASQ,cAAcA,CAACC,KAAK,EAAEC,GAAG,EAAE;EAClCR,sBAAsB,CAAC,QAAQ,CAAC;EAChCE,WAAW,CAACK,KAAK,CAAC;EAClB,MAAM;IACJE,QAAQ;IACRC,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,OAAO;IACPC,OAAO,GAAG,IAAI;IACdC,eAAe;IACfC,uBAAuB,GAAG,KAAK;IAC/BC,SAAS,GAAG,MAAM;IAClBC,aAAa;IACbC,OAAO;IACP,GAAGC;EACL,CAAC,GAAGd,KAAK;EAET,oBACEH,IAAA,CAACH,oBAAoB;IAAA,GACfoB,SAAS;IACbb,GAAG,EAAEA,GAAI;IACTc,WAAW,EAAE,KAAM;IACnBZ,KAAK,EAAEA,KAAM;IACbC,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBC,WAAW,EAAEA,WAAY;IACzBC,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBC,eAAe,EAAEA,eAAe,IAAI,CAAE;IACtCC,uBAAuB,EAAEA,uBAAwB;IACjDC,SAAS,EAAEA,SAAU;IACrBK,WAAW,EAAEA,CAAC;MAAEC;IAAY,CAAC,KAAK;MAChC,IAAIA,WAAW,CAACd,KAAK,KAAKA,KAAK,EAAE;QAC/BS,aAAa,GAAG;UAAEM,EAAE,EAAED,WAAW,CAACC,EAAE;UAAEd,KAAK,EAAEa,WAAW,CAACb;QAAM,CAAC,CAAC;MACnE;IACF,CAAE;IACFe,UAAU,EAAEA,CAAC;MAAEF;IAAY,CAAC,KAAK;MAC/B,IAAIA,WAAW,CAACd,KAAK,KAAKA,KAAK,EAAE;MACjC,MAAMiB,KAAK,GAAG;QACZC,IAAI,EAAEJ,WAAW,CAACI,IAAI;QACtBhB,OAAO,EAAEY,WAAW,CAACZ;MACvB,CAAC;MACD,IAAIQ,OAAO,EAAEA,OAAO,CAACO,KAAK,CAAC,CAAC,KAE1BE,OAAO,CAACC,IAAI,CACV,2BAA2BH,KAAK,CAACC,IAAI,KAAKD,KAAK,CAACf,OAAO,EACzD,CAAC;IACL,CAAE;IAAAH,QAAA,eAEFL,IAAA,CAACL,IAAI;MAACuB,WAAW,EAAE,KAAM;MAAAb,QAAA,EAAEA;IAAQ,CAAO;EAAC,CACvB,CAAC;AAE3B,CACF,CAAC;AAEDJ,OAAO,CAAC0B,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -15,12 +15,6 @@ export interface NativeTipPopoverProps extends ViewProps {
|
|
|
15
15
|
maxDisplayCount?: CodegenTypes.Int32;
|
|
16
16
|
ignoresDisplayFrequency?: boolean;
|
|
17
17
|
arrowEdge?: string;
|
|
18
|
-
onTipStatusChange?: DirectEventHandler<
|
|
19
|
-
Readonly<{ tipId: string; status: string; reason: string }>
|
|
20
|
-
>;
|
|
21
|
-
onTipVisibleChange?: DirectEventHandler<
|
|
22
|
-
Readonly<{ tipId: string; visible: boolean }>
|
|
23
|
-
>;
|
|
24
18
|
onTipAction?: DirectEventHandler<
|
|
25
19
|
Readonly<{ tipId: string; id: string; title: string }>
|
|
26
20
|
>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
|
+
|
|
8
|
+
export interface NativeTipViewProps extends ViewProps {
|
|
9
|
+
tipId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
systemImage?: string;
|
|
13
|
+
actions?: ReadonlyArray<Readonly<{ id: string; title: string }>>;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
maxDisplayCount?: CodegenTypes.Int32;
|
|
16
|
+
ignoresDisplayFrequency?: boolean;
|
|
17
|
+
arrowEdge?: string;
|
|
18
|
+
onTipAction?: DirectEventHandler<
|
|
19
|
+
Readonly<{ tipId: string; id: string; title: string }>
|
|
20
|
+
>;
|
|
21
|
+
onTipError?: DirectEventHandler<
|
|
22
|
+
Readonly<{ tipId: string; code: string; message: string }>
|
|
23
|
+
>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default codegenNativeComponent<NativeTipViewProps>('TinyuiTipView', {
|
|
27
|
+
excludedPlatforms: ['android'],
|
|
28
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { assertComponentEnabled } from "../utils/index.js";
|
|
5
|
+
import NativeTipView from './TipViewNativeComponent';
|
|
6
|
+
import { validateTip } from "./validation.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const View = /*#__PURE__*/forwardRef(function TipViewRoot(props, ref) {
|
|
9
|
+
assertComponentEnabled('TipKit');
|
|
10
|
+
validateTip(props, 'TipKit.View');
|
|
11
|
+
const {
|
|
12
|
+
tipId,
|
|
13
|
+
title,
|
|
14
|
+
message,
|
|
15
|
+
systemImage,
|
|
16
|
+
actions,
|
|
17
|
+
enabled = true,
|
|
18
|
+
maxDisplayCount,
|
|
19
|
+
ignoresDisplayFrequency = false,
|
|
20
|
+
arrowEdge = 'none',
|
|
21
|
+
onActionPress,
|
|
22
|
+
onError,
|
|
23
|
+
...viewProps
|
|
24
|
+
} = props;
|
|
25
|
+
return /*#__PURE__*/_jsx(NativeTipView, {
|
|
26
|
+
...viewProps,
|
|
27
|
+
children: undefined,
|
|
28
|
+
ref: ref,
|
|
29
|
+
collapsable: false,
|
|
30
|
+
tipId: tipId,
|
|
31
|
+
title: title,
|
|
32
|
+
message: message,
|
|
33
|
+
systemImage: systemImage,
|
|
34
|
+
actions: actions,
|
|
35
|
+
enabled: enabled,
|
|
36
|
+
maxDisplayCount: maxDisplayCount ?? 0,
|
|
37
|
+
ignoresDisplayFrequency: ignoresDisplayFrequency,
|
|
38
|
+
arrowEdge: arrowEdge,
|
|
39
|
+
onTipAction: ({
|
|
40
|
+
nativeEvent
|
|
41
|
+
}) => {
|
|
42
|
+
if (nativeEvent.tipId === tipId) {
|
|
43
|
+
onActionPress?.({
|
|
44
|
+
id: nativeEvent.id,
|
|
45
|
+
title: nativeEvent.title
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
onTipError: ({
|
|
50
|
+
nativeEvent
|
|
51
|
+
}) => {
|
|
52
|
+
if (nativeEvent.tipId !== tipId) return;
|
|
53
|
+
const error = {
|
|
54
|
+
code: nativeEvent.code,
|
|
55
|
+
message: nativeEvent.message
|
|
56
|
+
};
|
|
57
|
+
if (onError) onError(error);else console.warn(`[TinyUI] TipKit.View ${error.code}: ${error.message}`);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
View.displayName = 'TipKit.View';
|
|
62
|
+
//# sourceMappingURL=View.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","assertComponentEnabled","NativeTipView","validateTip","jsx","_jsx","View","TipViewRoot","props","ref","tipId","title","message","systemImage","actions","enabled","maxDisplayCount","ignoresDisplayFrequency","arrowEdge","onActionPress","onError","viewProps","children","undefined","collapsable","onTipAction","nativeEvent","id","onTipError","error","code","console","warn","displayName"],"sourceRoot":"../../../src","sources":["TipKit/View.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA2B,OAAO;AAGrD,SAASC,sBAAsB,QAAQ,mBAAU;AACjD,OAAOC,aAAa,MAAM,0BAA0B;AAEpD,SAASC,WAAW,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,OAAO,MAAMC,IAAI,gBAAGN,UAAU,CAG5B,SAASO,WAAWA,CAACC,KAAK,EAAEC,GAAG,EAAE;EACjCR,sBAAsB,CAAC,QAAQ,CAAC;EAChCE,WAAW,CAACK,KAAK,EAAE,aAAa,CAAC;EACjC,MAAM;IACJE,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,OAAO;IACPC,OAAO,GAAG,IAAI;IACdC,eAAe;IACfC,uBAAuB,GAAG,KAAK;IAC/BC,SAAS,GAAG,MAAM;IAClBC,aAAa;IACbC,OAAO;IACP,GAAGC;EACL,CAAC,GAAGb,KAAK;EAET,oBACEH,IAAA,CAACH,aAAa;IAAA,GACRmB,SAAS;IACbC,QAAQ,EAAEC,SAAU;IACpBd,GAAG,EAAEA,GAAI;IACTe,WAAW,EAAE,KAAM;IACnBd,KAAK,EAAEA,KAAM;IACbC,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBC,WAAW,EAAEA,WAAY;IACzBC,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBC,eAAe,EAAEA,eAAe,IAAI,CAAE;IACtCC,uBAAuB,EAAEA,uBAAwB;IACjDC,SAAS,EAAEA,SAAU;IACrBO,WAAW,EAAEA,CAAC;MAAEC;IAAY,CAAC,KAAK;MAChC,IAAIA,WAAW,CAAChB,KAAK,KAAKA,KAAK,EAAE;QAC/BS,aAAa,GAAG;UAAEQ,EAAE,EAAED,WAAW,CAACC,EAAE;UAAEhB,KAAK,EAAEe,WAAW,CAACf;QAAM,CAAC,CAAC;MACnE;IACF,CAAE;IACFiB,UAAU,EAAEA,CAAC;MAAEF;IAAY,CAAC,KAAK;MAC/B,IAAIA,WAAW,CAAChB,KAAK,KAAKA,KAAK,EAAE;MACjC,MAAMmB,KAAK,GAAG;QACZC,IAAI,EAAEJ,WAAW,CAACI,IAAI;QACtBlB,OAAO,EAAEc,WAAW,CAACd;MACvB,CAAC;MACD,IAAIQ,OAAO,EAAEA,OAAO,CAACS,KAAK,CAAC,CAAC,KAE1BE,OAAO,CAACC,IAAI,CAAC,wBAAwBH,KAAK,CAACC,IAAI,KAAKD,KAAK,CAACjB,OAAO,EAAE,CAAC;IACxE;EAAE,CACH,CAAC;AAEN,CAAC,CAAC;AAEFN,IAAI,CAAC2B,WAAW,GAAG,aAAa","ignoreList":[]}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { assertComponentEnabled, getNativeTinyui } from "../utils/index.js";
|
|
4
4
|
import { validateTipId } from "./validation.js";
|
|
5
5
|
import { Popover } from "./Popover.js";
|
|
6
|
+
import { View } from "./View.js";
|
|
6
7
|
export const TipKit = {
|
|
7
8
|
Popover,
|
|
9
|
+
View,
|
|
8
10
|
/**
|
|
9
11
|
* Clear all persisted tip, event and parameter records for testing.
|
|
10
12
|
* Call and await this before configure(); rejects if already configured,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["assertComponentEnabled","getNativeTinyui","validateTipId","Popover","TipKit","resetDatastore","resetTipsDatastore","configure","displayFrequency","includes","Error","configureTips","invalidate","tipId","reason","invalidateTip"],"sourceRoot":"../../../src","sources":["TipKit/index.ts"],"mappings":";;AAAA,SAASA,sBAAsB,EAAEC,eAAe,QAAQ,mBAAU;AAElE,SAASC,aAAa,QAAQ,iBAAc;AAC5C,SAASC,OAAO,QAAQ,cAAW;
|
|
1
|
+
{"version":3,"names":["assertComponentEnabled","getNativeTinyui","validateTipId","Popover","View","TipKit","resetDatastore","resetTipsDatastore","configure","displayFrequency","includes","Error","configureTips","invalidate","tipId","reason","invalidateTip"],"sourceRoot":"../../../src","sources":["TipKit/index.ts"],"mappings":";;AAAA,SAASA,sBAAsB,EAAEC,eAAe,QAAQ,mBAAU;AAElE,SAASC,aAAa,QAAQ,iBAAc;AAC5C,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,IAAI,QAAQ,WAAQ;AAE7B,OAAO,MAAMC,MAAM,GAAG;EACpBF,OAAO;EACPC,IAAI;EACJ;AACF;AACA;AACA;AACA;EACE,MAAME,cAAcA,CAAA,EAAkB;IACpCN,sBAAsB,CAAC,QAAQ,CAAC;IAChC,MAAMC,eAAe,CAAC,CAAC,CAACM,kBAAkB,CAAC,CAAC;EAC9C,CAAC;EAED;EACA,MAAMC,SAASA,CAAC;IACdC,gBAAgB,GAAG;EACA,CAAC,GAAG,CAAC,CAAC,EAAiB;IAC1CT,sBAAsB,CAAC,QAAQ,CAAC;IAChC,IACE,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAACU,QAAQ,CAC7DD,gBACF,CAAC,EACD;MACA,MAAM,IAAIE,KAAK,CACb,iEACF,CAAC;IACH;IACA,MAAMV,eAAe,CAAC,CAAC,CAACW,aAAa,CAACH,gBAAgB,CAAC;EACzD,CAAC;EAED;EACA,MAAMI,UAAUA,CACdC,KAAa,EACbC,MAA6B,GAAG,iBAAiB,EAClC;IACff,sBAAsB,CAAC,QAAQ,CAAC;IAChCE,aAAa,CAACY,KAAK,CAAC;IACpB,IAAIC,MAAM,KAAK,iBAAiB,IAAIA,MAAM,KAAK,WAAW,EAAE;MAC1D,MAAM,IAAIJ,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACA,MAAMV,eAAe,CAAC,CAAC,CAACe,aAAa,CAACF,KAAK,EAAEC,MAAM,CAAC;EACtD;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,18 +5,18 @@ export function validateTipId(tipId) {
|
|
|
5
5
|
throw new Error('[TinyUI] TipKit tipId must be a nonempty string.');
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export function validateTip(props) {
|
|
8
|
+
export function validateTip(props, component = 'TipKit.Popover') {
|
|
9
9
|
validateTipId(props.tipId);
|
|
10
10
|
if (typeof props.title !== 'string' || props.title.trim().length === 0) {
|
|
11
|
-
throw new Error(
|
|
11
|
+
throw new Error(`[TinyUI] ${component} title must be a nonempty string.`);
|
|
12
12
|
}
|
|
13
13
|
if (props.maxDisplayCount !== undefined && (!Number.isInteger(props.maxDisplayCount) || props.maxDisplayCount < 1 || props.maxDisplayCount > 2147483647)) {
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error(`[TinyUI] ${component} maxDisplayCount must be a positive 32-bit integer.`);
|
|
15
15
|
}
|
|
16
16
|
const ids = new Set();
|
|
17
17
|
for (const action of props.actions ?? []) {
|
|
18
18
|
if (typeof action.id !== 'string' || action.id.trim().length === 0 || typeof action.title !== 'string' || action.title.trim().length === 0 || ids.has(action.id)) {
|
|
19
|
-
throw new Error(
|
|
19
|
+
throw new Error(`[TinyUI] ${component} actions need unique nonempty ids and nonempty titles.`);
|
|
20
20
|
}
|
|
21
21
|
ids.add(action.id);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["validateTipId","tipId","trim","length","Error","validateTip","props","title","maxDisplayCount","undefined","Number","isInteger","ids","Set","action","actions","id","has","add"],"sourceRoot":"../../../src","sources":["TipKit/validation.ts"],"mappings":";;AAEA,OAAO,SAASA,aAAaA,CAACC,KAAa,EAAQ;EACjD,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1D,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;AACF;AAEA,OAAO,SAASC,WAAWA,
|
|
1
|
+
{"version":3,"names":["validateTipId","tipId","trim","length","Error","validateTip","props","component","title","maxDisplayCount","undefined","Number","isInteger","ids","Set","action","actions","id","has","add"],"sourceRoot":"../../../src","sources":["TipKit/validation.ts"],"mappings":";;AAEA,OAAO,SAASA,aAAaA,CAACC,KAAa,EAAQ;EACjD,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1D,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;AACF;AAEA,OAAO,SAASC,WAAWA,CACzBC,KAAsB,EACtBC,SAAS,GAAG,gBAAgB,EACtB;EACNP,aAAa,CAACM,KAAK,CAACL,KAAK,CAAC;EAC1B,IAAI,OAAOK,KAAK,CAACE,KAAK,KAAK,QAAQ,IAAIF,KAAK,CAACE,KAAK,CAACN,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,EAAE;IACtE,MAAM,IAAIC,KAAK,CAAC,YAAYG,SAAS,mCAAmC,CAAC;EAC3E;EACA,IACED,KAAK,CAACG,eAAe,KAAKC,SAAS,KAClC,CAACC,MAAM,CAACC,SAAS,CAACN,KAAK,CAACG,eAAe,CAAC,IACvCH,KAAK,CAACG,eAAe,GAAG,CAAC,IACzBH,KAAK,CAACG,eAAe,GAAG,UAAU,CAAC,EACrC;IACA,MAAM,IAAIL,KAAK,CACb,YAAYG,SAAS,qDACvB,CAAC;EACH;EACA,MAAMM,GAAG,GAAG,IAAIC,GAAG,CAAS,CAAC;EAC7B,KAAK,MAAMC,MAAM,IAAIT,KAAK,CAACU,OAAO,IAAI,EAAE,EAAE;IACxC,IACE,OAAOD,MAAM,CAACE,EAAE,KAAK,QAAQ,IAC7BF,MAAM,CAACE,EAAE,CAACf,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,IAC7B,OAAOY,MAAM,CAACP,KAAK,KAAK,QAAQ,IAChCO,MAAM,CAACP,KAAK,CAACN,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC,IAChCU,GAAG,CAACK,GAAG,CAACH,MAAM,CAACE,EAAE,CAAC,EAClB;MACA,MAAM,IAAIb,KAAK,CACb,YAAYG,SAAS,wDACvB,CAAC;IACH;IACAM,GAAG,CAACM,GAAG,CAACJ,MAAM,CAACE,EAAE,CAAC;EACpB;AACF","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export { Menu } from "./Menu/index.js";
|
|
4
|
+
export { SwipeActions } from "./SwipeActions/index.js";
|
|
4
5
|
export { TipKit } from "./TipKit/index.js";
|
|
5
6
|
export { Stepper } from "./Stepper/index.js";
|
|
6
7
|
export { ConcentricView } from "./ConcentricView/index.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Menu","TipKit","Stepper","ConcentricView","SFSymbol","Popover","PopoverClose","getNativeTinyui","assertComponentEnabled","LiquidGlassText"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,iBAAQ;AAC7B,SAASC,MAAM,QAAQ,mBAAU;AAuBjC,SAASC,OAAO,QAAQ,oBAAW;AAGnC,SAASC,cAAc,QAAQ,2BAAkB;AAGjD,SAASC,QAAQ,QAAQ,qBAAY;AAWrC,SAASC,OAAO,EAAEC,YAAY,QAAQ,oBAAW;AAUjD,SAASC,eAAe,EAAEC,sBAAsB,QAAQ,kBAAS;AAGjE,SAASC,eAAe,QAAQ,4BAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Menu","SwipeActions","TipKit","Stepper","ConcentricView","SFSymbol","Popover","PopoverClose","getNativeTinyui","assertComponentEnabled","LiquidGlassText"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,iBAAQ;AAC7B,SAASC,YAAY,QAAQ,yBAAgB;AAO7C,SAASC,MAAM,QAAQ,mBAAU;AAuBjC,SAASC,OAAO,QAAQ,oBAAW;AAGnC,SAASC,cAAc,QAAQ,2BAAkB;AAGjD,SAASC,QAAQ,QAAQ,qBAAY;AAWrC,SAASC,OAAO,EAAEC,YAAY,QAAQ,oBAAW;AAUjD,SAASC,eAAe,EAAEC,sBAAsB,QAAQ,kBAAS;AAGjE,SAASC,eAAe,QAAQ,4BAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeTinyui","nativeTinyui","enabledComponents","getNativeTinyui","Error","assertComponentEnabled","component","tinyui","Set","getEnabledComponents","has"],"sourceRoot":"../../../src","sources":["utils/getNativeTinyui.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAqB,oBAAiB;
|
|
1
|
+
{"version":3,"names":["NativeTinyui","nativeTinyui","enabledComponents","getNativeTinyui","Error","assertComponentEnabled","component","tinyui","Set","getEnabledComponents","has"],"sourceRoot":"../../../src","sources":["utils/getNativeTinyui.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAqB,oBAAiB;AAYzD,IAAIC,YAAqC;AACzC,IAAIC,iBAAkD;;AAEtD;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAS;EACtCF,YAAY,KAAKD,YAAY;EAC7B,IAAIC,YAAY,IAAI,IAAI,EAAE;IACxB,MAAM,IAAIG,KAAK,CACb,sDAAsD,GACpD,8DACJ,CAAC;EACH;EACA,OAAOH,YAAY;AACrB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAACC,SAA0B,EAAQ;EACvE,MAAMC,MAAM,GAAGJ,eAAe,CAAC,CAAC;EAChCD,iBAAiB,KAAK,IAAIM,GAAG,CAACD,MAAM,CAACE,oBAAoB,CAAC,CAAC,CAAC;EAE5D,IAAI,CAACP,iBAAiB,CAACQ,GAAG,CAACJ,SAAS,CAAC,EAAE;IACrC,MAAM,IAAIF,KAAK,CACb,gBAAgBE,SAAS,+BAA+B,GACtD,QAAQA,SAAS,kDAAkD,GACnE,sCACJ,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CodegenTypes, type ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface NativeSwipeActionsProps extends ViewProps {
|
|
4
|
+
actionsConfig: CodegenTypes.UnsafeMixed;
|
|
5
|
+
edge?: CodegenTypes.WithDefault<'leading' | 'trailing', 'trailing'>;
|
|
6
|
+
allowsFullSwipe?: CodegenTypes.WithDefault<boolean, true>;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onActionPress?: DirectEventHandler<Readonly<{
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}>>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeSwipeActionsProps>;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=SwipeActionsNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwipeActionsNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/SwipeActions/SwipeActionsNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC;IACxC,IAAI,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,SAAS,GAAG,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,eAAe,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CAC7E;;AAED,wBAGE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SwipeAction } from './types.js';
|
|
2
|
+
export declare function serializeSwipeActions(actions: readonly SwipeAction[]): {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
systemImage: string | undefined;
|
|
6
|
+
tintColor: import("react-native").ProcessedColorValue | null | undefined;
|
|
7
|
+
destructive: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/SwipeActions/actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE;;;;;;IAqBpE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SwipeActionsProps } from './types.js';
|
|
2
|
+
export declare const SwipeActions: import("react").ForwardRefExoticComponent<SwipeActionsProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
3
|
+
export type { SwipeAction, SwipeActionPressEvent, SwipeActionsEdge, SwipeActionsProps, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SwipeActions/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAEjD,eAAO,MAAM,YAAY,+LAiCvB,CAAC;AAOH,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ColorValue, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
export type SwipeActionsEdge = 'leading' | 'trailing';
|
|
4
|
+
export interface SwipeAction {
|
|
5
|
+
/** Stable identifier. Defaults to `item.<index>` when omitted. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Button title and accessible action name. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** SF Symbol name. */
|
|
10
|
+
systemImage?: string;
|
|
11
|
+
/** Native action background color, including semantic and dynamic colors. */
|
|
12
|
+
tintColor?: ColorValue;
|
|
13
|
+
/** Uses the system destructive appearance. Does not remove the React row. */
|
|
14
|
+
destructive?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type SwipeActionPressEvent = Readonly<{
|
|
17
|
+
nativeEvent: Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
export interface SwipeActionsProps extends Omit<ViewProps, 'children'> {
|
|
23
|
+
/** The React Native row content. */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/** Styles the moving row, including its background, corners and padding. */
|
|
26
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
27
|
+
/** Actions ordered from the selected edge inward. */
|
|
28
|
+
actions: readonly SwipeAction[];
|
|
29
|
+
/** Logical edge; respects layout direction. Defaults to `trailing`. */
|
|
30
|
+
edge?: SwipeActionsEdge;
|
|
31
|
+
/** A full swipe performs the first action. Defaults to `true`. */
|
|
32
|
+
allowsFullSwipe?: boolean;
|
|
33
|
+
/** Disables swipe actions without disabling the row's children. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
onActionPress?: (event: SwipeActionPressEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/SwipeActions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,WAAW,EAAE,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD,CAAC,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACpE,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,4EAA4E;IAC5E,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7C,qDAAqD;IACrD,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,uEAAuE;IACvE,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/Popover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/Popover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAS,CAAC;AAG/C,eAAO,MAAM,OAAO,6LAwDnB,CAAC"}
|
|
@@ -13,15 +13,6 @@ export interface NativeTipPopoverProps extends ViewProps {
|
|
|
13
13
|
maxDisplayCount?: CodegenTypes.Int32;
|
|
14
14
|
ignoresDisplayFrequency?: boolean;
|
|
15
15
|
arrowEdge?: string;
|
|
16
|
-
onTipStatusChange?: DirectEventHandler<Readonly<{
|
|
17
|
-
tipId: string;
|
|
18
|
-
status: string;
|
|
19
|
-
reason: string;
|
|
20
|
-
}>>;
|
|
21
|
-
onTipVisibleChange?: DirectEventHandler<Readonly<{
|
|
22
|
-
tipId: string;
|
|
23
|
-
visible: boolean;
|
|
24
|
-
}>>;
|
|
25
16
|
onTipAction?: DirectEventHandler<Readonly<{
|
|
26
17
|
tipId: string;
|
|
27
18
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TipPopoverNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/TipPopoverNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"TipPopoverNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/TipPopoverNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAC9B,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CACvD,CAAC;IACF,UAAU,CAAC,EAAE,kBAAkB,CAC7B,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAC3D,CAAC;CACH;;AAED,wBAKE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CodegenTypes, type ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface NativeTipViewProps extends ViewProps {
|
|
4
|
+
tipId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
systemImage?: string;
|
|
8
|
+
actions?: ReadonlyArray<Readonly<{
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}>>;
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
maxDisplayCount?: CodegenTypes.Int32;
|
|
14
|
+
ignoresDisplayFrequency?: boolean;
|
|
15
|
+
arrowEdge?: string;
|
|
16
|
+
onTipAction?: DirectEventHandler<Readonly<{
|
|
17
|
+
tipId: string;
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}>>;
|
|
21
|
+
onTipError?: DirectEventHandler<Readonly<{
|
|
22
|
+
tipId: string;
|
|
23
|
+
code: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}>>;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeTipViewProps>;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=TipViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TipViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/TipViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAC9B,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CACvD,CAAC;IACF,UAAU,CAAC,EAAE,kBAAkB,CAC7B,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAC3D,CAAC;CACH;;AAED,wBAEG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TipViewProps } from './types.js';
|
|
2
|
+
export declare const View: import("react").ForwardRefExoticComponent<TipViewProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
3
|
+
//# sourceMappingURL=View.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/View.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAS,CAAC;AAG5C,eAAO,MAAM,IAAI,0LAqDf,CAAC"}
|