@gmb/bitmark-parser 7.2.0 → 7.4.0

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 (47) hide show
  1. package/README.md +163 -23
  2. package/config/bitmark-json.tsp +439 -0
  3. package/config/bitmark.json +85074 -0
  4. package/dist/browser/bitmark-parser.min.js +6 -4
  5. package/dist/browser/bitmark-parser.min.js.map +1 -1
  6. package/dist/browser/cjs/index.cjs +140 -72
  7. package/dist/browser/cjs/index.cjs.map +1 -1
  8. package/dist/browser/cjs/index.d.cts +6299 -6806
  9. package/dist/browser/esm/index.d.ts +6299 -6806
  10. package/dist/browser/esm/index.js +139 -72
  11. package/dist/browser/esm/index.js.map +1 -1
  12. package/dist/browser/esm/worker-entry.js +86 -57
  13. package/dist/browser/esm/worker-entry.js.map +1 -1
  14. package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
  15. package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
  16. package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
  17. package/dist/index.cjs +76 -29
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6299 -6806
  20. package/dist/index.d.ts +6299 -6806
  21. package/dist/index.js +75 -29
  22. package/dist/index.js.map +1 -1
  23. package/dist/legacy.cjs +4 -3
  24. package/dist/legacy.cjs.map +1 -1
  25. package/dist/legacy.d.cts +9 -1
  26. package/dist/legacy.d.ts +9 -1
  27. package/dist/legacy.js +4 -3
  28. package/dist/legacy.js.map +1 -1
  29. package/dist/worker-entry.cjs +23 -15
  30. package/dist/worker-entry.cjs.map +1 -1
  31. package/package.json +11 -7
  32. package/schema/bitmark.schema.json +10459 -14050
  33. package/wasm/bitmark_wasm.d.ts +12 -3
  34. package/wasm/bitmark_wasm.js +34 -15
  35. package/wasm/bitmark_wasm_bg.wasm +0 -0
  36. package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -2
  37. package/wasm/package.json +1 -1
  38. package/wasm-bitmark-json/bitmark_json_wasm.d.ts +12 -3
  39. package/wasm-bitmark-json/bitmark_json_wasm.js +34 -15
  40. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
  41. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +2 -2
  42. package/wasm-bitmark-json/package.json +1 -1
  43. package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +12 -3
  44. package/wasm-browser-full/bitmark_browser_full_wasm.js +34 -15
  45. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
  46. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +2 -2
  47. package/wasm-browser-full/package.json +1 -1
@@ -5,15 +5,21 @@
5
5
  *
6
6
  * `format`: `"bitmark++"` (default) or `"plainText"`
7
7
  * `location`: `"body"` (default) or `"tag"`
8
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
9
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
10
+ * skips the running-text rules (PLAN-211)
8
11
  */
9
- export function breakscape_text(input: string, format: string, location: string): string;
12
+ export function breakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
10
13
  /**
11
14
  * Unbreakscape text (unescape bitmark special characters).
12
15
  *
13
16
  * `format`: `"bitmark++"` (default) or `"plainText"`
14
17
  * `location`: `"body"` (default) or `"tag"`
18
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
19
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
20
+ * (PLAN-211 D5a)
15
21
  */
16
- export function unbreakscape_text(input: string, format: string, location: string): string;
22
+ export function unbreakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
17
23
  /**
18
24
  * Query information about supported bit types.
19
25
  *
@@ -60,7 +66,10 @@ export function convert_text(input: string, direction: string, format: string, l
60
66
  * pipeline refuses them and that refusal is what throws.
61
67
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
62
68
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
63
- * runs sequentially. Returns the document text/JSON; throws on failure.
69
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
70
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
71
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
72
+ * e.g. `patch-index-out-of-range`); throws on failure.
64
73
  */
65
74
  export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
66
75
  /**
@@ -93,6 +93,10 @@ function passStringToWasm0(arg, malloc, realloc) {
93
93
  return ptr;
94
94
  }
95
95
 
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
96
100
  let cachedDataViewMemory0 = null;
97
101
 
98
102
  function getDataViewMemory0() {
@@ -106,14 +110,18 @@ function getDataViewMemory0() {
106
110
  *
107
111
  * `format`: `"bitmark++"` (default) or `"plainText"`
108
112
  * `location`: `"body"` (default) or `"tag"`
113
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
114
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
115
+ * skips the running-text rules (PLAN-211)
109
116
  * @param {string} input
110
117
  * @param {string} format
111
118
  * @param {string} location
119
+ * @param {string | null} [sub_location]
112
120
  * @returns {string}
113
121
  */
114
- module.exports.breakscape_text = function(input, format, location) {
115
- let deferred4_0;
116
- let deferred4_1;
122
+ module.exports.breakscape_text = function(input, format, location, sub_location) {
123
+ let deferred5_0;
124
+ let deferred5_1;
117
125
  try {
118
126
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
127
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -122,15 +130,17 @@ module.exports.breakscape_text = function(input, format, location) {
122
130
  const len1 = WASM_VECTOR_LEN;
123
131
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
124
132
  const len2 = WASM_VECTOR_LEN;
125
- wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
133
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
134
+ var len3 = WASM_VECTOR_LEN;
135
+ wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
126
136
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
127
137
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
128
- deferred4_0 = r0;
129
- deferred4_1 = r1;
138
+ deferred5_0 = r0;
139
+ deferred5_1 = r1;
130
140
  return getStringFromWasm0(r0, r1);
131
141
  } finally {
132
142
  wasm.__wbindgen_add_to_stack_pointer(16);
133
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
143
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
134
144
  }
135
145
  };
136
146
 
@@ -139,14 +149,18 @@ module.exports.breakscape_text = function(input, format, location) {
139
149
  *
140
150
  * `format`: `"bitmark++"` (default) or `"plainText"`
141
151
  * `location`: `"body"` (default) or `"tag"`
152
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
153
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
154
+ * (PLAN-211 D5a)
142
155
  * @param {string} input
143
156
  * @param {string} format
144
157
  * @param {string} location
158
+ * @param {string | null} [sub_location]
145
159
  * @returns {string}
146
160
  */
147
- module.exports.unbreakscape_text = function(input, format, location) {
148
- let deferred4_0;
149
- let deferred4_1;
161
+ module.exports.unbreakscape_text = function(input, format, location, sub_location) {
162
+ let deferred5_0;
163
+ let deferred5_1;
150
164
  try {
151
165
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
166
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -155,15 +169,17 @@ module.exports.unbreakscape_text = function(input, format, location) {
155
169
  const len1 = WASM_VECTOR_LEN;
156
170
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
157
171
  const len2 = WASM_VECTOR_LEN;
158
- wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
172
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
173
+ var len3 = WASM_VECTOR_LEN;
174
+ wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
159
175
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
160
176
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
161
- deferred4_0 = r0;
162
- deferred4_1 = r1;
177
+ deferred5_0 = r0;
178
+ deferred5_1 = r1;
163
179
  return getStringFromWasm0(r0, r1);
164
180
  } finally {
165
181
  wasm.__wbindgen_add_to_stack_pointer(16);
166
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
182
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
167
183
  }
168
184
  };
169
185
 
@@ -302,7 +318,10 @@ module.exports.convert_text = function(input, direction, format, location) {
302
318
  * pipeline refuses them and that refusal is what throws.
303
319
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
304
320
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
305
- * runs sequentially. Returns the document text/JSON; throws on failure.
321
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
322
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
323
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
324
+ * e.g. `patch-index-out-of-range`); throws on failure.
306
325
  * @param {string} input
307
326
  * @param {string} input_format_sel
308
327
  * @param {string} output_format_sel
Binary file
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
4
+ export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
5
5
  export const canonicalize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
6
6
  export const complete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
7
7
  export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => void;
@@ -19,7 +19,7 @@ export const resolve_patch_document: (a: number, b: number, c: number, d: number
19
19
  export const split_bits: (a: number, b: number, c: number) => void;
20
20
  export const split_json_bits: (a: number, b: number, c: number) => void;
21
21
  export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
22
- export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
22
+ export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
23
23
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
24
24
  export const __wbindgen_export_0: (a: number, b: number) => number;
25
25
  export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
package/wasm/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "7.2.0",
7
+ "version": "7.4.0",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",
@@ -5,15 +5,21 @@
5
5
  *
6
6
  * `format`: `"bitmark++"` (default) or `"plainText"`
7
7
  * `location`: `"body"` (default) or `"tag"`
8
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
9
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
10
+ * skips the running-text rules (PLAN-211)
8
11
  */
9
- export function breakscape_text(input: string, format: string, location: string): string;
12
+ export function breakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
10
13
  /**
11
14
  * Unbreakscape text (unescape bitmark special characters).
12
15
  *
13
16
  * `format`: `"bitmark++"` (default) or `"plainText"`
14
17
  * `location`: `"body"` (default) or `"tag"`
18
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
19
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
20
+ * (PLAN-211 D5a)
15
21
  */
16
- export function unbreakscape_text(input: string, format: string, location: string): string;
22
+ export function unbreakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
17
23
  /**
18
24
  * Query information about supported bit types.
19
25
  *
@@ -58,7 +64,10 @@ export function register(data_type: string, data: string): void;
58
64
  * pipeline refuses them and that refusal is what throws.
59
65
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
60
66
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
61
- * runs sequentially. Returns the document text/JSON; throws on failure.
67
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
68
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
69
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
70
+ * e.g. `patch-index-out-of-range`); throws on failure.
62
71
  */
63
72
  export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
64
73
  /**
@@ -93,6 +93,10 @@ function passStringToWasm0(arg, malloc, realloc) {
93
93
  return ptr;
94
94
  }
95
95
 
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
96
100
  let cachedDataViewMemory0 = null;
97
101
 
98
102
  function getDataViewMemory0() {
@@ -106,14 +110,18 @@ function getDataViewMemory0() {
106
110
  *
107
111
  * `format`: `"bitmark++"` (default) or `"plainText"`
108
112
  * `location`: `"body"` (default) or `"tag"`
113
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
114
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
115
+ * skips the running-text rules (PLAN-211)
109
116
  * @param {string} input
110
117
  * @param {string} format
111
118
  * @param {string} location
119
+ * @param {string | null} [sub_location]
112
120
  * @returns {string}
113
121
  */
114
- module.exports.breakscape_text = function(input, format, location) {
115
- let deferred4_0;
116
- let deferred4_1;
122
+ module.exports.breakscape_text = function(input, format, location, sub_location) {
123
+ let deferred5_0;
124
+ let deferred5_1;
117
125
  try {
118
126
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
127
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -122,15 +130,17 @@ module.exports.breakscape_text = function(input, format, location) {
122
130
  const len1 = WASM_VECTOR_LEN;
123
131
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
124
132
  const len2 = WASM_VECTOR_LEN;
125
- wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
133
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
134
+ var len3 = WASM_VECTOR_LEN;
135
+ wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
126
136
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
127
137
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
128
- deferred4_0 = r0;
129
- deferred4_1 = r1;
138
+ deferred5_0 = r0;
139
+ deferred5_1 = r1;
130
140
  return getStringFromWasm0(r0, r1);
131
141
  } finally {
132
142
  wasm.__wbindgen_add_to_stack_pointer(16);
133
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
143
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
134
144
  }
135
145
  };
136
146
 
@@ -139,14 +149,18 @@ module.exports.breakscape_text = function(input, format, location) {
139
149
  *
140
150
  * `format`: `"bitmark++"` (default) or `"plainText"`
141
151
  * `location`: `"body"` (default) or `"tag"`
152
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
153
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
154
+ * (PLAN-211 D5a)
142
155
  * @param {string} input
143
156
  * @param {string} format
144
157
  * @param {string} location
158
+ * @param {string | null} [sub_location]
145
159
  * @returns {string}
146
160
  */
147
- module.exports.unbreakscape_text = function(input, format, location) {
148
- let deferred4_0;
149
- let deferred4_1;
161
+ module.exports.unbreakscape_text = function(input, format, location, sub_location) {
162
+ let deferred5_0;
163
+ let deferred5_1;
150
164
  try {
151
165
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
166
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -155,15 +169,17 @@ module.exports.unbreakscape_text = function(input, format, location) {
155
169
  const len1 = WASM_VECTOR_LEN;
156
170
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
157
171
  const len2 = WASM_VECTOR_LEN;
158
- wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
172
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
173
+ var len3 = WASM_VECTOR_LEN;
174
+ wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
159
175
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
160
176
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
161
- deferred4_0 = r0;
162
- deferred4_1 = r1;
177
+ deferred5_0 = r0;
178
+ deferred5_1 = r1;
163
179
  return getStringFromWasm0(r0, r1);
164
180
  } finally {
165
181
  wasm.__wbindgen_add_to_stack_pointer(16);
166
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
182
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
167
183
  }
168
184
  };
169
185
 
@@ -277,7 +293,10 @@ module.exports.register = function(data_type, data) {
277
293
  * pipeline refuses them and that refusal is what throws.
278
294
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
279
295
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
280
- * runs sequentially. Returns the document text/JSON; throws on failure.
296
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
297
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
298
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
299
+ * e.g. `patch-index-out-of-range`); throws on failure.
281
300
  * @param {string} input
282
301
  * @param {string} input_format_sel
283
302
  * @param {string} output_format_sel
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
4
+ export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
5
5
  export const canonicalize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
6
6
  export const complete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
7
7
  export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => void;
@@ -17,7 +17,7 @@ export const resolve_patch_document: (a: number, b: number, c: number, d: number
17
17
  export const split_bits: (a: number, b: number, c: number) => void;
18
18
  export const split_json_bits: (a: number, b: number, c: number) => void;
19
19
  export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
20
- export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
20
+ export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
21
21
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
22
22
  export const __wbindgen_export_0: (a: number, b: number) => number;
23
23
  export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "7.2.0",
7
+ "version": "7.4.0",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",
@@ -5,15 +5,21 @@
5
5
  *
6
6
  * `format`: `"bitmark++"` (default) or `"plainText"`
7
7
  * `location`: `"body"` (default) or `"tag"`
8
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
9
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
10
+ * skips the running-text rules (PLAN-211)
8
11
  */
9
- export function breakscape_text(input: string, format: string, location: string): string;
12
+ export function breakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
10
13
  /**
11
14
  * Unbreakscape text (unescape bitmark special characters).
12
15
  *
13
16
  * `format`: `"bitmark++"` (default) or `"plainText"`
14
17
  * `location`: `"body"` (default) or `"tag"`
18
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
19
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
20
+ * (PLAN-211 D5a)
15
21
  */
16
- export function unbreakscape_text(input: string, format: string, location: string): string;
22
+ export function unbreakscape_text(input: string, format: string, location: string, sub_location?: string | null): string;
17
23
  /**
18
24
  * Query information about supported bit types.
19
25
  *
@@ -60,7 +66,10 @@ export function convert_text(input: string, direction: string, format: string, l
60
66
  * pipeline refuses them and that refusal is what throws.
61
67
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
62
68
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
63
- * runs sequentially. Returns the document text/JSON; throws on failure.
69
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
70
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
71
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
72
+ * e.g. `patch-index-out-of-range`); throws on failure.
64
73
  */
65
74
  export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
66
75
  /**
@@ -93,6 +93,10 @@ function passStringToWasm0(arg, malloc, realloc) {
93
93
  return ptr;
94
94
  }
95
95
 
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
96
100
  let cachedDataViewMemory0 = null;
97
101
 
98
102
  function getDataViewMemory0() {
@@ -106,14 +110,18 @@ function getDataViewMemory0() {
106
110
  *
107
111
  * `format`: `"bitmark++"` (default) or `"plainText"`
108
112
  * `location`: `"body"` (default) or `"tag"`
113
+ * `sub_location`: `"text"` (default) or `"attrValue"` — the value half of an
114
+ * inline-attr chain segment (`==t==|link:VALUE|`), which escapes `|` and
115
+ * skips the running-text rules (PLAN-211)
109
116
  * @param {string} input
110
117
  * @param {string} format
111
118
  * @param {string} location
119
+ * @param {string | null} [sub_location]
112
120
  * @returns {string}
113
121
  */
114
- module.exports.breakscape_text = function(input, format, location) {
115
- let deferred4_0;
116
- let deferred4_1;
122
+ module.exports.breakscape_text = function(input, format, location, sub_location) {
123
+ let deferred5_0;
124
+ let deferred5_1;
117
125
  try {
118
126
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
127
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -122,15 +130,17 @@ module.exports.breakscape_text = function(input, format, location) {
122
130
  const len1 = WASM_VECTOR_LEN;
123
131
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
124
132
  const len2 = WASM_VECTOR_LEN;
125
- wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
133
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
134
+ var len3 = WASM_VECTOR_LEN;
135
+ wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
126
136
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
127
137
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
128
- deferred4_0 = r0;
129
- deferred4_1 = r1;
138
+ deferred5_0 = r0;
139
+ deferred5_1 = r1;
130
140
  return getStringFromWasm0(r0, r1);
131
141
  } finally {
132
142
  wasm.__wbindgen_add_to_stack_pointer(16);
133
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
143
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
134
144
  }
135
145
  };
136
146
 
@@ -139,14 +149,18 @@ module.exports.breakscape_text = function(input, format, location) {
139
149
  *
140
150
  * `format`: `"bitmark++"` (default) or `"plainText"`
141
151
  * `location`: `"body"` (default) or `"tag"`
152
+ * `sub_location`: accepted and IGNORED — unbreakscape is sub-location
153
+ * independent for bitmarkText, so one inverse undoes every breakscape mode
154
+ * (PLAN-211 D5a)
142
155
  * @param {string} input
143
156
  * @param {string} format
144
157
  * @param {string} location
158
+ * @param {string | null} [sub_location]
145
159
  * @returns {string}
146
160
  */
147
- module.exports.unbreakscape_text = function(input, format, location) {
148
- let deferred4_0;
149
- let deferred4_1;
161
+ module.exports.unbreakscape_text = function(input, format, location, sub_location) {
162
+ let deferred5_0;
163
+ let deferred5_1;
150
164
  try {
151
165
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
166
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -155,15 +169,17 @@ module.exports.unbreakscape_text = function(input, format, location) {
155
169
  const len1 = WASM_VECTOR_LEN;
156
170
  const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
157
171
  const len2 = WASM_VECTOR_LEN;
158
- wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
172
+ var ptr3 = isLikeNone(sub_location) ? 0 : passStringToWasm0(sub_location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
173
+ var len3 = WASM_VECTOR_LEN;
174
+ wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
159
175
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
160
176
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
161
- deferred4_0 = r0;
162
- deferred4_1 = r1;
177
+ deferred5_0 = r0;
178
+ deferred5_1 = r1;
163
179
  return getStringFromWasm0(r0, r1);
164
180
  } finally {
165
181
  wasm.__wbindgen_add_to_stack_pointer(16);
166
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
182
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
167
183
  }
168
184
  };
169
185
 
@@ -302,7 +318,10 @@ module.exports.convert_text = function(input, direction, format, location) {
302
318
  * pipeline refuses them and that refusal is what throws.
303
319
  * `patch_json`: the patch entry array (empty string = no patches, i.e. a
304
320
  * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
305
- * runs sequentially. Returns the document text/JSON; throws on failure.
321
+ * runs sequentially. Returns `{ "data": <document text/JSON>, "diagnostics":
322
+ * [ { "path", "kind", "message" } ] }` — the diagnostics are the entries the
323
+ * pipeline skipped (PLAN-209 T9; `kind` is the error contract's identifier,
324
+ * e.g. `patch-index-out-of-range`); throws on failure.
306
325
  * @param {string} input
307
326
  * @param {string} input_format_sel
308
327
  * @param {string} output_format_sel
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
4
+ export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
5
5
  export const canonicalize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
6
6
  export const complete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
7
7
  export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => void;
@@ -19,7 +19,7 @@ export const resolve_patch_document: (a: number, b: number, c: number, d: number
19
19
  export const split_bits: (a: number, b: number, c: number) => void;
20
20
  export const split_json_bits: (a: number, b: number, c: number) => void;
21
21
  export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
22
- export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
22
+ export const unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
23
23
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
24
24
  export const __wbindgen_export_0: (a: number, b: number) => number;
25
25
  export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "7.2.0",
7
+ "version": "7.4.0",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",