@myunisoft/design-system 1.3.4-rev157 → 1.3.4

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.
@@ -41,12 +41,6 @@ export type DocumentComposerCustomProps = {
41
41
  getSectionDeletePermission?: (section: DocumentSection) => boolean;
42
42
  /** Defaults to `() => true` */
43
43
  getSectionOrderChangePermission?: (section: DocumentSection) => boolean;
44
- /**
45
- * Called during drag to validate if the move to a new position is allowed.
46
- * Use this for custom drop target restrictions (e.g., prevent dropping into archive sections).
47
- * Defaults to `() => true`.
48
- */
49
- canMoveSectionToNewPosition?: (params: ItemPositionParams) => boolean;
50
44
  /** Defaults to `() => true` */
51
45
  getSectionCreatePermission?: (section: DocumentSection) => boolean;
52
46
  /** Defaults to `() => true` */
@@ -56,6 +50,13 @@ export type DocumentComposerCustomProps = {
56
50
  hiddenIconTooltip?: string;
57
51
  /** Return null for no icon */
58
52
  renderSectionIcon?: (section: DocumentSection) => ReactNode;
53
+ /**
54
+ * Determines valid drop targets during drag. Invalid targets are greyed out.
55
+ * `targetSection` is `null` when dropping at root level.
56
+ * `newIndex` is the position where the item would be inserted in the target's children.
57
+ * Defaults to `() => true`.
58
+ */
59
+ isValidDropTarget?: (draggedSection: DocumentSection, targetSection: DocumentSection | null, newIndex: number) => boolean;
59
60
  sectionContent?: SectionContent;
60
61
  isLoadingSectionContent?: boolean;
61
62
  selectedSectionId?: string | null;
@@ -67,5 +68,5 @@ export type DocumentComposerCustomProps = {
67
68
  type DocumentComposerProps = {
68
69
  sections?: DocumentSection[];
69
70
  } & DocumentComposerCallbacks & DocumentComposerCustomProps;
70
- declare const DocumentComposer: ({ sections, isLoadingSections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, onSectionSelect, onSectionContentSave, noSectionsPlaceholder, getSectionTitleChangePermission, getSectionDeletePermission, getSectionOrderChangePermission, canMoveSectionToNewPosition, getSectionCreatePermission, getSectionVisibilityChangePermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, renderSectionIcon, sectionContent, isLoadingSectionContent, selectedSectionId, renderDeleteConfirmation, renderUnsavedChangesConfirmation }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
71
+ declare const DocumentComposer: ({ sections, isLoadingSections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, onSectionSelect, onSectionContentSave, noSectionsPlaceholder, getSectionTitleChangePermission, getSectionDeletePermission, getSectionOrderChangePermission, getSectionCreatePermission, getSectionVisibilityChangePermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, renderSectionIcon, isValidDropTarget, sectionContent, isLoadingSectionContent, selectedSectionId, renderDeleteConfirmation, renderUnsavedChangesConfirmation }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
71
72
  export default DocumentComposer;