tpmkms_4wp 8.9.0-beta.20 → 8.9.0-beta.22
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/common/wp.js +12 -1
- package/common/wp.test.json +3844 -4082
- package/package.json +2 -2
package/common/wp.js
CHANGED
@@ -33,6 +33,10 @@ const instance = require('./wp.instance.json')
|
|
33
33
|
word with 'a' in it
|
34
34
|
words containing a
|
35
35
|
every 5th word
|
36
|
+
|
37
|
+
in the first paragraph make the words that start with abc bold
|
38
|
+
bold the first three words that start with t
|
39
|
+
bold much and many
|
36
40
|
*/
|
37
41
|
|
38
42
|
class API {
|
@@ -82,12 +86,19 @@ let config = {
|
|
82
86
|
const changeState = ({api, isA, context, toArray, element, state}) => {
|
83
87
|
let unit = root(context.element.marker)
|
84
88
|
let scope
|
89
|
+
let conditions = []
|
85
90
|
if (isA(context.element, 'everything')) {
|
86
91
|
scope = 'all'
|
92
|
+
} else if (context.element.condition) {
|
93
|
+
const condition = context.element.condition
|
94
|
+
if (condition.marker == 'start_wp') {
|
95
|
+
const letters = condition.letters.letters.text
|
96
|
+
conditions.push({ comparison: 'prefix', letters })
|
97
|
+
}
|
87
98
|
} else {
|
88
99
|
scope = context.element.quantity.quantity
|
89
100
|
}
|
90
|
-
const update = { unit, scope }
|
101
|
+
const update = { unit, scope, conditions }
|
91
102
|
setUpdate(isA, update, toArray(context.state))
|
92
103
|
api.changeState(update)
|
93
104
|
}
|