@signiphi/page-assembly 0.2.0-beta.2 → 0.2.0-beta.20

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.
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,85 +1,94 @@
1
- {
2
- "name": "@signiphi/page-assembly",
3
- "version": "0.2.0-beta.2",
4
- "description": "React component for PDF and image page manipulation - upload, reorder, delete, and combine pages",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
8
- "sideEffects": [
9
- "*.css",
10
- "./dist/styles/*.css"
11
- ],
12
- "exports": {
13
- ".": {
14
- "types": "./dist/index.d.ts",
15
- "import": "./dist/index.mjs",
16
- "require": "./dist/index.js",
17
- "default": "./dist/index.js"
18
- },
19
- "./styles": "./dist/styles/index.css",
20
- "./styles/source": "./src/styles/index.css",
21
- "./src/styles/index.css": "./src/styles/index.css",
22
- "./dist/styles/index.css": "./dist/styles/index.css"
23
- },
24
- "files": [
25
- "dist",
26
- "src/styles",
27
- "README.md"
28
- ],
29
- "scripts": {
30
- "build": "tsup && node -e \"require('fs').mkdirSync('dist/styles', {recursive: true})\" && postcss src/styles/index.css -o dist/styles/index.css",
31
- "dev": "tsup --watch",
32
- "type-check": "tsc --noEmit"
33
- },
34
- "keywords": [
35
- "pdf",
36
- "page-assembly",
37
- "page-manipulation",
38
- "document-assembly",
39
- "react",
40
- "drag-and-drop"
41
- ],
42
- "author": "signiphi",
43
- "license": "",
44
- "peerDependencies": {
45
- "@radix-ui/react-alert-dialog": "^1.1.0",
46
- "@radix-ui/react-dialog": "^1.1.15",
47
- "@radix-ui/react-dropdown-menu": "^2.1.0",
48
- "@radix-ui/react-label": "^2.1.0",
49
- "@radix-ui/react-select": "^2.1.0",
50
- "@radix-ui/react-tooltip": "^1.1.0",
51
- "lucide-react": "^0.454.0",
52
- "react": "^18.2.0 || ^19.0.0",
53
- "react-dom": "^18.2.0 || ^19.0.0"
54
- },
55
- "peerDependenciesMeta": {
56
- "tailwindcss": {
57
- "optional": true
58
- }
59
- },
60
- "dependencies": {
61
- "@radix-ui/react-slot": "^1.2.3",
62
- "class-variance-authority": "^0.7.1",
63
- "clsx": "^2.1.1",
64
- "pdf-lib": "^1.17.1",
65
- "pdfjs-dist": "5.3.93",
66
- "react-dnd": "^16.0.1",
67
- "react-dnd-html5-backend": "^16.0.1",
68
- "tailwind-merge": "^3.3.1"
69
- },
70
- "devDependencies": {
71
- "@jridgewell/remapping": "^2.3.5",
72
- "@tailwindcss/postcss": "^4.1.4",
73
- "@types/node": "^20.11.19",
74
- "@types/react": "^18.3.17",
75
- "@types/react-dom": "^18.3.5",
76
- "postcss": "^8.5.6",
77
- "postcss-cli": "^11.0.0",
78
- "postcss-nesting": "^13.0.2",
79
- "postcss-prefix-selector": "^1.16.1",
80
- "postcss-preset-env": "^10.4.0",
81
- "tailwindcss": "^4.1.4",
82
- "tsup": "^8.3.5",
83
- "typescript": "^5.8.3"
84
- }
85
- }
1
+ {
2
+ "name": "@signiphi/page-assembly",
3
+ "version": "0.2.0-beta.20",
4
+ "description": "React component for PDF and image page manipulation - upload, reorder, delete, and combine pages",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "sideEffects": [
9
+ "*.css",
10
+ "./dist/styles/*.css"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.mjs",
16
+ "require": "./dist/index.js",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./styles": {
20
+ "types": "./dist/styles/index.d.ts",
21
+ "import": "./dist/styles/index.css",
22
+ "default": "./dist/styles/index.css"
23
+ },
24
+ "./styles/source": "./src/styles/index.css",
25
+ "./src/styles/index.css": "./src/styles/index.css",
26
+ "./dist/styles/index.css": "./dist/styles/index.css"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "src/styles",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "build": "tsup && node -e \"require('fs').mkdirSync('dist/styles', {recursive: true})\" && postcss src/styles/index.css -o dist/styles/index.css && node -e \"require('fs').copyFileSync('src/styles/index.d.ts','dist/styles/index.d.ts')\"",
35
+ "dev": "tsup --watch --no-clean",
36
+ "type-check": "tsc --noEmit",
37
+ "test": "vitest run --pool=forks",
38
+ "test:watch": "vitest"
39
+ },
40
+ "keywords": [
41
+ "pdf",
42
+ "page-assembly",
43
+ "page-manipulation",
44
+ "document-assembly",
45
+ "react",
46
+ "drag-and-drop"
47
+ ],
48
+ "author": "signiphi",
49
+ "license": "",
50
+ "peerDependencies": {
51
+ "@radix-ui/react-alert-dialog": "^1.1.0",
52
+ "@radix-ui/react-dialog": "^1.1.15",
53
+ "@radix-ui/react-dropdown-menu": "^2.1.0",
54
+ "@radix-ui/react-label": "^2.1.0",
55
+ "@radix-ui/react-select": "^2.1.0",
56
+ "@radix-ui/react-tooltip": "^1.1.0",
57
+ "lucide-react": "^0.454.0",
58
+ "react": "^18.2.0 || ^19.0.0",
59
+ "react-dom": "^18.2.0 || ^19.0.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "tailwindcss": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "dependencies": {
67
+ "@radix-ui/react-slot": "^1.2.3",
68
+ "class-variance-authority": "^0.7.1",
69
+ "clsx": "^2.1.1",
70
+ "pdf-lib": "^1.17.1",
71
+ "pdfjs-dist": "5.3.93",
72
+ "react-dnd": "^16.0.1",
73
+ "react-dnd-html5-backend": "^16.0.1",
74
+ "tailwind-merge": "^3.3.1"
75
+ },
76
+ "devDependencies": {
77
+ "@jridgewell/remapping": "^2.3.5",
78
+ "@signiphi/pdf-crypto": "workspace:*",
79
+ "@signiphi/prepared-document": "workspace:*",
80
+ "@tailwindcss/postcss": "^4.1.4",
81
+ "@types/node": "^20.11.19",
82
+ "@types/react": "^18.3.17",
83
+ "@types/react-dom": "^18.3.5",
84
+ "postcss": "^8.5.6",
85
+ "postcss-cli": "^11.0.0",
86
+ "postcss-nesting": "^13.0.2",
87
+ "postcss-prefix-selector": "^1.16.1",
88
+ "postcss-preset-env": "^10.4.0",
89
+ "tailwindcss": "^4.1.4",
90
+ "tsup": "^8.3.5",
91
+ "typescript": "^5.8.3",
92
+ "vitest": "^1.0.4"
93
+ }
94
+ }
@@ -1,109 +1,164 @@
1
- /**
2
- * signiphi Page Assembly Styles
3
- *
4
- * This file contains the base Tailwind CSS configuration and theme definitions
5
- * for the page-assembly package.
6
- *
7
- * All styles are scoped with .signiphi-page-assembly prefix via PostCSS.
8
- */
9
-
10
- @import "tailwindcss";
11
-
12
- /**
13
- * Theme configuration using Tailwind v4 @theme directive
14
- */
15
- @theme {
16
- /* Color palette for page-assembly */
17
- --color-primary: #0099cd;
18
- --color-primary-foreground: #ffffff;
19
-
20
- --color-secondary: #f1f5f9;
21
- --color-secondary-foreground: #0f172a;
22
-
23
- --color-destructive: #ef4444;
24
- --color-destructive-foreground: #ffffff;
25
-
26
- --color-muted: #f1f5f9;
27
- --color-muted-foreground: #64748b;
28
-
29
- --color-accent: #f1f5f9;
30
- --color-accent-foreground: #0f172a;
31
-
32
- --color-popover: #ffffff;
33
- --color-popover-foreground: #0f172a;
34
-
35
- --color-card: #ffffff;
36
- --color-card-foreground: #0f172a;
37
-
38
- --color-border: #e2e8f0;
39
- --color-input: #e2e8f0;
40
- --color-ring: #0099cd;
41
-
42
- --color-background: #ffffff;
43
- --color-foreground: #0f172a;
44
-
45
- /* CSS custom properties for consistent theming */
46
- --xpa-background: 0 0% 100%;
47
- --xpa-foreground: 222.2 84% 4.9%;
48
- --xpa-card: 0 0% 100%;
49
- --xpa-card-foreground: 222.2 84% 4.9%;
50
- --xpa-popover: 0 0% 100%;
51
- --xpa-popover-foreground: 222.2 84% 4.9%;
52
- --xpa-primary: 198 100% 40%;
53
- --xpa-primary-foreground: 0 0% 100%;
54
- --xpa-secondary: 210 40% 96.1%;
55
- --xpa-secondary-foreground: 222.2 47.4% 11.2%;
56
- --xpa-muted: 210 40% 96.1%;
57
- --xpa-muted-foreground: 215.4 16.3% 46.9%;
58
- --xpa-accent: 210 40% 96.1%;
59
- --xpa-accent-foreground: 222.2 47.4% 11.2%;
60
- --xpa-destructive: 0 84.2% 60.2%;
61
- --xpa-destructive-foreground: 0 0% 100%;
62
- --xpa-border: 214.3 31.8% 91.4%;
63
- --xpa-input: 214.3 31.8% 91.4%;
64
- --xpa-ring: 198 100% 40%;
65
- --xpa-radius: 0.5rem;
66
- }
67
-
68
- /**
69
- * Base component styles
70
- */
71
- @layer base {
72
- * {
73
- @apply border-border;
74
- }
75
-
76
- body {
77
- @apply bg-background text-foreground;
78
- }
79
- }
80
-
81
- /**
82
- * Custom animations
83
- */
84
- @layer utilities {
85
- @keyframes spin {
86
- to {
87
- transform: rotate(360deg);
88
- }
89
- }
90
-
91
- .animate-spin {
92
- animation: spin 1s linear infinite;
93
- }
94
- }
95
-
96
- /**
97
- * Tab button styles (for demo integration)
98
- */
99
- .tab-button {
100
- @apply inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors;
101
- }
102
-
103
- .tab-button-active {
104
- @apply bg-primary text-primary-foreground shadow-sm;
105
- }
106
-
107
- .tab-button-inactive {
108
- @apply bg-white text-gray-700 border border-gray-300 hover:bg-gray-50;
109
- }
1
+ /**
2
+ * signiphi Page Assembly Styles
3
+ *
4
+ * This file contains the base Tailwind CSS configuration and theme definitions
5
+ * for the page-assembly package.
6
+ *
7
+ * All styles are scoped with .signiphi-page-assembly prefix via PostCSS.
8
+ */
9
+
10
+ @import "tailwindcss";
11
+
12
+ /* Tailwind v4 resolves `dark:` against prefers-color-scheme by default, which
13
+ tracks the OS rather than the host app. Hosts toggle a `.dark` class on
14
+ <html>, so bind the variant to that class instead. `:where()` keeps the
15
+ variant at zero specificity so a host override still wins. */
16
+ @custom-variant dark (&:where(.dark, .dark *));
17
+
18
+ /**
19
+ * Theme configuration using Tailwind v4 @theme directive.
20
+ *
21
+ * `inline` is load-bearing, not cosmetic. Without it every utility compiles to
22
+ * `var(--color-x)` — a GLOBAL name, because postcss-prefix-selector deliberately
23
+ * exempts `:root` from scoping (see postcss.config.js) so portaled content keeps
24
+ * its tokens. document-prepare bundles this stylesheet into its own, so both
25
+ * packages were defining `--color-*` at `:root` and the later one silently won:
26
+ * page-assembly's hardcoded light literals were overwriting document-prepare's
27
+ * theme-aware values, pinning the whole workflow to light and rendering
28
+ * `text-foreground` as near-black on dark backgrounds.
29
+ *
30
+ * With `inline`, Tailwind substitutes the value expression instead of the token
31
+ * name, so each utility reads this package's own `--xpa-*` and the shared
32
+ * `--color-*` namespace stops being a collision point. pdf-signer and pdf-compose
33
+ * already do this.
34
+ */
35
+ @theme inline {
36
+ /* Color palette for page-assembly — resolved from the --xpa-* vars below so
37
+ a single `:root.dark` block can retheme every utility at once. */
38
+ --color-primary: hsl(var(--xpa-primary));
39
+ --color-primary-foreground: hsl(var(--xpa-primary-foreground));
40
+
41
+ --color-secondary: hsl(var(--xpa-secondary));
42
+ --color-secondary-foreground: hsl(var(--xpa-secondary-foreground));
43
+
44
+ --color-destructive: hsl(var(--xpa-destructive));
45
+ --color-destructive-foreground: hsl(var(--xpa-destructive-foreground));
46
+
47
+ --color-muted: hsl(var(--xpa-muted));
48
+ --color-muted-foreground: hsl(var(--xpa-muted-foreground));
49
+
50
+ --color-accent: hsl(var(--xpa-accent));
51
+ --color-accent-foreground: hsl(var(--xpa-accent-foreground));
52
+
53
+ --color-popover: hsl(var(--xpa-popover));
54
+ --color-popover-foreground: hsl(var(--xpa-popover-foreground));
55
+
56
+ --color-card: hsl(var(--xpa-card));
57
+ --color-card-foreground: hsl(var(--xpa-card-foreground));
58
+
59
+ --color-border: hsl(var(--xpa-border));
60
+ --color-input: hsl(var(--xpa-input));
61
+ --color-ring: hsl(var(--xpa-ring));
62
+
63
+ --color-background: hsl(var(--xpa-background));
64
+ --color-foreground: hsl(var(--xpa-foreground));
65
+ }
66
+
67
+ @layer base {
68
+ /* Light mode. Values are unchanged from before the dark-mode work. */
69
+ :root {
70
+ --xpa-background: 0 0% 100%;
71
+ --xpa-foreground: 222.2 84% 4.9%;
72
+ --xpa-card: 0 0% 100%;
73
+ --xpa-card-foreground: 222.2 84% 4.9%;
74
+ --xpa-popover: 0 0% 100%;
75
+ --xpa-popover-foreground: 222.2 84% 4.9%;
76
+ --xpa-primary: 198 100% 40%;
77
+ --xpa-primary-foreground: 0 0% 100%;
78
+ --xpa-secondary: 210 40% 96.1%;
79
+ --xpa-secondary-foreground: 222.2 47.4% 11.2%;
80
+ --xpa-muted: 210 40% 96.1%;
81
+ --xpa-muted-foreground: 215.4 16.3% 46.9%;
82
+ --xpa-accent: 210 40% 96.1%;
83
+ --xpa-accent-foreground: 222.2 47.4% 11.2%;
84
+ --xpa-destructive: 0 84.2% 60.2%;
85
+ --xpa-destructive-foreground: 0 0% 100%;
86
+ --xpa-border: 214.3 31.8% 91.4%;
87
+ --xpa-input: 214.3 31.8% 91.4%;
88
+ --xpa-ring: 198 100% 40%;
89
+ --xpa-radius: 0.5rem;
90
+ }
91
+
92
+ /* Dark mode. These are document-prepare's `--xdp-*` dark values verbatim:
93
+ the two packages render as one workflow (document-prepare bundles this
94
+ stylesheet and embeds <PageAssembler> as a step), so any seam between them
95
+ reads as a bug rather than as identity. Primary stays #0099CD in both
96
+ themes, matching document-prepare, which also holds its primary constant. */
97
+ :root[data-theme="dark"],
98
+ :root.dark {
99
+ --xpa-background: 222.2 47.4% 11.2%;
100
+ --xpa-foreground: 210 40% 98%;
101
+ --xpa-card: 222.2 47.4% 11.2%;
102
+ --xpa-card-foreground: 210 40% 98%;
103
+ --xpa-popover: 222.2 47.4% 11.2%;
104
+ --xpa-popover-foreground: 210 40% 98%;
105
+ --xpa-primary: 198 100% 40%;
106
+ --xpa-primary-foreground: 210 40% 98%;
107
+ --xpa-secondary: 217.2 32.6% 17.5%;
108
+ --xpa-secondary-foreground: 210 40% 98%;
109
+ --xpa-muted: 217.2 32.6% 17.5%;
110
+ --xpa-muted-foreground: 215 20.2% 65.1%;
111
+ --xpa-accent: 217.2 32.6% 17.5%;
112
+ --xpa-accent-foreground: 210 40% 98%;
113
+ --xpa-destructive: 0 62.8% 30.6%;
114
+ --xpa-destructive-foreground: 210 40% 98%;
115
+ --xpa-border: 217.2 32.6% 17.5%;
116
+ --xpa-input: 217.2 32.6% 17.5%;
117
+ --xpa-ring: 198 100% 40%;
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Base component styles
123
+ */
124
+ @layer base {
125
+ * {
126
+ @apply border-border;
127
+ }
128
+
129
+ body {
130
+ @apply bg-background text-foreground;
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Custom animations
136
+ */
137
+ @layer utilities {
138
+ @keyframes spin {
139
+ to {
140
+ transform: rotate(360deg);
141
+ }
142
+ }
143
+
144
+ .animate-spin {
145
+ animation: spin 1s linear infinite;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Tab button styles (for demo integration)
151
+ */
152
+ .tab-button {
153
+ @apply inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors;
154
+ }
155
+
156
+ .tab-button-active {
157
+ @apply bg-primary text-primary-foreground shadow-sm;
158
+ }
159
+
160
+ /* Token-based rather than bg-white/gray-300/gray-50, which pinned the inactive
161
+ tab to light regardless of theme. */
162
+ .tab-button-inactive {
163
+ @apply bg-card text-foreground border border-border hover:bg-muted;
164
+ }
@@ -0,0 +1 @@
1
+ export {};