@descope/sdk-mixins 0.27.2 → 0.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/mixins/observeAttributesMixin/helpers.js +4 -2
- package/dist/cjs/mixins/observeAttributesMixin/helpers.js.map +1 -1
- package/dist/esm/mixins/observeAttributesMixin/helpers.js +4 -2
- package/dist/esm/mixins/observeAttributesMixin/helpers.js.map +1 -1
- package/dist/index.d.ts +315 -315
- package/dist/types/mixins/componentsConditionsMixin/componentsConditionsMixin.d.ts +9 -9
- package/dist/types/mixins/configMixin/configMixin.d.ts +14 -14
- 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 +15 -15
- package/dist/types/mixins/flowIdMixin.d.ts +5 -5
- package/dist/types/mixins/flowInputMixin/flowInputMixin.d.ts +41 -41
- 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/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 +40 -40
- package/dist/types/mixins/widgetConfigMixin/widgetConfigMixin.d.ts +14 -14
- package/dist/types/mixins/widgetIdMixin.d.ts +5 -5
- package/package.json +1 -1
|
@@ -5,12 +5,14 @@ const attributesObserver = (ele, callback) => {
|
|
|
5
5
|
Array.from(ele.attributes).forEach((attr) => callback(attr.name));
|
|
6
6
|
const observer = new MutationObserver((mutationsList) => {
|
|
7
7
|
mutationsList.forEach((mutation) => {
|
|
8
|
-
|
|
8
|
+
// setAttribute with the current value still emits a mutation, skip it
|
|
9
|
+
if (mutation.type === 'attributes' &&
|
|
10
|
+
mutation.oldValue !== ele.getAttribute(mutation.attributeName)) {
|
|
9
11
|
callback(mutation.attributeName);
|
|
10
12
|
}
|
|
11
13
|
});
|
|
12
14
|
});
|
|
13
|
-
observer.observe(ele, { attributes: true });
|
|
15
|
+
observer.observe(ele, { attributes: true, attributeOldValue: true });
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
exports.attributesObserver = attributesObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/mixins/observeAttributesMixin/helpers.ts"],"sourcesContent":["export const attributesObserver = (\n ele: HTMLElement,\n callback: (attrName: string) => void,\n) => {\n // sync all attrs on init\n Array.from(ele.attributes).forEach((attr) => callback(attr.name));\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'attributes') {\n callback(mutation.attributeName);\n }\n });\n });\n\n observer.observe(ele, { attributes: true });\n};\n"],"names":[],"mappings":";;MAAa,kBAAkB,GAAG,CAChC,GAAgB,EAChB,QAAoC,KAClC;;IAEF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,aAAa,KAAI;AACtD,QAAA,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../src/mixins/observeAttributesMixin/helpers.ts"],"sourcesContent":["export const attributesObserver = (\n ele: HTMLElement,\n callback: (attrName: string) => void,\n) => {\n // sync all attrs on init\n Array.from(ele.attributes).forEach((attr) => callback(attr.name));\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n // setAttribute with the current value still emits a mutation, skip it\n if (\n mutation.type === 'attributes' &&\n mutation.oldValue !== ele.getAttribute(mutation.attributeName)\n ) {\n callback(mutation.attributeName);\n }\n });\n });\n\n observer.observe(ele, { attributes: true, attributeOldValue: true });\n};\n"],"names":[],"mappings":";;MAAa,kBAAkB,GAAG,CAChC,GAAgB,EAChB,QAAoC,KAClC;;IAEF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,aAAa,KAAI;AACtD,QAAA,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;;AAEjC,YAAA,IACE,QAAQ,CAAC,IAAI,KAAK,YAAY;AAC9B,gBAAA,QAAQ,CAAC,QAAQ,KAAK,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAC9D;AACA,gBAAA,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;aAClC;AACH,SAAC,CAAC,CAAC;AACL,KAAC,CAAC,CAAC;AAEH,IAAA,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE;;;;"}
|
|
@@ -3,12 +3,14 @@ const attributesObserver = (ele, callback) => {
|
|
|
3
3
|
Array.from(ele.attributes).forEach((attr) => callback(attr.name));
|
|
4
4
|
const observer = new MutationObserver((mutationsList) => {
|
|
5
5
|
mutationsList.forEach((mutation) => {
|
|
6
|
-
|
|
6
|
+
// setAttribute with the current value still emits a mutation, skip it
|
|
7
|
+
if (mutation.type === 'attributes' &&
|
|
8
|
+
mutation.oldValue !== ele.getAttribute(mutation.attributeName)) {
|
|
7
9
|
callback(mutation.attributeName);
|
|
8
10
|
}
|
|
9
11
|
});
|
|
10
12
|
});
|
|
11
|
-
observer.observe(ele, { attributes: true });
|
|
13
|
+
observer.observe(ele, { attributes: true, attributeOldValue: true });
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export { attributesObserver };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/mixins/observeAttributesMixin/helpers.ts"],"sourcesContent":["export const attributesObserver = (\n ele: HTMLElement,\n callback: (attrName: string) => void,\n) => {\n // sync all attrs on init\n Array.from(ele.attributes).forEach((attr) => callback(attr.name));\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'attributes') {\n callback(mutation.attributeName);\n }\n });\n });\n\n observer.observe(ele, { attributes: true });\n};\n"],"names":[],"mappings":"MAAa,kBAAkB,GAAG,CAChC,GAAgB,EAChB,QAAoC,KAClC;;IAEF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,aAAa,KAAI;AACtD,QAAA,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../src/mixins/observeAttributesMixin/helpers.ts"],"sourcesContent":["export const attributesObserver = (\n ele: HTMLElement,\n callback: (attrName: string) => void,\n) => {\n // sync all attrs on init\n Array.from(ele.attributes).forEach((attr) => callback(attr.name));\n\n const observer = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n // setAttribute with the current value still emits a mutation, skip it\n if (\n mutation.type === 'attributes' &&\n mutation.oldValue !== ele.getAttribute(mutation.attributeName)\n ) {\n callback(mutation.attributeName);\n }\n });\n });\n\n observer.observe(ele, { attributes: true, attributeOldValue: true });\n};\n"],"names":[],"mappings":"MAAa,kBAAkB,GAAG,CAChC,GAAgB,EAChB,QAAoC,KAClC;;IAEF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,aAAa,KAAI;AACtD,QAAA,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;;AAEjC,YAAA,IACE,QAAQ,CAAC,IAAI,KAAK,YAAY;AAC9B,gBAAA,QAAQ,CAAC,QAAQ,KAAK,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAC9D;AACA,gBAAA,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;aAClC;AACH,SAAC,CAAC,CAAC;AACL,KAAC,CAAC,CAAC;AAEH,IAAA,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE;;;;"}
|