tpmkms_4wp 8.9.1-beta.3 → 8.9.1-beta.4

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 CHANGED
@@ -9,6 +9,18 @@ const wp_tests = require('./wp.test.json')
9
9
  const instance = require('./wp.instance.json')
10
10
 
11
11
  /*
12
+ working on
13
+ bold the first word
14
+ bold the first paragraph
15
+ bold the first letter
16
+
17
+ after
18
+ bold the first word of every paragraph
19
+ bold the first letter of every word
20
+
21
+ after
22
+ make the words that start with t blue
23
+
12
24
  the bolded words that start with t
13
25
 
14
26
  start inserting text until I say banana
@@ -17,7 +29,9 @@ const instance = require('./wp.instance.json')
17
29
  stop inserting text
18
30
 
19
31
  make the text of the 1st to 3rd paragraphs blue
20
-
32
+
33
+ capitalize the words banana and word
34
+ capitalize banana and tree
21
35
 
22
36
  make the words that start with a bold
23
37
 
@@ -101,9 +115,16 @@ const changeState = ({api, isA, context, toArray, element, state}) => {
101
115
  let unit = root(context.element.marker)
102
116
  let scope
103
117
  let conditions = []
104
- if (isA(context.element, 'everything')) {
118
+
119
+ if (context.element.ordinal) {
120
+ conditions.push({ ordinals: toArray(context.element.ordinal).map((context) => context.value)})
121
+ } else if (isA(context.element, 'everything')) {
105
122
  scope = 'all'
106
- } else if (context.element.conditions) {
123
+ } else if (context.element.quantity) {
124
+ scope = context.element.quantity.quantity
125
+ }
126
+
127
+ if (context.element.conditions) {
107
128
  for (const condition of context.element.conditions) {
108
129
  if (condition.marker == 'wordComparisonWith_wp') {
109
130
  // with or not with that is the question
@@ -119,9 +140,8 @@ const changeState = ({api, isA, context, toArray, element, state}) => {
119
140
  }
120
141
  }
121
142
  }
122
- } else {
123
- scope = context.element.quantity.quantity
124
143
  }
144
+
125
145
  const update = { unit, scope, conditions }
126
146
  setUpdate(isA, update, toArray(context.state))
127
147
  api.changeState(update)
@@ -130,10 +150,11 @@ const changeState = ({api, isA, context, toArray, element, state}) => {
130
150
  template = {
131
151
  configs: [
132
152
  'setidsuffix _wp',
133
- 'words are countable and statefulElements',
134
- 'characters are countable',
135
- 'paragraphs are countable and statefulElement',
153
+ 'words are countable orderable and statefulElements',
154
+ 'characters are countable orderable and statefulElements',
155
+ 'paragraphs are countable orderable and statefulElement',
136
156
  'text is a statefulElement',
157
+ 'letters means characters',
137
158
  'bold, italic, code, capitalize, lowercase and underline are styles',
138
159
  'underlined means underline',
139
160
  'capitalized means capitalize',
@@ -141,7 +162,7 @@ template = {
141
162
  'italicize means italic',
142
163
  'italicized means italic',
143
164
  // TODO have a mode where I can stay this is a definition sentence then just say style modifies and it will do it right
144
- 'capitalized, bolded, italicized and underlined are styleModifiers',
165
+ 'uppercased, lowercased, capitalized, bolded, italicized and underlined are styleModifiers',
145
166
  // 'start end and contain are wordComparisonWiths',
146
167
  // 'styles are negatable',
147
168
  "resetIdSuffix",