arche 0.3.3 → 0.3.6
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/.github/workflows/nodejs.yml +1 -1
- package/README.md +3 -3
- package/es.js +4 -4
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +1 -1
- package/test.js +2 -1
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|

|
|
3
3
|
> Arche (/ˈɑːrki/; Ancient Greek: ἀρχή) is a Greek word with primary senses "beginning", "origin" or "source of action" (ἐξ' ἀρχῆς: from the beginning, οr ἐξ' ἀρχῆς λόγος: the original argument), and later "first principle" or "element". ([wikipedia](https://en.wikipedia.org/wiki/Arche))
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
[](https://codecov.io/gh/richytong/arche)
|
|
7
7
|
|
|
8
|
-
HTML as JavaScript.
|
|
8
|
+
HTML as JavaScript.
|
|
9
9
|
|
|
10
10
|
```javascript [playground]
|
|
11
11
|
const ReactElement = Arche(React)
|
|
@@ -24,7 +24,7 @@ const myElement = Div([
|
|
|
24
24
|
render(myElement)
|
|
25
25
|
// <div>
|
|
26
26
|
// <h1>I am a heading</h1>
|
|
27
|
-
// <p>
|
|
27
|
+
// <p>paragraph</p>
|
|
28
28
|
// <p>lorem ipsum</p>
|
|
29
29
|
// </div>
|
|
30
30
|
```
|
package/es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Arche v0.3.
|
|
2
|
+
* Arche v0.3.5
|
|
3
3
|
* https://github.com/richytong/arche
|
|
4
4
|
* (c) 2020-2023 Richard Tong
|
|
5
5
|
* Arche may be freely distributed under the MIT license.
|
|
@@ -264,7 +264,7 @@ const Arche = function (creator, options = {}) {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
if (isArray(arg1)) {
|
|
267
|
-
if (arg0.css == null) {
|
|
267
|
+
if (arg0 == null || arg0.css == null) {
|
|
268
268
|
return creatorCreateElement(creator, type, arg0, arg1)
|
|
269
269
|
}
|
|
270
270
|
const { css, ...props } = arg0
|
|
@@ -272,14 +272,14 @@ const Arche = function (creator, options = {}) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
if (arg1 == null) {
|
|
275
|
-
if (arg0.css == null) {
|
|
275
|
+
if (arg0 == null || arg0.css == null) {
|
|
276
276
|
return creatorCreateElement(creator, type, arg0, [])
|
|
277
277
|
}
|
|
278
278
|
const { css, ...props } = arg0
|
|
279
279
|
return creatorCreateElement(creator, styledComponent([css]), props, [])
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
if (arg0.css == null) {
|
|
282
|
+
if (arg0 == null || arg0.css == null) {
|
|
283
283
|
return creatorCreateElement(creator, type, arg0, [arg1])
|
|
284
284
|
}
|
|
285
285
|
const { css, ...props } = arg0
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Arche v0.3.
|
|
2
|
+
* Arche v0.3.5
|
|
3
3
|
* https://github.com/richytong/arche
|
|
4
4
|
* (c) 2020-2023 Richard Tong
|
|
5
5
|
* Arche may be freely distributed under the MIT license.
|
|
@@ -270,7 +270,7 @@ const Arche = function (creator, options = {}) {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
if (isArray(arg1)) {
|
|
273
|
-
if (arg0.css == null) {
|
|
273
|
+
if (arg0 == null || arg0.css == null) {
|
|
274
274
|
return creatorCreateElement(creator, type, arg0, arg1)
|
|
275
275
|
}
|
|
276
276
|
const { css, ...props } = arg0
|
|
@@ -278,14 +278,14 @@ const Arche = function (creator, options = {}) {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
if (arg1 == null) {
|
|
281
|
-
if (arg0.css == null) {
|
|
281
|
+
if (arg0 == null || arg0.css == null) {
|
|
282
282
|
return creatorCreateElement(creator, type, arg0, [])
|
|
283
283
|
}
|
|
284
284
|
const { css, ...props } = arg0
|
|
285
285
|
return creatorCreateElement(creator, styledComponent([css]), props, [])
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
if (arg0.css == null) {
|
|
288
|
+
if (arg0 == null || arg0.css == null) {
|
|
289
289
|
return creatorCreateElement(creator, type, arg0, [arg1])
|
|
290
290
|
}
|
|
291
291
|
const { css, ...props } = arg0
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Arche v0.3.
|
|
2
|
+
* Arche v0.3.5
|
|
3
3
|
* https://github.com/richytong/arche
|
|
4
4
|
* (c) 2020-2023 Richard Tong
|
|
5
5
|
* Arche may be freely distributed under the MIT license.
|
|
@@ -264,7 +264,7 @@ const Arche = function (creator, options = {}) {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
if (isArray(arg1)) {
|
|
267
|
-
if (arg0.css == null) {
|
|
267
|
+
if (arg0 == null || arg0.css == null) {
|
|
268
268
|
return creatorCreateElement(creator, type, arg0, arg1)
|
|
269
269
|
}
|
|
270
270
|
const { css, ...props } = arg0
|
|
@@ -272,14 +272,14 @@ const Arche = function (creator, options = {}) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
if (arg1 == null) {
|
|
275
|
-
if (arg0.css == null) {
|
|
275
|
+
if (arg0 == null || arg0.css == null) {
|
|
276
276
|
return creatorCreateElement(creator, type, arg0, [])
|
|
277
277
|
}
|
|
278
278
|
const { css, ...props } = arg0
|
|
279
279
|
return creatorCreateElement(creator, styledComponent([css]), props, [])
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
if (arg0.css == null) {
|
|
282
|
+
if (arg0 == null || arg0.css == null) {
|
|
283
283
|
return creatorCreateElement(creator, type, arg0, [arg1])
|
|
284
284
|
}
|
|
285
285
|
const { css, ...props } = arg0
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -117,11 +117,12 @@ describe('Arche', () => {
|
|
|
117
117
|
Div({ css: 'article', id: 'nested' }, [
|
|
118
118
|
Article('yo'),
|
|
119
119
|
]),
|
|
120
|
+
Span(),
|
|
120
121
|
])
|
|
121
122
|
|
|
122
123
|
assert.strictEqual(
|
|
123
124
|
JSON.stringify(el),
|
|
124
|
-
'["div",{},[["h1",{},["header"]],["h3",{"style":{"color":"grey"}},["description"]],["b",{"id":"hey","excluded":null},[]],["article",{"id":"nested"},[["article",{},["yo"]]]]]]')
|
|
125
|
+
'["div",{},[["h1",{},["header"]],["h3",{"style":{"color":"grey"}},["description"]],["b",{"id":"hey","excluded":null},[]],["article",{"id":"nested"},[["article",{},["yo"]]]],["span",{},[]]]]')
|
|
125
126
|
})
|
|
126
127
|
})
|
|
127
128
|
})
|