@pandacss/node 0.0.0-dev-20221217182653 → 0.0.0-dev-20221218093122
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.ts +13 -10
- package/dist/index.js +22 -10
- package/dist/index.mjs +22 -10
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _pandacss_core from '@pandacss/core';
|
|
2
2
|
import { StylesheetContext, Conditions, Utility } from '@pandacss/core';
|
|
3
3
|
export { discardDuplicate } from '@pandacss/core';
|
|
4
|
-
import * as _pandacss_types_dist_generator from '@pandacss/types/dist/generator';
|
|
5
4
|
import * as _pandacss_types_dist_composition from '@pandacss/types/dist/composition';
|
|
5
|
+
import * as _pandacss_types_dist_static_css from '@pandacss/types/dist/static-css';
|
|
6
6
|
import * as _pandacss_types_dist_recipe from '@pandacss/types/dist/recipe';
|
|
7
7
|
import * as _pandacss_types_dist_system_types from '@pandacss/types/dist/system-types';
|
|
8
8
|
import * as ts_morph from 'ts-morph';
|
|
@@ -63,7 +63,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
63
63
|
reloadSourceFile: (file: string) => void;
|
|
64
64
|
removeSourceFile: (file: string) => boolean | undefined;
|
|
65
65
|
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => Collector | undefined;
|
|
66
|
-
getPath: (str: string) => string;
|
|
66
|
+
getPath: (...str: string[]) => string;
|
|
67
67
|
paths: {
|
|
68
68
|
config: string;
|
|
69
69
|
css: string;
|
|
@@ -84,10 +84,11 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
84
84
|
tokens: TokenDictionary;
|
|
85
85
|
hasTokens: boolean;
|
|
86
86
|
utility: Utility;
|
|
87
|
-
|
|
87
|
+
getCss: (collector: Collector, file: string) => {
|
|
88
88
|
css: string;
|
|
89
89
|
file: string;
|
|
90
90
|
} | undefined;
|
|
91
|
+
getGlobalCss: () => string | undefined;
|
|
91
92
|
patterns: Record<string, PatternConfig>;
|
|
92
93
|
hasPatterns: boolean;
|
|
93
94
|
getPattern: (name: string) => PatternConfig | undefined;
|
|
@@ -116,6 +117,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
116
117
|
hash?: boolean | undefined;
|
|
117
118
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
118
119
|
separator?: "-" | "_" | "=" | undefined;
|
|
120
|
+
static?: _pandacss_types_dist_static_css.StaticCssOptions | undefined;
|
|
119
121
|
breakpoints?: Dict<any> | undefined;
|
|
120
122
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
121
123
|
minify?: boolean | undefined;
|
|
@@ -131,7 +133,6 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
131
133
|
textStyles?: _pandacss_types.TextStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
132
134
|
layerStyles?: _pandacss_types.LayerStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
133
135
|
strictTokens?: boolean | undefined;
|
|
134
|
-
generator?: _pandacss_types_dist_generator.ClassGeneratorOptions | undefined;
|
|
135
136
|
include: string[];
|
|
136
137
|
outdir: string;
|
|
137
138
|
};
|
|
@@ -186,7 +187,7 @@ declare class Builder {
|
|
|
186
187
|
reloadSourceFile: (file: string) => void;
|
|
187
188
|
removeSourceFile: (file: string) => boolean | undefined;
|
|
188
189
|
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => _pandacss_parser.Collector | undefined;
|
|
189
|
-
getPath: (str: string) => string;
|
|
190
|
+
getPath: (...str: string[]) => string;
|
|
190
191
|
paths: {
|
|
191
192
|
config: string;
|
|
192
193
|
css: string;
|
|
@@ -207,10 +208,11 @@ declare class Builder {
|
|
|
207
208
|
tokens: _pandacss_token_dictionary.TokenDictionary;
|
|
208
209
|
hasTokens: boolean;
|
|
209
210
|
utility: _pandacss_core.Utility;
|
|
210
|
-
|
|
211
|
+
getCss: (collector: _pandacss_parser.Collector, file: string) => {
|
|
211
212
|
css: string;
|
|
212
213
|
file: string;
|
|
213
214
|
} | undefined;
|
|
215
|
+
getGlobalCss: () => string | undefined;
|
|
214
216
|
patterns: Record<string, _pandacss_types.PatternConfig>;
|
|
215
217
|
hasPatterns: boolean;
|
|
216
218
|
getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
|
|
@@ -239,6 +241,7 @@ declare class Builder {
|
|
|
239
241
|
hash?: boolean | undefined;
|
|
240
242
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
241
243
|
separator?: "-" | "_" | "=" | undefined;
|
|
244
|
+
static?: _pandacss_types_dist_static_css.StaticCssOptions | undefined;
|
|
242
245
|
breakpoints?: _pandacss_types.Dict<any> | undefined;
|
|
243
246
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
244
247
|
minify?: boolean | undefined;
|
|
@@ -254,7 +257,6 @@ declare class Builder {
|
|
|
254
257
|
textStyles?: _pandacss_types.TextStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
255
258
|
layerStyles?: _pandacss_types.LayerStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
256
259
|
strictTokens?: boolean | undefined;
|
|
257
|
-
generator?: _pandacss_types_dist_generator.ClassGeneratorOptions | undefined;
|
|
258
260
|
include: string[];
|
|
259
261
|
outdir: string;
|
|
260
262
|
};
|
|
@@ -301,7 +303,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
301
303
|
reloadSourceFile: (file: string) => void;
|
|
302
304
|
removeSourceFile: (file: string) => boolean | undefined;
|
|
303
305
|
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => _pandacss_parser.Collector | undefined;
|
|
304
|
-
getPath: (str: string) => string;
|
|
306
|
+
getPath: (...str: string[]) => string;
|
|
305
307
|
paths: {
|
|
306
308
|
config: string;
|
|
307
309
|
css: string;
|
|
@@ -322,10 +324,11 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
322
324
|
tokens: _pandacss_token_dictionary.TokenDictionary;
|
|
323
325
|
hasTokens: boolean;
|
|
324
326
|
utility: _pandacss_core.Utility;
|
|
325
|
-
|
|
327
|
+
getCss: (collector: _pandacss_parser.Collector, file: string) => {
|
|
326
328
|
css: string;
|
|
327
329
|
file: string;
|
|
328
330
|
} | undefined;
|
|
331
|
+
getGlobalCss: () => string | undefined;
|
|
329
332
|
patterns: Record<string, _pandacss_types.PatternConfig>;
|
|
330
333
|
hasPatterns: boolean;
|
|
331
334
|
getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
|
|
@@ -354,6 +357,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
354
357
|
hash?: boolean | undefined;
|
|
355
358
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
356
359
|
separator?: "-" | "_" | "=" | undefined;
|
|
360
|
+
static?: _pandacss_types_dist_static_css.StaticCssOptions | undefined;
|
|
357
361
|
breakpoints?: _pandacss_types.Dict<any> | undefined;
|
|
358
362
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
359
363
|
minify?: boolean | undefined;
|
|
@@ -369,7 +373,6 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
369
373
|
textStyles?: _pandacss_types.TextStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
370
374
|
layerStyles?: _pandacss_types.LayerStyles<_pandacss_types_dist_composition.TCondition> | undefined;
|
|
371
375
|
strictTokens?: boolean | undefined;
|
|
372
|
-
generator?: _pandacss_types_dist_generator.ClassGeneratorOptions | undefined;
|
|
373
376
|
include: string[];
|
|
374
377
|
outdir: string;
|
|
375
378
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function extractFile(ctx, file) {
|
|
|
65
65
|
import_logger.logger.error({ err: error });
|
|
66
66
|
}
|
|
67
67
|
if (data) {
|
|
68
|
-
result = ctx.
|
|
68
|
+
result = ctx.getCss(data, file);
|
|
69
69
|
}
|
|
70
70
|
if (result) {
|
|
71
71
|
done();
|
|
@@ -81,6 +81,12 @@ function extractFiles(ctx) {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
function extractGlobalCss(ctx) {
|
|
85
|
+
const css2 = ctx.getGlobalCss();
|
|
86
|
+
if (!css2)
|
|
87
|
+
return;
|
|
88
|
+
return ctx.chunks.write("globals.css", css2);
|
|
89
|
+
}
|
|
84
90
|
|
|
85
91
|
// src/chunks.ts
|
|
86
92
|
async function extractChunks(ctx) {
|
|
@@ -1567,12 +1573,13 @@ async function emitArtifacts(ctx) {
|
|
|
1567
1573
|
}
|
|
1568
1574
|
async function emitAndExtract(ctx) {
|
|
1569
1575
|
await emitArtifacts(ctx);
|
|
1576
|
+
await extractGlobalCss(ctx);
|
|
1570
1577
|
await extractFiles(ctx);
|
|
1571
1578
|
await bundleChunks(ctx);
|
|
1572
1579
|
}
|
|
1573
1580
|
function getBaseCss(ctx) {
|
|
1574
|
-
const css2 = [generateReset(), generateTokenCss(ctx), generateKeyframes(ctx.keyframes)];
|
|
1575
|
-
return css2.join("\n");
|
|
1581
|
+
const css2 = [generateReset(), generateTokenCss(ctx), generateKeyframes(ctx.keyframes), ctx.getGlobalCss()];
|
|
1582
|
+
return css2.filter(Boolean).join("\n\n");
|
|
1576
1583
|
}
|
|
1577
1584
|
|
|
1578
1585
|
// src/builder.ts
|
|
@@ -1729,8 +1736,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1729
1736
|
function isStyleProp(prop) {
|
|
1730
1737
|
return (0, import_is_valid_prop2.isCssProperty)(prop) || isCustomCssProperty(prop);
|
|
1731
1738
|
}
|
|
1732
|
-
function getPath(str) {
|
|
1733
|
-
return (0, import_path2.join)(cwd, outdir, str);
|
|
1739
|
+
function getPath(...str) {
|
|
1740
|
+
return (0, import_path2.join)(cwd, outdir, ...str);
|
|
1734
1741
|
}
|
|
1735
1742
|
function absPath(str) {
|
|
1736
1743
|
return (0, import_path2.isAbsolute)(str) ? str : (0, import_path2.join)(cwd, str);
|
|
@@ -1848,11 +1855,15 @@ function createContext(conf, io = fileSystem) {
|
|
|
1848
1855
|
nodes: [...patternNodes, ...recipeNodes]
|
|
1849
1856
|
}
|
|
1850
1857
|
});
|
|
1851
|
-
function
|
|
1858
|
+
function getGlobalCss() {
|
|
1859
|
+
if (!globalCss)
|
|
1860
|
+
return;
|
|
1861
|
+
const sheet = new import_core3.Stylesheet(context());
|
|
1862
|
+
sheet.processGlobalCss(globalCss);
|
|
1863
|
+
return sheet.toCss();
|
|
1864
|
+
}
|
|
1865
|
+
function getCss(collector, file) {
|
|
1852
1866
|
const sheet = new import_core3.Stylesheet(context());
|
|
1853
|
-
if (globalCss) {
|
|
1854
|
-
sheet.addGlobalCss(globalCss);
|
|
1855
|
-
}
|
|
1856
1867
|
collector.globalCss.forEach((result) => {
|
|
1857
1868
|
sheet.processGlobalCss(result.data);
|
|
1858
1869
|
});
|
|
@@ -1938,7 +1949,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1938
1949
|
tokens,
|
|
1939
1950
|
hasTokens,
|
|
1940
1951
|
utility,
|
|
1941
|
-
|
|
1952
|
+
getCss,
|
|
1953
|
+
getGlobalCss,
|
|
1942
1954
|
patterns,
|
|
1943
1955
|
hasPatterns,
|
|
1944
1956
|
getPattern,
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function extractFile(ctx, file) {
|
|
|
19
19
|
logger.error({ err: error });
|
|
20
20
|
}
|
|
21
21
|
if (data) {
|
|
22
|
-
result = ctx.
|
|
22
|
+
result = ctx.getCss(data, file);
|
|
23
23
|
}
|
|
24
24
|
if (result) {
|
|
25
25
|
done();
|
|
@@ -35,6 +35,12 @@ function extractFiles(ctx) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
function extractGlobalCss(ctx) {
|
|
39
|
+
const css2 = ctx.getGlobalCss();
|
|
40
|
+
if (!css2)
|
|
41
|
+
return;
|
|
42
|
+
return ctx.chunks.write("globals.css", css2);
|
|
43
|
+
}
|
|
38
44
|
|
|
39
45
|
// src/chunks.ts
|
|
40
46
|
async function extractChunks(ctx) {
|
|
@@ -1521,12 +1527,13 @@ async function emitArtifacts(ctx) {
|
|
|
1521
1527
|
}
|
|
1522
1528
|
async function emitAndExtract(ctx) {
|
|
1523
1529
|
await emitArtifacts(ctx);
|
|
1530
|
+
await extractGlobalCss(ctx);
|
|
1524
1531
|
await extractFiles(ctx);
|
|
1525
1532
|
await bundleChunks(ctx);
|
|
1526
1533
|
}
|
|
1527
1534
|
function getBaseCss(ctx) {
|
|
1528
|
-
const css2 = [generateReset(), generateTokenCss(ctx), generateKeyframes(ctx.keyframes)];
|
|
1529
|
-
return css2.join("\n");
|
|
1535
|
+
const css2 = [generateReset(), generateTokenCss(ctx), generateKeyframes(ctx.keyframes), ctx.getGlobalCss()];
|
|
1536
|
+
return css2.filter(Boolean).join("\n\n");
|
|
1530
1537
|
}
|
|
1531
1538
|
|
|
1532
1539
|
// src/builder.ts
|
|
@@ -1689,8 +1696,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1689
1696
|
function isStyleProp(prop) {
|
|
1690
1697
|
return isCssProperty(prop) || isCustomCssProperty(prop);
|
|
1691
1698
|
}
|
|
1692
|
-
function getPath(str) {
|
|
1693
|
-
return join2(cwd, outdir, str);
|
|
1699
|
+
function getPath(...str) {
|
|
1700
|
+
return join2(cwd, outdir, ...str);
|
|
1694
1701
|
}
|
|
1695
1702
|
function absPath(str) {
|
|
1696
1703
|
return isAbsolute(str) ? str : join2(cwd, str);
|
|
@@ -1808,11 +1815,15 @@ function createContext(conf, io = fileSystem) {
|
|
|
1808
1815
|
nodes: [...patternNodes, ...recipeNodes]
|
|
1809
1816
|
}
|
|
1810
1817
|
});
|
|
1811
|
-
function
|
|
1818
|
+
function getGlobalCss() {
|
|
1819
|
+
if (!globalCss)
|
|
1820
|
+
return;
|
|
1821
|
+
const sheet = new Stylesheet2(context());
|
|
1822
|
+
sheet.processGlobalCss(globalCss);
|
|
1823
|
+
return sheet.toCss();
|
|
1824
|
+
}
|
|
1825
|
+
function getCss(collector, file) {
|
|
1812
1826
|
const sheet = new Stylesheet2(context());
|
|
1813
|
-
if (globalCss) {
|
|
1814
|
-
sheet.addGlobalCss(globalCss);
|
|
1815
|
-
}
|
|
1816
1827
|
collector.globalCss.forEach((result) => {
|
|
1817
1828
|
sheet.processGlobalCss(result.data);
|
|
1818
1829
|
});
|
|
@@ -1898,7 +1909,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1898
1909
|
tokens,
|
|
1899
1910
|
hasTokens,
|
|
1900
1911
|
utility,
|
|
1901
|
-
|
|
1912
|
+
getCss,
|
|
1913
|
+
getGlobalCss,
|
|
1902
1914
|
patterns,
|
|
1903
1915
|
hasPatterns,
|
|
1904
1916
|
getPattern,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20221218093122",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"telejson": "7.0.4",
|
|
31
31
|
"ts-pattern": "4.0.6",
|
|
32
32
|
"ts-morph": "17.0.1",
|
|
33
|
-
"@pandacss/types": "0.0.0-dev-
|
|
34
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
37
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
38
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
39
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/config": "0.0.0-dev-
|
|
33
|
+
"@pandacss/types": "0.0.0-dev-20221218093122",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20221218093122",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20221218093122",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20221218093122",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20221218093122",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20221218093122",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20221218093122",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20221218093122",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20221218093122"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/fs-extra": "9.0.13",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/glob-parent": "^5.1.1",
|
|
47
47
|
"@types/pluralize": "0.0.29",
|
|
48
48
|
"@types/lodash.merge": "4.6.7",
|
|
49
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
49
|
+
"@pandacss/fixture": "0.0.0-dev-20221218093122"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|