eyeling 1.24.12 → 1.24.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.24.12",
3
+ "version": "1.24.13",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [
@@ -661,6 +661,8 @@ async function main() {
661
661
  sourceHidden: sourceWrapper ? sourceWrapper.classList.contains('markdown-source-hidden') : true,
662
662
  renderedTabSelected: renderedTab ? renderedTab.getAttribute('aria-selected') === 'true' : false,
663
663
  sourceTabSelected: sourceTab ? sourceTab.getAttribute('aria-selected') === 'true' : false,
664
+ shareStatus: document.getElementById('share-status') ? String(document.getElementById('share-status').textContent || '') : '',
665
+ href: String(window.location.href || ''),
664
666
  highlighted,
665
667
  };
666
668
  })()`)) || { status: '', output: '', highlighted: [] }
@@ -709,6 +711,10 @@ async function main() {
709
711
  })()`);
710
712
  }
711
713
 
714
+ async function makeShareUrlInPage() {
715
+ return await evalInPage(`window.__eyelingPlaygroundMakeShareUrl()`);
716
+ }
717
+
712
718
  async function loadUrlIntoEditor(url) {
713
719
  const payload = JSON.stringify(String(url));
714
720
  await evalInPage(`(() => {
@@ -832,13 +838,24 @@ ${JSON.stringify(last, null, 2)}`);
832
838
  assert.equal(renderedAgain.renderedTabSelected, true, 'Expected Rendered tab to be selectable again');
833
839
  ok('playground renders log:outputString Markdown with Rendered/Markdown source tabs');
834
840
 
835
- // 5) URL-loaded repository examples should auto-load matching examples/builtin/<stem>.js.
841
+ // 5) Normal editing should not keep rewriting the browser URL with raw N3 content.
842
+ assert.doesNotMatch(renderedAgain.href, /[?&](?:edit|program)=/, 'Expected live URL to avoid raw editor content');
843
+ const compactShareUrl = await makeShareUrlInPage();
844
+ assert.match(compactShareUrl, /[?&]state=/, 'Expected an on-demand compact state parameter');
845
+ assert.doesNotMatch(compactShareUrl, /[?&](?:edit|program)=/, 'Expected share link to avoid raw edit/program params');
846
+ assert.ok(compactShareUrl.length < playgroundUrl.length + encodeURIComponent(outputStringProgram).length, 'Expected compact share URL to be shorter than raw editor URL');
847
+ ok('playground keeps the live URL short and creates compact share links on demand');
848
+
849
+ // 6) URL-loaded repository examples should auto-load matching examples/builtin/<stem>.js.
836
850
  await loadUrlIntoEditor('https://raw.githubusercontent.com/eyereasoner/eyeling/refs/heads/main/examples/sudoku.n3');
837
851
  await waitForState(
838
852
  'sudoku URL loaded with companion builtin',
839
853
  (st) => /loaded n3 into the editor and loaded its example builtin/i.test(String(st.status || '')),
840
854
  20000,
841
855
  );
856
+ const urlLoadedShareUrl = await makeShareUrlInPage();
857
+ assert.match(urlLoadedShareUrl, /[?&]url=/, 'Expected URL-loaded examples to share as a short url= link');
858
+ assert.doesNotMatch(urlLoadedShareUrl, /[?&]state=/, 'Expected unedited URL-loaded examples to avoid state payloads');
842
859
  await clickRun();
843
860
  const sudoku = await waitForState(
844
861
  'URL-loaded Sudoku example completion',