@wix/headless-site 1.26.0 → 1.28.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.
- package/dist/cjs/host-module.js +3 -1
- package/dist/cjs/host-module.js.map +1 -1
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/host-module.js +3 -1
- package/dist/esm/host-module.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/types/host-module.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +11 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/cjs/host-module.js
CHANGED
|
@@ -49,12 +49,14 @@ const createHostModule = () => {
|
|
|
49
49
|
}, {
|
|
50
50
|
reportErrorsToBI: false
|
|
51
51
|
});
|
|
52
|
+
},
|
|
53
|
+
translations: () => {
|
|
54
|
+
return typeof window !== 'undefined' ? window.__wix_translations__ : undefined;
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
|
-
|
|
58
60
|
// Normalize essentials by merging with window.essentials, handling property name differences
|
|
59
61
|
// Use a function to maintain reactivity to window.essentials changes
|
|
60
62
|
exports.createHostModule = createHostModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_monitoringVelo","require","_headers","_authUtils","_fetchUtils","_multilingualUtils","createHostModule","__type","create","host","essentials","passThroughHeaders","currentLanguage","getCurrentLanguage","getNormalizedEssentials","currentLocale","getCurrentLocale","getPassThroughHeaders","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","createVeloMonitoringClient","namespace","getAuthToken","resolveAuthToken","fetch","contextualFetch","reportErrorsToBI","exports","_window$essentials","_window$essentials2","_window$essentials3","_window$essentials4","_window$essentials5","
|
|
1
|
+
{"version":3,"names":["_monitoringVelo","require","_headers","_authUtils","_fetchUtils","_multilingualUtils","createHostModule","__type","create","host","essentials","passThroughHeaders","currentLanguage","getCurrentLanguage","getNormalizedEssentials","currentLocale","getCurrentLocale","getPassThroughHeaders","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","createVeloMonitoringClient","namespace","getAuthToken","resolveAuthToken","fetch","contextualFetch","reportErrorsToBI","translations","window","__wix_translations__","undefined","exports","_window$essentials","_window$essentials2","_window$essentials3","_window$essentials4","_window$essentials5","timeZone","multilingual"],"sources":["../../src/host-module.ts"],"sourcesContent":["import type { HostModule, Host } from '@wix/sdk-types';\nimport { createVeloMonitoringClient } from '@wix/monitoring-velo';\nimport { getPassThroughHeaders } from './headers';\nimport { resolveAuthToken } from './utils/auth-utils';\nimport { contextualFetch } from './utils/fetch-utils';\nimport type { Essentials, SDK, SDKOptions } from './types';\nimport {\n getCurrentLocale,\n getCurrentLanguage,\n} from './utils/multilingual-utils';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: (options: SDKOptions) => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n const currentLanguage = getCurrentLanguage(\n getNormalizedEssentials(essentials),\n );\n const currentLocale = getCurrentLocale(\n getNormalizedEssentials(essentials),\n );\n\n return getPassThroughHeaders(currentLocale, currentLanguage);\n },\n get language() {\n return getCurrentLanguage(getNormalizedEssentials(essentials));\n },\n get locale() {\n return getCurrentLocale(getNormalizedEssentials(essentials));\n },\n get timezone() {\n return getNormalizedEssentials(essentials).timezone ?? 'UTC';\n },\n },\n getMonitoringClient: () => {\n let producer = 'unknown';\n let req: Request | undefined;\n\n if (typeof document !== 'undefined') {\n producer = document.location.href;\n req = new Request(document.location.href);\n }\n\n return createVeloMonitoringClient(\n {\n req,\n namespace: 'Headless',\n producer,\n getAuthToken: async () => resolveAuthToken(),\n fetch: contextualFetch as typeof fetch,\n },\n { reportErrorsToBI: false },\n );\n },\n translations: () => {\n return typeof window !== 'undefined'\n ? window.__wix_translations__\n : undefined;\n },\n };\n },\n };\n};\n// Normalize essentials by merging with window.essentials, handling property name differences\n// Use a function to maintain reactivity to window.essentials changes\nconst getNormalizedEssentials = (essentials?: Essentials): Essentials => ({\n ...essentials,\n ...(typeof window !== 'undefined' ? window.essentials : {}),\n language:\n essentials?.language ??\n (typeof window !== 'undefined' ? window.essentials?.language : undefined) ??\n 'en',\n locale:\n essentials?.locale ??\n (typeof window !== 'undefined' ? window.essentials?.locale : undefined),\n timezone:\n essentials?.timezone ??\n (typeof window !== 'undefined'\n ? // @ts-expect-error\n window.essentials?.timeZone ?? window.essentials?.timezone\n : undefined),\n multilingual:\n essentials?.multilingual ??\n (typeof window !== 'undefined'\n ? window.essentials?.multilingual\n : undefined),\n});\n"],"mappings":";;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AAKO,MAAMK,gBAAgB,GAAGA,CAAA,KAE3B;EACH,OAAO;IACLC,MAAM,EAAE,MAAM;IACdC,MAAM,EAAEA,CAAA,KAAM;MACZ,OAAO,CAAC,CAAC;IACX,CAAC;IACDC,IAAI,EAAEA,CAAC;MAAEC;IAAuB,CAAC,GAAG,CAAC,CAAC,KAAK;MACzC,OAAO;QACLA,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,MAAMC,eAAe,GAAG,IAAAC,qCAAkB,EACxCC,uBAAuB,CAACJ,UAAU,CACpC,CAAC;YACD,MAAMK,aAAa,GAAG,IAAAC,mCAAgB,EACpCF,uBAAuB,CAACJ,UAAU,CACpC,CAAC;YAED,OAAO,IAAAO,8BAAqB,EAACF,aAAa,EAAEH,eAAe,CAAC;UAC9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,KAAK,WAAW,GAAGA,MAAM,CAAC1B,UAAU,GAAG,CAAC,CAAC,CAAC;IAC3DQ,QAAQ,EACN,CAAAR,UAAU,oBAAVA,UAAU,CAAEQ,QAAQ,MACnB,OAAOkB,MAAM,KAAK,WAAW,IAAAI,kBAAA,GAAGJ,MAAM,CAAC1B,UAAU,qBAAjB8B,kBAAA,CAAmBtB,QAAQ,GAAGoB,SAAS,CAAC,IACzE,IAAI;IACNnB,MAAM,EACJ,CAAAT,UAAU,oBAAVA,UAAU,CAAES,MAAM,MACjB,OAAOiB,MAAM,KAAK,WAAW,IAAAK,mBAAA,GAAGL,MAAM,CAAC1B,UAAU,qBAAjB+B,mBAAA,CAAmBtB,MAAM,GAAGmB,SAAS,CAAC;IACzElB,QAAQ,EACN,CAAAV,UAAU,oBAAVA,UAAU,CAAEU,QAAQ,MACnB,OAAOgB,MAAM,KAAK,WAAW;IAC1B;IACA,EAAAM,mBAAA,GAAAN,MAAM,CAAC1B,UAAU,qBAAjBgC,mBAAA,CAAmBG,QAAQ,OAAAF,mBAAA,GAAIP,MAAM,CAAC1B,UAAU,qBAAjBiC,mBAAA,CAAmBvB,QAAQ,IAC1DkB,SAAS,CAAC;IAChBQ,YAAY,EACV,CAAApC,UAAU,oBAAVA,UAAU,CAAEoC,YAAY,MACvB,OAAOV,MAAM,KAAK,WAAW,IAAAQ,mBAAA,GAC1BR,MAAM,CAAC1B,UAAU,qBAAjBkC,mBAAA,CAAmBE,YAAY,GAC/BR,SAAS;EACjB,CAAC;AAAA,CAAC","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,9 +3,5 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.headlessSite = void 0;
|
|
5
5
|
var _hostModule = require("./host-module");
|
|
6
|
-
var _types = require("./types");
|
|
7
|
-
exports.Multilingual = _types.Multilingual;
|
|
8
|
-
exports.Essentials = _types.Essentials;
|
|
9
|
-
exports.SDKOptions = _types.SDKOptions;
|
|
10
6
|
const headlessSite = exports.headlessSite = (0, _hostModule.createHostModule)();
|
|
11
7
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hostModule","require","
|
|
1
|
+
{"version":3,"names":["_hostModule","require","headlessSite","exports","createHostModule"],"sources":["../../src/index.ts"],"sourcesContent":["import { createHostModule } from './host-module';\n\nexport const headlessSite = createHostModule();\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,4BAAgB,EAAC,CAAC","ignoreList":[]}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResolutionMethod","exports"],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n}\n\nexport interface Multilingual {\n autoRedirect?: boolean;\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n countryCode?: string;\n isPrimary?: boolean;\n isVisitorPrimary?: boolean;\n languageCode?: string;\n locale?: Locale;\n resolutionMethod?: ResolutionMethod;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\nexport interface Locale {\n languageCode?: string;\n country?: string;\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"names":["ResolutionMethod","exports"],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\nexport interface WixSiteGlobalThisMetadata {\n multilingual?: Multilingual;\n}\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n };\n __wix_site_metadata__?: WixSiteGlobalThisMetadata;\n __wix_translations__?: {\n [language: string]: {\n [namespace: string]: {\n [key: string]: string;\n };\n };\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n}\n\nexport interface Multilingual {\n autoRedirect?: boolean;\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n countryCode?: string;\n isPrimary?: boolean;\n isVisitorPrimary?: boolean;\n languageCode?: string;\n locale?: Locale;\n resolutionMethod?: ResolutionMethod;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\nexport interface Locale {\n languageCode?: string;\n country?: string;\n}\n"],"mappings":";;;;IAkDYA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA","ignoreList":[]}
|
package/dist/esm/host-module.js
CHANGED
|
@@ -46,12 +46,14 @@ export const createHostModule = () => {
|
|
|
46
46
|
}, {
|
|
47
47
|
reportErrorsToBI: false
|
|
48
48
|
});
|
|
49
|
+
},
|
|
50
|
+
translations: () => {
|
|
51
|
+
return typeof window !== 'undefined' ? window.__wix_translations__ : undefined;
|
|
49
52
|
}
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
|
-
|
|
55
57
|
// Normalize essentials by merging with window.essentials, handling property name differences
|
|
56
58
|
// Use a function to maintain reactivity to window.essentials changes
|
|
57
59
|
const getNormalizedEssentials = essentials => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","contextualFetch","getCurrentLocale","getCurrentLanguage","createHostModule","__type","create","host","_temp","essentials","passThroughHeaders","currentLanguage","getNormalizedEssentials","currentLocale","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","namespace","getAuthToken","fetch","reportErrorsToBI","_window$essentials","_window$essentials2","_window$essentials3","_window$essentials4","_window$essentials5","
|
|
1
|
+
{"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","contextualFetch","getCurrentLocale","getCurrentLanguage","createHostModule","__type","create","host","_temp","essentials","passThroughHeaders","currentLanguage","getNormalizedEssentials","currentLocale","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","namespace","getAuthToken","fetch","reportErrorsToBI","translations","window","__wix_translations__","undefined","_window$essentials","_window$essentials2","_window$essentials3","_window$essentials4","_window$essentials5","timeZone","multilingual"],"sources":["../../src/host-module.ts"],"sourcesContent":["import type { HostModule, Host } from '@wix/sdk-types';\nimport { createVeloMonitoringClient } from '@wix/monitoring-velo';\nimport { getPassThroughHeaders } from './headers';\nimport { resolveAuthToken } from './utils/auth-utils';\nimport { contextualFetch } from './utils/fetch-utils';\nimport type { Essentials, SDK, SDKOptions } from './types';\nimport {\n getCurrentLocale,\n getCurrentLanguage,\n} from './utils/multilingual-utils';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: (options: SDKOptions) => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n const currentLanguage = getCurrentLanguage(\n getNormalizedEssentials(essentials),\n );\n const currentLocale = getCurrentLocale(\n getNormalizedEssentials(essentials),\n );\n\n return getPassThroughHeaders(currentLocale, currentLanguage);\n },\n get language() {\n return getCurrentLanguage(getNormalizedEssentials(essentials));\n },\n get locale() {\n return getCurrentLocale(getNormalizedEssentials(essentials));\n },\n get timezone() {\n return getNormalizedEssentials(essentials).timezone ?? 'UTC';\n },\n },\n getMonitoringClient: () => {\n let producer = 'unknown';\n let req: Request | undefined;\n\n if (typeof document !== 'undefined') {\n producer = document.location.href;\n req = new Request(document.location.href);\n }\n\n return createVeloMonitoringClient(\n {\n req,\n namespace: 'Headless',\n producer,\n getAuthToken: async () => resolveAuthToken(),\n fetch: contextualFetch as typeof fetch,\n },\n { reportErrorsToBI: false },\n );\n },\n translations: () => {\n return typeof window !== 'undefined'\n ? window.__wix_translations__\n : undefined;\n },\n };\n },\n };\n};\n// Normalize essentials by merging with window.essentials, handling property name differences\n// Use a function to maintain reactivity to window.essentials changes\nconst getNormalizedEssentials = (essentials?: Essentials): Essentials => ({\n ...essentials,\n ...(typeof window !== 'undefined' ? window.essentials : {}),\n language:\n essentials?.language ??\n (typeof window !== 'undefined' ? window.essentials?.language : undefined) ??\n 'en',\n locale:\n essentials?.locale ??\n (typeof window !== 'undefined' ? window.essentials?.locale : undefined),\n timezone:\n essentials?.timezone ??\n (typeof window !== 'undefined'\n ? // @ts-expect-error\n window.essentials?.timeZone ?? window.essentials?.timezone\n : undefined),\n multilingual:\n essentials?.multilingual ??\n (typeof window !== 'undefined'\n ? window.essentials?.multilingual\n : undefined),\n});\n"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,qBAAqB;AAErD,SACEC,gBAAgB,EAChBC,kBAAkB,QACb,4BAA4B;AAEnC,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAE3B;EACH,OAAO;IACLC,MAAM,EAAE,MAAM;IACdC,MAAM,EAAEA,CAAA,KAAM;MACZ,OAAO,CAAC,CAAC;IACX,CAAC;IACDC,IAAI,EAAE,SAAAA,CAAAC,KAAA,EAAqC;MAAA,IAApC;QAAEC;MAAuB,CAAC,GAAAD,KAAA,cAAG,CAAC,CAAC,GAAAA,KAAA;MACpC,OAAO;QACLC,UAAU,EAA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
{"version":3,"names":["createHostModule","headlessSite"],"sources":["../../src/index.ts"],"sourcesContent":["import { createHostModule } from './host-module';\n\nexport const headlessSite = createHostModule();\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,eAAe;AAEhD,OAAO,MAAMC,YAAY,GAAGD,gBAAgB,CAAC,CAAC","ignoreList":[]}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResolutionMethod"],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n}\n\nexport interface Multilingual {\n autoRedirect?: boolean;\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n countryCode?: string;\n isPrimary?: boolean;\n isVisitorPrimary?: boolean;\n languageCode?: string;\n locale?: Locale;\n resolutionMethod?: ResolutionMethod;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\nexport interface Locale {\n languageCode?: string;\n country?: string;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ResolutionMethod"],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\nexport interface WixSiteGlobalThisMetadata {\n multilingual?: Multilingual;\n}\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n };\n __wix_site_metadata__?: WixSiteGlobalThisMetadata;\n __wix_translations__?: {\n [language: string]: {\n [namespace: string]: {\n [key: string]: string;\n };\n };\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n multilingual?: Multilingual;\n}\n\nexport interface Multilingual {\n autoRedirect?: boolean;\n supportedLanguages?: SupportedLanguage[];\n}\n\nexport interface SupportedLanguage {\n countryCode?: string;\n isPrimary?: boolean;\n isVisitorPrimary?: boolean;\n languageCode?: string;\n locale?: Locale;\n resolutionMethod?: ResolutionMethod;\n}\n\nexport enum ResolutionMethod {\n QUERY_PARAM = 'QUERY_PARAM',\n SUBDOMAIN = 'SUBDOMAIN',\n SUBDIRECTORY = 'SUBDIRECTORY',\n}\n\nexport interface Locale {\n languageCode?: string;\n country?: string;\n}\n"],"mappings":"AAkDA,WAAYA,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-module.d.ts","sourceRoot":"","sources":["../../src/host-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAKvD,OAAO,KAAK,EAAc,GAAG,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM3D,eAAO,MAAM,gBAAgB;oBACX,UAAU,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"host-module.d.ts","sourceRoot":"","sources":["../../src/host-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAKvD,OAAO,KAAK,EAAc,GAAG,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM3D,eAAO,MAAM,gBAAgB;oBACX,UAAU,KAAK,IAAI;CA0DpC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Multilingual, Essentials, SDKOptions } from './types';
|
|
2
1
|
export declare const headlessSite: import("@wix/sdk-types").HostModule<import("./types").SDK, import("@wix/sdk-types").Host<unknown>> & {
|
|
3
|
-
host: (options: SDKOptions) => import("@wix/sdk-types").Host<unknown>;
|
|
2
|
+
host: (options: import("./types").SDKOptions) => import("@wix/sdk-types").Host<unknown>;
|
|
4
3
|
};
|
|
5
|
-
export { Multilingual, Essentials, SDKOptions };
|
|
6
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;CAAqB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare type SDK = {};
|
|
2
|
+
export interface WixSiteGlobalThisMetadata {
|
|
3
|
+
multilingual?: Multilingual;
|
|
4
|
+
}
|
|
2
5
|
declare global {
|
|
3
6
|
interface Window {
|
|
4
7
|
essentials: {
|
|
@@ -7,6 +10,14 @@ declare global {
|
|
|
7
10
|
timezone?: string;
|
|
8
11
|
multilingual?: Multilingual;
|
|
9
12
|
};
|
|
13
|
+
__wix_site_metadata__?: WixSiteGlobalThisMetadata;
|
|
14
|
+
__wix_translations__?: {
|
|
15
|
+
[language: string]: {
|
|
16
|
+
[namespace: string]: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
10
21
|
}
|
|
11
22
|
}
|
|
12
23
|
export interface SDKOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG,GAAG,EAAE,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,CAAC;YACjB,MAAM,C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|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"unpkg": true,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@wix/jest-yoshi-preset": "^6.131.0",
|
|
48
48
|
"@wix/redirects": "^1.0.106",
|
|
49
49
|
"@wix/sdk": "^1.15.27",
|
|
50
|
-
"@wix/sdk-types": "^1.
|
|
50
|
+
"@wix/sdk-types": "^1.17.0",
|
|
51
51
|
"@wix/yoshi-flow-library": "^6.141.0",
|
|
52
52
|
"chance": "^1.1.13",
|
|
53
53
|
"husky": "^4.2.1",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"wallaby": {
|
|
89
89
|
"autoDetect": true
|
|
90
90
|
},
|
|
91
|
-
"falconPackageHash": "
|
|
91
|
+
"falconPackageHash": "5728f5ac162d2190fbc32afc11b188dd3791517a6327e685a6051342"
|
|
92
92
|
}
|