jamespot-front-business 1.1.50 → 1.1.51

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/cjs.js CHANGED
@@ -1939,11 +1939,42 @@ const UserCurrent = {
1939
1939
  utils: { isAdmin, isLogged },
1940
1940
  };
1941
1941
 
1942
- const widgetApiDefinition = {
1943
- label: 'WIDGET_Api',
1944
- description: 'WIDGET_Api_Description',
1945
- name: 'widget-api',
1946
- img: '/img/fast-intranet/widget-text.png',
1942
+ function uniqid() {
1943
+ let id = '';
1944
+ for (let index = 0; index < 16; index++) {
1945
+ id += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
1946
+ }
1947
+ return id;
1948
+ }
1949
+
1950
+ const WIDGET_ARTICLE_TITLE = 'widget-article-title';
1951
+ const WIDGET_ARTICLE_TEXT = 'widget-article-text';
1952
+ const WIDGET_ARTICLE_IMAGE = 'widget-article-image';
1953
+ const WIDGET_ARTICLE_BUTTON = 'widget-article-button';
1954
+ const WIDGET_ARTICLE_GALLERY = 'widget-article-gallery';
1955
+ const WIDGET_ARTICLE_ATTACHMENT = 'widget-article-attachment';
1956
+ const WIDGET_CHECK_LIST = 'widget-check-list';
1957
+ const WIDGET_CHECK_LIST_LABEL = 'WIDGET_Check_List';
1958
+ const WIDGET_CHECK_LIST_DESCRIPTION = 'WIDGET_Check_List_Description';
1959
+
1960
+ var WIDGETS = /*#__PURE__*/Object.freeze({
1961
+ __proto__: null,
1962
+ WIDGET_ARTICLE_TITLE: WIDGET_ARTICLE_TITLE,
1963
+ WIDGET_ARTICLE_TEXT: WIDGET_ARTICLE_TEXT,
1964
+ WIDGET_ARTICLE_IMAGE: WIDGET_ARTICLE_IMAGE,
1965
+ WIDGET_ARTICLE_BUTTON: WIDGET_ARTICLE_BUTTON,
1966
+ WIDGET_ARTICLE_GALLERY: WIDGET_ARTICLE_GALLERY,
1967
+ WIDGET_ARTICLE_ATTACHMENT: WIDGET_ARTICLE_ATTACHMENT,
1968
+ WIDGET_CHECK_LIST: WIDGET_CHECK_LIST,
1969
+ WIDGET_CHECK_LIST_LABEL: WIDGET_CHECK_LIST_LABEL,
1970
+ WIDGET_CHECK_LIST_DESCRIPTION: WIDGET_CHECK_LIST_DESCRIPTION
1971
+ });
1972
+
1973
+ const widgetArticleTextDefinition = {
1974
+ label: 'WIDGET_Text',
1975
+ description: 'WIDGET_Text_Description',
1976
+ name: 'widget-article-text',
1977
+ img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
1947
1978
  available: true,
1948
1979
  panel: {
1949
1980
  useWrapper: false,
@@ -1951,51 +1982,42 @@ const widgetApiDefinition = {
1951
1982
  useWidgets: false,
1952
1983
  },
1953
1984
  };
1954
- const widgetApiContent = {
1955
- url: '',
1985
+ const widgetArticleTextContent = {
1986
+ text: '',
1956
1987
  };
1957
1988
 
1958
- const widgetArticleAttachmentDefinition = {
1959
- label: 'WIDGET_Article_Attachment',
1960
- description: 'WIDGET_Article_Attachment_Description',
1961
- name: 'widget-article-attachment',
1962
- img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
1989
+ const widgetArticleTitleDefinition = {
1990
+ label: 'WIDGET_Title',
1991
+ description: 'WIDGET_Title_Description',
1992
+ name: 'widget-article-title',
1993
+ img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
1963
1994
  available: true,
1964
1995
  panel: {
1965
- useWrapper: true,
1996
+ useWrapper: false,
1966
1997
  useEditor: true,
1967
1998
  useWidgets: false,
1968
1999
  },
1969
2000
  };
1970
- const widgetArticleAttachmentContent = {
1971
- files: [],
2001
+ const widgetArticleTitleContent = {
2002
+ text: '',
2003
+ heading: 'h1',
2004
+ backgroundColor: 'transparent',
1972
2005
  };
1973
2006
 
1974
- const widgetArticleButtonDefinition = {
1975
- label: 'WIDGET_Button',
1976
- description: 'WIDGET_Button_Description',
1977
- name: 'widget-article-button',
1978
- img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
2007
+ const widgetArticleAttachmentDefinition = {
2008
+ label: 'WIDGET_Article_Attachment',
2009
+ description: 'WIDGET_Article_Attachment_Description',
2010
+ name: 'widget-article-attachment',
2011
+ img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
1979
2012
  available: true,
1980
2013
  panel: {
1981
- useWrapper: false,
2014
+ useWrapper: true,
1982
2015
  useEditor: true,
1983
2016
  useWidgets: false,
1984
2017
  },
1985
2018
  };
1986
- const widgetArticleButtonContent = {
1987
- text: '',
1988
- openingType: 'link',
1989
- openingTypeLink: {
1990
- url: '',
1991
- target: '_blank',
1992
- },
1993
- variant: 'contained',
1994
- fontSize: '14',
1995
- color: '#fff',
1996
- backgroundColor: '#4dbf96',
1997
- buttonSize: 'lg',
1998
- borderRadius: '4',
2019
+ const widgetArticleAttachmentContent = {
2020
+ files: [],
1999
2021
  };
2000
2022
 
2001
2023
  const widgetArticleGalleryDefinition = {
@@ -2030,11 +2052,11 @@ const widgetArticleImageDefinition = {
2030
2052
  };
2031
2053
  const widgetArticleImageContent = {};
2032
2054
 
2033
- const widgetArticleSliderDefinition = {
2034
- label: 'WIDGET_Slider',
2035
- description: 'WIDGET_Slider_Description',
2036
- name: 'widget-article-slider',
2037
- img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
2055
+ const widgetArticleButtonDefinition = {
2056
+ label: 'WIDGET_Button',
2057
+ description: 'WIDGET_Button_Description',
2058
+ name: 'widget-article-button',
2059
+ img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
2038
2060
  available: true,
2039
2061
  panel: {
2040
2062
  useWrapper: false,
@@ -2042,19 +2064,26 @@ const widgetArticleSliderDefinition = {
2042
2064
  useWidgets: false,
2043
2065
  },
2044
2066
  };
2045
- const widgetArticleSliderContent = {
2046
- slides: [],
2047
- maxWidth: 800,
2048
- loop: false,
2049
- useDots: true,
2050
- startAt: 0,
2067
+ const widgetArticleButtonContent = {
2068
+ text: '',
2069
+ openingType: 'link',
2070
+ openingTypeLink: {
2071
+ url: '',
2072
+ target: '_blank',
2073
+ },
2074
+ variant: 'contained',
2075
+ fontSize: '14',
2076
+ color: '#fff',
2077
+ backgroundColor: '#4dbf96',
2078
+ buttonSize: 'lg',
2079
+ borderRadius: '4',
2051
2080
  };
2052
2081
 
2053
- const widgetArticleTextDefinition = {
2054
- label: 'WIDGET_Text',
2055
- description: 'WIDGET_Text_Description',
2056
- name: 'widget-article-text',
2057
- img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
2082
+ const widgetApiDefinition = {
2083
+ label: 'WIDGET_Api',
2084
+ description: 'WIDGET_Api_Description',
2085
+ name: 'widget-api',
2086
+ img: '/img/fast-intranet/widget-text.png',
2058
2087
  available: true,
2059
2088
  panel: {
2060
2089
  useWrapper: false,
@@ -2062,15 +2091,15 @@ const widgetArticleTextDefinition = {
2062
2091
  useWidgets: false,
2063
2092
  },
2064
2093
  };
2065
- const widgetArticleTextContent = {
2066
- text: '',
2094
+ const widgetApiContent = {
2095
+ url: '',
2067
2096
  };
2068
2097
 
2069
- const widgetArticleTitleDefinition = {
2070
- label: 'WIDGET_Title',
2071
- description: 'WIDGET_Title_Description',
2072
- name: 'widget-article-title',
2073
- img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
2098
+ const widgetArticleSliderDefinition = {
2099
+ label: 'WIDGET_Slider',
2100
+ description: 'WIDGET_Slider_Description',
2101
+ name: 'widget-article-slider',
2102
+ img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
2074
2103
  available: true,
2075
2104
  panel: {
2076
2105
  useWrapper: false,
@@ -2078,35 +2107,14 @@ const widgetArticleTitleDefinition = {
2078
2107
  useWidgets: false,
2079
2108
  },
2080
2109
  };
2081
- const widgetArticleTitleContent = {
2082
- text: '',
2083
- heading: 'h1',
2084
- backgroundColor: 'transparent',
2110
+ const widgetArticleSliderContent = {
2111
+ slides: [],
2112
+ maxWidth: 800,
2113
+ loop: false,
2114
+ useDots: true,
2115
+ startAt: 0,
2085
2116
  };
2086
2117
 
2087
- const WIDGET_ARTICLE_TITLE = 'widget-article-title';
2088
- const WIDGET_ARTICLE_TEXT = 'widget-article-text';
2089
- const WIDGET_ARTICLE_IMAGE = 'widget-article-image';
2090
- const WIDGET_ARTICLE_BUTTON = 'widget-article-button';
2091
- const WIDGET_ARTICLE_GALLERY = 'widget-article-gallery';
2092
- const WIDGET_ARTICLE_ATTACHMENT = 'widget-article-attachment';
2093
- const WIDGET_CHECK_LIST = 'widget-check-list';
2094
- const WIDGET_CHECK_LIST_LABEL = 'WIDGET_Check_List';
2095
- const WIDGET_CHECK_LIST_DESCRIPTION = 'WIDGET_Check_List_Description';
2096
-
2097
- var WIDGETS = /*#__PURE__*/Object.freeze({
2098
- __proto__: null,
2099
- WIDGET_ARTICLE_TITLE: WIDGET_ARTICLE_TITLE,
2100
- WIDGET_ARTICLE_TEXT: WIDGET_ARTICLE_TEXT,
2101
- WIDGET_ARTICLE_IMAGE: WIDGET_ARTICLE_IMAGE,
2102
- WIDGET_ARTICLE_BUTTON: WIDGET_ARTICLE_BUTTON,
2103
- WIDGET_ARTICLE_GALLERY: WIDGET_ARTICLE_GALLERY,
2104
- WIDGET_ARTICLE_ATTACHMENT: WIDGET_ARTICLE_ATTACHMENT,
2105
- WIDGET_CHECK_LIST: WIDGET_CHECK_LIST,
2106
- WIDGET_CHECK_LIST_LABEL: WIDGET_CHECK_LIST_LABEL,
2107
- WIDGET_CHECK_LIST_DESCRIPTION: WIDGET_CHECK_LIST_DESCRIPTION
2108
- });
2109
-
2110
2118
  const widgetCheckListDefinition = {
2111
2119
  label: WIDGET_CHECK_LIST_LABEL,
2112
2120
  description: WIDGET_CHECK_LIST_DESCRIPTION,
@@ -2114,7 +2122,7 @@ const widgetCheckListDefinition = {
2114
2122
  img: '/img/fast-intranet/widget-check-list.png',
2115
2123
  available: true,
2116
2124
  panel: {
2117
- useWrapper: false,
2125
+ useWrapper: true,
2118
2126
  useEditor: true,
2119
2127
  useWidgets: false,
2120
2128
  },
@@ -2123,12 +2131,29 @@ const widgetCheckListContent = {
2123
2131
  arr: [],
2124
2132
  };
2125
2133
 
2126
- function uniqid() {
2127
- let id = '';
2128
- for (let index = 0; index < 16; index++) {
2129
- id += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
2134
+ function widgetDefinition(name) {
2135
+ switch (name) {
2136
+ default:
2137
+ return widgetArticleGalleryDefinition;
2138
+ case 'widget-article-gallery':
2139
+ return widgetArticleGalleryDefinition;
2140
+ case 'widget-article-attachment':
2141
+ return widgetArticleAttachmentDefinition;
2142
+ case 'widget-article-slider':
2143
+ return widgetArticleSliderDefinition;
2144
+ case 'widget-article-text':
2145
+ return widgetArticleTextDefinition;
2146
+ case 'widget-article-title':
2147
+ return widgetArticleTitleDefinition;
2148
+ case 'widget-article-image':
2149
+ return widgetArticleImageDefinition;
2150
+ case 'widget-api':
2151
+ return widgetApiDefinition;
2152
+ case 'widget-article-button':
2153
+ return widgetArticleButtonDefinition;
2154
+ case 'widget-check-list':
2155
+ return widgetCheckListDefinition;
2130
2156
  }
2131
- return id;
2132
2157
  }
2133
2158
 
2134
2159
  function widgetFactory(name) {
@@ -2168,31 +2193,6 @@ function content(name) {
2168
2193
  }
2169
2194
  }
2170
2195
 
2171
- function widgetDefinition(name) {
2172
- switch (name) {
2173
- default:
2174
- return widgetArticleGalleryDefinition;
2175
- case 'widget-article-gallery':
2176
- return widgetArticleGalleryDefinition;
2177
- case 'widget-article-attachment':
2178
- return widgetArticleAttachmentDefinition;
2179
- case 'widget-article-slider':
2180
- return widgetArticleSliderDefinition;
2181
- case 'widget-article-text':
2182
- return widgetArticleTextDefinition;
2183
- case 'widget-article-title':
2184
- return widgetArticleTitleDefinition;
2185
- case 'widget-article-image':
2186
- return widgetArticleImageDefinition;
2187
- case 'widget-api':
2188
- return widgetApiDefinition;
2189
- case 'widget-article-button':
2190
- return widgetArticleButtonDefinition;
2191
- case 'widget-check-list':
2192
- return widgetCheckListDefinition;
2193
- }
2194
- }
2195
-
2196
2196
  const MODE_EDIT = 'edit';
2197
2197
  const MODE_VIEW = 'view';
2198
2198
  const initialState$3 = {
@@ -2204,6 +2204,7 @@ const initialState$3 = {
2204
2204
  editableMap: {},
2205
2205
  currentEditableIndex: -1,
2206
2206
  currentEditableWidgetId: undefined,
2207
+ widgetObject: {},
2207
2208
  };
2208
2209
  const widgetsSlice = toolkit.createSlice({
2209
2210
  name: 'widgets',
@@ -2214,6 +2215,10 @@ const widgetsSlice = toolkit.createSlice({
2214
2215
  state.ids[uniqid] = widget;
2215
2216
  state.states[uniqid] = { busy: false, initialized: false, loading: false, mounted: false, hover: false, empty: true };
2216
2217
  },
2218
+ registerWidgetObject: (state, action) => {
2219
+ const { uniqid, object } = action.payload;
2220
+ state.widgetObject[uniqid] = object;
2221
+ },
2217
2222
  updateWidget: (state, action) => {
2218
2223
  const { uniqid } = action.payload;
2219
2224
  const wrapper = Object.assign({}, state.ids[uniqid]);
@@ -2330,6 +2335,7 @@ const selectWidgets = (state) => state.widgets.ids;
2330
2335
  const selectWidgetContent = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) === null || _a === void 0 ? void 0 : _a.widget.content; };
2331
2336
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2332
2337
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2338
+ const selectWidgetObject = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObject[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2333
2339
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
2334
2340
  const updateWidgetContent = (uniqid, content, override) => Widget.slice.actions.updateWidget({ uniqid, content, override: override !== null && override !== void 0 ? override : false });
2335
2341
  const Widget = {
@@ -2348,6 +2354,7 @@ const Widget = {
2348
2354
  selectWidgetState,
2349
2355
  selectWidgetContent,
2350
2356
  selectModal,
2357
+ selectWidgetObject,
2351
2358
  },
2352
2359
  };
2353
2360