@redneckz/wildless-cms-uni-blocks 0.14.117 → 0.14.119

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.
Files changed (46) hide show
  1. package/bin/migration-scripts/0.14.111.js +12 -9
  2. package/bin/migration-scripts/0.14.117.js +47 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +5 -10
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/TextBlock/TextBlockContent.d.ts +3 -5
  7. package/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  8. package/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  9. package/dist/components/TextBlock/TextBlock.js +1 -7
  10. package/dist/components/TextBlock/TextBlock.js.map +1 -1
  11. package/dist/components/TextBlock/TextBlockContent.d.ts +3 -5
  12. package/lib/common.css +1 -1
  13. package/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  14. package/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  15. package/lib/components/TextBlock/TextBlock.fixture.mobile.d.ts +0 -2
  16. package/lib/components/TextBlock/TextBlock.js +1 -7
  17. package/lib/components/TextBlock/TextBlock.js.map +1 -1
  18. package/lib/components/TextBlock/TextBlockContent.d.ts +3 -5
  19. package/mobile/bundle/bundle.umd.js +5 -10
  20. package/mobile/bundle/bundle.umd.min.js +1 -1
  21. package/mobile/bundle/components/TextBlock/TextBlockContent.d.ts +3 -5
  22. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  23. package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  24. package/mobile/dist/components/TextBlock/TextBlock.js +1 -7
  25. package/mobile/dist/components/TextBlock/TextBlock.js.map +1 -1
  26. package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +3 -5
  27. package/mobile/lib/common.css +1 -1
  28. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
  29. package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
  30. package/mobile/lib/components/TextBlock/TextBlock.js +1 -7
  31. package/mobile/lib/components/TextBlock/TextBlock.js.map +1 -1
  32. package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +3 -5
  33. package/mobile/src/components/ApplicationForm/renderQuestionsInterested.tsx +1 -1
  34. package/mobile/src/components/TextBlock/TextBlock.example.json +1 -11
  35. package/mobile/src/components/TextBlock/TextBlock.tsx +1 -24
  36. package/mobile/src/components/TextBlock/TextBlockContent.ts +3 -7
  37. package/package.json +1 -1
  38. package/src/components/ApplicationForm/renderQuestionsInterested.tsx +1 -1
  39. package/src/components/HorizontalLayout/HorizontalLayout.fixture.mobile.tsx +0 -23
  40. package/src/components/TextBlock/TextBlock.example.json +1 -11
  41. package/src/components/TextBlock/TextBlock.fixture.mobile.tsx +0 -28
  42. package/src/components/TextBlock/TextBlock.fixture.tsx +1 -12
  43. package/src/components/TextBlock/TextBlock.tsx +1 -24
  44. package/src/components/TextBlock/TextBlockContent.ts +3 -7
  45. package/src/components/VerticalLayout/VerticalLayout.fixture.mobile.tsx +1 -26
  46. package/bin/migration-scripts/0.14.114.js +0 -17
@@ -5,17 +5,20 @@ export const description = 'v0.14.111';
5
5
  export default traversePageBlocks(adjustClearBlock);
6
6
 
7
7
  function adjustClearBlock(block) {
8
- if (block?.content) {
9
- block.content = deleteEmptyProps(block?.content);
10
- block.content = clearImage(block.content);
8
+ const content = block?.content;
9
+ if (!content) {
10
+ return;
11
11
  }
12
- if (block?.content?.__html === '<p><br></p>') {
13
- deleteProp(block.content, '__html');
12
+ block.content = deleteEmptyProps(block?.content);
13
+ block.content = clearImage(block.content);
14
+
15
+ if (content?.__html === '<p><br></p>') {
16
+ deleteProp(content, '__html');
14
17
  }
15
- if (!('items' in block.content)) {
16
- deleteProp(block.content, 'isDotted');
18
+ if (block?.content && !('items' in content)) {
19
+ deleteProp(content, 'isDotted');
17
20
  }
18
- if (block.type === 'TextBlock' && block?.version === 'primary') {
19
- deleteProp(block.content, 'version');
21
+ if (block.type === 'TextBlock' && content?.version === 'primary') {
22
+ deleteProp(content, 'version');
20
23
  }
21
24
  }
@@ -0,0 +1,47 @@
1
+ import { clearImage, deleteEmptyProps, deleteProp, traversePageBlocks } from '../utils.js';
2
+
3
+ export const description = 'v0.14.117';
4
+
5
+ export default traversePageBlocks(adjustClearBlock, adjustTextBlock);
6
+
7
+ function adjustClearBlock(block) {
8
+ const content = block?.content;
9
+ if (!content) {
10
+ return;
11
+ }
12
+ block.content = deleteEmptyProps(content);
13
+ block.content = clearImage(content);
14
+
15
+ if (content?.__html === '<p><br></p>') {
16
+ deleteProp(content, '__html');
17
+ }
18
+ if (block?.content && !('items' in content)) {
19
+ deleteProp(content, 'isDotted');
20
+ }
21
+ }
22
+
23
+ function adjustTextBlock(block) {
24
+ const content = block?.content;
25
+ if (!content || block.type !== 'TextBlock') {
26
+ return;
27
+ }
28
+
29
+ deleteProp(content, 'isDotted');
30
+ deleteProp(content, 'blockVersion');
31
+
32
+ if (content?.version === 'primary') {
33
+ deleteProp(content, 'version');
34
+ }
35
+
36
+ if (!content?.description && content?.title) {
37
+ const html = content?.__html || '';
38
+ content.__html = `<p><strong>${content.title}</strong></p> ${html}`;
39
+ deleteProp(content, 'title');
40
+ }
41
+
42
+ if (!content?.title && !content?.description && content?.iconVersion !== 'small') {
43
+ block.type = 'RichTextBlock';
44
+ block.content.padding = 'p-3xl';
45
+ deleteProp(content, 'iconVersion');
46
+ }
47
+ }