@descope/sdk-mixins 0.29.0 → 0.30.1
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/mixins/localeMixin/localeMixin.js +1 -1
- package/dist/cjs/mixins/localeMixin/localeMixin.js.map +1 -1
- package/dist/cjs/mixins/widgetConfigMixin/widgetConfigMixin.js +14 -0
- package/dist/cjs/mixins/widgetConfigMixin/widgetConfigMixin.js.map +1 -1
- package/dist/esm/mixins/localeMixin/localeMixin.js +1 -1
- package/dist/esm/mixins/localeMixin/localeMixin.js.map +1 -1
- package/dist/esm/mixins/widgetConfigMixin/widgetConfigMixin.js +14 -0
- package/dist/esm/mixins/widgetConfigMixin/widgetConfigMixin.js.map +1 -1
- package/dist/index.d.ts +331 -318
- package/dist/types/mixins/componentsConditionsMixin/componentsConditionsMixin.d.ts +9 -9
- package/dist/types/mixins/configMixin/configMixin.d.ts +14 -14
- package/dist/types/mixins/configMixin/types.d.ts +2 -0
- package/dist/types/mixins/createStateManagementMixin.d.ts +2 -2
- package/dist/types/mixins/createValidateAttributesMixin/createValidateAttributesMixin.d.ts +5 -5
- package/dist/types/mixins/cspNonceMixin.d.ts +5 -5
- package/dist/types/mixins/debuggerMixin/debugger-wc.d.ts +5 -5
- package/dist/types/mixins/debuggerMixin/debuggerMixin.d.ts +8 -8
- package/dist/types/mixins/descopeUiMixin/descopeUiMixin.d.ts +19 -19
- package/dist/types/mixins/fetchWidgetPagesMixin/createFetchWidgetPagesMixin.d.ts +16 -15
- package/dist/types/mixins/flowIdMixin.d.ts +5 -5
- package/dist/types/mixins/flowInputMixin/flowInputMixin.d.ts +42 -42
- package/dist/types/mixins/flowModalMixin/flowModalMixin.d.ts +25 -25
- package/dist/types/mixins/formMixin.d.ts +2 -2
- package/dist/types/mixins/initElementMixin.d.ts +5 -5
- package/dist/types/mixins/initLifecycleMixin.d.ts +1 -1
- package/dist/types/mixins/injectNpmLibMixin/injectNpmLibMixin.d.ts +2 -2
- package/dist/types/mixins/injectStyleMixin.d.ts +5 -5
- package/dist/types/mixins/localeMixin/localeMixin.d.ts +1 -1
- package/dist/types/mixins/loggerMixin/loggerMixin.d.ts +2 -2
- package/dist/types/mixins/modalMixin/modalMixin.d.ts +25 -25
- package/dist/types/mixins/notificationsMixin/notificationsMixin.d.ts +23 -23
- package/dist/types/mixins/observeAttributesMixin/observeAttributesMixin.d.ts +4 -4
- package/dist/types/mixins/projectIdMixin.d.ts +5 -5
- package/dist/types/mixins/resetMixin.d.ts +6 -6
- package/dist/types/mixins/staticResourcesMixin/staticResourcesMixin.d.ts +10 -10
- package/dist/types/mixins/telemetryMixin/telemetryMixin.d.ts +24 -24
- package/dist/types/mixins/tenantIdMixin.d.ts +5 -5
- package/dist/types/mixins/themeMixin/themeMixin.d.ts +41 -41
- package/dist/types/mixins/widgetConfigMixin/widgetConfigMixin.d.ts +24 -14
- package/dist/types/mixins/widgetIdMixin.d.ts +5 -5
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ var sdkHelpers = require('@descope/sdk-helpers');
|
|
|
9
9
|
* theme/styleId), so callers can pass it straight to setAttribute without emitting "undefined".
|
|
10
10
|
* - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved
|
|
11
11
|
* locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the
|
|
12
|
-
* web-component
|
|
12
|
+
* order of getUserLocale (also used by the web-component). Falls back to navigator.language.
|
|
13
13
|
* - `firstAvailableLocale(availableLocales)` returns the most-specific candidate that the consumer
|
|
14
14
|
* actually publishes (e.g. a widget's config.json targetLocales), or '' when none match.
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeMixin.js","sources":["../../../../src/mixins/localeMixin/localeMixin.ts"],"sourcesContent":["import { createSingletonMixin, getUserLocale } from '@descope/sdk-helpers';\n\n/**\n * Exposes the widget's locale to mixins that need it (HTML fetching, flow propagation).\n * Mirrors web-component's BaseDescopeWc locale handling:\n * - `locale` getter returns the raw attribute value, defaulting to '' when unset (like themeMixin's\n * theme/styleId), so callers can pass it straight to setAttribute without emitting \"undefined\".\n * - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved\n * locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the\n * web-component
|
|
1
|
+
{"version":3,"file":"localeMixin.js","sources":["../../../../src/mixins/localeMixin/localeMixin.ts"],"sourcesContent":["import { createSingletonMixin, getUserLocale } from '@descope/sdk-helpers';\n\n/**\n * Exposes the widget's locale to mixins that need it (HTML fetching, flow propagation).\n * Mirrors web-component's BaseDescopeWc locale handling:\n * - `locale` getter returns the raw attribute value, defaulting to '' when unset (like themeMixin's\n * theme/styleId), so callers can pass it straight to setAttribute without emitting \"undefined\".\n * - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved\n * locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the\n * order of getUserLocale (also used by the web-component). Falls back to navigator.language.\n * - `firstAvailableLocale(availableLocales)` returns the most-specific candidate that the consumer\n * actually publishes (e.g. a widget's config.json targetLocales), or '' when none match.\n */\nexport const localeMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) =>\n class LocaleMixinClass extends superclass {\n get locale(): string {\n return this.getAttribute('locale') || '';\n }\n\n get localeCandidates(): string[] {\n const { locale, fallback } = getUserLocale(this.locale);\n return [...new Set([locale, fallback].filter(Boolean))];\n }\n\n firstAvailableLocale(availableLocales: string[]): string {\n const available = (availableLocales ?? []).map((l) => l.toLowerCase());\n // localeCandidates are already lowercased, most-specific first.\n return this.localeCandidates.find((c) => available.includes(c)) ?? '';\n }\n },\n);\n"],"names":["createSingletonMixin","getUserLocale"],"mappings":";;;;AAEA;;;;;;;;;;AAUG;AACI,MAAM,WAAW,GAAGA,+BAAoB,CAC7C,CAAqC,UAAa,KAChD,MAAM,gBAAiB,SAAQ,UAAU,CAAA;AACvC,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE;IAC1C;AAEA,IAAA,IAAI,gBAAgB,GAAA;AAClB,QAAA,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAGC,wBAAa,CAAC,IAAI,CAAC,MAAM,CAAC;AACvD,QAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD;AAEA,IAAA,oBAAoB,CAAC,gBAA0B,EAAA;;QAC7C,MAAM,SAAS,GAAG,CAAC,gBAAgB,KAAA,IAAA,IAAhB,gBAAgB,KAAA,MAAA,GAAhB,gBAAgB,GAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;;QAEtE,OAAO,CAAA,EAAA,GAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE;IACvE;AACD,CAAA;;;;"}
|
|
@@ -20,6 +20,20 @@ const widgetConfigMixin = sdkHelpers.createSingletonMixin((superclass) => {
|
|
|
20
20
|
const config = await this.config;
|
|
21
21
|
return (_b = (_a = config === null || config === void 0 ? void 0 : config.projectConfig) === null || _a === void 0 ? void 0 : _a.widgets) === null || _b === void 0 ? void 0 : _b[this.widgetId];
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Base url of the project's hosted auth page, or undefined.
|
|
25
|
+
*
|
|
26
|
+
* Project-level rather than per-widget, because the auth domain belongs to
|
|
27
|
+
* the project. Undefined when the project has no custom domain of its own:
|
|
28
|
+
* the backend omits it rather than publishing the shared Descope host,
|
|
29
|
+
* since that would make a passkey's relying party a host shared across
|
|
30
|
+
* customers. So undefined means popup mode is not available.
|
|
31
|
+
*/
|
|
32
|
+
async getHostedPageBaseUrl() {
|
|
33
|
+
var _a;
|
|
34
|
+
const config = await this.config;
|
|
35
|
+
return (_a = config === null || config === void 0 ? void 0 : config.projectConfig) === null || _a === void 0 ? void 0 : _a.hostedPageBaseUrl;
|
|
36
|
+
}
|
|
23
37
|
};
|
|
24
38
|
});
|
|
25
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetConfigMixin.js","sources":["../../../../src/mixins/widgetConfigMixin/widgetConfigMixin.ts"],"sourcesContent":["import { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { configMixin } from '../configMixin';\nimport { WidgetConfig } from '../configMixin/types';\nimport { widgetIdMixin } from '../widgetIdMixin';\n\nexport const widgetConfigMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(configMixin, widgetIdMixin)(superclass);\n\n return class WidgetConfigMixinClass extends BaseClass {\n // Required: without this empty override, TS infers `init` on the composed\n // base as a property (intersection of identical signatures from multiple\n // mixin paths), and any downstream class declaring `async init()` as a\n // method fails TS2425.\n async init() {\n await super.init?.();\n }\n\n async getWidgetConfig(): Promise<WidgetConfig | undefined> {\n const config = await this.config;\n return config?.projectConfig?.widgets?.[this.widgetId];\n }\n };\n },\n);\n"],"names":["createSingletonMixin","compose","configMixin","widgetIdMixin"],"mappings":";;;;;;MAKa,iBAAiB,GAAGA,+BAAoB,CACnD,CAAqC,UAAa,KAAI;IACpD,MAAM,SAAS,GAAGC,kBAAO,CAACC,uBAAW,EAAEC,2BAAa,CAAC,CAAC,UAAU,CAAC;IAEjE,OAAO,MAAM,sBAAuB,SAAQ,SAAS,CAAA;;;;;AAKnD,QAAA,MAAM,IAAI,GAAA;;AACR,YAAA,OAAM,CAAA,EAAA,GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,CAAA,IAAA,CAAI,CAAA;QACtB;AAEA,QAAA,MAAM,eAAe,GAAA;;AACnB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;AAChC,YAAA,OAAO,MAAA,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAG,IAAI,CAAC,QAAQ,CAAC;QACxD;KACD;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"widgetConfigMixin.js","sources":["../../../../src/mixins/widgetConfigMixin/widgetConfigMixin.ts"],"sourcesContent":["import { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { configMixin } from '../configMixin';\nimport { WidgetConfig } from '../configMixin/types';\nimport { widgetIdMixin } from '../widgetIdMixin';\n\nexport const widgetConfigMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(configMixin, widgetIdMixin)(superclass);\n\n return class WidgetConfigMixinClass extends BaseClass {\n // Required: without this empty override, TS infers `init` on the composed\n // base as a property (intersection of identical signatures from multiple\n // mixin paths), and any downstream class declaring `async init()` as a\n // method fails TS2425.\n async init() {\n await super.init?.();\n }\n\n async getWidgetConfig(): Promise<WidgetConfig | undefined> {\n const config = await this.config;\n return config?.projectConfig?.widgets?.[this.widgetId];\n }\n\n /**\n * Base url of the project's hosted auth page, or undefined.\n *\n * Project-level rather than per-widget, because the auth domain belongs to\n * the project. Undefined when the project has no custom domain of its own:\n * the backend omits it rather than publishing the shared Descope host,\n * since that would make a passkey's relying party a host shared across\n * customers. So undefined means popup mode is not available.\n */\n async getHostedPageBaseUrl(): Promise<string | undefined> {\n const config = await this.config;\n return config?.projectConfig?.hostedPageBaseUrl;\n }\n };\n },\n);\n"],"names":["createSingletonMixin","compose","configMixin","widgetIdMixin"],"mappings":";;;;;;MAKa,iBAAiB,GAAGA,+BAAoB,CACnD,CAAqC,UAAa,KAAI;IACpD,MAAM,SAAS,GAAGC,kBAAO,CAACC,uBAAW,EAAEC,2BAAa,CAAC,CAAC,UAAU,CAAC;IAEjE,OAAO,MAAM,sBAAuB,SAAQ,SAAS,CAAA;;;;;AAKnD,QAAA,MAAM,IAAI,GAAA;;AACR,YAAA,OAAM,CAAA,EAAA,GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,CAAA,IAAA,CAAI,CAAA;QACtB;AAEA,QAAA,MAAM,eAAe,GAAA;;AACnB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;AAChC,YAAA,OAAO,MAAA,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAG,IAAI,CAAC,QAAQ,CAAC;QACxD;AAEA;;;;;;;;AAQG;AACH,QAAA,MAAM,oBAAoB,GAAA;;AACxB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;YAChC,OAAO,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,iBAAiB;QACjD;KACD;AACH,CAAC;;;;"}
|
|
@@ -7,7 +7,7 @@ import { createSingletonMixin, getUserLocale } from '@descope/sdk-helpers';
|
|
|
7
7
|
* theme/styleId), so callers can pass it straight to setAttribute without emitting "undefined".
|
|
8
8
|
* - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved
|
|
9
9
|
* locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the
|
|
10
|
-
* web-component
|
|
10
|
+
* order of getUserLocale (also used by the web-component). Falls back to navigator.language.
|
|
11
11
|
* - `firstAvailableLocale(availableLocales)` returns the most-specific candidate that the consumer
|
|
12
12
|
* actually publishes (e.g. a widget's config.json targetLocales), or '' when none match.
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeMixin.js","sources":["../../../../src/mixins/localeMixin/localeMixin.ts"],"sourcesContent":["import { createSingletonMixin, getUserLocale } from '@descope/sdk-helpers';\n\n/**\n * Exposes the widget's locale to mixins that need it (HTML fetching, flow propagation).\n * Mirrors web-component's BaseDescopeWc locale handling:\n * - `locale` getter returns the raw attribute value, defaulting to '' when unset (like themeMixin's\n * theme/styleId), so callers can pass it straight to setAttribute without emitting \"undefined\".\n * - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved\n * locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the\n * web-component
|
|
1
|
+
{"version":3,"file":"localeMixin.js","sources":["../../../../src/mixins/localeMixin/localeMixin.ts"],"sourcesContent":["import { createSingletonMixin, getUserLocale } from '@descope/sdk-helpers';\n\n/**\n * Exposes the widget's locale to mixins that need it (HTML fetching, flow propagation).\n * Mirrors web-component's BaseDescopeWc locale handling:\n * - `locale` getter returns the raw attribute value, defaulting to '' when unset (like themeMixin's\n * theme/styleId), so callers can pass it straight to setAttribute without emitting \"undefined\".\n * - `localeCandidates` returns the lowercased locales to try, most-specific first: the resolved\n * locale and then its language-only fallback (e.g. 'en-us' then 'en'), matching the\n * order of getUserLocale (also used by the web-component). Falls back to navigator.language.\n * - `firstAvailableLocale(availableLocales)` returns the most-specific candidate that the consumer\n * actually publishes (e.g. a widget's config.json targetLocales), or '' when none match.\n */\nexport const localeMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) =>\n class LocaleMixinClass extends superclass {\n get locale(): string {\n return this.getAttribute('locale') || '';\n }\n\n get localeCandidates(): string[] {\n const { locale, fallback } = getUserLocale(this.locale);\n return [...new Set([locale, fallback].filter(Boolean))];\n }\n\n firstAvailableLocale(availableLocales: string[]): string {\n const available = (availableLocales ?? []).map((l) => l.toLowerCase());\n // localeCandidates are already lowercased, most-specific first.\n return this.localeCandidates.find((c) => available.includes(c)) ?? '';\n }\n },\n);\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;AAUG;AACI,MAAM,WAAW,GAAG,oBAAoB,CAC7C,CAAqC,UAAa,KAChD,MAAM,gBAAiB,SAAQ,UAAU,CAAA;AACvC,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE;IAC1C;AAEA,IAAA,IAAI,gBAAgB,GAAA;AAClB,QAAA,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;AACvD,QAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD;AAEA,IAAA,oBAAoB,CAAC,gBAA0B,EAAA;;QAC7C,MAAM,SAAS,GAAG,CAAC,gBAAgB,KAAA,IAAA,IAAhB,gBAAgB,KAAA,MAAA,GAAhB,gBAAgB,GAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;;QAEtE,OAAO,CAAA,EAAA,GAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE;IACvE;AACD,CAAA;;;;"}
|
|
@@ -18,6 +18,20 @@ const widgetConfigMixin = createSingletonMixin((superclass) => {
|
|
|
18
18
|
const config = await this.config;
|
|
19
19
|
return (_b = (_a = config === null || config === void 0 ? void 0 : config.projectConfig) === null || _a === void 0 ? void 0 : _a.widgets) === null || _b === void 0 ? void 0 : _b[this.widgetId];
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Base url of the project's hosted auth page, or undefined.
|
|
23
|
+
*
|
|
24
|
+
* Project-level rather than per-widget, because the auth domain belongs to
|
|
25
|
+
* the project. Undefined when the project has no custom domain of its own:
|
|
26
|
+
* the backend omits it rather than publishing the shared Descope host,
|
|
27
|
+
* since that would make a passkey's relying party a host shared across
|
|
28
|
+
* customers. So undefined means popup mode is not available.
|
|
29
|
+
*/
|
|
30
|
+
async getHostedPageBaseUrl() {
|
|
31
|
+
var _a;
|
|
32
|
+
const config = await this.config;
|
|
33
|
+
return (_a = config === null || config === void 0 ? void 0 : config.projectConfig) === null || _a === void 0 ? void 0 : _a.hostedPageBaseUrl;
|
|
34
|
+
}
|
|
21
35
|
};
|
|
22
36
|
});
|
|
23
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetConfigMixin.js","sources":["../../../../src/mixins/widgetConfigMixin/widgetConfigMixin.ts"],"sourcesContent":["import { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { configMixin } from '../configMixin';\nimport { WidgetConfig } from '../configMixin/types';\nimport { widgetIdMixin } from '../widgetIdMixin';\n\nexport const widgetConfigMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(configMixin, widgetIdMixin)(superclass);\n\n return class WidgetConfigMixinClass extends BaseClass {\n // Required: without this empty override, TS infers `init` on the composed\n // base as a property (intersection of identical signatures from multiple\n // mixin paths), and any downstream class declaring `async init()` as a\n // method fails TS2425.\n async init() {\n await super.init?.();\n }\n\n async getWidgetConfig(): Promise<WidgetConfig | undefined> {\n const config = await this.config;\n return config?.projectConfig?.widgets?.[this.widgetId];\n }\n };\n },\n);\n"],"names":[],"mappings":";;;;MAKa,iBAAiB,GAAG,oBAAoB,CACnD,CAAqC,UAAa,KAAI;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,UAAU,CAAC;IAEjE,OAAO,MAAM,sBAAuB,SAAQ,SAAS,CAAA;;;;;AAKnD,QAAA,MAAM,IAAI,GAAA;;AACR,YAAA,OAAM,CAAA,EAAA,GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,CAAA,IAAA,CAAI,CAAA;QACtB;AAEA,QAAA,MAAM,eAAe,GAAA;;AACnB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;AAChC,YAAA,OAAO,MAAA,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAG,IAAI,CAAC,QAAQ,CAAC;QACxD;KACD;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"widgetConfigMixin.js","sources":["../../../../src/mixins/widgetConfigMixin/widgetConfigMixin.ts"],"sourcesContent":["import { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { configMixin } from '../configMixin';\nimport { WidgetConfig } from '../configMixin/types';\nimport { widgetIdMixin } from '../widgetIdMixin';\n\nexport const widgetConfigMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(configMixin, widgetIdMixin)(superclass);\n\n return class WidgetConfigMixinClass extends BaseClass {\n // Required: without this empty override, TS infers `init` on the composed\n // base as a property (intersection of identical signatures from multiple\n // mixin paths), and any downstream class declaring `async init()` as a\n // method fails TS2425.\n async init() {\n await super.init?.();\n }\n\n async getWidgetConfig(): Promise<WidgetConfig | undefined> {\n const config = await this.config;\n return config?.projectConfig?.widgets?.[this.widgetId];\n }\n\n /**\n * Base url of the project's hosted auth page, or undefined.\n *\n * Project-level rather than per-widget, because the auth domain belongs to\n * the project. Undefined when the project has no custom domain of its own:\n * the backend omits it rather than publishing the shared Descope host,\n * since that would make a passkey's relying party a host shared across\n * customers. So undefined means popup mode is not available.\n */\n async getHostedPageBaseUrl(): Promise<string | undefined> {\n const config = await this.config;\n return config?.projectConfig?.hostedPageBaseUrl;\n }\n };\n },\n);\n"],"names":[],"mappings":";;;;MAKa,iBAAiB,GAAG,oBAAoB,CACnD,CAAqC,UAAa,KAAI;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,UAAU,CAAC;IAEjE,OAAO,MAAM,sBAAuB,SAAQ,SAAS,CAAA;;;;;AAKnD,QAAA,MAAM,IAAI,GAAA;;AACR,YAAA,OAAM,CAAA,EAAA,GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,CAAA,IAAA,CAAI,CAAA;QACtB;AAEA,QAAA,MAAM,eAAe,GAAA;;AACnB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;AAChC,YAAA,OAAO,MAAA,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAG,IAAI,CAAC,QAAQ,CAAC;QACxD;AAEA;;;;;;;;AAQG;AACH,QAAA,MAAM,oBAAoB,GAAA;;AACxB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM;YAChC,OAAO,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,iBAAiB;QACjD;KACD;AACH,CAAC;;;;"}
|