@recursica/adapter-tester 2.0.1 → 2.0.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../src/devServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AA6FhF,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,sBAAsB,EAAE,EACpC,OAAO,GAAE,gBAAqB,GAC7B,IAAI,CA4HN"}
1
+ {"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../src/devServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAgGhF,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,sBAAsB,EAAE,EACpC,OAAO,GAAE,gBAAqB,GAC7B,IAAI,CA6HN"}
package/dist/index.html CHANGED
@@ -165,11 +165,11 @@
165
165
  <body>
166
166
  <div class="pane" id="leftPane">
167
167
  <div class="header">
168
- <span id="sourceOfTruthLabel">Source of Truth</span>
169
- <span class="status connected" id="mantineStatus">Connected & Syncing</span>
168
+ <span id="ownLabel">Target</span>
169
+ <span class="status connected" id="ownStatus">Connected & Syncing</span>
170
170
  </div>
171
- <!-- Load the source of truth via the SAME ORIGIN proxy -->
172
- <iframe id="mantine" src="/?path=/story/ui-kit-slider--default"></iframe>
171
+ <!-- Load this project's own Storybook via the SAME ORIGIN proxy -->
172
+ <iframe id="own" src="/?path=/story/ui-kit-slider--default"></iframe>
173
173
  </div>
174
174
 
175
175
  <div class="divider" id="vDivider"></div>
@@ -177,13 +177,13 @@
177
177
  <div class="pane" id="rightPane">
178
178
  <div class="right-top" id="rightTop">
179
179
  <div class="header">
180
- <span id="targetLabel">Target</span>
181
- <span class="status connected" id="muiStatus">Ready</span>
180
+ <span id="sourceOfTruthLabel">Source of Truth</span>
181
+ <span class="status connected" id="sourceOfTruthStatus">Ready</span>
182
182
  </div>
183
- <!-- Spacer to align the view with the source of truth's Storybook header (40px) -->
183
+ <!-- Spacer to align the view with the own Storybook's header (40px) -->
184
184
  <div style="height: 40px; flex: 0 0 40px; background-color: #fff; border-bottom: 1px solid #e6e6e6; box-sizing: border-box;"></div>
185
- <!-- Load the bare target component preview -->
186
- <iframe id="mui" src=""></iframe>
185
+ <!-- Load the bare source-of-truth component preview -->
186
+ <iframe id="sourceOfTruth" src=""></iframe>
187
187
  </div>
188
188
 
189
189
  <div class="h-divider" id="hDivider"></div>
@@ -214,13 +214,13 @@
214
214
 
215
215
  <script>
216
216
  // Injected by the dev server — see src/devServer.ts.
217
- const devConfig = window.__ADAPTER_TESTER__ || { sourceOfTruthName: 'Source of Truth', targetName: 'Target', targetPort: 6012 };
217
+ const devConfig = window.__ADAPTER_TESTER__ || { ownName: 'Target', sourceOfTruthName: 'Source of Truth', sourceOfTruthPort: 6011 };
218
+ document.getElementById('ownLabel').textContent = devConfig.ownName;
218
219
  document.getElementById('sourceOfTruthLabel').textContent = `${devConfig.sourceOfTruthName} (Source of Truth)`;
219
- document.getElementById('targetLabel').textContent = devConfig.targetName;
220
220
 
221
- const muiIframe = document.getElementById('mui');
222
- const mantineIframe = document.getElementById('mantine');
223
- const muiStatus = document.getElementById('muiStatus');
221
+ const ownIframe = document.getElementById('own');
222
+ const sourceOfTruthIframe = document.getElementById('sourceOfTruth');
223
+ const sourceOfTruthStatus = document.getElementById('sourceOfTruthStatus');
224
224
 
225
225
  // Sync initial iframe sources with outer URL if params exist, else fall
226
226
  // back to a sensible default story so both panes load something on open.
@@ -228,17 +228,17 @@
228
228
  const initialId = outerParams.get('id') || 'ui-kit-slider--default';
229
229
  const initialArgs = outerParams.get('args');
230
230
 
231
- let mSrc = `/?path=/story/${initialId}`;
231
+ let ownSrc = `/?path=/story/${initialId}`;
232
232
  if (initialArgs) {
233
- mSrc += `&args=${initialArgs}`;
233
+ ownSrc += `&args=${initialArgs}`;
234
234
  }
235
- mantineIframe.src = mSrc;
235
+ ownIframe.src = ownSrc;
236
236
 
237
- let uSrc = `http://localhost:${devConfig.targetPort}/iframe.html?id=${initialId}&viewMode=story`;
237
+ let sotSrc = `http://localhost:${devConfig.sourceOfTruthPort}/iframe.html?id=${initialId}&viewMode=story`;
238
238
  if (initialArgs) {
239
- uSrc += `&args=${initialArgs}`;
239
+ sotSrc += `&args=${initialArgs}`;
240
240
  }
241
- muiIframe.src = uSrc;
241
+ sourceOfTruthIframe.src = sotSrc;
242
242
 
243
243
  // Resizers
244
244
  const vDivider = document.getElementById('vDivider');
@@ -263,8 +263,8 @@
263
263
  vDivider.addEventListener('mousedown', (e) => {
264
264
  isVResizing = true;
265
265
  document.body.style.cursor = 'col-resize';
266
- mantineIframe.style.pointerEvents = 'none';
267
- muiIframe.style.pointerEvents = 'none';
266
+ ownIframe.style.pointerEvents = 'none';
267
+ sourceOfTruthIframe.style.pointerEvents = 'none';
268
268
  });
269
269
 
270
270
  document.addEventListener('mousemove', (e) => {
@@ -288,8 +288,8 @@
288
288
  isVResizing = false;
289
289
  isHResizing = false;
290
290
  document.body.style.cursor = 'default';
291
- mantineIframe.style.pointerEvents = 'auto';
292
- muiIframe.style.pointerEvents = 'auto';
291
+ ownIframe.style.pointerEvents = 'auto';
292
+ sourceOfTruthIframe.style.pointerEvents = 'auto';
293
293
  }
294
294
  });
295
295
 
@@ -298,8 +298,8 @@
298
298
  hDivider.addEventListener('mousedown', (e) => {
299
299
  isHResizing = true;
300
300
  document.body.style.cursor = 'row-resize';
301
- mantineIframe.style.pointerEvents = 'none';
302
- muiIframe.style.pointerEvents = 'none';
301
+ ownIframe.style.pointerEvents = 'none';
302
+ sourceOfTruthIframe.style.pointerEvents = 'none';
303
303
  });
304
304
 
305
305
  // Auto-save notes logic
@@ -406,7 +406,7 @@
406
406
  let lastUrl = '';
407
407
  setInterval(() => {
408
408
  try {
409
- const currentUrl = mantineIframe.contentWindow.location.href;
409
+ const currentUrl = ownIframe.contentWindow.location.href;
410
410
 
411
411
  if (currentUrl && currentUrl !== lastUrl && currentUrl !== 'about:blank') {
412
412
  lastUrl = currentUrl;
@@ -440,19 +440,19 @@
440
440
  window.history.replaceState({}, '', outerUrl.pathname + outerUrl.search);
441
441
  }
442
442
 
443
- let muiUrl = `http://localhost:${devConfig.targetPort}/iframe.html?id=${id}&viewMode=story`;
443
+ let sotUrl = `http://localhost:${devConfig.sourceOfTruthPort}/iframe.html?id=${id}&viewMode=story`;
444
444
  if (args) {
445
- muiUrl += `&args=${args}`;
445
+ sotUrl += `&args=${args}`;
446
446
  }
447
-
448
- if (muiIframe.src !== muiUrl) {
449
- muiStatus.textContent = 'Updating...';
450
- muiStatus.classList.remove('connected');
451
- muiIframe.src = muiUrl;
452
-
447
+
448
+ if (sourceOfTruthIframe.src !== sotUrl) {
449
+ sourceOfTruthStatus.textContent = 'Updating...';
450
+ sourceOfTruthStatus.classList.remove('connected');
451
+ sourceOfTruthIframe.src = sotUrl;
452
+
453
453
  setTimeout(() => {
454
- muiStatus.textContent = 'Synced';
455
- muiStatus.classList.add('connected');
454
+ sourceOfTruthStatus.textContent = 'Synced';
455
+ sourceOfTruthStatus.classList.add('connected');
456
456
  }, 500);
457
457
  }
458
458
  }
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/borderux/recursica.git",
14
14
  "directory": "packages/adapter-tester"
15
15
  },
16
- "version": "2.0.1",
16
+ "version": "2.0.2",
17
17
  "type": "module",
18
18
  "main": "./dist/index.cjs",
19
19
  "module": "./dist/index.js",
package/public/index.html CHANGED
@@ -165,11 +165,11 @@
165
165
  <body>
166
166
  <div class="pane" id="leftPane">
167
167
  <div class="header">
168
- <span id="sourceOfTruthLabel">Source of Truth</span>
169
- <span class="status connected" id="mantineStatus">Connected & Syncing</span>
168
+ <span id="ownLabel">Target</span>
169
+ <span class="status connected" id="ownStatus">Connected & Syncing</span>
170
170
  </div>
171
- <!-- Load the source of truth via the SAME ORIGIN proxy -->
172
- <iframe id="mantine" src="/?path=/story/ui-kit-slider--default"></iframe>
171
+ <!-- Load this project's own Storybook via the SAME ORIGIN proxy -->
172
+ <iframe id="own" src="/?path=/story/ui-kit-slider--default"></iframe>
173
173
  </div>
174
174
 
175
175
  <div class="divider" id="vDivider"></div>
@@ -177,13 +177,13 @@
177
177
  <div class="pane" id="rightPane">
178
178
  <div class="right-top" id="rightTop">
179
179
  <div class="header">
180
- <span id="targetLabel">Target</span>
181
- <span class="status connected" id="muiStatus">Ready</span>
180
+ <span id="sourceOfTruthLabel">Source of Truth</span>
181
+ <span class="status connected" id="sourceOfTruthStatus">Ready</span>
182
182
  </div>
183
- <!-- Spacer to align the view with the source of truth's Storybook header (40px) -->
183
+ <!-- Spacer to align the view with the own Storybook's header (40px) -->
184
184
  <div style="height: 40px; flex: 0 0 40px; background-color: #fff; border-bottom: 1px solid #e6e6e6; box-sizing: border-box;"></div>
185
- <!-- Load the bare target component preview -->
186
- <iframe id="mui" src=""></iframe>
185
+ <!-- Load the bare source-of-truth component preview -->
186
+ <iframe id="sourceOfTruth" src=""></iframe>
187
187
  </div>
188
188
 
189
189
  <div class="h-divider" id="hDivider"></div>
@@ -214,13 +214,13 @@
214
214
 
215
215
  <script>
216
216
  // Injected by the dev server — see src/devServer.ts.
217
- const devConfig = window.__ADAPTER_TESTER__ || { sourceOfTruthName: 'Source of Truth', targetName: 'Target', targetPort: 6012 };
217
+ const devConfig = window.__ADAPTER_TESTER__ || { ownName: 'Target', sourceOfTruthName: 'Source of Truth', sourceOfTruthPort: 6011 };
218
+ document.getElementById('ownLabel').textContent = devConfig.ownName;
218
219
  document.getElementById('sourceOfTruthLabel').textContent = `${devConfig.sourceOfTruthName} (Source of Truth)`;
219
- document.getElementById('targetLabel').textContent = devConfig.targetName;
220
220
 
221
- const muiIframe = document.getElementById('mui');
222
- const mantineIframe = document.getElementById('mantine');
223
- const muiStatus = document.getElementById('muiStatus');
221
+ const ownIframe = document.getElementById('own');
222
+ const sourceOfTruthIframe = document.getElementById('sourceOfTruth');
223
+ const sourceOfTruthStatus = document.getElementById('sourceOfTruthStatus');
224
224
 
225
225
  // Sync initial iframe sources with outer URL if params exist, else fall
226
226
  // back to a sensible default story so both panes load something on open.
@@ -228,17 +228,17 @@
228
228
  const initialId = outerParams.get('id') || 'ui-kit-slider--default';
229
229
  const initialArgs = outerParams.get('args');
230
230
 
231
- let mSrc = `/?path=/story/${initialId}`;
231
+ let ownSrc = `/?path=/story/${initialId}`;
232
232
  if (initialArgs) {
233
- mSrc += `&args=${initialArgs}`;
233
+ ownSrc += `&args=${initialArgs}`;
234
234
  }
235
- mantineIframe.src = mSrc;
235
+ ownIframe.src = ownSrc;
236
236
 
237
- let uSrc = `http://localhost:${devConfig.targetPort}/iframe.html?id=${initialId}&viewMode=story`;
237
+ let sotSrc = `http://localhost:${devConfig.sourceOfTruthPort}/iframe.html?id=${initialId}&viewMode=story`;
238
238
  if (initialArgs) {
239
- uSrc += `&args=${initialArgs}`;
239
+ sotSrc += `&args=${initialArgs}`;
240
240
  }
241
- muiIframe.src = uSrc;
241
+ sourceOfTruthIframe.src = sotSrc;
242
242
 
243
243
  // Resizers
244
244
  const vDivider = document.getElementById('vDivider');
@@ -263,8 +263,8 @@
263
263
  vDivider.addEventListener('mousedown', (e) => {
264
264
  isVResizing = true;
265
265
  document.body.style.cursor = 'col-resize';
266
- mantineIframe.style.pointerEvents = 'none';
267
- muiIframe.style.pointerEvents = 'none';
266
+ ownIframe.style.pointerEvents = 'none';
267
+ sourceOfTruthIframe.style.pointerEvents = 'none';
268
268
  });
269
269
 
270
270
  document.addEventListener('mousemove', (e) => {
@@ -288,8 +288,8 @@
288
288
  isVResizing = false;
289
289
  isHResizing = false;
290
290
  document.body.style.cursor = 'default';
291
- mantineIframe.style.pointerEvents = 'auto';
292
- muiIframe.style.pointerEvents = 'auto';
291
+ ownIframe.style.pointerEvents = 'auto';
292
+ sourceOfTruthIframe.style.pointerEvents = 'auto';
293
293
  }
294
294
  });
295
295
 
@@ -298,8 +298,8 @@
298
298
  hDivider.addEventListener('mousedown', (e) => {
299
299
  isHResizing = true;
300
300
  document.body.style.cursor = 'row-resize';
301
- mantineIframe.style.pointerEvents = 'none';
302
- muiIframe.style.pointerEvents = 'none';
301
+ ownIframe.style.pointerEvents = 'none';
302
+ sourceOfTruthIframe.style.pointerEvents = 'none';
303
303
  });
304
304
 
305
305
  // Auto-save notes logic
@@ -406,7 +406,7 @@
406
406
  let lastUrl = '';
407
407
  setInterval(() => {
408
408
  try {
409
- const currentUrl = mantineIframe.contentWindow.location.href;
409
+ const currentUrl = ownIframe.contentWindow.location.href;
410
410
 
411
411
  if (currentUrl && currentUrl !== lastUrl && currentUrl !== 'about:blank') {
412
412
  lastUrl = currentUrl;
@@ -440,19 +440,19 @@
440
440
  window.history.replaceState({}, '', outerUrl.pathname + outerUrl.search);
441
441
  }
442
442
 
443
- let muiUrl = `http://localhost:${devConfig.targetPort}/iframe.html?id=${id}&viewMode=story`;
443
+ let sotUrl = `http://localhost:${devConfig.sourceOfTruthPort}/iframe.html?id=${id}&viewMode=story`;
444
444
  if (args) {
445
- muiUrl += `&args=${args}`;
445
+ sotUrl += `&args=${args}`;
446
446
  }
447
-
448
- if (muiIframe.src !== muiUrl) {
449
- muiStatus.textContent = 'Updating...';
450
- muiStatus.classList.remove('connected');
451
- muiIframe.src = muiUrl;
452
-
447
+
448
+ if (sourceOfTruthIframe.src !== sotUrl) {
449
+ sourceOfTruthStatus.textContent = 'Updating...';
450
+ sourceOfTruthStatus.classList.remove('connected');
451
+ sourceOfTruthIframe.src = sotUrl;
452
+
453
453
  setTimeout(() => {
454
- muiStatus.textContent = 'Synced';
455
- muiStatus.classList.add('connected');
454
+ sourceOfTruthStatus.textContent = 'Synced';
455
+ sourceOfTruthStatus.classList.add('connected');
456
456
  }, 500);
457
457
  }
458
458
  }