@hyperfixi/behaviors 2.3.0 → 2.4.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/all.browser.global.js +26 -48
- package/dist/all.browser.global.js.map +1 -1
- package/dist/behaviors/autodismiss.d.cts +1 -1
- package/dist/behaviors/autodismiss.d.ts +1 -1
- package/dist/behaviors/clickoutside.d.cts +1 -1
- package/dist/behaviors/clickoutside.d.ts +1 -1
- package/dist/behaviors/clipboard.d.cts +1 -1
- package/dist/behaviors/clipboard.d.ts +1 -1
- package/dist/behaviors/draggable.d.cts +1 -1
- package/dist/behaviors/draggable.d.ts +1 -1
- package/dist/behaviors/focustrap.d.cts +1 -1
- package/dist/behaviors/focustrap.d.ts +1 -1
- package/dist/behaviors/removable.d.cts +1 -1
- package/dist/behaviors/removable.d.ts +1 -1
- package/dist/behaviors/resizable.cjs +12 -34
- package/dist/behaviors/resizable.cjs.map +1 -1
- package/dist/behaviors/resizable.d.cts +1 -1
- package/dist/behaviors/resizable.d.ts +1 -1
- package/dist/behaviors/resizable.js +2 -2
- package/dist/behaviors/scrollreveal.d.cts +1 -1
- package/dist/behaviors/scrollreveal.d.ts +1 -1
- package/dist/behaviors/sortable.cjs +7 -21
- package/dist/behaviors/sortable.cjs.map +1 -1
- package/dist/behaviors/sortable.d.cts +1 -1
- package/dist/behaviors/sortable.d.ts +1 -1
- package/dist/behaviors/sortable.js +2 -2
- package/dist/behaviors/tabs.d.cts +1 -1
- package/dist/behaviors/tabs.d.ts +1 -1
- package/dist/behaviors/toggleable.d.cts +1 -1
- package/dist/behaviors/toggleable.d.ts +1 -1
- package/dist/{chunk-MVNHMYIK.js → chunk-BBIIOGMF.js} +3 -3
- package/dist/{chunk-TLLGH5KX.js → chunk-IMDFEGIT.js} +3 -3
- package/dist/{chunk-TLLGH5KX.js.map → chunk-IMDFEGIT.js.map} +1 -1
- package/dist/{chunk-IQM32TEY.js → chunk-IT6TYVMW.js} +3 -3
- package/dist/{chunk-IQM32TEY.js.map → chunk-IT6TYVMW.js.map} +1 -1
- package/dist/{chunk-NC6I6T7T.js → chunk-V2M4W3LO.js} +7 -21
- package/dist/chunk-V2M4W3LO.js.map +1 -0
- package/dist/{chunk-U5GNXZUF.js → chunk-ZBSWTV6I.js} +12 -34
- package/dist/chunk-ZBSWTV6I.js.map +1 -0
- package/dist/index.cjs +19 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/loaders.cjs +19 -55
- package/dist/loaders.cjs.map +1 -1
- package/dist/loaders.js +3 -3
- package/dist/registry.d.cts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/resizable.browser.global.js +13 -28
- package/dist/resizable.browser.global.js.map +1 -1
- package/dist/resolver.browser.global.js +20 -42
- package/dist/resolver.browser.global.js.map +1 -1
- package/dist/schemas/index.cjs +17 -53
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +2 -2
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.js +2 -2
- package/dist/sortable.browser.global.js +8 -15
- package/dist/sortable.browser.global.js.map +1 -1
- package/dist/{types-DCCtVQS5.d.ts → types-BY-jB5FV.d.cts} +1 -1
- package/dist/{types-DCCtVQS5.d.cts → types-BY-jB5FV.d.ts} +1 -1
- package/package.json +2 -2
- package/src/behaviors/resizable.ts +1 -1
- package/src/behaviors/sortable.ts +1 -1
- package/src/browser-resolver-bundle.ts +1 -1
- package/src/schemas/resizable.schema.ts +11 -33
- package/src/schemas/sortable.schema.ts +6 -20
- package/dist/chunk-NC6I6T7T.js.map +0 -1
- package/dist/chunk-U5GNXZUF.js.map +0 -1
- /package/dist/{chunk-MVNHMYIK.js.map → chunk-BBIIOGMF.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/sortable.schema.ts"],"sourcesContent":["import type { BehaviorSchema } from './types';\n\n/**\n * Sortable Behavior Schema\n *\n * Drag-and-drop reordering of list items.\n * Apply to a container element; children become sortable.\n *\n * Note: This behavior fires lifecycle events but does NOT automatically\n * reorder DOM elements. Users must handle actual reordering in their\n * `sortable:move` event handlers.\n */\nexport const sortableSchema: BehaviorSchema = {\n name: 'Sortable',\n category: 'ui',\n tier: 'common',\n version: '1.0.0',\n description: 'Makes child elements reorderable via drag-and-drop',\n parameters: [\n {\n name: 'dragClass',\n type: 'string',\n optional: true,\n default: 'sorting',\n description: 'CSS class added to item during drag',\n },\n ],\n events: [\n { name: 'sortable:start', description: 'Fired when drag begins' },\n {\n name: 'sortable:move',\n description: 'Fired during drag — handle this event to reorder DOM elements',\n },\n { name: 'sortable:end', description: 'Fired when drag completes' },\n ],\n requirements: ['Users must handle DOM reordering in sortable:move event handlers'],\n source: `\nbehavior Sortable(dragClass)\n init\n if dragClass is undefined\n set dragClass to \"sorting\"\n end\n end\n on pointerdown(clientY) from me\n set item to the closest <li/> to the target\n if item is null\n exit\n end\n halt the event\n add .{dragClass} to item\n trigger sortable:start on me\n repeat until event pointerup from document\n wait for pointermove(clientY) from document\n trigger sortable:move on me\n end\n remove .{dragClass} from item\n trigger sortable:end on me\n end\nend`.trim(),\n};\n"],"mappings":";AAYO,IAAM,iBAAiC;AAAA,EAC5C,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AAAA,IACV;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,EAAE,MAAM,kBAAkB,aAAa,yBAAyB;AAAA,IAChE;AAAA,MACE,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,EAAE,MAAM,gBAAgB,aAAa,4BAA4B;AAAA,EACnE;AAAA,EACA,cAAc,CAAC,kEAAkE;AAAA,EACjF,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAsBL,KAAK;AACV;","names":[]}
|
|
@@ -6,13 +6,6 @@ var resizableSchema = {
|
|
|
6
6
|
version: "1.0.0",
|
|
7
7
|
description: "Makes elements resizable by dragging",
|
|
8
8
|
parameters: [
|
|
9
|
-
{
|
|
10
|
-
name: "handle",
|
|
11
|
-
type: "selector",
|
|
12
|
-
optional: true,
|
|
13
|
-
default: "me",
|
|
14
|
-
description: "CSS selector for the resize handle (defaults to the element itself)"
|
|
15
|
-
},
|
|
16
9
|
{
|
|
17
10
|
name: "minWidth",
|
|
18
11
|
type: "number",
|
|
@@ -48,25 +41,8 @@ var resizableSchema = {
|
|
|
48
41
|
{ name: "resizable:end", description: "Fired when resize completes" }
|
|
49
42
|
],
|
|
50
43
|
source: `
|
|
51
|
-
behavior Resizable(
|
|
52
|
-
|
|
53
|
-
if handle is undefined
|
|
54
|
-
set handle to me
|
|
55
|
-
end
|
|
56
|
-
if minWidth is undefined
|
|
57
|
-
set minWidth to 50
|
|
58
|
-
end
|
|
59
|
-
if minHeight is undefined
|
|
60
|
-
set minHeight to 50
|
|
61
|
-
end
|
|
62
|
-
if maxWidth is undefined
|
|
63
|
-
set maxWidth to 9999
|
|
64
|
-
end
|
|
65
|
-
if maxHeight is undefined
|
|
66
|
-
set maxHeight to 9999
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
on pointerdown(clientX, clientY) from handle
|
|
44
|
+
behavior Resizable(minWidth, minHeight, maxWidth, maxHeight)
|
|
45
|
+
on pointerdown(clientX, clientY) from me
|
|
70
46
|
halt the event
|
|
71
47
|
trigger resizable:start
|
|
72
48
|
measure width
|
|
@@ -76,13 +52,15 @@ behavior Resizable(handle, minWidth, minHeight, maxWidth, maxHeight)
|
|
|
76
52
|
set startX to clientX
|
|
77
53
|
set startY to clientY
|
|
78
54
|
repeat until event pointerup from document
|
|
79
|
-
wait for pointermove(clientX, clientY)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
end
|
|
55
|
+
wait for pointermove(clientX, clientY) from document
|
|
56
|
+
set newWidth to startWidth + clientX - startX
|
|
57
|
+
set newHeight to startHeight + clientY - startY
|
|
58
|
+
if newWidth < minWidth then set newWidth to minWidth end
|
|
59
|
+
if newWidth > maxWidth then set newWidth to maxWidth end
|
|
60
|
+
if newHeight < minHeight then set newHeight to minHeight end
|
|
61
|
+
if newHeight > maxHeight then set newHeight to maxHeight end
|
|
62
|
+
set my style.width to newWidth + "px"
|
|
63
|
+
set my style.height to newHeight + "px"
|
|
86
64
|
trigger resizable:resize
|
|
87
65
|
end
|
|
88
66
|
trigger resizable:end
|
|
@@ -94,4 +72,4 @@ end
|
|
|
94
72
|
export {
|
|
95
73
|
resizableSchema
|
|
96
74
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-ZBSWTV6I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/resizable.schema.ts"],"sourcesContent":["import type { BehaviorSchema } from './types';\n\n/**\n * Resizable Behavior Schema\n *\n * Makes elements resizable by dragging edges or corners.\n * Supports minimum/maximum dimensions and resize handles.\n */\nexport const resizableSchema: BehaviorSchema = {\n name: 'Resizable',\n category: 'ui',\n tier: 'optional',\n version: '1.0.0',\n description: 'Makes elements resizable by dragging',\n parameters: [\n {\n name: 'minWidth',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum width in pixels',\n },\n {\n name: 'minHeight',\n type: 'number',\n optional: true,\n default: 50,\n description: 'Minimum height in pixels',\n },\n {\n name: 'maxWidth',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum width in pixels',\n },\n {\n name: 'maxHeight',\n type: 'number',\n optional: true,\n default: 9999,\n description: 'Maximum height in pixels',\n },\n ],\n events: [\n { name: 'resizable:start', description: 'Fired when resize begins' },\n { name: 'resizable:resize', description: 'Fired during resize' },\n { name: 'resizable:end', description: 'Fired when resize completes' },\n ],\n source: `\nbehavior Resizable(minWidth, minHeight, maxWidth, maxHeight)\n on pointerdown(clientX, clientY) from me\n halt the event\n trigger resizable:start\n measure width\n set startWidth to it\n measure height\n set startHeight to it\n set startX to clientX\n set startY to clientY\n repeat until event pointerup from document\n wait for pointermove(clientX, clientY) from document\n set newWidth to startWidth + clientX - startX\n set newHeight to startHeight + clientY - startY\n if newWidth < minWidth then set newWidth to minWidth end\n if newWidth > maxWidth then set newWidth to maxWidth end\n if newHeight < minHeight then set newHeight to minHeight end\n if newHeight > maxHeight then set newHeight to maxHeight end\n set my style.width to newWidth + \"px\"\n set my style.height to newHeight + \"px\"\n trigger resizable:resize\n end\n trigger resizable:end\n end\nend\n`.trim(),\n};\n"],"mappings":";AAQO,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AAAA,IACV;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,EAAE,MAAM,mBAAmB,aAAa,2BAA2B;AAAA,IACnE,EAAE,MAAM,oBAAoB,aAAa,sBAAsB;AAAA,IAC/D,EAAE,MAAM,iBAAiB,aAAa,8BAA8B;AAAA,EACtE;AAAA,EACA,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BR,KAAK;AACP;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -399,13 +399,6 @@ var init_sortable_schema = __esm({
|
|
|
399
399
|
version: "1.0.0",
|
|
400
400
|
description: "Makes child elements reorderable via drag-and-drop",
|
|
401
401
|
parameters: [
|
|
402
|
-
{
|
|
403
|
-
name: "handle",
|
|
404
|
-
type: "selector",
|
|
405
|
-
optional: true,
|
|
406
|
-
default: "none",
|
|
407
|
-
description: "CSS selector for drag handles within items"
|
|
408
|
-
},
|
|
409
402
|
{
|
|
410
403
|
name: "dragClass",
|
|
411
404
|
type: "string",
|
|
@@ -424,32 +417,25 @@ var init_sortable_schema = __esm({
|
|
|
424
417
|
],
|
|
425
418
|
requirements: ["Users must handle DOM reordering in sortable:move event handlers"],
|
|
426
419
|
source: `
|
|
427
|
-
behavior Sortable(
|
|
420
|
+
behavior Sortable(dragClass)
|
|
428
421
|
init
|
|
429
422
|
if dragClass is undefined
|
|
430
423
|
set dragClass to "sorting"
|
|
431
424
|
end
|
|
432
425
|
end
|
|
433
426
|
on pointerdown(clientY) from me
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
var item = target.closest("li");
|
|
437
|
-
if (!item || !me.contains(item)) return false;
|
|
438
|
-
if (handle && !target.closest(handle)) return false;
|
|
439
|
-
event.preventDefault();
|
|
440
|
-
event.stopPropagation();
|
|
441
|
-
return true;
|
|
442
|
-
end
|
|
443
|
-
if it is false
|
|
427
|
+
set item to the closest <li/> to the target
|
|
428
|
+
if item is null
|
|
444
429
|
exit
|
|
445
430
|
end
|
|
446
|
-
|
|
431
|
+
halt the event
|
|
432
|
+
add .{dragClass} to item
|
|
447
433
|
trigger sortable:start on me
|
|
448
434
|
repeat until event pointerup from document
|
|
449
435
|
wait for pointermove(clientY) from document
|
|
450
436
|
trigger sortable:move on me
|
|
451
437
|
end
|
|
452
|
-
remove .{dragClass} from
|
|
438
|
+
remove .{dragClass} from item
|
|
453
439
|
trigger sortable:end on me
|
|
454
440
|
end
|
|
455
441
|
end`.trim()
|
|
@@ -507,7 +493,7 @@ async function registerSortable(hyperfixi) {
|
|
|
507
493
|
const syntheticNode = {
|
|
508
494
|
type: "behavior",
|
|
509
495
|
name: "Sortable",
|
|
510
|
-
parameters: ["
|
|
496
|
+
parameters: ["dragClass"],
|
|
511
497
|
eventHandlers: [],
|
|
512
498
|
imperativeInstaller: installSortable
|
|
513
499
|
};
|
|
@@ -545,13 +531,6 @@ var init_resizable_schema = __esm({
|
|
|
545
531
|
version: "1.0.0",
|
|
546
532
|
description: "Makes elements resizable by dragging",
|
|
547
533
|
parameters: [
|
|
548
|
-
{
|
|
549
|
-
name: "handle",
|
|
550
|
-
type: "selector",
|
|
551
|
-
optional: true,
|
|
552
|
-
default: "me",
|
|
553
|
-
description: "CSS selector for the resize handle (defaults to the element itself)"
|
|
554
|
-
},
|
|
555
534
|
{
|
|
556
535
|
name: "minWidth",
|
|
557
536
|
type: "number",
|
|
@@ -587,25 +566,8 @@ var init_resizable_schema = __esm({
|
|
|
587
566
|
{ name: "resizable:end", description: "Fired when resize completes" }
|
|
588
567
|
],
|
|
589
568
|
source: `
|
|
590
|
-
behavior Resizable(
|
|
591
|
-
|
|
592
|
-
if handle is undefined
|
|
593
|
-
set handle to me
|
|
594
|
-
end
|
|
595
|
-
if minWidth is undefined
|
|
596
|
-
set minWidth to 50
|
|
597
|
-
end
|
|
598
|
-
if minHeight is undefined
|
|
599
|
-
set minHeight to 50
|
|
600
|
-
end
|
|
601
|
-
if maxWidth is undefined
|
|
602
|
-
set maxWidth to 9999
|
|
603
|
-
end
|
|
604
|
-
if maxHeight is undefined
|
|
605
|
-
set maxHeight to 9999
|
|
606
|
-
end
|
|
607
|
-
end
|
|
608
|
-
on pointerdown(clientX, clientY) from handle
|
|
569
|
+
behavior Resizable(minWidth, minHeight, maxWidth, maxHeight)
|
|
570
|
+
on pointerdown(clientX, clientY) from me
|
|
609
571
|
halt the event
|
|
610
572
|
trigger resizable:start
|
|
611
573
|
measure width
|
|
@@ -615,13 +577,15 @@ behavior Resizable(handle, minWidth, minHeight, maxWidth, maxHeight)
|
|
|
615
577
|
set startX to clientX
|
|
616
578
|
set startY to clientY
|
|
617
579
|
repeat until event pointerup from document
|
|
618
|
-
wait for pointermove(clientX, clientY)
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
end
|
|
580
|
+
wait for pointermove(clientX, clientY) from document
|
|
581
|
+
set newWidth to startWidth + clientX - startX
|
|
582
|
+
set newHeight to startHeight + clientY - startY
|
|
583
|
+
if newWidth < minWidth then set newWidth to minWidth end
|
|
584
|
+
if newWidth > maxWidth then set newWidth to maxWidth end
|
|
585
|
+
if newHeight < minHeight then set newHeight to minHeight end
|
|
586
|
+
if newHeight > maxHeight then set newHeight to maxHeight end
|
|
587
|
+
set my style.width to newWidth + "px"
|
|
588
|
+
set my style.height to newHeight + "px"
|
|
625
589
|
trigger resizable:resize
|
|
626
590
|
end
|
|
627
591
|
trigger resizable:end
|
|
@@ -687,7 +651,7 @@ async function registerResizable(hyperfixi) {
|
|
|
687
651
|
const syntheticNode = {
|
|
688
652
|
type: "behavior",
|
|
689
653
|
name: "Resizable",
|
|
690
|
-
parameters: [
|
|
654
|
+
parameters: [],
|
|
691
655
|
eventHandlers: [],
|
|
692
656
|
imperativeInstaller: installResizable
|
|
693
657
|
};
|