@codedesignai/nextjs-live-edit-plugin 1.0.7 → 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 +1 -1
- package/package.json +1 -1
- package/source-mapper-loader.js +6 -2
package/index.js
CHANGED
|
@@ -50,7 +50,7 @@ function withLiveEdit(nextConfig = {}, pluginOptions = {}) {
|
|
|
50
50
|
|
|
51
51
|
return {
|
|
52
52
|
...nextConfig,
|
|
53
|
-
allowedDevOrigins: [...existingOrigins, '
|
|
53
|
+
allowedDevOrigins: [...existingOrigins, '*.miraqal.com', '*.codedesign.one', '*.cdsn.app'],
|
|
54
54
|
turbopack: {
|
|
55
55
|
...existingTurbopack,
|
|
56
56
|
rules: {
|
package/package.json
CHANGED
package/source-mapper-loader.js
CHANGED
|
@@ -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
|
|
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,
|
|
235
|
+
makeRegion(source, relativeToSrcDir, trimStart, trimEnd, trimmed, 'text-content')
|
|
232
236
|
);
|
|
233
237
|
}
|
|
234
238
|
}
|