@monimesl/dot-core 0.1.0-alpha.8 → 0.1.0-alpha.9
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/dist/index.d.ts +401 -281
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/event/core.ts","../src/view/component.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/event/core.ts","../src/view/component.ts","../src/theme/theme.ts","../src/host/context.ts","../src/host/calls.ts","../src/page/bars.ts","../src/page/navigation.ts","../src/protocol/core.ts","../src/view/renderer.ts","../src/view/values.ts","../src/view/components/amount-input.ts","../src/view/components/button.ts","../src/view/components/carousel.ts","../src/view/components/chip.ts","../src/view/components/code-input.ts","../src/view/components/detail-row.ts","../src/view/components/divider.ts","../src/view/components/empty-state.ts","../src/view/components/feedback.ts","../src/view/components/footer.ts","../src/view/components/grid.ts","../src/view/components/icon.ts","../src/view/components/image.ts","../src/view/components/input.ts","../src/view/components/link.ts","../src/view/components/list.ts","../src/view/components/overlays.ts","../src/view/components/qr-code.ts","../src/view/components/select.ts","../src/view/components/scroll.ts","../src/view/components/skeleton.ts","../src/view/components/tabs.ts","../src/view/components/text.ts","../src/view/components/text-area.ts","../src/view/components/toggles.ts","../src/view/components/view.ts","../src/view/components/options.ts","../src/view/components/index.ts","../src/source/location.ts","../src/source/error.ts","../src/event/emitter.ts","../src/protocol/transport.ts","../src/host/host.ts","../src/host/permissions.ts","../src/host/files.ts","../src/host/network.ts","../src/host/react.ts","../src/page/lifecycle.ts","../src/page/state.ts","../src/version/semantic-version.ts","../src/messageChannel.ts"],"mappings":";UAEiB,SAAS,kBAAkB,OAAO,SAAS;WACjD;WACA,QAAQ;WACR,MAAM;;wBAGD,YAAY,SAAS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;;;KCvBlC,eAAe,YAAY,SAAS;qBAEnC,eAAe,iBAAiB,YAAY,iBAAiB;;EAI5D,YAAA,WAAW;EAIvB,KAAK,UAAU,YAAY,WAAW,MAAM,GAAG,SAAS,SAAS;EAIjE,OAAO,UAAU,YAAY,WAC3B,MAAM,GACN,SAAS,eAAe,SAAS,MAChC,eAAe,SAAS;EAM3B,OAAO,UAAU,gBAAgB,SAAS"}
|
package/dist/index.js
CHANGED
|
@@ -43,57 +43,14 @@ function toList(value) {
|
|
|
43
43
|
return [];
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region src/source/location.ts
|
|
47
|
-
function createLocator(source) {
|
|
48
|
-
const lineStarts = [0];
|
|
49
|
-
for (let index = 0; index < source.length; index++) if (source[index] === "\n") lineStarts.push(index + 1);
|
|
50
|
-
return (offset) => {
|
|
51
|
-
let low = 0;
|
|
52
|
-
let high = lineStarts.length - 1;
|
|
53
|
-
while (low < high) {
|
|
54
|
-
const middle = Math.floor((low + high + 1) / 2);
|
|
55
|
-
if (lineStarts[middle] <= offset) low = middle;
|
|
56
|
-
else high = middle - 1;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
line: low + 1,
|
|
60
|
-
column: offset - lineStarts[low] + 1,
|
|
61
|
-
offset
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function locationAt(source, offset) {
|
|
66
|
-
return createLocator(source)(offset);
|
|
67
|
-
}
|
|
68
|
-
function locatedMessage(message, file, location) {
|
|
69
|
-
const where = [
|
|
70
|
-
file,
|
|
71
|
-
location?.line,
|
|
72
|
-
location?.column
|
|
73
|
-
].filter((part) => part !== void 0).join(":");
|
|
74
|
-
return where ? `${where}: ${message}` : message;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/source/error.ts
|
|
78
|
-
var SourceError = class extends Error {
|
|
79
|
-
reason;
|
|
80
|
-
file;
|
|
81
|
-
loc;
|
|
82
|
-
constructor(reason, file, location) {
|
|
83
|
-
super(locatedMessage(reason, file, location));
|
|
84
|
-
this.reason = reason;
|
|
85
|
-
this.file = file;
|
|
86
|
-
this.loc = location;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
46
|
//#region src/view/components/amount-input.ts
|
|
91
47
|
const AmountInput = defineComponent({
|
|
92
48
|
name: "AmountInput",
|
|
93
49
|
props: {
|
|
94
50
|
value: "number",
|
|
95
51
|
currency: "string",
|
|
96
|
-
|
|
52
|
+
minorUnits: "number",
|
|
53
|
+
unit: ["minor", "major"],
|
|
97
54
|
label: "string",
|
|
98
55
|
placeholder: "string",
|
|
99
56
|
hint: "string",
|
|
@@ -128,6 +85,22 @@ const SPACES = [
|
|
|
128
85
|
"medium",
|
|
129
86
|
"large"
|
|
130
87
|
];
|
|
88
|
+
const PADDING_PROPS = {
|
|
89
|
+
padding: SPACES,
|
|
90
|
+
paddingTop: SPACES,
|
|
91
|
+
paddingStart: SPACES,
|
|
92
|
+
paddingEnd: SPACES,
|
|
93
|
+
paddingBottom: SPACES
|
|
94
|
+
};
|
|
95
|
+
const ASPECTS = [
|
|
96
|
+
"1:1",
|
|
97
|
+
"4:3",
|
|
98
|
+
"3:2",
|
|
99
|
+
"16:9",
|
|
100
|
+
"3:4",
|
|
101
|
+
"2:3",
|
|
102
|
+
"9:16"
|
|
103
|
+
];
|
|
131
104
|
const TONES = [
|
|
132
105
|
"default",
|
|
133
106
|
"muted",
|
|
@@ -166,26 +139,33 @@ const ICON_NAMES = [
|
|
|
166
139
|
"download",
|
|
167
140
|
"edit",
|
|
168
141
|
"error",
|
|
142
|
+
"external-link",
|
|
169
143
|
"eye",
|
|
170
144
|
"eye-off",
|
|
171
145
|
"file",
|
|
172
146
|
"gift",
|
|
147
|
+
"globe",
|
|
173
148
|
"grid",
|
|
149
|
+
"headphones",
|
|
174
150
|
"heart",
|
|
175
151
|
"help",
|
|
176
152
|
"history",
|
|
177
153
|
"home",
|
|
178
154
|
"image",
|
|
179
155
|
"info",
|
|
156
|
+
"link",
|
|
180
157
|
"list",
|
|
181
158
|
"location",
|
|
182
159
|
"lock",
|
|
183
160
|
"logout",
|
|
184
161
|
"mail",
|
|
162
|
+
"microphone",
|
|
185
163
|
"minus",
|
|
186
164
|
"mobile",
|
|
187
165
|
"more",
|
|
166
|
+
"music",
|
|
188
167
|
"phone",
|
|
168
|
+
"playlist",
|
|
189
169
|
"plus",
|
|
190
170
|
"qr-code",
|
|
191
171
|
"receipt",
|
|
@@ -196,10 +176,12 @@ const ICON_NAMES = [
|
|
|
196
176
|
"share",
|
|
197
177
|
"star",
|
|
198
178
|
"success",
|
|
179
|
+
"ticket",
|
|
199
180
|
"trash",
|
|
200
181
|
"upload",
|
|
201
182
|
"user",
|
|
202
183
|
"users",
|
|
184
|
+
"video",
|
|
203
185
|
"wallet",
|
|
204
186
|
"warning",
|
|
205
187
|
"water",
|
|
@@ -216,7 +198,8 @@ const Carousel = defineComponent({
|
|
|
216
198
|
indicator: ["dots", "none"],
|
|
217
199
|
gap: SPACES,
|
|
218
200
|
effect: ["slide", "scale"],
|
|
219
|
-
index: "number"
|
|
201
|
+
index: "number",
|
|
202
|
+
...PADDING_PROPS
|
|
220
203
|
},
|
|
221
204
|
events: ["change"],
|
|
222
205
|
children: "elements"
|
|
@@ -251,6 +234,23 @@ const CodeInput = defineComponent({
|
|
|
251
234
|
children: "none"
|
|
252
235
|
});
|
|
253
236
|
//#endregion
|
|
237
|
+
//#region src/view/components/detail-row.ts
|
|
238
|
+
const DetailRow = defineComponent({
|
|
239
|
+
name: "DetailRow",
|
|
240
|
+
props: {
|
|
241
|
+
label: "string",
|
|
242
|
+
value: "string",
|
|
243
|
+
tone: TONES,
|
|
244
|
+
weight: [
|
|
245
|
+
"regular",
|
|
246
|
+
"medium",
|
|
247
|
+
"bold"
|
|
248
|
+
],
|
|
249
|
+
...PADDING_PROPS
|
|
250
|
+
},
|
|
251
|
+
children: "none"
|
|
252
|
+
});
|
|
253
|
+
//#endregion
|
|
254
254
|
//#region src/view/components/divider.ts
|
|
255
255
|
const Divider = defineComponent({
|
|
256
256
|
name: "Divider",
|
|
@@ -263,7 +263,8 @@ const EmptyState = defineComponent({
|
|
|
263
263
|
props: {
|
|
264
264
|
icon: ICON_NAMES,
|
|
265
265
|
title: "string",
|
|
266
|
-
text: "string"
|
|
266
|
+
text: "string",
|
|
267
|
+
...PADDING_PROPS
|
|
267
268
|
},
|
|
268
269
|
children: "elements"
|
|
269
270
|
});
|
|
@@ -283,7 +284,8 @@ const Notice = defineComponent({
|
|
|
283
284
|
name: "Notice",
|
|
284
285
|
props: {
|
|
285
286
|
tone: STATUS_TONES,
|
|
286
|
-
title: "string"
|
|
287
|
+
title: "string",
|
|
288
|
+
...PADDING_PROPS
|
|
287
289
|
},
|
|
288
290
|
children: "text"
|
|
289
291
|
});
|
|
@@ -296,6 +298,7 @@ const Badge = defineComponent({
|
|
|
296
298
|
//#region src/view/components/footer.ts
|
|
297
299
|
const Footer = defineComponent({
|
|
298
300
|
name: "Footer",
|
|
301
|
+
props: PADDING_PROPS,
|
|
299
302
|
children: "elements"
|
|
300
303
|
});
|
|
301
304
|
//#endregion
|
|
@@ -304,7 +307,8 @@ const Grid = defineComponent({
|
|
|
304
307
|
name: "Grid",
|
|
305
308
|
props: {
|
|
306
309
|
columns: "number",
|
|
307
|
-
gap: SPACES
|
|
310
|
+
gap: SPACES,
|
|
311
|
+
...PADDING_PROPS
|
|
308
312
|
},
|
|
309
313
|
children: "elements"
|
|
310
314
|
});
|
|
@@ -345,10 +349,16 @@ const Image = defineComponent({
|
|
|
345
349
|
"rounded",
|
|
346
350
|
"square",
|
|
347
351
|
"circle"
|
|
348
|
-
]
|
|
352
|
+
],
|
|
353
|
+
aspect: ASPECTS
|
|
349
354
|
},
|
|
350
355
|
events: ["load", "error"],
|
|
351
|
-
children: "none"
|
|
356
|
+
children: "none",
|
|
357
|
+
overrides: [{
|
|
358
|
+
prop: "aspect",
|
|
359
|
+
ignores: "height",
|
|
360
|
+
because: "the aspect sets the height"
|
|
361
|
+
}]
|
|
352
362
|
});
|
|
353
363
|
//#endregion
|
|
354
364
|
//#region src/view/components/input.ts
|
|
@@ -376,10 +386,26 @@ const Input = defineComponent({
|
|
|
376
386
|
children: "none"
|
|
377
387
|
});
|
|
378
388
|
//#endregion
|
|
389
|
+
//#region src/view/components/link.ts
|
|
390
|
+
const Link = defineComponent({
|
|
391
|
+
name: "Link",
|
|
392
|
+
props: {
|
|
393
|
+
href: "string",
|
|
394
|
+
tone: TONES
|
|
395
|
+
},
|
|
396
|
+
events: ["tap"],
|
|
397
|
+
children: "text",
|
|
398
|
+
inline: true
|
|
399
|
+
});
|
|
400
|
+
//#endregion
|
|
379
401
|
//#region src/view/components/list.ts
|
|
380
402
|
const List = defineComponent({
|
|
381
403
|
name: "List",
|
|
382
|
-
props: {
|
|
404
|
+
props: {
|
|
405
|
+
size: ["sm", "md"],
|
|
406
|
+
...PADDING_PROPS
|
|
407
|
+
},
|
|
408
|
+
events: ["endReached"],
|
|
383
409
|
children: "elements"
|
|
384
410
|
});
|
|
385
411
|
const ListItem = defineComponent({
|
|
@@ -389,7 +415,8 @@ const ListItem = defineComponent({
|
|
|
389
415
|
subtitle: "string",
|
|
390
416
|
value: "string",
|
|
391
417
|
icon: ICON_NAMES,
|
|
392
|
-
image: "string"
|
|
418
|
+
image: "string",
|
|
419
|
+
...PADDING_PROPS
|
|
393
420
|
},
|
|
394
421
|
events: ["tap"],
|
|
395
422
|
children: "elements"
|
|
@@ -401,7 +428,8 @@ const Sheet = defineComponent({
|
|
|
401
428
|
props: {
|
|
402
429
|
open: "boolean",
|
|
403
430
|
title: "string",
|
|
404
|
-
showCloseIcon: "boolean"
|
|
431
|
+
showCloseIcon: "boolean",
|
|
432
|
+
...PADDING_PROPS
|
|
405
433
|
},
|
|
406
434
|
events: ["close"],
|
|
407
435
|
children: "elements"
|
|
@@ -451,6 +479,23 @@ const Option = defineComponent({
|
|
|
451
479
|
children: "none"
|
|
452
480
|
});
|
|
453
481
|
//#endregion
|
|
482
|
+
//#region src/view/components/scroll.ts
|
|
483
|
+
const Scroll = defineComponent({
|
|
484
|
+
name: "Scroll",
|
|
485
|
+
props: {
|
|
486
|
+
gap: SPACES,
|
|
487
|
+
snap: [
|
|
488
|
+
"none",
|
|
489
|
+
"start",
|
|
490
|
+
"center"
|
|
491
|
+
],
|
|
492
|
+
index: "number",
|
|
493
|
+
...PADDING_PROPS
|
|
494
|
+
},
|
|
495
|
+
events: ["change"],
|
|
496
|
+
children: "elements"
|
|
497
|
+
});
|
|
498
|
+
//#endregion
|
|
454
499
|
//#region src/view/components/skeleton.ts
|
|
455
500
|
const Skeleton = defineComponent({
|
|
456
501
|
name: "Skeleton",
|
|
@@ -471,7 +516,8 @@ const Tabs = defineComponent({
|
|
|
471
516
|
name: "Tabs",
|
|
472
517
|
props: {
|
|
473
518
|
value: "string",
|
|
474
|
-
variant: ["underline", "segmented"]
|
|
519
|
+
variant: ["underline", "segmented"],
|
|
520
|
+
...PADDING_PROPS
|
|
475
521
|
},
|
|
476
522
|
events: ["change"],
|
|
477
523
|
children: "elements"
|
|
@@ -506,7 +552,8 @@ const Text = defineComponent({
|
|
|
506
552
|
"center",
|
|
507
553
|
"end"
|
|
508
554
|
],
|
|
509
|
-
maxLines: "number"
|
|
555
|
+
maxLines: "number",
|
|
556
|
+
...PADDING_PROPS
|
|
510
557
|
},
|
|
511
558
|
children: "text",
|
|
512
559
|
inline: true
|
|
@@ -590,11 +637,7 @@ const View = defineComponent({
|
|
|
590
637
|
],
|
|
591
638
|
wrap: "boolean",
|
|
592
639
|
grow: "boolean",
|
|
593
|
-
|
|
594
|
-
paddingTop: SPACES,
|
|
595
|
-
paddingStart: SPACES,
|
|
596
|
-
paddingEnd: SPACES,
|
|
597
|
-
paddingBottom: SPACES,
|
|
640
|
+
...PADDING_PROPS,
|
|
598
641
|
variant: ["plain", "card"]
|
|
599
642
|
},
|
|
600
643
|
events: ["tap"],
|
|
@@ -610,6 +653,7 @@ const builtinComponents = {
|
|
|
610
653
|
Checkbox,
|
|
611
654
|
Chip,
|
|
612
655
|
CodeInput,
|
|
656
|
+
DetailRow,
|
|
613
657
|
Divider,
|
|
614
658
|
EmptyState,
|
|
615
659
|
Footer,
|
|
@@ -618,6 +662,7 @@ const builtinComponents = {
|
|
|
618
662
|
Icon,
|
|
619
663
|
Image,
|
|
620
664
|
Input,
|
|
665
|
+
Link,
|
|
621
666
|
List,
|
|
622
667
|
ListItem,
|
|
623
668
|
Notice,
|
|
@@ -626,6 +671,7 @@ const builtinComponents = {
|
|
|
626
671
|
QRCode,
|
|
627
672
|
Radio,
|
|
628
673
|
RadioGroup,
|
|
674
|
+
Scroll,
|
|
629
675
|
Select,
|
|
630
676
|
Sheet,
|
|
631
677
|
Skeleton,
|
|
@@ -640,6 +686,50 @@ const builtinComponents = {
|
|
|
640
686
|
};
|
|
641
687
|
const builtinRegistry = componentRegistry(Object.values(builtinComponents));
|
|
642
688
|
//#endregion
|
|
689
|
+
//#region src/source/location.ts
|
|
690
|
+
function createLocator(source) {
|
|
691
|
+
const lineStarts = [0];
|
|
692
|
+
for (let index = 0; index < source.length; index++) if (source[index] === "\n") lineStarts.push(index + 1);
|
|
693
|
+
return (offset) => {
|
|
694
|
+
let low = 0;
|
|
695
|
+
let high = lineStarts.length - 1;
|
|
696
|
+
while (low < high) {
|
|
697
|
+
const middle = Math.floor((low + high + 1) / 2);
|
|
698
|
+
if (lineStarts[middle] <= offset) low = middle;
|
|
699
|
+
else high = middle - 1;
|
|
700
|
+
}
|
|
701
|
+
return {
|
|
702
|
+
line: low + 1,
|
|
703
|
+
column: offset - lineStarts[low] + 1,
|
|
704
|
+
offset
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
function locationAt(source, offset) {
|
|
709
|
+
return createLocator(source)(offset);
|
|
710
|
+
}
|
|
711
|
+
function locatedMessage(message, file, location) {
|
|
712
|
+
const where = [
|
|
713
|
+
file,
|
|
714
|
+
location?.line,
|
|
715
|
+
location?.column
|
|
716
|
+
].filter((part) => part !== void 0).join(":");
|
|
717
|
+
return where ? `${where}: ${message}` : message;
|
|
718
|
+
}
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region src/source/error.ts
|
|
721
|
+
var SourceError = class extends Error {
|
|
722
|
+
reason;
|
|
723
|
+
file;
|
|
724
|
+
loc;
|
|
725
|
+
constructor(reason, file, location) {
|
|
726
|
+
super(locatedMessage(reason, file, location));
|
|
727
|
+
this.reason = reason;
|
|
728
|
+
this.file = file;
|
|
729
|
+
this.loc = location;
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
//#endregion
|
|
643
733
|
//#region src/event/emitter.ts
|
|
644
734
|
var EventEmitter = class {
|
|
645
735
|
#listeners = /* @__PURE__ */ new Map();
|
|
@@ -672,7 +762,6 @@ function hostTransport() {
|
|
|
672
762
|
//#endregion
|
|
673
763
|
//#region src/host/context.ts
|
|
674
764
|
const DEFAULT_SYSTEM_CONTEXT = {
|
|
675
|
-
platform: "ios",
|
|
676
765
|
scheme: "light",
|
|
677
766
|
appState: "active"
|
|
678
767
|
};
|
|
@@ -692,7 +781,7 @@ function connectHost(caller) {
|
|
|
692
781
|
}
|
|
693
782
|
function callHost(method, params, options = {}) {
|
|
694
783
|
if (!connectedCaller) {
|
|
695
|
-
const error = new HostError("unsupported", `
|
|
784
|
+
const error = new HostError("unsupported", `Can't run "${method}" here: call Dash from the dot's logic`);
|
|
696
785
|
return createHostRequest(Promise.reject(error));
|
|
697
786
|
}
|
|
698
787
|
return connectedCaller(method, params, options);
|
|
@@ -715,10 +804,10 @@ const MAX_NAME_LENGTH = 255;
|
|
|
715
804
|
function dotFilePathProblem(path, { allowRoot = false } = {}) {
|
|
716
805
|
if (path === "") return allowRoot ? null : "A path is needed, such as \"receipts/42.pdf\"";
|
|
717
806
|
if (path.length > 512) return `"${path.slice(0, 40)}…" is longer than 512 characters`;
|
|
718
|
-
if (path.startsWith("/")) return `"${path}" starts with "/"
|
|
719
|
-
if ([...path].some((char) => char === "\\" || char.charCodeAt(0) < 32)) return `"${path}" has a backslash or
|
|
807
|
+
if (path.startsWith("/")) return `"${path}" starts with "/". Start paths without it, such as "receipts/42.pdf"`;
|
|
808
|
+
if ([...path].some((char) => char === "\\" || char.charCodeAt(0) < 32)) return `"${path}" has a backslash or another character paths can't use`;
|
|
720
809
|
for (const name of path.split("/")) {
|
|
721
|
-
if (name === "" || name === "." || name === "..") return `"${path}" has an empty, "." or ".." part
|
|
810
|
+
if (name === "" || name === "." || name === "..") return `"${path}" has an empty, "." or ".." part. Name each folder, such as "receipts/42.pdf"`;
|
|
722
811
|
if (name.length > MAX_NAME_LENGTH) return `"${path}" has a name longer than ${MAX_NAME_LENGTH} characters`;
|
|
723
812
|
}
|
|
724
813
|
return null;
|
|
@@ -859,10 +948,6 @@ var NavigationStack = class {
|
|
|
859
948
|
get top() {
|
|
860
949
|
return this.#pages.at(-1);
|
|
861
950
|
}
|
|
862
|
-
/**
|
|
863
|
-
* Applies a navigation, or refuses it and returns false: a push onto a full stack, or going back
|
|
864
|
-
* from the first page (which the host handles itself, e.g. by closing the dot).
|
|
865
|
-
*/
|
|
866
951
|
apply(navigation) {
|
|
867
952
|
switch (navigation.action) {
|
|
868
953
|
case "push":
|
|
@@ -969,6 +1054,6 @@ var MessageChannel = class {
|
|
|
969
1054
|
}
|
|
970
1055
|
};
|
|
971
1056
|
//#endregion
|
|
972
|
-
export { AmountInput, Badge, Button, Carousel, Checkbox, Chip, CodeInput, DEFAULT_SYSTEM_CONTEXT, DOT_FILE_PATH_MAX_LENGTH, Divider, EmptyState, EventEmitter, Footer, Grid, GridItem, HostError, ICON_NAMES, Icon, Image, Input, List, ListItem, MAX_STACK_DEPTH, MessageChannel, NETWORK_HOST_MAX_LENGTH, NETWORK_HOST_PATTERN, NavigationStack, Notice, Option, PAGE_HOOKS, PERMISSIONS, ProgressBar, QRCode, REACT_HOST_MODULES, REACT_HOST_PATH, Radio, RadioGroup, SEMVER_PATTERN, SIZES, STATUS_TONES, Select, Sheet, Skeleton, SourceError, Spinner, Switch, TONES, Tab, Tabs, Text, TextArea, Toast, View, allowsHost, applyChanges, builtinComponents, builtinRegistry, callHost, checkConfigs, checkNavigationBar, checkTabBar, compareVersions, componentRegistry, connectHost, createAdaptorTransport, createEvent, createHostRequest, createLocator, createTransportPair, defineComponent, dotFilePathProblem, eventName, eventProp, hostTransport, isEventProp, isNetworkHost, isPageId, isPermission, isReactCompatible, isSemanticVersion, isVersionAtLeast, locatedMessage, locationAt, majorVersion, mergeConfigs, newestReactOfMajor, reactHostUrl, toList, toText };
|
|
1057
|
+
export { ASPECTS, AmountInput, Badge, Button, Carousel, Checkbox, Chip, CodeInput, DEFAULT_SYSTEM_CONTEXT, DOT_FILE_PATH_MAX_LENGTH, DetailRow, Divider, EmptyState, EventEmitter, Footer, Grid, GridItem, HostError, ICON_NAMES, Icon, Image, Input, Link, List, ListItem, MAX_STACK_DEPTH, MessageChannel, NETWORK_HOST_MAX_LENGTH, NETWORK_HOST_PATTERN, NavigationStack, Notice, Option, PADDING_PROPS, PAGE_HOOKS, PERMISSIONS, ProgressBar, QRCode, REACT_HOST_MODULES, REACT_HOST_PATH, Radio, RadioGroup, SEMVER_PATTERN, SIZES, SPACES, STATUS_TONES, Scroll, Select, Sheet, Skeleton, SourceError, Spinner, Switch, TONES, Tab, Tabs, Text, TextArea, Toast, View, allowsHost, applyChanges, builtinComponents, builtinRegistry, callHost, checkConfigs, checkNavigationBar, checkTabBar, compareVersions, componentRegistry, connectHost, createAdaptorTransport, createEvent, createHostRequest, createLocator, createTransportPair, defineComponent, dotFilePathProblem, eventName, eventProp, hostTransport, isEventProp, isNetworkHost, isPageId, isPermission, isReactCompatible, isSemanticVersion, isVersionAtLeast, locatedMessage, locationAt, majorVersion, mergeConfigs, newestReactOfMajor, reactHostUrl, toList, toText };
|
|
973
1058
|
|
|
974
1059
|
//# sourceMappingURL=index.js.map
|