@plumeria/core 2.2.0 → 2.2.1

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/css.js CHANGED
@@ -22,58 +22,46 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
 
23
23
  const zss_engine = __toESM(require("zss-engine"));
24
24
 
25
- let resolvePromise_1;
26
- let globalPromise_1;
27
- const sheetQueue_1 = [];
28
- let isProcessing_1 = false;
29
- function initPromise_1() {
30
- globalPromise_1 = new Promise((resolve) => {
31
- resolvePromise_1 = (value) => {
32
- sheetQueue_1.push(value);
33
- resolve(value);
34
- };
35
- });
36
- }
37
- async function processQueue_1(filePath) {
38
- while (sheetQueue_1.length > 0) {
39
- const styleSheet = sheetQueue_1.shift();
40
- if (!zss_engine.isDevelopment && styleSheet) (0, zss_engine.build)(styleSheet, filePath);
41
- }
42
- isProcessing_1 = false;
43
- }
44
- async function buildProps(filePath) {
45
- if (typeof globalPromise_1 === "undefined") initPromise_1();
46
- if (!isProcessing_1 && sheetQueue_1.length > 0) {
47
- isProcessing_1 = true;
48
- processQueue_1(filePath);
49
- }
50
- }
51
- let resolvePromise_2;
52
- let globalPromise_2;
53
- const sheetQueue_2 = [];
54
- let isProcessing_2 = false;
55
- function initPromise_2() {
56
- globalPromise_2 = new Promise((resolve) => {
57
- resolvePromise_2 = (value) => {
58
- sheetQueue_2.push(value);
59
- resolve(value);
60
- };
61
- });
62
- }
63
- async function processQueue_2(filePath) {
64
- while (sheetQueue_2.length > 0) {
65
- const styleSheet = sheetQueue_2.shift();
66
- if (!zss_engine.isDevelopment && styleSheet) (0, zss_engine.build)(styleSheet, filePath, "--global");
67
- }
68
- isProcessing_2 = false;
69
- }
70
- async function buildGlobal(filePath) {
71
- if (typeof globalPromise_2 === "undefined") initPromise_2();
72
- if (!isProcessing_2 && sheetQueue_2.length > 0) {
73
- isProcessing_2 = true;
74
- processQueue_2(filePath);
75
- }
76
- }
25
+ const createProcessor = () => {
26
+ let resolve;
27
+ let promise;
28
+ const queue = [];
29
+ let processing = false;
30
+ const init = () => {
31
+ promise = new Promise((r) => {
32
+ resolve = (value) => {
33
+ queue.push(value);
34
+ r(value);
35
+ };
36
+ });
37
+ };
38
+ const process = async (filePath) => {
39
+ while (queue.length > 0) {
40
+ const sheet = queue.shift();
41
+ if (!zss_engine.isDevelopment && sheet) (0, zss_engine.build)(sheet, filePath);
42
+ }
43
+ processing = false;
44
+ };
45
+ const buildFiles = async (filePath) => {
46
+ if (!promise) init();
47
+ if (!processing && queue.length > 0) {
48
+ processing = true;
49
+ process(filePath);
50
+ }
51
+ };
52
+ return {
53
+ get resolve() {
54
+ return resolve;
55
+ },
56
+ get promise() {
57
+ return promise;
58
+ },
59
+ init,
60
+ build: buildFiles
61
+ };
62
+ };
63
+ const gQueue = createProcessor();
64
+ const pQueue = createProcessor();
77
65
 
78
66
  Object.defineProperty(exports, '__toESM', {
79
67
  enumerable: true,
@@ -81,51 +69,15 @@ Object.defineProperty(exports, '__toESM', {
81
69
  return __toESM;
82
70
  }
83
71
  });
84
- Object.defineProperty(exports, 'buildGlobal', {
85
- enumerable: true,
86
- get: function () {
87
- return buildGlobal;
88
- }
89
- });
90
- Object.defineProperty(exports, 'buildProps', {
91
- enumerable: true,
92
- get: function () {
93
- return buildProps;
94
- }
95
- });
96
- Object.defineProperty(exports, 'globalPromise_1', {
97
- enumerable: true,
98
- get: function () {
99
- return globalPromise_1;
100
- }
101
- });
102
- Object.defineProperty(exports, 'globalPromise_2', {
103
- enumerable: true,
104
- get: function () {
105
- return globalPromise_2;
106
- }
107
- });
108
- Object.defineProperty(exports, 'initPromise_1', {
109
- enumerable: true,
110
- get: function () {
111
- return initPromise_1;
112
- }
113
- });
114
- Object.defineProperty(exports, 'initPromise_2', {
115
- enumerable: true,
116
- get: function () {
117
- return initPromise_2;
118
- }
119
- });
120
- Object.defineProperty(exports, 'resolvePromise_1', {
72
+ Object.defineProperty(exports, 'gQueue', {
121
73
  enumerable: true,
122
74
  get: function () {
123
- return resolvePromise_1;
75
+ return gQueue;
124
76
  }
125
77
  });
126
- Object.defineProperty(exports, 'resolvePromise_2', {
78
+ Object.defineProperty(exports, 'pQueue', {
127
79
  enumerable: true,
128
80
  get: function () {
129
- return resolvePromise_2;
81
+ return pQueue;
130
82
  }
131
83
  });
package/dist/css.mjs CHANGED
@@ -1,56 +1,44 @@
1
1
  import { build, isDevelopment } from "zss-engine";
2
2
 
3
- let resolvePromise_1;
4
- let globalPromise_1;
5
- const sheetQueue_1 = [];
6
- let isProcessing_1 = false;
7
- function initPromise_1() {
8
- globalPromise_1 = new Promise((resolve) => {
9
- resolvePromise_1 = (value) => {
10
- sheetQueue_1.push(value);
11
- resolve(value);
12
- };
13
- });
14
- }
15
- async function processQueue_1(filePath) {
16
- while (sheetQueue_1.length > 0) {
17
- const styleSheet = sheetQueue_1.shift();
18
- if (!isDevelopment && styleSheet) build(styleSheet, filePath);
19
- }
20
- isProcessing_1 = false;
21
- }
22
- async function buildProps(filePath) {
23
- if (typeof globalPromise_1 === "undefined") initPromise_1();
24
- if (!isProcessing_1 && sheetQueue_1.length > 0) {
25
- isProcessing_1 = true;
26
- processQueue_1(filePath);
27
- }
28
- }
29
- let resolvePromise_2;
30
- let globalPromise_2;
31
- const sheetQueue_2 = [];
32
- let isProcessing_2 = false;
33
- function initPromise_2() {
34
- globalPromise_2 = new Promise((resolve) => {
35
- resolvePromise_2 = (value) => {
36
- sheetQueue_2.push(value);
37
- resolve(value);
38
- };
39
- });
40
- }
41
- async function processQueue_2(filePath) {
42
- while (sheetQueue_2.length > 0) {
43
- const styleSheet = sheetQueue_2.shift();
44
- if (!isDevelopment && styleSheet) build(styleSheet, filePath, "--global");
45
- }
46
- isProcessing_2 = false;
47
- }
48
- async function buildGlobal(filePath) {
49
- if (typeof globalPromise_2 === "undefined") initPromise_2();
50
- if (!isProcessing_2 && sheetQueue_2.length > 0) {
51
- isProcessing_2 = true;
52
- processQueue_2(filePath);
53
- }
54
- }
3
+ const createProcessor = () => {
4
+ let resolve;
5
+ let promise;
6
+ const queue = [];
7
+ let processing = false;
8
+ const init = () => {
9
+ promise = new Promise((r) => {
10
+ resolve = (value) => {
11
+ queue.push(value);
12
+ r(value);
13
+ };
14
+ });
15
+ };
16
+ const process = async (filePath) => {
17
+ while (queue.length > 0) {
18
+ const sheet = queue.shift();
19
+ if (!isDevelopment && sheet) build(sheet, filePath);
20
+ }
21
+ processing = false;
22
+ };
23
+ const buildFiles = async (filePath) => {
24
+ if (!promise) init();
25
+ if (!processing && queue.length > 0) {
26
+ processing = true;
27
+ process(filePath);
28
+ }
29
+ };
30
+ return {
31
+ get resolve() {
32
+ return resolve;
33
+ },
34
+ get promise() {
35
+ return promise;
36
+ },
37
+ init,
38
+ build: buildFiles
39
+ };
40
+ };
41
+ const gQueue = createProcessor();
42
+ const pQueue = createProcessor();
55
43
 
56
- export { buildGlobal, buildProps, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
44
+ export { gQueue, pQueue };
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ function create(object) {
11
11
  const finalFlat = (0, zss_engine.overrideLonghand)(flat);
12
12
  const records = [];
13
13
  Object.entries(finalFlat).forEach(([prop, value]) => {
14
- if ((prop.startsWith("@media") || prop.startsWith("@container")) && typeof value === "object" && value !== null) Object.entries(value).forEach(([innerProp, innerValue]) => {
14
+ if (prop.startsWith("@media") || prop.startsWith("@container")) Object.entries(value).forEach(([innerProp, innerValue]) => {
15
15
  const atomicMap = new Map();
16
16
  (0, zss_engine.processAtomicProps)({ [innerProp]: innerValue }, atomicMap, prop);
17
17
  const querySheetParts = [];
@@ -121,15 +121,15 @@ function props(...objects) {
121
121
  }
122
122
  const uniqueStyleSheets = [...allStyleSheets].filter((sheet) => !injectedStyleSheets.has(sheet));
123
123
  uniqueStyleSheets.forEach((sheet) => injectedStyleSheets.add(sheet));
124
- if (typeof require_css.globalPromise_1 === "undefined") require_css.initPromise_1();
125
- require_css.resolvePromise_1(uniqueStyleSheets.join(""));
124
+ if (typeof require_css.pQueue.promise === "undefined") require_css.pQueue.init();
125
+ require_css.pQueue.resolve(uniqueStyleSheets.join(""));
126
126
  return classList.join(" ");
127
127
  }
128
128
 
129
129
  function global(object) {
130
130
  const { styleSheet } = (0, zss_engine.transpile)(object, void 0, "--global");
131
- if (typeof require_css.globalPromise_2 === "undefined") require_css.initPromise_2();
132
- require_css.resolvePromise_2(styleSheet);
131
+ if (typeof require_css.gQueue.promise === "undefined") require_css.gQueue.init();
132
+ require_css.gQueue.resolve(styleSheet);
133
133
  }
134
134
 
135
135
  const keyframes = (object) => {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "./css.mjs";
1
+ import { gQueue, pQueue } from "./css.mjs";
2
2
  import { camelToKebabCase, genBase36Hash, overrideLonghand, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
3
3
 
4
4
  const styleAtomMap = new WeakMap();
@@ -11,7 +11,7 @@ function create(object) {
11
11
  const finalFlat = overrideLonghand(flat);
12
12
  const records = [];
13
13
  Object.entries(finalFlat).forEach(([prop, value]) => {
14
- if ((prop.startsWith("@media") || prop.startsWith("@container")) && typeof value === "object" && value !== null) Object.entries(value).forEach(([innerProp, innerValue]) => {
14
+ if (prop.startsWith("@media") || prop.startsWith("@container")) Object.entries(value).forEach(([innerProp, innerValue]) => {
15
15
  const atomicMap = new Map();
16
16
  processAtomicProps({ [innerProp]: innerValue }, atomicMap, prop);
17
17
  const querySheetParts = [];
@@ -121,15 +121,15 @@ function props(...objects) {
121
121
  }
122
122
  const uniqueStyleSheets = [...allStyleSheets].filter((sheet) => !injectedStyleSheets.has(sheet));
123
123
  uniqueStyleSheets.forEach((sheet) => injectedStyleSheets.add(sheet));
124
- if (typeof globalPromise_1 === "undefined") initPromise_1();
125
- resolvePromise_1(uniqueStyleSheets.join(""));
124
+ if (typeof pQueue.promise === "undefined") pQueue.init();
125
+ pQueue.resolve(uniqueStyleSheets.join(""));
126
126
  return classList.join(" ");
127
127
  }
128
128
 
129
129
  function global(object) {
130
130
  const { styleSheet } = transpile(object, void 0, "--global");
131
- if (typeof globalPromise_2 === "undefined") initPromise_2();
132
- resolvePromise_2(styleSheet);
131
+ if (typeof gQueue.promise === "undefined") gQueue.init();
132
+ gQueue.resolve(styleSheet);
133
133
  }
134
134
 
135
135
  const keyframes = (object) => {
@@ -1,11 +1,15 @@
1
1
 
2
- declare let resolvePromise_1: (value: string) => void;
3
- declare let globalPromise_1: Promise<string>;
4
- declare function initPromise_1(): void;
5
- declare function buildProps(filePath: string): Promise<void>;
6
- declare let resolvePromise_2: (value: string) => void;
7
- declare let globalPromise_2: Promise<string>;
8
- declare function initPromise_2(): void;
9
- declare function buildGlobal(filePath: string): Promise<void>;
2
+ declare const gQueue: {
3
+ readonly resolve: (value: string) => void;
4
+ readonly promise: Promise<string>;
5
+ init: () => void;
6
+ build: (filePath: string) => Promise<void>;
7
+ };
8
+ declare const pQueue: {
9
+ readonly resolve: (value: string) => void;
10
+ readonly promise: Promise<string>;
11
+ init: () => void;
12
+ build: (filePath: string) => Promise<void>;
13
+ };
10
14
 
11
- export { buildGlobal, buildProps, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
15
+ export { gQueue, pQueue };
@@ -1,29 +1,3 @@
1
1
  const require_css = require('../css.js');
2
- exports.buildGlobal = require_css.buildGlobal;
3
- exports.buildProps = require_css.buildProps;
4
- Object.defineProperty(exports, 'globalPromise_1', {
5
- enumerable: true,
6
- get: function () {
7
- return require_css.globalPromise_1;
8
- }
9
- });
10
- Object.defineProperty(exports, 'globalPromise_2', {
11
- enumerable: true,
12
- get: function () {
13
- return require_css.globalPromise_2;
14
- }
15
- });
16
- exports.initPromise_1 = require_css.initPromise_1;
17
- exports.initPromise_2 = require_css.initPromise_2;
18
- Object.defineProperty(exports, 'resolvePromise_1', {
19
- enumerable: true,
20
- get: function () {
21
- return require_css.resolvePromise_1;
22
- }
23
- });
24
- Object.defineProperty(exports, 'resolvePromise_2', {
25
- enumerable: true,
26
- get: function () {
27
- return require_css.resolvePromise_2;
28
- }
29
- });
2
+ exports.gQueue = require_css.gQueue;
3
+ exports.pQueue = require_css.pQueue;
@@ -1,2 +1,2 @@
1
- import { buildGlobal, buildProps, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "../css.mjs";
2
- export { buildGlobal, buildProps, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
1
+ import { gQueue, pQueue } from "../css.mjs";
2
+ export { gQueue, pQueue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "An atomic CSS runtime designed to disappear.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "stylesheet.css"
46
46
  ],
47
47
  "dependencies": {
48
- "zss-engine": "1.2.1"
48
+ "zss-engine": "1.2.2"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",