basedpl 0.1.77 → 0.1.79

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/basedpl_wasm.js CHANGED
@@ -638,6 +638,10 @@ function __wbg_get_imports() {
638
638
  const ret = arg0.response;
639
639
  return ret;
640
640
  }, arguments); },
641
+ __wbg_search_9cf5002ecfca6094: function(arg0, arg1) {
642
+ const ret = arg0.search(arg1);
643
+ return ret;
644
+ },
641
645
  __wbg_send_3b3b20df5e2e7616: function() { return handleError(function (arg0, arg1, arg2) {
642
646
  arg0.send(arg1 === 0 ? undefined : getArrayU8FromWasm0(arg1, arg2));
643
647
  }, arguments); },
@@ -684,6 +688,10 @@ function __wbg_get_imports() {
684
688
  const ret = JSON.stringify(arg0);
685
689
  return ret;
686
690
  }, arguments); },
691
+ __wbg_substring_7a68fc10027938a4: function(arg0, arg1, arg2) {
692
+ const ret = arg0.substring(arg1 >>> 0, arg2 >>> 0);
693
+ return ret;
694
+ },
687
695
  __wbg_value_f3c585ee8f5ba40c: function(arg0) {
688
696
  const ret = arg0.value;
689
697
  return ret;
Binary file
package/bpl-editor.js CHANGED
@@ -90,7 +90,7 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
90
90
  }
91
91
 
92
92
  const host = d.createElement('div');
93
- host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"></div>
93
+ host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"><button type="button" class="ngn_x" style="float:right" title="Close symbol bar">×</button></div>
94
94
  <div class="bpl_choices" role="group" aria-label="BPL symbol completions" hidden></div>
95
95
  <style>
96
96
  .ngn_lb,.bpl_choices{background:var(--bpl-bar-background,#eee);color:var(--bpl-bar-color,#111);font:15px var(--bpl-font,SAX2B),monospace}
@@ -106,6 +106,7 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
106
106
  </style>`;
107
107
  container.append(host);
108
108
  const bar = host.querySelector('.ngn_lb'), tip = host.querySelector('.bpl_choices');
109
+ bar.querySelector('.ngn_x').onclick = () => { bar.hidden = true; };
109
110
  let active, lastEditor, choice, keyInput = false;
110
111
  const names = new Map(symbols.map(({glyph, name, monad, dyad}) =>
111
112
  [glyph, [name, monad, dyad].filter(Boolean).join(' ')]));
@@ -251,15 +252,14 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
251
252
  container.style.cssText = 'position:fixed;top:0;left:0;right:0;z-index:2147483647';
252
253
  d.body.append(container);
253
254
  const input = attach(monaco, container, true), bar = container.querySelector('.ngn_lb');
254
- bar.insertAdjacentHTML('afterbegin', '<button class="ngn_x" style="float:right" title="Close symbol bar">×</button><button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
255
+ bar.insertAdjacentHTML('afterbegin', '<button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
255
256
  let overlay = false;
256
257
  const padding = d.body.style.paddingTop, toggle = bar.querySelector('.ngn_o');
257
258
  try { overlay = localStorage.getItem('ngn_lb_overlay') === '1'; } catch {}
258
259
  function reflow() {
259
260
  toggle.textContent = overlay ? '▼' : '▲';
260
- d.body.style.paddingTop = overlay || container.hidden ? padding : `${bar.offsetHeight}px`;
261
+ d.body.style.paddingTop = overlay || bar.hidden ? padding : `${bar.offsetHeight}px`;
261
262
  }
262
- bar.querySelector('.ngn_x').onclick = () => { container.hidden = true; reflow(); };
263
263
  toggle.onclick = () => {
264
264
  overlay = !overlay;
265
265
  try { localStorage.setItem('ngn_lb_overlay', overlay ? '1' : '0'); } catch {}
@@ -463,9 +463,14 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
463
463
  }
464
464
  );
465
465
  const font = new URL("SAX2B.woff2", import.meta.url);
466
- export function attach(monaco, container) {
467
- const input = bar.attach(monaco, container), style = container.ownerDocument.createElement('style');
466
+ export function installFont(doc = document) {
467
+ if (doc.getElementById('bpl-font')) return;
468
+ const style = doc.createElement('style');
469
+ style.id = 'bpl-font';
468
470
  style.textContent = `@font-face{font-family:SAX2B;src:url("${font}") format("woff2")}`;
469
- container.append(style);
470
- return {dispose() { input.dispose(); style.remove(); }};
471
+ doc.head.append(style);
472
+ }
473
+ export function attach(monaco, container) {
474
+ installFont(container.ownerDocument);
475
+ return bar.attach(monaco, container);
471
476
  }
package/lb.js CHANGED
@@ -86,7 +86,7 @@
86
86
  }
87
87
 
88
88
  const host = d.createElement('div');
89
- host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"></div>
89
+ host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"><button type="button" class="ngn_x" style="float:right" title="Close symbol bar">×</button></div>
90
90
  <div class="bpl_choices" role="group" aria-label="BPL symbol completions" hidden></div>
91
91
  <style>
92
92
  .ngn_lb,.bpl_choices{background:var(--bpl-bar-background,#eee);color:var(--bpl-bar-color,#111);font:15px var(--bpl-font,SAX2B),monospace}
@@ -102,6 +102,7 @@
102
102
  </style>`;
103
103
  container.append(host);
104
104
  const bar = host.querySelector('.ngn_lb'), tip = host.querySelector('.bpl_choices');
105
+ bar.querySelector('.ngn_x').onclick = () => { bar.hidden = true; };
105
106
  let active, lastEditor, choice, keyInput = false;
106
107
  const names = new Map(symbols.map(({glyph, name, monad, dyad}) =>
107
108
  [glyph, [name, monad, dyad].filter(Boolean).join(' ')]));
@@ -247,15 +248,14 @@
247
248
  container.style.cssText = 'position:fixed;top:0;left:0;right:0;z-index:2147483647';
248
249
  d.body.append(container);
249
250
  const input = attach(monaco, container, true), bar = container.querySelector('.ngn_lb');
250
- bar.insertAdjacentHTML('afterbegin', '<button class="ngn_x" style="float:right" title="Close symbol bar">×</button><button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
251
+ bar.insertAdjacentHTML('afterbegin', '<button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
251
252
  let overlay = false;
252
253
  const padding = d.body.style.paddingTop, toggle = bar.querySelector('.ngn_o');
253
254
  try { overlay = localStorage.getItem('ngn_lb_overlay') === '1'; } catch {}
254
255
  function reflow() {
255
256
  toggle.textContent = overlay ? '▼' : '▲';
256
- d.body.style.paddingTop = overlay || container.hidden ? padding : `${bar.offsetHeight}px`;
257
+ d.body.style.paddingTop = overlay || bar.hidden ? padding : `${bar.offsetHeight}px`;
257
258
  }
258
- bar.querySelector('.ngn_x').onclick = () => { container.hidden = true; reflow(); };
259
259
  toggle.onclick = () => {
260
260
  overlay = !overlay;
261
261
  try { localStorage.setItem('ngn_lb_overlay', overlay ? '1' : '0'); } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basedpl",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "description": "BasedPL, the Based-array Programming Language, is an APL-derived array language, borrowing ideas from J and BQN, with an emphasis on simple, consistent notation.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {