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