@dialpad/dialtone-vue 4.8.0 → 4.9.0
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/FilterPill-DY9T19XB.cjs +2 -0
- package/dist/FilterPill-DY9T19XB.cjs.map +1 -0
- package/dist/FilterPill-IBlswKiK.js +757 -0
- package/dist/FilterPill-IBlswKiK.js.map +1 -0
- package/dist/{ForceLinkify-DuAo3TMB.js → ForceLinkify-53Zegx7z.js} +1 -1
- package/dist/{ForceLinkify-DuAo3TMB.js.map → ForceLinkify-53Zegx7z.js.map} +1 -1
- package/dist/{ForceLinkify-kQ_kWKVm.cjs → ForceLinkify-DhmBEXhe.cjs} +1 -1
- package/dist/{ForceLinkify-kQ_kWKVm.cjs.map → ForceLinkify-DhmBEXhe.cjs.map} +1 -1
- package/dist/{MarkdownRenderer-eMwmPygx.js → MarkdownRenderer-Cnbn7gje.js} +1 -1
- package/dist/{MarkdownRenderer-eMwmPygx.js.map → MarkdownRenderer-Cnbn7gje.js.map} +1 -1
- package/dist/{MarkdownRenderer-C5wdjC5_.cjs → MarkdownRenderer-a12waV7r.cjs} +1 -1
- package/dist/{MarkdownRenderer-C5wdjC5_.cjs.map → MarkdownRenderer-a12waV7r.cjs.map} +1 -1
- package/dist/{Resizable-DBRsEUf3.cjs → Resizable-DdP6uPio.cjs} +2 -2
- package/dist/{Resizable-DBRsEUf3.cjs.map → Resizable-DdP6uPio.cjs.map} +1 -1
- package/dist/{Resizable-EY7mWluI.js → Resizable-Ddsm-H14.js} +3 -3
- package/dist/{Resizable-EY7mWluI.js.map → Resizable-Ddsm-H14.js.map} +1 -1
- package/dist/{ResizableHandle-v-oU-sj-.js → ResizableHandle-DQduVxrG.js} +3 -3
- package/dist/{ResizableHandle-v-oU-sj-.js.map → ResizableHandle-DQduVxrG.js.map} +1 -1
- package/dist/{ResizableHandle-DQG7a5D9.cjs → ResizableHandle-_ldmhyEw.cjs} +2 -2
- package/dist/{ResizableHandle-DQG7a5D9.cjs.map → ResizableHandle-_ldmhyEw.cjs.map} +1 -1
- package/dist/{ResizableUtils-C9qEZRN5.js → ResizableUtils-BIRNCdKB.js} +1 -1
- package/dist/{ResizableUtils-C9qEZRN5.js.map → ResizableUtils-BIRNCdKB.js.map} +1 -1
- package/dist/{ResizableUtils-DMfertP2.cjs → ResizableUtils-BptSHmLg.cjs} +1 -1
- package/dist/{ResizableUtils-DMfertP2.cjs.map → ResizableUtils-BptSHmLg.cjs.map} +1 -1
- package/dist/{RichTextEditor-DMUDJKVn.cjs → RichTextEditor-CjyvDYID.cjs} +2 -2
- package/dist/{RichTextEditor-DMUDJKVn.cjs.map → RichTextEditor-CjyvDYID.cjs.map} +1 -1
- package/dist/{RichTextEditor-D8DfONFm.js → RichTextEditor-DhNhx5AH.js} +4 -4
- package/dist/{RichTextEditor-D8DfONFm.js.map → RichTextEditor-DhNhx5AH.js.map} +1 -1
- package/dist/{Scroller-pAU8UWIH.cjs → Scroller-Bt8TUghI.cjs} +1 -1
- package/dist/{Scroller-pAU8UWIH.cjs.map → Scroller-Bt8TUghI.cjs.map} +1 -1
- package/dist/{Scroller-B1xwv6TG.js → Scroller-D7MjyXun.js} +1 -1
- package/dist/{Scroller-B1xwv6TG.js.map → Scroller-D7MjyXun.js.map} +1 -1
- package/dist/{Slider-D2cDYZcJ.cjs → Slider-CfvbLBv5.cjs} +2 -2
- package/dist/{Slider-D2cDYZcJ.cjs.map → Slider-CfvbLBv5.cjs.map} +1 -1
- package/dist/{Slider-Du45PVLU.js → Slider-Xd5Aj9nS.js} +2 -2
- package/dist/{Slider-Du45PVLU.js.map → Slider-Xd5Aj9nS.js.map} +1 -1
- package/dist/{TextList-7RwngSie.js → TextList-CkY7OAl2.js} +1 -1
- package/dist/{TextList-7RwngSie.js.map → TextList-CkY7OAl2.js.map} +1 -1
- package/dist/{TextList-CLUdOdlp.cjs → TextList-DUL3NwQp.cjs} +1 -1
- package/dist/{TextList-CLUdOdlp.cjs.map → TextList-DUL3NwQp.cjs.map} +1 -1
- package/dist/{TextListItem-B-bhrqik.cjs → TextListItem-BI9M_J8Y.cjs} +1 -1
- package/dist/{TextListItem-B-bhrqik.cjs.map → TextListItem-BI9M_J8Y.cjs.map} +1 -1
- package/dist/{TextListItem-D0UmIR_q.js → TextListItem-D96feMQf.js} +1 -1
- package/dist/{TextListItem-D0UmIR_q.js.map → TextListItem-D96feMQf.js.map} +1 -1
- package/dist/{Toast-57Ts-hX9.cjs → Toast-BXvUrvd_.cjs} +1 -1
- package/dist/{Toast-57Ts-hX9.cjs.map → Toast-BXvUrvd_.cjs.map} +1 -1
- package/dist/{Toast-BNhGD6l8.js → Toast-DmzQrYtG.js} +1 -1
- package/dist/{Toast-BNhGD6l8.js.map → Toast-DmzQrYtG.js.map} +1 -1
- package/dist/{UseResizableCalculations-C6lmroJg.cjs → UseResizableCalculations-BNcxJfef.cjs} +2 -2
- package/dist/{UseResizableCalculations-C6lmroJg.cjs.map → UseResizableCalculations-BNcxJfef.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-BTQ4jiff.js → UseResizableCalculations-k6TSRlpa.js} +2 -2
- package/dist/{UseResizableCalculations-BTQ4jiff.js.map → UseResizableCalculations-k6TSRlpa.js.map} +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Combobox/Combobox.vue.d.ts +18 -0
- package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts +9 -0
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts +9 -0
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts.map +1 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +36 -0
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +62 -3
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPillControlled.d.ts +7 -1
- package/dist/components/FilterPill/FilterPillControlled.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPillSelection.d.ts +5 -0
- package/dist/components/FilterPill/FilterPillSelection.d.ts.map +1 -1
- package/dist/components/FilterPill/modules/FilterPillOptionGroup.vue.d.ts +31 -0
- package/dist/components/FilterPill/modules/FilterPillOptionGroup.vue.d.ts.map +1 -0
- package/dist/components/ListItem/ListItem.vue.d.ts +9 -0
- package/dist/components/ListItem/ListItem.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts +9 -0
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +3 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +18 -19
- package/dist/{floating-ui.dom-j5GI2lJG.js → floating-ui.dom-BUeA6pp4.js} +1 -1
- package/dist/{floating-ui.dom-j5GI2lJG.js.map → floating-ui.dom-BUeA6pp4.js.map} +1 -1
- package/dist/{floating-ui.dom-D2zQ_96p.cjs → floating-ui.dom-DF2uE3n8.cjs} +1 -1
- package/dist/{floating-ui.dom-D2zQ_96p.cjs.map → floating-ui.dom-DF2uE3n8.cjs.map} +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +18 -11
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.js +4 -1
- package/dist/lib/filter-pill/filter-pill-controlled.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill-selection.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill-selection.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill-selection.js +53 -19
- package/dist/lib/filter-pill/filter-pill-selection.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -2
- package/dist/lib/filter-pill/filter-pill.js +2 -709
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +1 -1
- package/dist/lib/list-item/list-item.cjs +1 -1
- package/dist/lib/list-item/list-item.cjs.map +1 -1
- package/dist/lib/list-item/list-item.js +14 -3
- package/dist/lib/list-item/list-item.js.map +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/package.json +5 -5
- package/dist/lib/filter-pill/filter-pill.cjs.map +0 -1
- package/dist/lib/filter-pill/filter-pill.js.map +0 -1
package/dist/{UseResizableCalculations-C6lmroJg.cjs.map → UseResizableCalculations-BNcxJfef.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseResizableCalculations-C6lmroJg.cjs","names":[],"sources":["../components/Resizable/Composables/ConstraintResolver.ts","../components/Resizable/Composables/UseResizableCalculations.ts"],"sourcesContent":["/**\n * Constraint Resolver\n *\n * Pure functions for resolving the constraint hierarchy for resizable panels.\n * No DOM access, no Vue reactivity, no side effects.\n *\n * @see computeLayout.ts\n * @see ../resizable_constants.ts\n */\n\nimport type { ResizablePanelConfig } from '../ResizableConstants';\nimport { parseSizeToPixels } from '../ResizableUtils';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\n/**\n * Result of constraint hierarchy calculation.\n * User limits are absolute boundaries; system limits are the operating range within user limits.\n */\nexport interface ConstraintHierarchy {\n // User drag limits (absolute boundaries)\n userMinSizePixels?: number;\n userMaxSizePixels?: number;\n // System scaling limits (operating range within user limits)\n systemMinSizePixels?: number;\n systemMaxSizePixels?: number;\n // Auto-collapse threshold (container width, not panel width)\n collapseSizePixels?: number;\n}\n\n// ============================================================================\n// CLAMPING PRIMITIVE\n// ============================================================================\n\n/**\n * Clamp a value to optional min/max bounds.\n * Single source of truth for all constraint clamping in the resizable system.\n */\nexport function clampSize(value: number, min?: number, max?: number): number {\n let result = value;\n if (min !== undefined) result = Math.max(result, min);\n if (max !== undefined) result = Math.min(result, max);\n return result;\n}\n\n/**\n * Resolve effective min/max for a given constraint tier, then clamp.\n * - 'user' tier: uses userMin/userMax only\n * - 'system' tier: uses systemMin/systemMax, falling back to userMin/userMax\n */\nexport function clampToTier(\n value: number,\n constraints: ConstraintHierarchy,\n tier: 'user' | 'system' = 'system'\n): number {\n const min = tier === 'user'\n ? constraints.userMinSizePixels\n : (constraints.systemMinSizePixels ?? constraints.userMinSizePixels);\n const max = tier === 'user'\n ? constraints.userMaxSizePixels\n : (constraints.systemMaxSizePixels ?? constraints.userMaxSizePixels);\n return clampSize(value, min, max);\n}\n\n// ============================================================================\n// INTERNAL HELPERS\n// ============================================================================\n\n/**\n * Resolve user constraints (drag limits) from panel config.\n */\nexport function resolveUserConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): { userMinSizePixels?: number; userMaxSizePixels?: number } {\n return {\n userMinSizePixels: panelConfig.userMinSize ? parseSizeToPixels(panelConfig.userMinSize, containerSize) : undefined,\n userMaxSizePixels: panelConfig.userMaxSize ? parseSizeToPixels(panelConfig.userMaxSize, containerSize) : undefined,\n };\n}\n\n/**\n * Clamp system min to be at least user min.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMin(systemMin: number | undefined, userMin: number | undefined): number | undefined {\n if (systemMin === undefined || userMin === undefined) return systemMin;\n return Math.max(systemMin, userMin);\n}\n\n/**\n * Clamp system max to be at most user max.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMax(systemMax: number | undefined, userMax: number | undefined): number | undefined {\n if (systemMax === undefined || userMax === undefined) return systemMax;\n return Math.min(systemMax, userMax);\n}\n\n/**\n * Resolve system constraints with fallback to user constraints.\n * System limits are silently clamped to stay within user limits.\n */\nexport function resolveSystemConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number,\n userMinSizePixels?: number,\n userMaxSizePixels?: number\n): { systemMinSizePixels?: number; systemMaxSizePixels?: number } {\n // Calculate system limits from props, or fall back to user limits\n const rawSystemMin = panelConfig.systemMinSize\n ? parseSizeToPixels(panelConfig.systemMinSize, containerSize)\n : userMinSizePixels;\n const rawSystemMax = panelConfig.systemMaxSize\n ? parseSizeToPixels(panelConfig.systemMaxSize, containerSize)\n : userMaxSizePixels;\n\n // Validate and clamp system limits within user limits\n const systemMinSizePixels = clampSystemMin(rawSystemMin, userMinSizePixels);\n const systemMaxSizePixels = clampSystemMax(rawSystemMax, userMaxSizePixels);\n\n return { systemMinSizePixels, systemMaxSizePixels };\n}\n\n// ============================================================================\n// PUBLIC API\n// ============================================================================\n\n/**\n * Calculate the complete constraint hierarchy for a panel.\n *\n * This separates user drag limits from system scaling limits:\n * - User limits (userMinSize/userMaxSize) are absolute boundaries for user dragging\n * - System limits (systemMinSize/systemMaxSize) are the operating range for viewport resize\n * - System limits must be within user limits (clamped silently if not)\n *\n * @param panelConfig - Panel configuration\n * @param containerSize - Current container size in pixels\n * @returns Complete constraint hierarchy with all pixel values\n */\nexport function calculateConstraintHierarchy(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): ConstraintHierarchy {\n // Resolve user constraints (drag limits)\n const { userMinSizePixels, userMaxSizePixels } = resolveUserConstraints(panelConfig, containerSize);\n\n // Resolve system constraints (viewport resize limits) with fallback to user limits\n const { systemMinSizePixels, systemMaxSizePixels } = resolveSystemConstraints(\n panelConfig,\n containerSize,\n userMinSizePixels,\n userMaxSizePixels\n );\n\n // Calculate collapse threshold (container width trigger, NOT a panel size)\n // Don't clamp to container - this threshold is compared AGAINST the container width\n const collapseSizePixels = panelConfig.collapseSize\n ? parseSizeToPixels(panelConfig.collapseSize, containerSize, { clampToContainer: false })\n : undefined;\n\n return {\n userMinSizePixels,\n userMaxSizePixels,\n systemMinSizePixels,\n systemMaxSizePixels,\n collapseSizePixels,\n };\n}\n","import { MIN_PANEL_SIZE_PX } from '../ResizableConstants';\nimport type { ResizablePanelState } from '../ResizableConstants';\nimport { clampSize } from './ConstraintResolver';\n\n// ============================================================================\n// RESIZE HANDLING\n// ============================================================================\n\nexport interface ResizeHandler {\n processResizeMove: (\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ) => ResizeMoveResult;\n}\n\nexport interface ResizeMoveResult {\n constrainedCursorPosition: number;\n beforePanelSize: number;\n afterPanelSize: number;\n isValidResize: boolean;\n}\n\nexport function useResizeHandling(containerSize?: () => number) {\n function checkPanelsResizable(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState\n ): ResizeMoveResult | null {\n if (beforePanel.resizable === false || afterPanel.resizable === false) {\n return {\n constrainedCursorPosition: rawCursorPosition,\n beforePanelSize: beforePanel.pixelSize || 0,\n afterPanelSize: afterPanel.pixelSize || 0,\n isValidResize: false,\n };\n }\n return null;\n }\n\n function applyPanelConstraints(proposedSize: number, panel: ResizablePanelState): number {\n return clampSize(proposedSize, panel.userMinSizePixels, panel.userMaxSizePixels);\n }\n\n function calculateMaxCursorForAfterPanel(\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n allPanels?: ResizablePanelState[]\n ): number {\n const minPixels = afterPanel.userMinSizePixels;\n\n if (minPixels === undefined || !allPanels) {\n return containerSizeValue;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - minPixels - totalFixedSpaceAfter;\n }\n\n function calculateAfterPanelSize(\n cursorPosition: number,\n containerSizeValue: number,\n afterPanel: ResizablePanelState,\n allPanels?: ResizablePanelState[]\n ): number {\n if (!allPanels) {\n return containerSizeValue - cursorPosition;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - cursorPosition - totalFixedSpaceAfter;\n }\n\n function processResizeMove(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ): ResizeMoveResult {\n const nonResizableResult = checkPanelsResizable(rawCursorPosition, beforePanel, afterPanel);\n if (nonResizableResult) return nonResizableResult;\n\n const beforeLeft = beforePanelLeft || 0;\n const proposedBeforeSize = rawCursorPosition - beforeLeft;\n const proposedAfterSize = containerSizeValue - rawCursorPosition;\n\n let constrainedBeforeSize = applyPanelConstraints(proposedBeforeSize, beforePanel);\n let constrainedAfterSize = applyPanelConstraints(proposedAfterSize, afterPanel);\n\n const maxCursorForAfterPanel = calculateMaxCursorForAfterPanel(afterPanel, containerSizeValue, allPanels);\n const beforePanelCursor = beforeLeft + constrainedBeforeSize;\n const effectiveCursor = Math.min(beforePanelCursor, maxCursorForAfterPanel);\n\n let constrainedCursorPosition;\n\n if (effectiveCursor < beforePanelCursor) {\n constrainedCursorPosition = effectiveCursor;\n constrainedBeforeSize = constrainedCursorPosition - beforeLeft;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n } else {\n constrainedCursorPosition = beforePanelCursor;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n }\n\n return {\n constrainedCursorPosition,\n beforePanelSize: constrainedBeforeSize,\n afterPanelSize: constrainedAfterSize,\n isValidResize: constrainedBeforeSize >= MIN_PANEL_SIZE_PX && constrainedAfterSize >= MIN_PANEL_SIZE_PX,\n };\n }\n\n return {\n processResizeMove,\n };\n}\n"],"mappings":"iDAwCA,SAAgB,EAAU,E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EAAmB,EAAuB,CAEvE,EAqBJ,OAnBI,EAAkB,GACpB,EAA4B,EAC5B,EAAwB,EAA4B,EACpD,EAAuB,EACrB,EACA,EACA,EACA,EACD,GAED,EAA4B,EAC5B,EAAuB,EACrB,EACA,EACA,EACA,EACD,EAGI,CACL,4BACA,gBAAiB,EACjB,eAAgB,EAChB,cAAe,GAAA,IAA8C,GAAA,GAC9D,CAGH,MAAO,CACL,oBACD"}
|
|
1
|
+
{"version":3,"file":"UseResizableCalculations-BNcxJfef.cjs","names":[],"sources":["../components/Resizable/Composables/ConstraintResolver.ts","../components/Resizable/Composables/UseResizableCalculations.ts"],"sourcesContent":["/**\n * Constraint Resolver\n *\n * Pure functions for resolving the constraint hierarchy for resizable panels.\n * No DOM access, no Vue reactivity, no side effects.\n *\n * @see computeLayout.ts\n * @see ../resizable_constants.ts\n */\n\nimport type { ResizablePanelConfig } from '../ResizableConstants';\nimport { parseSizeToPixels } from '../ResizableUtils';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\n/**\n * Result of constraint hierarchy calculation.\n * User limits are absolute boundaries; system limits are the operating range within user limits.\n */\nexport interface ConstraintHierarchy {\n // User drag limits (absolute boundaries)\n userMinSizePixels?: number;\n userMaxSizePixels?: number;\n // System scaling limits (operating range within user limits)\n systemMinSizePixels?: number;\n systemMaxSizePixels?: number;\n // Auto-collapse threshold (container width, not panel width)\n collapseSizePixels?: number;\n}\n\n// ============================================================================\n// CLAMPING PRIMITIVE\n// ============================================================================\n\n/**\n * Clamp a value to optional min/max bounds.\n * Single source of truth for all constraint clamping in the resizable system.\n */\nexport function clampSize(value: number, min?: number, max?: number): number {\n let result = value;\n if (min !== undefined) result = Math.max(result, min);\n if (max !== undefined) result = Math.min(result, max);\n return result;\n}\n\n/**\n * Resolve effective min/max for a given constraint tier, then clamp.\n * - 'user' tier: uses userMin/userMax only\n * - 'system' tier: uses systemMin/systemMax, falling back to userMin/userMax\n */\nexport function clampToTier(\n value: number,\n constraints: ConstraintHierarchy,\n tier: 'user' | 'system' = 'system'\n): number {\n const min = tier === 'user'\n ? constraints.userMinSizePixels\n : (constraints.systemMinSizePixels ?? constraints.userMinSizePixels);\n const max = tier === 'user'\n ? constraints.userMaxSizePixels\n : (constraints.systemMaxSizePixels ?? constraints.userMaxSizePixels);\n return clampSize(value, min, max);\n}\n\n// ============================================================================\n// INTERNAL HELPERS\n// ============================================================================\n\n/**\n * Resolve user constraints (drag limits) from panel config.\n */\nexport function resolveUserConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): { userMinSizePixels?: number; userMaxSizePixels?: number } {\n return {\n userMinSizePixels: panelConfig.userMinSize ? parseSizeToPixels(panelConfig.userMinSize, containerSize) : undefined,\n userMaxSizePixels: panelConfig.userMaxSize ? parseSizeToPixels(panelConfig.userMaxSize, containerSize) : undefined,\n };\n}\n\n/**\n * Clamp system min to be at least user min.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMin(systemMin: number | undefined, userMin: number | undefined): number | undefined {\n if (systemMin === undefined || userMin === undefined) return systemMin;\n return Math.max(systemMin, userMin);\n}\n\n/**\n * Clamp system max to be at most user max.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMax(systemMax: number | undefined, userMax: number | undefined): number | undefined {\n if (systemMax === undefined || userMax === undefined) return systemMax;\n return Math.min(systemMax, userMax);\n}\n\n/**\n * Resolve system constraints with fallback to user constraints.\n * System limits are silently clamped to stay within user limits.\n */\nexport function resolveSystemConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number,\n userMinSizePixels?: number,\n userMaxSizePixels?: number\n): { systemMinSizePixels?: number; systemMaxSizePixels?: number } {\n // Calculate system limits from props, or fall back to user limits\n const rawSystemMin = panelConfig.systemMinSize\n ? parseSizeToPixels(panelConfig.systemMinSize, containerSize)\n : userMinSizePixels;\n const rawSystemMax = panelConfig.systemMaxSize\n ? parseSizeToPixels(panelConfig.systemMaxSize, containerSize)\n : userMaxSizePixels;\n\n // Validate and clamp system limits within user limits\n const systemMinSizePixels = clampSystemMin(rawSystemMin, userMinSizePixels);\n const systemMaxSizePixels = clampSystemMax(rawSystemMax, userMaxSizePixels);\n\n return { systemMinSizePixels, systemMaxSizePixels };\n}\n\n// ============================================================================\n// PUBLIC API\n// ============================================================================\n\n/**\n * Calculate the complete constraint hierarchy for a panel.\n *\n * This separates user drag limits from system scaling limits:\n * - User limits (userMinSize/userMaxSize) are absolute boundaries for user dragging\n * - System limits (systemMinSize/systemMaxSize) are the operating range for viewport resize\n * - System limits must be within user limits (clamped silently if not)\n *\n * @param panelConfig - Panel configuration\n * @param containerSize - Current container size in pixels\n * @returns Complete constraint hierarchy with all pixel values\n */\nexport function calculateConstraintHierarchy(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): ConstraintHierarchy {\n // Resolve user constraints (drag limits)\n const { userMinSizePixels, userMaxSizePixels } = resolveUserConstraints(panelConfig, containerSize);\n\n // Resolve system constraints (viewport resize limits) with fallback to user limits\n const { systemMinSizePixels, systemMaxSizePixels } = resolveSystemConstraints(\n panelConfig,\n containerSize,\n userMinSizePixels,\n userMaxSizePixels\n );\n\n // Calculate collapse threshold (container width trigger, NOT a panel size)\n // Don't clamp to container - this threshold is compared AGAINST the container width\n const collapseSizePixels = panelConfig.collapseSize\n ? parseSizeToPixels(panelConfig.collapseSize, containerSize, { clampToContainer: false })\n : undefined;\n\n return {\n userMinSizePixels,\n userMaxSizePixels,\n systemMinSizePixels,\n systemMaxSizePixels,\n collapseSizePixels,\n };\n}\n","import { MIN_PANEL_SIZE_PX } from '../ResizableConstants';\nimport type { ResizablePanelState } from '../ResizableConstants';\nimport { clampSize } from './ConstraintResolver';\n\n// ============================================================================\n// RESIZE HANDLING\n// ============================================================================\n\nexport interface ResizeHandler {\n processResizeMove: (\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ) => ResizeMoveResult;\n}\n\nexport interface ResizeMoveResult {\n constrainedCursorPosition: number;\n beforePanelSize: number;\n afterPanelSize: number;\n isValidResize: boolean;\n}\n\nexport function useResizeHandling(containerSize?: () => number) {\n function checkPanelsResizable(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState\n ): ResizeMoveResult | null {\n if (beforePanel.resizable === false || afterPanel.resizable === false) {\n return {\n constrainedCursorPosition: rawCursorPosition,\n beforePanelSize: beforePanel.pixelSize || 0,\n afterPanelSize: afterPanel.pixelSize || 0,\n isValidResize: false,\n };\n }\n return null;\n }\n\n function applyPanelConstraints(proposedSize: number, panel: ResizablePanelState): number {\n return clampSize(proposedSize, panel.userMinSizePixels, panel.userMaxSizePixels);\n }\n\n function calculateMaxCursorForAfterPanel(\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n allPanels?: ResizablePanelState[]\n ): number {\n const minPixels = afterPanel.userMinSizePixels;\n\n if (minPixels === undefined || !allPanels) {\n return containerSizeValue;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - minPixels - totalFixedSpaceAfter;\n }\n\n function calculateAfterPanelSize(\n cursorPosition: number,\n containerSizeValue: number,\n afterPanel: ResizablePanelState,\n allPanels?: ResizablePanelState[]\n ): number {\n if (!allPanels) {\n return containerSizeValue - cursorPosition;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - cursorPosition - totalFixedSpaceAfter;\n }\n\n function processResizeMove(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ): ResizeMoveResult {\n const nonResizableResult = checkPanelsResizable(rawCursorPosition, beforePanel, afterPanel);\n if (nonResizableResult) return nonResizableResult;\n\n const beforeLeft = beforePanelLeft || 0;\n const proposedBeforeSize = rawCursorPosition - beforeLeft;\n const proposedAfterSize = containerSizeValue - rawCursorPosition;\n\n let constrainedBeforeSize = applyPanelConstraints(proposedBeforeSize, beforePanel);\n let constrainedAfterSize = applyPanelConstraints(proposedAfterSize, afterPanel);\n\n const maxCursorForAfterPanel = calculateMaxCursorForAfterPanel(afterPanel, containerSizeValue, allPanels);\n const beforePanelCursor = beforeLeft + constrainedBeforeSize;\n const effectiveCursor = Math.min(beforePanelCursor, maxCursorForAfterPanel);\n\n let constrainedCursorPosition;\n\n if (effectiveCursor < beforePanelCursor) {\n constrainedCursorPosition = effectiveCursor;\n constrainedBeforeSize = constrainedCursorPosition - beforeLeft;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n } else {\n constrainedCursorPosition = beforePanelCursor;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n }\n\n return {\n constrainedCursorPosition,\n beforePanelSize: constrainedBeforeSize,\n afterPanelSize: constrainedAfterSize,\n isValidResize: constrainedBeforeSize >= MIN_PANEL_SIZE_PX && constrainedAfterSize >= MIN_PANEL_SIZE_PX,\n };\n }\n\n return {\n processResizeMove,\n };\n}\n"],"mappings":"iDAwCA,SAAgB,EAAU,EAAe,EAAc,EAAsB,CAC3E,IAAI,EAAS,EAGb,OAFI,IAAQ,IAAA,KAAW,EAAS,KAAK,IAAI,EAAQ,EAAI,EACjD,IAAQ,IAAA,KAAW,EAAS,KAAK,IAAI,EAAQ,EAAI,EAC9C,EAQT,SAAgB,EACd,EAC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A,gBAAiB,EACjB,eAAgB,EAChB,cAAe,GAAA,IAA8C,GAAA,GAC9D,CAGH,MAAO,CACL,oBACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as e } from "./ResizableUtils-
|
|
1
|
+
import { o as e } from "./ResizableUtils-BIRNCdKB.js";
|
|
2
2
|
//#region components/Resizable/Composables/ConstraintResolver.ts
|
|
3
3
|
function t(e, t, n) {
|
|
4
4
|
let r = e;
|
|
@@ -77,4 +77,4 @@ function c(e) {
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { s as n, n as r, c as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=UseResizableCalculations-
|
|
80
|
+
//# sourceMappingURL=UseResizableCalculations-k6TSRlpa.js.map
|
package/dist/{UseResizableCalculations-BTQ4jiff.js.map → UseResizableCalculations-k6TSRlpa.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseResizableCalculations-BTQ4jiff.js","names":[],"sources":["../components/Resizable/Composables/ConstraintResolver.ts","../components/Resizable/Composables/UseResizableCalculations.ts"],"sourcesContent":["/**\n * Constraint Resolver\n *\n * Pure functions for resolving the constraint hierarchy for resizable panels.\n * No DOM access, no Vue reactivity, no side effects.\n *\n * @see computeLayout.ts\n * @see ../resizable_constants.ts\n */\n\nimport type { ResizablePanelConfig } from '../ResizableConstants';\nimport { parseSizeToPixels } from '../ResizableUtils';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\n/**\n * Result of constraint hierarchy calculation.\n * User limits are absolute boundaries; system limits are the operating range within user limits.\n */\nexport interface ConstraintHierarchy {\n // User drag limits (absolute boundaries)\n userMinSizePixels?: number;\n userMaxSizePixels?: number;\n // System scaling limits (operating range within user limits)\n systemMinSizePixels?: number;\n systemMaxSizePixels?: number;\n // Auto-collapse threshold (container width, not panel width)\n collapseSizePixels?: number;\n}\n\n// ============================================================================\n// CLAMPING PRIMITIVE\n// ============================================================================\n\n/**\n * Clamp a value to optional min/max bounds.\n * Single source of truth for all constraint clamping in the resizable system.\n */\nexport function clampSize(value: number, min?: number, max?: number): number {\n let result = value;\n if (min !== undefined) result = Math.max(result, min);\n if (max !== undefined) result = Math.min(result, max);\n return result;\n}\n\n/**\n * Resolve effective min/max for a given constraint tier, then clamp.\n * - 'user' tier: uses userMin/userMax only\n * - 'system' tier: uses systemMin/systemMax, falling back to userMin/userMax\n */\nexport function clampToTier(\n value: number,\n constraints: ConstraintHierarchy,\n tier: 'user' | 'system' = 'system'\n): number {\n const min = tier === 'user'\n ? constraints.userMinSizePixels\n : (constraints.systemMinSizePixels ?? constraints.userMinSizePixels);\n const max = tier === 'user'\n ? constraints.userMaxSizePixels\n : (constraints.systemMaxSizePixels ?? constraints.userMaxSizePixels);\n return clampSize(value, min, max);\n}\n\n// ============================================================================\n// INTERNAL HELPERS\n// ============================================================================\n\n/**\n * Resolve user constraints (drag limits) from panel config.\n */\nexport function resolveUserConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): { userMinSizePixels?: number; userMaxSizePixels?: number } {\n return {\n userMinSizePixels: panelConfig.userMinSize ? parseSizeToPixels(panelConfig.userMinSize, containerSize) : undefined,\n userMaxSizePixels: panelConfig.userMaxSize ? parseSizeToPixels(panelConfig.userMaxSize, containerSize) : undefined,\n };\n}\n\n/**\n * Clamp system min to be at least user min.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMin(systemMin: number | undefined, userMin: number | undefined): number | undefined {\n if (systemMin === undefined || userMin === undefined) return systemMin;\n return Math.max(systemMin, userMin);\n}\n\n/**\n * Clamp system max to be at most user max.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMax(systemMax: number | undefined, userMax: number | undefined): number | undefined {\n if (systemMax === undefined || userMax === undefined) return systemMax;\n return Math.min(systemMax, userMax);\n}\n\n/**\n * Resolve system constraints with fallback to user constraints.\n * System limits are silently clamped to stay within user limits.\n */\nexport function resolveSystemConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number,\n userMinSizePixels?: number,\n userMaxSizePixels?: number\n): { systemMinSizePixels?: number; systemMaxSizePixels?: number } {\n // Calculate system limits from props, or fall back to user limits\n const rawSystemMin = panelConfig.systemMinSize\n ? parseSizeToPixels(panelConfig.systemMinSize, containerSize)\n : userMinSizePixels;\n const rawSystemMax = panelConfig.systemMaxSize\n ? parseSizeToPixels(panelConfig.systemMaxSize, containerSize)\n : userMaxSizePixels;\n\n // Validate and clamp system limits within user limits\n const systemMinSizePixels = clampSystemMin(rawSystemMin, userMinSizePixels);\n const systemMaxSizePixels = clampSystemMax(rawSystemMax, userMaxSizePixels);\n\n return { systemMinSizePixels, systemMaxSizePixels };\n}\n\n// ============================================================================\n// PUBLIC API\n// ============================================================================\n\n/**\n * Calculate the complete constraint hierarchy for a panel.\n *\n * This separates user drag limits from system scaling limits:\n * - User limits (userMinSize/userMaxSize) are absolute boundaries for user dragging\n * - System limits (systemMinSize/systemMaxSize) are the operating range for viewport resize\n * - System limits must be within user limits (clamped silently if not)\n *\n * @param panelConfig - Panel configuration\n * @param containerSize - Current container size in pixels\n * @returns Complete constraint hierarchy with all pixel values\n */\nexport function calculateConstraintHierarchy(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): ConstraintHierarchy {\n // Resolve user constraints (drag limits)\n const { userMinSizePixels, userMaxSizePixels } = resolveUserConstraints(panelConfig, containerSize);\n\n // Resolve system constraints (viewport resize limits) with fallback to user limits\n const { systemMinSizePixels, systemMaxSizePixels } = resolveSystemConstraints(\n panelConfig,\n containerSize,\n userMinSizePixels,\n userMaxSizePixels\n );\n\n // Calculate collapse threshold (container width trigger, NOT a panel size)\n // Don't clamp to container - this threshold is compared AGAINST the container width\n const collapseSizePixels = panelConfig.collapseSize\n ? parseSizeToPixels(panelConfig.collapseSize, containerSize, { clampToContainer: false })\n : undefined;\n\n return {\n userMinSizePixels,\n userMaxSizePixels,\n systemMinSizePixels,\n systemMaxSizePixels,\n collapseSizePixels,\n };\n}\n","import { MIN_PANEL_SIZE_PX } from '../ResizableConstants';\nimport type { ResizablePanelState } from '../ResizableConstants';\nimport { clampSize } from './ConstraintResolver';\n\n// ============================================================================\n// RESIZE HANDLING\n// ============================================================================\n\nexport interface ResizeHandler {\n processResizeMove: (\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ) => ResizeMoveResult;\n}\n\nexport interface ResizeMoveResult {\n constrainedCursorPosition: number;\n beforePanelSize: number;\n afterPanelSize: number;\n isValidResize: boolean;\n}\n\nexport function useResizeHandling(containerSize?: () => number) {\n function checkPanelsResizable(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState\n ): ResizeMoveResult | null {\n if (beforePanel.resizable === false || afterPanel.resizable === false) {\n return {\n constrainedCursorPosition: rawCursorPosition,\n beforePanelSize: beforePanel.pixelSize || 0,\n afterPanelSize: afterPanel.pixelSize || 0,\n isValidResize: false,\n };\n }\n return null;\n }\n\n function applyPanelConstraints(proposedSize: number, panel: ResizablePanelState): number {\n return clampSize(proposedSize, panel.userMinSizePixels, panel.userMaxSizePixels);\n }\n\n function calculateMaxCursorForAfterPanel(\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n allPanels?: ResizablePanelState[]\n ): number {\n const minPixels = afterPanel.userMinSizePixels;\n\n if (minPixels === undefined || !allPanels) {\n return containerSizeValue;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - minPixels - totalFixedSpaceAfter;\n }\n\n function calculateAfterPanelSize(\n cursorPosition: number,\n containerSizeValue: number,\n afterPanel: ResizablePanelState,\n allPanels?: ResizablePanelState[]\n ): number {\n if (!allPanels) {\n return containerSizeValue - cursorPosition;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - cursorPosition - totalFixedSpaceAfter;\n }\n\n function processResizeMove(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ): ResizeMoveResult {\n const nonResizableResult = checkPanelsResizable(rawCursorPosition, beforePanel, afterPanel);\n if (nonResizableResult) return nonResizableResult;\n\n const beforeLeft = beforePanelLeft || 0;\n const proposedBeforeSize = rawCursorPosition - beforeLeft;\n const proposedAfterSize = containerSizeValue - rawCursorPosition;\n\n let constrainedBeforeSize = applyPanelConstraints(proposedBeforeSize, beforePanel);\n let constrainedAfterSize = applyPanelConstraints(proposedAfterSize, afterPanel);\n\n const maxCursorForAfterPanel = calculateMaxCursorForAfterPanel(afterPanel, containerSizeValue, allPanels);\n const beforePanelCursor = beforeLeft + constrainedBeforeSize;\n const effectiveCursor = Math.min(beforePanelCursor, maxCursorForAfterPanel);\n\n let constrainedCursorPosition;\n\n if (effectiveCursor < beforePanelCursor) {\n constrainedCursorPosition = effectiveCursor;\n constrainedBeforeSize = constrainedCursorPosition - beforeLeft;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n } else {\n constrainedCursorPosition = beforePanelCursor;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n }\n\n return {\n constrainedCursorPosition,\n beforePanelSize: constrainedBeforeSize,\n afterPanelSize: constrainedAfterSize,\n isValidResize: constrainedBeforeSize >= MIN_PANEL_SIZE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AW,EAEzE,IAAyB,EAAgC,GAAY,GAAoB,EAAU,EACnG,IAAoB,IAAa,GACjC,IAAkB,KAAK,IAAI,GAAmB,EAAuB,EAEvE;AAqBJ,SAnBI,IAAkB,KACpB,IAA4B,GAC5B,IAAwB,IAA4B,GACpD,IAAuB,EACrB,GACA,GACA,GACA,EACD,KAED,IAA4B,GAC5B,IAAuB,EACrB,GACA,GACA,GACA,EACD,GAGI;GACL;GACA,iBAAiB;GACjB,gBAAgB;GAChB,eAAe,KAAA,MAA8C,KAAA;GAC9D;;AAGH,QAAO,EACL,sBACD"}
|
|
1
|
+
{"version":3,"file":"UseResizableCalculations-k6TSRlpa.js","names":[],"sources":["../components/Resizable/Composables/ConstraintResolver.ts","../components/Resizable/Composables/UseResizableCalculations.ts"],"sourcesContent":["/**\n * Constraint Resolver\n *\n * Pure functions for resolving the constraint hierarchy for resizable panels.\n * No DOM access, no Vue reactivity, no side effects.\n *\n * @see computeLayout.ts\n * @see ../resizable_constants.ts\n */\n\nimport type { ResizablePanelConfig } from '../ResizableConstants';\nimport { parseSizeToPixels } from '../ResizableUtils';\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\n/**\n * Result of constraint hierarchy calculation.\n * User limits are absolute boundaries; system limits are the operating range within user limits.\n */\nexport interface ConstraintHierarchy {\n // User drag limits (absolute boundaries)\n userMinSizePixels?: number;\n userMaxSizePixels?: number;\n // System scaling limits (operating range within user limits)\n systemMinSizePixels?: number;\n systemMaxSizePixels?: number;\n // Auto-collapse threshold (container width, not panel width)\n collapseSizePixels?: number;\n}\n\n// ============================================================================\n// CLAMPING PRIMITIVE\n// ============================================================================\n\n/**\n * Clamp a value to optional min/max bounds.\n * Single source of truth for all constraint clamping in the resizable system.\n */\nexport function clampSize(value: number, min?: number, max?: number): number {\n let result = value;\n if (min !== undefined) result = Math.max(result, min);\n if (max !== undefined) result = Math.min(result, max);\n return result;\n}\n\n/**\n * Resolve effective min/max for a given constraint tier, then clamp.\n * - 'user' tier: uses userMin/userMax only\n * - 'system' tier: uses systemMin/systemMax, falling back to userMin/userMax\n */\nexport function clampToTier(\n value: number,\n constraints: ConstraintHierarchy,\n tier: 'user' | 'system' = 'system'\n): number {\n const min = tier === 'user'\n ? constraints.userMinSizePixels\n : (constraints.systemMinSizePixels ?? constraints.userMinSizePixels);\n const max = tier === 'user'\n ? constraints.userMaxSizePixels\n : (constraints.systemMaxSizePixels ?? constraints.userMaxSizePixels);\n return clampSize(value, min, max);\n}\n\n// ============================================================================\n// INTERNAL HELPERS\n// ============================================================================\n\n/**\n * Resolve user constraints (drag limits) from panel config.\n */\nexport function resolveUserConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): { userMinSizePixels?: number; userMaxSizePixels?: number } {\n return {\n userMinSizePixels: panelConfig.userMinSize ? parseSizeToPixels(panelConfig.userMinSize, containerSize) : undefined,\n userMaxSizePixels: panelConfig.userMaxSize ? parseSizeToPixels(panelConfig.userMaxSize, containerSize) : undefined,\n };\n}\n\n/**\n * Clamp system min to be at least user min.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMin(systemMin: number | undefined, userMin: number | undefined): number | undefined {\n if (systemMin === undefined || userMin === undefined) return systemMin;\n return Math.max(systemMin, userMin);\n}\n\n/**\n * Clamp system max to be at most user max.\n * System constraints that exceed user boundaries are silently clamped\n * since this is expected behavior during constraint resolution.\n */\nexport function clampSystemMax(systemMax: number | undefined, userMax: number | undefined): number | undefined {\n if (systemMax === undefined || userMax === undefined) return systemMax;\n return Math.min(systemMax, userMax);\n}\n\n/**\n * Resolve system constraints with fallback to user constraints.\n * System limits are silently clamped to stay within user limits.\n */\nexport function resolveSystemConstraints(\n panelConfig: ResizablePanelConfig,\n containerSize: number,\n userMinSizePixels?: number,\n userMaxSizePixels?: number\n): { systemMinSizePixels?: number; systemMaxSizePixels?: number } {\n // Calculate system limits from props, or fall back to user limits\n const rawSystemMin = panelConfig.systemMinSize\n ? parseSizeToPixels(panelConfig.systemMinSize, containerSize)\n : userMinSizePixels;\n const rawSystemMax = panelConfig.systemMaxSize\n ? parseSizeToPixels(panelConfig.systemMaxSize, containerSize)\n : userMaxSizePixels;\n\n // Validate and clamp system limits within user limits\n const systemMinSizePixels = clampSystemMin(rawSystemMin, userMinSizePixels);\n const systemMaxSizePixels = clampSystemMax(rawSystemMax, userMaxSizePixels);\n\n return { systemMinSizePixels, systemMaxSizePixels };\n}\n\n// ============================================================================\n// PUBLIC API\n// ============================================================================\n\n/**\n * Calculate the complete constraint hierarchy for a panel.\n *\n * This separates user drag limits from system scaling limits:\n * - User limits (userMinSize/userMaxSize) are absolute boundaries for user dragging\n * - System limits (systemMinSize/systemMaxSize) are the operating range for viewport resize\n * - System limits must be within user limits (clamped silently if not)\n *\n * @param panelConfig - Panel configuration\n * @param containerSize - Current container size in pixels\n * @returns Complete constraint hierarchy with all pixel values\n */\nexport function calculateConstraintHierarchy(\n panelConfig: ResizablePanelConfig,\n containerSize: number\n): ConstraintHierarchy {\n // Resolve user constraints (drag limits)\n const { userMinSizePixels, userMaxSizePixels } = resolveUserConstraints(panelConfig, containerSize);\n\n // Resolve system constraints (viewport resize limits) with fallback to user limits\n const { systemMinSizePixels, systemMaxSizePixels } = resolveSystemConstraints(\n panelConfig,\n containerSize,\n userMinSizePixels,\n userMaxSizePixels\n );\n\n // Calculate collapse threshold (container width trigger, NOT a panel size)\n // Don't clamp to container - this threshold is compared AGAINST the container width\n const collapseSizePixels = panelConfig.collapseSize\n ? parseSizeToPixels(panelConfig.collapseSize, containerSize, { clampToContainer: false })\n : undefined;\n\n return {\n userMinSizePixels,\n userMaxSizePixels,\n systemMinSizePixels,\n systemMaxSizePixels,\n collapseSizePixels,\n };\n}\n","import { MIN_PANEL_SIZE_PX } from '../ResizableConstants';\nimport type { ResizablePanelState } from '../ResizableConstants';\nimport { clampSize } from './ConstraintResolver';\n\n// ============================================================================\n// RESIZE HANDLING\n// ============================================================================\n\nexport interface ResizeHandler {\n processResizeMove: (\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ) => ResizeMoveResult;\n}\n\nexport interface ResizeMoveResult {\n constrainedCursorPosition: number;\n beforePanelSize: number;\n afterPanelSize: number;\n isValidResize: boolean;\n}\n\nexport function useResizeHandling(containerSize?: () => number) {\n function checkPanelsResizable(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState\n ): ResizeMoveResult | null {\n if (beforePanel.resizable === false || afterPanel.resizable === false) {\n return {\n constrainedCursorPosition: rawCursorPosition,\n beforePanelSize: beforePanel.pixelSize || 0,\n afterPanelSize: afterPanel.pixelSize || 0,\n isValidResize: false,\n };\n }\n return null;\n }\n\n function applyPanelConstraints(proposedSize: number, panel: ResizablePanelState): number {\n return clampSize(proposedSize, panel.userMinSizePixels, panel.userMaxSizePixels);\n }\n\n function calculateMaxCursorForAfterPanel(\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n allPanels?: ResizablePanelState[]\n ): number {\n const minPixels = afterPanel.userMinSizePixels;\n\n if (minPixels === undefined || !allPanels) {\n return containerSizeValue;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - minPixels - totalFixedSpaceAfter;\n }\n\n function calculateAfterPanelSize(\n cursorPosition: number,\n containerSizeValue: number,\n afterPanel: ResizablePanelState,\n allPanels?: ResizablePanelState[]\n ): number {\n if (!allPanels) {\n return containerSizeValue - cursorPosition;\n }\n\n const afterPanelIndex = allPanels.findIndex(p => p.id === afterPanel.id);\n const panelsAfterThis = allPanels.slice(afterPanelIndex + 1);\n const totalFixedSpaceAfter = panelsAfterThis.reduce((sum, panel) => sum + (panel.pixelSize || 0), 0);\n\n return containerSizeValue - cursorPosition - totalFixedSpaceAfter;\n }\n\n function processResizeMove(\n rawCursorPosition: number,\n beforePanel: ResizablePanelState,\n afterPanel: ResizablePanelState,\n containerSizeValue: number,\n handleId?: string,\n allPanels?: ResizablePanelState[],\n beforePanelLeft?: number\n ): ResizeMoveResult {\n const nonResizableResult = checkPanelsResizable(rawCursorPosition, beforePanel, afterPanel);\n if (nonResizableResult) return nonResizableResult;\n\n const beforeLeft = beforePanelLeft || 0;\n const proposedBeforeSize = rawCursorPosition - beforeLeft;\n const proposedAfterSize = containerSizeValue - rawCursorPosition;\n\n let constrainedBeforeSize = applyPanelConstraints(proposedBeforeSize, beforePanel);\n let constrainedAfterSize = applyPanelConstraints(proposedAfterSize, afterPanel);\n\n const maxCursorForAfterPanel = calculateMaxCursorForAfterPanel(afterPanel, containerSizeValue, allPanels);\n const beforePanelCursor = beforeLeft + constrainedBeforeSize;\n const effectiveCursor = Math.min(beforePanelCursor, maxCursorForAfterPanel);\n\n let constrainedCursorPosition;\n\n if (effectiveCursor < beforePanelCursor) {\n constrainedCursorPosition = effectiveCursor;\n constrainedBeforeSize = constrainedCursorPosition - beforeLeft;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n } else {\n constrainedCursorPosition = beforePanelCursor;\n constrainedAfterSize = calculateAfterPanelSize(\n constrainedCursorPosition,\n containerSizeValue,\n afterPanel,\n allPanels\n );\n }\n\n return {\n constrainedCursorPosition,\n beforePanelSize: constrainedBeforeSize,\n afterPanelSize: constrainedAfterSize,\n isValidResize: constrainedBeforeSize >= MIN_PANEL_SIZE_PX && constrainedAfterSize >= MIN_PANEL_SIZE_PX,\n };\n }\n\n return {\n processResizeMove,\n };\n}\n"],"mappings":";;AAwCA,SAAgB,EAAU,GAAe,GAAc,GAAsB;CAC3E,IAAI,IAAS;AAGb,QAFI,MAAQ,KAAA,MAAW,IAAS,KAAK,IAAI,GAAQ,E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