@sitecore-jss/sitecore-jss-angular 18.0.2-canary.0 → 18.0.2
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/bundles/sitecore-jss-sitecore-jss-angular.umd.js +1421 -1421
- package/dist/components/date.directive.d.ts +17 -17
- package/dist/components/file.directive.d.ts +14 -14
- package/dist/components/generic-link.directive.d.ts +14 -14
- package/dist/components/image.directive.d.ts +28 -28
- package/dist/components/link.directive.d.ts +18 -18
- package/dist/components/missing-component.component.d.ts +3 -3
- package/dist/components/placeholder-loading.directive.d.ts +5 -5
- package/dist/components/placeholder.component.d.ts +45 -45
- package/dist/components/placeholder.token.d.ts +30 -30
- package/dist/components/raw.component.d.ts +9 -9
- package/dist/components/render-component.component.d.ts +29 -29
- package/dist/components/render-each.directive.d.ts +5 -5
- package/dist/components/render-empty.directive.d.ts +5 -5
- package/dist/components/rendering-field.d.ts +20 -20
- package/dist/components/rendering.d.ts +5 -5
- package/dist/components/rich-text.directive.d.ts +12 -12
- package/dist/components/router-link.directive.d.ts +12 -12
- package/dist/components/text.directive.d.ts +13 -13
- package/dist/esm2015/components/date.directive.js +52 -52
- package/dist/esm2015/components/file.directive.js +42 -42
- package/dist/esm2015/components/generic-link.directive.js +57 -57
- package/dist/esm2015/components/image.directive.js +122 -122
- package/dist/esm2015/components/link.directive.js +98 -98
- package/dist/esm2015/components/missing-component.component.js +12 -12
- package/dist/esm2015/components/placeholder-loading.directive.js +14 -14
- package/dist/esm2015/components/placeholder.component.js +191 -191
- package/dist/esm2015/components/placeholder.token.js +20 -20
- package/dist/esm2015/components/raw.component.js +36 -36
- package/dist/esm2015/components/render-component.component.js +88 -88
- package/dist/esm2015/components/render-each.directive.js +14 -14
- package/dist/esm2015/components/render-empty.directive.js +14 -14
- package/dist/esm2015/components/rendering-field.js +1 -1
- package/dist/esm2015/components/rendering.js +7 -7
- package/dist/esm2015/components/rich-text.directive.js +40 -40
- package/dist/esm2015/components/router-link.directive.js +43 -43
- package/dist/esm2015/components/text.directive.js +53 -53
- package/dist/esm2015/jss-component-factory.service.js +86 -86
- package/dist/esm2015/layout-service-error.js +2 -2
- package/dist/esm2015/layout.service.js +28 -28
- package/dist/esm2015/lib.module.js +111 -111
- package/dist/esm2015/public_api.js +16 -16
- package/dist/esm2015/sitecore-jss-sitecore-jss-angular.js +12 -12
- package/dist/esm2015/utils.js +37 -37
- package/dist/fesm2015/sitecore-jss-sitecore-jss-angular.js +1079 -1079
- package/dist/jss-component-factory.service.d.ts +21 -21
- package/dist/layout-service-error.d.ts +8 -8
- package/dist/layout.service.d.ts +8 -8
- package/dist/lib.module.d.ts +24 -24
- package/dist/package.json +2 -2
- package/dist/public_api.d.ts +17 -17
- package/dist/sitecore-jss-sitecore-jss-angular.d.ts +12 -12
- package/dist/utils.d.ts +10 -10
- package/package.json +3 -3
package/dist/esm2015/utils.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { isExperienceEditorActive } from '@sitecore-jss/sitecore-jss';
|
|
2
|
-
/**
|
|
3
|
-
* @description in Experience Editor with an Angular sample app, anchor tags
|
|
4
|
-
* with both onclick and href attributes will use the href, blocking the onclick from firing.
|
|
5
|
-
* This function makes it so the anchor tags function as intended in an Angular sample when using Experience Editor
|
|
6
|
-
*
|
|
7
|
-
* The Mutation Observer API is used to observe changes to the body, then select all elements with href="#" and an onclick,
|
|
8
|
-
* and replaces the # value with javascript:void(0); which prevents the anchor tag from blocking the onclick event handler.
|
|
9
|
-
* @see Mutation Observer API: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver
|
|
10
|
-
*/
|
|
11
|
-
export const handleEditorAnchors = () => {
|
|
12
|
-
// Angular gives the href attribute priority over the onclick attribute if both are present, so we must replace
|
|
13
|
-
// the href attribute to avoid overriding the onclick in Experience Editor
|
|
14
|
-
if (!window || !isExperienceEditorActive()) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const targetNode = document.querySelector('body');
|
|
18
|
-
const callback = (mutationList) => {
|
|
19
|
-
mutationList.forEach((mutation) => {
|
|
20
|
-
const btns = document.querySelectorAll('.scChromeDropDown > a[href="#"], a[onclick]');
|
|
21
|
-
if (mutation.type === 'childList') {
|
|
22
|
-
btns.forEach((link) => {
|
|
23
|
-
link.href = 'javascript:void(0);';
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return;
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const observer = new MutationObserver(callback);
|
|
30
|
-
const observerOptions = {
|
|
31
|
-
childList: true,
|
|
32
|
-
subtree: true,
|
|
33
|
-
};
|
|
34
|
-
if (targetNode) {
|
|
35
|
-
observer.observe(targetNode, observerOptions);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
1
|
+
import { isExperienceEditorActive } from '@sitecore-jss/sitecore-jss';
|
|
2
|
+
/**
|
|
3
|
+
* @description in Experience Editor with an Angular sample app, anchor tags
|
|
4
|
+
* with both onclick and href attributes will use the href, blocking the onclick from firing.
|
|
5
|
+
* This function makes it so the anchor tags function as intended in an Angular sample when using Experience Editor
|
|
6
|
+
*
|
|
7
|
+
* The Mutation Observer API is used to observe changes to the body, then select all elements with href="#" and an onclick,
|
|
8
|
+
* and replaces the # value with javascript:void(0); which prevents the anchor tag from blocking the onclick event handler.
|
|
9
|
+
* @see Mutation Observer API: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver
|
|
10
|
+
*/
|
|
11
|
+
export const handleEditorAnchors = () => {
|
|
12
|
+
// Angular gives the href attribute priority over the onclick attribute if both are present, so we must replace
|
|
13
|
+
// the href attribute to avoid overriding the onclick in Experience Editor
|
|
14
|
+
if (!window || !isExperienceEditorActive()) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const targetNode = document.querySelector('body');
|
|
18
|
+
const callback = (mutationList) => {
|
|
19
|
+
mutationList.forEach((mutation) => {
|
|
20
|
+
const btns = document.querySelectorAll('.scChromeDropDown > a[href="#"], a[onclick]');
|
|
21
|
+
if (mutation.type === 'childList') {
|
|
22
|
+
btns.forEach((link) => {
|
|
23
|
+
link.href = 'javascript:void(0);';
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const observer = new MutationObserver(callback);
|
|
30
|
+
const observerOptions = {
|
|
31
|
+
childList: true,
|
|
32
|
+
subtree: true,
|
|
33
|
+
};
|
|
34
|
+
if (targetNode) {
|
|
35
|
+
observer.observe(targetNode, observerOptions);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
38
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFFdEU7Ozs7Ozs7O0dBUUc7QUFDSCxNQUFNLENBQUMsTUFBTSxtQkFBbUIsR0FBRyxHQUFHLEVBQUU7SUFDdEMsK0dBQStHO0lBQy9HLDBFQUEwRTtJQUMxRSxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsd0JBQXdCLEVBQUUsRUFBRTtRQUMxQyxPQUFPO0tBQ1I7SUFDRCxNQUFNLFVBQVUsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ2xELE1BQU0sUUFBUSxHQUFHLENBQUMsWUFBOEIsRUFBRSxFQUFFO1FBQ2xELFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQyxRQUF3QixFQUFFLEVBQUU7WUFDaEQsTUFBTSxJQUFJLEdBQWtDLFFBQVEsQ0FBQyxnQkFBZ0IsQ0FDbkUsNkNBQTZDLENBQzlDLENBQUM7WUFDRixJQUFJLFFBQVEsQ0FBQy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