Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
],
"type": "module",
"scripts": {
"build": "cp README.md packages/react-grab/README.md && turbo run build --filter=react-grab --filter=@react-grab/cursor --filter=@react-grab/claude-code --filter=@react-grab/ami --filter=@react-grab/opencode --filter=@react-grab/codex --filter=@react-grab/gemini --filter=@react-grab/amp --filter=@react-grab/droid --filter=@react-grab/copilot --filter=@react-grab/cli --filter=@react-grab/utils && pnpm --filter grab build",
"dev": "turbo dev --filter=react-grab --filter=@react-grab/cursor --filter=@react-grab/claude-code --filter=@react-grab/ami --filter=@react-grab/opencode --filter=@react-grab/codex --filter=@react-grab/gemini --filter=@react-grab/amp --filter=@react-grab/droid --filter=@react-grab/copilot --filter=@react-grab/cli --filter=@react-grab/utils",
"build": "cp README.md packages/react-grab/README.md && turbo run build --filter=react-grab --filter=@react-grab/paper --filter=@react-grab/cursor --filter=@react-grab/claude-code --filter=@react-grab/ami --filter=@react-grab/opencode --filter=@react-grab/codex --filter=@react-grab/gemini --filter=@react-grab/amp --filter=@react-grab/droid --filter=@react-grab/copilot --filter=@react-grab/cli --filter=@react-grab/utils && pnpm --filter grab build",
"dev": "turbo dev --filter=react-grab --filter=@react-grab/paper --filter=@react-grab/cursor --filter=@react-grab/claude-code --filter=@react-grab/ami --filter=@react-grab/opencode --filter=@react-grab/codex --filter=@react-grab/gemini --filter=@react-grab/amp --filter=@react-grab/droid --filter=@react-grab/copilot --filter=@react-grab/cli --filter=@react-grab/utils",
"test": "turbo run test --filter=react-grab --filter=@react-grab/cli",
"typecheck": "pnpm --filter react-grab typecheck",
"lint": "pnpm --filter react-grab lint",
Expand Down
23 changes: 23 additions & 0 deletions packages/paper/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@react-grab/paper",
"version": "0.0.1",
"private": true,
"type": "module",
"files": [
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Dual package type exports lack explicit .d.cts for CommonJS, which causes TypeScript errors under Node16 module resolution.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/paper/package.json, line 11:

<comment>Dual package type exports lack explicit `.d.cts` for CommonJS, which causes TypeScript errors under `Node16` module resolution.</comment>

<file context>
@@ -0,0 +1,23 @@
+  ],
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "import": "./dist/index.js",
+      "require": "./dist/index.cjs"
</file context>
Fix with Cubic

"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"scripts": {
"dev": "tsup --watch",
"build": "tsup"
},
"devDependencies": {
"tsup": "^8.4.0"
}
}
1 change: 1 addition & 0 deletions packages/paper/paper-clipboard-text-html-content.html

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions packages/paper/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export const SKIPPED_TAGS = new Set([
"SCRIPT",
"STYLE",
"NOSCRIPT",
"TEMPLATE",
"LINK",
"META",
"HEAD",
"IFRAME",
"OBJECT",
"EMBED",
]);

export const TAG_LABELS: Record<string, string> = {
H1: "Heading 1",
H2: "Heading 2",
H3: "Heading 3",
H4: "Heading 4",
H5: "Heading 5",
H6: "Heading 6",
P: "Paragraph",
BUTTON: "Button",
A: "Link",
IMG: "Image",
NAV: "Navigation",
HEADER: "Header",
FOOTER: "Footer",
MAIN: "Main",
SECTION: "Section",
ARTICLE: "Article",
ASIDE: "Aside",
UL: "List",
OL: "List",
LI: "List Item",
FORM: "Form",
INPUT: "Input",
TEXTAREA: "Textarea",
SELECT: "Select",
TABLE: "Table",
VIDEO: "Video",
FIGURE: "Figure",
FIGCAPTION: "Caption",
BLOCKQUOTE: "Quote",
};

export const INLINE_DISPLAY_VALUES = new Set([
"inline",
"inline-block",
"inline-flex",
]);

export const SHORT_TEXT_THRESHOLD_CHARS = 60;
export const DEFAULT_MAX_DEPTH = 50;
export const UNIQUE_ID_LENGTH = 26;

export const UTILITY_CLASS_PATTERN =
/^(flex|grid|p[xytrbl]?-|m[xytrbl]?-|w-|h-|bg-|text-|border-|rounded|shadow|opacity-|gap-|space-|font-|leading-|tracking-|overflow-|z-|relative|absolute|fixed|sticky|hidden|block|inline|sr-only|col-|row-|items-|justify-|self-|order-|grow|shrink|basis-)/;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Regex matches unintended class names due to missing word boundaries

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/paper/src/constants.ts, line 57:

<comment>Regex matches unintended class names due to missing word boundaries</comment>

<file context>
@@ -0,0 +1,57 @@
+export const UNIQUE_ID_LENGTH = 26;
+
+export const UTILITY_CLASS_PATTERN =
+  /^(flex|grid|p[xytrbl]?-|m[xytrbl]?-|w-|h-|bg-|text-|border-|rounded|shadow|opacity-|gap-|space-|font-|leading-|tracking-|overflow-|z-|relative|absolute|fixed|sticky|hidden|block|inline|sr-only|col-|row-|items-|justify-|self-|order-|grow|shrink|basis-)/;
</file context>
Fix with Cubic

Loading
Loading