@wildwinter/toolkit 0.2.3 → 0.2.5
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/CHANGELOG.md +21 -0
- package/README.md +14 -0
- package/conformance/extensions/defaults.json +1 -0
- package/conformance/extensions/manifest.json +314 -0
- package/conformance/extensions/values.json +527 -1
- package/dist/extensions.cjs +158 -2
- package/dist/extensions.cjs.map +1 -1
- package/dist/extensions.d.cts +54 -3
- package/dist/extensions.d.ts +54 -3
- package/dist/extensions.js +155 -3
- package/dist/extensions.js.map +1 -1
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +36 -1
- package/dist/index.js.map +1 -1
- package/extensions.md +28 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @wildwinter/toolkit
|
|
2
2
|
|
|
3
|
+
## 0.2.5
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **A `pick` value type** (`./extensions`): one choice from the sources a manifest names in `from`, in order:
|
|
8
|
+
fixed `words`, the nodes of a reference kind (`to`), and a list of text on the extension's own project node
|
|
9
|
+
(`list`). The value is text; empty is automatic. The manifest check holds each source to its shape and each
|
|
10
|
+
`list` to a list of text on the project target. `valueProblems` reports a value no source holds
|
|
11
|
+
(`not-a-choice`) and one two sources hold (`pick-ambiguous`, a warning), given the host's lists in the new
|
|
12
|
+
`ValueContext.list`. `pickChoices` lists the choices for an editor, `pickClashes` reports each name two sources
|
|
13
|
+
hold once for the project, and `pickLists` reads the lists off the project entry.
|
|
14
|
+
|
|
15
|
+
## 0.2.4
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **Find by field value**: `parseFieldQuery`, `fieldNameMatches`, `fieldValueMatches` and `fieldValueText`, so the
|
|
20
|
+
Field tabs in Storyletter's and Patterpad's Find windows read `mood = tense` by one rule. A value matches by its
|
|
21
|
+
field's type (text, enum and quality without case, flags by membership, numbers numerically, booleans by word),
|
|
22
|
+
`!=` negates, and a bare field name matches any value.
|
|
23
|
+
|
|
3
24
|
## 0.2.3
|
|
4
25
|
|
|
5
26
|
### Added
|
package/README.md
CHANGED
|
@@ -73,6 +73,20 @@ matcher, or `null` for an empty query. The query is **escaped**: somebody typing
|
|
|
73
73
|
`a.b` means those three characters, not "a, anything, b". Always global, so
|
|
74
74
|
every occurrence in a string is replaced rather than only the first.
|
|
75
75
|
|
|
76
|
+
Find by field value, the Field tab both families' Find windows have. Each app
|
|
77
|
+
walks its own project for the values; these say what a query means, so
|
|
78
|
+
`mood = tense` reads the same in both:
|
|
79
|
+
|
|
80
|
+
- `parseFieldQuery(query)`: `mood`, `mood = tense`, `mood != tense`,
|
|
81
|
+
`ext.field = "two words"`, or `null` when it is not a field name.
|
|
82
|
+
- `fieldNameMatches(name, query)`: names compare without case.
|
|
83
|
+
- `fieldValueMatches(type, value, query)`: by the field's type. Text, enum and
|
|
84
|
+
quality compare without case, flags match when the list includes the flag
|
|
85
|
+
(`= ""` is none set), numbers numerically, booleans as `true` or `false`.
|
|
86
|
+
`!=` is the opposite, and no operator matches any value. Pass the value that
|
|
87
|
+
holds, the default where the node sets none.
|
|
88
|
+
- `fieldValueText(type, value)`: the value as a row shows it.
|
|
89
|
+
|
|
76
90
|
## Archive
|
|
77
91
|
|
|
78
92
|
A separate, node-only entry point, because it imports `node:path`:
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
{ "name": "flags: none", "decl": { "name": "a", "type": "flags", "values": ["x"] }, "default": [] },
|
|
12
12
|
{ "name": "quality: the first stage", "decl": { "name": "a", "type": "quality", "stages": ["p", "q"] }, "default": "p" },
|
|
13
13
|
{ "name": "reference: none", "decl": { "name": "a", "type": "reference", "to": "card" }, "default": "" },
|
|
14
|
+
{ "name": "pick: automatic", "decl": { "name": "a", "type": "pick", "from": [{ "words": ["all"] }, { "to": "cast" }] }, "default": "" },
|
|
14
15
|
{ "name": "record: each field's default", "decl": { "name": "a", "type": "record", "fields": [
|
|
15
16
|
{ "name": "s", "type": "text" }, { "name": "n", "type": "number", "default": 2 }, { "name": "q", "type": "quality", "stages": ["p", "q"] }
|
|
16
17
|
] }, "default": { "n": 2, "q": "p", "s": "" } },
|
|
@@ -1124,6 +1124,320 @@
|
|
|
1124
1124
|
"code": "value-help"
|
|
1125
1125
|
}
|
|
1126
1126
|
]
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"name": "a pick over words, a node kind and a project list passes",
|
|
1130
|
+
"manifest": {
|
|
1131
|
+
"schema": "wildwinter/extension@0",
|
|
1132
|
+
"id": "probe",
|
|
1133
|
+
"name": "Probe",
|
|
1134
|
+
"version": "1.0.0",
|
|
1135
|
+
"targets": {
|
|
1136
|
+
"patter": {
|
|
1137
|
+
"line": {
|
|
1138
|
+
"fields": [
|
|
1139
|
+
{
|
|
1140
|
+
"name": "to",
|
|
1141
|
+
"type": "pick",
|
|
1142
|
+
"from": [
|
|
1143
|
+
{
|
|
1144
|
+
"words": [
|
|
1145
|
+
"all"
|
|
1146
|
+
]
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"to": "cast"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"list": "pointsOfInterest"
|
|
1153
|
+
}
|
|
1154
|
+
]
|
|
1155
|
+
}
|
|
1156
|
+
]
|
|
1157
|
+
},
|
|
1158
|
+
"project": {
|
|
1159
|
+
"fields": [
|
|
1160
|
+
{
|
|
1161
|
+
"name": "pointsOfInterest",
|
|
1162
|
+
"type": "list",
|
|
1163
|
+
"of": {
|
|
1164
|
+
"type": "text"
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
]
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
"problems": []
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
"name": "a pick inside a record passes, its list checked",
|
|
1176
|
+
"manifest": {
|
|
1177
|
+
"schema": "wildwinter/extension@0",
|
|
1178
|
+
"id": "probe",
|
|
1179
|
+
"name": "Probe",
|
|
1180
|
+
"version": "1.0.0",
|
|
1181
|
+
"targets": {
|
|
1182
|
+
"patter": {
|
|
1183
|
+
"line": {
|
|
1184
|
+
"fields": [
|
|
1185
|
+
{
|
|
1186
|
+
"name": "look",
|
|
1187
|
+
"type": "record",
|
|
1188
|
+
"fields": [
|
|
1189
|
+
{
|
|
1190
|
+
"name": "at",
|
|
1191
|
+
"type": "pick",
|
|
1192
|
+
"from": [
|
|
1193
|
+
{
|
|
1194
|
+
"list": "pointsOfInterest"
|
|
1195
|
+
}
|
|
1196
|
+
]
|
|
1197
|
+
}
|
|
1198
|
+
]
|
|
1199
|
+
}
|
|
1200
|
+
]
|
|
1201
|
+
},
|
|
1202
|
+
"project": {
|
|
1203
|
+
"fields": [
|
|
1204
|
+
{
|
|
1205
|
+
"name": "pointsOfInterest",
|
|
1206
|
+
"type": "list",
|
|
1207
|
+
"of": {
|
|
1208
|
+
"type": "text"
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
]
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
"problems": []
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"name": "a pick with no sources",
|
|
1220
|
+
"manifest": {
|
|
1221
|
+
"schema": "wildwinter/extension@0",
|
|
1222
|
+
"id": "probe",
|
|
1223
|
+
"name": "Probe",
|
|
1224
|
+
"version": "1.0.0",
|
|
1225
|
+
"targets": {
|
|
1226
|
+
"patter": {
|
|
1227
|
+
"line": {
|
|
1228
|
+
"fields": [
|
|
1229
|
+
{
|
|
1230
|
+
"name": "to",
|
|
1231
|
+
"type": "pick"
|
|
1232
|
+
}
|
|
1233
|
+
]
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
"problems": [
|
|
1239
|
+
{
|
|
1240
|
+
"path": "targets.patter.line.fields[0].from",
|
|
1241
|
+
"code": "pick-from"
|
|
1242
|
+
}
|
|
1243
|
+
]
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"name": "a pick source is one of words, to and list",
|
|
1247
|
+
"manifest": {
|
|
1248
|
+
"schema": "wildwinter/extension@0",
|
|
1249
|
+
"id": "probe",
|
|
1250
|
+
"name": "Probe",
|
|
1251
|
+
"version": "1.0.0",
|
|
1252
|
+
"targets": {
|
|
1253
|
+
"patter": {
|
|
1254
|
+
"line": {
|
|
1255
|
+
"fields": [
|
|
1256
|
+
{
|
|
1257
|
+
"name": "to",
|
|
1258
|
+
"type": "pick",
|
|
1259
|
+
"from": [
|
|
1260
|
+
{
|
|
1261
|
+
"words": [
|
|
1262
|
+
"all"
|
|
1263
|
+
],
|
|
1264
|
+
"to": "cast"
|
|
1265
|
+
},
|
|
1266
|
+
{}
|
|
1267
|
+
]
|
|
1268
|
+
}
|
|
1269
|
+
]
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
1274
|
+
"problems": [
|
|
1275
|
+
{
|
|
1276
|
+
"path": "targets.patter.line.fields[0].from[0]",
|
|
1277
|
+
"code": "pick-source"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"path": "targets.patter.line.fields[0].from[1]",
|
|
1281
|
+
"code": "pick-source"
|
|
1282
|
+
}
|
|
1283
|
+
]
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
"name": "a pick's nodes are of a kind the host references",
|
|
1287
|
+
"manifest": {
|
|
1288
|
+
"schema": "wildwinter/extension@0",
|
|
1289
|
+
"id": "probe",
|
|
1290
|
+
"name": "Probe",
|
|
1291
|
+
"version": "1.0.0",
|
|
1292
|
+
"targets": {
|
|
1293
|
+
"patter": {
|
|
1294
|
+
"line": {
|
|
1295
|
+
"fields": [
|
|
1296
|
+
{
|
|
1297
|
+
"name": "to",
|
|
1298
|
+
"type": "pick",
|
|
1299
|
+
"from": [
|
|
1300
|
+
{
|
|
1301
|
+
"to": "card"
|
|
1302
|
+
}
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
]
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
"problems": [
|
|
1311
|
+
{
|
|
1312
|
+
"path": "targets.patter.line.fields[0].from[0].to",
|
|
1313
|
+
"code": "reference-to"
|
|
1314
|
+
}
|
|
1315
|
+
]
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"name": "a pick's words are named, once each",
|
|
1319
|
+
"manifest": {
|
|
1320
|
+
"schema": "wildwinter/extension@0",
|
|
1321
|
+
"id": "probe",
|
|
1322
|
+
"name": "Probe",
|
|
1323
|
+
"version": "1.0.0",
|
|
1324
|
+
"targets": {
|
|
1325
|
+
"patter": {
|
|
1326
|
+
"line": {
|
|
1327
|
+
"fields": [
|
|
1328
|
+
{
|
|
1329
|
+
"name": "to",
|
|
1330
|
+
"type": "pick",
|
|
1331
|
+
"from": [
|
|
1332
|
+
{
|
|
1333
|
+
"words": [
|
|
1334
|
+
"all",
|
|
1335
|
+
"",
|
|
1336
|
+
"all"
|
|
1337
|
+
]
|
|
1338
|
+
}
|
|
1339
|
+
]
|
|
1340
|
+
}
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
"problems": [
|
|
1347
|
+
{
|
|
1348
|
+
"path": "targets.patter.line.fields[0].from[0].words[1]",
|
|
1349
|
+
"code": "value-empty"
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"path": "targets.patter.line.fields[0].from[0].words[2]",
|
|
1353
|
+
"code": "value-duplicate"
|
|
1354
|
+
}
|
|
1355
|
+
]
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"name": "a pick's list is a list of text on the project node",
|
|
1359
|
+
"manifest": {
|
|
1360
|
+
"schema": "wildwinter/extension@0",
|
|
1361
|
+
"id": "probe",
|
|
1362
|
+
"name": "Probe",
|
|
1363
|
+
"version": "1.0.0",
|
|
1364
|
+
"targets": {
|
|
1365
|
+
"patter": {
|
|
1366
|
+
"line": {
|
|
1367
|
+
"fields": [
|
|
1368
|
+
{
|
|
1369
|
+
"name": "to",
|
|
1370
|
+
"type": "pick",
|
|
1371
|
+
"from": [
|
|
1372
|
+
{
|
|
1373
|
+
"list": "pointsOfInterest"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"list": "moods"
|
|
1377
|
+
}
|
|
1378
|
+
]
|
|
1379
|
+
}
|
|
1380
|
+
]
|
|
1381
|
+
},
|
|
1382
|
+
"project": {
|
|
1383
|
+
"fields": [
|
|
1384
|
+
{
|
|
1385
|
+
"name": "moods",
|
|
1386
|
+
"type": "list",
|
|
1387
|
+
"of": {
|
|
1388
|
+
"type": "number"
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
]
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
"problems": [
|
|
1397
|
+
{
|
|
1398
|
+
"path": "targets.patter.line.fields[0].from[0].list",
|
|
1399
|
+
"code": "pick-list"
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"path": "targets.patter.line.fields[0].from[1].list",
|
|
1403
|
+
"code": "pick-list"
|
|
1404
|
+
}
|
|
1405
|
+
]
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"name": "a pick's default must be a choice when its words are all it has",
|
|
1409
|
+
"manifest": {
|
|
1410
|
+
"schema": "wildwinter/extension@0",
|
|
1411
|
+
"id": "probe",
|
|
1412
|
+
"name": "Probe",
|
|
1413
|
+
"version": "1.0.0",
|
|
1414
|
+
"targets": {
|
|
1415
|
+
"patter": {
|
|
1416
|
+
"line": {
|
|
1417
|
+
"fields": [
|
|
1418
|
+
{
|
|
1419
|
+
"name": "favour",
|
|
1420
|
+
"type": "pick",
|
|
1421
|
+
"from": [
|
|
1422
|
+
{
|
|
1423
|
+
"words": [
|
|
1424
|
+
"speaker"
|
|
1425
|
+
]
|
|
1426
|
+
}
|
|
1427
|
+
],
|
|
1428
|
+
"default": "crowd"
|
|
1429
|
+
}
|
|
1430
|
+
]
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
"problems": [
|
|
1436
|
+
{
|
|
1437
|
+
"path": "targets.patter.line.fields[0].default",
|
|
1438
|
+
"code": "default-misfit"
|
|
1439
|
+
}
|
|
1440
|
+
]
|
|
1127
1441
|
}
|
|
1128
1442
|
]
|
|
1129
1443
|
}
|