react-smart-copy 1.2.0 → 1.4.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 +83 -16
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.js.map +1 -1
- package/dist/core.cjs +94 -19
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +149 -74
- package/dist/core.d.ts +149 -74
- package/dist/core.js +94 -20
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +176 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +181 -79
- package/dist/index.d.ts +181 -79
- package/dist/index.js +176 -28
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -102,9 +102,19 @@ const PASTE_DESCRIPTIONS = {
|
|
|
102
102
|
function describeCopyError(error) {
|
|
103
103
|
return COPY_DESCRIPTIONS[error.type];
|
|
104
104
|
}
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
/** Drops can only fail in these ways; the rest of the paste wording would mention the clipboard. */
|
|
106
|
+
const DROP_DESCRIPTIONS = {
|
|
107
|
+
"invalid-payload": "The dropped content couldn't be read.",
|
|
108
|
+
"no-content": "Nothing that was dropped can be used here.",
|
|
109
|
+
"too-large": "The dropped content is too large.",
|
|
110
|
+
unknown: "Couldn't read the dropped content. Try again."
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Default English, user-facing sentence for a paste error. Pass the error
|
|
114
|
+
* state's `source` to word drag-and-drop failures as drops. Replace for i18n.
|
|
115
|
+
*/
|
|
116
|
+
function describePasteError(error, source) {
|
|
117
|
+
return (source === "drop" ? DROP_DESCRIPTIONS[error.type] : void 0) ?? PASTE_DESCRIPTIONS[error.type];
|
|
108
118
|
}
|
|
109
119
|
//#endregion
|
|
110
120
|
//#region src/core/payload.ts
|
|
@@ -379,8 +389,10 @@ function invoke(fn, ...args) {
|
|
|
379
389
|
function createOperations() {
|
|
380
390
|
let controller;
|
|
381
391
|
const abort = () => {
|
|
382
|
-
controller
|
|
392
|
+
if (!controller) return false;
|
|
393
|
+
controller.abort();
|
|
383
394
|
controller = void 0;
|
|
395
|
+
return true;
|
|
384
396
|
};
|
|
385
397
|
return {
|
|
386
398
|
start: () => {
|
|
@@ -568,17 +580,21 @@ function createCopyMachine(options = {}) {
|
|
|
568
580
|
};
|
|
569
581
|
const reset = () => {
|
|
570
582
|
++generation;
|
|
571
|
-
operations.abort();
|
|
583
|
+
const cancelled = operations.abort();
|
|
572
584
|
clearResetTimer();
|
|
585
|
+
const wasIdle = state.status === "idle";
|
|
573
586
|
setState(IDLE_STATE);
|
|
587
|
+
if (cancelled) invoke(read().onCancel, "reset");
|
|
588
|
+
if (!wasIdle) invoke(read().onReset);
|
|
574
589
|
};
|
|
575
590
|
const connect = () => {
|
|
576
591
|
if (state.status === "copied") scheduleReset(state);
|
|
577
592
|
return () => {
|
|
578
593
|
++generation;
|
|
579
|
-
operations.abort();
|
|
594
|
+
const cancelled = operations.abort();
|
|
580
595
|
clearResetTimer();
|
|
581
596
|
if (state.status === "copying") setState(IDLE_STATE);
|
|
597
|
+
if (cancelled) invoke(read().onCancel, "disconnect");
|
|
582
598
|
};
|
|
583
599
|
};
|
|
584
600
|
return {
|
|
@@ -597,6 +613,14 @@ function createCopyMachine(options = {}) {
|
|
|
597
613
|
}
|
|
598
614
|
//#endregion
|
|
599
615
|
//#region src/core/paste-reader.ts
|
|
616
|
+
/** Adds the derived fields to an adapter's result. Any `imageFiles` it carried is recomputed. */
|
|
617
|
+
function completePasteResult(result) {
|
|
618
|
+
const images = new Set(result.images);
|
|
619
|
+
return {
|
|
620
|
+
...result,
|
|
621
|
+
imageFiles: result.files.filter((file) => images.has(file))
|
|
622
|
+
};
|
|
623
|
+
}
|
|
600
624
|
const DEFAULT_PASTE_ACCEPT = /* @__PURE__ */ Object.freeze(["text"]);
|
|
601
625
|
const DEFAULT_PASTE_MAX_BYTES = 33554432;
|
|
602
626
|
const DEFAULT_PASTE_MAX_ITEMS = 32;
|
|
@@ -652,13 +676,52 @@ function createBudget(options) {
|
|
|
652
676
|
if (bytes > options.maxBytes) throw copyFailure("too-large", `The paste exceeds the ${String(options.maxBytes)}-byte limit.`);
|
|
653
677
|
} };
|
|
654
678
|
}
|
|
655
|
-
|
|
679
|
+
/**
|
|
680
|
+
* UTF-8 byte length of a string, without allocating an encoded copy.
|
|
681
|
+
* Lone surrogates count 3 bytes, as `TextEncoder` / `Blob` encode them as U+FFFD.
|
|
682
|
+
*/
|
|
683
|
+
function utf8ByteLength(text) {
|
|
684
|
+
let bytes = 0;
|
|
685
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
686
|
+
const unit = text.charCodeAt(i);
|
|
687
|
+
if (unit < 128) bytes += 1;
|
|
688
|
+
else if (unit < 2048) bytes += 2;
|
|
689
|
+
else if (unit >= 55296 && unit <= 56319 && i + 1 < text.length && (text.charCodeAt(i + 1) & 64512) === 56320) {
|
|
690
|
+
bytes += 4;
|
|
691
|
+
i += 1;
|
|
692
|
+
} else bytes += 3;
|
|
693
|
+
}
|
|
694
|
+
return bytes;
|
|
695
|
+
}
|
|
696
|
+
/** Strings are measured as UTF-8, the same unit `Blob.size` reports for clipboard items. */
|
|
697
|
+
const sizeOf = (data) => typeof data === "string" ? utf8ByteLength(data) : data.size;
|
|
656
698
|
/** Throws `too-large` when the entries break `maxItems` / `maxBytes`. */
|
|
657
699
|
function enforcePasteLimits(entries, options) {
|
|
658
700
|
const budget = createBudget(options);
|
|
659
701
|
for (const entry of entries) budget.charge(sizeOf(entry.data));
|
|
660
702
|
}
|
|
661
703
|
/**
|
|
704
|
+
* Whether a drag in progress could drop anything `accept`s. Uses only what
|
|
705
|
+
* browsers expose before the drop (item kinds and types, never the data).
|
|
706
|
+
* A file whose type is not known yet (some browsers hide it while dragging)
|
|
707
|
+
* counts as a maybe: the drop itself is checked against `accept`.
|
|
708
|
+
*/
|
|
709
|
+
function canAcceptDrag(data, options) {
|
|
710
|
+
const items = data.items ?? Array.from(data.types, (type) => type === "Files" ? {
|
|
711
|
+
kind: "file",
|
|
712
|
+
type: ""
|
|
713
|
+
} : {
|
|
714
|
+
kind: "string",
|
|
715
|
+
type
|
|
716
|
+
});
|
|
717
|
+
return Array.from(items).some(({ kind, type: raw }) => {
|
|
718
|
+
const file = kind === "file";
|
|
719
|
+
const type = normalizeMimeType(raw);
|
|
720
|
+
if (type === null) return file;
|
|
721
|
+
return (file || isTextualMimeType(type)) && isAccepted(type, options);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
662
725
|
* Synchronously copies the accepted parts of a paste event's `DataTransfer`.
|
|
663
726
|
* It must run during the event: browsers empty the object afterwards.
|
|
664
727
|
*/
|
|
@@ -756,7 +819,7 @@ async function finalizePaste(entries, source, options) {
|
|
|
756
819
|
data
|
|
757
820
|
});
|
|
758
821
|
}
|
|
759
|
-
if (items.length === 0) throw copyFailure("no-content", "The
|
|
822
|
+
if (items.length === 0) throw copyFailure("no-content", "The content holds nothing that matches `accept`.");
|
|
760
823
|
return {
|
|
761
824
|
source,
|
|
762
825
|
items,
|
|
@@ -896,15 +959,17 @@ function createPasteMachine(options = {}) {
|
|
|
896
959
|
const run = (produce, source, retryCount) => {
|
|
897
960
|
clearResetTimer();
|
|
898
961
|
const current = ++generation;
|
|
962
|
+
const superseded = operations.abort();
|
|
899
963
|
const context = operations.start();
|
|
900
964
|
setState(PASTE_READING_STATE);
|
|
965
|
+
if (superseded) invoke(read().onCancel, "superseded");
|
|
901
966
|
let pending;
|
|
902
967
|
try {
|
|
903
968
|
pending = produce(context);
|
|
904
969
|
} catch (cause) {
|
|
905
970
|
pending = Promise.reject(cause);
|
|
906
971
|
}
|
|
907
|
-
return pending.then((result) => {
|
|
972
|
+
return pending.then(completePasteResult).then((result) => {
|
|
908
973
|
operations.end(context);
|
|
909
974
|
if (current === generation) {
|
|
910
975
|
const readState = {
|
|
@@ -946,19 +1011,21 @@ function createPasteMachine(options = {}) {
|
|
|
946
1011
|
}
|
|
947
1012
|
return readClipboard(state.retryCount + 1);
|
|
948
1013
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
if (!data) return Promise.resolve(IGNORED_NO_CONTENT);
|
|
1014
|
+
/** Shared by paste and drop events: their `DataTransfer` has the same shape and lifetime. */
|
|
1015
|
+
const transfer = (data, event, source) => {
|
|
952
1016
|
const current = read();
|
|
1017
|
+
if (source === "drop" && current.preventDefault !== false) event.preventDefault();
|
|
1018
|
+
if (!data) return Promise.resolve(IGNORED_NO_CONTENT);
|
|
953
1019
|
let resolved;
|
|
954
1020
|
try {
|
|
955
1021
|
resolved = resolvePasteReadOptions(current);
|
|
956
1022
|
} catch (cause) {
|
|
957
1023
|
const error = toCopyError(cause, "read");
|
|
958
1024
|
++generation;
|
|
959
|
-
operations.abort();
|
|
1025
|
+
const superseded = operations.abort();
|
|
960
1026
|
clearResetTimer();
|
|
961
|
-
settleError(error,
|
|
1027
|
+
settleError(error, source, 0);
|
|
1028
|
+
if (superseded) invoke(current.onCancel, "superseded");
|
|
962
1029
|
return Promise.resolve({
|
|
963
1030
|
status: "error",
|
|
964
1031
|
error
|
|
@@ -966,25 +1033,31 @@ function createPasteMachine(options = {}) {
|
|
|
966
1033
|
}
|
|
967
1034
|
const entries = snapshotDataTransfer(data, resolved);
|
|
968
1035
|
if (entries.length === 0) return Promise.resolve(IGNORED_NO_CONTENT);
|
|
969
|
-
if (current.preventDefault !== false) event.preventDefault();
|
|
1036
|
+
if (source === "event" && current.preventDefault !== false) event.preventDefault();
|
|
970
1037
|
return run(() => {
|
|
971
1038
|
enforcePasteLimits(entries, resolved);
|
|
972
|
-
return finalizePaste(entries,
|
|
973
|
-
},
|
|
1039
|
+
return finalizePaste(entries, source, resolved);
|
|
1040
|
+
}, source, 0);
|
|
974
1041
|
};
|
|
1042
|
+
const pasteEvent = (event) => transfer(event.clipboardData, event, "event");
|
|
1043
|
+
const dropEvent = (event) => transfer(event.dataTransfer, event, "drop");
|
|
975
1044
|
const reset = () => {
|
|
976
1045
|
++generation;
|
|
977
|
-
operations.abort();
|
|
1046
|
+
const cancelled = operations.abort();
|
|
978
1047
|
clearResetTimer();
|
|
1048
|
+
const wasIdle = state.status === "idle";
|
|
979
1049
|
setState(PASTE_IDLE_STATE);
|
|
1050
|
+
if (cancelled) invoke(read().onCancel, "reset");
|
|
1051
|
+
if (!wasIdle) invoke(read().onReset);
|
|
980
1052
|
};
|
|
981
1053
|
const connect = () => {
|
|
982
1054
|
if (state.status === "read") scheduleReset(state);
|
|
983
1055
|
return () => {
|
|
984
1056
|
++generation;
|
|
985
|
-
operations.abort();
|
|
1057
|
+
const cancelled = operations.abort();
|
|
986
1058
|
clearResetTimer();
|
|
987
1059
|
if (state.status === "reading") setState(PASTE_IDLE_STATE);
|
|
1060
|
+
if (cancelled) invoke(read().onCancel, "disconnect");
|
|
988
1061
|
};
|
|
989
1062
|
};
|
|
990
1063
|
return {
|
|
@@ -997,6 +1070,7 @@ function createPasteMachine(options = {}) {
|
|
|
997
1070
|
},
|
|
998
1071
|
paste,
|
|
999
1072
|
pasteEvent,
|
|
1073
|
+
dropEvent,
|
|
1000
1074
|
retry,
|
|
1001
1075
|
reset,
|
|
1002
1076
|
connect
|
|
@@ -1461,10 +1535,21 @@ const CopyField = {
|
|
|
1461
1535
|
//#endregion
|
|
1462
1536
|
//#region src/react/usePaste.ts
|
|
1463
1537
|
const getServerSnapshot = () => PASTE_IDLE_STATE;
|
|
1538
|
+
const DRAG_END_EVENTS = ["drop", "dragend"];
|
|
1539
|
+
/** A text field or editable region nested inside the drop target, which should keep its native drop. */
|
|
1540
|
+
const isNestedEditable = (event) => {
|
|
1541
|
+
const { target, currentTarget } = event;
|
|
1542
|
+
if (target === currentTarget || !(target instanceof HTMLElement)) return false;
|
|
1543
|
+
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA") return true;
|
|
1544
|
+
return target.isContentEditable && !(currentTarget instanceof HTMLElement && currentTarget.isContentEditable);
|
|
1545
|
+
};
|
|
1546
|
+
/** The drop effect the drag source allows, preferring copy: an effect it disallows cancels the drop. */
|
|
1547
|
+
const dropEffectFor = (allowed) => /^(all|uninitialized|copy)/.test(allowed) ? "copy" : /move/i.test(allowed) ? "move" : allowed === "link" ? "link" : "none";
|
|
1464
1548
|
/**
|
|
1465
1549
|
* Paste state machine bound to a component. Supports a "Paste" button
|
|
1466
|
-
* (`paste()`, may prompt for permission)
|
|
1467
|
-
*
|
|
1550
|
+
* (`paste()`, may prompt for permission), keyboard paste (`targetProps` or
|
|
1551
|
+
* `listenOnDocument`, no prompt) and drag-and-drop (`dropTargetProps`).
|
|
1552
|
+
* Options may change on every render.
|
|
1468
1553
|
*
|
|
1469
1554
|
* Everything in the result is untrusted user input.
|
|
1470
1555
|
*/
|
|
@@ -1491,6 +1576,48 @@ function usePaste(options = {}) {
|
|
|
1491
1576
|
const targetProps = useMemo(() => ({ onPaste: (event) => {
|
|
1492
1577
|
machine.pasteEvent(event);
|
|
1493
1578
|
} }), [machine]);
|
|
1579
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
1580
|
+
const dragDepth = useRef(0);
|
|
1581
|
+
const [endDrag] = useState(() => () => {
|
|
1582
|
+
dragDepth.current = 0;
|
|
1583
|
+
setIsDragOver(false);
|
|
1584
|
+
});
|
|
1585
|
+
const dropTargetProps = useMemo(() => {
|
|
1586
|
+
const accepts = (data) => {
|
|
1587
|
+
try {
|
|
1588
|
+
return canAcceptDrag(data, resolvePasteReadOptions(optionsRef.current));
|
|
1589
|
+
} catch {
|
|
1590
|
+
return true;
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
return {
|
|
1594
|
+
onDragEnter: (event) => {
|
|
1595
|
+
dragDepth.current += 1;
|
|
1596
|
+
if (accepts(event.dataTransfer)) setIsDragOver(true);
|
|
1597
|
+
},
|
|
1598
|
+
onDragOver: (event) => {
|
|
1599
|
+
if (isNestedEditable(event)) return;
|
|
1600
|
+
event.preventDefault();
|
|
1601
|
+
event.dataTransfer.dropEffect = accepts(event.dataTransfer) ? dropEffectFor(event.dataTransfer.effectAllowed) : "none";
|
|
1602
|
+
},
|
|
1603
|
+
onDragLeave: (event) => {
|
|
1604
|
+
const next = event.relatedTarget;
|
|
1605
|
+
dragDepth.current -= 1;
|
|
1606
|
+
if (dragDepth.current <= 0 || next instanceof Node && !event.currentTarget.contains(next)) endDrag();
|
|
1607
|
+
},
|
|
1608
|
+
onDrop: (event) => {
|
|
1609
|
+
endDrag();
|
|
1610
|
+
if (!isNestedEditable(event)) machine.dropEvent(event);
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
}, [machine, endDrag]);
|
|
1614
|
+
useEffect(() => {
|
|
1615
|
+
if (!isDragOver) return void 0;
|
|
1616
|
+
for (const type of DRAG_END_EVENTS) window.addEventListener(type, endDrag, true);
|
|
1617
|
+
return () => {
|
|
1618
|
+
for (const type of DRAG_END_EVENTS) window.removeEventListener(type, endDrag, true);
|
|
1619
|
+
};
|
|
1620
|
+
}, [isDragOver, endDrag]);
|
|
1494
1621
|
return useMemo(() => ({
|
|
1495
1622
|
state,
|
|
1496
1623
|
status: state.status,
|
|
@@ -1499,14 +1626,19 @@ function usePaste(options = {}) {
|
|
|
1499
1626
|
canRetry,
|
|
1500
1627
|
paste: machine.paste,
|
|
1501
1628
|
pasteEvent: machine.pasteEvent,
|
|
1629
|
+
dropEvent: machine.dropEvent,
|
|
1502
1630
|
retry: machine.retry,
|
|
1503
1631
|
reset: machine.reset,
|
|
1504
|
-
targetProps
|
|
1632
|
+
targetProps,
|
|
1633
|
+
dropTargetProps,
|
|
1634
|
+
isDragOver
|
|
1505
1635
|
}), [
|
|
1506
1636
|
state,
|
|
1507
1637
|
canRetry,
|
|
1508
1638
|
machine,
|
|
1509
|
-
targetProps
|
|
1639
|
+
targetProps,
|
|
1640
|
+
dropTargetProps,
|
|
1641
|
+
isDragOver
|
|
1510
1642
|
]);
|
|
1511
1643
|
}
|
|
1512
1644
|
//#endregion
|
|
@@ -1562,6 +1694,7 @@ function usePasteDisplayStatus(status, options = {}) {
|
|
|
1562
1694
|
//#region src/react/PasteField.tsx
|
|
1563
1695
|
const defaultPasteFieldMessages = {
|
|
1564
1696
|
pasted: "Pasted from clipboard",
|
|
1697
|
+
dropped: "Dropped content added",
|
|
1565
1698
|
error: describePasteError,
|
|
1566
1699
|
triggerLabel: (label) => `Paste ${label}`,
|
|
1567
1700
|
zoneLabel: (label) => `Paste area for ${label}`
|
|
@@ -1585,6 +1718,7 @@ const Root = /* @__PURE__ */ forwardRef(function PasteFieldRoot({ label, pasteOp
|
|
|
1585
1718
|
const zoneId = `${baseId}-zone`;
|
|
1586
1719
|
const messages = useMemo(() => ({
|
|
1587
1720
|
...defaultPasteFieldMessages,
|
|
1721
|
+
...messageOverrides?.pasted === void 0 ? {} : { dropped: messageOverrides.pasted },
|
|
1588
1722
|
...messageOverrides
|
|
1589
1723
|
}), [messageOverrides]);
|
|
1590
1724
|
const { paste: machinePaste } = pasteState;
|
|
@@ -1613,7 +1747,11 @@ const Root = /* @__PURE__ */ forwardRef(function PasteFieldRoot({ label, pasteOp
|
|
|
1613
1747
|
doPaste
|
|
1614
1748
|
]);
|
|
1615
1749
|
const { state } = pasteState;
|
|
1616
|
-
|
|
1750
|
+
let announcement = "";
|
|
1751
|
+
if (state.status === "read") {
|
|
1752
|
+
const message = (state.result.source === "drop" ? messages.dropped : void 0) ?? messages.pasted;
|
|
1753
|
+
announcement = typeof message === "function" ? message(state.result) : message;
|
|
1754
|
+
} else if (state.status === "error") announcement = messages.error(state.error, state.source);
|
|
1617
1755
|
return /* @__PURE__ */ jsx(PasteFieldContext.Provider, {
|
|
1618
1756
|
value: context,
|
|
1619
1757
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -1662,15 +1800,23 @@ const Status = /* @__PURE__ */ forwardRef(function PasteFieldStatus({ children,
|
|
|
1662
1800
|
});
|
|
1663
1801
|
/**
|
|
1664
1802
|
* A focusable paste target. Accepts keyboard paste (Ctrl/⌘+V) without a
|
|
1665
|
-
* permission prompt and
|
|
1803
|
+
* permission prompt and, unless `droppable={false}`, drag-and-drop. Renders
|
|
1804
|
+
* `data-zone` and `data-drag-over` for styling.
|
|
1666
1805
|
*
|
|
1667
1806
|
* Accessible name: `aria-label` prop, else `messages.zoneLabel(label)`
|
|
1668
1807
|
* ("Paste area for Notes"). Pass `aria-labelledby` explicitly to name it from
|
|
1669
1808
|
* another element instead.
|
|
1670
1809
|
*/
|
|
1671
|
-
const Zone = /* @__PURE__ */ forwardRef(function PasteFieldZone({ children, focusable = true, onPaste, "aria-label": ariaLabel, tabIndex, ...rest }, ref) {
|
|
1810
|
+
const Zone = /* @__PURE__ */ forwardRef(function PasteFieldZone({ children, focusable = true, droppable = true, onPaste, onDragEnter, onDragOver, onDragLeave, onDrop, "aria-label": ariaLabel, tabIndex, ...rest }, ref) {
|
|
1672
1811
|
const field = usePasteField();
|
|
1673
|
-
const { targetProps } = field;
|
|
1812
|
+
const { targetProps, dropTargetProps } = field;
|
|
1813
|
+
const drop = {
|
|
1814
|
+
onDragEnter,
|
|
1815
|
+
onDragOver,
|
|
1816
|
+
onDragLeave,
|
|
1817
|
+
onDrop
|
|
1818
|
+
};
|
|
1819
|
+
if (droppable) for (const key of Object.keys(dropTargetProps)) drop[key] = composeEventHandlers(drop[key], dropTargetProps[key]);
|
|
1674
1820
|
const safeAriaLabel = (ariaLabel ?? field.messages.zoneLabel(field.label)) || defaultPasteFieldMessages.zoneLabel(field.label);
|
|
1675
1821
|
return /* @__PURE__ */ jsx("div", {
|
|
1676
1822
|
"aria-keyshortcuts": "Control+V Meta+V",
|
|
@@ -1682,8 +1828,10 @@ const Zone = /* @__PURE__ */ forwardRef(function PasteFieldZone({ children, focu
|
|
|
1682
1828
|
"data-zone": "",
|
|
1683
1829
|
"data-state": field.status,
|
|
1684
1830
|
"data-display-state": field.displayStatus,
|
|
1831
|
+
"data-drag-over": droppable && field.isDragOver ? "" : void 0,
|
|
1685
1832
|
tabIndex: tabIndex ?? (focusable ? 0 : void 0),
|
|
1686
1833
|
onPaste: composeEventHandlers(onPaste, targetProps.onPaste),
|
|
1834
|
+
...drop,
|
|
1687
1835
|
children
|
|
1688
1836
|
});
|
|
1689
1837
|
});
|
|
@@ -1807,6 +1955,6 @@ const PasteField = {
|
|
|
1807
1955
|
})
|
|
1808
1956
|
};
|
|
1809
1957
|
//#endregion
|
|
1810
|
-
export { CopyFailure, CopyField, CopyGroup, DEFAULT_MAX_RETRIES, DEFAULT_MIN_PENDING_MS, DEFAULT_PASTE_ACCEPT, DEFAULT_PASTE_MAX_BYTES, DEFAULT_PASTE_MAX_ITEMS, DEFAULT_PASTE_MIN_PENDING_MS, DEFAULT_PASTE_PENDING_DELAY_MS, DEFAULT_PENDING_DELAY_MS, DEFAULT_RESET_AFTER_MS, IDLE_STATE, IMAGE_MIME_TYPE, LiveRegion, PASTE_IDLE_STATE, PasteField, SVG_MIME_TYPE, canRetryPasteState, canRetryState, copyFailure, createBrowserClipboardAdapter, createBrowserPasteAdapter, createCopyCoordinator, createCopyError, createCopyMachine, createPasteMachine, defaultCopyFieldMessages, defaultPasteFieldMessages, describeCopyError, describePasteError, isBlob, isCopyFailure, isRetryableError, isTextualMimeType, matchesMimePattern, normalizeMimeType, normalizePayload, resolveMaxRetries, resolvePasteReadOptions, serializeJson, sniffImageBytes, sniffImageType, toCopyError, useCopy, useCopyField, useCopyGroup, useDisplayStatus, usePaste, usePasteDisplayStatus, usePasteField, useRevealOnInteraction, validatePayload, visuallyHiddenStyle };
|
|
1958
|
+
export { CopyFailure, CopyField, CopyGroup, DEFAULT_MAX_RETRIES, DEFAULT_MIN_PENDING_MS, DEFAULT_PASTE_ACCEPT, DEFAULT_PASTE_MAX_BYTES, DEFAULT_PASTE_MAX_ITEMS, DEFAULT_PASTE_MIN_PENDING_MS, DEFAULT_PASTE_PENDING_DELAY_MS, DEFAULT_PENDING_DELAY_MS, DEFAULT_RESET_AFTER_MS, IDLE_STATE, IMAGE_MIME_TYPE, LiveRegion, PASTE_IDLE_STATE, PasteField, SVG_MIME_TYPE, canAcceptDrag, canRetryPasteState, canRetryState, copyFailure, createBrowserClipboardAdapter, createBrowserPasteAdapter, createCopyCoordinator, createCopyError, createCopyMachine, createPasteMachine, defaultCopyFieldMessages, defaultPasteFieldMessages, describeCopyError, describePasteError, isBlob, isCopyFailure, isRetryableError, isTextualMimeType, matchesMimePattern, normalizeMimeType, normalizePayload, resolveMaxRetries, resolvePasteReadOptions, serializeJson, sniffImageBytes, sniffImageType, toCopyError, useCopy, useCopyField, useCopyGroup, useDisplayStatus, usePaste, usePasteDisplayStatus, usePasteField, useRevealOnInteraction, validatePayload, visuallyHiddenStyle };
|
|
1811
1959
|
|
|
1812
1960
|
//# sourceMappingURL=index.js.map
|