ekms 8.9.0-beta.14 → 8.9.0-beta.15

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.
@@ -20,10 +20,14 @@
20
20
  "localHierarchy": [
21
21
  [
22
22
  "thisitthat",
23
- "statefulElement"
23
+ "statefulElement_wp"
24
+ ],
25
+ [
26
+ "everything",
27
+ "statefulElement_wp"
24
28
  ]
25
29
  ],
26
- "semantic": "({api, isA, context, toArray}) => {\n const root = (id) => {\n return id.split('_')[0]\n }\n const unit = root(context.element.marker)\n const scope = context.element.quantity.quantity\n let color;\n const styles = []\n const update = { unit, scope }\n for (const state of toArray(context.state)) {\n if (isA(state, 'style_wp')) {\n if (!update.styles) {\n update.styles = []\n }\n let style = root(state.value)\n if (style == 'underlined') {\n style = 'underline'\n }\n update.styles.push(root(state.value))\n } else {\n update.color = root(state.value)\n }\n }\n api.changeState(update)\n }"
30
+ "semantic": "({api, isA, context, toArray}) => {\n const unit = root(context.element.marker)\n const scope = context.element.quantity.quantity\n const update = { unit, scope }\n setUpdate(isA, update, toArray(context.state))\n api.changeState(update)\n }"
27
31
  },
28
32
  {
29
33
  "id": "stateValue_wp",
@@ -33,6 +37,16 @@
33
37
  ]
34
38
  }
35
39
  ],
40
+ "semantics": [
41
+ {
42
+ "match": "({context, isA}) => isA(context, 'style_wp') && !context.same && !context.isResponse && !context.evaluate",
43
+ "apply": "({context, api, isA, toArray}) => {\n const update = { scope: 'selection' }\n setUpdate(isA, update, toArray(context))\n api.changeState(update)\n }"
44
+ },
45
+ {
46
+ "match": "({context, isA}) => isA(context, 'statefulElement_wp') && !context.same && !context.isResponse && !context.evaluate",
47
+ "apply": "({context, api, isA, toArray}) => {\n const unit = root(context.marker)\n let scope\n if (context.quantity) {\n scope = context.quantity.quantity\n }\n // TODO set default scope for \"every word bold underlined etc\"\n }"
48
+ }
49
+ ],
36
50
  "priorities": [
37
51
  {
38
52
  "context": [
@@ -1390,6 +1404,11 @@
1390
1404
  "theAble",
1391
1405
  false
1392
1406
  ],
1407
+ [
1408
+ "negatable",
1409
+ "queryable",
1410
+ false
1411
+ ],
1393
1412
  [
1394
1413
  "noun",
1395
1414
  "theAble",
@@ -2244,8 +2263,7 @@
2244
2263
  "level": 1,
2245
2264
  "topLevel": true,
2246
2265
  "touchedBy": [
2247
- "wp#call2",
2248
- "instance0#wp#call2"
2266
+ "wp#call2"
2249
2267
  ]
2250
2268
  }
2251
2269
  ],
@@ -3620,6 +3638,11 @@
3620
3638
  "theAble",
3621
3639
  false
3622
3640
  ],
3641
+ [
3642
+ "negatable",
3643
+ "queryable",
3644
+ false
3645
+ ],
3623
3646
  [
3624
3647
  "noun",
3625
3648
  "theAble",
@@ -4621,8 +4644,7 @@
4621
4644
  "level": 2,
4622
4645
  "topLevel": true,
4623
4646
  "touchedBy": [
4624
- "wp#call2",
4625
- "instance0#wp#call2"
4647
+ "wp#call2"
4626
4648
  ]
4627
4649
  }
4628
4650
  ],
@@ -6063,6 +6085,11 @@
6063
6085
  "theAble",
6064
6086
  false
6065
6087
  ],
6088
+ [
6089
+ "negatable",
6090
+ "queryable",
6091
+ false
6092
+ ],
6066
6093
  [
6067
6094
  "noun",
6068
6095
  "theAble",
@@ -7051,8 +7078,7 @@
7051
7078
  "level": 2,
7052
7079
  "topLevel": true,
7053
7080
  "touchedBy": [
7054
- "wp#call2",
7055
- "instance0#wp#call2"
7081
+ "wp#call2"
7056
7082
  ]
7057
7083
  }
7058
7084
  ],
@@ -8485,6 +8511,11 @@
8485
8511
  "theAble",
8486
8512
  false
8487
8513
  ],
8514
+ [
8515
+ "negatable",
8516
+ "queryable",
8517
+ false
8518
+ ],
8488
8519
  [
8489
8520
  "noun",
8490
8521
  "theAble",
@@ -9473,8 +9504,7 @@
9473
9504
  "level": 2,
9474
9505
  "topLevel": true,
9475
9506
  "touchedBy": [
9476
- "wp#call2",
9477
- "instance0#wp#call2"
9507
+ "wp#call2"
9478
9508
  ]
9479
9509
  }
9480
9510
  ],
@@ -10907,6 +10937,11 @@
10907
10937
  "theAble",
10908
10938
  false
10909
10939
  ],
10940
+ [
10941
+ "negatable",
10942
+ "queryable",
10943
+ false
10944
+ ],
10910
10945
  [
10911
10946
  "noun",
10912
10947
  "theAble",
@@ -13886,6 +13921,11 @@
13886
13921
  "theAble",
13887
13922
  false
13888
13923
  ],
13924
+ [
13925
+ "negatable",
13926
+ "queryable",
13927
+ false
13928
+ ],
13889
13929
  [
13890
13930
  "noun",
13891
13931
  "theAble",
@@ -14943,7 +14983,11 @@
14943
14983
  "localHierarchy": [
14944
14984
  [
14945
14985
  "thisitthat",
14946
- "statefulElement"
14986
+ "statefulElement_wp"
14987
+ ],
14988
+ [
14989
+ "everything",
14990
+ "statefulElement_wp"
14947
14991
  ]
14948
14992
  ]
14949
14993
  },
@@ -14955,6 +14999,14 @@
14955
14999
  ]
14956
15000
  }
14957
15001
  ],
15002
+ "semantics": [
15003
+ {
15004
+ "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:111"
15005
+ },
15006
+ {
15007
+ "where": "/home/dev/code/theprogrammablemind/kms/common/wp.js:120"
15008
+ }
15009
+ ],
14958
15010
  "priorities": [
14959
15011
  {
14960
15012
  "context": [
package/common/wp.js CHANGED
@@ -18,6 +18,16 @@ const instance = require('./wp.instance.json')
18
18
 
19
19
 
20
20
  make every word bold and underlines and blue -> weirdly "bold underlined and blue" works
21
+
22
+ make the font ...
23
+ make the color blue
24
+ make the color of the first paragraph blue
25
+
26
+ 4 letter word
27
+ 4 to 6 letter word
28
+ word with 'a' in it
29
+ words containing a
30
+ every 5th word
21
31
  */
22
32
 
23
33
  class API {
@@ -67,6 +77,7 @@ template = {
67
77
  'characters are countable',
68
78
  'paragraphs are countable',
69
79
  'bold, italic, code and underlined are styles',
80
+ // 'styles are negatable',
70
81
  "resetIdSuffix",
71
82
  {
72
83
  operators: [
@@ -79,11 +90,17 @@ template = {
79
90
  parents: ['verb'],
80
91
  bridge: "{ ...next(operator), element: after[0], state: after[1], operator: operator, generate: ['operator', 'element', 'state'] }",
81
92
  localHierarchy: [
82
- ['thisitthat', 'statefulElement'],
93
+ ['thisitthat', 'statefulElement_wp'],
94
+ ['everything', 'statefulElement_wp'],
83
95
  ],
84
96
  semantic: ({api, isA, context, toArray}) => {
85
- const unit = root(context.element.marker)
86
- const scope = context.element.quantity.quantity
97
+ let unit = root(context.element.marker)
98
+ let scope
99
+ if (isA(context.element, 'everything')) {
100
+ scope = 'all'
101
+ } else {
102
+ scope = context.element.quantity.quantity
103
+ }
87
104
  const update = { unit, scope }
88
105
  setUpdate(isA, update, toArray(context.state))
89
106
  api.changeState(update)