@salesforce/storefront-next-runtime 0.4.2 → 1.0.0-alpha.0

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.
Files changed (60) hide show
  1. package/README.md +9 -3
  2. package/dist/config.d.ts +33 -221
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +34 -116
  5. package/dist/config.js.map +1 -1
  6. package/dist/data-store.d.ts +185 -15
  7. package/dist/data-store.d.ts.map +1 -1
  8. package/dist/data-store.js +412 -10
  9. package/dist/data-store.js.map +1 -1
  10. package/dist/design-data.d.ts +266 -62
  11. package/dist/design-data.d.ts.map +1 -1
  12. package/dist/design-data.js +399 -14
  13. package/dist/design-data.js.map +1 -1
  14. package/dist/design-mode.d.ts +3 -2
  15. package/dist/design-mode.d.ts.map +1 -1
  16. package/dist/design-react-core.d.ts +2 -2
  17. package/dist/events.d.ts +32 -6
  18. package/dist/events.d.ts.map +1 -1
  19. package/dist/i18n-client.d.ts.map +1 -1
  20. package/dist/i18n-client.js.map +1 -1
  21. package/dist/i18n.d.ts +1 -2
  22. package/dist/i18n.d.ts.map +1 -1
  23. package/dist/modeDetection.js +0 -18
  24. package/dist/modeDetection.js.map +1 -1
  25. package/dist/scapi.d.ts +2185 -466
  26. package/dist/scapi.d.ts.map +1 -1
  27. package/dist/scapi.js +1 -1
  28. package/dist/scapi.js.map +1 -1
  29. package/dist/schema.d.ts +17 -15
  30. package/dist/schema.d.ts.map +1 -1
  31. package/dist/site-context.d.ts +43 -27
  32. package/dist/site-context.d.ts.map +1 -1
  33. package/dist/site-context.js +2 -2
  34. package/dist/site-context2.js +41 -31
  35. package/dist/site-context2.js.map +1 -1
  36. package/dist/types.d.ts +19 -3
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/types2.d.ts +89 -63
  39. package/dist/types2.d.ts.map +1 -1
  40. package/package.json +1 -19
  41. package/dist/custom-global-preferences.d.ts +0 -20
  42. package/dist/custom-global-preferences.d.ts.map +0 -1
  43. package/dist/custom-global-preferences.js +0 -31
  44. package/dist/custom-global-preferences.js.map +0 -1
  45. package/dist/custom-site-preferences.d.ts +0 -20
  46. package/dist/custom-site-preferences.d.ts.map +0 -1
  47. package/dist/custom-site-preferences.js +0 -31
  48. package/dist/custom-site-preferences.js.map +0 -1
  49. package/dist/data-store-custom-global-preferences.d.ts +0 -2
  50. package/dist/data-store-custom-global-preferences.js +0 -6
  51. package/dist/data-store-custom-site-preferences.d.ts +0 -2
  52. package/dist/data-store-custom-site-preferences.js +0 -6
  53. package/dist/data-store-gcp-preferences.d.ts +0 -2
  54. package/dist/data-store-gcp-preferences.js +0 -6
  55. package/dist/gcp-preferences.d.ts +0 -52
  56. package/dist/gcp-preferences.d.ts.map +0 -1
  57. package/dist/gcp-preferences.js +0 -64
  58. package/dist/gcp-preferences.js.map +0 -1
  59. package/dist/utils.js +0 -90
  60. package/dist/utils.js.map +0 -1
package/dist/i18n.d.ts CHANGED
@@ -27,7 +27,6 @@ declare function mockI18nContext(contextProvider: RouterContextProvider, options
27
27
  }): void;
28
28
  //#endregion
29
29
  //#region src/i18n/types.d.ts
30
-
31
30
  /** Config passed to `createI18nMiddleware`. All values come from the template — the SDK never reads config values directly. */
32
31
  interface I18nMiddlewareConfig {
33
32
  resources: Resource;
@@ -59,5 +58,5 @@ declare function createI18nMiddleware(config: I18nMiddlewareConfig): MiddlewareF
59
58
  /** Shared i18next interpolation config. Disables HTML escaping (React handles that) and adds `{{ value, number }}` formatting via `toLocaleString`. */
60
59
  declare const defaultInterpolation: InterpolationOptions;
61
60
  //#endregion
62
- export { type I18nMiddlewareConfig, type LocaleLoader, type Resource, type ResourceLanguage, createI18nMiddleware, defaultInterpolation, getLocale, getTranslation, mockI18nContext };
61
+ export { type I18nMiddlewareConfig, type LocaleLoader, createI18nMiddleware, defaultInterpolation, getLocale, getTranslation, mockI18nContext };
63
62
  //# sourceMappingURL=i18n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","names":[],"sources":["../src/i18n/context.ts","../src/i18n/types.ts","../src/i18n/middleware.ts","../src/i18n/defaults.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AE2BA;AAA6C,iBFI7B,cAAA,CEJ6B,OAAA,CAAA,EFIJ,QEJI,CFIK,qBEJL,CAAA,CAAA,EAAA;EAA0C,OAAA,MAAA;EAAnB,CAAA,oBAAA,CAAA,CAAA,aAAA,EAAA,GAAA,MAAA,EAAA,CAAA,EAAA,SAAA,CAAA;CAAkB;;;;ACTtF;iBHqCgB,SAAA,UAAmB,SAAS;;;;;iBAQ5B,eAAA,kBACK;;aACsB;;;;;;ACzCvB,UAJH,oBAAA,CAIG;EACN,SAAA,EAJC,QAID;EAAgB,kBAAA,EAAA,MAAA,EAAA;EAWlB,gBAAY,EAAA,MAAA;kBAZJ;YACN;;ACEd;;;;;;;;ACTa,KFkBD,YAAA,GEVX,CAAA,QAAA,EAAA,MARkC,EAAA,GFkBc,OElBd,CAAA;WFkBiC;;;;;;;ADLpE;AAAkD,iBEJlC,oBAAA,CFIkC,MAAA,EEJL,oBFIK,CAAA,EEJkB,kBFIlB,CEJqC,QFIrC,CAAA;;;ACXlD;AACe,cEHF,oBFGE,EEHoB,oBFGpB"}
1
+ {"version":3,"file":"i18n.d.ts","names":[],"sources":["../src/i18n/context.ts","../src/i18n/types.ts","../src/i18n/middleware.ts","../src/i18n/defaults.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AE2BA;AAA6C,iBFI7B,cAAA,CEJ6B,OAAA,CAAA,EFIJ,QEJI,CFIK,qBEJL,CAAA,CAAA,EAAA;EAA0C,OAAA,MAAA;EAAnB,CAAA,oBAAA,CAAA,CAAA,aAAA,EAAA,GAAA,MAAA,EAAA,CAAA,EAAA,SAAA,CAAA;CAAkB;;;;ACTtF;iBHqCgB,SAAA,UAAmB,SAAS;;;;;iBAQ5B,eAAA,kBACK;;aACsB;;;;AC/C3C;AACe,UADE,oBAAA,CACF;EAGK,SAAA,EAHL,QAGK;EACN,kBAAA,EAAA,MAAA,EAAA;EAAgB,gBAAA,EAAA,MAAA;EAWlB,aAAA,CAAA,EAZQ,oBAYgD;YAXtD;;;ACId;;;;;;;KDOY,YAAA,yBAAqC;EEhBpC,OAAA,EFgBuD,gBERnE;;;;;;;AHKD;AAAkD,iBEJlC,oBAAA,CFIkC,MAAA,EEJL,oBFIK,CAAA,EEJkB,kBFIlB,CEJqC,QFIrC,CAAA;;;ACblD;AACe,cEDF,oBFCE,EEDoB,oBFCpB"}
@@ -1,23 +1,5 @@
1
1
  //#region src/design/modeDetection.ts
2
2
  /**
3
- * Copyright 2026 Salesforce, Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * Utility functions for detecting active design/preview modes
19
- */
20
- /**
21
3
  * Get the mode parameter from URL search params
22
4
  * @param url - Optional URL string or Request object for server-side usage. If not provided, uses window.location on client-side
23
5
  * @returns The mode parameter value or null if not found
@@ -1 +1 @@
1
- {"version":3,"file":"modeDetection.js","names":["searchParams: URLSearchParams"],"sources":["../src/design/modeDetection.ts"],"sourcesContent":["/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Utility functions for detecting active design/preview modes\n */\n\n/**\n * Get the mode parameter from URL search params\n * @param url - Optional URL string or Request object for server-side usage. If not provided, uses window.location on client-side\n * @returns The mode parameter value or null if not found\n */\nexport const getUrlMode = (url?: string | URL | Request): string | null => {\n let searchParams: URLSearchParams;\n\n if (url) {\n // Server-side: extract search params from provided URL or Request\n if (url instanceof Request) {\n searchParams = new URL(url.url).searchParams;\n } else {\n searchParams = new URL(url).searchParams;\n }\n } else {\n // Client-side: use window.location\n if (typeof window === 'undefined') {\n return null;\n }\n searchParams = new URLSearchParams(window.location.search);\n }\n\n return searchParams.get('mode');\n};\n\n/**\n * Check if design mode is active\n * @param url - Optional URL string or Request object for server-side usage\n * @returns True if mode=EDIT is present in URL\n */\nexport const isDesignModeActive = (url?: string | URL | Request): boolean => getUrlMode(url) === 'EDIT';\n\n/**\n * Check if preview mode is active\n * @param url - Optional URL string or Request object for server-side usage\n * @returns True if mode=PREVIEW is present in URL\n */\nexport const isPreviewModeActive = (url?: string | URL | Request): boolean => getUrlMode(url) === 'PREVIEW';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,cAAc,QAAgD;CACvE,IAAIA;AAEJ,KAAI,IAEA,KAAI,eAAe,QACf,gBAAe,IAAI,IAAI,IAAI,IAAI,CAAC;KAEhC,gBAAe,IAAI,IAAI,IAAI,CAAC;MAE7B;AAEH,MAAI,OAAO,WAAW,YAClB,QAAO;AAEX,iBAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;;AAG9D,QAAO,aAAa,IAAI,OAAO;;;;;;;AAQnC,MAAa,sBAAsB,QAA0C,WAAW,IAAI,KAAK;;;;;;AAOjG,MAAa,uBAAuB,QAA0C,WAAW,IAAI,KAAK"}
1
+ {"version":3,"file":"modeDetection.js","names":["searchParams: URLSearchParams"],"sources":["../src/design/modeDetection.ts"],"sourcesContent":["/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Utility functions for detecting active design/preview modes\n */\n\nexport type PageDesignerMode = 'EDIT' | 'PREVIEW';\n\n/**\n * Get the mode parameter from URL search params\n * @param url - Optional URL string or Request object for server-side usage. If not provided, uses window.location on client-side\n * @returns The mode parameter value or null if not found\n */\nexport const getUrlMode = (url?: string | URL | Request): PageDesignerMode | null => {\n let searchParams: URLSearchParams;\n\n if (url) {\n // Server-side: extract search params from provided URL or Request\n if (url instanceof Request) {\n searchParams = new URL(url.url).searchParams;\n } else {\n searchParams = new URL(url).searchParams;\n }\n } else {\n // Client-side: use window.location\n if (typeof window === 'undefined') {\n return null;\n }\n searchParams = new URLSearchParams(window.location.search);\n }\n\n return searchParams.get('mode') as PageDesignerMode | null;\n};\n\n/**\n * Check if design mode is active\n * @param url - Optional URL string or Request object for server-side usage\n * @returns True if mode=EDIT is present in URL\n */\nexport const isDesignModeActive = (url?: string | URL | Request): boolean => getUrlMode(url) === 'EDIT';\n\n/**\n * Check if preview mode is active\n * @param url - Optional URL string or Request object for server-side usage\n * @returns True if mode=PREVIEW is present in URL\n */\nexport const isPreviewModeActive = (url?: string | URL | Request): boolean => getUrlMode(url) === 'PREVIEW';\n"],"mappings":";;;;;;AA2BA,MAAa,cAAc,QAA0D;CACjF,IAAIA;AAEJ,KAAI,IAEA,KAAI,eAAe,QACf,gBAAe,IAAI,IAAI,IAAI,IAAI,CAAC;KAEhC,gBAAe,IAAI,IAAI,IAAI,CAAC;MAE7B;AAEH,MAAI,OAAO,WAAW,YAClB,QAAO;AAEX,iBAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;;AAG9D,QAAO,aAAa,IAAI,OAAO;;;;;;;AAQnC,MAAa,sBAAsB,QAA0C,WAAW,IAAI,KAAK;;;;;;AAOjG,MAAa,uBAAuB,QAA0C,WAAW,IAAI,KAAK"}