anentrypoint-design 0.0.174 → 0.0.175
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.175",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
|
@@ -272,6 +272,14 @@ export function SplitPanel({ orientation = 'horizontal', initial = '50%', min =
|
|
|
272
272
|
const sizeProp = isH ? 'width' : 'height';
|
|
273
273
|
const initStyle = typeof initial === 'number' ? initial + 'px' : initial;
|
|
274
274
|
let rootEl = null;
|
|
275
|
+
// The dragged size is persisted here so a re-render (applyDiff reconciling
|
|
276
|
+
// the pane's style back to the initial value) does NOT reset the user's
|
|
277
|
+
// resize. onResize records it; the pane's ref re-applies it after each diff.
|
|
278
|
+
let draggedSize = null;
|
|
279
|
+
const applySize = (a) => {
|
|
280
|
+
if (!a) return;
|
|
281
|
+
if (draggedSize != null) { a.style[sizeProp] = draggedSize + 'px'; a.style.flex = '0 0 auto'; }
|
|
282
|
+
};
|
|
275
283
|
const onResize = (delta) => {
|
|
276
284
|
if (!rootEl) return;
|
|
277
285
|
const a = rootEl.firstChild;
|
|
@@ -280,6 +288,7 @@ export function SplitPanel({ orientation = 'horizontal', initial = '50%', min =
|
|
|
280
288
|
const curr = isH ? rect.width : rect.height;
|
|
281
289
|
const total = isH ? rootEl.getBoundingClientRect().width : rootEl.getBoundingClientRect().height;
|
|
282
290
|
const next = Math.max(min, Math.min(max === Infinity ? total - min : max, curr + delta));
|
|
291
|
+
draggedSize = next;
|
|
283
292
|
a.style[sizeProp] = next + 'px';
|
|
284
293
|
a.style.flex = '0 0 auto';
|
|
285
294
|
};
|
|
@@ -287,7 +296,7 @@ export function SplitPanel({ orientation = 'horizontal', initial = '50%', min =
|
|
|
287
296
|
class: 'ds-ep-split ' + (isH ? 'horiz' : 'vert'),
|
|
288
297
|
ref: (el) => { rootEl = el; }
|
|
289
298
|
},
|
|
290
|
-
h('div', { class: 'ds-ep-split-pane', style: '--split-size:' + initStyle + ';flex:0 0 auto' }, first),
|
|
299
|
+
h('div', { class: 'ds-ep-split-pane', style: '--split-size:' + initStyle + ';flex:0 0 auto', ref: applySize }, first),
|
|
291
300
|
ResizeHandle({ axis: isH ? 'horizontal' : 'vertical', onResize }),
|
|
292
301
|
h('div', { class: 'ds-ep-split-pane grow', style: 'flex:1 1 0;min-' + sizeProp + ':0' }, second)
|
|
293
302
|
);
|