cellery 1.4.0 → 1.4.1
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/index.d.ts +0 -1
- package/lib/cellery.js +0 -1
- package/lib/cells.js +1 -19
- package/lib/compat.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/lib/cellery.js
CHANGED
package/lib/cells.js
CHANGED
|
@@ -67,26 +67,11 @@ class Cell {
|
|
|
67
67
|
destroy: true
|
|
68
68
|
})
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
// @deprecated
|
|
72
|
-
register(cellery) {}
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
class Style {
|
|
76
73
|
constructor(opts = {}) {
|
|
77
74
|
this.content = parse(opts.children?.join('\n'))
|
|
78
|
-
|
|
79
|
-
// setup data-cellery-cell for namespaced matching
|
|
80
|
-
const cellNames = new Set(Object.keys(opts.cells))
|
|
81
|
-
|
|
82
|
-
walk(this.content, {
|
|
83
|
-
visit: 'TypeSelector',
|
|
84
|
-
enter(node) {
|
|
85
|
-
if (cellNames.has(node.name)) {
|
|
86
|
-
node.name = `[data-cellery-cell="${node.name}"]`
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
75
|
}
|
|
91
76
|
|
|
92
77
|
findPropertyOfCell(name, property) {
|
|
@@ -113,14 +98,11 @@ class Style {
|
|
|
113
98
|
return value
|
|
114
99
|
}
|
|
115
100
|
|
|
116
|
-
addScope(
|
|
101
|
+
addScope(parent) {
|
|
117
102
|
walk(this.content, {
|
|
118
103
|
visit: 'Rule',
|
|
119
104
|
enter(rule) {
|
|
120
105
|
rule.prelude.children.forEach((selector) => {
|
|
121
|
-
const str = generate(selector)
|
|
122
|
-
if (!str.startsWith(target)) return
|
|
123
|
-
|
|
124
106
|
selector.children.prependData({ type: 'Combinator', name: ' ' })
|
|
125
107
|
selector.children.prependData({ type: 'IdSelector', name: parent })
|
|
126
108
|
})
|
package/lib/compat.js
CHANGED
|
@@ -12,7 +12,7 @@ module.exports = {
|
|
|
12
12
|
input: Input.Styled({ multiline: false }),
|
|
13
13
|
textbox: Input.Styled({ multiline: true }),
|
|
14
14
|
span: Text,
|
|
15
|
-
button:
|
|
15
|
+
button: Container.Styled({ events: ['click'] }),
|
|
16
16
|
p: Text.Styled({ paragraph: true }),
|
|
17
17
|
style: Style
|
|
18
18
|
}
|