@multiplatform.one/components 9.0.1 → 9.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DropdownMenu/index.cjs +44 -25
- package/dist/cjs/DropdownMenu/index.native.js +42 -21
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +4 -3
- package/dist/cjs/appShell/AppShell.cjs +17 -12
- package/dist/cjs/appShell/AppShell.native.js +17 -12
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/code/PayloadView/index.cjs +4 -1
- package/dist/cjs/code/PayloadView/index.native.js +4 -1
- package/dist/cjs/code/PayloadView/index.native.js.map +1 -1
- package/dist/cjs/images/RemoteArt/index.native.js +3 -1
- package/dist/cjs/images/RemoteArt/index.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +9 -8
- package/dist/cjs/layouts/AsyncBoundary.native.js +9 -8
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +5 -1
- package/dist/cjs/views/Dashboard.native.js +3 -1
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +2 -2
- package/dist/cjs/views/ListGroup.native.js +8 -6
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.cjs +2 -1
- package/dist/cjs/views/ListRow.native.js +2 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +44 -25
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +42 -21
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +4 -3
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.mjs +17 -12
- package/dist/esm/appShell/AppShell.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.native.js +17 -12
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/code/PayloadView/index.mjs +4 -1
- package/dist/esm/code/PayloadView/index.mjs.map +1 -1
- package/dist/esm/code/PayloadView/index.native.js +4 -1
- package/dist/esm/code/PayloadView/index.native.js.map +1 -1
- package/dist/esm/images/RemoteArt/index.native.js +3 -1
- package/dist/esm/images/RemoteArt/index.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +9 -8
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +9 -8
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +5 -1
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +3 -1
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/ListGroup.mjs +3 -3
- package/dist/esm/views/ListGroup.mjs.map +1 -1
- package/dist/esm/views/ListGroup.native.js +9 -7
- package/dist/esm/views/ListGroup.native.js.map +1 -1
- package/dist/esm/views/ListRow.mjs +2 -1
- package/dist/esm/views/ListRow.mjs.map +1 -1
- package/dist/esm/views/ListRow.native.js +2 -1
- package/dist/esm/views/ListRow.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +44 -25
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +42 -21
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +4 -3
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.mjs +17 -12
- package/dist/jsx/appShell/AppShell.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.native.js +17 -12
- package/dist/jsx/appShell/AppShell.native.js.map +1 -1
- package/dist/jsx/code/PayloadView/index.mjs +4 -1
- package/dist/jsx/code/PayloadView/index.mjs.map +1 -1
- package/dist/jsx/code/PayloadView/index.native.js +4 -1
- package/dist/jsx/code/PayloadView/index.native.js.map +1 -1
- package/dist/jsx/images/RemoteArt/index.native.js +3 -1
- package/dist/jsx/images/RemoteArt/index.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +9 -8
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +9 -8
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +5 -1
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +3 -1
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/ListGroup.mjs +3 -3
- package/dist/jsx/views/ListGroup.mjs.map +1 -1
- package/dist/jsx/views/ListGroup.native.js +8 -6
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/ListRow.mjs +2 -1
- package/dist/jsx/views/ListRow.mjs.map +1 -1
- package/dist/jsx/views/ListRow.native.js +2 -1
- package/dist/jsx/views/ListRow.native.js.map +1 -1
- package/package.json +7 -7
- package/src/DropdownMenu/index.tsx +39 -26
- package/src/SheetModal/index.tsx +2 -1
- package/src/SwipeDismissRow/SwipeDismissRow.stories.tsx +2 -1
- package/src/appShell/AppShell.stories.tsx +8 -11
- package/src/appShell/AppShell.tsx +8 -6
- package/src/code/PayloadView/index.tsx +4 -2
- package/src/images/RemoteArt/index.native.tsx +1 -1
- package/src/layouts/AsyncBoundary.tsx +9 -5
- package/src/views/Dashboard.tsx +5 -9
- package/src/views/ListGroup.stories.tsx +1 -1
- package/src/views/ListGroup.tsx +13 -2
- package/src/views/ListRow.tsx +2 -1
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/appShell/AppShell.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/ListGroup.d.ts.map +1 -1
- package/types/views/ListRow.d.ts.map +1 -1
|
@@ -163,28 +163,40 @@ function decorateTrigger(trigger, open, onArrow) {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
function renderEntries(items) {
|
|
166
|
-
return items.map((entry, index) =>
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
return items.map((entry, index) => renderEntry(entry, index));
|
|
167
|
+
}
|
|
168
|
+
function renderEntry(entry, index) {
|
|
169
|
+
if ("separator" in entry && entry.separator) {
|
|
170
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`);
|
|
171
|
+
}
|
|
172
|
+
if (entry.items) {
|
|
173
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
|
|
174
|
+
stayOnPick: entry.stayOnPick,
|
|
175
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubTrigger, {
|
|
176
|
+
icon: entry.icon,
|
|
177
|
+
value: entry.value,
|
|
178
|
+
disabled: entry.disabled,
|
|
179
|
+
disabledReason: entry.disabledReason,
|
|
180
|
+
children: entry.label
|
|
181
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
|
|
182
|
+
children: renderEntries(entry.items)
|
|
183
|
+
})]
|
|
184
|
+
}, entry.key ?? index);
|
|
185
|
+
}
|
|
186
|
+
if ("checked" in entry && entry.checked !== void 0) {
|
|
187
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
|
|
188
|
+
checked: entry.checked,
|
|
169
189
|
icon: entry.icon,
|
|
170
|
-
|
|
190
|
+
onCheckedChange: entry.onCheckedChange,
|
|
191
|
+
onSelect: entry.onSelect,
|
|
192
|
+
closeOnSelect: entry.closeOnSelect,
|
|
171
193
|
disabled: entry.disabled,
|
|
172
194
|
disabledReason: entry.disabledReason,
|
|
195
|
+
shortcut: entry.shortcut,
|
|
173
196
|
children: entry.label
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}, entry.key ?? index) : "checked" in entry && entry.checked !== void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
|
|
178
|
-
checked: entry.checked,
|
|
179
|
-
icon: entry.icon,
|
|
180
|
-
onCheckedChange: entry.onCheckedChange,
|
|
181
|
-
onSelect: entry.onSelect,
|
|
182
|
-
closeOnSelect: entry.closeOnSelect,
|
|
183
|
-
disabled: entry.disabled,
|
|
184
|
-
disabledReason: entry.disabledReason,
|
|
185
|
-
shortcut: entry.shortcut,
|
|
186
|
-
children: entry.label
|
|
187
|
-
}, entry.key ?? index) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
|
|
197
|
+
}, entry.key ?? index);
|
|
198
|
+
}
|
|
199
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
|
|
188
200
|
icon: entry.icon,
|
|
189
201
|
shortcut: entry.shortcut,
|
|
190
202
|
disabled: entry.disabled,
|
|
@@ -193,7 +205,7 @@ function renderEntries(items) {
|
|
|
193
205
|
closeOnSelect: entry.closeOnSelect,
|
|
194
206
|
onSelect: entry.onSelect,
|
|
195
207
|
children: entry.label
|
|
196
|
-
}, entry.key ?? index)
|
|
208
|
+
}, entry.key ?? index);
|
|
197
209
|
}
|
|
198
210
|
function DropdownMenuRoot({
|
|
199
211
|
children,
|
|
@@ -368,6 +380,14 @@ function DropdownMenuContent({
|
|
|
368
380
|
children
|
|
369
381
|
});
|
|
370
382
|
}
|
|
383
|
+
function menuLabel(levelTitle, ariaLabel) {
|
|
384
|
+
if (levelTitle) return {
|
|
385
|
+
"aria-label": levelTitle
|
|
386
|
+
};
|
|
387
|
+
return ariaLabel ? {
|
|
388
|
+
"aria-label": ariaLabel
|
|
389
|
+
} : {};
|
|
390
|
+
}
|
|
371
391
|
function DropdownMenuList({
|
|
372
392
|
children,
|
|
373
393
|
maxHeight,
|
|
@@ -503,11 +523,7 @@ function DropdownMenuList({
|
|
|
503
523
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
504
524
|
ref: innerRef,
|
|
505
525
|
role: "menu",
|
|
506
|
-
...(levelTitle
|
|
507
|
-
"aria-label": levelTitle
|
|
508
|
-
} : ariaLabel ? {
|
|
509
|
-
"aria-label": ariaLabel
|
|
510
|
-
} : {}),
|
|
526
|
+
...menuLabel(levelTitle, ariaLabel),
|
|
511
527
|
"data-dismiss-class": "commit",
|
|
512
528
|
"data-mp-width-mode": "at-least-trigger",
|
|
513
529
|
width: "100%",
|
|
@@ -797,6 +813,9 @@ function subTitle(children) {
|
|
|
797
813
|
}
|
|
798
814
|
return null;
|
|
799
815
|
}
|
|
816
|
+
function levelFace(ctx, id) {
|
|
817
|
+
return ctx.levels.some(level => level.id === id) ? "level" : null;
|
|
818
|
+
}
|
|
800
819
|
function DropdownMenuSub({
|
|
801
820
|
children,
|
|
802
821
|
stayOnPick = false
|
|
@@ -806,7 +825,7 @@ function DropdownMenuSub({
|
|
|
806
825
|
const id = (0, import_react2.useId)();
|
|
807
826
|
const title = subTitle(children);
|
|
808
827
|
const active = activeLevelId(ctx);
|
|
809
|
-
const face = active === owner ? "trigger" : ctx
|
|
828
|
+
const face = active === owner ? "trigger" : levelFace(ctx, id);
|
|
810
829
|
const sub = (0, import_react2.useMemo)(() => face ? {
|
|
811
830
|
id,
|
|
812
831
|
title,
|
|
@@ -169,8 +169,17 @@ function decorateTrigger(trigger, open, onArrow) {
|
|
|
169
169
|
}
|
|
170
170
|
function renderEntries(items) {
|
|
171
171
|
return items.map(function (entry, index) {
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
return renderEntry(entry, index);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function renderEntry(entry, index) {
|
|
176
|
+
var _entry_key;
|
|
177
|
+
if ("separator" in entry && entry.separator) {
|
|
178
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}, `separator-${index}`);
|
|
179
|
+
}
|
|
180
|
+
if (entry.items) {
|
|
181
|
+
var _entry_key1;
|
|
182
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
|
|
174
183
|
stayOnPick: entry.stayOnPick,
|
|
175
184
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubTrigger, {
|
|
176
185
|
icon: entry.icon,
|
|
@@ -181,7 +190,11 @@ function renderEntries(items) {
|
|
|
181
190
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
|
|
182
191
|
children: renderEntries(entry.items)
|
|
183
192
|
})]
|
|
184
|
-
}, (
|
|
193
|
+
}, (_entry_key1 = entry.key) !== null && _entry_key1 !== void 0 ? _entry_key1 : index);
|
|
194
|
+
}
|
|
195
|
+
if ("checked" in entry && entry.checked !== void 0) {
|
|
196
|
+
var _entry_key2;
|
|
197
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuCheckboxItem, {
|
|
185
198
|
checked: entry.checked,
|
|
186
199
|
icon: entry.icon,
|
|
187
200
|
onCheckedChange: entry.onCheckedChange,
|
|
@@ -191,17 +204,18 @@ function renderEntries(items) {
|
|
|
191
204
|
disabledReason: entry.disabledReason,
|
|
192
205
|
shortcut: entry.shortcut,
|
|
193
206
|
children: entry.label
|
|
194
|
-
}, (_entry_key1 = entry.key) !== null && _entry_key1 !== void 0 ? _entry_key1 : index) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
|
|
195
|
-
icon: entry.icon,
|
|
196
|
-
shortcut: entry.shortcut,
|
|
197
|
-
disabled: entry.disabled,
|
|
198
|
-
disabledReason: entry.disabledReason,
|
|
199
|
-
destructive: entry.destructive,
|
|
200
|
-
closeOnSelect: entry.closeOnSelect,
|
|
201
|
-
onSelect: entry.onSelect,
|
|
202
|
-
children: entry.label
|
|
203
207
|
}, (_entry_key2 = entry.key) !== null && _entry_key2 !== void 0 ? _entry_key2 : index);
|
|
204
|
-
}
|
|
208
|
+
}
|
|
209
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(DropdownMenuItem, {
|
|
210
|
+
icon: entry.icon,
|
|
211
|
+
shortcut: entry.shortcut,
|
|
212
|
+
disabled: entry.disabled,
|
|
213
|
+
disabledReason: entry.disabledReason,
|
|
214
|
+
destructive: entry.destructive,
|
|
215
|
+
closeOnSelect: entry.closeOnSelect,
|
|
216
|
+
onSelect: entry.onSelect,
|
|
217
|
+
children: entry.label
|
|
218
|
+
}, (_entry_key = entry.key) !== null && _entry_key !== void 0 ? _entry_key : index);
|
|
205
219
|
}
|
|
206
220
|
function DropdownMenuRoot(param) {
|
|
207
221
|
var {
|
|
@@ -416,6 +430,14 @@ function DropdownMenuContent(param) {
|
|
|
416
430
|
children
|
|
417
431
|
});
|
|
418
432
|
}
|
|
433
|
+
function menuLabel(levelTitle, ariaLabel) {
|
|
434
|
+
if (levelTitle) return {
|
|
435
|
+
"aria-label": levelTitle
|
|
436
|
+
};
|
|
437
|
+
return ariaLabel ? {
|
|
438
|
+
"aria-label": ariaLabel
|
|
439
|
+
} : {};
|
|
440
|
+
}
|
|
419
441
|
function DropdownMenuList(param) {
|
|
420
442
|
var {
|
|
421
443
|
children,
|
|
@@ -564,11 +586,7 @@ function DropdownMenuList(param) {
|
|
|
564
586
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
565
587
|
ref: innerRef,
|
|
566
588
|
role: "menu",
|
|
567
|
-
...(levelTitle
|
|
568
|
-
"aria-label": levelTitle
|
|
569
|
-
} : ariaLabel ? {
|
|
570
|
-
"aria-label": ariaLabel
|
|
571
|
-
} : {}),
|
|
589
|
+
...menuLabel(levelTitle, ariaLabel),
|
|
572
590
|
"data-dismiss-class": "commit",
|
|
573
591
|
"data-mp-width-mode": "at-least-trigger",
|
|
574
592
|
width: "100%",
|
|
@@ -882,6 +900,11 @@ function subTitle(children) {
|
|
|
882
900
|
}
|
|
883
901
|
return null;
|
|
884
902
|
}
|
|
903
|
+
function levelFace(ctx, id) {
|
|
904
|
+
return ctx.levels.some(function (level) {
|
|
905
|
+
return level.id === id;
|
|
906
|
+
}) ? "level" : null;
|
|
907
|
+
}
|
|
885
908
|
function DropdownMenuSub(param) {
|
|
886
909
|
var {
|
|
887
910
|
children,
|
|
@@ -892,9 +915,7 @@ function DropdownMenuSub(param) {
|
|
|
892
915
|
var id = (0, import_react2.useId)();
|
|
893
916
|
var title = subTitle(children);
|
|
894
917
|
var active = activeLevelId(ctx);
|
|
895
|
-
var face = active === owner ? "trigger" : ctx
|
|
896
|
-
return level.id === id;
|
|
897
|
-
}) ? "level" : null;
|
|
918
|
+
var face = active === owner ? "trigger" : levelFace(ctx, id);
|
|
898
919
|
var sub = (0, import_react2.useMemo)(function () {
|
|
899
920
|
return face ? {
|
|
900
921
|
id,
|