@shoppexio/builder-contracts 0.1.12 → 0.1.14

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.
@@ -2,5 +2,5 @@
2
2
  * Normalizes the storefront route visible inside a theme-preview iframe after the
3
3
  * worker strips the `/s/:sessionId/:draftToken` prefix via history.replaceState.
4
4
  */
5
- export declare function readPreviewStorefrontRoutePath(pathname: string, search?: string, hash?: string): string | null;
5
+ export declare function readPreviewStorefrontRoutePath(pathname: string, search?: string, _hash?: string): string | null;
6
6
  //# sourceMappingURL=preview-route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview-route.d.ts","sourceRoot":"","sources":["../src/preview-route.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAK,EACX,IAAI,SAAK,GACR,MAAM,GAAG,IAAI,CAaf"}
1
+ {"version":3,"file":"preview-route.d.ts","sourceRoot":"","sources":["../src/preview-route.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAK,EACX,KAAK,SAAK,GACT,MAAM,GAAG,IAAI,CAaf"}
@@ -2,7 +2,7 @@
2
2
  * Normalizes the storefront route visible inside a theme-preview iframe after the
3
3
  * worker strips the `/s/:sessionId/:draftToken` prefix via history.replaceState.
4
4
  */
5
- export function readPreviewStorefrontRoutePath(pathname, search = '', hash = '') {
5
+ export function readPreviewStorefrontRoutePath(pathname, search = '', _hash = '') {
6
6
  const path = pathname.trim() || '/';
7
7
  if (path.includes('/__shoppex/')) {
8
8
  return null;
@@ -12,5 +12,5 @@ export function readPreviewStorefrontRoutePath(pathname, search = '', hash = '')
12
12
  return null;
13
13
  }
14
14
  const normalizedPath = path.replace(/\/+$/, '') || '/';
15
- return `${normalizedPath}${search}${hash}`;
15
+ return `${normalizedPath}${search}`;
16
16
  }
@@ -3,7 +3,7 @@ export type PublicBuilderThemeScheme = (typeof PUBLIC_BUILDER_THEME_SCHEMES)[num
3
3
  export declare const STARTER_BUILDER_THEME_SCHEMES: readonly ["blank"];
4
4
  export declare const THEME_STORE_DISABLED_SCHEMES: readonly [];
5
5
  export declare const THEME_STORE_INSTALLABLE_SCHEMES: readonly ["default", "starlight", "pulse", "vault", "clean-minimal", "classic", "phantom", "nebula", "apex", "shadow"];
6
- export declare const BUILDER_READY_THEME_SCHEMES: readonly ["blank", "default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault", "clean-minimal", "shadow"];
6
+ export declare const BUILDER_READY_THEME_SCHEMES: readonly ["blank", "default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault", "clean-minimal"];
7
7
  export type ThemeStoreInstallableScheme = (typeof THEME_STORE_INSTALLABLE_SCHEMES)[number];
8
8
  export type StarterBuilderThemeScheme = (typeof STARTER_BUILDER_THEME_SCHEMES)[number];
9
9
  export type BuilderReadyThemeScheme = (typeof BUILDER_READY_THEME_SCHEMES)[number];
@@ -1 +1 @@
1
- {"version":3,"file":"theme-schemes.d.ts","sourceRoot":"","sources":["../src/theme-schemes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,wHAW/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,6BAA6B,oBAAqB,CAAC;AAEhE,eAAO,MAAM,4BAA4B,aAA4D,CAAC;AAItG,eAAO,MAAM,+BAA+B,wHAWY,CAAC;AAEzD,eAAO,MAAM,2BAA2B,iIAG9B,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3F,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF,MAAM,MAAM,uBAAuB,GAAG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AAK,EAAE,MAAM,GACZ,KAAK,IAAI,2BAA2B,CAEtC;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,yBAAyB,CAE7F;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,uBAAuB,CAEzF"}
@@ -27,7 +27,15 @@ export const THEME_STORE_INSTALLABLE_SCHEMES = [
27
27
  ];
28
28
  export const BUILDER_READY_THEME_SCHEMES = [
29
29
  ...STARTER_BUILDER_THEME_SCHEMES,
30
- ...PUBLIC_BUILDER_THEME_SCHEMES,
30
+ 'default',
31
+ 'classic',
32
+ 'nebula',
33
+ 'pulse',
34
+ 'phantom',
35
+ 'starlight',
36
+ 'apex',
37
+ 'vault',
38
+ 'clean-minimal',
31
39
  ];
32
40
  export function isPublicBuilderThemeScheme(value) {
33
41
  return PUBLIC_BUILDER_THEME_SCHEMES.includes(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoppexio/builder-contracts",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Shared Builder v2 contracts for Shoppex dashboard, backend, preview runtime, and themes",
5
5
  "type": "module",
6
6
  "repository": {
@@ -7,6 +7,11 @@ describe('readPreviewStorefrontRoutePath', () => {
7
7
  .toBe('/products?category=fivem&sort=price-asc');
8
8
  });
9
9
 
10
+ test('omits hash fragments from storefront routes', () => {
11
+ expect(readPreviewStorefrontRoutePath('/products', '?category=fivem', '#faq'))
12
+ .toBe('/products?category=fivem');
13
+ });
14
+
10
15
  test('normalizes trailing slashes on non-root paths', () => {
11
16
  expect(readPreviewStorefrontRoutePath('/products/', '?page=2')).toBe('/products?page=2');
12
17
  });
@@ -5,7 +5,7 @@
5
5
  export function readPreviewStorefrontRoutePath(
6
6
  pathname: string,
7
7
  search = '',
8
- hash = '',
8
+ _hash = '',
9
9
  ): string | null {
10
10
  const path = pathname.trim() || '/';
11
11
  if (path.includes('/__shoppex/')) {
@@ -18,5 +18,5 @@ export function readPreviewStorefrontRoutePath(
18
18
  }
19
19
 
20
20
  const normalizedPath = path.replace(/\/+$/, '') || '/';
21
- return `${normalizedPath}${search}${hash}`;
21
+ return `${normalizedPath}${search}`;
22
22
  }
@@ -34,7 +34,15 @@ export const THEME_STORE_INSTALLABLE_SCHEMES = [
34
34
 
35
35
  export const BUILDER_READY_THEME_SCHEMES = [
36
36
  ...STARTER_BUILDER_THEME_SCHEMES,
37
- ...PUBLIC_BUILDER_THEME_SCHEMES,
37
+ 'default',
38
+ 'classic',
39
+ 'nebula',
40
+ 'pulse',
41
+ 'phantom',
42
+ 'starlight',
43
+ 'apex',
44
+ 'vault',
45
+ 'clean-minimal',
38
46
  ] as const;
39
47
 
40
48
  export type ThemeStoreInstallableScheme = (typeof THEME_STORE_INSTALLABLE_SCHEMES)[number];