@plumeria/core 0.7.10 → 0.7.14

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/cjs/css.js CHANGED
@@ -14,9 +14,15 @@ class css {
14
14
  static create(object) {
15
15
  return (0, create_js_1.create)(object);
16
16
  }
17
- static global(object) {
18
- return (0, global_js_1.global)(object);
19
- }
17
+ static global = ((called = false) => {
18
+ return (object) => {
19
+ if (called) {
20
+ throw new Error('css.global() must be one');
21
+ }
22
+ called = true;
23
+ return (0, global_js_1.global)(object);
24
+ };
25
+ })();
20
26
  static defineThemeVars(object) {
21
27
  return (0, define_theme_vars_js_1.defineThemeVars)(object);
22
28
  }
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.globalPromise = exports.resolvePromise = void 0;
7
4
  exports.buildCreate = buildCreate;
8
5
  exports.initPromise = initPromise;
9
6
  const zss_engine_1 = require("zss-engine");
10
- const path_1 = __importDefault(require("path"));
11
7
  let resolvePromise;
12
8
  let globalPromise;
13
9
  const sheetQueue = [];
@@ -20,8 +16,9 @@ function initPromise() {
20
16
  };
21
17
  });
22
18
  }
23
- function processQueue() {
24
- const filePath = path_1.default.join(__dirname, '../../../stylesheet/core.css');
19
+ async function processQueue() {
20
+ const path = await import('path');
21
+ const filePath = path.join(__dirname, '../../../stylesheet/core.css');
25
22
  while (sheetQueue.length > 0) {
26
23
  const styleSheet = sheetQueue.shift();
27
24
  if (!zss_engine_1.isDevelopment && styleSheet)
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.globalPromise = exports.resolvePromise = void 0;
7
4
  exports.buildGlobal = buildGlobal;
8
5
  exports.initPromise = initPromise;
9
6
  const zss_engine_1 = require("zss-engine");
10
- const path_1 = __importDefault(require("path"));
11
7
  let resolvePromise;
12
8
  let globalPromise;
13
9
  const seetQueue = [];
@@ -21,7 +17,8 @@ function initPromise() {
21
17
  });
22
18
  }
23
19
  async function processSheets() {
24
- const filePath = path_1.default.join(__dirname, '../../../stylesheet/core.css');
20
+ const path = await import('path');
21
+ const filePath = path.join(__dirname, '../../../stylesheet/core.css');
25
22
  while (seetQueue.length > 0) {
26
23
  const [styleSheet, option] = seetQueue.shift();
27
24
  if (!zss_engine_1.isDevelopment && styleSheet)
package/dist/esm/css.js CHANGED
@@ -9,9 +9,15 @@ class css {
9
9
  static create(object) {
10
10
  return create(object);
11
11
  }
12
- static global(object) {
13
- return global(object);
14
- }
12
+ static global = ((called = false) => {
13
+ return (object) => {
14
+ if (called) {
15
+ throw new Error('css.global() must be one');
16
+ }
17
+ called = true;
18
+ return global(object);
19
+ };
20
+ })();
15
21
  static defineThemeVars(object) {
16
22
  return defineThemeVars(object);
17
23
  }
@@ -1,6 +1,4 @@
1
1
  import { build, isDevelopment } from 'zss-engine';
2
- import path from 'path';
3
- const __dirname = import.meta.dirname;
4
2
  let resolvePromise;
5
3
  let globalPromise;
6
4
  const sheetQueue = [];
@@ -13,7 +11,9 @@ function initPromise() {
13
11
  };
14
12
  });
15
13
  }
16
- function processQueue() {
14
+ async function processQueue() {
15
+ const path = await import('path');
16
+ const __dirname = import.meta.dirname;
17
17
  const filePath = path.join(__dirname, '../../../stylesheet/core.css');
18
18
  while (sheetQueue.length > 0) {
19
19
  const styleSheet = sheetQueue.shift();
@@ -1,6 +1,4 @@
1
1
  import { build, isDevelopment } from 'zss-engine';
2
- import path from 'path';
3
- const __dirname = import.meta.dirname;
4
2
  let resolvePromise;
5
3
  let globalPromise;
6
4
  const seetQueue = [];
@@ -14,6 +12,8 @@ function initPromise() {
14
12
  });
15
13
  }
16
14
  async function processSheets() {
15
+ const path = await import('path');
16
+ const __dirname = import.meta.dirname;
17
17
  const filePath = path.join(__dirname, '../../../stylesheet/core.css');
18
18
  while (seetQueue.length > 0) {
19
19
  const [styleSheet, option] = seetQueue.shift();
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.7.10",
3
+ "version": "0.7.14",
4
4
  "description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
5
5
  "keywords": [
6
- "react",
7
- "vite",
8
- "next",
9
6
  "css",
10
7
  "css-in-js",
11
8
  "plumeria",
12
- "styling"
9
+ "react",
10
+ "vite",
11
+ "next"
13
12
  ],
14
13
  "repository": "github:zss-in-js/plumeria",
15
- "author": "Refirst",
16
14
  "license": "MIT",
17
15
  "sideEffects": false,
18
16
  "exports": {
19
17
  "./package.json": "./package.json",
20
- "./stylesheet": {
21
- "types": "./stylesheet/index.d.ts",
22
- "import": "./stylesheet/index.mjs",
23
- "default": "./stylesheet/index.js"
24
- },
18
+ "./stylesheet": "./stylesheet/core.css",
25
19
  "./dist/method/create-build-helper": {
26
20
  "types": "./types/method/create-build-helper.d.ts",
27
21
  "import": "./dist/esm/method/create-build-helper.js",
@@ -46,19 +40,19 @@
46
40
  "types/",
47
41
  "stylesheet/"
48
42
  ],
43
+ "scripts": {
44
+ "build": "rimraf dist types && pnpm esm && pnpm cjs",
45
+ "cjs": "tsc --project tsconfig.cjs.json",
46
+ "esm": "tsc --project tsconfig.esm.json && node __direname"
47
+ },
49
48
  "dependencies": {
50
49
  "style-preset": "0.0.14",
51
- "zss-engine": "0.2.24"
50
+ "zss-engine": "0.2.26"
52
51
  },
53
52
  "peerDependencies": {
54
53
  "@plumeria/compiler": ">=0.6.5"
55
54
  },
56
55
  "publishConfig": {
57
56
  "access": "public"
58
- },
59
- "scripts": {
60
- "build": "rimraf dist types && pnpm esm && pnpm cjs",
61
- "cjs": "tsc --project tsconfig.cjs.json",
62
- "esm": "tsc --project tsconfig.esm.json && node __direname"
63
57
  }
64
- }
58
+ }
package/types/css.d.ts CHANGED
@@ -3,7 +3,7 @@ import { cx } from './cx.js';
3
3
  import { rx } from './rx.js';
4
4
  declare class css {
5
5
  static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
6
- static global(object: CustomHTMLType): void;
6
+ static global: (object: CustomHTMLType) => void;
7
7
  static defineThemeVars<const T extends VarsDefinition>(object: T): { [K in keyof T]: `var(--${string & K})`; };
8
8
  static keyframes(object: KeyframesDefinition): string;
9
9
  static media: {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) zss-in-js contributer
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,2 +0,0 @@
1
- // @plumeria/core/stylesheet/index.d.ts
2
- declare module '@plumeria/core/stylesheet';
@@ -1 +0,0 @@
1
- require('./core.css');
@@ -1 +0,0 @@
1
- import './core.css';