@graview/core 0.1.47 → 0.1.49

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.
Files changed (143) hide show
  1. package/dist/blocks.d.ts +1 -1
  2. package/dist/blocks.d.ts.map +1 -1
  3. package/dist/blocks.js +1 -1
  4. package/dist/blocks.js.map +1 -1
  5. package/dist/capital.d.ts +7 -0
  6. package/dist/capital.d.ts.map +1 -1
  7. package/dist/capital.js +7 -0
  8. package/dist/capital.js.map +1 -1
  9. package/dist/cli/check/forms.js +2 -2
  10. package/dist/cli/check/forms.js.map +1 -1
  11. package/dist/cli/check/policy.d.ts.map +1 -1
  12. package/dist/cli/check/policy.js +9 -1
  13. package/dist/cli/check/policy.js.map +1 -1
  14. package/dist/cli/check/relations.d.ts.map +1 -1
  15. package/dist/cli/check/relations.js +4 -1
  16. package/dist/cli/check/relations.js.map +1 -1
  17. package/dist/cli/describe.js +1 -1
  18. package/dist/cli/describe.js.map +1 -1
  19. package/dist/cli/docs.d.ts.map +1 -1
  20. package/dist/cli/docs.js +2 -1
  21. package/dist/cli/docs.js.map +1 -1
  22. package/dist/describe.d.ts +1 -1
  23. package/dist/describe.d.ts.map +1 -1
  24. package/dist/document/act-spellings.d.ts +12 -0
  25. package/dist/document/act-spellings.d.ts.map +1 -0
  26. package/dist/document/act-spellings.js +56 -0
  27. package/dist/document/act-spellings.js.map +1 -0
  28. package/dist/document/blocks.d.ts +9 -0
  29. package/dist/document/blocks.d.ts.map +1 -1
  30. package/dist/document/blocks.js +34 -4
  31. package/dist/document/blocks.js.map +1 -1
  32. package/dist/document/compile.d.ts.map +1 -1
  33. package/dist/document/compile.js +16 -4
  34. package/dist/document/compile.js.map +1 -1
  35. package/dist/document/describe-forms.d.ts +15 -0
  36. package/dist/document/describe-forms.d.ts.map +1 -0
  37. package/dist/document/describe-forms.js +79 -0
  38. package/dist/document/describe-forms.js.map +1 -0
  39. package/dist/document/describe-place.d.ts.map +1 -1
  40. package/dist/document/describe-place.js +40 -5
  41. package/dist/document/describe-place.js.map +1 -1
  42. package/dist/document/described.d.ts +39 -1
  43. package/dist/document/described.d.ts.map +1 -1
  44. package/dist/document/diff.js +2 -2
  45. package/dist/document/diff.js.map +1 -1
  46. package/dist/document/edit.d.ts.map +1 -1
  47. package/dist/document/edit.js +21 -2
  48. package/dist/document/edit.js.map +1 -1
  49. package/dist/document/page-fields.d.ts +10 -0
  50. package/dist/document/page-fields.d.ts.map +1 -1
  51. package/dist/document/page-fields.js +19 -0
  52. package/dist/document/page-fields.js.map +1 -1
  53. package/dist/document/policy-words.d.ts.map +1 -1
  54. package/dist/document/policy-words.js +10 -4
  55. package/dist/document/policy-words.js.map +1 -1
  56. package/dist/document/rule-line.d.ts.map +1 -1
  57. package/dist/document/rule-line.js +2 -1
  58. package/dist/document/rule-line.js.map +1 -1
  59. package/dist/document/template.d.ts +11 -0
  60. package/dist/document/template.d.ts.map +1 -1
  61. package/dist/document/template.js +18 -0
  62. package/dist/document/template.js.map +1 -1
  63. package/dist/document.schema.json +2 -2
  64. package/dist/forms.d.ts +1 -1
  65. package/dist/forms.d.ts.map +1 -1
  66. package/dist/forms.js +1 -1
  67. package/dist/forms.js.map +1 -1
  68. package/dist/index.d.ts +4 -2
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +5 -2
  71. package/dist/index.js.map +1 -1
  72. package/dist/intelligence-bridge.d.ts +11 -2
  73. package/dist/intelligence-bridge.d.ts.map +1 -1
  74. package/dist/mutations/act-spelling.d.ts +23 -0
  75. package/dist/mutations/act-spelling.d.ts.map +1 -0
  76. package/dist/mutations/act-spelling.js +68 -0
  77. package/dist/mutations/act-spelling.js.map +1 -0
  78. package/dist/mutations/asked-order.d.ts +54 -0
  79. package/dist/mutations/asked-order.d.ts.map +1 -0
  80. package/dist/mutations/asked-order.js +78 -0
  81. package/dist/mutations/asked-order.js.map +1 -0
  82. package/dist/mutations/define-mutation.d.ts +9 -0
  83. package/dist/mutations/define-mutation.d.ts.map +1 -1
  84. package/dist/mutations/define-mutation.js +51 -5
  85. package/dist/mutations/define-mutation.js.map +1 -1
  86. package/dist/mutations/derive-edits.d.ts.map +1 -1
  87. package/dist/mutations/derive-edits.js +9 -2
  88. package/dist/mutations/derive-edits.js.map +1 -1
  89. package/dist/mutations/derive-relations.d.ts.map +1 -1
  90. package/dist/mutations/derive-relations.js +10 -2
  91. package/dist/mutations/derive-relations.js.map +1 -1
  92. package/dist/mutations/derived-names.d.ts +17 -0
  93. package/dist/mutations/derived-names.d.ts.map +1 -1
  94. package/dist/mutations/derived-names.js +17 -0
  95. package/dist/mutations/derived-names.js.map +1 -1
  96. package/dist/mutations/form.d.ts +7 -0
  97. package/dist/mutations/form.d.ts.map +1 -1
  98. package/dist/mutations/form.js +9 -0
  99. package/dist/mutations/form.js.map +1 -1
  100. package/dist/mutations/types.d.ts +7 -0
  101. package/dist/mutations/types.d.ts.map +1 -1
  102. package/dist/mutations/visitor-form.d.ts.map +1 -1
  103. package/dist/mutations/visitor-form.js +3 -3
  104. package/dist/mutations/visitor-form.js.map +1 -1
  105. package/dist/mutations/words.d.ts.map +1 -1
  106. package/dist/mutations/words.js +2 -1
  107. package/dist/mutations/words.js.map +1 -1
  108. package/dist/ops/lineage.d.ts +37 -5
  109. package/dist/ops/lineage.d.ts.map +1 -1
  110. package/dist/ops/lineage.js +47 -16
  111. package/dist/ops/lineage.js.map +1 -1
  112. package/dist/ops/suggestions.d.ts +36 -4
  113. package/dist/ops/suggestions.d.ts.map +1 -1
  114. package/dist/ops/suggestions.js +13 -7
  115. package/dist/ops/suggestions.js.map +1 -1
  116. package/dist/ops/tidying.d.ts +33 -4
  117. package/dist/ops/tidying.d.ts.map +1 -1
  118. package/dist/ops/tidying.js +50 -9
  119. package/dist/ops/tidying.js.map +1 -1
  120. package/dist/ops/types.d.ts +8 -0
  121. package/dist/ops/types.d.ts.map +1 -1
  122. package/dist/schema/define-node.d.ts.map +1 -1
  123. package/dist/schema/define-node.js +8 -1
  124. package/dist/schema/define-node.js.map +1 -1
  125. package/dist/schema/json-schema.d.ts +1 -1
  126. package/dist/schema/json-schema.d.ts.map +1 -1
  127. package/dist/schema/json-schema.js +11 -1
  128. package/dist/schema/json-schema.js.map +1 -1
  129. package/dist/store.d.ts +11 -0
  130. package/dist/store.d.ts.map +1 -1
  131. package/dist/store.js +31 -4
  132. package/dist/store.js.map +1 -1
  133. package/dist/tidying.d.ts +25 -7
  134. package/dist/tidying.d.ts.map +1 -1
  135. package/dist/tidying.js +26 -11
  136. package/dist/tidying.js.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/dist/words.d.ts +1 -0
  140. package/dist/words.d.ts.map +1 -1
  141. package/dist/words.js +1 -0
  142. package/dist/words.js.map +1 -1
  143. package/package.json +1 -1
@@ -1048,7 +1048,7 @@ class Editor {
1048
1048
  // A title is an address: one lens a title on a kind.
1049
1049
  const clash = lenses.findIndex((other, index) => index !== at && isObject(other) && typeof other["title"] === "string" && placeSlug(other["title"]) === placeSlug(e.title) && (e.on === undefined || other["on"] === undefined || other["on"] === e.on));
1050
1050
  if (clash >= 0)
1051
- return this.fail(i, "title", `there is already a lens called "${String(lenses[clash]["title"])}"`, 'give it its own title, or say "replace" with the title of the lens it takes the place of');
1051
+ return this.titleTaken(i, lenses[clash]);
1052
1052
  // An option the lens does not take would apply and do nothing: refused in the checker's own words (FR-190).
1053
1053
  const stray = isObject(e.options) ? Object.keys(e.options).find((key) => !SHIPPED_LENSES[name].options.includes(key)) : undefined;
1054
1054
  if (stray !== undefined) {
@@ -1084,7 +1084,26 @@ class Editor {
1084
1084
  this.doc.pages.first = e.title;
1085
1085
  follows = "; the app still opens on it";
1086
1086
  }
1087
- this.said.push(retitled ? `The lens "${String(was["title"])}" is now "${e.title}"${where}${follows}.` : `The lens "${e.title}" changes${where}.`);
1087
+ // Drawn in the place of one kept off the lists, it is kept off them too: said, so a lens meant to be seen is shown.
1088
+ const stays = lens.hidden === true ? `; it stays off the bar and the page list, as "${String(was["title"])}" was, until set-lens-hidden with "hidden": false shows it` : "";
1089
+ this.said.push(retitled ? `The lens "${String(was["title"])}" is now "${e.title}"${where}${follows}${stays}.` : `The lens "${e.title}" changes${where}${stays}.`);
1090
+ }
1091
+ /**
1092
+ * A TITLE ANOTHER LENS HOLDS. A title is an address, so add-lens refuses
1093
+ * it — and says which lens holds it (what draws it, over what, and
1094
+ * whether it is kept off the lists, where a reader of the page never
1095
+ * sees it), and the one way to take it: "replace" with that title. An
1096
+ * app made with lenses it never asked for, hidden afterwards, met a bare
1097
+ * "there is already a lens called…" for a title it could not find.
1098
+ * Hiding a lens does not free its title: it is still a place at its
1099
+ * address.
1100
+ */
1101
+ titleTaken(i, held) {
1102
+ const title = String(held["title"]);
1103
+ const over = typeof held["on"] === "string" ? held["on"] : kindsBound(held)[0];
1104
+ const what = `the ${typeof held["name"] === "string" ? held["name"] : "blocks"} lens${over ? ` over ${pluralWords(this.doc, over)}` : ""}`;
1105
+ const hidden = held["hidden"] === true;
1106
+ this.fail(i, "title", `there is already a lens called "${title}" — ${what}${hidden ? ", kept off the bar and the page list (set-lens-hidden), which still holds its title and its address" : ""}`, `to draw this one in its place, say "replace": "${title}"${hidden ? ' (it stays off the lists, as that one is, until set-lens-hidden with "hidden": false shows it)' : ""}; or give this one a title of its own`);
1088
1107
  }
1089
1108
  /**
1090
1109
  * A STATUS BOARD'S BINDINGS (FR-97), held before it is added: each kind it