shineout 3.1.22 → 3.1.24

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/esm/index.js CHANGED
@@ -58,5 +58,5 @@ export * from "./deprecated";
58
58
  import * as _TYPE from "./type";
59
59
  export { _TYPE as TYPE };
60
60
  export default {
61
- version: '3.1.22'
61
+ version: '3.1.24'
62
62
  };
@@ -1,4 +1,17 @@
1
+ import { setJssConfig } from '@sheinx/shineout-style';
2
+ import { _convertCamelToDash } from "./utils";
1
3
  import { setConfig } from "./..";
2
4
  setConfig({
3
5
  delay: 0
6
+ });
7
+ setJssConfig({
8
+ generateId: function generateId(rule, sheet) {
9
+ var options = sheet.options;
10
+ var ns = options.classNamePrefix;
11
+ if (!ns) {
12
+ console.warn('[sheinx/base]: styled should give namespace');
13
+ }
14
+ var prefix = 'soui-';
15
+ return "".concat(prefix).concat(ns).concat(_convertCamelToDash(rule.key));
16
+ }
4
17
  });
@@ -27,5 +27,6 @@ export declare const delay: (time: number) => Promise<void>;
27
27
  type classNamesMapType = {
28
28
  [key: string]: string;
29
29
  };
30
+ export declare function _convertCamelToDash(str: string): string;
30
31
  export declare const createClassName: (componentsName: string, originClasses: string[], originItemClasses: string[]) => classNamesMapType;
31
32
  export {};
@@ -126,7 +126,7 @@ export var delay = function delay(time) {
126
126
  }, time);
127
127
  });
128
128
  };
129
- function _convertCamelToDash(str) {
129
+ export function _convertCamelToDash(str) {
130
130
  return str.replace(/([A-Z])/g, '-$1').replace(/^-/, '').toLowerCase();
131
131
  }
132
132
  function convertHashClassName(componentsName, key) {
@@ -136,12 +136,12 @@ function convertHashClassName(componentsName, key) {
136
136
 
137
137
  // Automatically generate corresponding className according to jss type
138
138
  export var createClassName = function createClassName(componentsName, originClasses, originItemClasses) {
139
- // const prefix = `so-${componentsName}-`;
139
+ var prefix = "soui-".concat(componentsName, "-");
140
140
  var classNamesMap = {};
141
141
  var classes = [].concat(_toConsumableArray(originClasses), _toConsumableArray(originItemClasses));
142
142
  classes.forEach(function (item) {
143
- // classNamesMap[item] = `${prefix}${convertCamelToDash(item)}`;
144
- classNamesMap[item] = convertHashClassName(componentsName, item);
143
+ classNamesMap[item] = "".concat(prefix).concat(_convertCamelToDash(item));
144
+ // classNamesMap[item] = convertHashClassName(componentsName, item);
145
145
  if (!originItemClasses.includes(item)) classNamesMap[item] = ".".concat(classNamesMap[item]);
146
146
  });
147
147
  return classNamesMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "3.1.22",
3
+ "version": "3.1.24",
4
4
  "description": "A components library for React",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -16,10 +16,10 @@
16
16
  "module": "./esm/index.js",
17
17
  "typings": "./cjs/index.d.ts",
18
18
  "dependencies": {
19
- "@sheinx/base": "3.1.22",
20
- "@sheinx/hooks": "3.1.22",
21
- "@sheinx/shineout-style": "3.1.22",
22
- "@sheinx/theme": "3.1.22",
19
+ "@sheinx/base": "3.1.24",
20
+ "@sheinx/hooks": "3.1.24",
21
+ "@sheinx/shineout-style": "3.1.24",
22
+ "@sheinx/theme": "3.1.24",
23
23
  "classnames": "^2.0.0",
24
24
  "immer": "^10.0.0",
25
25
  "deep-eql": "^4.0.0"