@symbo.ls/preview 0.0.78 → 0.0.79
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 +1 -1
- package/src/app.js +1 -2
- package/src/pages/Typography/collection.js +10 -16
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
4
|
findHeadingLetter,
|
|
5
5
|
getFontFamily
|
|
6
6
|
} from '@symbo.ls/scratch'
|
|
@@ -28,7 +28,7 @@ const getTypeProp = (key, prop, library, defaultValue) => {
|
|
|
28
28
|
const { TYPOGRAPHY } = library
|
|
29
29
|
const { styles } = TYPOGRAPHY
|
|
30
30
|
if (!styles[key]) styles[key] = {}
|
|
31
|
-
return styles[key][prop] ||
|
|
31
|
+
return styles[key][prop] ||
|
|
32
32
|
styles[prop] ||
|
|
33
33
|
TYPOGRAPHY[prop] ||
|
|
34
34
|
defaultValue ||
|
|
@@ -45,10 +45,8 @@ const getTypeStyle = (key, library) => ({
|
|
|
45
45
|
letterWidth: getTypeProp(key, 'letterWidth', library)
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
49
48
|
const isHeading = v => v.length === 2 && v[0] === 'h'
|
|
50
|
-
const isTag = v => HTML_TAGS.root.indexOf(v) > -1
|
|
51
|
-
HTML_TAGS.body.indexOf(v) > -1
|
|
49
|
+
const isTag = v => HTML_TAGS.root.indexOf(v) > -1 || HTML_TAGS.body.indexOf(v) > -1
|
|
52
50
|
const isHelper = v => v.slice(0, 1) === '.'
|
|
53
51
|
|
|
54
52
|
const getCollectionFromArray = (arr, s) => {
|
|
@@ -65,11 +63,11 @@ const getCollectionFromArray = (arr, s) => {
|
|
|
65
63
|
},
|
|
66
64
|
labels: Object.keys(result)
|
|
67
65
|
.filter(key => key !== 'fontSize' && result[key] && result[key] !== '0')
|
|
68
|
-
.map(key => ({
|
|
66
|
+
.map(key => ({
|
|
69
67
|
icon: iconMap[key],
|
|
70
68
|
text: result[key]
|
|
71
69
|
})
|
|
72
|
-
|
|
70
|
+
),
|
|
73
71
|
sequenceValue: s.sequence[
|
|
74
72
|
isHeading(v) ? findHeadingLetter(s.h1Matches, k) : result.fontSize
|
|
75
73
|
]
|
|
@@ -85,7 +83,7 @@ export const headingsCollection = (el, s) => {
|
|
|
85
83
|
|
|
86
84
|
export const tagsCollection = (el, s) => {
|
|
87
85
|
const { __system } = s
|
|
88
|
-
const {
|
|
86
|
+
const { TYPOGRAPHY } = __system
|
|
89
87
|
const { styles } = TYPOGRAPHY
|
|
90
88
|
if (!styles.body) styles.body = {}
|
|
91
89
|
el.removeContent()
|
|
@@ -100,17 +98,13 @@ export const tagsCollection = (el, s) => {
|
|
|
100
98
|
|
|
101
99
|
export const helpersCollection = (el, s) => {
|
|
102
100
|
const { __system } = s
|
|
103
|
-
const { TYPOGRAPHY
|
|
104
|
-
|
|
105
|
-
if (!styles) styles = TYPOGRAPHY.styles = {}
|
|
106
|
-
el.removeContent()
|
|
107
|
-
|
|
108
|
-
const { lineHeight, fontWeight } = TYPOGRAPHY
|
|
109
|
-
const familyValue = getFontFamily('def', FONT_FAMILY)
|
|
110
|
-
const font = familyValue[0]
|
|
101
|
+
const { TYPOGRAPHY } = __system
|
|
102
|
+
const { styles } = TYPOGRAPHY
|
|
111
103
|
|
|
112
104
|
const HELPERS = Object.keys(styles)
|
|
113
105
|
.filter(v => v.slice(0, 1) === '.')
|
|
114
106
|
|
|
107
|
+
el.removeContent()
|
|
108
|
+
|
|
115
109
|
return getCollectionFromArray(HELPERS, s)
|
|
116
110
|
}
|