@universityofmaryland/web-model-library 1.0.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.
Files changed (252) hide show
  1. package/README.md +138 -0
  2. package/dist/_types.d.ts +77 -0
  3. package/dist/_types.d.ts.map +1 -0
  4. package/dist/_virtual/___vite-browser-external.js +8 -0
  5. package/dist/_virtual/___vite-browser-external.js.map +1 -0
  6. package/dist/_virtual/___vite-browser-external.mjs +7 -0
  7. package/dist/_virtual/___vite-browser-external.mjs.map +1 -0
  8. package/dist/_virtual/__vite-browser-external.js +4 -0
  9. package/dist/_virtual/__vite-browser-external.js.map +1 -0
  10. package/dist/_virtual/__vite-browser-external.mjs +5 -0
  11. package/dist/_virtual/__vite-browser-external.mjs.map +1 -0
  12. package/dist/_virtual/_commonjsHelpers.js +37 -0
  13. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  14. package/dist/_virtual/_commonjsHelpers.mjs +37 -0
  15. package/dist/_virtual/_commonjsHelpers.mjs.map +1 -0
  16. package/dist/_virtual/index.js +7 -0
  17. package/dist/_virtual/index.js.map +1 -0
  18. package/dist/_virtual/index.mjs +8 -0
  19. package/dist/_virtual/index.mjs.map +1 -0
  20. package/dist/_virtual/picocolors.browser.js +5 -0
  21. package/dist/_virtual/picocolors.browser.js.map +1 -0
  22. package/dist/_virtual/picocolors.browser.mjs +5 -0
  23. package/dist/_virtual/picocolors.browser.mjs.map +1 -0
  24. package/dist/_virtual/postcss.js +7 -0
  25. package/dist/_virtual/postcss.js.map +1 -0
  26. package/dist/_virtual/postcss.mjs +8 -0
  27. package/dist/_virtual/postcss.mjs.map +1 -0
  28. package/dist/_virtual/symbols.js +5 -0
  29. package/dist/_virtual/symbols.js.map +1 -0
  30. package/dist/_virtual/symbols.mjs +5 -0
  31. package/dist/_virtual/symbols.mjs.map +1 -0
  32. package/dist/attributes/checks.d.ts +133 -0
  33. package/dist/attributes/checks.d.ts.map +1 -0
  34. package/dist/attributes/checks.js +757 -0
  35. package/dist/attributes/checks.js.map +1 -0
  36. package/dist/attributes/checks.mjs +740 -0
  37. package/dist/attributes/checks.mjs.map +1 -0
  38. package/dist/attributes/handler.d.ts +52 -0
  39. package/dist/attributes/handler.d.ts.map +1 -0
  40. package/dist/attributes/handler.js +205 -0
  41. package/dist/attributes/handler.js.map +1 -0
  42. package/dist/attributes/handler.mjs +206 -0
  43. package/dist/attributes/handler.mjs.map +1 -0
  44. package/dist/attributes/index.d.ts +7 -0
  45. package/dist/attributes/index.d.ts.map +1 -0
  46. package/dist/attributes/names.d.ts +132 -0
  47. package/dist/attributes/names.d.ts.map +1 -0
  48. package/dist/attributes/names.js +145 -0
  49. package/dist/attributes/names.js.map +1 -0
  50. package/dist/attributes/names.mjs +146 -0
  51. package/dist/attributes/names.mjs.map +1 -0
  52. package/dist/attributes/values.d.ts +70 -0
  53. package/dist/attributes/values.d.ts.map +1 -0
  54. package/dist/attributes/values.js +80 -0
  55. package/dist/attributes/values.js.map +1 -0
  56. package/dist/attributes/values.mjs +81 -0
  57. package/dist/attributes/values.mjs.map +1 -0
  58. package/dist/attributes.d.ts +2 -0
  59. package/dist/attributes.js +23 -0
  60. package/dist/attributes.js.map +1 -0
  61. package/dist/attributes.mjs +23 -0
  62. package/dist/attributes.mjs.map +1 -0
  63. package/dist/index.d.ts +10 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +13 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/index.mjs +13 -0
  68. package/dist/index.mjs.map +1 -0
  69. package/dist/model/index.d.ts +43 -0
  70. package/dist/model/index.d.ts.map +1 -0
  71. package/dist/model.d.ts +2 -0
  72. package/dist/model.js +259 -0
  73. package/dist/model.js.map +1 -0
  74. package/dist/model.mjs +259 -0
  75. package/dist/model.mjs.map +1 -0
  76. package/dist/node_modules/nanoid/non-secure/index.js +31 -0
  77. package/dist/node_modules/nanoid/non-secure/index.js.map +1 -0
  78. package/dist/node_modules/nanoid/non-secure/index.mjs +31 -0
  79. package/dist/node_modules/nanoid/non-secure/index.mjs.map +1 -0
  80. package/dist/node_modules/picocolors/picocolors.browser.js +17 -0
  81. package/dist/node_modules/picocolors/picocolors.browser.js.map +1 -0
  82. package/dist/node_modules/picocolors/picocolors.browser.mjs +17 -0
  83. package/dist/node_modules/picocolors/picocolors.browser.mjs.map +1 -0
  84. package/dist/node_modules/postcss/lib/at-rule.js +30 -0
  85. package/dist/node_modules/postcss/lib/at-rule.js.map +1 -0
  86. package/dist/node_modules/postcss/lib/at-rule.mjs +30 -0
  87. package/dist/node_modules/postcss/lib/at-rule.mjs.map +1 -0
  88. package/dist/node_modules/postcss/lib/comment.js +21 -0
  89. package/dist/node_modules/postcss/lib/comment.js.map +1 -0
  90. package/dist/node_modules/postcss/lib/comment.mjs +21 -0
  91. package/dist/node_modules/postcss/lib/comment.mjs.map +1 -0
  92. package/dist/node_modules/postcss/lib/container.js +383 -0
  93. package/dist/node_modules/postcss/lib/container.js.map +1 -0
  94. package/dist/node_modules/postcss/lib/container.mjs +383 -0
  95. package/dist/node_modules/postcss/lib/container.mjs.map +1 -0
  96. package/dist/node_modules/postcss/lib/css-syntax-error.js +92 -0
  97. package/dist/node_modules/postcss/lib/css-syntax-error.js.map +1 -0
  98. package/dist/node_modules/postcss/lib/css-syntax-error.mjs +92 -0
  99. package/dist/node_modules/postcss/lib/css-syntax-error.mjs.map +1 -0
  100. package/dist/node_modules/postcss/lib/declaration.js +27 -0
  101. package/dist/node_modules/postcss/lib/declaration.js.map +1 -0
  102. package/dist/node_modules/postcss/lib/declaration.mjs +27 -0
  103. package/dist/node_modules/postcss/lib/declaration.mjs.map +1 -0
  104. package/dist/node_modules/postcss/lib/document.js +34 -0
  105. package/dist/node_modules/postcss/lib/document.js.map +1 -0
  106. package/dist/node_modules/postcss/lib/document.mjs +34 -0
  107. package/dist/node_modules/postcss/lib/document.mjs.map +1 -0
  108. package/dist/node_modules/postcss/lib/fromJSON.js +67 -0
  109. package/dist/node_modules/postcss/lib/fromJSON.js.map +1 -0
  110. package/dist/node_modules/postcss/lib/fromJSON.mjs +67 -0
  111. package/dist/node_modules/postcss/lib/fromJSON.mjs.map +1 -0
  112. package/dist/node_modules/postcss/lib/input.js +216 -0
  113. package/dist/node_modules/postcss/lib/input.js.map +1 -0
  114. package/dist/node_modules/postcss/lib/input.mjs +216 -0
  115. package/dist/node_modules/postcss/lib/input.mjs.map +1 -0
  116. package/dist/node_modules/postcss/lib/lazy-result.js +467 -0
  117. package/dist/node_modules/postcss/lib/lazy-result.js.map +1 -0
  118. package/dist/node_modules/postcss/lib/lazy-result.mjs +467 -0
  119. package/dist/node_modules/postcss/lib/lazy-result.mjs.map +1 -0
  120. package/dist/node_modules/postcss/lib/list.js +60 -0
  121. package/dist/node_modules/postcss/lib/list.js.map +1 -0
  122. package/dist/node_modules/postcss/lib/list.mjs +60 -0
  123. package/dist/node_modules/postcss/lib/list.mjs.map +1 -0
  124. package/dist/node_modules/postcss/lib/map-generator.js +314 -0
  125. package/dist/node_modules/postcss/lib/map-generator.js.map +1 -0
  126. package/dist/node_modules/postcss/lib/map-generator.mjs +314 -0
  127. package/dist/node_modules/postcss/lib/map-generator.mjs.map +1 -0
  128. package/dist/node_modules/postcss/lib/no-work-result.js +113 -0
  129. package/dist/node_modules/postcss/lib/no-work-result.js.map +1 -0
  130. package/dist/node_modules/postcss/lib/no-work-result.mjs +113 -0
  131. package/dist/node_modules/postcss/lib/no-work-result.mjs.map +1 -0
  132. package/dist/node_modules/postcss/lib/node.js +335 -0
  133. package/dist/node_modules/postcss/lib/node.js.map +1 -0
  134. package/dist/node_modules/postcss/lib/node.mjs +335 -0
  135. package/dist/node_modules/postcss/lib/node.mjs.map +1 -0
  136. package/dist/node_modules/postcss/lib/parse.js +30 -0
  137. package/dist/node_modules/postcss/lib/parse.js.map +1 -0
  138. package/dist/node_modules/postcss/lib/parse.mjs +30 -0
  139. package/dist/node_modules/postcss/lib/parse.mjs.map +1 -0
  140. package/dist/node_modules/postcss/lib/parser.js +543 -0
  141. package/dist/node_modules/postcss/lib/parser.js.map +1 -0
  142. package/dist/node_modules/postcss/lib/parser.mjs +543 -0
  143. package/dist/node_modules/postcss/lib/parser.mjs.map +1 -0
  144. package/dist/node_modules/postcss/lib/postcss.js +28 -0
  145. package/dist/node_modules/postcss/lib/postcss.js.map +1 -0
  146. package/dist/node_modules/postcss/lib/postcss.mjs +29 -0
  147. package/dist/node_modules/postcss/lib/postcss.mjs.map +1 -0
  148. package/dist/node_modules/postcss/lib/postcss2.js +110 -0
  149. package/dist/node_modules/postcss/lib/postcss2.js.map +1 -0
  150. package/dist/node_modules/postcss/lib/postcss2.mjs +110 -0
  151. package/dist/node_modules/postcss/lib/postcss2.mjs.map +1 -0
  152. package/dist/node_modules/postcss/lib/previous-map.js +123 -0
  153. package/dist/node_modules/postcss/lib/previous-map.js.map +1 -0
  154. package/dist/node_modules/postcss/lib/previous-map.mjs +123 -0
  155. package/dist/node_modules/postcss/lib/previous-map.mjs.map +1 -0
  156. package/dist/node_modules/postcss/lib/processor.js +61 -0
  157. package/dist/node_modules/postcss/lib/processor.js.map +1 -0
  158. package/dist/node_modules/postcss/lib/processor.mjs +61 -0
  159. package/dist/node_modules/postcss/lib/processor.mjs.map +1 -0
  160. package/dist/node_modules/postcss/lib/result.js +44 -0
  161. package/dist/node_modules/postcss/lib/result.js.map +1 -0
  162. package/dist/node_modules/postcss/lib/result.mjs +44 -0
  163. package/dist/node_modules/postcss/lib/result.mjs.map +1 -0
  164. package/dist/node_modules/postcss/lib/root.js +58 -0
  165. package/dist/node_modules/postcss/lib/root.js.map +1 -0
  166. package/dist/node_modules/postcss/lib/root.mjs +58 -0
  167. package/dist/node_modules/postcss/lib/root.mjs.map +1 -0
  168. package/dist/node_modules/postcss/lib/rule.js +33 -0
  169. package/dist/node_modules/postcss/lib/rule.js.map +1 -0
  170. package/dist/node_modules/postcss/lib/rule.mjs +33 -0
  171. package/dist/node_modules/postcss/lib/rule.mjs.map +1 -0
  172. package/dist/node_modules/postcss/lib/stringifier.js +308 -0
  173. package/dist/node_modules/postcss/lib/stringifier.js.map +1 -0
  174. package/dist/node_modules/postcss/lib/stringifier.mjs +308 -0
  175. package/dist/node_modules/postcss/lib/stringifier.mjs.map +1 -0
  176. package/dist/node_modules/postcss/lib/stringify.js +19 -0
  177. package/dist/node_modules/postcss/lib/stringify.js.map +1 -0
  178. package/dist/node_modules/postcss/lib/stringify.mjs +19 -0
  179. package/dist/node_modules/postcss/lib/stringify.mjs.map +1 -0
  180. package/dist/node_modules/postcss/lib/symbols.js +13 -0
  181. package/dist/node_modules/postcss/lib/symbols.js.map +1 -0
  182. package/dist/node_modules/postcss/lib/symbols.mjs +13 -0
  183. package/dist/node_modules/postcss/lib/symbols.mjs.map +1 -0
  184. package/dist/node_modules/postcss/lib/tokenize.js +219 -0
  185. package/dist/node_modules/postcss/lib/tokenize.js.map +1 -0
  186. package/dist/node_modules/postcss/lib/tokenize.mjs +219 -0
  187. package/dist/node_modules/postcss/lib/tokenize.mjs.map +1 -0
  188. package/dist/node_modules/postcss/lib/warning.js +40 -0
  189. package/dist/node_modules/postcss/lib/warning.js.map +1 -0
  190. package/dist/node_modules/postcss/lib/warning.mjs +40 -0
  191. package/dist/node_modules/postcss/lib/warning.mjs.map +1 -0
  192. package/dist/packages/model/node_modules/postcss-discard-duplicates/src/index.js +130 -0
  193. package/dist/packages/model/node_modules/postcss-discard-duplicates/src/index.js.map +1 -0
  194. package/dist/packages/model/node_modules/postcss-discard-duplicates/src/index.mjs +130 -0
  195. package/dist/packages/model/node_modules/postcss-discard-duplicates/src/index.mjs.map +1 -0
  196. package/dist/slots/create.d.ts +15 -0
  197. package/dist/slots/create.d.ts.map +1 -0
  198. package/dist/slots/create.js +50 -0
  199. package/dist/slots/create.js.map +1 -0
  200. package/dist/slots/create.mjs +50 -0
  201. package/dist/slots/create.mjs.map +1 -0
  202. package/dist/slots/element.d.ts +3 -0
  203. package/dist/slots/element.d.ts.map +1 -0
  204. package/dist/slots/element.js +42 -0
  205. package/dist/slots/element.js.map +1 -0
  206. package/dist/slots/element.mjs +42 -0
  207. package/dist/slots/element.mjs.map +1 -0
  208. package/dist/slots/extract.d.ts +6 -0
  209. package/dist/slots/extract.d.ts.map +1 -0
  210. package/dist/slots/index.d.ts +140 -0
  211. package/dist/slots/index.d.ts.map +1 -0
  212. package/dist/slots/mapping.d.ts +82 -0
  213. package/dist/slots/mapping.d.ts.map +1 -0
  214. package/dist/slots/mapping.js +97 -0
  215. package/dist/slots/mapping.js.map +1 -0
  216. package/dist/slots/mapping.mjs +97 -0
  217. package/dist/slots/mapping.mjs.map +1 -0
  218. package/dist/slots/query.d.ts +9 -0
  219. package/dist/slots/query.d.ts.map +1 -0
  220. package/dist/slots/validate.d.ts +22 -0
  221. package/dist/slots/validate.d.ts.map +1 -0
  222. package/dist/slots.d.ts +6 -0
  223. package/dist/slots.js +73 -0
  224. package/dist/slots.js.map +1 -0
  225. package/dist/slots.mjs +74 -0
  226. package/dist/slots.mjs.map +1 -0
  227. package/dist/utilities/index.d.ts +4 -0
  228. package/dist/utilities/index.d.ts.map +1 -0
  229. package/dist/utilities/lifecycle.d.ts +12 -0
  230. package/dist/utilities/lifecycle.d.ts.map +1 -0
  231. package/dist/utilities/lifecycle.js +21 -0
  232. package/dist/utilities/lifecycle.js.map +1 -0
  233. package/dist/utilities/lifecycle.mjs +21 -0
  234. package/dist/utilities/lifecycle.mjs.map +1 -0
  235. package/dist/utilities/register.d.ts +17 -0
  236. package/dist/utilities/register.d.ts.map +1 -0
  237. package/dist/utilities/register.js +32 -0
  238. package/dist/utilities/register.js.map +1 -0
  239. package/dist/utilities/register.mjs +32 -0
  240. package/dist/utilities/register.mjs.map +1 -0
  241. package/dist/utilities/styles.d.ts +5 -0
  242. package/dist/utilities/styles.d.ts.map +1 -0
  243. package/dist/utilities/styles.js +79 -0
  244. package/dist/utilities/styles.js.map +1 -0
  245. package/dist/utilities/styles.mjs +80 -0
  246. package/dist/utilities/styles.mjs.map +1 -0
  247. package/dist/utilities.d.ts +2 -0
  248. package/dist/utilities.js +11 -0
  249. package/dist/utilities.js.map +1 -0
  250. package/dist/utilities.mjs +11 -0
  251. package/dist/utilities.mjs.map +1 -0
  252. package/package.json +69 -0
@@ -0,0 +1,740 @@
1
+ import * as Styles from "@universityofmaryland/web-styles-library";
2
+ import AttributeNames from "./names.mjs";
3
+ import AttributeValues from "./values.mjs";
4
+ const isAttributeTrue = ({
5
+ element,
6
+ attributeName,
7
+ attributeValue,
8
+ defaultValue = false
9
+ }) => {
10
+ const value = element.getAttribute(attributeName);
11
+ if (value === null) {
12
+ return defaultValue;
13
+ }
14
+ if (value === "false") {
15
+ return false;
16
+ }
17
+ return value === attributeValue;
18
+ };
19
+ const isAttributeNotNull = ({
20
+ element,
21
+ attributeName
22
+ }) => {
23
+ const value = element.getAttribute(attributeName);
24
+ if (value === "true") return true;
25
+ if (value === "false") return false;
26
+ return value !== null;
27
+ };
28
+ const depcreationWarning = ({
29
+ element,
30
+ attributeNameOld,
31
+ attributeNameNew
32
+ }) => {
33
+ console.warn(
34
+ `UMD Web Component: ${element.nodeName} - Attribute "${attributeNameOld}" is deprecated. Use "${attributeNameNew}" instead. This attribute will be removed in version 2.0.`
35
+ );
36
+ };
37
+ const checkDeprecatedAttribute = (props) => {
38
+ const {
39
+ element,
40
+ attributeNameOld,
41
+ attributeNameNew,
42
+ attributeValue,
43
+ ...rest
44
+ } = props;
45
+ const isDeprecatedUsed = isAttributeTrue({
46
+ ...rest,
47
+ element,
48
+ attributeName: attributeNameOld,
49
+ attributeValue
50
+ });
51
+ if (isDeprecatedUsed) {
52
+ depcreationWarning(props);
53
+ return true;
54
+ }
55
+ return false;
56
+ };
57
+ const createAttributeCheck = (attributeName, attributeValue, defaultValue = false) => (props) => isAttributeTrue({
58
+ ...props,
59
+ attributeName,
60
+ attributeValue,
61
+ defaultValue
62
+ });
63
+ const createValueGetter = ({
64
+ currentName,
65
+ deprecatedName
66
+ }) => {
67
+ return ({ element }) => {
68
+ if (deprecatedName) {
69
+ const deprecatedValue = element.getAttribute(deprecatedName);
70
+ if (deprecatedValue !== null) {
71
+ depcreationWarning({
72
+ element,
73
+ attributeNameOld: deprecatedName,
74
+ attributeNameNew: currentName
75
+ });
76
+ return deprecatedValue;
77
+ }
78
+ }
79
+ const value = element.getAttribute(currentName);
80
+ if (value !== null) {
81
+ return value;
82
+ }
83
+ return null;
84
+ };
85
+ };
86
+ const hasInfo = {
87
+ gifts: (props) => isAttributeNotNull({
88
+ ...props,
89
+ attributeName: AttributeNames.information.gift
90
+ }),
91
+ search: (props) => isAttributeNotNull({
92
+ ...props,
93
+ attributeName: AttributeNames.information.search
94
+ })
95
+ };
96
+ const hasDecoration = {
97
+ line: (props) => checkDeprecatedAttribute({
98
+ ...props,
99
+ attributeNameOld: AttributeNames.deprecated.option.OPTIONAL_HAS_LINE,
100
+ attributeNameNew: AttributeNames.decoration.line,
101
+ attributeValue: ""
102
+ }) || isAttributeNotNull({
103
+ ...props,
104
+ attributeName: AttributeNames.decoration.line
105
+ })
106
+ };
107
+ const includesFeature = {
108
+ animation: createAttributeCheck(
109
+ AttributeNames.feature.animation,
110
+ AttributeValues.state.TRUE,
111
+ true
112
+ ),
113
+ imageExpand: createAttributeCheck(
114
+ AttributeNames.feature.imageExpand,
115
+ AttributeValues.state.TRUE,
116
+ true
117
+ ),
118
+ fullScreenOption: createAttributeCheck(
119
+ AttributeNames.deprecated.feature.FULLSCREEN,
120
+ AttributeValues.state.TRUE,
121
+ true
122
+ ),
123
+ visualTime: createAttributeCheck(
124
+ AttributeNames.deprecated.feature.SHOW_TIME,
125
+ AttributeValues.state.TRUE,
126
+ true
127
+ ),
128
+ lazyLoad: (props) => checkDeprecatedAttribute({
129
+ ...props,
130
+ attributeNameOld: AttributeNames.deprecated.feed.FEED_LAZY_LOAD,
131
+ attributeNameNew: AttributeNames.feature.lazyLoad,
132
+ attributeValue: AttributeValues.state.TRUE
133
+ }) || isAttributeTrue({
134
+ ...props,
135
+ attributeName: AttributeNames.feature.lazyLoad,
136
+ attributeValue: AttributeValues.state.TRUE
137
+ })
138
+ };
139
+ const isData = {
140
+ type: {
141
+ academic: (props) => checkDeprecatedAttribute({
142
+ ...props,
143
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
144
+ attributeNameNew: AttributeNames.feed.type,
145
+ attributeValue: AttributeValues.data.type.academic
146
+ }) || isAttributeTrue({
147
+ ...props,
148
+ attributeName: AttributeNames.feed.type,
149
+ attributeValue: AttributeValues.data.type.academic
150
+ })
151
+ },
152
+ union: createAttributeCheck(
153
+ AttributeNames.deprecated.feed.FEED_UNION,
154
+ AttributeValues.state.FALSE,
155
+ true
156
+ )
157
+ };
158
+ const isDisplay = {
159
+ block: (props) => checkDeprecatedAttribute({
160
+ ...props,
161
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY_TYPE,
162
+ attributeNameNew: AttributeNames.display.default,
163
+ attributeValue: AttributeValues.display.block
164
+ }) || isAttributeTrue({
165
+ ...props,
166
+ attributeName: AttributeNames.display.default,
167
+ attributeValue: AttributeValues.display.block
168
+ }),
169
+ feature: createAttributeCheck(
170
+ AttributeNames.deprecated.display.DISPLAY,
171
+ AttributeValues.display.feature
172
+ ),
173
+ featured: (props) => checkDeprecatedAttribute({
174
+ ...props,
175
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
176
+ attributeNameNew: AttributeNames.display.default,
177
+ attributeValue: AttributeValues.display.featured
178
+ }) || isAttributeTrue({
179
+ ...props,
180
+ attributeName: AttributeNames.display.default,
181
+ attributeValue: AttributeValues.display.featured
182
+ }),
183
+ hero: (props) => checkDeprecatedAttribute({
184
+ ...props,
185
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
186
+ attributeNameNew: AttributeNames.display.default,
187
+ attributeValue: AttributeValues.display.hero
188
+ }) || isAttributeTrue({
189
+ ...props,
190
+ attributeName: AttributeNames.display.default,
191
+ attributeValue: AttributeValues.display.hero
192
+ }),
193
+ list: (props) => checkDeprecatedAttribute({
194
+ ...props,
195
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY,
196
+ attributeNameNew: AttributeNames.display.default,
197
+ attributeValue: AttributeValues.display.list
198
+ }) || isAttributeTrue({
199
+ ...props,
200
+ attributeName: AttributeNames.display.default,
201
+ attributeValue: AttributeValues.display.list
202
+ }),
203
+ outline: (props) => checkDeprecatedAttribute({
204
+ ...props,
205
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
206
+ attributeNameNew: AttributeNames.display.default,
207
+ attributeValue: AttributeValues.type.OUTLINE
208
+ }) || isAttributeTrue({
209
+ ...props,
210
+ attributeName: AttributeNames.display.default,
211
+ attributeValue: AttributeValues.type.OUTLINE
212
+ }),
213
+ overlay: (props) => checkDeprecatedAttribute({
214
+ ...props,
215
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
216
+ attributeNameNew: AttributeNames.display.default,
217
+ attributeValue: AttributeValues.display.overlay
218
+ }) || isAttributeTrue({
219
+ ...props,
220
+ attributeName: AttributeNames.display.default,
221
+ attributeValue: AttributeValues.display.overlay
222
+ }),
223
+ promo: createAttributeCheck(
224
+ AttributeNames.deprecated.display.DISPLAY,
225
+ AttributeValues.display.promo
226
+ ),
227
+ primary: (props) => checkDeprecatedAttribute({
228
+ ...props,
229
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
230
+ attributeNameNew: AttributeNames.display.default,
231
+ attributeValue: AttributeValues.type.PRIMARY
232
+ }) || isAttributeTrue({
233
+ ...props,
234
+ attributeName: AttributeNames.display.default,
235
+ attributeValue: AttributeValues.type.PRIMARY
236
+ }),
237
+ secondary: (props) => checkDeprecatedAttribute({
238
+ ...props,
239
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
240
+ attributeNameNew: AttributeNames.display.default,
241
+ attributeValue: AttributeValues.type.SECONDARY
242
+ }) || isAttributeTrue({
243
+ ...props,
244
+ attributeName: AttributeNames.display.default,
245
+ attributeValue: AttributeValues.type.SECONDARY
246
+ }),
247
+ short: createAttributeCheck(
248
+ AttributeNames.display.default,
249
+ AttributeValues.display.short
250
+ ),
251
+ standardCentered: (props) => checkDeprecatedAttribute({
252
+ ...props,
253
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
254
+ attributeNameNew: AttributeNames.display.default,
255
+ attributeValue: AttributeValues.layout.defaultCentered
256
+ }) || isAttributeTrue({
257
+ ...props,
258
+ attributeName: AttributeNames.deprecated.type.TYPE,
259
+ attributeValue: AttributeValues.layout.defaultCentered
260
+ }),
261
+ standardInterior: (props) => checkDeprecatedAttribute({
262
+ ...props,
263
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
264
+ attributeNameNew: AttributeNames.display.default,
265
+ attributeValue: AttributeValues.layout.defaultInterior
266
+ }) || isAttributeTrue({
267
+ ...props,
268
+ attributeName: AttributeNames.deprecated.type.TYPE,
269
+ attributeValue: AttributeValues.layout.defaultInterior
270
+ }),
271
+ standardInteriorCentered: (props) => checkDeprecatedAttribute({
272
+ ...props,
273
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
274
+ attributeNameNew: AttributeNames.display.default,
275
+ attributeValue: AttributeValues.layout.defaultInteriorCentered
276
+ }) || isAttributeTrue({
277
+ ...props,
278
+ attributeName: AttributeNames.deprecated.type.TYPE,
279
+ attributeValue: AttributeValues.layout.defaultInteriorCentered
280
+ }),
281
+ statement: createAttributeCheck(
282
+ AttributeNames.deprecated.display.DISPLAY,
283
+ AttributeValues.display.statement
284
+ ),
285
+ sticky: (props) => checkDeprecatedAttribute({
286
+ ...props,
287
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
288
+ attributeNameNew: AttributeNames.display.default,
289
+ attributeValue: AttributeValues.display.sticky
290
+ }) || isAttributeTrue({
291
+ ...props,
292
+ attributeName: AttributeNames.display.default,
293
+ attributeValue: AttributeValues.display.sticky
294
+ }),
295
+ stacked: (props) => checkDeprecatedAttribute({
296
+ ...props,
297
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
298
+ attributeNameNew: AttributeNames.display.default,
299
+ attributeValue: AttributeValues.display.stacked
300
+ }) || isAttributeTrue({
301
+ ...props,
302
+ attributeName: AttributeNames.display.default,
303
+ attributeValue: AttributeValues.display.stacked
304
+ }),
305
+ stackedInteriorDeprecated: createAttributeCheck(
306
+ AttributeNames.deprecated.type.TYPE,
307
+ AttributeValues.layout.stackedInterior
308
+ ),
309
+ stackedInterior: (props) => checkDeprecatedAttribute({
310
+ ...props,
311
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
312
+ attributeNameNew: AttributeNames.display.default,
313
+ attributeValue: AttributeValues.layout.stackedInterior
314
+ }) || isAttributeTrue({
315
+ ...props,
316
+ attributeName: AttributeNames.display.default,
317
+ attributeValue: AttributeValues.layout.stackedInterior
318
+ }),
319
+ tabular: (props) => checkDeprecatedAttribute({
320
+ ...props,
321
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY,
322
+ attributeNameNew: AttributeNames.display.default,
323
+ attributeValue: AttributeValues.display.tabular
324
+ }) || isAttributeTrue({
325
+ ...props,
326
+ attributeName: AttributeNames.display.default,
327
+ attributeValue: AttributeValues.display.tabular
328
+ })
329
+ };
330
+ const isInfo = {
331
+ admissions: createAttributeCheck(
332
+ AttributeNames.information.admissions,
333
+ AttributeValues.state.TRUE
334
+ ),
335
+ events: createAttributeCheck(
336
+ AttributeNames.information.events,
337
+ AttributeValues.state.TRUE
338
+ ),
339
+ news: createAttributeCheck(
340
+ AttributeNames.information.news,
341
+ AttributeValues.state.TRUE
342
+ ),
343
+ schools: createAttributeCheck(
344
+ AttributeNames.information.schools,
345
+ AttributeValues.state.TRUE
346
+ ),
347
+ searchDomain: createAttributeCheck(
348
+ AttributeNames.information.searchType,
349
+ AttributeValues.search.domain
350
+ )
351
+ };
352
+ const isLayout = {
353
+ alertOff: createAttributeCheck(
354
+ AttributeNames.layout.alertOff,
355
+ AttributeValues.state.TRUE
356
+ ),
357
+ alignmentRight: (props) => checkDeprecatedAttribute({
358
+ ...props,
359
+ attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_ALIGNMENT,
360
+ attributeNameNew: AttributeNames.layout.alignment,
361
+ attributeValue: AttributeValues.layout.right
362
+ }) || isAttributeTrue({
363
+ ...props,
364
+ attributeName: AttributeNames.layout.alignment,
365
+ attributeValue: AttributeValues.layout.right
366
+ }),
367
+ fixed: (props) => checkDeprecatedAttribute({
368
+ ...props,
369
+ attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_FIXED,
370
+ attributeNameNew: AttributeNames.layout.fixed,
371
+ attributeValue: ""
372
+ }) || isAttributeTrue({
373
+ ...props,
374
+ attributeName: AttributeNames.layout.fixed,
375
+ attributeValue: AttributeValues.state.TRUE
376
+ }),
377
+ fullImage: createAttributeCheck(
378
+ AttributeNames.deprecated.type.TYPE,
379
+ AttributeValues.layout.fullImage
380
+ ),
381
+ heightSmall: (props) => isAttributeTrue({
382
+ ...props,
383
+ attributeName: AttributeNames.layout.height,
384
+ attributeValue: AttributeValues.layout.small
385
+ }),
386
+ hidden: createAttributeCheck(
387
+ AttributeNames.layout.hidden,
388
+ AttributeValues.state.TRUE
389
+ ),
390
+ image: createAttributeCheck(
391
+ AttributeNames.deprecated.type.TYPE,
392
+ AttributeValues.display.image
393
+ ),
394
+ imagePositionRight: (props) => checkDeprecatedAttribute({
395
+ ...props,
396
+ attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,
397
+ attributeNameNew: AttributeNames.layout.imagePosition,
398
+ attributeValue: AttributeValues.layout.right
399
+ }) || isAttributeTrue({
400
+ ...props,
401
+ attributeName: AttributeNames.layout.imagePosition,
402
+ attributeValue: AttributeValues.layout.right,
403
+ defaultValue: true
404
+ }),
405
+ imagePositionLeft: (props) => checkDeprecatedAttribute({
406
+ ...props,
407
+ attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,
408
+ attributeNameNew: AttributeNames.layout.imagePosition,
409
+ attributeValue: AttributeValues.layout.left
410
+ }) || isAttributeTrue({
411
+ ...props,
412
+ attributeName: AttributeNames.layout.imagePosition,
413
+ attributeValue: AttributeValues.layout.left,
414
+ defaultValue: false
415
+ }),
416
+ imageScaled: (props) => isAttributeTrue({
417
+ ...props,
418
+ attributeName: AttributeNames.layout.imageScaled,
419
+ attributeValue: AttributeValues.state.TRUE,
420
+ defaultValue: true
421
+ }),
422
+ interior: createAttributeCheck(
423
+ AttributeNames.layout.interior,
424
+ AttributeValues.state.TRUE
425
+ ),
426
+ lock: createAttributeCheck(
427
+ AttributeNames.layout.lock,
428
+ AttributeValues.state.TRUE
429
+ ),
430
+ lockFull: createAttributeCheck(
431
+ AttributeNames.layout.lock,
432
+ AttributeValues.layout.large
433
+ ),
434
+ reverse: (props) => checkDeprecatedAttribute({
435
+ ...props,
436
+ attributeNameOld: AttributeNames.deprecated.layout.DEFAULT,
437
+ attributeNameNew: AttributeNames.layout.reverse,
438
+ attributeValue: AttributeValues.state.TRUE
439
+ }) || isAttributeTrue({
440
+ ...props,
441
+ attributeName: AttributeNames.layout.reverse,
442
+ attributeValue: AttributeValues.state.TRUE
443
+ }),
444
+ spaceHorizontalLarge: (props) => isAttributeTrue({
445
+ ...props,
446
+ attributeName: AttributeNames.layout.spaceHorizontal,
447
+ attributeValue: AttributeValues.layout.large
448
+ }),
449
+ textCentered: (props) => checkDeprecatedAttribute({
450
+ ...props,
451
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TEXT_CENTER,
452
+ attributeNameNew: AttributeNames.layout.text,
453
+ attributeValue: AttributeValues.layout.center
454
+ }) || isAttributeTrue({
455
+ ...props,
456
+ attributeName: AttributeNames.layout.text,
457
+ attributeValue: AttributeValues.layout.center
458
+ })
459
+ };
460
+ const isSharing = {
461
+ email: createAttributeCheck(
462
+ AttributeNames.sharing.email,
463
+ AttributeValues.state.TRUE
464
+ ),
465
+ print: createAttributeCheck(
466
+ AttributeNames.sharing.print,
467
+ AttributeValues.state.TRUE
468
+ )
469
+ };
470
+ const includesSharing = {
471
+ facebook: createAttributeCheck(
472
+ AttributeNames.social.facebook,
473
+ AttributeValues.state.TRUE,
474
+ true
475
+ ),
476
+ twitter: createAttributeCheck(
477
+ AttributeNames.social.twitter,
478
+ AttributeValues.state.TRUE,
479
+ true
480
+ )
481
+ };
482
+ const isTheme = {
483
+ dark: (props) => checkDeprecatedAttribute({
484
+ ...props,
485
+ attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,
486
+ attributeNameNew: AttributeNames.theme.default,
487
+ attributeValue: AttributeValues.theme.DARK
488
+ }) || isAttributeTrue({
489
+ ...props,
490
+ attributeName: AttributeNames.theme.default,
491
+ attributeValue: AttributeValues.theme.DARK
492
+ }),
493
+ gold: (props) => checkDeprecatedAttribute({
494
+ ...props,
495
+ attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,
496
+ attributeNameNew: AttributeNames.theme.default,
497
+ attributeValue: AttributeValues.theme.GOLD
498
+ }) || isAttributeTrue({
499
+ ...props,
500
+ attributeName: AttributeNames.theme.default,
501
+ attributeValue: AttributeValues.theme.GOLD
502
+ }),
503
+ light: (props) => checkDeprecatedAttribute({
504
+ ...props,
505
+ attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,
506
+ attributeNameNew: AttributeNames.theme.default,
507
+ attributeValue: AttributeValues.theme.LIGHT
508
+ }) || isAttributeTrue({
509
+ ...props,
510
+ attributeName: AttributeNames.theme.default,
511
+ attributeValue: AttributeValues.theme.LIGHT
512
+ }),
513
+ maryland: (props) => checkDeprecatedAttribute({
514
+ ...props,
515
+ attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,
516
+ attributeNameNew: AttributeNames.theme.default,
517
+ attributeValue: AttributeValues.theme.MARYLAND
518
+ }) || isAttributeTrue({
519
+ ...props,
520
+ attributeName: AttributeNames.theme.default,
521
+ attributeValue: AttributeValues.theme.MARYLAND
522
+ })
523
+ };
524
+ const isVisual = {
525
+ aligned: (props) => checkDeprecatedAttribute({
526
+ ...props,
527
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ALIGN,
528
+ attributeNameNew: AttributeNames.visual.imageAligned,
529
+ attributeValue: AttributeValues.state.TRUE
530
+ }) || isAttributeTrue({
531
+ ...props,
532
+ attributeName: AttributeNames.visual.imageAligned,
533
+ attributeValue: AttributeValues.state.TRUE
534
+ }),
535
+ bordered: (props) => checkDeprecatedAttribute({
536
+ ...props,
537
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_BORDER,
538
+ attributeNameNew: AttributeNames.visual.bordered,
539
+ attributeValue: AttributeValues.state.TRUE
540
+ }) || isAttributeTrue({
541
+ ...props,
542
+ attributeName: AttributeNames.visual.bordered,
543
+ attributeValue: AttributeValues.state.TRUE
544
+ }),
545
+ campaign: createAttributeCheck(
546
+ AttributeNames.visual.campaign,
547
+ AttributeValues.campaign.forward
548
+ ),
549
+ icon_seal: (props) => checkDeprecatedAttribute({
550
+ ...props,
551
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_HAS_LOGO,
552
+ attributeNameNew: AttributeNames.visual.iconSeal,
553
+ attributeValue: AttributeValues.state.TRUE
554
+ }) || isAttributeTrue({
555
+ ...props,
556
+ attributeName: AttributeNames.visual.iconSeal,
557
+ attributeValue: AttributeValues.state.TRUE
558
+ }),
559
+ open: (props) => checkDeprecatedAttribute({
560
+ ...props,
561
+ attributeNameOld: AttributeNames.deprecated.state.STATE_DEPRECATD,
562
+ attributeNameNew: AttributeNames.visual.open,
563
+ attributeValue: AttributeValues.state.OPENED
564
+ }) || isAttributeTrue({
565
+ ...props,
566
+ attributeName: AttributeNames.visual.open,
567
+ attributeValue: AttributeValues.state.TRUE
568
+ }),
569
+ play: createAttributeCheck(
570
+ AttributeNames.visual.play,
571
+ AttributeValues.state.TRUE
572
+ ),
573
+ quote: createAttributeCheck(
574
+ AttributeNames.deprecated.visual.VISUAL_QUOTE,
575
+ AttributeValues.state.TRUE
576
+ ),
577
+ showIcon: (props) => checkDeprecatedAttribute({
578
+ ...props,
579
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ICON,
580
+ attributeNameNew: AttributeNames.visual.icon,
581
+ attributeValue: AttributeValues.state.TRUE
582
+ }) || isAttributeTrue({
583
+ ...props,
584
+ attributeName: AttributeNames.visual.icon,
585
+ attributeValue: AttributeValues.state.TRUE
586
+ }),
587
+ sizeNormal: (props) => checkDeprecatedAttribute({
588
+ ...props,
589
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,
590
+ attributeNameNew: AttributeNames.visual.size,
591
+ attributeValue: AttributeValues.size.NORMAL
592
+ }) || isAttributeTrue({
593
+ ...props,
594
+ attributeName: AttributeNames.visual.size,
595
+ attributeValue: AttributeValues.size.NORMAL
596
+ }),
597
+ showTime: (props) => checkDeprecatedAttribute({
598
+ ...props,
599
+ attributeNameOld: AttributeNames.deprecated.feature.SHOW_TIME,
600
+ attributeNameNew: AttributeNames.visual.time,
601
+ attributeValue: AttributeValues.state.TRUE
602
+ }) || isAttributeTrue({
603
+ ...props,
604
+ attributeName: AttributeNames.visual.time,
605
+ attributeValue: AttributeValues.state.TRUE,
606
+ defaultValue: true
607
+ }),
608
+ sizeLarge: (props) => checkDeprecatedAttribute({
609
+ ...props,
610
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,
611
+ attributeNameNew: AttributeNames.visual.size,
612
+ attributeValue: AttributeValues.size.LARGE
613
+ }) || checkDeprecatedAttribute({
614
+ ...props,
615
+ attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,
616
+ attributeNameNew: AttributeNames.visual.size,
617
+ attributeValue: ""
618
+ }) || isAttributeTrue({
619
+ ...props,
620
+ attributeName: AttributeNames.visual.size,
621
+ attributeValue: AttributeValues.size.LARGE
622
+ }),
623
+ stickyFirst: createAttributeCheck(
624
+ AttributeNames.deprecated.option.OPTIONAL_STICKY_FIRST,
625
+ AttributeValues.state.TRUE,
626
+ true
627
+ ),
628
+ transparent: (props) => checkDeprecatedAttribute({
629
+ ...props,
630
+ attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TRANSPARENT,
631
+ attributeNameNew: AttributeNames.visual.transparent,
632
+ attributeValue: AttributeValues.state.TRUE
633
+ }) || isAttributeTrue({
634
+ ...props,
635
+ attributeName: AttributeNames.visual.transparent,
636
+ attributeValue: AttributeValues.state.TRUE
637
+ })
638
+ };
639
+ const isType = {
640
+ mega: (props) => checkDeprecatedAttribute({
641
+ ...props,
642
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
643
+ attributeNameNew: AttributeNames.type.default,
644
+ attributeValue: AttributeValues.type.MEGA
645
+ }) || isAttributeTrue({
646
+ ...props,
647
+ attributeName: AttributeNames.type.default,
648
+ attributeValue: AttributeValues.type.MEGA
649
+ }),
650
+ visual: (props) => checkDeprecatedAttribute({
651
+ ...props,
652
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
653
+ attributeNameNew: AttributeNames.type.default,
654
+ attributeValue: AttributeValues.type.VISUAL
655
+ }) || isAttributeTrue({
656
+ ...props,
657
+ attributeName: AttributeNames.type.default,
658
+ attributeValue: AttributeValues.type.VISUAL
659
+ }),
660
+ simple: (props) => checkDeprecatedAttribute({
661
+ ...props,
662
+ attributeNameOld: AttributeNames.deprecated.type.TYPE,
663
+ attributeNameNew: AttributeNames.type.default,
664
+ attributeValue: AttributeValues.type.SIMPLE
665
+ }) || isAttributeTrue({
666
+ ...props,
667
+ attributeName: AttributeNames.type.default,
668
+ attributeValue: AttributeValues.type.SIMPLE
669
+ })
670
+ };
671
+ const getValue = {
672
+ alertUrl: createValueGetter({
673
+ currentName: AttributeNames.information.alertUrl
674
+ }),
675
+ daysToHide: createValueGetter({
676
+ currentName: AttributeNames.visual.hiddenDays,
677
+ deprecatedName: AttributeNames.deprecated.visual.VISUAL_DAYS_TO_HIDE
678
+ }),
679
+ feedEntryRemoveIds: createValueGetter({
680
+ currentName: AttributeNames.information.removeIds,
681
+ deprecatedName: AttributeNames.deprecated.feed.FEED_NOT_ENTRIES
682
+ }),
683
+ feedFilterIds: createValueGetter({
684
+ currentName: AttributeNames.information.filterIds,
685
+ deprecatedName: AttributeNames.deprecated.feed.FEED_CATEGORIES
686
+ }),
687
+ feedToken: createValueGetter({
688
+ currentName: AttributeNames.information.token,
689
+ deprecatedName: AttributeNames.deprecated.feed.FEED_TOKEN
690
+ }),
691
+ giftUrl: createValueGetter({
692
+ currentName: AttributeNames.information.gift
693
+ }),
694
+ layoutColumnCount: createValueGetter({
695
+ currentName: AttributeNames.layout.columnCount,
696
+ deprecatedName: AttributeNames.deprecated.feed.FEED_COLUMN_COUNT
697
+ }),
698
+ layoutLock: createValueGetter({
699
+ currentName: AttributeNames.layout.lock
700
+ }),
701
+ layoutRowCount: createValueGetter({
702
+ currentName: AttributeNames.layout.rowCount,
703
+ deprecatedName: AttributeNames.deprecated.feed.FEED_ROW_COUNT
704
+ }),
705
+ title: createValueGetter({
706
+ currentName: AttributeNames.information.title
707
+ }),
708
+ topPosition: createValueGetter({
709
+ currentName: AttributeNames.layout.position,
710
+ deprecatedName: AttributeNames.deprecated.layout.LAYOUT_STICKY_TOP
711
+ }),
712
+ styleProps: (props) => {
713
+ const cssString = createValueGetter({
714
+ ...props,
715
+ currentName: AttributeNames.deprecated.visual.VISUAL_STYLE_PROPS
716
+ });
717
+ if (cssString && typeof cssString === "string") {
718
+ return Styles.utilities.create.jss.objectFromString(cssString);
719
+ }
720
+ },
721
+ url: createValueGetter({
722
+ currentName: AttributeNames.information.url
723
+ })
724
+ };
725
+ export {
726
+ getValue,
727
+ hasDecoration,
728
+ hasInfo,
729
+ includesFeature,
730
+ includesSharing,
731
+ isData,
732
+ isDisplay,
733
+ isInfo,
734
+ isLayout,
735
+ isSharing,
736
+ isTheme,
737
+ isType,
738
+ isVisual
739
+ };
740
+ //# sourceMappingURL=checks.mjs.map