@plusscommunities/pluss-feature-builder-app-d 1.0.1-beta.3
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/module/actions/featureBuilderActions.js +106 -0
- package/dist/module/actions/featureBuilderActions.js.map +1 -0
- package/dist/module/actions/featureBuilderStringsActions.js +106 -0
- package/dist/module/actions/featureBuilderStringsActions.js.map +1 -0
- package/dist/module/actions/index.js +12 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +7 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/components/FeatureDetailScreen.js +725 -0
- package/dist/module/components/FeatureDetailScreen.js.map +1 -0
- package/dist/module/components/FeatureListItem.js +174 -0
- package/dist/module/components/FeatureListItem.js.map +1 -0
- package/dist/module/components/FeatureListScreen.js +159 -0
- package/dist/module/components/FeatureListScreen.js.map +1 -0
- package/dist/module/components/FieldRenderer.js +218 -0
- package/dist/module/components/FieldRenderer.js.map +1 -0
- package/dist/module/components/FileDownload.js +74 -0
- package/dist/module/components/FileDownload.js.map +1 -0
- package/dist/module/components/WidgetGrid.js +158 -0
- package/dist/module/components/WidgetGrid.js.map +1 -0
- package/dist/module/components/WidgetLarge.js +274 -0
- package/dist/module/components/WidgetLarge.js.map +1 -0
- package/dist/module/components/WidgetSmall.js +315 -0
- package/dist/module/components/WidgetSmall.js.map +1 -0
- package/dist/module/components/common/index.js +25 -0
- package/dist/module/components/common/index.js.map +1 -0
- package/dist/module/components/layouts/CondensedList.js +195 -0
- package/dist/module/components/layouts/CondensedList.js.map +1 -0
- package/dist/module/components/layouts/FeatureImageList.js +172 -0
- package/dist/module/components/layouts/FeatureImageList.js.map +1 -0
- package/dist/module/components/layouts/RoundImageList.js +198 -0
- package/dist/module/components/layouts/RoundImageList.js.map +1 -0
- package/dist/module/components/layouts/SquareImageList.js +185 -0
- package/dist/module/components/layouts/SquareImageList.js.map +1 -0
- package/dist/module/config/index.js +10 -0
- package/dist/module/config/index.js.map +1 -0
- package/dist/module/core.config.js +17 -0
- package/dist/module/core.config.js.map +1 -0
- package/dist/module/feature.config.js +113 -0
- package/dist/module/feature.config.js.map +1 -0
- package/dist/module/index.js +24 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/Colors.js +25 -0
- package/dist/module/js/Colors.js.map +1 -0
- package/dist/module/js/FieldTypes.js +123 -0
- package/dist/module/js/FieldTypes.js.map +1 -0
- package/dist/module/js/NavigationService.js +10 -0
- package/dist/module/js/NavigationService.js.map +1 -0
- package/dist/module/js/Styles.js +3 -0
- package/dist/module/js/Styles.js.map +1 -0
- package/dist/module/js/helpers.js +29 -0
- package/dist/module/js/helpers.js.map +1 -0
- package/dist/module/js/index.js +24 -0
- package/dist/module/js/index.js.map +1 -0
- package/dist/module/js/spacing.js +29 -0
- package/dist/module/js/spacing.js.map +1 -0
- package/dist/module/js/types.js +254 -0
- package/dist/module/js/types.js.map +1 -0
- package/dist/module/reducers/featureBuilderReducer.js +75 -0
- package/dist/module/reducers/featureBuilderReducer.js.map +1 -0
- package/dist/module/utils/featureSelectors.js +9 -0
- package/dist/module/utils/featureSelectors.js.map +1 -0
- package/dist/module/values.config.a.js +96 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +96 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +96 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +96 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.js +96 -0
- package/dist/module/values.config.js.map +1 -0
- package/dist/module/webapi/featureBuilderAPI.js +59 -0
- package/dist/module/webapi/featureBuilderAPI.js.map +1 -0
- package/dist/module/webapi/helper.js +4 -0
- package/dist/module/webapi/helper.js.map +1 -0
- package/dist/module/webapi/index.js +8 -0
- package/dist/module/webapi/index.js.map +1 -0
- package/package.json +62 -0
- package/src/actions/featureBuilderActions.js +112 -0
- package/src/actions/featureBuilderStringsActions.js +114 -0
- package/src/actions/index.js +12 -0
- package/src/actions/types.js +7 -0
- package/src/components/FeatureDetailScreen.js +817 -0
- package/src/components/FeatureListItem.js +198 -0
- package/src/components/FeatureListScreen.js +160 -0
- package/src/components/FieldRenderer.js +272 -0
- package/src/components/FileDownload.js +79 -0
- package/src/components/WidgetGrid.js +181 -0
- package/src/components/WidgetLarge.js +305 -0
- package/src/components/WidgetSmall.js +344 -0
- package/src/components/common/index.js +25 -0
- package/src/components/layouts/CondensedList.js +230 -0
- package/src/components/layouts/FeatureImageList.js +193 -0
- package/src/components/layouts/RoundImageList.js +219 -0
- package/src/components/layouts/SquareImageList.js +205 -0
- package/src/config/index.js +10 -0
- package/src/core.config.js +29 -0
- package/src/feature.config.js +127 -0
- package/src/index.js +27 -0
- package/src/js/Colors.js +30 -0
- package/src/js/FieldTypes.js +131 -0
- package/src/js/NavigationService.js +12 -0
- package/src/js/Styles.js +3 -0
- package/src/js/helpers.js +30 -0
- package/src/js/index.js +24 -0
- package/src/js/spacing.js +30 -0
- package/src/js/types.js +253 -0
- package/src/reducers/featureBuilderReducer.js +64 -0
- package/src/utils/featureSelectors.js +8 -0
- package/src/values.config.a.js +104 -0
- package/src/values.config.b.js +104 -0
- package/src/values.config.c.js +104 -0
- package/src/values.config.d.js +104 -0
- package/src/values.config.js +104 -0
- package/src/webapi/featureBuilderAPI.js +65 -0
- package/src/webapi/helper.js +4 -0
- package/src/webapi/index.js +8 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, View, StyleSheet, TouchableOpacity, Linking } from "react-native";
|
|
3
|
+
import { Icon } from "react-native-elements";
|
|
4
|
+
import { Colours, Components, Helper } from "../core.config";
|
|
5
|
+
import { Attachment, InlineButton } from "./common";
|
|
6
|
+
import { FIELD_TYPES, isCTAField, isImageField, isLinkField } from "../js/FieldTypes";
|
|
7
|
+
import { SPACING } from "../js/spacing";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Smart Field Renderer Component
|
|
11
|
+
* Renders different field types based on field definition and value
|
|
12
|
+
*/
|
|
13
|
+
const FieldRenderer = ({
|
|
14
|
+
fieldId,
|
|
15
|
+
fieldValue,
|
|
16
|
+
fieldDefinition,
|
|
17
|
+
onFieldPress,
|
|
18
|
+
color,
|
|
19
|
+
style
|
|
20
|
+
}) => {
|
|
21
|
+
var _fieldDefinition$valu;
|
|
22
|
+
const fieldType = fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.type;
|
|
23
|
+
const fieldLabel = (fieldDefinition === null || fieldDefinition === void 0 || (_fieldDefinition$valu = fieldDefinition.values) === null || _fieldDefinition$valu === void 0 ? void 0 : _fieldDefinition$valu.label) || fieldId;
|
|
24
|
+
const handleLinkPress = url => {
|
|
25
|
+
if (url) {
|
|
26
|
+
Linking.openURL(url).catch(err => {
|
|
27
|
+
// Silently handle URL open errors
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// If no field type, try to infer from value structure
|
|
33
|
+
if (!fieldType) {
|
|
34
|
+
if (isCTAField(fieldValue)) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(InlineButton, {
|
|
36
|
+
large: true,
|
|
37
|
+
color: color || Colours.BRANDING_MAIN,
|
|
38
|
+
style: style,
|
|
39
|
+
onPress: () => (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.url) && handleLinkPress(fieldValue.url)
|
|
40
|
+
}, (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label) || fieldLabel);
|
|
41
|
+
}
|
|
42
|
+
if (isImageField(fieldValue)) {
|
|
43
|
+
// Handle image fields - typically rendered elsewhere in layouts
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
if (isLinkField(fieldValue)) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
48
|
+
style: [styles.linkContainer, style],
|
|
49
|
+
onPress: () => handleLinkPress(fieldValue)
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
51
|
+
type: "font-awesome",
|
|
52
|
+
name: "link",
|
|
53
|
+
size: 16,
|
|
54
|
+
color: color || Colours.BRANDING_MAIN,
|
|
55
|
+
style: styles.linkIcon
|
|
56
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
57
|
+
style: [styles.linkText, {
|
|
58
|
+
color: color || Colours.BRANDING_MAIN
|
|
59
|
+
}],
|
|
60
|
+
numberOfLines: 2
|
|
61
|
+
}, fieldValue));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Default to text field
|
|
65
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
66
|
+
style: [styles.text, style],
|
|
67
|
+
numberOfLines: 3
|
|
68
|
+
}, fieldValue));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Type-based rendering
|
|
72
|
+
switch (fieldType) {
|
|
73
|
+
case FIELD_TYPES.CTA:
|
|
74
|
+
return /*#__PURE__*/React.createElement(InlineButton, {
|
|
75
|
+
large: true,
|
|
76
|
+
color: color || Colours.BRANDING_MAIN,
|
|
77
|
+
style: style,
|
|
78
|
+
onPress: () => (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.url) && handleLinkPress(fieldValue.url)
|
|
79
|
+
}, (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label) || fieldLabel);
|
|
80
|
+
case FIELD_TYPES.TITLE:
|
|
81
|
+
case FIELD_TYPES.TEXT:
|
|
82
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
83
|
+
style: [styles.text, styles.titleText, style],
|
|
84
|
+
numberOfLines: 2
|
|
85
|
+
}, fieldValue);
|
|
86
|
+
case FIELD_TYPES.DESCRIPTION:
|
|
87
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
88
|
+
style: [styles.text, styles.descriptionText, style]
|
|
89
|
+
}, fieldValue);
|
|
90
|
+
case FIELD_TYPES.EMAIL:
|
|
91
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
92
|
+
style: [styles.linkContainer, style],
|
|
93
|
+
onPress: () => handleLinkPress(`mailto:${fieldValue}`)
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
95
|
+
type: "font-awesome",
|
|
96
|
+
name: "envelope",
|
|
97
|
+
size: 16,
|
|
98
|
+
color: color || Colours.BRANDING_MAIN,
|
|
99
|
+
style: styles.linkIcon
|
|
100
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
101
|
+
style: [styles.linkText, {
|
|
102
|
+
color: color || Colours.BRANDING_MAIN
|
|
103
|
+
}],
|
|
104
|
+
numberOfLines: 1
|
|
105
|
+
}, fieldValue));
|
|
106
|
+
case FIELD_TYPES.NUMBER:
|
|
107
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
style: [styles.text, styles.numberText, style]
|
|
109
|
+
}, fieldValue);
|
|
110
|
+
case FIELD_TYPES.DATE:
|
|
111
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
112
|
+
style: [styles.dateContainer, style]
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
114
|
+
type: "font-awesome",
|
|
115
|
+
name: "calendar",
|
|
116
|
+
size: 16,
|
|
117
|
+
color: Colours.TEXT_LIGHT,
|
|
118
|
+
style: styles.dateIcon
|
|
119
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
120
|
+
style: [styles.text, styles.dateText]
|
|
121
|
+
}, fieldValue));
|
|
122
|
+
case FIELD_TYPES.IMAGE:
|
|
123
|
+
case FIELD_TYPES.FEATURE_IMAGE:
|
|
124
|
+
// Images are typically rendered by the layout components
|
|
125
|
+
return null;
|
|
126
|
+
case FIELD_TYPES.FILE:
|
|
127
|
+
// Handle both single file and multiple files (array)
|
|
128
|
+
const files = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
|
|
129
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
130
|
+
style: styles.filesContainer
|
|
131
|
+
}, files.map((file, index) => {
|
|
132
|
+
var _file$url;
|
|
133
|
+
// Skip null/undefined files
|
|
134
|
+
if (!file) return null;
|
|
135
|
+
return /*#__PURE__*/React.createElement(Attachment, {
|
|
136
|
+
key: index,
|
|
137
|
+
onPress: () => onFieldPress && onFieldPress(fieldId, file),
|
|
138
|
+
title: (file === null || file === void 0 ? void 0 : file.name) || (file === null || file === void 0 || (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split("/").pop()) || "Document"
|
|
139
|
+
});
|
|
140
|
+
}));
|
|
141
|
+
default:
|
|
142
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
143
|
+
style: [styles.text, style],
|
|
144
|
+
numberOfLines: 3
|
|
145
|
+
}, fieldValue);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const styles = StyleSheet.create({
|
|
149
|
+
text: {
|
|
150
|
+
fontFamily: "sf-regular",
|
|
151
|
+
fontSize: 16,
|
|
152
|
+
color: Colours.TEXT_DARK
|
|
153
|
+
},
|
|
154
|
+
titleText: {
|
|
155
|
+
fontFamily: "sf-semibold",
|
|
156
|
+
fontSize: 16,
|
|
157
|
+
fontWeight: "600"
|
|
158
|
+
},
|
|
159
|
+
descriptionText: {
|
|
160
|
+
fontFamily: "sf-regular",
|
|
161
|
+
fontSize: 14,
|
|
162
|
+
lineHeight: 20,
|
|
163
|
+
marginVertical: 12
|
|
164
|
+
},
|
|
165
|
+
numberText: {
|
|
166
|
+
fontFamily: "sf-medium",
|
|
167
|
+
fontSize: 16,
|
|
168
|
+
fontWeight: "500"
|
|
169
|
+
},
|
|
170
|
+
linkContainer: {
|
|
171
|
+
flexDirection: "row",
|
|
172
|
+
alignItems: "center",
|
|
173
|
+
paddingVertical: SPACING.XS
|
|
174
|
+
},
|
|
175
|
+
linkIcon: {
|
|
176
|
+
marginRight: SPACING.SM
|
|
177
|
+
},
|
|
178
|
+
linkText: {
|
|
179
|
+
fontFamily: "sf-medium",
|
|
180
|
+
fontSize: 16,
|
|
181
|
+
textDecorationLine: "underline"
|
|
182
|
+
},
|
|
183
|
+
dateContainer: {
|
|
184
|
+
flexDirection: "row",
|
|
185
|
+
alignItems: "center",
|
|
186
|
+
paddingVertical: SPACING.XS
|
|
187
|
+
},
|
|
188
|
+
dateIcon: {
|
|
189
|
+
marginRight: SPACING.SM
|
|
190
|
+
},
|
|
191
|
+
dateText: {
|
|
192
|
+
fontFamily: "sf-regular",
|
|
193
|
+
fontSize: 14,
|
|
194
|
+
color: Colours.TEXT_LIGHT
|
|
195
|
+
},
|
|
196
|
+
fileContainer: {
|
|
197
|
+
flexDirection: "row",
|
|
198
|
+
alignItems: "center",
|
|
199
|
+
paddingVertical: SPACING.XS,
|
|
200
|
+
backgroundColor: Colours.BACKGROUND_LIGHT,
|
|
201
|
+
padding: SPACING.SM,
|
|
202
|
+
borderRadius: SPACING.XS
|
|
203
|
+
},
|
|
204
|
+
fileIcon: {
|
|
205
|
+
marginRight: SPACING.SM
|
|
206
|
+
},
|
|
207
|
+
fileText: {
|
|
208
|
+
fontFamily: "sf-medium",
|
|
209
|
+
fontSize: 14,
|
|
210
|
+
flex: 1
|
|
211
|
+
},
|
|
212
|
+
// File container for multiple attachments
|
|
213
|
+
filesContainer: {
|
|
214
|
+
marginVertical: SPACING.XS
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
export default FieldRenderer;
|
|
218
|
+
//# sourceMappingURL=FieldRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","View","StyleSheet","TouchableOpacity","Linking","Icon","Colours","Components","Helper","Attachment","InlineButton","FIELD_TYPES","isCTAField","isImageField","isLinkField","SPACING","FieldRenderer","fieldId","fieldValue","fieldDefinition","onFieldPress","color","style","_fieldDefinition$valu","fieldType","type","fieldLabel","values","label","handleLinkPress","url","openURL","catch","err","createElement","large","BRANDING_MAIN","onPress","styles","linkContainer","name","size","linkIcon","linkText","numberOfLines","Fragment","text","CTA","TITLE","TEXT","titleText","DESCRIPTION","descriptionText","EMAIL","NUMBER","numberText","DATE","dateContainer","TEXT_LIGHT","dateIcon","dateText","IMAGE","FEATURE_IMAGE","FILE","files","Array","isArray","filesContainer","map","file","index","_file$url","key","title","split","pop","create","fontFamily","fontSize","TEXT_DARK","fontWeight","lineHeight","marginVertical","flexDirection","alignItems","paddingVertical","XS","marginRight","SM","textDecorationLine","fileContainer","backgroundColor","BACKGROUND_LIGHT","padding","borderRadius","fileIcon","fileText","flex"],"sources":["FieldRenderer.js"],"sourcesContent":["import React from \"react\";\nimport {\n\tText,\n\tView,\n\tStyleSheet,\n\tTouchableOpacity,\n\tLinking,\n} from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport { Colours, Components, Helper } from \"../core.config\";\nimport { Attachment, InlineButton } from \"./common\";\nimport {\n\tFIELD_TYPES,\n\tisCTAField,\n\tisImageField,\n\tisLinkField,\n} from \"../js/FieldTypes\";\nimport { SPACING } from \"../js/spacing\";\n\n/**\n * Smart Field Renderer Component\n * Renders different field types based on field definition and value\n */\nconst FieldRenderer = ({\n\tfieldId,\n\tfieldValue,\n\tfieldDefinition,\n\tonFieldPress,\n\tcolor,\n\tstyle,\n}) => {\n\tconst fieldType = fieldDefinition?.type;\n\tconst fieldLabel = fieldDefinition?.values?.label || fieldId;\n\n\tconst handleLinkPress = (url) => {\n\t\tif (url) {\n\t\t\tLinking.openURL(url).catch((err) => {\n\t\t\t\t// Silently handle URL open errors\n\t\t\t});\n\t\t}\n\t};\n\n\t// If no field type, try to infer from value structure\n\tif (!fieldType) {\n\t\tif (isCTAField(fieldValue)) {\n\t\t\treturn (\n\t\t\t\t<InlineButton\n\t\t\t\t\tlarge\n\t\t\t\t\tcolor={color || Colours.BRANDING_MAIN}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tonPress={() => fieldValue?.url && handleLinkPress(fieldValue.url)}\n\t\t\t\t>\n\t\t\t\t\t{fieldValue?.label || fieldLabel}\n\t\t\t\t</InlineButton>\n\t\t\t);\n\t\t}\n\n\t\tif (isImageField(fieldValue)) {\n\t\t\t// Handle image fields - typically rendered elsewhere in layouts\n\t\t\treturn null;\n\t\t}\n\n\t\tif (isLinkField(fieldValue)) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tstyle={[styles.linkContainer, style]}\n\t\t\t\t\tonPress={() => handleLinkPress(fieldValue)}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\tcolor={color || Colours.BRANDING_MAIN}\n\t\t\t\t\t\tstyle={styles.linkIcon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[styles.linkText, { color: color || Colours.BRANDING_MAIN }]}\n\t\t\t\t\t\tnumberOfLines={2}\n\t\t\t\t\t>\n\t\t\t\t\t\t{fieldValue}\n\t\t\t\t\t</Text>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\n\t\t// Default to text field\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Text style={[styles.text, style]} numberOfLines={3}>\n\t\t\t\t\t{fieldValue}\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t);\n\t}\n\n\t// Type-based rendering\n\tswitch (fieldType) {\n\t\tcase FIELD_TYPES.CTA:\n\t\t\treturn (\n\t\t\t\t<InlineButton\n\t\t\t\t\tlarge\n\t\t\t\t\tcolor={color || Colours.BRANDING_MAIN}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tonPress={() => fieldValue?.url && handleLinkPress(fieldValue.url)}\n\t\t\t\t>\n\t\t\t\t\t{fieldValue?.label || fieldLabel}\n\t\t\t\t</InlineButton>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.TITLE:\n\t\tcase FIELD_TYPES.TEXT:\n\t\t\treturn (\n\t\t\t\t<Text style={[styles.text, styles.titleText, style]} numberOfLines={2}>\n\t\t\t\t\t{fieldValue}\n\t\t\t\t</Text>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.DESCRIPTION:\n\t\t\treturn (\n\t\t\t\t<Text style={[styles.text, styles.descriptionText, style]}>\n\t\t\t\t\t{fieldValue}\n\t\t\t\t</Text>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.EMAIL:\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tstyle={[styles.linkContainer, style]}\n\t\t\t\t\tonPress={() => handleLinkPress(`mailto:${fieldValue}`)}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\tname=\"envelope\"\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\tcolor={color || Colours.BRANDING_MAIN}\n\t\t\t\t\t\tstyle={styles.linkIcon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[styles.linkText, { color: color || Colours.BRANDING_MAIN }]}\n\t\t\t\t\t\tnumberOfLines={1}\n\t\t\t\t\t>\n\t\t\t\t\t\t{fieldValue}\n\t\t\t\t\t</Text>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.NUMBER:\n\t\t\treturn (\n\t\t\t\t<Text style={[styles.text, styles.numberText, style]}>\n\t\t\t\t\t{fieldValue}\n\t\t\t\t</Text>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.DATE:\n\t\t\treturn (\n\t\t\t\t<View style={[styles.dateContainer, style]}>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\tname=\"calendar\"\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\tcolor={Colours.TEXT_LIGHT}\n\t\t\t\t\t\tstyle={styles.dateIcon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text style={[styles.text, styles.dateText]}>{fieldValue}</Text>\n\t\t\t\t</View>\n\t\t\t);\n\n\t\tcase FIELD_TYPES.IMAGE:\n\t\tcase FIELD_TYPES.FEATURE_IMAGE:\n\t\t\t// Images are typically rendered by the layout components\n\t\t\treturn null;\n\n\t\tcase FIELD_TYPES.FILE:\n\t\t\t// Handle both single file and multiple files (array)\n\t\t\tconst files = Array.isArray(fieldValue) ? fieldValue : [fieldValue];\n\t\t\treturn (\n\t\t\t\t<View style={styles.filesContainer}>\n\t\t\t\t\t{files.map((file, index) => {\n\t\t\t\t\t\t// Skip null/undefined files\n\t\t\t\t\t\tif (!file) return null;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Attachment\n\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\tonPress={() => onFieldPress && onFieldPress(fieldId, file)}\n\t\t\t\t\t\t\t\ttitle={file?.name || file?.url?.split(\"/\").pop() || \"Document\"}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</View>\n\t\t\t);\n\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<Text style={[styles.text, style]} numberOfLines={3}>\n\t\t\t\t\t{fieldValue}\n\t\t\t\t</Text>\n\t\t\t);\n\t}\n};\n\nconst styles = StyleSheet.create({\n\ttext: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tcolor: Colours.TEXT_DARK,\n\t},\n\ttitleText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"600\",\n\t},\n\tdescriptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tmarginVertical: 12,\n\t},\n\tnumberText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"500\",\n\t},\n\tlinkContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: SPACING.XS,\n\t},\n\tlinkIcon: {\n\t\tmarginRight: SPACING.SM,\n\t},\n\tlinkText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\ttextDecorationLine: \"underline\",\n\t},\n\tdateContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: SPACING.XS,\n\t},\n\tdateIcon: {\n\t\tmarginRight: SPACING.SM,\n\t},\n\tdateText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 14,\n\t\tcolor: Colours.TEXT_LIGHT,\n\t},\n\tfileContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: SPACING.XS,\n\t\tbackgroundColor: Colours.BACKGROUND_LIGHT,\n\t\tpadding: SPACING.SM,\n\t\tborderRadius: SPACING.XS,\n\t},\n\tfileIcon: {\n\t\tmarginRight: SPACING.SM,\n\t},\n\tfileText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tflex: 1,\n\t},\n\t// File container for multiple attachments\n\tfilesContainer: {\n\t\tmarginVertical: SPACING.XS,\n\t},\n});\n\nexport default FieldRenderer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACCC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,OAAO,QACD,cAAc;AACrB,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,EAAEC,UAAU,EAAEC,MAAM,QAAQ,gBAAgB;AAC5D,SAASC,UAAU,EAAEC,YAAY,QAAQ,UAAU;AACnD,SACCC,WAAW,EACXC,UAAU,EACVC,YAAY,EACZC,WAAW,QACL,kBAAkB;AACzB,SAASC,OAAO,QAAQ,eAAe;;AAEvC;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAGA,CAAC;EACtBC,OAAO;EACPC,UAAU;EACVC,eAAe;EACfC,YAAY;EACZC,KAAK;EACLC;AACD,CAAC,KAAK;EAAA,IAAAC,qBAAA;EACL,MAAMC,SAAS,GAAGL,eAAe,aAAfA,eAA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a,EAAE;IACdP,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAEtE,OAAO,CAACuE,EAAE;IAC3BK,eAAe,EAAErF,OAAO,CAACsF,gBAAgB;IACzCC,OAAO,EAAE9E,OAAO,CAACyE,EAAE;IACnBM,YAAY,EAAE/E,OAAO,CAACuE;EACvB,CAAC;EACDS,QAAQ,EAAE;IACTR,WAAW,EAAExE,OAAO,CAACyE;EACtB,CAAC;EACDQ,QAAQ,EAAE;IACTnB,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZmB,IAAI,EAAE;EACP,CAAC;EACD;EACA9B,cAAc,EAAE;IACfe,cAAc,EAAEnE,OAAO,CAACuE;EACzB;AACD,CAAC,CAAC;AAEF,eAAetE,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
|
+
import { Icon } from "react-native-elements";
|
|
4
|
+
import { Colours } from "../core.config";
|
|
5
|
+
import { SPACING } from "../js/spacing";
|
|
6
|
+
import { TEXT_DARK } from "../core.config";
|
|
7
|
+
const FileDownload = ({
|
|
8
|
+
file,
|
|
9
|
+
onPress,
|
|
10
|
+
color,
|
|
11
|
+
style
|
|
12
|
+
}) => {
|
|
13
|
+
const fileName = (file === null || file === void 0 ? void 0 : file.name) || (file === null || file === void 0 ? void 0 : file.url) && file.url.split("?")[0].split("#")[0].split("/").pop() || "Document";
|
|
14
|
+
const downloadColor = color || Colours.BRANDING_MAIN;
|
|
15
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
16
|
+
style: [styles.container, style],
|
|
17
|
+
onPress: () => onPress && onPress(file)
|
|
18
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: styles.extensionIcon
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
name: "paperclip",
|
|
22
|
+
type: "font-awesome",
|
|
23
|
+
size: 16,
|
|
24
|
+
color: downloadColor
|
|
25
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: styles.textContainer
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
style: [styles.fileName, {
|
|
29
|
+
color: TEXT_DARK
|
|
30
|
+
}],
|
|
31
|
+
numberOfLines: 1
|
|
32
|
+
}, fileName), /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
+
name: "download",
|
|
34
|
+
type: "font-awesome",
|
|
35
|
+
size: 16,
|
|
36
|
+
color: downloadColor
|
|
37
|
+
})));
|
|
38
|
+
};
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
flexDirection: "row",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
paddingVertical: SPACING.SM,
|
|
44
|
+
paddingRight: SPACING.MD,
|
|
45
|
+
backgroundColor: "#ffffff",
|
|
46
|
+
borderRadius: SPACING.XS,
|
|
47
|
+
marginVertical: SPACING.XS / 2
|
|
48
|
+
},
|
|
49
|
+
extensionIcon: {
|
|
50
|
+
width: 32,
|
|
51
|
+
height: 32,
|
|
52
|
+
borderRadius: SPACING.XS / 2,
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
backgroundColor: "#f5f5f5"
|
|
56
|
+
},
|
|
57
|
+
textContainer: {
|
|
58
|
+
flex: 1,
|
|
59
|
+
flexDirection: "row",
|
|
60
|
+
justifyContent: "space-between",
|
|
61
|
+
alignItems: "center"
|
|
62
|
+
},
|
|
63
|
+
fileName: {
|
|
64
|
+
fontFamily: "sf-medium",
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
fontWeight: "600",
|
|
67
|
+
lineHeight: 20,
|
|
68
|
+
flex: 1,
|
|
69
|
+
marginRight: SPACING.SM,
|
|
70
|
+
marginLeft: SPACING.SM
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export default FileDownload;
|
|
74
|
+
//# sourceMappingURL=FileDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","TouchableOpacity","StyleSheet","Icon","Colours","SPACING","TEXT_DARK","FileDownload","file","onPress","color","style","fileName","name","url","split","pop","downloadColor","BRANDING_MAIN","createElement","styles","container","extensionIcon","type","size","textContainer","numberOfLines","create","flexDirection","alignItems","paddingVertical","SM","paddingRight","MD","backgroundColor","borderRadius","XS","marginVertical","width","height","justifyContent","flex","fontFamily","fontSize","fontWeight","lineHeight","marginRight","marginLeft"],"sources":["FileDownload.js"],"sourcesContent":["import React from \"react\";\nimport { View, Text, TouchableOpacity, StyleSheet } from \"react-native\";\nimport { Icon } from \"react-native-elements\";\nimport { Colours } from \"../core.config\";\nimport { SPACING } from \"../js/spacing\";\nimport { TEXT_DARK } from \"../core.config\";\n\nconst FileDownload = ({ file, onPress, color, style }) => {\n\tconst fileName =\n\t\tfile?.name ||\n\t\t(file?.url && file.url.split(\"?\")[0].split(\"#\")[0].split(\"/\").pop()) ||\n\t\t\"Document\";\n\tconst downloadColor = color || Colours.BRANDING_MAIN;\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tstyle={[styles.container, style]}\n\t\t\tonPress={() => onPress && onPress(file)}\n\t\t>\n\t\t\t<View style={styles.extensionIcon}>\n\t\t\t\t<Icon\n\t\t\t\t\tname=\"paperclip\"\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tsize={16}\n\t\t\t\t\tcolor={downloadColor}\n\t\t\t\t/>\n\t\t\t</View>\n\n\t\t\t<View style={styles.textContainer}>\n\t\t\t\t<Text style={[styles.fileName, { color: TEXT_DARK }]} numberOfLines={1}>\n\t\t\t\t\t{fileName}\n\t\t\t\t</Text>\n\t\t\t\t<Icon\n\t\t\t\t\tname=\"download\"\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tsize={16}\n\t\t\t\t\tcolor={downloadColor}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n};\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tpaddingVertical: SPACING.SM,\n\t\tpaddingRight: SPACING.MD,\n\t\tbackgroundColor: \"#ffffff\",\n\t\tborderRadius: SPACING.XS,\n\t\tmarginVertical: SPACING.XS / 2,\n\t},\n\textensionIcon: {\n\t\twidth: 32,\n\t\theight: 32,\n\t\tborderRadius: SPACING.XS / 2,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t\tbackgroundColor: \"#f5f5f5\",\n\t},\n\ttextContainer: {\n\t\tflex: 1,\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t\talignItems: \"center\",\n\t},\n\tfileName: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"600\",\n\t\tlineHeight: 20,\n\t\tflex: 1,\n\t\tmarginRight: SPACING.SM,\n\t\tmarginLeft: SPACING.SM,\n\t},\n});\n\nexport default FileDownload;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AACvE,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,SAAS,QAAQ,gBAAgB;AAE1C,MAAMC,YAAY,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAM,CAAC,KAAK;EACzD,MAAMC,QAAQ,GACb,CAAAJ,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEK,IAAI,KACT,CAAAL,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEM,GAAG,KAAIN,IAAI,CAACM,GAAG,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CA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eAAe,EAAE,SAAS;IAC1BC,YAAY,EAAE9B,OAAO,CAAC+B,EAAE;IACxBC,cAAc,EAAEhC,OAAO,CAAC+B,EAAE,GAAG;EAC9B,CAAC;EACDd,aAAa,EAAE;IACdgB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVJ,YAAY,EAAE9B,OAAO,CAAC+B,EAAE,GAAG,CAAC;IAC5BI,cAAc,EAAE,QAAQ;IACxBX,UAAU,EAAE,QAAQ;IACpBK,eAAe,EAAE;EAClB,CAAC;EACDT,aAAa,EAAE;IACdgB,IAAI,EAAE,CAAC;IACPb,aAAa,EAAE,KAAK;IACpBY,cAAc,EAAE,eAAe;IAC/BX,UAAU,EAAE;EACb,CAAC;EACDjB,QAAQ,EAAE;IACT8B,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE,EAAE;IACdJ,IAAI,EAAE,CAAC;IACPK,WAAW,EAAEzC,OAAO,CAAC0B,EAAE;IACvBgB,UAAU,EAAE1C,OAAO,CAAC0B;EACrB;AACD,CAAC,CAAC;AAEF,eAAexB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { Text, View, StyleSheet, TouchableOpacity, Dimensions } from "react-native";
|
|
6
|
+
import { connect } from "react-redux";
|
|
7
|
+
import _ from "lodash";
|
|
8
|
+
import { Services } from "../feature.config";
|
|
9
|
+
import { Components } from "../core.config";
|
|
10
|
+
import { values } from "../values.config";
|
|
11
|
+
import { selectActiveFeatureDefinitions } from "../reducers/featureBuilderReducer";
|
|
12
|
+
import { getTargetFeatureDefinition } from "../utils/featureSelectors";
|
|
13
|
+
import { SPACING } from "../js/spacing";
|
|
14
|
+
import { getMainBrandingColourFromState } from "../js";
|
|
15
|
+
// Import SVGIcon directly from main app since extension has import issues
|
|
16
|
+
// Using a different approach - we'll use a simple text representation for now
|
|
17
|
+
// import { SVGIcon } from '../../../../../src/components/common';
|
|
18
|
+
|
|
19
|
+
class WidgetGrid extends Component {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
_defineProperty(this, "refresh", () => {
|
|
23
|
+
this.onLoadingChanged(true, async () => {
|
|
24
|
+
try {
|
|
25
|
+
const {
|
|
26
|
+
initializeFeatureBuilder
|
|
27
|
+
} = await import("../actions/featureBuilderActions");
|
|
28
|
+
await initializeFeatureBuilder()(this.props.dispatch, () => this.props.getState);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
// Silently handle refresh errors
|
|
31
|
+
} finally {
|
|
32
|
+
this.onLoadingChanged(false);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
_defineProperty(this, "onLoadingChanged", (loading, callback) => {
|
|
37
|
+
this.setState({
|
|
38
|
+
loading
|
|
39
|
+
}, () => {
|
|
40
|
+
if (this.props.onLoadingChanged) this.props.onLoadingChanged(this.state.loading);
|
|
41
|
+
if (callback) callback();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
_defineProperty(this, "onPress", () => {
|
|
45
|
+
Services.navigation.navigate(values.screens.featureList, {
|
|
46
|
+
options: this.props.options
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
this.state = {
|
|
50
|
+
loading: false
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
componentDidMount() {
|
|
54
|
+
this.refresh();
|
|
55
|
+
}
|
|
56
|
+
componentDidUpdate(prevProps) {
|
|
57
|
+
if (!prevProps.dataUpdated && this.props.dataUpdated) {
|
|
58
|
+
this.refresh();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
const {
|
|
63
|
+
colourBrandingMain,
|
|
64
|
+
featureDefinitions,
|
|
65
|
+
targetFeatureDefinition
|
|
66
|
+
} = this.props;
|
|
67
|
+
|
|
68
|
+
// Always show the card, even when loading or no features, with a loading state
|
|
69
|
+
const icon = "settings"; // Use a valid icon instead of 'cog'
|
|
70
|
+
// Use the feature definition title if available, otherwise fall back to default
|
|
71
|
+
const title = (targetFeatureDefinition === null || targetFeatureDefinition === void 0 ? void 0 : targetFeatureDefinition.title) || (targetFeatureDefinition === null || targetFeatureDefinition === void 0 ? void 0 : targetFeatureDefinition.displayName) || values.featureName || "Feature Builder";
|
|
72
|
+
const isLoading = this.state.loading;
|
|
73
|
+
const featureCount = (featureDefinitions === null || featureDefinitions === void 0 ? void 0 : featureDefinitions.length) || 0;
|
|
74
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
75
|
+
onPress: this.onPress,
|
|
76
|
+
style: [styles.container]
|
|
77
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
78
|
+
style: [styles.button, {
|
|
79
|
+
backgroundColor: colourBrandingMain || values.colors.defaultBrandMain
|
|
80
|
+
}]
|
|
81
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
82
|
+
style: styles.buttonTitleSection
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
84
|
+
style: [styles.buttonTitle, styles.buttonTitleLarge],
|
|
85
|
+
numberOfLines: 2
|
|
86
|
+
}, isLoading ? "Loading..." : title), /*#__PURE__*/React.createElement(Text, {
|
|
87
|
+
style: styles.subtitleText
|
|
88
|
+
}, isLoading ? "Please wait..." : `${featureCount} Feature${featureCount !== 1 ? "s" : ""} Available`)), /*#__PURE__*/React.createElement(View, {
|
|
89
|
+
style: styles.iconContainer
|
|
90
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
91
|
+
style: styles.iconText
|
|
92
|
+
}, "\u2699"))));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const mapStateToProps = state => {
|
|
96
|
+
var _state$strings;
|
|
97
|
+
const {
|
|
98
|
+
user,
|
|
99
|
+
notifications
|
|
100
|
+
} = state;
|
|
101
|
+
const targetFeatureDefinition = getTargetFeatureDefinition(state);
|
|
102
|
+
return {
|
|
103
|
+
colourBrandingMain: getMainBrandingColourFromState(state),
|
|
104
|
+
featureDefinitions: selectActiveFeatureDefinitions(state),
|
|
105
|
+
targetFeatureDefinition,
|
|
106
|
+
site: user.site,
|
|
107
|
+
dataUpdated: notifications.dataUpdated[values.notificationKey],
|
|
108
|
+
strings: ((_state$strings = state.strings) === null || _state$strings === void 0 ? void 0 : _state$strings.config) || {}
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
container: {
|
|
113
|
+
marginHorizontal: SPACING.SM,
|
|
114
|
+
marginVertical: SPACING.SM
|
|
115
|
+
},
|
|
116
|
+
button: {
|
|
117
|
+
borderRadius: SPACING.SM,
|
|
118
|
+
padding: SPACING.MD,
|
|
119
|
+
minHeight: 120,
|
|
120
|
+
justifyContent: "space-between",
|
|
121
|
+
alignItems: "flex-start",
|
|
122
|
+
flexDirection: "row"
|
|
123
|
+
},
|
|
124
|
+
buttonTitleSection: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
marginRight: SPACING.MD,
|
|
127
|
+
justifyContent: "center"
|
|
128
|
+
},
|
|
129
|
+
buttonTitle: {
|
|
130
|
+
color: "#fff",
|
|
131
|
+
fontSize: 16,
|
|
132
|
+
fontWeight: "600"
|
|
133
|
+
},
|
|
134
|
+
buttonTitleLarge: {
|
|
135
|
+
fontSize: 18
|
|
136
|
+
},
|
|
137
|
+
subtitleText: {
|
|
138
|
+
color: "rgba(255, 255, 255, 0.8)",
|
|
139
|
+
fontSize: 12,
|
|
140
|
+
marginTop: SPACING.XS
|
|
141
|
+
},
|
|
142
|
+
iconContainer: {
|
|
143
|
+
width: 50,
|
|
144
|
+
height: 50,
|
|
145
|
+
borderRadius: 25,
|
|
146
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)",
|
|
147
|
+
justifyContent: "center",
|
|
148
|
+
alignItems: "center"
|
|
149
|
+
},
|
|
150
|
+
iconText: {
|
|
151
|
+
fontSize: 24,
|
|
152
|
+
color: "#fff"
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
export default connect(mapStateToProps, null, null, {
|
|
156
|
+
forwardRef: true
|
|
157
|
+
})(WidgetGrid);
|
|
158
|
+
//# sourceMappingURL=WidgetGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","Text","View","StyleSheet","TouchableOpacity","Dimensions","connect","_","Services","Components","values","selectActiveFeatureDefinitions","getTargetFeatureDefinition","SPACING","getMainBrandingColourFromState","WidgetGrid","constructor","props","_defineProperty","onLoadingChanged","initializeFeatureBuilder","dispatch","getState","error","loading","callback","setState","state","navigation","navigate","screens","featureList","options","componentDidMount","refresh","componentDidUpdate","prevProps","dataUpdated","render","colourBrandingMain","featureDefinitions","targetFeatureDefinition","icon","title","displayName","featureName","isLoading","featureCount","length","createElement","onPress","style","styles","container","button","backgroundColor","colors","defaultBrandMain","buttonTitleSection","buttonTitle","buttonTitleLarge","numberOfLines","subtitleText","iconContainer","iconText","mapStateToProps","_state$strings","user","notifications","site","notificationKey","strings","config","create","marginHorizontal","SM","marginVertical","borderRadius","padding","MD","minHeight","justifyContent","alignItems","flexDirection","flex","marginRight","color","fontSize","fontWeight","marginTop","XS","width","height","forwardRef"],"sources":["WidgetGrid.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport {\n\tText,\n\tView,\n\tStyleSheet,\n\tTouchableOpacity,\n\tDimensions,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport { Services } from \"../feature.config\";\nimport { Components } from \"../core.config\";\nimport { values } from \"../values.config\";\nimport { selectActiveFeatureDefinitions } from \"../reducers/featureBuilderReducer\";\nimport { getTargetFeatureDefinition } from \"../utils/featureSelectors\";\nimport { SPACING } from \"../js/spacing\";\nimport { getMainBrandingColourFromState } from \"../js\";\n// Import SVGIcon directly from main app since extension has import issues\n// Using a different approach - we'll use a simple text representation for now\n// import { SVGIcon } from '../../../../../src/components/common';\n\nclass WidgetGrid extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = { loading: false };\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.refresh();\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (!prevProps.dataUpdated && this.props.dataUpdated) {\n\t\t\tthis.refresh();\n\t\t}\n\t}\n\n\trefresh = () => {\n\t\tthis.onLoadingChanged(true, async () => {\n\t\t\ttry {\n\t\t\t\tconst { initializeFeatureBuilder } = await import(\n\t\t\t\t\t\"../actions/featureBuilderActions\"\n\t\t\t\t);\n\t\t\t\tawait initializeFeatureBuilder()(\n\t\t\t\t\tthis.props.dispatch,\n\t\t\t\t\t() => this.props.getState,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\t// Silently handle refresh errors\n\t\t\t} finally {\n\t\t\t\tthis.onLoadingChanged(false);\n\t\t\t}\n\t\t});\n\t};\n\n\tonLoadingChanged = (loading, callback) => {\n\t\tthis.setState({ loading }, () => {\n\t\t\tif (this.props.onLoadingChanged)\n\t\t\t\tthis.props.onLoadingChanged(this.state.loading);\n\t\t\tif (callback) callback();\n\t\t});\n\t};\n\n\tonPress = () => {\n\t\tServices.navigation.navigate(values.screens.featureList, {\n\t\t\toptions: this.props.options,\n\t\t});\n\t};\n\n\trender() {\n\t\tconst { colourBrandingMain, featureDefinitions, targetFeatureDefinition } =\n\t\t\tthis.props;\n\n\t\t// Always show the card, even when loading or no features, with a loading state\n\t\tconst icon = \"settings\"; // Use a valid icon instead of 'cog'\n\t\t// Use the feature definition title if available, otherwise fall back to default\n\t\tconst title =\n\t\t\ttargetFeatureDefinition?.title ||\n\t\t\ttargetFeatureDefinition?.displayName ||\n\t\t\tvalues.featureName ||\n\t\t\t\"Feature Builder\";\n\n\t\tconst isLoading = this.state.loading;\n\t\tconst featureCount = featureDefinitions?.length || 0;\n\n\t\treturn (\n\t\t\t<TouchableOpacity onPress={this.onPress} style={[styles.container]}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.button,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\t\t\tcolourBrandingMain || values.colors.defaultBrandMain,\n\t\t\t\t\t\t},\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<View style={styles.buttonTitleSection}>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={[styles.buttonTitle, styles.buttonTitleLarge]}\n\t\t\t\t\t\t\tnumberOfLines={2}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{isLoading ? \"Loading...\" : title}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text style={styles.subtitleText}>\n\t\t\t\t\t\t\t{isLoading\n\t\t\t\t\t\t\t\t? \"Please wait...\"\n\t\t\t\t\t\t\t\t: `${featureCount} Feature${featureCount !== 1 ? \"s\" : \"\"} Available`}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t<View style={styles.iconContainer}>\n\t\t\t\t\t\t<Text style={styles.iconText}>⚙</Text>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst mapStateToProps = (state) => {\n\tconst { user, notifications } = state;\n\n\tconst targetFeatureDefinition = getTargetFeatureDefinition(state);\n\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tfeatureDefinitions: selectActiveFeatureDefinitions(state),\n\t\ttargetFeatureDefinition,\n\t\tsite: user.site,\n\t\tdataUpdated: notifications.dataUpdated[values.notificationKey],\n\t\tstrings: state.strings?.config || {},\n\t};\n};\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tmarginHorizontal: SPACING.SM,\n\t\tmarginVertical: SPACING.SM,\n\t},\n\tbutton: {\n\t\tborderRadius: SPACING.SM,\n\t\tpadding: SPACING.MD,\n\t\tminHeight: 120,\n\t\tjustifyContent: \"space-between\",\n\t\talignItems: \"flex-start\",\n\t\tflexDirection: \"row\",\n\t},\n\tbuttonTitleSection: {\n\t\tflex: 1,\n\t\tmarginRight: SPACING.MD,\n\t\tjustifyContent: \"center\",\n\t},\n\tbuttonTitle: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"600\",\n\t},\n\tbuttonTitleLarge: {\n\t\tfontSize: 18,\n\t},\n\tsubtitleText: {\n\t\tcolor: \"rgba(255, 255, 255, 0.8)\",\n\t\tfontSize: 12,\n\t\tmarginTop: SPACING.XS,\n\t},\n\ticonContainer: {\n\t\twidth: 50,\n\t\theight: 50,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: \"rgba(255, 255, 255, 0.2)\",\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\ticonText: {\n\t\tfontSize: 24,\n\t\tcolor: \"#fff\",\n\t},\n});\n\nexport default connect(mapStateToProps, null, null, { forwardRef: true })(\n\tWidgetGrid,\n);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACCC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,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