panelui-native 0.108.0 → 0.110.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 (95) hide show
  1. package/lib/module/components/avatar-cropper/avatar-cropper-math.js +320 -0
  2. package/lib/module/components/avatar-cropper/avatar-cropper-math.js.map +1 -0
  3. package/lib/module/components/avatar-cropper/index.js +656 -0
  4. package/lib/module/components/avatar-cropper/index.js.map +1 -0
  5. package/lib/module/components/badge/index.js +85 -4
  6. package/lib/module/components/badge/index.js.map +1 -1
  7. package/lib/module/components/button/index.js +12 -0
  8. package/lib/module/components/button/index.js.map +1 -1
  9. package/lib/module/components/button-group/index.js +3 -0
  10. package/lib/module/components/button-group/index.js.map +1 -1
  11. package/lib/module/components/checkbox/index.js +54 -4
  12. package/lib/module/components/checkbox/index.js.map +1 -1
  13. package/lib/module/components/chip/index.js +23 -1
  14. package/lib/module/components/chip/index.js.map +1 -1
  15. package/lib/module/components/input/index.js +14 -0
  16. package/lib/module/components/input/index.js.map +1 -1
  17. package/lib/module/components/map/index.js +157 -5
  18. package/lib/module/components/map/index.js.map +1 -1
  19. package/lib/module/components/map/map-insets.js +174 -0
  20. package/lib/module/components/map/map-insets.js.map +1 -0
  21. package/lib/module/components/radio-group/index.js +49 -3
  22. package/lib/module/components/radio-group/index.js.map +1 -1
  23. package/lib/module/components/select/index.js +54 -2
  24. package/lib/module/components/select/index.js.map +1 -1
  25. package/lib/module/components/switch/index.js +42 -3
  26. package/lib/module/components/switch/index.js.map +1 -1
  27. package/lib/module/components/tabs/index.js +147 -1
  28. package/lib/module/components/tabs/index.js.map +1 -1
  29. package/lib/module/components/textarea/index.js +18 -0
  30. package/lib/module/components/textarea/index.js.map +1 -1
  31. package/lib/module/components/toggle-button/index.js +34 -2
  32. package/lib/module/components/toggle-button/index.js.map +1 -1
  33. package/lib/module/icons/index.js +6 -0
  34. package/lib/module/icons/index.js.map +1 -1
  35. package/lib/module/index.js +1 -0
  36. package/lib/module/index.js.map +1 -1
  37. package/lib/module/providers/panel-ui-provider.js +22 -10
  38. package/lib/module/providers/panel-ui-provider.js.map +1 -1
  39. package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts +98 -0
  40. package/lib/typescript/src/components/avatar-cropper/avatar-cropper-math.d.ts.map +1 -0
  41. package/lib/typescript/src/components/avatar-cropper/index.d.ts +168 -0
  42. package/lib/typescript/src/components/avatar-cropper/index.d.ts.map +1 -0
  43. package/lib/typescript/src/components/badge/index.d.ts +68 -0
  44. package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
  45. package/lib/typescript/src/components/button/index.d.ts +12 -0
  46. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  47. package/lib/typescript/src/components/button-group/index.d.ts +9 -0
  48. package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
  49. package/lib/typescript/src/components/checkbox/index.d.ts +89 -0
  50. package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
  51. package/lib/typescript/src/components/chip/index.d.ts +24 -0
  52. package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
  53. package/lib/typescript/src/components/input/index.d.ts +30 -0
  54. package/lib/typescript/src/components/input/index.d.ts.map +1 -1
  55. package/lib/typescript/src/components/map/index.d.ts +67 -1
  56. package/lib/typescript/src/components/map/index.d.ts.map +1 -1
  57. package/lib/typescript/src/components/map/map-insets.d.ts +80 -0
  58. package/lib/typescript/src/components/map/map-insets.d.ts.map +1 -0
  59. package/lib/typescript/src/components/radio-group/index.d.ts +188 -1
  60. package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
  61. package/lib/typescript/src/components/select/index.d.ts +9 -1
  62. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  63. package/lib/typescript/src/components/switch/index.d.ts +38 -0
  64. package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
  65. package/lib/typescript/src/components/tabs/index.d.ts +10 -1
  66. package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
  67. package/lib/typescript/src/components/textarea/index.d.ts +18 -0
  68. package/lib/typescript/src/components/textarea/index.d.ts.map +1 -1
  69. package/lib/typescript/src/components/toggle-button/index.d.ts +24 -0
  70. package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
  71. package/lib/typescript/src/icons/index.d.ts +2 -0
  72. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  73. package/lib/typescript/src/index.d.ts +8 -7
  74. package/lib/typescript/src/index.d.ts.map +1 -1
  75. package/lib/typescript/src/providers/panel-ui-provider.d.ts.map +1 -1
  76. package/package.json +9 -1
  77. package/src/components/avatar-cropper/avatar-cropper-math.ts +311 -0
  78. package/src/components/avatar-cropper/index.tsx +808 -0
  79. package/src/components/badge/index.tsx +30 -4
  80. package/src/components/button/index.tsx +9 -2
  81. package/src/components/button-group/index.tsx +1 -0
  82. package/src/components/checkbox/index.tsx +47 -3
  83. package/src/components/chip/index.tsx +5 -1
  84. package/src/components/input/index.tsx +6 -0
  85. package/src/components/map/index.tsx +215 -5
  86. package/src/components/map/map-insets.ts +169 -0
  87. package/src/components/radio-group/index.tsx +56 -4
  88. package/src/components/select/index.tsx +50 -1
  89. package/src/components/switch/index.tsx +16 -4
  90. package/src/components/tabs/index.tsx +61 -0
  91. package/src/components/textarea/index.tsx +6 -0
  92. package/src/components/toggle-button/index.tsx +16 -1
  93. package/src/icons/index.tsx +3 -0
  94. package/src/index.ts +24 -3
  95. package/src/providers/panel-ui-provider.tsx +21 -11
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The geometry behind the avatar cropper, kept apart from the component.
5
+ *
6
+ * The mask stays fixed in the middle of the canvas and the photo moves under
7
+ * it, so everything here is one question asked different ways: where is the
8
+ * mask, measured in the photo's own frame? Clamping asks it to keep the mask
9
+ * on the photo, and the export asks it to find the same square in the photo's
10
+ * pixels.
11
+ *
12
+ * The photo is drawn at a base size whose short side equals the mask, then
13
+ * moved by `x`/`y`, turned by `rotation` and scaled by `scale` about its own
14
+ * centre — the order React Native applies `translate`, `rotate`, `scale` in a
15
+ * transform. Every function runs on the UI thread inside a gesture or an
16
+ * animated style, so each is a worklet, and none touches React Native, which
17
+ * is what lets the contract tests run them in Node.
18
+ */
19
+
20
+ /** Where the photo sits under the mask. Rotation is in degrees, clockwise. */
21
+
22
+ /** The fixed parts: the mask's side, and the photo's size at a scale of 1. */
23
+
24
+ /** A crop in the source's pixels, after the source is turned by `rotation`. */
25
+
26
+ export const IDENTITY = {
27
+ x: 0,
28
+ y: 0,
29
+ scale: 1,
30
+ rotation: 0
31
+ };
32
+
33
+ /** How much a rubber-banded overshoot gives. Lower is stiffer. */
34
+ const RUBBER_BAND = 0.55;
35
+
36
+ /** Below this a sine or cosine is taken as zero, so a quarter turn is exact. */
37
+ const EPSILON = 1e-9;
38
+ export function clamp(value, min, max) {
39
+ 'worklet';
40
+
41
+ return Math.min(Math.max(value, min), max);
42
+ }
43
+ function trig(degrees) {
44
+ 'worklet';
45
+
46
+ const radians = degrees * Math.PI / 180;
47
+ let cos = Math.cos(radians);
48
+ let sin = Math.sin(radians);
49
+ if (Math.abs(cos) < EPSILON) cos = 0;
50
+ if (Math.abs(sin) < EPSILON) sin = 0;
51
+ return {
52
+ cos,
53
+ sin
54
+ };
55
+ }
56
+
57
+ /** An angle folded into (-180, 180]. */
58
+ export function normalizeDegrees(degrees) {
59
+ 'worklet';
60
+
61
+ let folded = degrees % 360;
62
+ if (folded <= -180) folded += 360;
63
+ if (folded > 180) folded -= 360;
64
+ return folded;
65
+ }
66
+
67
+ /** The photo's size at a scale of 1: its short side exactly covers the mask. */
68
+ export function baseSize(source, mask) {
69
+ 'worklet';
70
+
71
+ const shortSide = Math.min(source.width, source.height);
72
+ if (shortSide <= 0 || mask <= 0) return {
73
+ width: mask,
74
+ height: mask
75
+ };
76
+ const factor = mask / shortSide;
77
+ return {
78
+ width: source.width * factor,
79
+ height: source.height * factor
80
+ };
81
+ }
82
+
83
+ /**
84
+ * Half the mask's extent along the photo's axes, in screen points.
85
+ *
86
+ * A circle reaches the same distance whichever way the photo is turned. A
87
+ * square turned against the photo reaches further — out to its corners — and
88
+ * the squircle is held to its square, which contains it, so its corners can
89
+ * never come off the photo either.
90
+ */
91
+ export function maskReach(shape, mask, rotation) {
92
+ 'worklet';
93
+
94
+ const half = mask / 2;
95
+ if (shape === 'circle') return half;
96
+ const {
97
+ cos,
98
+ sin
99
+ } = trig(rotation);
100
+ return half * (Math.abs(cos) + Math.abs(sin));
101
+ }
102
+
103
+ /** The smallest scale at which the photo still covers the whole mask. */
104
+ export function minScale(shape, rotation) {
105
+ 'worklet';
106
+
107
+ // The base size's short side is the mask, so covering the reach on the
108
+ // short side covers it on the long one too.
109
+ return maskReach(shape, 2, rotation);
110
+ }
111
+
112
+ /** Screen offset → the same offset along the photo's axes, and back. */
113
+ function toImageAxes(x, y, rotation) {
114
+ 'worklet';
115
+
116
+ const {
117
+ cos,
118
+ sin
119
+ } = trig(rotation);
120
+ return {
121
+ u: cos * x + sin * y,
122
+ v: -sin * x + cos * y
123
+ };
124
+ }
125
+ function fromImageAxes(u, v, rotation) {
126
+ 'worklet';
127
+
128
+ const {
129
+ cos,
130
+ sin
131
+ } = trig(rotation);
132
+ return {
133
+ x: cos * u - sin * v,
134
+ y: sin * u + cos * v
135
+ };
136
+ }
137
+
138
+ /**
139
+ * How far the photo can move along each of its own axes before the mask
140
+ * reaches its edge. Zero when the photo is too small to move at all.
141
+ */
142
+ function travel(state, shape, frame) {
143
+ 'worklet';
144
+
145
+ const reach = maskReach(shape, frame.mask, state.rotation);
146
+ return {
147
+ u: Math.max(0, state.scale * frame.image.width / 2 - reach),
148
+ v: Math.max(0, state.scale * frame.image.height / 2 - reach)
149
+ };
150
+ }
151
+
152
+ /** The nearest translation that keeps the mask on the photo. */
153
+ export function clampTranslation(state, shape, frame) {
154
+ 'worklet';
155
+
156
+ const limit = travel(state, shape, frame);
157
+ const along = toImageAxes(state.x, state.y, state.rotation);
158
+ return fromImageAxes(clamp(along.u, -limit.u, limit.u), clamp(along.v, -limit.v, limit.v), state.rotation);
159
+ }
160
+
161
+ /** The state a gesture settles into: in range, and covering the mask. */
162
+ export function settle(state, shape, frame, maxZoom) {
163
+ 'worklet';
164
+
165
+ const lowest = minScale(shape, state.rotation);
166
+ const scale = clamp(state.scale, lowest, Math.max(lowest, maxZoom));
167
+ const next = {
168
+ ...state,
169
+ scale
170
+ };
171
+ return {
172
+ ...next,
173
+ ...clampTranslation(next, shape, frame)
174
+ };
175
+ }
176
+
177
+ /** An overshoot past a bound, compressed so it gives but never runs away. */
178
+ export function rubberBand(overshoot, dimension) {
179
+ 'worklet';
180
+
181
+ if (dimension <= 0) return 0;
182
+ const sign = overshoot < 0 ? -1 : 1;
183
+ const distance = Math.abs(overshoot);
184
+ return sign * (1 - 1 / (distance * RUBBER_BAND / dimension + 1)) * dimension;
185
+ }
186
+
187
+ /**
188
+ * What to draw while a gesture is still going: the raw state, with anything
189
+ * past a bound rubber-banded back towards it. At rest the raw state is already
190
+ * settled and this returns it unchanged.
191
+ */
192
+ export function present(state, shape, frame, maxZoom) {
193
+ 'worklet';
194
+
195
+ const lowest = minScale(shape, state.rotation);
196
+ const highest = Math.max(lowest, maxZoom);
197
+ let scale = state.scale;
198
+ if (scale < lowest) scale = lowest - rubberBand(lowest - scale, lowest / 2);else if (scale > highest) scale = highest + rubberBand(scale - highest, highest / 2);
199
+ const next = {
200
+ ...state,
201
+ scale
202
+ };
203
+ const limit = travel(next, shape, frame);
204
+ const along = toImageAxes(state.x, state.y, state.rotation);
205
+ const u = clamp(along.u, -limit.u, limit.u);
206
+ const v = clamp(along.v, -limit.v, limit.v);
207
+ const offset = fromImageAxes(u + rubberBand(along.u - u, frame.mask), v + rubberBand(along.v - v, frame.mask), state.rotation);
208
+ return {
209
+ ...next,
210
+ ...offset
211
+ };
212
+ }
213
+
214
+ /** Scale by `factor` about a point, given relative to the canvas centre. */
215
+ export function zoomAbout(state, factor, fx, fy) {
216
+ 'worklet';
217
+
218
+ return {
219
+ ...state,
220
+ scale: state.scale * factor,
221
+ x: fx + (state.x - fx) * factor,
222
+ y: fy + (state.y - fy) * factor
223
+ };
224
+ }
225
+
226
+ /** Turn by `degrees` about a point, given relative to the canvas centre. */
227
+ export function rotateAbout(state, degrees, ax, ay) {
228
+ 'worklet';
229
+
230
+ const {
231
+ cos,
232
+ sin
233
+ } = trig(degrees);
234
+ const dx = state.x - ax;
235
+ const dy = state.y - ay;
236
+ return {
237
+ ...state,
238
+ rotation: state.rotation + degrees,
239
+ x: ax + cos * dx - sin * dy,
240
+ y: ay + sin * dx + cos * dy
241
+ };
242
+ }
243
+
244
+ /** The next quarter turn from wherever the photo is, in either direction. */
245
+ export function nextQuarterTurn(rotation, direction) {
246
+ 'worklet';
247
+
248
+ const quarters = rotation / 90;
249
+ const nearest = Math.round(quarters);
250
+ // Already on a quarter turn: step a whole one. Part way: finish this one.
251
+ const onQuarter = Math.abs(quarters - nearest) < 1e-6;
252
+ const base = onQuarter ? nearest : direction > 0 ? Math.floor(quarters) : Math.ceil(quarters);
253
+ return (base + direction) * 90;
254
+ }
255
+
256
+ /**
257
+ * The square the mask covers, in the source's pixels.
258
+ *
259
+ * The export turns the source first and cuts an upright square from the
260
+ * result, because a turned square cannot be cut directly. Turning grows the
261
+ * canvas to the turned image's bounding box with the image still centred, and
262
+ * a point at `p` from the source's centre lands at `R(θ)·p` from the canvas
263
+ * centre. The mask's centre sits at `R(−θ)·(−x, −y) / scale` in the photo, so
264
+ * after the turn it lands at `−(x, y) / scale` — the rotation cancels, and the
265
+ * crop is the mask's offset scaled into pixels.
266
+ */
267
+ export function sourceCrop(state, frame, source) {
268
+ 'worklet';
269
+
270
+ const rotation = normalizeDegrees(state.rotation);
271
+ const {
272
+ cos,
273
+ sin
274
+ } = trig(rotation);
275
+ // Both platforms round the turned canvas down to whole pixels.
276
+ const canvas = {
277
+ width: Math.floor(Math.abs(source.width * cos) + Math.abs(source.height * sin) + 1e-6),
278
+ height: Math.floor(Math.abs(source.width * sin) + Math.abs(source.height * cos) + 1e-6)
279
+ };
280
+ // Screen points per source pixel, at the current scale.
281
+ const pointsPerPixel = frame.image.width / source.width * state.scale;
282
+ const side = Math.max(1, Math.min(Math.floor(frame.mask / pointsPerPixel), canvas.width, canvas.height));
283
+ const centreX = canvas.width / 2 - state.x / pointsPerPixel;
284
+ const centreY = canvas.height / 2 - state.y / pointsPerPixel;
285
+ return {
286
+ originX: clamp(Math.round(centreX - side / 2), 0, canvas.width - side),
287
+ originY: clamp(Math.round(centreY - side / 2), 0, canvas.height - side),
288
+ width: side,
289
+ height: side,
290
+ rotation,
291
+ canvas
292
+ };
293
+ }
294
+
295
+ /** Superellipse exponent for the squircle. Four is soft; five reads as an app icon. */
296
+ const SQUIRCLE_EXPONENT = 5;
297
+ const SQUIRCLE_STEPS = 128;
298
+
299
+ /** The mask's outline as an SVG path, centred on (`cx`, `cy`). */
300
+ export function maskPath(shape, cx, cy, mask) {
301
+ const r = mask / 2;
302
+ if (shape === 'square') {
303
+ return `M${cx - r} ${cy - r}H${cx + r}V${cy + r}H${cx - r}Z`;
304
+ }
305
+ if (shape === 'circle') {
306
+ return `M${cx - r} ${cy}A${r} ${r} 0 1 0 ${cx + r} ${cy}A${r} ${r} 0 1 0 ${cx - r} ${cy}Z`;
307
+ }
308
+ const exponent = 2 / SQUIRCLE_EXPONENT;
309
+ let path = '';
310
+ for (let step = 0; step < SQUIRCLE_STEPS; step += 1) {
311
+ const t = step / SQUIRCLE_STEPS * Math.PI * 2;
312
+ const cos = Math.cos(t);
313
+ const sin = Math.sin(t);
314
+ const x = cx + r * Math.sign(cos) * Math.abs(cos) ** exponent;
315
+ const y = cy + r * Math.sign(sin) * Math.abs(sin) ** exponent;
316
+ path += `${step === 0 ? 'M' : 'L'}${x.toFixed(2)} ${y.toFixed(2)}`;
317
+ }
318
+ return `${path}Z`;
319
+ }
320
+ //# sourceMappingURL=avatar-cropper-math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IDENTITY","x","y","scale","rotation","RUBBER_BAND","EPSILON","clamp","value","min","max","Math","trig","degrees","radians","PI","cos","sin","abs","normalizeDegrees","folded","baseSize","source","mask","shortSide","width","height","factor","maskReach","shape","half","minScale","toImageAxes","u","v","fromImageAxes","travel","state","frame","reach","image","clampTranslation","limit","along","settle","maxZoom","lowest","next","rubberBand","overshoot","dimension","sign","distance","present","highest","offset","zoomAbout","fx","fy","rotateAbout","ax","ay","dx","dy","nextQuarterTurn","direction","quarters","nearest","round","onQuarter","base","floor","ceil","sourceCrop","canvas","pointsPerPixel","side","centreX","centreY","originX","originY","SQUIRCLE_EXPONENT","SQUIRCLE_STEPS","maskPath","cx","cy","r","exponent","path","step","t","toFixed"],"sourceRoot":"../../../../src","sources":["components/avatar-cropper/avatar-cropper-math.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;;AAQA;;AAMA;;AAaA,OAAO,MAAMA,QAAmB,GAAG;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,KAAK,EAAE,CAAC;EAAEC,QAAQ,EAAE;AAAE,CAAC;;AAExE;AACA,MAAMC,WAAW,GAAG,IAAI;;AAExB;AACA,MAAMC,OAAO,GAAG,IAAI;AAEpB,OAAO,SAASC,KAAKA,CAACC,KAAa,EAAEC,GAAW,EAAEC,GAAW,EAAU;EACrE,SAAS;;EACT,OAAOC,IAAI,CAACF,GAAG,CAACE,IAAI,CAACD,GAAG,CAACF,KAAK,EAAEC,GAAG,CAAC,EAAEC,GAAG,CAAC;AAC5C;AAEA,SAASE,IAAIA,CAACC,OAAe,EAAgC;EAC3D,SAAS;;EACT,MAAMC,OAAO,GAAID,OAAO,GAAGF,IAAI,CAACI,EAAE,GAAI,GAAG;EACzC,IAAIC,GAAG,GAAGL,IAAI,CAACK,GAAG,CAACF,OAAO,CAAC;EAC3B,IAAIG,GAAG,GAAGN,IAAI,CAACM,GAAG,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