domql 1.5.117 → 1.5.118

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "domql",
3
3
  "description": "DOM rendering Javascript framework at early stage.",
4
4
  "author": "symbo.ls",
5
- "version": "1.5.117",
5
+ "version": "1.5.118",
6
6
  "repository": "https://github.com/domql/domql",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org"
@@ -1,58 +1,4 @@
1
1
  'use strict'
2
2
 
3
- // import DOM from '../../src'
4
- import { isObjectLike, exec, isObject, isEqualDeep } from '@domql/utils'
5
- import { classList } from '../../src/element/mixins'
6
- import createEmotion from '@emotion/css/create-instance'
7
- const ENV = process.env.NODE_ENV
8
-
9
- export const transformEmotionStyle = (emotion, live) => {
10
- return (params, element, state) => {
11
- const execParams = exec(params, element)
12
- if (params) {
13
- if (isObjectLike(element.class)) element.class.elementStyle = execParams
14
- else element.class = { elementStyle: execParams }
15
- }
16
- transformEmotionClass(emotion, live)(element.class, element, state, true)
17
- }
18
- }
19
-
20
- export const transformEmotionClass = (emotion, live) => {
21
- return (params, element, state, flag) => {
22
- if (element.style && !flag) return
23
- const { __ref } = element
24
- const { __class, __classNames } = __ref
25
-
26
- if (!isObjectLike(params)) return
27
-
28
- for (const key in params) {
29
- const prop = exec(params[key], element)
30
-
31
- if (!prop) {
32
- delete __class[key]
33
- delete __classNames[key]
34
- continue
35
- }
36
-
37
- const isEqual = isEqualDeep(__class[key], prop)
38
- if (!isEqual) {
39
- if ((ENV === 'test' || ENV === 'development') && isObject(prop)) prop.label = key || element.key
40
-
41
- const CSSed = emotion.css(prop)
42
- __class[key] = prop
43
- __classNames[key] = CSSed
44
- }
45
- }
46
- classList(__classNames, element, element.node, live)
47
- // return element.class
48
- }
49
- }
50
-
51
- export const transformDOMQLEmotion = (emotion, options) => {
52
- if (!emotion) emotion = createEmotion(options || { key: 'smbls' })
53
-
54
- return {
55
- style: transformEmotionStyle(emotion),
56
- class: transformEmotionClass(emotion)
57
- }
58
- }
3
+ // support legacy import
4
+ export * from '@domql/emotion'