@salty-css/core 0.0.1-alpha.336 → 0.0.1-alpha.338

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.
@@ -2,7 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- const parseStyles = require("./parse-styles-DDx7UpaY.cjs");
5
+ const parseStyles = require("./parse-styles-CA3TP5n1.cjs");
6
6
  const dashCase = require("./dash-case-DIwKaYgE.cjs");
7
7
  const toHash = require("./to-hash-C05Y906F.cjs");
8
8
  class StylesGenerator {
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { p as parseAndJoinStyles } from "./parse-styles-DQoke7UP.js";
4
+ import { p as parseAndJoinStyles } from "./parse-styles-BTIoYnBr.js";
5
5
  import { d as dashCase } from "./dash-case-DblXvymC.js";
6
6
  import { t as toHash } from "./to-hash-DAN2LcHK.js";
7
7
  class StylesGenerator {
@@ -13,7 +13,7 @@ const compiler_helpers = require("./helpers.cjs");
13
13
  const defineTemplates = require("../define-templates-Deq1aCbN.cjs");
14
14
  const dashCase = require("../dash-case-DIwKaYgE.cjs");
15
15
  const toHash = require("../to-hash-C05Y906F.cjs");
16
- const parseStyles = require("../parse-styles-DDx7UpaY.cjs");
16
+ const parseStyles = require("../parse-styles-CA3TP5n1.cjs");
17
17
  const css_merge = require("../css/merge.cjs");
18
18
  const compiler_getFiles = require("./get-files.cjs");
19
19
  const parsers_index = require("../parsers/index.cjs");
@@ -11,7 +11,7 @@ import { isSaltyFile, resolveExportValue, getCorePackageRoot, saltyFileExtension
11
11
  import { d as defineTemplates } from "../define-templates-CVhhgPnd.js";
12
12
  import { d as dashCase } from "../dash-case-DblXvymC.js";
13
13
  import { t as toHash } from "../to-hash-DAN2LcHK.js";
14
- import { p as parseAndJoinStyles, b as parseVariableTokens } from "../parse-styles-DQoke7UP.js";
14
+ import { p as parseAndJoinStyles, b as parseVariableTokens } from "../parse-styles-BTIoYnBr.js";
15
15
  import { mergeObjects, mergeFactories } from "../css/merge.js";
16
16
  import { getPackageJson } from "./get-files.js";
17
17
  import { parseTemplates, getTemplateTypes } from "../parsers/index.js";
package/css/keyframes.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const parseStyles = require("../parse-styles-DDx7UpaY.cjs");
3
+ const parseStyles = require("../parse-styles-CA3TP5n1.cjs");
4
4
  const toHash = require("../to-hash-C05Y906F.cjs");
5
5
  const keyframes = ({ animationName: _name, params: _params, appendInitialStyles, ...keyframes2 }) => {
6
6
  const modifyKeyframes = async (params = {}) => {
package/css/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as parseAndJoinStyles } from "../parse-styles-DQoke7UP.js";
1
+ import { p as parseAndJoinStyles } from "../parse-styles-BTIoYnBr.js";
2
2
  import { t as toHash } from "../to-hash-DAN2LcHK.js";
3
3
  const keyframes = ({ animationName: _name, params: _params, appendInitialStyles, ...keyframes2 }) => {
4
4
  const modifyKeyframes = async (params = {}) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const classNameGenerator = require("../class-name-generator-B_LEduWe.cjs");
3
+ const classNameGenerator = require("../class-name-generator-B2Pb2obX.cjs");
4
4
  const dashCase = require("../dash-case-DIwKaYgE.cjs");
5
5
  class StyledGenerator extends classNameGenerator.StylesGenerator {
6
6
  constructor(tagName, _params) {
@@ -1,5 +1,5 @@
1
- import { S as StylesGenerator } from "../class-name-generator-i5iaicjF.js";
2
- import { C } from "../class-name-generator-i5iaicjF.js";
1
+ import { S as StylesGenerator } from "../class-name-generator-YeSQe_Ik.js";
2
+ import { C } from "../class-name-generator-YeSQe_Ik.js";
3
3
  import { d as dashCase } from "../dash-case-DblXvymC.js";
4
4
  class StyledGenerator extends StylesGenerator {
5
5
  constructor(tagName, _params) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const classNameGenerator = require("../class-name-generator-B_LEduWe.cjs");
3
+ const classNameGenerator = require("../class-name-generator-B2Pb2obX.cjs");
4
4
  const classNameInstance = (params) => {
5
5
  const generator = new classNameGenerator.ClassNameGenerator(params);
6
6
  const createClass = (classNameStr) => {
@@ -1,4 +1,4 @@
1
- import { C as ClassNameGenerator } from "../class-name-generator-i5iaicjF.js";
1
+ import { C as ClassNameGenerator } from "../class-name-generator-YeSQe_Ik.js";
2
2
  const classNameInstance = (params) => {
3
3
  const generator = new ClassNameGenerator(params);
4
4
  const createClass = (classNameStr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.336",
3
+ "version": "0.0.1-alpha.338",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -84,14 +84,14 @@ const parseStyles = async (styles, currentScope = "", config, omitTemplates = fa
84
84
  const cssStyles = /* @__PURE__ */ new Set();
85
85
  const entries = Object.entries(styles);
86
86
  const processStyleEntry = async ([key, value]) => {
87
- var _a;
87
+ var _a, _b;
88
88
  const _key = key.trim().replace(/^\?+/g, "");
89
89
  const propertyName = propertyNameCheck(_key);
90
90
  const toString = (val, eol = ";") => `${propertyName}:${val}${eol}`;
91
91
  const context = { scope: currentScope, config };
92
92
  if (typeof value === "function") return processStyleEntry([key, value(context)]);
93
93
  if (value instanceof Promise) return processStyleEntry([key, await value]);
94
- if ((config == null ? void 0 : config.templates) && config.templatePaths[_key]) {
94
+ if ((config == null ? void 0 : config.templates) && ((_a = config.templatePaths) == null ? void 0 : _a[_key])) {
95
95
  try {
96
96
  const [name, path] = config.templatePaths[_key].split(";;");
97
97
  const functions = await import(
@@ -166,7 +166,7 @@ const parseStyles = async (styles, currentScope = "", config, omitTemplates = fa
166
166
  return void 0;
167
167
  }
168
168
  if (_key.startsWith("@")) {
169
- const mediaQuery = ((_a = config == null ? void 0 : config.mediaQueries) == null ? void 0 : _a[_key]) || _key;
169
+ const mediaQuery = ((_b = config == null ? void 0 : config.mediaQueries) == null ? void 0 : _b[_key]) || _key;
170
170
  const results2 = await parseAndJoinStyles(value, currentScope, config);
171
171
  const query = `${mediaQuery} { ${results2} }`;
172
172
  cssStyles.add(query);
@@ -85,14 +85,14 @@ const parseStyles = async (styles, currentScope = "", config, omitTemplates = fa
85
85
  const cssStyles = /* @__PURE__ */ new Set();
86
86
  const entries = Object.entries(styles);
87
87
  const processStyleEntry = async ([key, value]) => {
88
- var _a;
88
+ var _a, _b;
89
89
  const _key = key.trim().replace(/^\?+/g, "");
90
90
  const propertyName = propertyNameCheck(_key);
91
91
  const toString = (val, eol = ";") => `${propertyName}:${val}${eol}`;
92
92
  const context = { scope: currentScope, config };
93
93
  if (typeof value === "function") return processStyleEntry([key, value(context)]);
94
94
  if (value instanceof Promise) return processStyleEntry([key, await value]);
95
- if ((config == null ? void 0 : config.templates) && config.templatePaths[_key]) {
95
+ if ((config == null ? void 0 : config.templates) && ((_a = config.templatePaths) == null ? void 0 : _a[_key])) {
96
96
  try {
97
97
  const [name, path] = config.templatePaths[_key].split(";;");
98
98
  const functions = await import(
@@ -167,7 +167,7 @@ const parseStyles = async (styles, currentScope = "", config, omitTemplates = fa
167
167
  return void 0;
168
168
  }
169
169
  if (_key.startsWith("@")) {
170
- const mediaQuery = ((_a = config == null ? void 0 : config.mediaQueries) == null ? void 0 : _a[_key]) || _key;
170
+ const mediaQuery = ((_b = config == null ? void 0 : config.mediaQueries) == null ? void 0 : _b[_key]) || _key;
171
171
  const results2 = await parseAndJoinStyles(value, currentScope, config);
172
172
  const query = `${mediaQuery} { ${results2} }`;
173
173
  cssStyles.add(query);
package/parsers/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const parseStyles = require("../parse-styles-DDx7UpaY.cjs");
3
+ const parseStyles = require("../parse-styles-CA3TP5n1.cjs");
4
4
  const dashCase = require("../dash-case-DIwKaYgE.cjs");
5
5
  const toHash = require("../to-hash-C05Y906F.cjs");
6
6
  const parseTemplates = async (obj, path = []) => {
package/parsers/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { p as parseAndJoinStyles } from "../parse-styles-DQoke7UP.js";
2
- import { a, c, d, b } from "../parse-styles-DQoke7UP.js";
1
+ import { p as parseAndJoinStyles } from "../parse-styles-BTIoYnBr.js";
2
+ import { a, c, d, b } from "../parse-styles-BTIoYnBr.js";
3
3
  import { d as dashCase } from "../dash-case-DblXvymC.js";
4
4
  import { t as toHash } from "../to-hash-DAN2LcHK.js";
5
5
  const parseTemplates = async (obj, path = []) => {
@@ -9,5 +9,5 @@ import { CachedConfig, SaltyConfig } from '../types/config-types';
9
9
  * - First item is the main class with all the styles
10
10
  * - Rest of the items are child selectors or media queries etc.
11
11
  */
12
- export declare const parseStyles: <T extends object>(styles?: T, currentScope?: string, config?: (SaltyConfig & CachedConfig) | CachedConfig | undefined, omitTemplates?: boolean) => Promise<string[]>;
13
- export declare const parseAndJoinStyles: <T extends object>(styles: T, currentClass: string, config?: (SaltyConfig & CachedConfig) | undefined, omitTemplates?: boolean) => Promise<string>;
12
+ export declare const parseStyles: <T extends object>(styles?: T, currentScope?: string, config?: Partial<SaltyConfig & CachedConfig> | CachedConfig | undefined, omitTemplates?: boolean) => Promise<string[]>;
13
+ export declare const parseAndJoinStyles: <T extends object>(styles: T, currentClass: string, config?: Partial<SaltyConfig & CachedConfig> | undefined, omitTemplates?: boolean) => Promise<string>;
package/runtime/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const parseStyles = require("../parse-styles-DDx7UpaY.cjs");
3
+ const parseStyles = require("../parse-styles-CA3TP5n1.cjs");
4
4
  const defineRuntime = (config) => {
5
5
  const getDynamicStylesCss = async (styles, scope) => {
6
6
  const parsed = await parseStyles.parseStyles(styles, scope, config);
@@ -1,5 +1,7 @@
1
1
  import { CachedConfig, SaltyConfig } from '../config';
2
2
  import { BaseStyles } from '../types';
3
- export declare const defineRuntime: (config: SaltyConfig & CachedConfig) => {
3
+ type Config = Partial<SaltyConfig & CachedConfig>;
4
+ export declare const defineRuntime: (config: Config) => {
4
5
  getDynamicStylesCss: (styles: BaseStyles, scope?: string) => Promise<string>;
5
6
  };
7
+ export {};
package/runtime/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as parseStyles } from "../parse-styles-DQoke7UP.js";
1
+ import { a as parseStyles } from "../parse-styles-BTIoYnBr.js";
2
2
  const defineRuntime = (config) => {
3
3
  const getDynamicStylesCss = async (styles, scope) => {
4
4
  const parsed = await parseStyles(styles, scope, config);