tpmkms_4wp 8.9.1-beta.0 → 8.9.1-beta.2

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,8 @@ const wp_tests = require('./wp.test.json')
9
9
  const instance = require('./wp.instance.json')
10
10
 
11
11
  /*
12
+ the bolded words that start with t
13
+
12
14
  start inserting text until I say banana
13
15
  ...
14
16
  or
@@ -17,12 +19,16 @@ const instance = require('./wp.instance.json')
17
19
  make the text of the 1st to 3rd paragraphs blue
18
20
 
19
21
 
22
+ make the words that start with a bold
23
+
20
24
  make every word bold and underlines and blue -> weirdly "bold underlined and blue" works
21
25
 
22
26
  make the font ...
23
27
  make the color blue
24
28
  make the color of the first paragraph blue
25
29
 
30
+ undeline the bolded text / the text that is bolded
31
+
26
32
  words that start with a
27
33
  make all the bold text uppercase
28
34
  underline all the bold text
@@ -38,6 +44,11 @@ const instance = require('./wp.instance.json')
38
44
  bold the first three words that start with t
39
45
  bold much and many
40
46
  make the words that start with t bold and underlined
47
+ make all the capital letters|punctuation bold
48
+
49
+ move this paragraph up 2
50
+ move the next paragraph up 1
51
+ move the last paragraph before this one
41
52
  */
42
53
 
43
54
  class API {
@@ -90,11 +101,16 @@ const changeState = ({api, isA, context, toArray, element, state}) => {
90
101
  let conditions = []
91
102
  if (isA(context.element, 'everything')) {
92
103
  scope = 'all'
93
- } else if (context.element.condition) {
94
- const condition = context.element.condition
95
- if (condition.marker == 'wordComparison_wp') {
104
+ } else if (context.element.conditions) {
105
+ const condition = context.element.conditions[0]
106
+ if (condition.marker == 'wordComparisonWith_wp') {
107
+ // with or not with that is the question
96
108
  const letters = condition.letters.letters.text
97
109
  conditions.push({ comparison: condition.comparison, letters })
110
+ } else if (condition.marker == 'wordComparison_wp') {
111
+ // with or not with that is the question
112
+ const letters = condition.letters.text
113
+ conditions.push({ comparison: condition.comparison, letters })
98
114
  }
99
115
  } else {
100
116
  scope = context.element.quantity.quantity
@@ -109,40 +125,61 @@ template = {
109
125
  'setidsuffix _wp',
110
126
  'words are countable and statefulElements',
111
127
  'characters are countable',
112
- 'paragraphs are countable',
128
+ 'paragraphs are countable and statefulElement',
129
+ 'text is a statefulElement',
113
130
  'bold, italic, code, capitalize, lowercase and underline are styles',
114
131
  'underlined means underline',
115
132
  'capitalized means capitalize',
116
133
  'uppercase means capitalize',
117
134
  'italicize means italic',
118
135
  'italicized means italic',
119
- // 'start end and contain are wordComparisons',
136
+ // TODO have a mode where I can stay this is a definition sentence then just say style modifies and it will do it right
137
+ 'capitalized, bolded, italicized and underlined are styleModifiers',
138
+ // 'start end and contain are wordComparisonWiths',
120
139
  // 'styles are negatable',
121
140
  "resetIdSuffix",
122
141
  {
123
142
  operators: [
124
143
  "([changeState_wp|make] ([statefulElement_wp]) ([stateValue_wp|]))",
125
144
  "((style_wp/*) [applyStyle_wp] ([statefulElement_wp|]))",
126
- "((word_wp/*) [wordComparison_wp] ([startsWith_wp|with] (a/0)? (letters)))",
145
+ "((word_wp/*) [wordComparisonWith_wp] ([comparisonWith_wp|with] (a/0)? (letters)))",
146
+ "((word_wp/*) [wordComparison_wp] (a/0)? (letters))",
147
+ "((styleModifier_wp/*) [modifiedByStyle_wp] (statefulElement_wp/*))",
127
148
  ],
128
149
  bridges: [
129
150
  {
130
- id: 'wordComparison_wp',
151
+ id: 'modifiedByStyle_wp',
152
+ parents: ['adjective'],
153
+ convolution: true,
154
+ bridge: "{ ...after[0], style: before[0], target: after[0], generate: ['style', 'target'], conditions: append(after[0].conditions, [before[0]]) }",
155
+ },
156
+ {
157
+ id: 'wordComparisonWith_wp',
131
158
  parents: ['verb'],
132
159
  words: [
133
160
  { word: 'start', comparison: 'prefix' },
134
161
  { word: 'starts', comparison: 'prefix', },
135
162
  { word: 'end', comparison: 'suffix' },
136
163
  { word: 'ends', comparison: 'suffix' },
164
+ ],
165
+ bridge: "{ ...next(operator), element: before[0], subject: before[0], letters: after[0], verb: operator, generate: ['element', 'verb', 'letters'] }",
166
+ },
167
+ {
168
+ id: 'wordComparison_wp',
169
+ parents: ['verb'],
170
+ words: [
137
171
  { word: 'contain', comparison: 'include' },
138
172
  { word: 'contains', comparison: 'include' },
139
173
  { word: 'include', comparison: 'include' },
140
174
  { word: 'includes', comparison: 'include' },
141
175
  ],
142
- bridge: "{ ...next(operator), element: before[0], subject: before[0], letters: after[0], verb: operator, generate: ['element', 'verb', 'letters'] }",
176
+ optional: {
177
+ 1: "{ marker: 'a' }",
178
+ },
179
+ bridge: "{ ...next(operator), element: before[0], subject: before[0], letters: after[1], verb: operator, generate: ['element', 'verb', 'letters'] }",
143
180
  },
144
181
  {
145
- id: 'startsWith_wp',
182
+ id: 'comparisonWith_wp',
146
183
  parents: ['preposition'],
147
184
  optional: {
148
185
  1: "{ marker: 'a' }",
@@ -204,7 +241,7 @@ template = {
204
241
  ],
205
242
  priorities: [
206
243
  { "context": [['changeState_wp',0], ['statefulElement_wp', 0], ['list', 0]], ordered: true, choose: [0] },
207
- { "context": [['startsWith_wp',0], ['unknown', 0], ['list', 1]], ordered: true, choose: [0] },
244
+ { "context": [['comparisonWith_wp',0], ['unknown', 0], ['list', 1]], ordered: true, choose: [0] },
208
245
  ],
209
246
  },
210
247
  // "([changeState_wp|make] ([statefulElement_wp]) ([stateValue_wp|]))",