@editframe/react 0.25.0-beta.0 → 0.25.1-beta.0
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/package.json +26 -5
- package/tsdown.config.ts +22 -3
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/react",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
|
-
".":
|
|
7
|
-
|
|
6
|
+
".": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
"./types.json": "./types.json"
|
|
8
14
|
},
|
|
9
15
|
"type": "module",
|
|
10
16
|
"scripts": {
|
|
@@ -16,7 +22,7 @@
|
|
|
16
22
|
"author": "",
|
|
17
23
|
"license": "UNLICENSED",
|
|
18
24
|
"dependencies": {
|
|
19
|
-
"@editframe/elements": "0.25.
|
|
25
|
+
"@editframe/elements": "0.25.1-beta.0",
|
|
20
26
|
"@lit/react": "^1.0.8",
|
|
21
27
|
"@lit/task": "^1.0.1",
|
|
22
28
|
"debug": "^4.3.5",
|
|
@@ -28,10 +34,25 @@
|
|
|
28
34
|
"@types/node": "^22.0.0",
|
|
29
35
|
"@types/react": "^18.3.0",
|
|
30
36
|
"@types/react-dom": "^18.3.0",
|
|
37
|
+
"autoprefixer": "^10.4.19",
|
|
38
|
+
"postcss": "^8.4.38",
|
|
39
|
+
"tailwindcss": "^3.4.3",
|
|
31
40
|
"typescript": "^5.5.4",
|
|
32
41
|
"vitest": "^1.6.0"
|
|
33
42
|
},
|
|
34
43
|
"main": "./dist/index.js",
|
|
35
44
|
"module": "./dist/index.js",
|
|
36
|
-
"types": "./dist/index.d.ts"
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/index.d.ts",
|
|
51
|
+
"default": "./dist/index.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./package.json": "./package.json",
|
|
55
|
+
"./types.json": "./types.json"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
37
58
|
}
|
package/tsdown.config.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
3
|
+
import autoprefixer from "autoprefixer";
|
|
4
|
+
import postcss from "postcss";
|
|
5
|
+
import tailwindcss from "tailwindcss";
|
|
4
6
|
import { defineConfig, type Plugin } from "tsdown";
|
|
5
7
|
|
|
6
8
|
import { createTsdownConfig } from "../tsdown.config.base.ts";
|
|
7
9
|
|
|
8
|
-
// Plugin to handle CSS ?inline imports from @editframe/elements
|
|
10
|
+
// Plugin to handle CSS ?inline imports from @editframe/elements with Tailwind processing
|
|
9
11
|
const inlineCssPlugin = (): Plugin => ({
|
|
10
12
|
name: "inline-css",
|
|
11
13
|
resolveId(source, importer) {
|
|
@@ -18,10 +20,24 @@ const inlineCssPlugin = (): Plugin => ({
|
|
|
18
20
|
}
|
|
19
21
|
return null;
|
|
20
22
|
},
|
|
21
|
-
load(id) {
|
|
23
|
+
async load(id) {
|
|
22
24
|
if (id.endsWith("?inline")) {
|
|
23
25
|
const filePath = id.replace("?inline", "");
|
|
24
26
|
const css = readFileSync(filePath, "utf-8");
|
|
27
|
+
|
|
28
|
+
// Process through Tailwind if it contains @tailwind directives
|
|
29
|
+
if (css.includes("@tailwind")) {
|
|
30
|
+
const srcDir = path.resolve(path.dirname(filePath));
|
|
31
|
+
const result = await postcss([
|
|
32
|
+
tailwindcss({
|
|
33
|
+
content: [path.join(srcDir, "**/*.ts")],
|
|
34
|
+
}),
|
|
35
|
+
autoprefixer(),
|
|
36
|
+
]).process(css, { from: filePath });
|
|
37
|
+
|
|
38
|
+
return `export default ${JSON.stringify(result.css)}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
25
41
|
return `export default ${JSON.stringify(css)}`;
|
|
26
42
|
}
|
|
27
43
|
return null;
|
|
@@ -32,5 +48,8 @@ export default defineConfig(
|
|
|
32
48
|
createTsdownConfig({
|
|
33
49
|
plugins: [inlineCssPlugin()],
|
|
34
50
|
external: [/@editframe\/(elements|assets)/],
|
|
51
|
+
additionalExports: {
|
|
52
|
+
"./types.json": "./types.json",
|
|
53
|
+
},
|
|
35
54
|
}),
|
|
36
55
|
);
|