@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.
Files changed (118) hide show
  1. package/dist/module/actions/featureBuilderActions.js +106 -0
  2. package/dist/module/actions/featureBuilderActions.js.map +1 -0
  3. package/dist/module/actions/featureBuilderStringsActions.js +106 -0
  4. package/dist/module/actions/featureBuilderStringsActions.js.map +1 -0
  5. package/dist/module/actions/index.js +12 -0
  6. package/dist/module/actions/index.js.map +1 -0
  7. package/dist/module/actions/types.js +7 -0
  8. package/dist/module/actions/types.js.map +1 -0
  9. package/dist/module/components/FeatureDetailScreen.js +725 -0
  10. package/dist/module/components/FeatureDetailScreen.js.map +1 -0
  11. package/dist/module/components/FeatureListItem.js +174 -0
  12. package/dist/module/components/FeatureListItem.js.map +1 -0
  13. package/dist/module/components/FeatureListScreen.js +159 -0
  14. package/dist/module/components/FeatureListScreen.js.map +1 -0
  15. package/dist/module/components/FieldRenderer.js +218 -0
  16. package/dist/module/components/FieldRenderer.js.map +1 -0
  17. package/dist/module/components/FileDownload.js +74 -0
  18. package/dist/module/components/FileDownload.js.map +1 -0
  19. package/dist/module/components/WidgetGrid.js +158 -0
  20. package/dist/module/components/WidgetGrid.js.map +1 -0
  21. package/dist/module/components/WidgetLarge.js +274 -0
  22. package/dist/module/components/WidgetLarge.js.map +1 -0
  23. package/dist/module/components/WidgetSmall.js +315 -0
  24. package/dist/module/components/WidgetSmall.js.map +1 -0
  25. package/dist/module/components/common/index.js +25 -0
  26. package/dist/module/components/common/index.js.map +1 -0
  27. package/dist/module/components/layouts/CondensedList.js +195 -0
  28. package/dist/module/components/layouts/CondensedList.js.map +1 -0
  29. package/dist/module/components/layouts/FeatureImageList.js +172 -0
  30. package/dist/module/components/layouts/FeatureImageList.js.map +1 -0
  31. package/dist/module/components/layouts/RoundImageList.js +198 -0
  32. package/dist/module/components/layouts/RoundImageList.js.map +1 -0
  33. package/dist/module/components/layouts/SquareImageList.js +185 -0
  34. package/dist/module/components/layouts/SquareImageList.js.map +1 -0
  35. package/dist/module/config/index.js +10 -0
  36. package/dist/module/config/index.js.map +1 -0
  37. package/dist/module/core.config.js +17 -0
  38. package/dist/module/core.config.js.map +1 -0
  39. package/dist/module/feature.config.js +113 -0
  40. package/dist/module/feature.config.js.map +1 -0
  41. package/dist/module/index.js +24 -0
  42. package/dist/module/index.js.map +1 -0
  43. package/dist/module/js/Colors.js +25 -0
  44. package/dist/module/js/Colors.js.map +1 -0
  45. package/dist/module/js/FieldTypes.js +123 -0
  46. package/dist/module/js/FieldTypes.js.map +1 -0
  47. package/dist/module/js/NavigationService.js +10 -0
  48. package/dist/module/js/NavigationService.js.map +1 -0
  49. package/dist/module/js/Styles.js +3 -0
  50. package/dist/module/js/Styles.js.map +1 -0
  51. package/dist/module/js/helpers.js +29 -0
  52. package/dist/module/js/helpers.js.map +1 -0
  53. package/dist/module/js/index.js +24 -0
  54. package/dist/module/js/index.js.map +1 -0
  55. package/dist/module/js/spacing.js +29 -0
  56. package/dist/module/js/spacing.js.map +1 -0
  57. package/dist/module/js/types.js +254 -0
  58. package/dist/module/js/types.js.map +1 -0
  59. package/dist/module/reducers/featureBuilderReducer.js +75 -0
  60. package/dist/module/reducers/featureBuilderReducer.js.map +1 -0
  61. package/dist/module/utils/featureSelectors.js +9 -0
  62. package/dist/module/utils/featureSelectors.js.map +1 -0
  63. package/dist/module/values.config.a.js +96 -0
  64. package/dist/module/values.config.a.js.map +1 -0
  65. package/dist/module/values.config.b.js +96 -0
  66. package/dist/module/values.config.b.js.map +1 -0
  67. package/dist/module/values.config.c.js +96 -0
  68. package/dist/module/values.config.c.js.map +1 -0
  69. package/dist/module/values.config.d.js +96 -0
  70. package/dist/module/values.config.d.js.map +1 -0
  71. package/dist/module/values.config.js +96 -0
  72. package/dist/module/values.config.js.map +1 -0
  73. package/dist/module/webapi/featureBuilderAPI.js +59 -0
  74. package/dist/module/webapi/featureBuilderAPI.js.map +1 -0
  75. package/dist/module/webapi/helper.js +4 -0
  76. package/dist/module/webapi/helper.js.map +1 -0
  77. package/dist/module/webapi/index.js +8 -0
  78. package/dist/module/webapi/index.js.map +1 -0
  79. package/package.json +62 -0
  80. package/src/actions/featureBuilderActions.js +112 -0
  81. package/src/actions/featureBuilderStringsActions.js +114 -0
  82. package/src/actions/index.js +12 -0
  83. package/src/actions/types.js +7 -0
  84. package/src/components/FeatureDetailScreen.js +817 -0
  85. package/src/components/FeatureListItem.js +198 -0
  86. package/src/components/FeatureListScreen.js +160 -0
  87. package/src/components/FieldRenderer.js +272 -0
  88. package/src/components/FileDownload.js +79 -0
  89. package/src/components/WidgetGrid.js +181 -0
  90. package/src/components/WidgetLarge.js +305 -0
  91. package/src/components/WidgetSmall.js +344 -0
  92. package/src/components/common/index.js +25 -0
  93. package/src/components/layouts/CondensedList.js +230 -0
  94. package/src/components/layouts/FeatureImageList.js +193 -0
  95. package/src/components/layouts/RoundImageList.js +219 -0
  96. package/src/components/layouts/SquareImageList.js +205 -0
  97. package/src/config/index.js +10 -0
  98. package/src/core.config.js +29 -0
  99. package/src/feature.config.js +127 -0
  100. package/src/index.js +27 -0
  101. package/src/js/Colors.js +30 -0
  102. package/src/js/FieldTypes.js +131 -0
  103. package/src/js/NavigationService.js +12 -0
  104. package/src/js/Styles.js +3 -0
  105. package/src/js/helpers.js +30 -0
  106. package/src/js/index.js +24 -0
  107. package/src/js/spacing.js +30 -0
  108. package/src/js/types.js +253 -0
  109. package/src/reducers/featureBuilderReducer.js +64 -0
  110. package/src/utils/featureSelectors.js +8 -0
  111. package/src/values.config.a.js +104 -0
  112. package/src/values.config.b.js +104 -0
  113. package/src/values.config.c.js +104 -0
  114. package/src/values.config.d.js +104 -0
  115. package/src/values.config.js +104 -0
  116. package/src/webapi/featureBuilderAPI.js +65 -0
  117. package/src/webapi/helper.js +4 -0
  118. package/src/webapi/index.js +8 -0
@@ -0,0 +1,106 @@
1
+ import { values } from "../values.config";
2
+ import { featureBuilderAPI } from "../webapi/featureBuilderAPI";
3
+ import { updateFeatureBuilderStringAndIconFromDefinition } from "./featureBuilderStringsActions";
4
+
5
+ /**
6
+ * Action types for feature builder Redux actions
7
+ * These are pulled from values.config.actions to ensure unique action types per instance
8
+ * @readonly
9
+ * @enum {string}
10
+ */
11
+ export const FeatureBuilderActionTypes = {
12
+ /** Indicates loading state for feature data fetch */
13
+ LOADING: values.actions.LOADING,
14
+ /** Indicates successful fetch of feature definition and listings */
15
+ LOAD_SUCCESS: values.actions.LOAD_SUCCESS,
16
+ /** Indicates failure in fetching feature data */
17
+ FAILURE: values.actions.FAILURE
18
+ };
19
+
20
+ /**
21
+ * Loads the target feature definition and its listings from the API
22
+ * This function fetches the feature definition configured in values.config
23
+ * and loads all associated listings for display
24
+ *
25
+ * @function
26
+ * @returns {Function} Redux thunk function that handles the async loading
27
+ * @throws {Error} When no feature definitions are found or API calls fail
28
+ *
29
+ * @example
30
+ * // In component
31
+ * useEffect(() => {
32
+ * props.loadTargetFeature();
33
+ * }, []);
34
+ *
35
+ * // Dispatch directly
36
+ * dispatch(loadTargetFeature());
37
+ */
38
+ export const loadTargetFeature = () => {
39
+ return async (dispatch, getState) => {
40
+ dispatch({
41
+ type: FeatureBuilderActionTypes.LOADING
42
+ });
43
+ try {
44
+ var _state$user;
45
+ const state = getState();
46
+ const site = (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.site;
47
+ const targetId = values.targetFeatureDefinitionId;
48
+ const defResponse = await featureBuilderAPI.getFeatureDefinitions(site);
49
+ const allDefinitions = defResponse.data.featureDefinitions || [];
50
+
51
+ // Find the specific target definition - throw if not found
52
+ const rawTarget = allDefinitions.find(d => d.id === targetId);
53
+ if (!rawTarget) {
54
+ throw new Error(`Target feature definition with ID '${targetId}' not found.`);
55
+ }
56
+ const flattenedFeature = {
57
+ id: rawTarget.id,
58
+ ...rawTarget.definition
59
+ };
60
+ const listResponse = await featureBuilderAPI.getFeatureListings(site, rawTarget.id);
61
+ const rawListings = listResponse.data.listings || [];
62
+
63
+ // Filter out soft-deleted items at the Redux level
64
+ const listings = rawListings.filter(listing => !listing.deletedAt);
65
+ dispatch({
66
+ type: FeatureBuilderActionTypes.LOAD_SUCCESS,
67
+ payload: {
68
+ feature: flattenedFeature,
69
+ listings: listings
70
+ }
71
+ });
72
+
73
+ // Update strings store with feature definition title and icon
74
+ dispatch(updateFeatureBuilderStringAndIconFromDefinition());
75
+ } catch (error) {
76
+ dispatch({
77
+ type: FeatureBuilderActionTypes.FAILURE,
78
+ payload: error.message || "Failed to load feature."
79
+ });
80
+ }
81
+ };
82
+ };
83
+
84
+ // Aliases for compatibility with any lingering imports
85
+
86
+ /**
87
+ * Alias for loadTargetFeature - initializes feature builder with target feature
88
+ * @function
89
+ * @see loadTargetFeature
90
+ */
91
+ export const initializeFeatureBuilder = loadTargetFeature;
92
+
93
+ /**
94
+ * Alias for loadTargetFeature - refreshes current feature data
95
+ * @function
96
+ * @see loadTargetFeature
97
+ */
98
+ export const refreshFeature = loadTargetFeature;
99
+
100
+ /**
101
+ * Alias for loadTargetFeature - fetches listings for target feature
102
+ * @function
103
+ * @see loadTargetFeature
104
+ */
105
+ export const fetchTargetFeatureListings = loadTargetFeature;
106
+ //# sourceMappingURL=featureBuilderActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["values","featureBuilderAPI","updateFeatureBuilderStringAndIconFromDefinition","FeatureBuilderActionTypes","LOADING","actions","LOAD_SUCCESS","FAILURE","loadTargetFeature","dispatch","getState","type","_state$user","state","site","user","targetId","targetFeatureDefinitionId","defResponse","getFeatureDefinitions","allDefinitions","data","featureDefinitions","rawTarget","find","d","id","Error","flattenedFeature","definition","listResponse","getFeatureListings","rawListings","listings","filter","listing","deletedAt","payload","feature","error","message","initializeFeatureBuilder","refreshFeature","fetchTargetFeatureListings"],"sources":["featureBuilderActions.js"],"sourcesContent":["import { values } from \"../values.config\";\nimport { featureBuilderAPI } from \"../webapi/featureBuilderAPI\";\nimport { updateFeatureBuilderStringAndIconFromDefinition } from \"./featureBuilderStringsActions\";\n\n/**\n * Action types for feature builder Redux actions\n * These are pulled from values.config.actions to ensure unique action types per instance\n * @readonly\n * @enum {string}\n */\nexport const FeatureBuilderActionTypes = {\n\t/** Indicates loading state for feature data fetch */\n\tLOADING: values.actions.LOADING,\n\t/** Indicates successful fetch of feature definition and listings */\n\tLOAD_SUCCESS: values.actions.LOAD_SUCCESS,\n\t/** Indicates failure in fetching feature data */\n\tFAILURE: values.actions.FAILURE,\n};\n\n/**\n * Loads the target feature definition and its listings from the API\n * This function fetches the feature definition configured in values.config\n * and loads all associated listings for display\n *\n * @function\n * @returns {Function} Redux thunk function that handles the async loading\n * @throws {Error} When no feature definitions are found or API calls fail\n *\n * @example\n * // In component\n * useEffect(() => {\n * props.loadTargetFeature();\n * }, []);\n *\n * // Dispatch directly\n * dispatch(loadTargetFeature());\n */\nexport const loadTargetFeature = () => {\n\treturn async (dispatch, getState) => {\n\t\tdispatch({ type: FeatureBuilderActionTypes.LOADING });\n\n\t\ttry {\n\t\t\tconst state = getState();\n\t\t\tconst site = state.user?.site;\n\t\t\tconst targetId = values.targetFeatureDefinitionId;\n\t\t\tconst defResponse = await featureBuilderAPI.getFeatureDefinitions(site);\n\t\t\tconst allDefinitions = defResponse.data.featureDefinitions || [];\n\n\t\t\t// Find the specific target definition - throw if not found\n\t\t\tconst rawTarget = allDefinitions.find((d) => d.id === targetId);\n\n\t\t\tif (!rawTarget) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Target feature definition with ID '${targetId}' not found.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst flattenedFeature = {\n\t\t\t\tid: rawTarget.id,\n\t\t\t\t...rawTarget.definition,\n\t\t\t};\n\n\t\t\tconst listResponse = await featureBuilderAPI.getFeatureListings(\n\t\t\t\tsite,\n\t\t\t\trawTarget.id,\n\t\t\t);\n\t\t\tconst rawListings = listResponse.data.listings || [];\n\n\t\t\t// Filter out soft-deleted items at the Redux level\n\t\t\tconst listings = rawListings.filter((listing) => !listing.deletedAt);\n\n\t\t\tdispatch({\n\t\t\t\ttype: FeatureBuilderActionTypes.LOAD_SUCCESS,\n\t\t\t\tpayload: {\n\t\t\t\t\tfeature: flattenedFeature,\n\t\t\t\t\tlistings: listings,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// Update strings store with feature definition title and icon\n\t\t\tdispatch(updateFeatureBuilderStringAndIconFromDefinition());\n\t\t} catch (error) {\n\t\t\tdispatch({\n\t\t\t\ttype: FeatureBuilderActionTypes.FAILURE,\n\t\t\t\tpayload: error.message || \"Failed to load feature.\",\n\t\t\t});\n\t\t}\n\t};\n};\n\n// Aliases for compatibility with any lingering imports\n\n/**\n * Alias for loadTargetFeature - initializes feature builder with target feature\n * @function\n * @see loadTargetFeature\n */\nexport const initializeFeatureBuilder = loadTargetFeature;\n\n/**\n * Alias for loadTargetFeature - refreshes current feature data\n * @function\n * @see loadTargetFeature\n */\nexport const refreshFeature = loadTargetFeature;\n\n/**\n * Alias for loadTargetFeature - fetches listings for target feature\n * @function\n * @see loadTargetFeature\n */\nexport const fetchTargetFeatureListings = loadTargetFeature;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAkB;AACzC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,+CAA+C,QAAQ,gCAAgC;;AAEhG;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAG;EACxC;EACAC,OAAO,EAAEJ,MAAM,CAACK,OAAO,CAACD,OAAO;EAC/B;EACAE,YAAY,EAAEN,MAAM,CAACK,OAAO,CAACC,YAAY;EACzC;EACAC,OAAO,EAAEP,MAAM,CAACK,OAAO,CAACE;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACtC,OAAO,OAAO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CAACP,+CAA+C,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,OAAOqC,KAAK,EAAE;MACf9B,QAAQ,CAAC;QACRE,IAAI,EAAER,yBAAyB,CAACI,OAAO;QACvC8B,OAAO,EAAEE,KAAK,CAACC,OAAO,IAAI;MAC3B,CAAC,CAAC;IACH;EACD,CAAC;AACF,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGjC,iBAAiB;;AAEzD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMkC,cAAc,GAAGlC,iBAAiB;;AAE/C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMmC,0BAA0B,GAAGnC,iBAAiB","ignoreList":[]}
@@ -0,0 +1,106 @@
1
+ import { selectFeatureDefinition } from "../reducers/featureBuilderReducer";
2
+ import { values } from "../values.config";
3
+
4
+ // IMPORTANT: Using local UPDATE_STRINGS action type to make extension self-contained
5
+ // The main app's StringsReducer will handle this action type the same way
6
+ export const UPDATE_STRINGS = "UPDATE_STRINGS";
7
+
8
+ /**
9
+ * Updates the feature builder's menu text in the global strings store
10
+ * This ensures UI components use the dynamic title from feature definition
11
+ */
12
+ export const updateFeatureBuilderString = title => (dispatch, getState) => {
13
+ var _getState$strings;
14
+ const currentStrings = ((_getState$strings = getState().strings) === null || _getState$strings === void 0 ? void 0 : _getState$strings.config) || {};
15
+ const updatedStrings = {
16
+ ...currentStrings,
17
+ featureTitles: {
18
+ ...currentStrings.featureTitles,
19
+ [values.featureKey]: title || values.featureName
20
+ }
21
+ };
22
+ dispatch({
23
+ type: UPDATE_STRINGS,
24
+ payload: updatedStrings
25
+ });
26
+ };
27
+
28
+ /**
29
+ * Updates the feature builder string using the current title from feature definition
30
+ * This is useful when the feature definition has been updated
31
+ */
32
+ export const updateFeatureBuilderStringFromDefinition = () => (dispatch, getState) => {
33
+ const definition = selectFeatureDefinition(getState());
34
+ const title = (definition === null || definition === void 0 ? void 0 : definition.title) || values.featureName;
35
+ // Capitalize first letter of title
36
+ const capitalizedTitle = title ? title.charAt(0).toUpperCase() + title.slice(1) : values.featureName;
37
+ dispatch(updateFeatureBuilderString(capitalizedTitle));
38
+ };
39
+
40
+ /**
41
+ * Updates the feature builder icon in the global strings store
42
+ * This ensures UI components use the dynamic icon from the feature definition
43
+ */
44
+ export const updateFeatureBuilderIcon = icon => (dispatch, getState) => {
45
+ var _getState$strings2;
46
+ const currentStrings = ((_getState$strings2 = getState().strings) === null || _getState$strings2 === void 0 ? void 0 : _getState$strings2.config) || {};
47
+ const updatedStrings = {
48
+ ...currentStrings,
49
+ featureIcons: {
50
+ ...currentStrings.featureIcons,
51
+ [values.featureKey]: icon
52
+ }
53
+ };
54
+ dispatch({
55
+ type: UPDATE_STRINGS,
56
+ payload: updatedStrings
57
+ });
58
+ };
59
+
60
+ /**
61
+ * Updates the feature builder icon using the current icon from feature definition
62
+ * This is useful when the feature definition has been updated
63
+ */
64
+ export const updateFeatureBuilderIconFromDefinition = () => (dispatch, getState) => {
65
+ const definition = selectFeatureDefinition(getState());
66
+ const icon = (definition === null || definition === void 0 ? void 0 : definition.icon) || values.navigation.gridMenu.icon;
67
+ dispatch(updateFeatureBuilderIcon(icon));
68
+ };
69
+
70
+ /**
71
+ * Updates the feature builder grid icon in the global strings store
72
+ * This ensures UI components use the dynamic grid icon from the feature definition
73
+ */
74
+ export const updateFeatureBuilderGridIcon = gridIcon => (dispatch, getState) => {
75
+ var _getState$strings3;
76
+ const currentStrings = ((_getState$strings3 = getState().strings) === null || _getState$strings3 === void 0 ? void 0 : _getState$strings3.config) || {};
77
+ const updatedStrings = {
78
+ ...currentStrings,
79
+ featureIcons: {
80
+ ...currentStrings.featureIcons,
81
+ [values.featureKey]: gridIcon
82
+ }
83
+ };
84
+ dispatch({
85
+ type: UPDATE_STRINGS,
86
+ payload: updatedStrings
87
+ });
88
+ };
89
+
90
+ /**
91
+ * Updates both the title and icon from the current feature definition
92
+ * This is useful when both have been updated in the definition
93
+ */
94
+ export const updateFeatureBuilderStringAndIconFromDefinition = () => (dispatch, getState) => {
95
+ const definition = selectFeatureDefinition(getState());
96
+ const title = (definition === null || definition === void 0 ? void 0 : definition.title) || values.featureName;
97
+ const icon = (definition === null || definition === void 0 ? void 0 : definition.icon) || values.navigation.gridMenu.icon;
98
+
99
+ // Update title
100
+ const capitalizedTitle = title ? title.charAt(0).toUpperCase() + title.slice(1) : values.featureName;
101
+ dispatch(updateFeatureBuilderString(capitalizedTitle));
102
+
103
+ // Update icon
104
+ dispatch(updateFeatureBuilderIcon(icon));
105
+ };
106
+ //# sourceMappingURL=featureBuilderStringsActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["selectFeatureDefinition","values","UPDATE_STRINGS","updateFeatureBuilderString","title","dispatch","getState","_getState$strings","currentStrings","strings","config","updatedStrings","featureTitles","featureKey","featureName","type","payload","updateFeatureBuilderStringFromDefinition","definition","capitalizedTitle","charAt","toUpperCase","slice","updateFeatureBuilderIcon","icon","_getState$strings2","featureIcons","updateFeatureBuilderIconFromDefinition","navigation","gridMenu","updateFeatureBuilderGridIcon","gridIcon","_getState$strings3","updateFeatureBuilderStringAndIconFromDefinition"],"sources":["featureBuilderStringsActions.js"],"sourcesContent":["import { selectFeatureDefinition } from \"../reducers/featureBuilderReducer\";\nimport { values } from \"../values.config\";\n\n// IMPORTANT: Using local UPDATE_STRINGS action type to make extension self-contained\n// The main app's StringsReducer will handle this action type the same way\nexport const UPDATE_STRINGS = \"UPDATE_STRINGS\";\n\n/**\n * Updates the feature builder's menu text in the global strings store\n * This ensures UI components use the dynamic title from feature definition\n */\nexport const updateFeatureBuilderString = (title) => (dispatch, getState) => {\n\tconst currentStrings = getState().strings?.config || {};\n\n\tconst updatedStrings = {\n\t\t...currentStrings,\n\t\tfeatureTitles: {\n\t\t\t...currentStrings.featureTitles,\n\t\t\t[values.featureKey]: title || values.featureName,\n\t\t},\n\t};\n\n\tdispatch({\n\t\ttype: UPDATE_STRINGS,\n\t\tpayload: updatedStrings,\n\t});\n};\n\n/**\n * Updates the feature builder string using the current title from feature definition\n * This is useful when the feature definition has been updated\n */\nexport const updateFeatureBuilderStringFromDefinition =\n\t() => (dispatch, getState) => {\n\t\tconst definition = selectFeatureDefinition(getState());\n\t\tconst title = definition?.title || values.featureName;\n\t\t// Capitalize first letter of title\n\t\tconst capitalizedTitle = title\n\t\t\t? title.charAt(0).toUpperCase() + title.slice(1)\n\t\t\t: values.featureName;\n\t\tdispatch(updateFeatureBuilderString(capitalizedTitle));\n\t};\n\n/**\n * Updates the feature builder icon in the global strings store\n * This ensures UI components use the dynamic icon from the feature definition\n */\nexport const updateFeatureBuilderIcon = (icon) => (dispatch, getState) => {\n\tconst currentStrings = getState().strings?.config || {};\n\tconst updatedStrings = {\n\t\t...currentStrings,\n\t\tfeatureIcons: {\n\t\t\t...currentStrings.featureIcons,\n\t\t\t[values.featureKey]: icon,\n\t\t},\n\t};\n\n\tdispatch({\n\t\ttype: UPDATE_STRINGS,\n\t\tpayload: updatedStrings,\n\t});\n};\n\n/**\n * Updates the feature builder icon using the current icon from feature definition\n * This is useful when the feature definition has been updated\n */\nexport const updateFeatureBuilderIconFromDefinition =\n\t() => (dispatch, getState) => {\n\t\tconst definition = selectFeatureDefinition(getState());\n\t\tconst icon = definition?.icon || values.navigation.gridMenu.icon;\n\t\tdispatch(updateFeatureBuilderIcon(icon));\n\t};\n\n/**\n * Updates the feature builder grid icon in the global strings store\n * This ensures UI components use the dynamic grid icon from the feature definition\n */\nexport const updateFeatureBuilderGridIcon =\n\t(gridIcon) => (dispatch, getState) => {\n\t\tconst currentStrings = getState().strings?.config || {};\n\t\tconst updatedStrings = {\n\t\t\t...currentStrings,\n\t\t\tfeatureIcons: {\n\t\t\t\t...currentStrings.featureIcons,\n\t\t\t\t[values.featureKey]: gridIcon,\n\t\t\t},\n\t\t};\n\n\t\tdispatch({\n\t\t\ttype: UPDATE_STRINGS,\n\t\t\tpayload: updatedStrings,\n\t\t});\n\t};\n\n/**\n * Updates both the title and icon from the current feature definition\n * This is useful when both have been updated in the definition\n */\nexport const updateFeatureBuilderStringAndIconFromDefinition =\n\t() => (dispatch, getState) => {\n\t\tconst definition = selectFeatureDefinition(getState());\n\t\tconst title = definition?.title || values.featureName;\n\t\tconst icon = definition?.icon || values.navigation.gridMenu.icon;\n\n\t\t// Update title\n\t\tconst capitalizedTitle = title\n\t\t\t? title.charAt(0).toUpperCase() + title.slice(1)\n\t\t\t: values.featureName;\n\t\tdispatch(updateFeatureBuilderString(capitalizedTitle));\n\n\t\t// Update icon\n\t\tdispatch(updateFeatureBuilderIcon(icon));\n\t};\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,mCAAmC;AAC3E,SAASC,MAAM,QAAQ,kBAAkB;;AAEzC;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,gBAAgB;;AAE9C;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAIC,KAAK,IAAK,CAACC,QAAQ,EAAEC,QAAQ,KAAK;EAAA,IAAAC,iBAAA;EAC5E,MAAMC,cAAc,GAAG,EAAAD,iBAAA,GAAAD,QAAQ,CAAC,CAAC,CAACG,OAAO,cAAAF,iBAAA,uBAAlBA,iBAAA,CAAoBG,MAAM,KAAI,CAAC,CAAC;EAEvD,MAAMC,cAAc,GAAG;IACtB,GAAGH,cAAc;IACjBI,aAAa,EAAE;MACd,GAAGJ,cAAc,CAACI,aAAa;MAC/B,CAACX,MAAM,CAACY,UAAU,GAAGT,KAAK,IAAIH,MAAM,CAACa;IACtC;EACD,CAAC;EAEDT,QAAQ,CAAC;IACRU,IAAI,EAAEb,cAAc;IACpBc,OAAO,EAAEL;EACV,CAAC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMM,wCAAwC,GACpDA,CAAA,KAAM,CAACZ,QAAQ,EAAEC,QAAQ,KAAK;EAC7B,MAAMY,UAAU,GAAGlB,uBAAuB,CAACM,QAAQ,CAAC,CAAC,CAAC;EACtD,MAAMF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AAC,CAAC;AACzC,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import { Actions } from "../core.config";
2
+ export const getFollowers = Actions.getFollowers;
3
+ export const addFollower = Actions.addFollower;
4
+ export const selectEventTime = Actions.selectEventTime;
5
+ export const residentsLoaded = Actions.residentsLoaded;
6
+ export const linkedUsersLoaded = Actions.linkedToUsersLoaded;
7
+ export const linkedToUsersLoaded = Actions.linkedToUsersLoaded;
8
+ export const updateNavRead = Actions.updateNavRead;
9
+
10
+ // TODO: Add custom actions below for example,
11
+ // export * from './AlertActions';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Actions","getFollowers","addFollower","selectEventTime","residentsLoaded","linkedUsersLoaded","linkedToUsersLoaded","updateNavRead"],"sources":["index.js"],"sourcesContent":["import { Actions } from \"../core.config\";\n\nexport const getFollowers = Actions.getFollowers;\nexport const addFollower = Actions.addFollower;\nexport const selectEventTime = Actions.selectEventTime;\nexport const residentsLoaded = Actions.residentsLoaded;\nexport const linkedUsersLoaded = Actions.linkedToUsersLoaded;\nexport const linkedToUsersLoaded = Actions.linkedToUsersLoaded;\nexport const updateNavRead = Actions.updateNavRead;\n\n// TODO: Add custom actions below for example,\n// export * from './AlertActions';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB;AAExC,OAAO,MAAMC,YAAY,GAAGD,OAAO,CAACC,YAAY;AAChD,OAAO,MAAMC,WAAW,GAAGF,OAAO,CAACE,WAAW;AAC9C,OAAO,MAAMC,eAAe,GAAGH,OAAO,CAACG,eAAe;AACtD,OAAO,MAAMC,eAAe,GAAGJ,OAAO,CAACI,eAAe;AACtD,OAAO,MAAMC,iBAAiB,GAAGL,OAAO,CAACM,mBAAmB;AAC5D,OAAO,MAAMA,mBAAmB,GAAGN,OAAO,CAACM,mBAAmB;AAC9D,OAAO,MAAMC,aAAa,GAAGP,OAAO,CAACO,aAAa;;AAElD;AACA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { ActionTypes } from "../core.config";
2
+ export const LOGOUT = ActionTypes.LOGOUT;
3
+ export const CHANGE_ROLE = ActionTypes.CHANGE_ROLE;
4
+
5
+ // TODO: Define action types for example,
6
+ // export const EVENTS_UPDATED = 'EVENTS_UPDATED';
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ActionTypes","LOGOUT","CHANGE_ROLE"],"sources":["types.js"],"sourcesContent":["import { ActionTypes } from \"../core.config\";\n\nexport const LOGOUT = ActionTypes.LOGOUT;\nexport const CHANGE_ROLE = ActionTypes.CHANGE_ROLE;\n\n// TODO: Define action types for example,\n// export const EVENTS_UPDATED = 'EVENTS_UPDATED';\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,OAAO,MAAMC,MAAM,GAAGD,WAAW,CAACC,MAAM;AACxC,OAAO,MAAMC,WAAW,GAAGF,WAAW,CAACE,WAAW;;AAElD;AACA","ignoreList":[]}