react-smart-copy 1.19.0 → 1.19.1
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 +10 -9
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -686,7 +686,7 @@ documents with a CommonMark parser and compare the result character by character
|
|
|
686
686
|
- images default to their alt text (`images: "alt"`), so rendering the Markdown loads no tracking pixels. `"keep"` writes `` for `https:`/`http:` images, `"drop"` removes them
|
|
687
687
|
- `maxLength` (16 MiB), `maxNodes` (200,000) and `maxDepth` (200) bound the work; content left out sets `truncated: true`, and merged-cell expansion is capped
|
|
688
688
|
|
|
689
|
-
| Option | Default | |
|
|
689
|
+
| Option | Default | Notes |
|
|
690
690
|
| ------ | ------- | - |
|
|
691
691
|
| `images` | `"alt"` | `"alt"`, `"keep"` or `"drop"` |
|
|
692
692
|
| `links` | `"keep"` | `"text"` keeps only the link text |
|
|
@@ -764,7 +764,7 @@ Pasted code is never cut: past `maxLength` (2,000,000 characters) `pasteToCode`
|
|
|
764
764
|
`too-large` error, and `pasteAsCode` leaves the paste to the browser. HTML is parsed
|
|
765
765
|
inertly and only its text is used.
|
|
766
766
|
|
|
767
|
-
| Option | Default | |
|
|
767
|
+
| Option | Default | Notes |
|
|
768
768
|
| ------ | ------- | - |
|
|
769
769
|
| `prompt` | `"auto"` copy, `false` paste | a style (`"shell"`, `"powershell"`, `"cmd"`, `"python"`, `"ipython"`, `"node"`), `{ command, continuation }` regexes, or `false` |
|
|
770
770
|
| `diff` | `false` | `"after"` or `"before"` |
|
|
@@ -838,7 +838,7 @@ const info = await readImageInfo(file);
|
|
|
838
838
|
const { blob, removed } = await stripMetadata(file); // bit-for-bit the same picture
|
|
839
839
|
```
|
|
840
840
|
|
|
841
|
-
| Option (`prepareImage`) | Default | |
|
|
841
|
+
| Option (`prepareImage`) | Default | Notes |
|
|
842
842
|
| ----------------------- | ------- | - |
|
|
843
843
|
| `maxWidth` / `maxHeight` | none | only ever makes images smaller |
|
|
844
844
|
| `maxPixels` | 16,777,216 | Safari's canvas limit |
|
|
@@ -932,7 +932,7 @@ usePaste({ accept: ["text", "html", "text/uri-list"], onPaste: (result) => {
|
|
|
932
932
|
} });
|
|
933
933
|
```
|
|
934
934
|
|
|
935
|
-
| Option | Default | |
|
|
935
|
+
| Option | Default | Notes |
|
|
936
936
|
| ------ | ------- | - |
|
|
937
937
|
| `text` | `"url"` | plain text: `"url"`, `"title"`, `"title-and-url"` or `"markdown"` |
|
|
938
938
|
| `target` | clipboard | `"drag"` adds `text/uri-list` and `text/x-moz-url` |
|
|
@@ -1000,7 +1000,7 @@ The output is property-tested against hostile HTML. [DOMPurify](https://github.c
|
|
|
1000
1000
|
finds nothing to remove from it, and running the output through again changes nothing.
|
|
1001
1001
|
In Chromium, Firefox and WebKit, the computed styles are checked end to end.
|
|
1002
1002
|
|
|
1003
|
-
| Option | Default | |
|
|
1003
|
+
| Option | Default | Notes |
|
|
1004
1004
|
| --- | --- | --- |
|
|
1005
1005
|
| `colors` | `"readable"` | `"keep"`, `"none"` |
|
|
1006
1006
|
| `background` | `"#ffffff"` | where it is pasted, for readability |
|
|
@@ -1136,7 +1136,7 @@ contrastLevel(contrastRatio("#767676", "#fff")); // "AA" (4.54)
|
|
|
1136
1136
|
parseColor("hsl(1turn 100% 50% / 50%)"); // { r: 1, g: 0, b: 0, alpha: 0.5 }
|
|
1137
1137
|
```
|
|
1138
1138
|
|
|
1139
|
-
| Option (`formatColor`, `colorPayload`) | Default | |
|
|
1139
|
+
| Option (`formatColor`, `colorPayload`) | Default | Notes |
|
|
1140
1140
|
| --- | --- | --- |
|
|
1141
1141
|
| `format` | `"hex"` | `colorPayload` only |
|
|
1142
1142
|
| `gamut` | `"map"` | `"clip"` |
|
|
@@ -1674,7 +1674,7 @@ embedded webviews. Where a capability is missing you get a typed error, never a
|
|
|
1674
1674
|
- ~~**1.18** One shared copy of the core across entry points: smaller bundles when you use several modules, and one `CopyFailure` class~~ shipped
|
|
1675
1675
|
- ~~**1.19** `react-smart-copy/rich`, paste side: paste from Word, Google Docs and web pages into rich-text editors as clean, safe HTML~~ shipped
|
|
1676
1676
|
|
|
1677
|
-
Full history: [CHANGELOG.md](./CHANGELOG.md) or the [Releases page](https://suprabhat02.github.io/react-smart-copy
|
|
1677
|
+
Full history: [CHANGELOG.md](./CHANGELOG.md) or the [Releases page](https://suprabhat02.github.io/react-smart-copy/project/releases/).
|
|
1678
1678
|
|
|
1679
1679
|
## Development
|
|
1680
1680
|
|
|
@@ -1682,8 +1682,9 @@ Full history: [CHANGELOG.md](./CHANGELOG.md) or the [Releases page](https://supr
|
|
|
1682
1682
|
npm install
|
|
1683
1683
|
npm run verify # lint, types, tests at 100% coverage, build, publint + attw, consumer types, size budgets
|
|
1684
1684
|
npm run changeset # describe your change for the changelog
|
|
1685
|
-
npm run
|
|
1686
|
-
npm run
|
|
1685
|
+
npm run docs:install # once: the docs site has its own lockfile, in docs/
|
|
1686
|
+
npm run docs:dev # the docs, with live demos, at http://localhost:4321/react-smart-copy/
|
|
1687
|
+
npm run docs:build && npm run test:e2e # end-to-end tests in Chromium, Firefox and WebKit
|
|
1687
1688
|
```
|
|
1688
1689
|
|
|
1689
1690
|
Releases are automated: merging the "chore: release" PR publishes to npm through
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-smart-copy",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Headless, type-safe clipboard interactions for React: copy and paste text, rich HTML, images, spreadsheet tables, typed application data, Markdown, code, privacy-safe images, links, sharing, colours, portable rich text and clean pastes from Word and Google Docs, with coordinated copy groups, SVG/DOM capture, Trojan Source and homoglyph detection, honest error states, retry and screen-reader announcements.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -292,8 +292,9 @@
|
|
|
292
292
|
"verify": "npm run lint && npm run typecheck && npm run test:coverage && npm run build && node scripts/check-dist.js && npm run lint:package && npm run types:consumer && npm run size",
|
|
293
293
|
"changeset": "changeset",
|
|
294
294
|
"release": "npm run verify && changeset publish",
|
|
295
|
-
"
|
|
296
|
-
"
|
|
295
|
+
"docs:install": "npm ci --prefix docs",
|
|
296
|
+
"docs:dev": "npm run build && npm run dev --prefix docs",
|
|
297
|
+
"docs:build": "npm run build && npm run build --prefix docs",
|
|
297
298
|
"test:coverage": "vitest run --coverage --exclude \"**/*.property.test.ts\" && npm run test:property",
|
|
298
299
|
"test:property": "vitest run property.test",
|
|
299
300
|
"types:consumer": "tsc -p consumer/tsconfig.bundler.json && tsc -p consumer/tsconfig.nodenext.json",
|