ublo-lib 1.44.15 → 1.44.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"use-injected-cms-markup.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-injected-cms-markup.js"],"names":[],"mappings":";AAaA,wEA+BC"}
1
+ {"version":3,"file":"use-injected-cms-markup.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-injected-cms-markup.js"],"names":[],"mappings":";AAaA,wEAqCC"}
@@ -12,28 +12,32 @@ const findAllByKey = (obj, keyToFind) => {
12
12
  const useInjectedCmsMarkup = (entries, isReady) => {
13
13
  const { cmsMode } = useUbloContext();
14
14
  const injectCmsMarkup = React.useCallback(async () => {
15
- await window.Cms.register();
16
- const formats = window.Cms.sectionClasses;
17
- entries.forEach((entry) => {
18
- const { key, value } = entry;
19
- const isArray = Array.isArray(value);
20
- const targets = findAllByKey(formats, key);
21
- targets.forEach((target) => {
22
- if (!target?.markup)
23
- return;
24
- if (isArray) {
25
- const formattedRows = value.map((v) => {
26
- return { name: v, markup: `<tr><td>${v}</td></tr>` };
27
- });
28
- const [anchor] = target.markup;
29
- target.markup = anchor ? [anchor, ...formattedRows] : formattedRows;
30
- }
31
- else {
32
- target.markup = value;
33
- }
15
+ window.requestAnimationFrame(() => window.requestAnimationFrame(async () => {
16
+ await window.Cms.register();
17
+ const formats = window.Cms.sectionClasses;
18
+ entries.forEach((entry) => {
19
+ const { key, value } = entry;
20
+ const isArray = Array.isArray(value);
21
+ const targets = findAllByKey(formats, key);
22
+ targets.forEach((target) => {
23
+ if (!target?.markup)
24
+ return;
25
+ if (isArray) {
26
+ const formattedRows = value.map((v) => {
27
+ return { name: v, markup: `<tr><td>${v}</td></tr>` };
28
+ });
29
+ const [anchor] = target.markup;
30
+ target.markup = anchor
31
+ ? [anchor, ...formattedRows]
32
+ : formattedRows;
33
+ }
34
+ else {
35
+ target.markup = value;
36
+ }
37
+ });
34
38
  });
35
- });
36
- await window.Cms.analyse();
39
+ await window.Cms.analyse();
40
+ }));
37
41
  }, [entries]);
38
42
  React.useEffect(() => {
39
43
  if (isReady && cmsMode === "connected") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.44.15",
3
+ "version": "1.44.16",
4
4
  "peerDependencies": {
5
5
  "classnames": "^2.5.1",
6
6
  "dt-design-system": "^3.12.0",