@hai3/studio 0.2.0-alpha.0 → 0.3.0-alpha.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 +2 -2
- package/dist/index.cjs +70 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +50 -46
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -101,8 +101,8 @@ Studio provides full localization for 36 languages including English, Spanish, F
|
|
|
101
101
|
Requires the following packages:
|
|
102
102
|
|
|
103
103
|
- `@hai3/uicore` - Core framework for state management and events
|
|
104
|
-
- `react` ^
|
|
105
|
-
- `react-dom` ^
|
|
104
|
+
- `react` ^19.2.4 - React library
|
|
105
|
+
- `react-dom` ^19.2.4 - React DOM renderer
|
|
106
106
|
|
|
107
107
|
## Browser Compatibility
|
|
108
108
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React3 = require('react');
|
|
4
4
|
var react = require('@hai3/react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var uikit = require('@hai3/uikit');
|
|
@@ -8,7 +8,7 @@ var lodash = require('lodash');
|
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
12
12
|
|
|
13
13
|
var __create = Object.create;
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
|
|
39
39
|
// src/i18n/en.json
|
|
40
40
|
var require_en = __commonJS({
|
|
41
|
-
"src/i18n/en.json"(exports, module) {
|
|
41
|
+
"src/i18n/en.json"(exports$1, module) {
|
|
42
42
|
module.exports = {
|
|
43
43
|
title: "HAI3 Studio",
|
|
44
44
|
aria: {
|
|
@@ -59,7 +59,7 @@ var require_en = __commonJS({
|
|
|
59
59
|
|
|
60
60
|
// src/i18n/ar.json
|
|
61
61
|
var require_ar = __commonJS({
|
|
62
|
-
"src/i18n/ar.json"(exports, module) {
|
|
62
|
+
"src/i18n/ar.json"(exports$1, module) {
|
|
63
63
|
module.exports = {
|
|
64
64
|
title: "\u0623\u062F\u0648\u0627\u062A \u062A\u0637\u0648\u064A\u0631 HAI3",
|
|
65
65
|
aria: {
|
|
@@ -80,7 +80,7 @@ var require_ar = __commonJS({
|
|
|
80
80
|
|
|
81
81
|
// src/i18n/bn.json
|
|
82
82
|
var require_bn = __commonJS({
|
|
83
|
-
"src/i18n/bn.json"(exports, module) {
|
|
83
|
+
"src/i18n/bn.json"(exports$1, module) {
|
|
84
84
|
module.exports = {
|
|
85
85
|
title: "HAI3 \u09A1\u09C7\u09AD\u09C7\u09B2\u09AA\u09AE\u09C7\u09A8\u09CD\u099F \u099F\u09C1\u09B2\u09B8",
|
|
86
86
|
aria: {
|
|
@@ -101,7 +101,7 @@ var require_bn = __commonJS({
|
|
|
101
101
|
|
|
102
102
|
// src/i18n/cs.json
|
|
103
103
|
var require_cs = __commonJS({
|
|
104
|
-
"src/i18n/cs.json"(exports, module) {
|
|
104
|
+
"src/i18n/cs.json"(exports$1, module) {
|
|
105
105
|
module.exports = {
|
|
106
106
|
title: "V\xFDvoj\xE1\u0159sk\xE9 n\xE1stroje HAI3",
|
|
107
107
|
aria: {
|
|
@@ -122,7 +122,7 @@ var require_cs = __commonJS({
|
|
|
122
122
|
|
|
123
123
|
// src/i18n/da.json
|
|
124
124
|
var require_da = __commonJS({
|
|
125
|
-
"src/i18n/da.json"(exports, module) {
|
|
125
|
+
"src/i18n/da.json"(exports$1, module) {
|
|
126
126
|
module.exports = {
|
|
127
127
|
title: "HAI3 Udviklingsv\xE6rkt\xF8jer",
|
|
128
128
|
aria: {
|
|
@@ -143,7 +143,7 @@ var require_da = __commonJS({
|
|
|
143
143
|
|
|
144
144
|
// src/i18n/de.json
|
|
145
145
|
var require_de = __commonJS({
|
|
146
|
-
"src/i18n/de.json"(exports, module) {
|
|
146
|
+
"src/i18n/de.json"(exports$1, module) {
|
|
147
147
|
module.exports = {
|
|
148
148
|
title: "HAI3 Entwicklerwerkzeuge",
|
|
149
149
|
aria: {
|
|
@@ -164,7 +164,7 @@ var require_de = __commonJS({
|
|
|
164
164
|
|
|
165
165
|
// src/i18n/el.json
|
|
166
166
|
var require_el = __commonJS({
|
|
167
|
-
"src/i18n/el.json"(exports, module) {
|
|
167
|
+
"src/i18n/el.json"(exports$1, module) {
|
|
168
168
|
module.exports = {
|
|
169
169
|
title: "\u0395\u03C1\u03B3\u03B1\u03BB\u03B5\u03AF\u03B1 \u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7\u03C2 HAI3",
|
|
170
170
|
aria: {
|
|
@@ -185,7 +185,7 @@ var require_el = __commonJS({
|
|
|
185
185
|
|
|
186
186
|
// src/i18n/es.json
|
|
187
187
|
var require_es = __commonJS({
|
|
188
|
-
"src/i18n/es.json"(exports, module) {
|
|
188
|
+
"src/i18n/es.json"(exports$1, module) {
|
|
189
189
|
module.exports = {
|
|
190
190
|
title: "Herramientas de Desarrollo HAI3",
|
|
191
191
|
aria: {
|
|
@@ -206,7 +206,7 @@ var require_es = __commonJS({
|
|
|
206
206
|
|
|
207
207
|
// src/i18n/fa.json
|
|
208
208
|
var require_fa = __commonJS({
|
|
209
|
-
"src/i18n/fa.json"(exports, module) {
|
|
209
|
+
"src/i18n/fa.json"(exports$1, module) {
|
|
210
210
|
module.exports = {
|
|
211
211
|
title: "\u0627\u0628\u0632\u0627\u0631\u0647\u0627\u06CC \u062A\u0648\u0633\u0639\u0647 HAI3",
|
|
212
212
|
aria: {
|
|
@@ -227,7 +227,7 @@ var require_fa = __commonJS({
|
|
|
227
227
|
|
|
228
228
|
// src/i18n/fi.json
|
|
229
229
|
var require_fi = __commonJS({
|
|
230
|
-
"src/i18n/fi.json"(exports, module) {
|
|
230
|
+
"src/i18n/fi.json"(exports$1, module) {
|
|
231
231
|
module.exports = {
|
|
232
232
|
title: "HAI3 Kehitysty\xF6kalut",
|
|
233
233
|
aria: {
|
|
@@ -248,7 +248,7 @@ var require_fi = __commonJS({
|
|
|
248
248
|
|
|
249
249
|
// src/i18n/fr.json
|
|
250
250
|
var require_fr = __commonJS({
|
|
251
|
-
"src/i18n/fr.json"(exports, module) {
|
|
251
|
+
"src/i18n/fr.json"(exports$1, module) {
|
|
252
252
|
module.exports = {
|
|
253
253
|
title: "Outils de D\xE9veloppement HAI3",
|
|
254
254
|
aria: {
|
|
@@ -269,7 +269,7 @@ var require_fr = __commonJS({
|
|
|
269
269
|
|
|
270
270
|
// src/i18n/he.json
|
|
271
271
|
var require_he = __commonJS({
|
|
272
|
-
"src/i18n/he.json"(exports, module) {
|
|
272
|
+
"src/i18n/he.json"(exports$1, module) {
|
|
273
273
|
module.exports = {
|
|
274
274
|
title: "\u05DB\u05DC\u05D9 \u05E4\u05D9\u05EA\u05D5\u05D7 HAI3",
|
|
275
275
|
aria: {
|
|
@@ -290,7 +290,7 @@ var require_he = __commonJS({
|
|
|
290
290
|
|
|
291
291
|
// src/i18n/hi.json
|
|
292
292
|
var require_hi = __commonJS({
|
|
293
|
-
"src/i18n/hi.json"(exports, module) {
|
|
293
|
+
"src/i18n/hi.json"(exports$1, module) {
|
|
294
294
|
module.exports = {
|
|
295
295
|
title: "HAI3 \u0921\u0947\u0935\u0932\u092A\u092E\u0947\u0902\u091F \u091F\u0942\u0932\u094D\u0938",
|
|
296
296
|
aria: {
|
|
@@ -311,7 +311,7 @@ var require_hi = __commonJS({
|
|
|
311
311
|
|
|
312
312
|
// src/i18n/hu.json
|
|
313
313
|
var require_hu = __commonJS({
|
|
314
|
-
"src/i18n/hu.json"(exports, module) {
|
|
314
|
+
"src/i18n/hu.json"(exports$1, module) {
|
|
315
315
|
module.exports = {
|
|
316
316
|
title: "HAI3 Fejleszt\u0151i Eszk\xF6z\xF6k",
|
|
317
317
|
aria: {
|
|
@@ -332,7 +332,7 @@ var require_hu = __commonJS({
|
|
|
332
332
|
|
|
333
333
|
// src/i18n/id.json
|
|
334
334
|
var require_id = __commonJS({
|
|
335
|
-
"src/i18n/id.json"(exports, module) {
|
|
335
|
+
"src/i18n/id.json"(exports$1, module) {
|
|
336
336
|
module.exports = {
|
|
337
337
|
title: "Alat Pengembangan HAI3",
|
|
338
338
|
aria: {
|
|
@@ -353,7 +353,7 @@ var require_id = __commonJS({
|
|
|
353
353
|
|
|
354
354
|
// src/i18n/it.json
|
|
355
355
|
var require_it = __commonJS({
|
|
356
|
-
"src/i18n/it.json"(exports, module) {
|
|
356
|
+
"src/i18n/it.json"(exports$1, module) {
|
|
357
357
|
module.exports = {
|
|
358
358
|
title: "Strumenti di Sviluppo HAI3",
|
|
359
359
|
aria: {
|
|
@@ -374,7 +374,7 @@ var require_it = __commonJS({
|
|
|
374
374
|
|
|
375
375
|
// src/i18n/ja.json
|
|
376
376
|
var require_ja = __commonJS({
|
|
377
|
-
"src/i18n/ja.json"(exports, module) {
|
|
377
|
+
"src/i18n/ja.json"(exports$1, module) {
|
|
378
378
|
module.exports = {
|
|
379
379
|
title: "HAI3 \u958B\u767A\u30C4\u30FC\u30EB",
|
|
380
380
|
aria: {
|
|
@@ -395,7 +395,7 @@ var require_ja = __commonJS({
|
|
|
395
395
|
|
|
396
396
|
// src/i18n/ko.json
|
|
397
397
|
var require_ko = __commonJS({
|
|
398
|
-
"src/i18n/ko.json"(exports, module) {
|
|
398
|
+
"src/i18n/ko.json"(exports$1, module) {
|
|
399
399
|
module.exports = {
|
|
400
400
|
title: "HAI3 \uAC1C\uBC1C \uB3C4\uAD6C",
|
|
401
401
|
aria: {
|
|
@@ -416,7 +416,7 @@ var require_ko = __commonJS({
|
|
|
416
416
|
|
|
417
417
|
// src/i18n/ms.json
|
|
418
418
|
var require_ms = __commonJS({
|
|
419
|
-
"src/i18n/ms.json"(exports, module) {
|
|
419
|
+
"src/i18n/ms.json"(exports$1, module) {
|
|
420
420
|
module.exports = {
|
|
421
421
|
title: "Alat Pembangun HAI3",
|
|
422
422
|
aria: {
|
|
@@ -437,7 +437,7 @@ var require_ms = __commonJS({
|
|
|
437
437
|
|
|
438
438
|
// src/i18n/nl.json
|
|
439
439
|
var require_nl = __commonJS({
|
|
440
|
-
"src/i18n/nl.json"(exports, module) {
|
|
440
|
+
"src/i18n/nl.json"(exports$1, module) {
|
|
441
441
|
module.exports = {
|
|
442
442
|
title: "HAI3 Ontwikkeltools",
|
|
443
443
|
aria: {
|
|
@@ -458,7 +458,7 @@ var require_nl = __commonJS({
|
|
|
458
458
|
|
|
459
459
|
// src/i18n/no.json
|
|
460
460
|
var require_no = __commonJS({
|
|
461
|
-
"src/i18n/no.json"(exports, module) {
|
|
461
|
+
"src/i18n/no.json"(exports$1, module) {
|
|
462
462
|
module.exports = {
|
|
463
463
|
title: "HAI3 Utviklingsverkt\xF8y",
|
|
464
464
|
aria: {
|
|
@@ -479,7 +479,7 @@ var require_no = __commonJS({
|
|
|
479
479
|
|
|
480
480
|
// src/i18n/pl.json
|
|
481
481
|
var require_pl = __commonJS({
|
|
482
|
-
"src/i18n/pl.json"(exports, module) {
|
|
482
|
+
"src/i18n/pl.json"(exports$1, module) {
|
|
483
483
|
module.exports = {
|
|
484
484
|
title: "Narz\u0119dzia programistyczne HAI3",
|
|
485
485
|
aria: {
|
|
@@ -500,7 +500,7 @@ var require_pl = __commonJS({
|
|
|
500
500
|
|
|
501
501
|
// src/i18n/pt.json
|
|
502
502
|
var require_pt = __commonJS({
|
|
503
|
-
"src/i18n/pt.json"(exports, module) {
|
|
503
|
+
"src/i18n/pt.json"(exports$1, module) {
|
|
504
504
|
module.exports = {
|
|
505
505
|
title: "Ferramentas de Desenvolvimento HAI3",
|
|
506
506
|
aria: {
|
|
@@ -521,7 +521,7 @@ var require_pt = __commonJS({
|
|
|
521
521
|
|
|
522
522
|
// src/i18n/ro.json
|
|
523
523
|
var require_ro = __commonJS({
|
|
524
|
-
"src/i18n/ro.json"(exports, module) {
|
|
524
|
+
"src/i18n/ro.json"(exports$1, module) {
|
|
525
525
|
module.exports = {
|
|
526
526
|
title: "Instrumente de Dezvoltare HAI3",
|
|
527
527
|
aria: {
|
|
@@ -542,7 +542,7 @@ var require_ro = __commonJS({
|
|
|
542
542
|
|
|
543
543
|
// src/i18n/ru.json
|
|
544
544
|
var require_ru = __commonJS({
|
|
545
|
-
"src/i18n/ru.json"(exports, module) {
|
|
545
|
+
"src/i18n/ru.json"(exports$1, module) {
|
|
546
546
|
module.exports = {
|
|
547
547
|
title: "\u0418\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u044B \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u043A\u0438 HAI3",
|
|
548
548
|
aria: {
|
|
@@ -563,7 +563,7 @@ var require_ru = __commonJS({
|
|
|
563
563
|
|
|
564
564
|
// src/i18n/sv.json
|
|
565
565
|
var require_sv = __commonJS({
|
|
566
|
-
"src/i18n/sv.json"(exports, module) {
|
|
566
|
+
"src/i18n/sv.json"(exports$1, module) {
|
|
567
567
|
module.exports = {
|
|
568
568
|
title: "HAI3 Utvecklingsverktyg",
|
|
569
569
|
aria: {
|
|
@@ -584,7 +584,7 @@ var require_sv = __commonJS({
|
|
|
584
584
|
|
|
585
585
|
// src/i18n/sw.json
|
|
586
586
|
var require_sw = __commonJS({
|
|
587
|
-
"src/i18n/sw.json"(exports, module) {
|
|
587
|
+
"src/i18n/sw.json"(exports$1, module) {
|
|
588
588
|
module.exports = {
|
|
589
589
|
title: "Zana za Utengenezaji wa HAI3",
|
|
590
590
|
aria: {
|
|
@@ -605,7 +605,7 @@ var require_sw = __commonJS({
|
|
|
605
605
|
|
|
606
606
|
// src/i18n/ta.json
|
|
607
607
|
var require_ta = __commonJS({
|
|
608
|
-
"src/i18n/ta.json"(exports, module) {
|
|
608
|
+
"src/i18n/ta.json"(exports$1, module) {
|
|
609
609
|
module.exports = {
|
|
610
610
|
title: "HAI3 \u0BAE\u0BC7\u0BAE\u0BCD\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1 \u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BCD",
|
|
611
611
|
aria: {
|
|
@@ -626,7 +626,7 @@ var require_ta = __commonJS({
|
|
|
626
626
|
|
|
627
627
|
// src/i18n/th.json
|
|
628
628
|
var require_th = __commonJS({
|
|
629
|
-
"src/i18n/th.json"(exports, module) {
|
|
629
|
+
"src/i18n/th.json"(exports$1, module) {
|
|
630
630
|
module.exports = {
|
|
631
631
|
title: "\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D\u0E1E\u0E31\u0E12\u0E19\u0E32 HAI3",
|
|
632
632
|
aria: {
|
|
@@ -647,7 +647,7 @@ var require_th = __commonJS({
|
|
|
647
647
|
|
|
648
648
|
// src/i18n/tl.json
|
|
649
649
|
var require_tl = __commonJS({
|
|
650
|
-
"src/i18n/tl.json"(exports, module) {
|
|
650
|
+
"src/i18n/tl.json"(exports$1, module) {
|
|
651
651
|
module.exports = {
|
|
652
652
|
title: "Mga Kasangkapan sa Pag-develop ng HAI3",
|
|
653
653
|
aria: {
|
|
@@ -668,7 +668,7 @@ var require_tl = __commonJS({
|
|
|
668
668
|
|
|
669
669
|
// src/i18n/tr.json
|
|
670
670
|
var require_tr = __commonJS({
|
|
671
|
-
"src/i18n/tr.json"(exports, module) {
|
|
671
|
+
"src/i18n/tr.json"(exports$1, module) {
|
|
672
672
|
module.exports = {
|
|
673
673
|
title: "HAI3 Geli\u015Ftirici Ara\xE7lar\u0131",
|
|
674
674
|
aria: {
|
|
@@ -689,7 +689,7 @@ var require_tr = __commonJS({
|
|
|
689
689
|
|
|
690
690
|
// src/i18n/uk.json
|
|
691
691
|
var require_uk = __commonJS({
|
|
692
|
-
"src/i18n/uk.json"(exports, module) {
|
|
692
|
+
"src/i18n/uk.json"(exports$1, module) {
|
|
693
693
|
module.exports = {
|
|
694
694
|
title: "\u0406\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0438 \u0440\u043E\u0437\u0440\u043E\u0431\u043A\u0438 HAI3",
|
|
695
695
|
aria: {
|
|
@@ -710,7 +710,7 @@ var require_uk = __commonJS({
|
|
|
710
710
|
|
|
711
711
|
// src/i18n/ur.json
|
|
712
712
|
var require_ur = __commonJS({
|
|
713
|
-
"src/i18n/ur.json"(exports, module) {
|
|
713
|
+
"src/i18n/ur.json"(exports$1, module) {
|
|
714
714
|
module.exports = {
|
|
715
715
|
title: "HAI3 \u0688\u0648\u06CC\u0644\u067E\u0645\u0646\u0679 \u0679\u0648\u0644\u0632",
|
|
716
716
|
aria: {
|
|
@@ -731,7 +731,7 @@ var require_ur = __commonJS({
|
|
|
731
731
|
|
|
732
732
|
// src/i18n/vi.json
|
|
733
733
|
var require_vi = __commonJS({
|
|
734
|
-
"src/i18n/vi.json"(exports, module) {
|
|
734
|
+
"src/i18n/vi.json"(exports$1, module) {
|
|
735
735
|
module.exports = {
|
|
736
736
|
title: "C\xF4ng c\u1EE5 Ph\xE1t tri\u1EC3n HAI3",
|
|
737
737
|
aria: {
|
|
@@ -752,7 +752,7 @@ var require_vi = __commonJS({
|
|
|
752
752
|
|
|
753
753
|
// src/i18n/zh-TW.json
|
|
754
754
|
var require_zh_TW = __commonJS({
|
|
755
|
-
"src/i18n/zh-TW.json"(exports, module) {
|
|
755
|
+
"src/i18n/zh-TW.json"(exports$1, module) {
|
|
756
756
|
module.exports = {
|
|
757
757
|
title: "HAI3 \u958B\u767C\u5DE5\u5177",
|
|
758
758
|
aria: {
|
|
@@ -773,7 +773,7 @@ var require_zh_TW = __commonJS({
|
|
|
773
773
|
|
|
774
774
|
// src/i18n/zh.json
|
|
775
775
|
var require_zh = __commonJS({
|
|
776
|
-
"src/i18n/zh.json"(exports, module) {
|
|
776
|
+
"src/i18n/zh.json"(exports$1, module) {
|
|
777
777
|
module.exports = {
|
|
778
778
|
title: "HAI3 \u5F00\u53D1\u5DE5\u5177",
|
|
779
779
|
aria: {
|
|
@@ -903,24 +903,24 @@ var studioTranslations = react.I18nRegistry.createLoader({
|
|
|
903
903
|
[react.Language.ChineseSimplified]: () => Promise.resolve().then(() => __toESM(require_zh()))
|
|
904
904
|
});
|
|
905
905
|
react.i18nRegistry.registerLoader("studio", studioTranslations);
|
|
906
|
-
var StudioContext =
|
|
906
|
+
var StudioContext = React3.createContext(void 0);
|
|
907
907
|
var useStudioContext = () => {
|
|
908
|
-
const context =
|
|
908
|
+
const context = React3.useContext(StudioContext);
|
|
909
909
|
if (!context) {
|
|
910
910
|
throw new Error("useStudioContext must be used within StudioProvider");
|
|
911
911
|
}
|
|
912
912
|
return context;
|
|
913
913
|
};
|
|
914
914
|
var StudioProvider = ({ children }) => {
|
|
915
|
-
const [collapsed, setCollapsed] =
|
|
915
|
+
const [collapsed, setCollapsed] = React3.useState(
|
|
916
916
|
() => loadStudioState(STORAGE_KEYS.COLLAPSED, false)
|
|
917
917
|
);
|
|
918
|
-
const [portalContainer, setPortalContainer] =
|
|
919
|
-
|
|
918
|
+
const [portalContainer, setPortalContainer] = React3.useState(null);
|
|
919
|
+
React3.useEffect(() => {
|
|
920
920
|
const cleanup = initPersistenceEffects();
|
|
921
921
|
return cleanup;
|
|
922
922
|
}, []);
|
|
923
|
-
const toggleCollapsed =
|
|
923
|
+
const toggleCollapsed = React3.useCallback(() => {
|
|
924
924
|
setCollapsed((prev) => {
|
|
925
925
|
const newValue = !prev;
|
|
926
926
|
saveStudioState(STORAGE_KEYS.COLLAPSED, newValue);
|
|
@@ -946,19 +946,19 @@ var useDraggable = ({ panelSize, storageKey = STORAGE_KEYS.POSITION }) => {
|
|
|
946
946
|
x: window.innerWidth - panelSize.width - 20,
|
|
947
947
|
y: window.innerHeight - panelSize.height - 20
|
|
948
948
|
});
|
|
949
|
-
const [position, setPosition] =
|
|
949
|
+
const [position, setPosition] = React3.useState(
|
|
950
950
|
() => loadStudioState(storageKey, getDefaultPosition())
|
|
951
951
|
);
|
|
952
|
-
const [isDragging, setIsDragging] =
|
|
953
|
-
const dragStartPos =
|
|
954
|
-
const handleMouseDown =
|
|
952
|
+
const [isDragging, setIsDragging] = React3.useState(false);
|
|
953
|
+
const dragStartPos = React3.useRef({ x: 0, y: 0 });
|
|
954
|
+
const handleMouseDown = React3.useCallback((e) => {
|
|
955
955
|
setIsDragging(true);
|
|
956
956
|
dragStartPos.current = {
|
|
957
957
|
x: e.clientX - position.x,
|
|
958
958
|
y: e.clientY - position.y
|
|
959
959
|
};
|
|
960
960
|
}, [position]);
|
|
961
|
-
|
|
961
|
+
React3.useEffect(() => {
|
|
962
962
|
if (!isDragging) return;
|
|
963
963
|
const handleMouseMove = (e) => {
|
|
964
964
|
const newX = lodash.clamp(
|
|
@@ -993,15 +993,15 @@ var useDraggable = ({ panelSize, storageKey = STORAGE_KEYS.POSITION }) => {
|
|
|
993
993
|
};
|
|
994
994
|
};
|
|
995
995
|
var useResizable = () => {
|
|
996
|
-
const [size, setSize] =
|
|
996
|
+
const [size, setSize] = React3.useState(
|
|
997
997
|
() => loadStudioState(STORAGE_KEYS.SIZE, {
|
|
998
998
|
width: PANEL_CONSTRAINTS.DEFAULT_WIDTH,
|
|
999
999
|
height: PANEL_CONSTRAINTS.DEFAULT_HEIGHT
|
|
1000
1000
|
})
|
|
1001
1001
|
);
|
|
1002
|
-
const [isResizing, setIsResizing] =
|
|
1003
|
-
const resizeStartRef =
|
|
1004
|
-
const handleMouseDown =
|
|
1002
|
+
const [isResizing, setIsResizing] = React3.useState(false);
|
|
1003
|
+
const resizeStartRef = React3.useRef(null);
|
|
1004
|
+
const handleMouseDown = React3.useCallback((e) => {
|
|
1005
1005
|
e.stopPropagation();
|
|
1006
1006
|
resizeStartRef.current = {
|
|
1007
1007
|
mouseX: e.clientX,
|
|
@@ -1011,7 +1011,7 @@ var useResizable = () => {
|
|
|
1011
1011
|
};
|
|
1012
1012
|
setIsResizing(true);
|
|
1013
1013
|
}, [size.width, size.height]);
|
|
1014
|
-
|
|
1014
|
+
React3.useEffect(() => {
|
|
1015
1015
|
if (!isResizing || !resizeStartRef.current) return;
|
|
1016
1016
|
const startState = resizeStartRef.current;
|
|
1017
1017
|
document.body.style.userSelect = "none";
|
|
@@ -1145,14 +1145,18 @@ function LanguageSelector({
|
|
|
1145
1145
|
] })
|
|
1146
1146
|
] });
|
|
1147
1147
|
}
|
|
1148
|
-
var ApiModeToggle = ({
|
|
1149
|
-
|
|
1148
|
+
var ApiModeToggle = ({
|
|
1149
|
+
className
|
|
1150
|
+
}) => {
|
|
1150
1151
|
const { t } = react.useTranslation();
|
|
1152
|
+
const enabled = react.useAppSelector((state) => {
|
|
1153
|
+
const mockState = state.mock;
|
|
1154
|
+
return mockState?.enabled ?? false;
|
|
1155
|
+
});
|
|
1151
1156
|
const handleToggle = (checked) => {
|
|
1152
|
-
|
|
1153
|
-
react.apiRegistry.setMockMode(checked);
|
|
1157
|
+
react.toggleMockMode(checked);
|
|
1154
1158
|
};
|
|
1155
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center justify-between h-9 ${className}`, children: [
|
|
1159
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center justify-between h-9 ${className ?? ""}`, children: [
|
|
1156
1160
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1157
1161
|
"label",
|
|
1158
1162
|
{
|
|
@@ -1165,7 +1169,7 @@ var ApiModeToggle = ({ className }) => {
|
|
|
1165
1169
|
uikit.Switch,
|
|
1166
1170
|
{
|
|
1167
1171
|
id: "api-mode-toggle",
|
|
1168
|
-
checked:
|
|
1172
|
+
checked: enabled,
|
|
1169
1173
|
onCheckedChange: handleToggle
|
|
1170
1174
|
}
|
|
1171
1175
|
)
|
|
@@ -1185,9 +1189,9 @@ var buildScreensetOptions = () => {
|
|
|
1185
1189
|
};
|
|
1186
1190
|
var ControlPanel = () => {
|
|
1187
1191
|
const { currentScreenset, navigateToScreenset } = react.useNavigation();
|
|
1188
|
-
const [screensetOptions, setScreensetOptions] =
|
|
1192
|
+
const [screensetOptions, setScreensetOptions] = React3.useState([]);
|
|
1189
1193
|
const { t } = react.useTranslation();
|
|
1190
|
-
|
|
1194
|
+
React3.useEffect(() => {
|
|
1191
1195
|
const options = buildScreensetOptions();
|
|
1192
1196
|
setScreensetOptions(options);
|
|
1193
1197
|
}, []);
|
|
@@ -1224,13 +1228,13 @@ ControlPanel.displayName = "ControlPanel";
|
|
|
1224
1228
|
var StudioPanel = () => {
|
|
1225
1229
|
const { toggleCollapsed, setPortalContainer } = useStudioContext();
|
|
1226
1230
|
const { t } = react.useTranslation();
|
|
1227
|
-
const portalRef =
|
|
1231
|
+
const portalRef = React3__default.default.useRef(null);
|
|
1228
1232
|
const { size, handleMouseDown: handleResizeMouseDown } = useResizable();
|
|
1229
1233
|
const { position, isDragging, handleMouseDown: handleDragMouseDown } = useDraggable({
|
|
1230
1234
|
panelSize: size,
|
|
1231
1235
|
storageKey: STORAGE_KEYS.POSITION
|
|
1232
1236
|
});
|
|
1233
|
-
|
|
1237
|
+
React3__default.default.useEffect(() => {
|
|
1234
1238
|
setPortalContainer(portalRef.current);
|
|
1235
1239
|
return () => setPortalContainer(null);
|
|
1236
1240
|
}, [setPortalContainer]);
|
|
@@ -1321,7 +1325,7 @@ var StudioPanel = () => {
|
|
|
1321
1325
|
};
|
|
1322
1326
|
StudioPanel.displayName = "StudioPanel";
|
|
1323
1327
|
var useKeyboardShortcut = (handler) => {
|
|
1324
|
-
|
|
1328
|
+
React3.useEffect(() => {
|
|
1325
1329
|
const handleKeyDown = (e) => {
|
|
1326
1330
|
if (e.shiftKey && e.code === "Backquote") {
|
|
1327
1331
|
e.preventDefault();
|
|
@@ -1381,7 +1385,7 @@ var CollapsedButton = ({ toggleCollapsed }) => {
|
|
|
1381
1385
|
panelSize: BUTTON_SIZE,
|
|
1382
1386
|
storageKey: STORAGE_KEYS.BUTTON_POSITION
|
|
1383
1387
|
});
|
|
1384
|
-
const dragStartPosition =
|
|
1388
|
+
const dragStartPosition = React3.useRef(null);
|
|
1385
1389
|
const handleButtonMouseDown = (e) => {
|
|
1386
1390
|
dragStartPosition.current = { x: e.clientX, y: e.clientY };
|
|
1387
1391
|
handleMouseDown(e);
|