@bagelink/blox 1.15.168 → 1.15.172
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/dist/CmsPageView.vue.d.ts.map +1 -1
- package/dist/{PreviewApp-D4KSHYFg.js → PreviewApp-CsC6qej1.js} +1 -1
- package/dist/{PreviewApp-BzkbTbJn.cjs → PreviewApp-Dz003khp.cjs} +1 -1
- package/dist/PreviewApp.vue.d.ts.map +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-E1fz5U0S.cjs → PreviewApp.vue_vue_type_style_index_0_lang-BNKK7Vhs.cjs} +5 -2
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-jOqBFtyW.js → PreviewApp.vue_vue_type_style_index_0_lang-C1SwhjdY.js} +5 -2
- package/dist/bridge.d.ts +4 -1
- package/dist/bridge.d.ts.map +1 -1
- package/dist/components/LocaleRouterLink.vue.d.ts +2 -0
- package/dist/components/LocaleRouterLink.vue.d.ts.map +1 -1
- package/dist/composables/useLocaleNav.d.ts +2 -2
- package/dist/composables/useLocaleNav.d.ts.map +1 -1
- package/dist/{core-CcRbfY3w.js → core-CbOrSpOU.js} +183 -36
- package/dist/{core-z-MGlvcM.cjs → core-fPjj9xyJ.cjs} +174 -27
- package/dist/core.d.ts.map +1 -1
- package/dist/createBloxApp.d.ts.map +1 -1
- package/dist/defineBlock.d.ts +25 -2
- package/dist/defineBlock.d.ts.map +1 -1
- package/dist/index.cjs +26 -7
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +39 -20
- package/dist/localeStrategy.d.ts +5 -2
- package/dist/localeStrategy.d.ts.map +1 -1
- package/dist/manifest.d.ts +2 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/schema.d.ts +5 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/smartLinks.d.ts +31 -0
- package/dist/smartLinks.d.ts.map +1 -0
- package/dist/ssg/index.cjs +1 -1
- package/dist/ssg/index.mjs +1 -1
- package/dist/vite-plugin.cjs +12 -2
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.mjs +12 -2
- package/package.json +1 -1
package/dist/localeStrategy.d.ts
CHANGED
|
@@ -6,11 +6,12 @@ export interface LocaleStrategy {
|
|
|
6
6
|
slug: string;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* Return a navigable path for the given slug in the current locale
|
|
9
|
+
* Return a navigable path for the given slug in the given (or current) locale.
|
|
10
10
|
* For `path` strategy: prepends locale prefix (omitted for default locale).
|
|
11
|
+
* Idempotent if `slug` is already locale-prefixed.
|
|
11
12
|
* For `domain` strategy: returns slug as-is (the domain carries the locale).
|
|
12
13
|
*/
|
|
13
|
-
toPath: (slug: string) => string;
|
|
14
|
+
toPath: (slug: string, locale?: string) => string;
|
|
14
15
|
/**
|
|
15
16
|
* Navigate to a different locale, using the provided localized slug.
|
|
16
17
|
* Falls back to '/' if no slug given.
|
|
@@ -18,6 +19,8 @@ export interface LocaleStrategy {
|
|
|
18
19
|
switchTo: (locale: string, slug: string, router: Router) => void;
|
|
19
20
|
/** All known locales. */
|
|
20
21
|
readonly locales: string[];
|
|
22
|
+
/** Default / canonical locale (pages resolve by this locale's slug). */
|
|
23
|
+
readonly defaultLocale: string;
|
|
21
24
|
/** The locale active on this deployment/URL. */
|
|
22
25
|
readonly currentLocale: string;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeStrategy.d.ts","sourceRoot":"","sources":["../src/localeStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC,MAAM,WAAW,cAAc;IAC9B,gEAAgE;IAChE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E
|
|
1
|
+
{"version":3,"file":"localeStrategy.d.ts","sourceRoot":"","sources":["../src/localeStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC,MAAM,WAAW,cAAc;IAC9B,gEAAgE;IAChE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E;;;;;OAKG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACjD;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAChE,yBAAyB;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAMD,MAAM,WAAW,mBAAmB;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAA;CAC1B;AAoED,MAAM,WAAW,qBAAqB;IACrC,+EAA+E;IAC/E,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC;AAgDD,MAAM,WAAW,eAAe;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAClC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CAQ7E"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface BlockManifestEntry {
|
|
|
19
19
|
description?: string;
|
|
20
20
|
/** True when the block fetches its own data from a datastore collection. */
|
|
21
21
|
dataSource?: boolean;
|
|
22
|
+
/** Group key for the editor block picker. */
|
|
23
|
+
category?: string;
|
|
22
24
|
/** Sort order in the editor block picker (lower first). */
|
|
23
25
|
order?: number;
|
|
24
26
|
/**
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC3C,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,YAAY;IAC5B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAC5B;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC3C,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,YAAY;IAC5B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAC5B;AAmCD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACvC,YAAY,CAKd;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAElE"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaDefinition } from '@bagelink/vue';
|
|
2
2
|
import { Component } from 'vue';
|
|
3
|
-
import { BlockMeta } from './defineBlock';
|
|
3
|
+
import { BlockDataSourceConfig, BlockMeta } from './defineBlock';
|
|
4
4
|
export interface BlockSchema {
|
|
5
5
|
/** Human-readable name shown in the editor. */
|
|
6
6
|
label: string;
|
|
@@ -14,8 +14,10 @@ export interface BlockSchema {
|
|
|
14
14
|
fields?: SchemaDefinition;
|
|
15
15
|
/** Default prop values. Merged with block props at render time. */
|
|
16
16
|
defaults?: Record<string, unknown>;
|
|
17
|
-
/**
|
|
18
|
-
dataSource?:
|
|
17
|
+
/** Datastore linkage — see {@link BlockDataSourceConfig}. */
|
|
18
|
+
dataSource?: BlockDataSourceConfig;
|
|
19
|
+
/** Group key for the editor block picker. See {@link BlockMeta.category}. */
|
|
20
|
+
category?: string;
|
|
19
21
|
/** Static thumbnail image URL for the editor block picker. Overrides the default icon. */
|
|
20
22
|
thumbnail?: string;
|
|
21
23
|
/** Sort order in the editor block picker. Lower values appear first. Defaults to 100. */
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAErE,MAAM,WAAW,WAAW;IAC3B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,WAAW,CAAA;CACnB;AAED,+EAA+E;AAC/E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Router } from 'vue-router';
|
|
2
|
+
/**
|
|
3
|
+
* Normalise a link so editors can omit the leading slash on internal paths:
|
|
4
|
+
* `about` → `/about`. Leaves empty values and anything already absolute /
|
|
5
|
+
* special (http, mailto, tel, #, //, /…) untouched.
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeLink(href?: string | null): string | undefined;
|
|
8
|
+
/** @deprecated use normalizeLink — kept as alias for existing call sites */
|
|
9
|
+
export declare const normalizeTo: typeof normalizeLink;
|
|
10
|
+
/** Absolute http(s) or protocol-relative (`//example.com`) URL. */
|
|
11
|
+
export declare function isAbsoluteExternal(href: string): boolean;
|
|
12
|
+
/** Browser-handled schemes / in-page anchors. */
|
|
13
|
+
export declare function isSpecialScheme(href: string): boolean;
|
|
14
|
+
export type LinkKind = 'external' | 'special' | 'internal';
|
|
15
|
+
/**
|
|
16
|
+
* Classify a (preferably already-normalised) href.
|
|
17
|
+
* Same-origin absolute URLs count as internal.
|
|
18
|
+
*/
|
|
19
|
+
export declare function classifyLink(href: string, origin?: string): LinkKind;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve an internal href to a path (+ search + hash) suitable for the router.
|
|
22
|
+
* Same-origin absolute URLs are reduced to path/search/hash.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toInternalPath(href: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Document-level click delegation so raw `<a href>` (and Btn `:href`) get the
|
|
27
|
+
* same internal/external behaviour without per-block wiring.
|
|
28
|
+
* Returns an uninstall function.
|
|
29
|
+
*/
|
|
30
|
+
export declare function installSmartLinks(router: Router): () => void;
|
|
31
|
+
//# sourceMappingURL=smartLinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartLinks.d.ts","sourceRoot":"","sources":["../src/smartLinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED,4EAA4E;AAC5E,eAAO,MAAM,WAAW,sBAAgB,CAAA;AAExC,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,iDAAiD;AACjD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAA;AAE1D;;;GAGG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,SAA8D,GAClE,QAAQ,CAWV;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYnD;AAYD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CA0C5D"}
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const prerender = require("../prerender-BLECK5o5.cjs");
|
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const core = require("../core-
|
|
29
|
+
const core = require("../core-fPjj9xyJ.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
const {
|
|
32
32
|
url,
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WIN
|
|
|
4
4
|
import { getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, markRaw } from "vue";
|
|
7
|
-
import { c as createBlox } from "../core-
|
|
7
|
+
import { c as createBlox } from "../core-CbOrSpOU.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
const {
|
|
10
10
|
url,
|
package/dist/vite-plugin.cjs
CHANGED
|
@@ -266,10 +266,20 @@ function bloxPlugin(options = {}) {
|
|
|
266
266
|
const identifiers = /* @__PURE__ */ new Set();
|
|
267
267
|
const identRe = /\b([a-z_$][\w$]*)\b/gi;
|
|
268
268
|
let identMatch;
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
const strippedCall = callExpr.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, '""').replace(/\b([a-z_$][\w$]*)\s*:/gi, ":");
|
|
270
|
+
const SKIP_IDENTS = /* @__PURE__ */ new Set([
|
|
271
|
+
"true",
|
|
272
|
+
"false",
|
|
273
|
+
"null",
|
|
274
|
+
"undefined",
|
|
275
|
+
"NaN",
|
|
276
|
+
"Infinity"
|
|
277
|
+
]);
|
|
278
|
+
while ((identMatch = identRe.exec(strippedCall)) !== null) {
|
|
279
|
+
if (!SKIP_IDENTS.has(identMatch[1])) identifiers.add(identMatch[1]);
|
|
271
280
|
}
|
|
272
281
|
for (const ident of identifiers) {
|
|
282
|
+
if (ident === "defineBlock") continue;
|
|
273
283
|
const declRe = new RegExp(`^([ \\t]*const\\s+${ident}\\s*=\\s*)`, "m");
|
|
274
284
|
const declMatch = declRe.exec(remaining);
|
|
275
285
|
if (!declMatch) continue;
|
|
@@ -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;IACzB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,
|
|
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;IACzB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,CAqapE"}
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -242,10 +242,20 @@ function bloxPlugin(options = {}) {
|
|
|
242
242
|
const identifiers = /* @__PURE__ */ new Set();
|
|
243
243
|
const identRe = /\b([a-z_$][\w$]*)\b/gi;
|
|
244
244
|
let identMatch;
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
const strippedCall = callExpr.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, '""').replace(/\b([a-z_$][\w$]*)\s*:/gi, ":");
|
|
246
|
+
const SKIP_IDENTS = /* @__PURE__ */ new Set([
|
|
247
|
+
"true",
|
|
248
|
+
"false",
|
|
249
|
+
"null",
|
|
250
|
+
"undefined",
|
|
251
|
+
"NaN",
|
|
252
|
+
"Infinity"
|
|
253
|
+
]);
|
|
254
|
+
while ((identMatch = identRe.exec(strippedCall)) !== null) {
|
|
255
|
+
if (!SKIP_IDENTS.has(identMatch[1])) identifiers.add(identMatch[1]);
|
|
247
256
|
}
|
|
248
257
|
for (const ident of identifiers) {
|
|
258
|
+
if (ident === "defineBlock") continue;
|
|
249
259
|
const declRe = new RegExp(`^([ \\t]*const\\s+${ident}\\s*=\\s*)`, "m");
|
|
250
260
|
const declMatch = declRe.exec(remaining);
|
|
251
261
|
if (!declMatch) continue;
|
package/package.json
CHANGED