pds-dev-kit-web-test 2.5.28 → 2.5.30

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.
@@ -79,6 +79,14 @@ type ActionHandlerPayload = {
79
79
  '@CUSTOMSECTION/ESCAPE_ONE_FROM_GROUP': {
80
80
  id: string;
81
81
  };
82
+ '@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE': {
83
+ layout: Layout;
84
+ layoutItem: LayoutItem;
85
+ data: any;
86
+ };
87
+ '@CUSTOMSECTION/ON_DROP_DRAG_OVER': {
88
+ e: any;
89
+ };
82
90
  };
83
91
  type ActionMap<M extends {
84
92
  [index: string]: any;
@@ -445,18 +445,37 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
445
445
  }
446
446
  return false;
447
447
  })();
448
- var onDrop = function (layout, layoutItem, _event) {
449
- alert("Dropped element props:\n".concat(JSON.stringify(layoutItem, ['x', 'y', 'w', 'h'], 2)));
448
+ var _j = (0, react_1.useState)(), droppingItem = _j[0], setDroppingItem = _j[1];
449
+ var onDrop = function (layout, layoutItem, e) {
450
+ var data = e.dataTransfer.getData('text/plain');
451
+ console.log(data);
452
+ // alert(`Dropped element props:\n${JSON.stringify(layoutItem, ['x', 'y', 'w', 'h'], 2)}`);
453
+ if (!isEditMode) {
454
+ return;
455
+ }
456
+ sectionActionHandler &&
457
+ sectionActionHandler({
458
+ type: '@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE',
459
+ payload: {
460
+ layout: layout,
461
+ layoutItem: layoutItem,
462
+ data: data
463
+ }
464
+ });
450
465
  };
451
466
  var onDropDragOver = function (e) {
452
- return { w: 10, h: 10 };
467
+ if (!sectionActionHandler) {
468
+ return null;
469
+ }
470
+ // return sectionActionHandler({
471
+ // type: '@CUSTOMSECTION/ON_DROP_FROM_OUTSIDE',
472
+ // payload: {
473
+ // e
474
+ // }
475
+ // });
476
+ return null;
453
477
  };
454
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsxs)(exports.S_gleStyles, { children: [showSectionHiddenCover && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)("div", __assign({ className: "droppable-element", draggable: true, unselectable: "on",
455
- // this is a hack for firefox
456
- // Firefox requires some kind of initialization
457
- // which we can do by adding this attribute
458
- // @see https://bugzilla.mozilla.org/show_bug.cgi?id=568313
459
- onDragStart: function (e) { return e.dataTransfer.setData('text/plain', ''); } }, { children: "Droppable Element (Drag me!)" })), (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
478
+ return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsxs)(exports.S_gleStyles, { children: [showSectionHiddenCover && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
460
479
  minHeight: customSectionStyles.minHeight,
461
480
  paddingTop: padding.top,
462
481
  paddingBottom: padding.bottom,
@@ -468,6 +487,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
468
487
  minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
469
488
  fontSize: "".concat(baseFontSize, "px")
470
489
  }, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onDrop: onDrop, onResizeStop: onResizeStop, onDropDragOver: onDropDragOver,
490
+ // droppingItem={droppingItem}
471
491
  // onFitToContent={onAutoFitContent}
472
492
  onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
473
493
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.28",
3
+ "version": "2.5.30",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",