jamespot-front-business 1.1.76 → 1.1.77

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
@@ -2167,6 +2167,9 @@ const WIDGET_ARTICLE_ATTACHMENT = 'widget-article-attachment';
2167
2167
  const WIDGET_CHECK_LIST = 'widget-check-list';
2168
2168
  const WIDGET_CHECK_LIST_LABEL = 'WIDGET_Check_List';
2169
2169
  const WIDGET_CHECK_LIST_DESCRIPTION = 'WIDGET_Check_List_Description';
2170
+ const WIDGET_QUICK_SURVEY = 'widget-quick-survey';
2171
+ const WIDGET_QUICK_SURVEY_LABEL = 'WIDGET_Quick_Survey';
2172
+ const WIDGET_QUICK_SURVEY_DESCRIPTION = 'WIDGET_Quick_Survey_Text';
2170
2173
 
2171
2174
  var WIDGETS = /*#__PURE__*/Object.freeze({
2172
2175
  __proto__: null,
@@ -2178,30 +2181,33 @@ var WIDGETS = /*#__PURE__*/Object.freeze({
2178
2181
  WIDGET_ARTICLE_ATTACHMENT: WIDGET_ARTICLE_ATTACHMENT,
2179
2182
  WIDGET_CHECK_LIST: WIDGET_CHECK_LIST,
2180
2183
  WIDGET_CHECK_LIST_LABEL: WIDGET_CHECK_LIST_LABEL,
2181
- WIDGET_CHECK_LIST_DESCRIPTION: WIDGET_CHECK_LIST_DESCRIPTION
2184
+ WIDGET_CHECK_LIST_DESCRIPTION: WIDGET_CHECK_LIST_DESCRIPTION,
2185
+ WIDGET_QUICK_SURVEY: WIDGET_QUICK_SURVEY,
2186
+ WIDGET_QUICK_SURVEY_LABEL: WIDGET_QUICK_SURVEY_LABEL,
2187
+ WIDGET_QUICK_SURVEY_DESCRIPTION: WIDGET_QUICK_SURVEY_DESCRIPTION
2182
2188
  });
2183
2189
 
2184
- const widgetArticleTextDefinition = {
2185
- label: 'WIDGET_Text',
2186
- description: 'WIDGET_Text_Description',
2187
- name: WidgetsName.ArticleText,
2188
- img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
2190
+ const widgetArticleAttachmentDefinition = {
2191
+ label: 'WIDGET_Article_Attachment',
2192
+ description: 'WIDGET_Article_Attachment_Description',
2193
+ name: WidgetsName.ArticleAttachment,
2194
+ img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
2189
2195
  available: true,
2190
2196
  panel: {
2191
- useWrapper: false,
2197
+ useWrapper: true,
2192
2198
  useEditor: true,
2193
2199
  useWidgets: false,
2194
2200
  },
2195
2201
  };
2196
- const widgetArticleTextContent = {
2197
- text: '',
2202
+ const widgetArticleAttachmentContent = {
2203
+ files: [],
2198
2204
  };
2199
2205
 
2200
- const widgetArticleTitleDefinition = {
2201
- label: 'WIDGET_Title',
2202
- description: 'WIDGET_Title_Description',
2203
- name: WidgetsName.ArticleTitle,
2204
- img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
2206
+ const widgetArticleButtonDefinition = {
2207
+ label: 'WIDGET_Button',
2208
+ description: 'WIDGET_Button_Description',
2209
+ name: WidgetsName.ArticleButton,
2210
+ img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
2205
2211
  available: true,
2206
2212
  panel: {
2207
2213
  useWrapper: false,
@@ -2209,26 +2215,19 @@ const widgetArticleTitleDefinition = {
2209
2215
  useWidgets: false,
2210
2216
  },
2211
2217
  };
2212
- const widgetArticleTitleContent = {
2218
+ const widgetArticleButtonContent = {
2213
2219
  text: '',
2214
- heading: 'h1',
2215
- backgroundColor: 'transparent',
2216
- };
2217
-
2218
- const widgetArticleAttachmentDefinition = {
2219
- label: 'WIDGET_Article_Attachment',
2220
- description: 'WIDGET_Article_Attachment_Description',
2221
- name: WidgetsName.ArticleAttachment,
2222
- img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
2223
- available: true,
2224
- panel: {
2225
- useWrapper: true,
2226
- useEditor: true,
2227
- useWidgets: false,
2220
+ openingType: 'link',
2221
+ openingTypeLink: {
2222
+ url: '',
2223
+ target: '_blank',
2228
2224
  },
2229
- };
2230
- const widgetArticleAttachmentContent = {
2231
- files: [],
2225
+ variant: 'contained',
2226
+ fontSize: '14',
2227
+ color: '#fff',
2228
+ backgroundColor: '#4dbf96',
2229
+ buttonSize: 'lg',
2230
+ borderRadius: '4',
2232
2231
  };
2233
2232
 
2234
2233
  const widgetArticleGalleryDefinition = {
@@ -2263,33 +2262,6 @@ const widgetArticleImageDefinition = {
2263
2262
  };
2264
2263
  const widgetArticleImageContent = {};
2265
2264
 
2266
- const widgetArticleButtonDefinition = {
2267
- label: 'WIDGET_Button',
2268
- description: 'WIDGET_Button_Description',
2269
- name: WidgetsName.ArticleButton,
2270
- img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
2271
- available: true,
2272
- panel: {
2273
- useWrapper: false,
2274
- useEditor: true,
2275
- useWidgets: false,
2276
- },
2277
- };
2278
- const widgetArticleButtonContent = {
2279
- text: '',
2280
- openingType: 'link',
2281
- openingTypeLink: {
2282
- url: '',
2283
- target: '_blank',
2284
- },
2285
- variant: 'contained',
2286
- fontSize: '14',
2287
- color: '#fff',
2288
- backgroundColor: '#4dbf96',
2289
- buttonSize: 'lg',
2290
- borderRadius: '4',
2291
- };
2292
-
2293
2265
  const widgetArticleSliderDefinition = {
2294
2266
  label: 'WIDGET_Slider',
2295
2267
  description: 'WIDGET_Slider_Description',
@@ -2310,6 +2282,40 @@ const widgetArticleSliderContent = {
2310
2282
  startAt: 0,
2311
2283
  };
2312
2284
 
2285
+ const widgetArticleTextDefinition = {
2286
+ label: 'WIDGET_Text',
2287
+ description: 'WIDGET_Text_Description',
2288
+ name: WidgetsName.ArticleText,
2289
+ img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
2290
+ available: true,
2291
+ panel: {
2292
+ useWrapper: false,
2293
+ useEditor: true,
2294
+ useWidgets: false,
2295
+ },
2296
+ };
2297
+ const widgetArticleTextContent = {
2298
+ text: '',
2299
+ };
2300
+
2301
+ const widgetArticleTitleDefinition = {
2302
+ label: 'WIDGET_Title',
2303
+ description: 'WIDGET_Title_Description',
2304
+ name: WidgetsName.ArticleTitle,
2305
+ img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
2306
+ available: true,
2307
+ panel: {
2308
+ useWrapper: false,
2309
+ useEditor: true,
2310
+ useWidgets: false,
2311
+ },
2312
+ };
2313
+ const widgetArticleTitleContent = {
2314
+ text: '',
2315
+ heading: 'h1',
2316
+ backgroundColor: 'transparent',
2317
+ };
2318
+
2313
2319
  const widgetCheckListDefinition = {
2314
2320
  label: WIDGET_CHECK_LIST_LABEL,
2315
2321
  description: WIDGET_CHECK_LIST_DESCRIPTION,
@@ -2387,6 +2393,28 @@ const widgetPresenceContent = {
2387
2393
  limitValue: 100,
2388
2394
  };
2389
2395
 
2396
+ const widgetQuickSurveyDefinition = {
2397
+ label: WIDGET_QUICK_SURVEY_LABEL,
2398
+ description: WIDGET_QUICK_SURVEY_DESCRIPTION,
2399
+ name: WidgetsName.QuickSurvey,
2400
+ img: '/img/fast-intranet/widget-check-list.png',
2401
+ available: true,
2402
+ panel: {
2403
+ useWrapper: true,
2404
+ useEditor: true,
2405
+ useWidgets: false,
2406
+ },
2407
+ };
2408
+ const widgetQuickSurveyContent = {
2409
+ arr: [],
2410
+ open: false,
2411
+ multi: false,
2412
+ closing: false,
2413
+ isClosed: false,
2414
+ showResult: false,
2415
+ isNotDisabled: false,
2416
+ };
2417
+
2390
2418
  function widgetDefinition(name) {
2391
2419
  switch (name) {
2392
2420
  default:
@@ -2413,6 +2441,8 @@ function widgetDefinition(name) {
2413
2441
  return widgetArticleButtonDefinition;
2414
2442
  case 'widget-check-list':
2415
2443
  return widgetCheckListDefinition;
2444
+ case 'widget-quick-survey':
2445
+ return widgetQuickSurveyDefinition;
2416
2446
  }
2417
2447
  }
2418
2448
 
@@ -2454,6 +2484,8 @@ function content(name) {
2454
2484
  return Object.assign({}, widgetArticleTextContent);
2455
2485
  case 'widget-check-list':
2456
2486
  return Object.assign({}, widgetCheckListContent);
2487
+ case 'widget-quick-survey':
2488
+ return Object.assign({}, widgetQuickSurveyContent);
2457
2489
  }
2458
2490
  }
2459
2491
 
@@ -2523,8 +2555,8 @@ const widgetsSlice = createSlice({
2523
2555
  }
2524
2556
  },
2525
2557
  registerWidgetRTObject: (state, action) => {
2526
- const { uniqid, object } = action.payload;
2527
- state.rtObjectStack = [...state.rtObjectStack, { uniqid, object }];
2558
+ const { uniqid, fn, object } = action.payload;
2559
+ state.rtObjectStack = [...state.rtObjectStack, { uniqid, fn, object }];
2528
2560
  },
2529
2561
  flushWidget: (state, action) => {
2530
2562
  const { uniqid } = action.payload;
@@ -2637,6 +2669,40 @@ const getWidgetRTHandlers = function (dispatch, uniqid) {
2637
2669
  dispatch(widgetsSlice.actions.registerWidgetRTObject({
2638
2670
  uniqid: message.data.uniqid,
2639
2671
  object: message.data.object,
2672
+ fn: message.function,
2673
+ }));
2674
+ }
2675
+ }
2676
+ };
2677
+ const widgetChecklistResponseHandler = function (message) {
2678
+ if (message.namespace === 'WIDGET' && message.function === 'check-list-response') {
2679
+ if (message.data && message.data.uniqid === uniqid) {
2680
+ dispatch(widgetsSlice.actions.registerWidgetRTObject({
2681
+ uniqid: message.data.uniqid,
2682
+ object: message.data.object,
2683
+ fn: message.function,
2684
+ }));
2685
+ }
2686
+ }
2687
+ };
2688
+ const widgetUpdateHandler = function (message) {
2689
+ if (message.namespace === 'WIDGET' && message.function === 'widget-update') {
2690
+ if (message.data && message.data.uniqid === uniqid) {
2691
+ dispatch(widgetsSlice.actions.registerWidgetRTObject({
2692
+ uniqid: message.data.uniqid,
2693
+ object: message.data.object,
2694
+ fn: message.function,
2695
+ }));
2696
+ }
2697
+ }
2698
+ };
2699
+ const widgetQuickSurveyResponseHandler = function (message) {
2700
+ if (message.namespace === 'WIDGET' && message.function === 'widget-quick-survey-response') {
2701
+ if (message.data && message.data.uniqid === uniqid) {
2702
+ dispatch(widgetsSlice.actions.registerWidgetRTObject({
2703
+ uniqid: message.data.uniqid,
2704
+ object: message.data.object,
2705
+ fn: message.function,
2640
2706
  }));
2641
2707
  }
2642
2708
  }
@@ -2647,6 +2713,21 @@ const getWidgetRTHandlers = function (dispatch, uniqid) {
2647
2713
  function: 'widget-presence-response',
2648
2714
  handler: widgetPresenceResponseHandler,
2649
2715
  },
2716
+ {
2717
+ namespace: 'WIDGET',
2718
+ function: 'check-list-response',
2719
+ handler: widgetChecklistResponseHandler,
2720
+ },
2721
+ {
2722
+ namespace: 'WIDGET',
2723
+ function: 'widget-update',
2724
+ handler: widgetUpdateHandler,
2725
+ },
2726
+ {
2727
+ namespace: 'WIDGET',
2728
+ function: 'widget-quick-survey-response',
2729
+ handler: widgetQuickSurveyResponseHandler,
2730
+ },
2650
2731
  ];
2651
2732
  };
2652
2733
 
@@ -2657,6 +2738,13 @@ const selectFlushedWidgets = (state) => state.widgets.flushedWidgets;
2657
2738
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2658
2739
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2659
2740
  const selectWidgetObject = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObject[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2741
+ const selectWidgetObjectUri = (state, uniqid) => {
2742
+ const o = state.widgets.widgetObject[uniqid];
2743
+ if (o && 'uri' in o) {
2744
+ return o.uri;
2745
+ }
2746
+ return undefined;
2747
+ };
2660
2748
  const selectWidgetObjectRights = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObjectRights[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2661
2749
  const selectWidgetAuthor = (state, uniqid) => { var _a; return (_a = state.widgets.widgetAuthor[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
2662
2750
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
@@ -2679,6 +2767,7 @@ const Widget = {
2679
2767
  selectWidgetState,
2680
2768
  selectModal,
2681
2769
  selectWidgetObject,
2770
+ selectWidgetObjectUri,
2682
2771
  selectWidgetAuthor,
2683
2772
  selectWidgetObjectRights,
2684
2773
  selectAllWidgetRTObject,
@@ -2694,18 +2783,20 @@ const editorsSlice = createSlice({
2694
2783
  initialState: initialState$2,
2695
2784
  reducers: {
2696
2785
  registerEditor: (state, action) => {
2697
- const { uniqid, name, onSave } = action.payload;
2786
+ const { uniqid, name, onSave, mode } = action.payload;
2698
2787
  const ed = !onSave
2699
2788
  ? {
2700
2789
  uniqid,
2701
2790
  name,
2702
2791
  position: 'right',
2792
+ mode: mode !== null && mode !== void 0 ? mode : 'view',
2703
2793
  }
2704
2794
  : {
2705
2795
  uniqid,
2706
2796
  name,
2707
2797
  onSave,
2708
2798
  position: 'right',
2799
+ mode: mode !== null && mode !== void 0 ? mode : 'view',
2709
2800
  };
2710
2801
  state.editors = state.editors.find((ed) => ed.uniqid === uniqid)
2711
2802
  ? state.editors