@react-spot/plugin-copy-to-clipboard 0.0.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 ADDED
@@ -0,0 +1,46 @@
1
+ # @react-spot/plugin-copy-to-clipboard
2
+
3
+ `@react-spot/plugin-copy-to-clipboard` adds a `Copy path` item to the Trace action panel for selections that have source information.
4
+
5
+ When you trigger the action, the plugin copies a project-relative `path:lineNumber` reference to the clipboard.
6
+
7
+ ## Install
8
+
9
+ Install the plugin alongside its peer dependencies:
10
+
11
+ ```bash
12
+ pnpm add --dev @react-spot/core @react-spot/ui-components @react-spot/plugin-copy-to-clipboard
13
+ ```
14
+
15
+ If you are already using `@react-spot/kit`, this plugin is included there by default.
16
+
17
+ ## Usage
18
+
19
+ ```tsx
20
+ import { Trace } from '@react-spot/core'
21
+ import { CopyToClipboardPlugin } from '@react-spot/plugin-copy-to-clipboard'
22
+
23
+ import App from './App'
24
+
25
+ export function AppWithTrace() {
26
+ return (
27
+ <>
28
+ <App />
29
+ <Trace
30
+ root={import.meta.env.VITE_ROOT}
31
+ plugins={[CopyToClipboardPlugin()]}
32
+ />
33
+ </>
34
+ )
35
+ }
36
+ ```
37
+
38
+ `root` should be the absolute project root passed to Trace so the plugin can resolve relative file paths for comments.
39
+
40
+ ## Copied output
41
+
42
+ The copied value uses the current project root as the base path and looks like this:
43
+
44
+ ```text
45
+ src/components/Button.tsx:42
46
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/index.tsx
4
+ function CopyToClipboardPlugin() {
5
+ return { name: "copy-to-clipboard" };
6
+ }
7
+
8
+ //#endregion
9
+ exports.CopyToClipboardPlugin = CopyToClipboardPlugin;
10
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["import type { TracePlugin } from '@react-spot/core'\n\nexport function CopyToClipboardPlugin(): TracePlugin {\n return {\n name: 'copy-to-clipboard',\n }\n}\n"],"mappings":";;;AAEA,SAAgB,wBAAqC;AACnD,QAAO,EACL,MAAM,qBACP"}
@@ -0,0 +1,7 @@
1
+ import { TracePlugin } from "@react-spot/core";
2
+
3
+ //#region src/index.d.ts
4
+ declare function CopyToClipboardPlugin(): TracePlugin;
5
+ //#endregion
6
+ export { CopyToClipboardPlugin };
7
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;iBAEgB,qBAAA,CAAA,GAAyB,WAAA"}
@@ -0,0 +1,7 @@
1
+ import { TracePlugin } from "@react-spot/core";
2
+
3
+ //#region src/index.d.ts
4
+ declare function CopyToClipboardPlugin(): TracePlugin;
5
+ //#endregion
6
+ export { CopyToClipboardPlugin };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;;iBAEgB,qBAAA,CAAA,GAAyB,WAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ //#region src/index.tsx
2
+ function CopyToClipboardPlugin() {
3
+ return { name: "copy-to-clipboard" };
4
+ }
5
+
6
+ //#endregion
7
+ export { CopyToClipboardPlugin };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.tsx"],"sourcesContent":["import type { TracePlugin } from '@react-spot/core'\n\nexport function CopyToClipboardPlugin(): TracePlugin {\n return {\n name: 'copy-to-clipboard',\n }\n}\n"],"mappings":";AAEA,SAAgB,wBAAqC;AACnD,QAAO,EACL,MAAM,qBACP"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/index.prod.ts
4
+ /**
5
+ * Production stub for @react-spot/plugin-copy-to-clipboard.
6
+ */
7
+ const CopyToClipboardPlugin = () => ({ name: "copy-to-clipboard" });
8
+
9
+ //#endregion
10
+ exports.CopyToClipboardPlugin = CopyToClipboardPlugin;
11
+ //# sourceMappingURL=index.prod.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.cjs","names":[],"sources":["../src/index.prod.ts"],"sourcesContent":["/**\n * Production stub for @react-spot/plugin-copy-to-clipboard.\n */\nexport const CopyToClipboardPlugin = () => ({\n name: 'copy-to-clipboard' as const,\n})\n"],"mappings":";;;;;;AAGA,MAAa,+BAA+B,EAC1C,MAAM,qBACP"}
@@ -0,0 +1,10 @@
1
+ //#region src/index.prod.d.ts
2
+ /**
3
+ * Production stub for @react-spot/plugin-copy-to-clipboard.
4
+ */
5
+ declare const CopyToClipboardPlugin: () => {
6
+ name: "copy-to-clipboard";
7
+ };
8
+ //#endregion
9
+ export { CopyToClipboardPlugin };
10
+ //# sourceMappingURL=index.prod.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.d.cts","names":[],"sources":["../src/index.prod.ts"],"mappings":";;AAGA;;cAAa,qBAAA;EAEX,IAAA;AAAA"}
@@ -0,0 +1,10 @@
1
+ //#region src/index.prod.d.ts
2
+ /**
3
+ * Production stub for @react-spot/plugin-copy-to-clipboard.
4
+ */
5
+ declare const CopyToClipboardPlugin: () => {
6
+ name: "copy-to-clipboard";
7
+ };
8
+ //#endregion
9
+ export { CopyToClipboardPlugin };
10
+ //# sourceMappingURL=index.prod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.d.ts","names":[],"sources":["../src/index.prod.ts"],"mappings":";;AAGA;;cAAa,qBAAA;EAEX,IAAA;AAAA"}
@@ -0,0 +1,9 @@
1
+ //#region src/index.prod.ts
2
+ /**
3
+ * Production stub for @react-spot/plugin-copy-to-clipboard.
4
+ */
5
+ const CopyToClipboardPlugin = () => ({ name: "copy-to-clipboard" });
6
+
7
+ //#endregion
8
+ export { CopyToClipboardPlugin };
9
+ //# sourceMappingURL=index.prod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.js","names":[],"sources":["../src/index.prod.ts"],"sourcesContent":["/**\n * Production stub for @react-spot/plugin-copy-to-clipboard.\n */\nexport const CopyToClipboardPlugin = () => ({\n name: 'copy-to-clipboard' as const,\n})\n"],"mappings":";;;;AAGA,MAAa,+BAA+B,EAC1C,MAAM,qBACP"}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@react-spot/plugin-copy-to-clipboard",
3
+ "version": "0.0.1",
4
+ "description": "react-trace plugin: copy selected component source and path to clipboard",
5
+ "keywords": [
6
+ "react-trace",
7
+ "react-trace-plugin"
8
+ ],
9
+ "license": "MIT",
10
+ "author": "Vitor Buzinaro",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/buzinas/react-trace",
14
+ "directory": "packages/plugin-copy-to-clipboard"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "development": {
26
+ "import": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "require": {
31
+ "types": "./dist/index.d.cts",
32
+ "default": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "production": {
36
+ "import": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.prod.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/index.d.cts",
42
+ "default": "./dist/index.prod.cjs"
43
+ }
44
+ },
45
+ "default": {
46
+ "import": {
47
+ "types": "./dist/index.d.ts",
48
+ "default": "./dist/index.js"
49
+ },
50
+ "require": {
51
+ "types": "./dist/index.d.cts",
52
+ "default": "./dist/index.cjs"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ },
60
+ "scripts": {
61
+ "build": "tsdown",
62
+ "dev": "tsdown --watch --no-clean",
63
+ "typecheck": "tsc --noEmit",
64
+ "lint": "oxlint src",
65
+ "prepublishOnly": "pnpm build"
66
+ },
67
+ "devDependencies": {
68
+ "@types/react": "^19",
69
+ "oxlint": "latest",
70
+ "react": "^19",
71
+ "tsdown": "^0.21.0-beta.2",
72
+ "typescript": "^5"
73
+ },
74
+ "peerDependencies": {
75
+ "@react-spot/core": "^0.0.1",
76
+ "@react-spot/ui-components": "^0.0.1",
77
+ "react": ">=18"
78
+ }
79
+ }