smbls 0.8.36 → 0.8.39

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
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.8.36",
6
+ "version": "0.8.39",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Link.js CHANGED
@@ -1,10 +1,8 @@
1
1
  'use strict'
2
2
 
3
3
  import { exec } from '@domql/utils'
4
- import { Shape, Text } from '.'
5
4
 
6
5
  export const Link = {
7
- proto: [Shape, Text],
8
6
  tag: 'a',
9
7
  props: {
10
8
  // theme: 'link',
package/src/Media.js CHANGED
@@ -70,19 +70,20 @@ const applySelectorProps = (key, props, result, element) => {
70
70
 
71
71
  const applyCaseProps = (key, props, result, element) => {
72
72
  const caseKey = key.slice(1)
73
- if (!CONFIG_CASES[caseKey]) return
73
+ const isPropTrue = element.props[caseKey]
74
+ if (!CONFIG_CASES[caseKey] && !isPropTrue) return
74
75
  return merge(result, convertPropsToClass(props, result, element))
75
76
  }
76
77
 
77
78
  const applyConditionalCaseProps = (key, props, result, element) => {
78
79
  const caseKey = key.slice(1)
79
80
  const isPropTrue = element.props[caseKey]
80
- console.log(isPropTrue)
81
- console.log(result)
82
81
  if (!isPropTrue) return // remove classname if not here
83
82
  return merge(result, convertPropsToClass(props, result, element))
84
83
  }
85
84
 
85
+ const applyTrueProps = (props, result, element) => merge(result, convertPropsToClass(props, result, element))
86
+
86
87
  const beforeClassAssign = (element, s) => {
87
88
  const { props, class: className } = element
88
89
 
@@ -117,27 +118,14 @@ export const initUpdate = element => {
117
118
  const setter = keySetters[key.slice(0, 1)]
118
119
  if (key === 'theme') {
119
120
  props.update({ themeModifier: globalTheme }, { preventRecursive: true, ignoreInitUpdate: true })
120
- }
121
+ } else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
122
+
121
123
  if (setter) setter(key, props[key], CLASS_NAMES, element)
122
124
  }
123
125
 
124
126
  if (Object.keys(CLASS_NAMES.media).length) className.media = CLASS_NAMES.media
125
127
  className.selector = CLASS_NAMES.selector
126
128
  className.case = CLASS_NAMES.case
127
-
128
- // for (const screen in props) {
129
- // if (screen.slice(0, 1) === '@') {
130
- // const mediaName = screen.slice(1)
131
- // const mediaKey = `@media screen and ${CONFIG_MEDIA[mediaName]}`
132
- // if (mediaName === 'dark' || mediaName === 'light') {
133
- // const { MEDIA_FORCE } = className
134
- // if (!MEDIA_FORCE) className.media = {}
135
- // if (globalTheme === mediaName) {
136
- // className.MEDIA_FORCED = className.MEDIA[mediaKey]
137
- // } else className.MEDIA_FORCED = {}
138
- // }
139
- // }
140
- // }
141
129
  }
142
130
 
143
131
  export const Responsive = {