@bagelink/blox 1.14.7 → 1.14.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.
@@ -1277,10 +1277,18 @@ function bloxPlugin(options = {}) {
1277
1277
  remaining = remaining.slice(0, declStart) + remaining.slice(j);
1278
1278
  }
1279
1279
  const hoistedImports = [];
1280
- const importRe = /^[ \t]*import\s[^\n]+from\s+['"](?:@bagelink\/blox|@bagelink\/vue)['"]\s*/gm;
1281
- remaining = remaining.replace(importRe, (match) => {
1282
- hoistedImports.push(match.trimEnd());
1283
- return "";
1280
+ const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
1281
+ remaining = remaining.replace(importRe, (match, namedGroup, source) => {
1282
+ const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
1283
+ const hoist = [];
1284
+ const keep = [];
1285
+ for (const name of names) {
1286
+ const local = name.split(/\s+as\s+/).pop().trim();
1287
+ if (identifiers.has(local)) hoist.push(name);
1288
+ else keep.push(name);
1289
+ }
1290
+ if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
1291
+ return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
1284
1292
  });
1285
1293
  const langMatch = attrs.match(/lang="([^"]+)"/);
1286
1294
  const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,CAgTpE"}
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,CAsUpE"}
@@ -1275,10 +1275,18 @@ function bloxPlugin(options = {}) {
1275
1275
  remaining = remaining.slice(0, declStart) + remaining.slice(j);
1276
1276
  }
1277
1277
  const hoistedImports = [];
1278
- const importRe = /^[ \t]*import\s[^\n]+from\s+['"](?:@bagelink\/blox|@bagelink\/vue)['"]\s*/gm;
1279
- remaining = remaining.replace(importRe, (match) => {
1280
- hoistedImports.push(match.trimEnd());
1281
- return "";
1278
+ const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
1279
+ remaining = remaining.replace(importRe, (match, namedGroup, source) => {
1280
+ const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
1281
+ const hoist = [];
1282
+ const keep = [];
1283
+ for (const name of names) {
1284
+ const local = name.split(/\s+as\s+/).pop().trim();
1285
+ if (identifiers.has(local)) hoist.push(name);
1286
+ else keep.push(name);
1287
+ }
1288
+ if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
1289
+ return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
1282
1290
  });
1283
1291
  const langMatch = attrs.match(/lang="([^"]+)"/);
1284
1292
  const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.14.7",
4
+ "version": "1.14.13",
5
5
  "description": "Blox page builder library for drag-and-drop page building and static data management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",