@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.
- package/dist/index.d.mts +347 -1
- package/dist/index.d.ts +347 -1
- package/dist/index.js +1733 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1724 -59
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +238 -166
- package/dist/styles/index.d.ts +1 -0
- package/package.json +94 -85
- package/src/styles/index.css +164 -109
- package/src/styles/index.d.ts +1 -0
|
@@ -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.
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"react": "^
|
|
53
|
-
"react-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"react-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"postcss
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
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
|
+
}
|
package/src/styles/index.css
CHANGED
|
@@ -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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
--color-
|
|
39
|
-
--color-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
--color-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
|
|
53
|
-
--
|
|
54
|
-
--
|
|
55
|
-
|
|
56
|
-
--
|
|
57
|
-
--
|
|
58
|
-
|
|
59
|
-
--
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
|
|
63
|
-
--
|
|
64
|
-
--
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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 {};
|