@cooperco/cooper-component-library 0.1.127 → 0.1.129

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 (49) hide show
  1. package/dist/cms/0095-create-table-module.cjs +174 -0
  2. package/dist/cms/0096-update-container-collection-filtered-table.cjs +57 -0
  3. package/dist/cms/0097-tabmodule-inline-body-copy.cjs +566 -0
  4. package/dist/cms/0098-delete-body-copy-content-type.cjs +151 -0
  5. package/dist/cms/containerCollectionModule.query.ts +6 -0
  6. package/dist/cms/contentful/migrations/scripts/0095-create-table-module.cjs +174 -0
  7. package/dist/cms/contentful/migrations/scripts/0096-update-container-collection-filtered-table.cjs +57 -0
  8. package/dist/cms/contentful/migrations/scripts/0097-tabmodule-inline-body-copy.cjs +566 -0
  9. package/dist/cms/contentful/migrations/scripts/0098-delete-body-copy-content-type.cjs +151 -0
  10. package/dist/cms/contentful/queries/containerCollectionModule.query.js +6 -0
  11. package/dist/cms/contentful/queries/containerCollectionModule.query.ts +6 -0
  12. package/dist/cms/contentful/queries/index.d.ts +1 -0
  13. package/dist/cms/contentful/queries/index.js +1 -0
  14. package/dist/cms/contentful/queries/index.ts +2 -0
  15. package/dist/cms/contentful/queries/productModule.query.js +12 -3
  16. package/dist/cms/contentful/queries/productModule.query.ts +12 -3
  17. package/dist/cms/contentful/queries/tableModule.query.d.ts +2 -0
  18. package/dist/cms/contentful/queries/tableModule.query.js +60 -0
  19. package/dist/cms/contentful/queries/tableModule.query.ts +62 -0
  20. package/dist/cms/index.ts +2 -0
  21. package/dist/cms/migrations/scripts/0095-create-table-module.cjs +174 -0
  22. package/dist/cms/migrations/scripts/0096-update-container-collection-filtered-table.cjs +57 -0
  23. package/dist/cms/migrations/scripts/0097-tabmodule-inline-body-copy.cjs +566 -0
  24. package/dist/cms/migrations/scripts/0098-delete-body-copy-content-type.cjs +151 -0
  25. package/dist/cms/productModule.query.ts +12 -3
  26. package/dist/cms/queries/containerCollectionModule.query.ts +6 -0
  27. package/dist/cms/queries/index.ts +2 -0
  28. package/dist/cms/queries/productModule.query.ts +12 -3
  29. package/dist/cms/queries/tableModule.query.ts +62 -0
  30. package/dist/cms/scripts/0095-create-table-module.cjs +174 -0
  31. package/dist/cms/scripts/0096-update-container-collection-filtered-table.cjs +57 -0
  32. package/dist/cms/scripts/0097-tabmodule-inline-body-copy.cjs +566 -0
  33. package/dist/cms/scripts/0098-delete-body-copy-content-type.cjs +151 -0
  34. package/dist/cms/tableModule.query.ts +62 -0
  35. package/dist/lib/component-lib.js +3634 -3253
  36. package/dist/lib/component-lib.umd.cjs +23 -23
  37. package/dist/lib/css/main.css +48 -18
  38. package/dist/lib/style.css +1 -1
  39. package/dist/types/cms/contentful/queries/index.d.ts +1 -0
  40. package/dist/types/cms/contentful/queries/tableModule.query.d.ts +2 -0
  41. package/dist/types/src/components/ContainerCollectionModule/ContainerCollectionModule.d.ts +4 -1
  42. package/dist/types/src/components/TableModule/TableModule.d.ts +51 -0
  43. package/dist/types/src/components/TableModule/TableModule.vue.d.ts +3 -0
  44. package/dist/types/src/components/components.d.ts +1 -0
  45. package/dist/types/src/components/types.d.ts +1 -0
  46. package/dist/types/src/config/defaultPassthrough/index.d.ts +1 -0
  47. package/dist/types/src/config/defaultPassthrough/types.d.ts +3 -1
  48. package/dist/types/src/types.d.ts +1 -0
  49. package/package.json +1 -1
@@ -0,0 +1,174 @@
1
+ const addEntryNameField = require('../helpers/addEntryNameField.cjs')
2
+
3
+ module.exports = {
4
+ // @ts-check
5
+ /** @type { import('contentful-migration').MigrationFunction } */
6
+ up: function (migration) {
7
+ const tableModule = migration.createContentType('tableModule', {
8
+ name: 'Table Module',
9
+ displayField: 'entryName',
10
+ })
11
+
12
+ // Add mandatory entryName field
13
+ addEntryNameField(tableModule)
14
+
15
+ // Title
16
+ tableModule.createField('title', {
17
+ name: 'Title',
18
+ type: 'Symbol',
19
+ required: false,
20
+ })
21
+
22
+ // Description (RichText)
23
+ tableModule.createField('description', {
24
+ name: 'Description',
25
+ type: 'RichText',
26
+ required: false,
27
+ validations: [
28
+ {
29
+ enabledMarks: ['bold', 'italic', 'underline'],
30
+ message: 'Only bold, italic, and underline marks are allowed',
31
+ },
32
+ {
33
+ enabledNodeTypes: [
34
+ 'ordered-list',
35
+ 'unordered-list',
36
+ 'hr',
37
+ 'hyperlink',
38
+ 'embedded-entry-inline',
39
+ ],
40
+ },
41
+ {
42
+ nodes: {
43
+ 'embedded-entry-inline': [
44
+ {
45
+ linkContentType: ['highlightedText'],
46
+ message: 'You can only embed Highlighted Text.',
47
+ },
48
+ ],
49
+ },
50
+ },
51
+ ],
52
+ })
53
+
54
+ // Body Copy Alignment
55
+ tableModule.createField('bodyCopyAlignment', {
56
+ name: 'Body Copy Alignment',
57
+ type: 'Symbol',
58
+ required: false,
59
+ validations: [
60
+ {
61
+ in: ['Left', 'Center', 'Right'],
62
+ },
63
+ ],
64
+ })
65
+ tableModule.changeFieldControl('bodyCopyAlignment', 'builtin', 'dropdown', {
66
+ helpText: 'Override the description copy text alignment independently. If not set, it will follow the default alignment.',
67
+ })
68
+
69
+ // Table Highlight
70
+ tableModule.createField('tableHighlight', {
71
+ name: 'Table Highlight',
72
+ type: 'Symbol',
73
+ required: false,
74
+ validations: [
75
+ {
76
+ in: ['Row', 'Column'],
77
+ },
78
+ ],
79
+ })
80
+ tableModule.changeFieldControl('tableHighlight', 'builtin', 'dropdown', {
81
+ helpText: 'Highlight a specific row or column in the table.',
82
+ })
83
+
84
+ // Table (RichText with table node enabled)
85
+ tableModule.createField('table', {
86
+ name: 'Table',
87
+ type: 'RichText',
88
+ required: true,
89
+ validations: [
90
+ {
91
+ enabledMarks: ['bold', 'italic', 'underline'],
92
+ message: 'Only bold, italic, and underline marks are allowed',
93
+ },
94
+ {
95
+ enabledNodeTypes: [
96
+ 'table',
97
+ 'hyperlink',
98
+ 'embedded-entry-inline',
99
+ 'unordered-list',
100
+ 'ordered-list',
101
+ ],
102
+ },
103
+ {
104
+ nodes: {
105
+ 'embedded-entry-inline': [
106
+ {
107
+ linkContentType: ['highlightedText'],
108
+ message: 'You can only embed Highlighted Text.',
109
+ },
110
+ ],
111
+ },
112
+ },
113
+ ],
114
+ })
115
+
116
+ // Filter columns (Symbol list)
117
+ tableModule.createField('filterColumns', {
118
+ name: 'Filter Columns',
119
+ type: 'Array',
120
+ required: false,
121
+ items: {
122
+ type: 'Symbol',
123
+ validations: [],
124
+ },
125
+ })
126
+ tableModule.changeFieldControl('filterColumns', 'builtin', 'tagEditor', {
127
+ helpText: 'Enter the exact column heading(s) to make filterable. Max 4 suggested.',
128
+ })
129
+
130
+ // Footer (RichText)
131
+ tableModule.createField('footer', {
132
+ name: 'Footer',
133
+ type: 'RichText',
134
+ required: false,
135
+ validations: [
136
+ {
137
+ enabledMarks: ['bold', 'italic', 'underline'],
138
+ message: 'Only bold, italic, and underline marks are allowed',
139
+ },
140
+ {
141
+ enabledNodeTypes: ['hyperlink', 'embedded-entry-inline'],
142
+ },
143
+ {
144
+ nodes: {
145
+ 'embedded-entry-inline': [
146
+ {
147
+ linkContentType: ['highlightedText'],
148
+ message: 'You can only embed Highlighted Text.',
149
+ },
150
+ ],
151
+ },
152
+ },
153
+ ],
154
+ })
155
+
156
+ // Background Color
157
+ tableModule.createField('backgroundColor', {
158
+ name: 'Background Color',
159
+ type: 'Symbol',
160
+ required: false,
161
+ })
162
+
163
+ // Change field control for Color Picker App
164
+ tableModule.changeFieldControl(
165
+ 'backgroundColor',
166
+ 'app',
167
+ process.env.COLOR_PICKER_APP_ID
168
+ )
169
+ },
170
+
171
+ down: async function (migration) {
172
+ await migration.deleteContentType('tableModule')
173
+ },
174
+ }
@@ -0,0 +1,57 @@
1
+ module.exports = {
2
+ // @ts-check
3
+ /** @type { import('contentful-migration').MigrationFunction } */
4
+ up: function (migration) {
5
+ const collection = migration.editContentType('containerCollectionModule')
6
+
7
+ // Delete the variant field from Contentful
8
+ collection.deleteField('variant')
9
+
10
+ // Subheadline field
11
+ collection.createField('subheadline', {
12
+ name: 'Subheadline',
13
+ type: 'Symbol',
14
+ required: false,
15
+ })
16
+
17
+ // Order the fields
18
+ collection.moveField('subheadline').afterField('headline')
19
+
20
+ // Update link validations for modules collection to accept splitModule and tableModule
21
+ collection.editField('modules').items({
22
+ type: 'Link',
23
+ linkType: 'Entry',
24
+ validations: [
25
+ {
26
+ linkContentType: ['splitModule', 'tableModule'],
27
+ },
28
+ ],
29
+ })
30
+
31
+ // Add helper text to modules field
32
+ collection.changeFieldControl('modules', 'builtin', 'entryCardsEditor', {
33
+ helpText:
34
+ 'Add Table Modules to render filtered tables with tabs, or Split Modules for standard collections.',
35
+ })
36
+ },
37
+
38
+ // @ts-check
39
+ /** @type { import('contentful-migration').MigrationFunction } */
40
+ down: function (migration) {
41
+ const collection = migration.editContentType('containerCollectionModule')
42
+
43
+ // Delete subheadline field
44
+ collection.deleteField('subheadline')
45
+
46
+ // Revert validations on modules collection to splitModule only
47
+ collection.editField('modules').items({
48
+ type: 'Link',
49
+ linkType: 'Entry',
50
+ validations: [
51
+ {
52
+ linkContentType: ['splitModule'],
53
+ },
54
+ ],
55
+ })
56
+ },
57
+ }