@multiplatform.one/components 9.0.1 → 9.0.3

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 (146) hide show
  1. package/dist/cjs/Chip/index.cjs +4 -3
  2. package/dist/cjs/Chip/index.native.js +4 -3
  3. package/dist/cjs/Chip/index.native.js.map +1 -1
  4. package/dist/cjs/DropdownMenu/index.cjs +44 -25
  5. package/dist/cjs/DropdownMenu/index.native.js +42 -21
  6. package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
  7. package/dist/cjs/SheetModal/index.cjs +4 -3
  8. package/dist/cjs/appShell/AppShell.cjs +17 -12
  9. package/dist/cjs/appShell/AppShell.native.js +17 -12
  10. package/dist/cjs/appShell/AppShell.native.js.map +1 -1
  11. package/dist/cjs/code/PayloadView/index.cjs +4 -1
  12. package/dist/cjs/code/PayloadView/index.native.js +4 -1
  13. package/dist/cjs/code/PayloadView/index.native.js.map +1 -1
  14. package/dist/cjs/images/RemoteArt/index.native.js +3 -1
  15. package/dist/cjs/images/RemoteArt/index.native.js.map +1 -1
  16. package/dist/cjs/images/RemoteArt/svgMarkup.cjs +36 -28
  17. package/dist/cjs/images/RemoteArt/svgMarkup.native.js +66 -58
  18. package/dist/cjs/images/RemoteArt/svgMarkup.native.js.map +1 -1
  19. package/dist/cjs/layouts/AsyncBoundary.cjs +9 -8
  20. package/dist/cjs/layouts/AsyncBoundary.native.js +9 -8
  21. package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
  22. package/dist/cjs/views/Dashboard.cjs +44 -30
  23. package/dist/cjs/views/Dashboard.native.js +46 -28
  24. package/dist/cjs/views/Dashboard.native.js.map +1 -1
  25. package/dist/cjs/views/FilePreview.cjs +91 -48
  26. package/dist/cjs/views/FilePreview.native.js +98 -54
  27. package/dist/cjs/views/FilePreview.native.js.map +1 -1
  28. package/dist/cjs/views/ListGroup.cjs +68 -53
  29. package/dist/cjs/views/ListGroup.native.js +78 -61
  30. package/dist/cjs/views/ListGroup.native.js.map +1 -1
  31. package/dist/cjs/views/ListRow.cjs +2 -1
  32. package/dist/cjs/views/ListRow.native.js +2 -1
  33. package/dist/cjs/views/ListRow.native.js.map +1 -1
  34. package/dist/esm/Chip/index.mjs +4 -3
  35. package/dist/esm/Chip/index.mjs.map +1 -1
  36. package/dist/esm/Chip/index.native.js +4 -3
  37. package/dist/esm/Chip/index.native.js.map +1 -1
  38. package/dist/esm/DropdownMenu/index.mjs +44 -25
  39. package/dist/esm/DropdownMenu/index.mjs.map +1 -1
  40. package/dist/esm/DropdownMenu/index.native.js +42 -21
  41. package/dist/esm/DropdownMenu/index.native.js.map +1 -1
  42. package/dist/esm/SheetModal/index.mjs +4 -3
  43. package/dist/esm/SheetModal/index.mjs.map +1 -1
  44. package/dist/esm/appShell/AppShell.mjs +17 -12
  45. package/dist/esm/appShell/AppShell.mjs.map +1 -1
  46. package/dist/esm/appShell/AppShell.native.js +17 -12
  47. package/dist/esm/appShell/AppShell.native.js.map +1 -1
  48. package/dist/esm/code/PayloadView/index.mjs +4 -1
  49. package/dist/esm/code/PayloadView/index.mjs.map +1 -1
  50. package/dist/esm/code/PayloadView/index.native.js +4 -1
  51. package/dist/esm/code/PayloadView/index.native.js.map +1 -1
  52. package/dist/esm/images/RemoteArt/index.native.js +3 -1
  53. package/dist/esm/images/RemoteArt/index.native.js.map +1 -1
  54. package/dist/esm/images/RemoteArt/svgMarkup.mjs +36 -28
  55. package/dist/esm/images/RemoteArt/svgMarkup.mjs.map +1 -1
  56. package/dist/esm/images/RemoteArt/svgMarkup.native.js +66 -58
  57. package/dist/esm/images/RemoteArt/svgMarkup.native.js.map +1 -1
  58. package/dist/esm/layouts/AsyncBoundary.mjs +9 -8
  59. package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
  60. package/dist/esm/layouts/AsyncBoundary.native.js +9 -8
  61. package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
  62. package/dist/esm/views/Dashboard.mjs +44 -30
  63. package/dist/esm/views/Dashboard.mjs.map +1 -1
  64. package/dist/esm/views/Dashboard.native.js +46 -28
  65. package/dist/esm/views/Dashboard.native.js.map +1 -1
  66. package/dist/esm/views/FilePreview.mjs +91 -48
  67. package/dist/esm/views/FilePreview.mjs.map +1 -1
  68. package/dist/esm/views/FilePreview.native.js +98 -54
  69. package/dist/esm/views/FilePreview.native.js.map +1 -1
  70. package/dist/esm/views/ListGroup.mjs +69 -54
  71. package/dist/esm/views/ListGroup.mjs.map +1 -1
  72. package/dist/esm/views/ListGroup.native.js +79 -62
  73. package/dist/esm/views/ListGroup.native.js.map +1 -1
  74. package/dist/esm/views/ListRow.mjs +2 -1
  75. package/dist/esm/views/ListRow.mjs.map +1 -1
  76. package/dist/esm/views/ListRow.native.js +2 -1
  77. package/dist/esm/views/ListRow.native.js.map +1 -1
  78. package/dist/jsx/Chip/index.mjs +4 -3
  79. package/dist/jsx/Chip/index.mjs.map +1 -1
  80. package/dist/jsx/Chip/index.native.js +4 -3
  81. package/dist/jsx/Chip/index.native.js.map +1 -1
  82. package/dist/jsx/DropdownMenu/index.mjs +44 -25
  83. package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
  84. package/dist/jsx/DropdownMenu/index.native.js +42 -21
  85. package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
  86. package/dist/jsx/SheetModal/index.mjs +4 -3
  87. package/dist/jsx/SheetModal/index.mjs.map +1 -1
  88. package/dist/jsx/appShell/AppShell.mjs +17 -12
  89. package/dist/jsx/appShell/AppShell.mjs.map +1 -1
  90. package/dist/jsx/appShell/AppShell.native.js +17 -12
  91. package/dist/jsx/appShell/AppShell.native.js.map +1 -1
  92. package/dist/jsx/code/PayloadView/index.mjs +4 -1
  93. package/dist/jsx/code/PayloadView/index.mjs.map +1 -1
  94. package/dist/jsx/code/PayloadView/index.native.js +4 -1
  95. package/dist/jsx/code/PayloadView/index.native.js.map +1 -1
  96. package/dist/jsx/images/RemoteArt/index.native.js +3 -1
  97. package/dist/jsx/images/RemoteArt/index.native.js.map +1 -1
  98. package/dist/jsx/images/RemoteArt/svgMarkup.mjs +36 -28
  99. package/dist/jsx/images/RemoteArt/svgMarkup.mjs.map +1 -1
  100. package/dist/jsx/images/RemoteArt/svgMarkup.native.js +66 -58
  101. package/dist/jsx/images/RemoteArt/svgMarkup.native.js.map +1 -1
  102. package/dist/jsx/layouts/AsyncBoundary.mjs +9 -8
  103. package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
  104. package/dist/jsx/layouts/AsyncBoundary.native.js +9 -8
  105. package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
  106. package/dist/jsx/views/Dashboard.mjs +44 -30
  107. package/dist/jsx/views/Dashboard.mjs.map +1 -1
  108. package/dist/jsx/views/Dashboard.native.js +46 -28
  109. package/dist/jsx/views/Dashboard.native.js.map +1 -1
  110. package/dist/jsx/views/FilePreview.mjs +91 -48
  111. package/dist/jsx/views/FilePreview.mjs.map +1 -1
  112. package/dist/jsx/views/FilePreview.native.js +98 -54
  113. package/dist/jsx/views/FilePreview.native.js.map +1 -1
  114. package/dist/jsx/views/ListGroup.mjs +69 -54
  115. package/dist/jsx/views/ListGroup.mjs.map +1 -1
  116. package/dist/jsx/views/ListGroup.native.js +78 -61
  117. package/dist/jsx/views/ListGroup.native.js.map +1 -1
  118. package/dist/jsx/views/ListRow.mjs +2 -1
  119. package/dist/jsx/views/ListRow.mjs.map +1 -1
  120. package/dist/jsx/views/ListRow.native.js +2 -1
  121. package/dist/jsx/views/ListRow.native.js.map +1 -1
  122. package/package.json +7 -7
  123. package/src/Chip/index.tsx +2 -1
  124. package/src/DropdownMenu/index.tsx +39 -26
  125. package/src/SheetModal/index.tsx +2 -1
  126. package/src/SwipeDismissRow/SwipeDismissRow.stories.tsx +2 -1
  127. package/src/appShell/AppShell.stories.tsx +8 -11
  128. package/src/appShell/AppShell.tsx +8 -6
  129. package/src/code/PayloadView/index.tsx +4 -2
  130. package/src/images/RemoteArt/index.native.tsx +1 -1
  131. package/src/images/RemoteArt/svgMarkup.ts +56 -41
  132. package/src/layouts/AsyncBoundary.tsx +9 -5
  133. package/src/views/Dashboard.tsx +48 -40
  134. package/src/views/FilePreview.tsx +84 -46
  135. package/src/views/ListGroup.stories.tsx +1 -1
  136. package/src/views/ListGroup.tsx +99 -55
  137. package/src/views/ListRow.tsx +2 -1
  138. package/types/Chip/index.d.ts.map +1 -1
  139. package/types/DropdownMenu/index.d.ts.map +1 -1
  140. package/types/SheetModal/index.d.ts.map +1 -1
  141. package/types/appShell/AppShell.d.ts.map +1 -1
  142. package/types/layouts/AsyncBoundary.d.ts.map +1 -1
  143. package/types/views/Dashboard.d.ts.map +1 -1
  144. package/types/views/FilePreview.d.ts.map +1 -1
  145. package/types/views/ListGroup.d.ts.map +1 -1
  146. package/types/views/ListRow.d.ts.map +1 -1
@@ -121,6 +121,67 @@ function FileGlyph({
121
121
  if (!isTextFile(file)) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileIcon, {});
122
122
  return isProse(file) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileTextIcon, {}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileCodeIcon, {});
123
123
  }
124
+ function useRowViewer(file, onOpen) {
125
+ const host = useFileViewerHost();
126
+ const [open, setOpen] = (0, import_react2.useState)(false);
127
+ const show = () => {
128
+ if (onOpen) onOpen(file);else if (host) host.open(file);else setOpen(true);
129
+ };
130
+ const hostSelected = host?.file != null && fileKey(host.file) === fileKey(file);
131
+ return {
132
+ open,
133
+ setOpen,
134
+ show,
135
+ hostSelected,
136
+ owned: onOpen == null && host == null
137
+ };
138
+ }
139
+ function FilePreviewWell({
140
+ file,
141
+ preview,
142
+ iconSize
143
+ }) {
144
+ const {
145
+ knobProps
146
+ } = (0, import_theme.useResolvedKnobs)();
147
+ const caption = knobProps.textRole.caption;
148
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
149
+ ...knobProps.gap,
150
+ paddingBottom: "$1",
151
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
152
+ flexShrink: 0,
153
+ width: file.thumbnail ? "$true" : iconSize
154
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
155
+ "aria-hidden": true,
156
+ flex: 1,
157
+ minWidth: 0,
158
+ backgroundColor: "$backgroundPress",
159
+ borderRadius: knobProps.borderRadius.borderRadius,
160
+ borderWidth: 0,
161
+ paddingHorizontal: "$3",
162
+ paddingVertical: "$2",
163
+ overflow: "hidden",
164
+ ...{
165
+ "data-file-preview": "",
166
+ "data-code-well": ""
167
+ },
168
+ children: preview.map((line, index) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
169
+ fontFamily: "$mono",
170
+ letterSpacing: 0,
171
+ fontSize: caption.fontSize,
172
+ lineHeight: caption.lineHeight,
173
+ color: caption.color,
174
+ numberOfLines: 1,
175
+ whiteSpace: "pre",
176
+ userSelect: "none",
177
+ ...{
178
+ "data-preview-line": ""
179
+ },
180
+ children: line || " "
181
+ }, index))
182
+ })]
183
+ });
184
+ }
124
185
  function FilePreviewRow({
125
186
  file,
126
187
  onOpen,
@@ -132,18 +193,28 @@ function FilePreviewRow({
132
193
  const {
133
194
  knobProps
134
195
  } = (0, import_theme.useResolvedKnobs)();
135
- const host = useFileViewerHost();
136
- const [open, setOpen] = (0, import_react2.useState)(false);
196
+ const {
197
+ open,
198
+ setOpen,
199
+ show,
200
+ hostSelected,
201
+ owned
202
+ } = useRowViewer(file, onOpen);
137
203
  const preview = filePreviewLines(file, lines);
138
204
  const viewable = isViewableFile(file);
139
- const owned = onOpen == null && host == null;
140
205
  const iconSize = (0, import_ListRow.listLeadingIconSize)(knobProps.sizeToken);
141
- const caption = knobProps.textRole.caption;
142
206
  let press;
143
- if (viewable) press = () => onOpen ? onOpen(file) : host ? host.open(file) : setOpen(true);else if (onDownload) press = () => onDownload(file);
144
- const hostSelected = host?.file != null && fileKey(host.file) === fileKey(file);
145
- const trailing = viewable ? import_react.CaretRightIcon : onDownload ? import_react.DownloadSimpleIcon : null;
146
- const TrailingIcon = trailing;
207
+ let action = "none";
208
+ let TrailingIcon = null;
209
+ if (viewable) {
210
+ press = show;
211
+ action = "view";
212
+ TrailingIcon = import_react.CaretRightIcon;
213
+ } else if (onDownload) {
214
+ press = () => onDownload(file);
215
+ action = "download";
216
+ TrailingIcon = import_react.DownloadSimpleIcon;
217
+ }
147
218
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
148
219
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_ListGroup.ListGroupItem, {
149
220
  onPress: press,
@@ -151,7 +222,7 @@ function FilePreviewRow({
151
222
  "aria-label": file.meta ? `${file.name}, ${file.meta}` : file.name,
152
223
  ...{
153
224
  "data-file-row": preview.length ? "preview" : "plain",
154
- "data-file-action": viewable ? "view" : onDownload ? "download" : "none"
225
+ "data-file-action": action
155
226
  },
156
227
  children: [Array.from({
157
228
  length: indent
@@ -174,41 +245,10 @@ function FilePreviewRow({
174
245
  title: file.name,
175
246
  subtitle: file.meta
176
247
  })
177
- }), preview.length ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
178
- ...knobProps.gap,
179
- paddingBottom: "$1",
180
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
181
- flexShrink: 0,
182
- width: file.thumbnail ? "$true" : iconSize
183
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
184
- "aria-hidden": true,
185
- flex: 1,
186
- minWidth: 0,
187
- backgroundColor: "$backgroundPress",
188
- borderRadius: knobProps.borderRadius.borderRadius,
189
- borderWidth: 0,
190
- paddingHorizontal: "$3",
191
- paddingVertical: "$2",
192
- overflow: "hidden",
193
- ...{
194
- "data-file-preview": "",
195
- "data-code-well": ""
196
- },
197
- children: preview.map((line, index) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
198
- fontFamily: "$mono",
199
- letterSpacing: 0,
200
- fontSize: caption.fontSize,
201
- lineHeight: caption.lineHeight,
202
- color: caption.color,
203
- numberOfLines: 1,
204
- whiteSpace: "pre",
205
- userSelect: "none",
206
- ...{
207
- "data-preview-line": ""
208
- },
209
- children: line || " "
210
- }, index))
211
- })]
248
+ }), preview.length ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(FilePreviewWell, {
249
+ file,
250
+ preview,
251
+ iconSize
212
252
  }) : null]
213
253
  }), TrailingIcon ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ListRow.ListRowMeta, {
214
254
  children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TrailingIcon, {
@@ -269,10 +309,10 @@ function shareFile(file, text) {
269
309
  URL.revokeObjectURL(href);
270
310
  return;
271
311
  }
272
- void import_react_native.Share.share({
312
+ import_react_native.Share.share({
273
313
  title: file.name,
274
314
  message: text
275
- }).catch(() => {});
315
+ }).catch(() => void 0);
276
316
  }
277
317
  function withBreaks(content) {
278
318
  if (!import_tamagui.isWeb || !/[/:,=&?]/.test(content)) return content;
@@ -357,6 +397,7 @@ function useFileViewerParts(file, open, onClose) {
357
397
  } = (0, import_theme.useResolvedKnobs)();
358
398
  const {
359
399
  region,
400
+ report,
360
401
  copy
361
402
  } = (0, import_copy.useCopyFeedback)();
362
403
  const {
@@ -370,14 +411,16 @@ function useFileViewerParts(file, open, onClose) {
370
411
  key: "copy",
371
412
  icon: import_react.CopyIcon,
372
413
  label: t("Copy"),
373
- onPress: () => void copy(text)
414
+ onPress: () => {
415
+ copy(text).catch(() => report(false));
416
+ }
374
417
  }, {
375
418
  key: "share",
376
419
  icon: import_react.ShareNetworkIcon,
377
420
  label: t("Share"),
378
421
  onPress: () => shareFile(file, text)
379
422
  }];
380
- }, [copy, file, t, text]);
423
+ }, [copy, file, report, t, text]);
381
424
  if (!file) return null;
382
425
  const title = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
383
426
  flex: 1,
@@ -129,6 +129,70 @@ function FileGlyph(param) {
129
129
  if (!isTextFile(file)) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileIcon, {});
130
130
  return isProse(file) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileTextIcon, {}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.FileCodeIcon, {});
131
131
  }
132
+ function useRowViewer(file, onOpen) {
133
+ var host = useFileViewerHost();
134
+ var [open, setOpen] = (0, import_react2.useState)(false);
135
+ var show = function show2() {
136
+ if (onOpen) onOpen(file);else if (host) host.open(file);else setOpen(true);
137
+ };
138
+ var hostSelected = (host === null || host === void 0 ? void 0 : host.file) != null && fileKey(host.file) === fileKey(file);
139
+ return {
140
+ open,
141
+ setOpen,
142
+ show,
143
+ hostSelected,
144
+ owned: onOpen == null && host == null
145
+ };
146
+ }
147
+ function FilePreviewWell(param) {
148
+ var {
149
+ file,
150
+ preview,
151
+ iconSize
152
+ } = param;
153
+ var {
154
+ knobProps
155
+ } = (0, import_theme.useResolvedKnobs)();
156
+ var caption = knobProps.textRole.caption;
157
+ return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
158
+ ...knobProps.gap,
159
+ paddingBottom: "$1",
160
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
161
+ flexShrink: 0,
162
+ width: file.thumbnail ? "$true" : iconSize
163
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
164
+ "aria-hidden": true,
165
+ flex: 1,
166
+ minWidth: 0,
167
+ backgroundColor: "$backgroundPress",
168
+ borderRadius: knobProps.borderRadius.borderRadius,
169
+ borderWidth: 0,
170
+ paddingHorizontal: "$3",
171
+ paddingVertical: "$2",
172
+ overflow: "hidden",
173
+ ...{
174
+ "data-file-preview": "",
175
+ "data-code-well": ""
176
+ },
177
+ children: preview.map(function (line, index) {
178
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
179
+ fontFamily: "$mono",
180
+ letterSpacing: 0,
181
+ fontSize: caption.fontSize,
182
+ lineHeight: caption.lineHeight,
183
+ color: caption.color,
184
+ numberOfLines: 1,
185
+ whiteSpace: "pre",
186
+ userSelect: "none",
187
+ ...{
188
+ "data-preview-line": ""
189
+ },
190
+ children: line || " "
191
+ }, index);
192
+ })
193
+ })]
194
+ });
195
+ }
132
196
  function FilePreviewRow(param) {
133
197
  var {
134
198
  file,
@@ -141,22 +205,30 @@ function FilePreviewRow(param) {
141
205
  var {
142
206
  knobProps
143
207
  } = (0, import_theme.useResolvedKnobs)();
144
- var host = useFileViewerHost();
145
- var [open, setOpen] = (0, import_react2.useState)(false);
208
+ var {
209
+ open,
210
+ setOpen,
211
+ show,
212
+ hostSelected,
213
+ owned
214
+ } = useRowViewer(file, onOpen);
146
215
  var preview = filePreviewLines(file, lines);
147
216
  var viewable = isViewableFile(file);
148
- var owned = onOpen == null && host == null;
149
217
  var iconSize = (0, import_ListRow.listLeadingIconSize)(knobProps.sizeToken);
150
- var caption = knobProps.textRole.caption;
151
218
  var press;
152
- if (viewable) press = function press2() {
153
- return onOpen ? onOpen(file) : host ? host.open(file) : setOpen(true);
154
- };else if (onDownload) press = function press2() {
155
- return onDownload(file);
156
- };
157
- var hostSelected = (host === null || host === void 0 ? void 0 : host.file) != null && fileKey(host.file) === fileKey(file);
158
- var trailing = viewable ? import_react.CaretRightIcon : onDownload ? import_react.DownloadSimpleIcon : null;
159
- var TrailingIcon = trailing;
219
+ var action = "none";
220
+ var TrailingIcon = null;
221
+ if (viewable) {
222
+ press = show;
223
+ action = "view";
224
+ TrailingIcon = import_react.CaretRightIcon;
225
+ } else if (onDownload) {
226
+ press = function press2() {
227
+ return onDownload(file);
228
+ };
229
+ action = "download";
230
+ TrailingIcon = import_react.DownloadSimpleIcon;
231
+ }
160
232
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
161
233
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_ListGroup.ListGroupItem, {
162
234
  onPress: press,
@@ -164,7 +236,7 @@ function FilePreviewRow(param) {
164
236
  "aria-label": file.meta ? `${file.name}, ${file.meta}` : file.name,
165
237
  ...{
166
238
  "data-file-row": preview.length ? "preview" : "plain",
167
- "data-file-action": viewable ? "view" : onDownload ? "download" : "none"
239
+ "data-file-action": action
168
240
  },
169
241
  children: [Array.from({
170
242
  length: indent
@@ -189,43 +261,10 @@ function FilePreviewRow(param) {
189
261
  title: file.name,
190
262
  subtitle: file.meta
191
263
  })
192
- }), preview.length ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
193
- ...knobProps.gap,
194
- paddingBottom: "$1",
195
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
196
- flexShrink: 0,
197
- width: file.thumbnail ? "$true" : iconSize
198
- }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
199
- "aria-hidden": true,
200
- flex: 1,
201
- minWidth: 0,
202
- backgroundColor: "$backgroundPress",
203
- borderRadius: knobProps.borderRadius.borderRadius,
204
- borderWidth: 0,
205
- paddingHorizontal: "$3",
206
- paddingVertical: "$2",
207
- overflow: "hidden",
208
- ...{
209
- "data-file-preview": "",
210
- "data-code-well": ""
211
- },
212
- children: preview.map(function (line, index) {
213
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
214
- fontFamily: "$mono",
215
- letterSpacing: 0,
216
- fontSize: caption.fontSize,
217
- lineHeight: caption.lineHeight,
218
- color: caption.color,
219
- numberOfLines: 1,
220
- whiteSpace: "pre",
221
- userSelect: "none",
222
- ...{
223
- "data-preview-line": ""
224
- },
225
- children: line || " "
226
- }, index);
227
- })
228
- })]
264
+ }), preview.length ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(FilePreviewWell, {
265
+ file,
266
+ preview,
267
+ iconSize
229
268
  }) : null]
230
269
  }), TrailingIcon ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ListRow.ListRowMeta, {
231
270
  children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TrailingIcon, {
@@ -290,10 +329,12 @@ function shareFile(file, text) {
290
329
  URL.revokeObjectURL(href);
291
330
  return;
292
331
  }
293
- void import_react_native.Share.share({
332
+ import_react_native.Share.share({
294
333
  title: file.name,
295
334
  message: text
296
- }).catch(function () {});
335
+ }).catch(function () {
336
+ return void 0;
337
+ });
297
338
  }
298
339
  function withBreaks(content) {
299
340
  var _pieces_;
@@ -391,6 +432,7 @@ function useFileViewerParts(file, open, onClose) {
391
432
  } = (0, import_theme.useResolvedKnobs)();
392
433
  var {
393
434
  region,
435
+ report,
394
436
  copy
395
437
  } = (0, import_copy.useCopyFeedback)();
396
438
  var {
@@ -405,7 +447,9 @@ function useFileViewerParts(file, open, onClose) {
405
447
  icon: import_react.CopyIcon,
406
448
  label: t("Copy"),
407
449
  onPress: function onPress() {
408
- return void copy(text);
450
+ copy(text).catch(function () {
451
+ return report(false);
452
+ });
409
453
  }
410
454
  }, {
411
455
  key: "share",
@@ -415,7 +459,7 @@ function useFileViewerParts(file, open, onClose) {
415
459
  return shareFile(file, text);
416
460
  }
417
461
  }];
418
- }, [copy, file, t, text]);
462
+ }, [copy, file, report, t, text]);
419
463
  if (!file) return null;
420
464
  var title = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
421
465
  flex: 1,