tpmkms_4wp 7.12.4-beta.2 → 7.12.4-beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,6 +41,8 @@ let configStruct = {
41
41
  // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
42
42
  "(([queryable]) [(<isEd|> ([isEdAble|]))])",
43
43
 
44
+ "([nevermind])",
45
+ { pattern: "([nevermindTestSetup] (allowed))", development: true },
44
46
  "([why])",
45
47
  "([reason])",
46
48
  "([thisitthat|])",
@@ -204,6 +206,44 @@ let configStruct = {
204
206
  before: ['verby'],
205
207
  bridge: "{ ...next(operator) }"
206
208
  },
209
+ {
210
+ id: "nevermind",
211
+ bridge: "{ ...next(operator) }",
212
+ semantic: (args) => {
213
+ const {config, context} = args
214
+ // stop asking all questions
215
+ for (const semantic of config.semantics) {
216
+ if (semantic.isQuestion) {
217
+ let doRemove = true
218
+ if (semantic.onNevermind && semantic.getWasAsked() && !semantic.getWasApplied()) {
219
+ doRemove = semantic.onNevermind(args)
220
+ }
221
+ if (doRemove) {
222
+ config.removeSemantic(semantic)
223
+ }
224
+ }
225
+ }
226
+ }
227
+ },
228
+ {
229
+ id: "nevermindTestSetup",
230
+ development: true,
231
+ bridge: "{ ...next(operator), type: after[0], postModifiers: ['type'] }",
232
+ semantic: ({ask, context}) => {
233
+ const nevermindType = context.type.value
234
+ ask({
235
+ applyq: () => 'the test question?',
236
+ onNevermind: ({objects, context}) => {
237
+ objects.onNevermindWasCalled = true
238
+ debugger
239
+ objects.nevermindType = nevermindType
240
+ return nevermindType == 'accept'
241
+ },
242
+ matchr: () => false,
243
+ applyr: () => {},
244
+ })
245
+ }
246
+ },
207
247
  {
208
248
  id: "why",
209
249
  level: 0,
@@ -903,6 +943,7 @@ knowledgeModule( {
903
943
  name: './dialogues.test.json',
904
944
  contents: dialogues_tests,
905
945
  checks: {
946
+ objects: ['onNevermindWasCalled', 'nevermindType'],
906
947
  context: defaultContextCheck,
907
948
  },
908
949