@codedesignai/nextjs-live-edit-plugin 1.0.6 → 1.0.8

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/index.js CHANGED
@@ -44,8 +44,13 @@ function withLiveEdit(nextConfig = {}, pluginOptions = {}) {
44
44
  const existingTurbopack = nextConfig.turbopack || {};
45
45
  const existingRules = existingTurbopack.rules || {};
46
46
 
47
+ // Merge allowedDevOrigins — sandbox domains need cross-origin HMR access
48
+ // for React hydration to complete (which <Script strategy="afterInteractive"> depends on)
49
+ const existingOrigins = nextConfig.allowedDevOrigins || [];
50
+
47
51
  return {
48
52
  ...nextConfig,
53
+ allowedDevOrigins: [...existingOrigins, '*.miraqal.com', '*.codedesign.one', '*.cdsn.app'],
49
54
  turbopack: {
50
55
  ...existingTurbopack,
51
56
  rules: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedesignai/nextjs-live-edit-plugin",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Next.js plugin for live editing React components with AST-powered source mapping",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -225,10 +225,14 @@ module.exports = function sourceMapperLoader(source) {
225
225
  for (const child of node.children) {
226
226
  // 2a. Direct JSXText with non-whitespace content
227
227
  if (child.type === 'JSXText') {
228
- const trimmed = child.value.trim();
228
+ const raw = child.value;
229
+ const trimmed = raw.trim();
229
230
  if (trimmed.length > 0) {
231
+ // Adjust start/end to the trimmed text boundaries (not the full node which includes whitespace)
232
+ const trimStart = child.start + raw.indexOf(trimmed);
233
+ const trimEnd = trimStart + trimmed.length;
230
234
  regions.push(
231
- makeRegion(source, relativeToSrcDir, child.start, child.end, trimmed, 'text-content')
235
+ makeRegion(source, relativeToSrcDir, trimStart, trimEnd, trimmed, 'text-content')
232
236
  );
233
237
  }
234
238
  }