@ship-ui/core 0.22.16 → 0.22.17

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.
Files changed (66) hide show
  1. package/assets/mcp/components.json +181 -39
  2. package/bin/src/subset.ts +6 -6
  3. package/bin/src/utilities.ts +14 -14
  4. package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs +4 -87
  5. package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs.map +1 -1
  6. package/fesm2022/ship-ui-core-ship-accordion.mjs +4 -3
  7. package/fesm2022/ship-ui-core-ship-accordion.mjs.map +1 -1
  8. package/fesm2022/ship-ui-core-ship-alert.mjs +1 -4
  9. package/fesm2022/ship-ui-core-ship-alert.mjs.map +1 -1
  10. package/fesm2022/ship-ui-core-ship-blueprint.mjs +8 -10
  11. package/fesm2022/ship-ui-core-ship-blueprint.mjs.map +1 -1
  12. package/fesm2022/ship-ui-core-ship-checkbox.mjs +3 -2
  13. package/fesm2022/ship-ui-core-ship-checkbox.mjs.map +1 -1
  14. package/fesm2022/ship-ui-core-ship-color-picker.mjs +66 -62
  15. package/fesm2022/ship-ui-core-ship-color-picker.mjs.map +1 -1
  16. package/fesm2022/ship-ui-core-ship-datepicker.mjs +8 -12
  17. package/fesm2022/ship-ui-core-ship-datepicker.mjs.map +1 -1
  18. package/fesm2022/ship-ui-core-ship-editor.mjs +0 -42
  19. package/fesm2022/ship-ui-core-ship-editor.mjs.map +1 -1
  20. package/fesm2022/ship-ui-core-ship-form-field.mjs +0 -1
  21. package/fesm2022/ship-ui-core-ship-form-field.mjs.map +1 -1
  22. package/fesm2022/ship-ui-core-ship-kbd.mjs +0 -6
  23. package/fesm2022/ship-ui-core-ship-kbd.mjs.map +1 -1
  24. package/fesm2022/ship-ui-core-ship-list-item-swipe.mjs +241 -0
  25. package/fesm2022/ship-ui-core-ship-list-item-swipe.mjs.map +1 -0
  26. package/fesm2022/ship-ui-core-ship-menu.mjs +7 -10
  27. package/fesm2022/ship-ui-core-ship-menu.mjs.map +1 -1
  28. package/fesm2022/ship-ui-core-ship-popover.mjs +1 -20
  29. package/fesm2022/ship-ui-core-ship-popover.mjs.map +1 -1
  30. package/fesm2022/ship-ui-core-ship-radio.mjs +3 -2
  31. package/fesm2022/ship-ui-core-ship-radio.mjs.map +1 -1
  32. package/fesm2022/ship-ui-core-ship-range-slider.mjs +7 -9
  33. package/fesm2022/ship-ui-core-ship-range-slider.mjs.map +1 -1
  34. package/fesm2022/ship-ui-core-ship-select.mjs.map +1 -1
  35. package/fesm2022/ship-ui-core-ship-sidenav.mjs +2 -2
  36. package/fesm2022/ship-ui-core-ship-sidenav.mjs.map +1 -1
  37. package/fesm2022/ship-ui-core-ship-sortable.mjs +262 -68
  38. package/fesm2022/ship-ui-core-ship-sortable.mjs.map +1 -1
  39. package/fesm2022/ship-ui-core-ship-spotlight.mjs +0 -11
  40. package/fesm2022/ship-ui-core-ship-spotlight.mjs.map +1 -1
  41. package/fesm2022/ship-ui-core-ship-stepper.mjs +1 -1
  42. package/fesm2022/ship-ui-core-ship-stepper.mjs.map +1 -1
  43. package/fesm2022/ship-ui-core-ship-table.mjs +4 -5
  44. package/fesm2022/ship-ui-core-ship-table.mjs.map +1 -1
  45. package/fesm2022/ship-ui-core-ship-toggle.mjs +3 -2
  46. package/fesm2022/ship-ui-core-ship-toggle.mjs.map +1 -1
  47. package/fesm2022/ship-ui-core-ship-tree.mjs +1 -9
  48. package/fesm2022/ship-ui-core-ship-tree.mjs.map +1 -1
  49. package/fesm2022/ship-ui-core.mjs +37 -53
  50. package/fesm2022/ship-ui-core.mjs.map +1 -1
  51. package/package.json +5 -1
  52. package/types/ship-ui-core-ship-a11y-keybindings.d.ts +0 -55
  53. package/types/ship-ui-core-ship-accordion.d.ts +7 -7
  54. package/types/ship-ui-core-ship-blueprint.d.ts +1 -1
  55. package/types/ship-ui-core-ship-checkbox.d.ts +2 -3
  56. package/types/ship-ui-core-ship-color-picker.d.ts +1 -25
  57. package/types/ship-ui-core-ship-datepicker.d.ts +0 -3
  58. package/types/ship-ui-core-ship-editor.d.ts +10 -10
  59. package/types/ship-ui-core-ship-list-item-swipe.d.ts +25 -0
  60. package/types/ship-ui-core-ship-menu.d.ts +1 -2
  61. package/types/ship-ui-core-ship-radio.d.ts +2 -3
  62. package/types/ship-ui-core-ship-range-slider.d.ts +6 -6
  63. package/types/ship-ui-core-ship-sortable.d.ts +31 -9
  64. package/types/ship-ui-core-ship-toggle.d.ts +2 -3
  65. package/types/ship-ui-core-ship-tree.d.ts +20 -25
  66. package/types/ship-ui-core.d.ts +17 -24
@@ -169,7 +169,7 @@
169
169
  },
170
170
  {
171
171
  "name": "clearTimeout",
172
- "parameters": "this.destroyTimeout);\n this.destroyTimeout = null;\n }\n }\n\n private showTooltip(",
172
+ "parameters": "this.destroyTimeout);\n this.destroyTimeout = null;\n }\n }\n\n #showTooltip(",
173
173
  "returnType": "any",
174
174
  "description": ""
175
175
  }
@@ -361,7 +361,7 @@
361
361
  {
362
362
  "name": "execCommand",
363
363
  "parameters": "commandId: string, showUI?: boolean, value?: string",
364
- "returnType": "boolean;\n queryCommandState(commandId: string): boolean;\n queryCommandEnabled(commandId: string): boolean;\n}\n\n// Value Accessor Provider\nconst SHIP_EDITOR_VALUE_ACCESSOR: Provider =",
364
+ "returnType": "boolean;\n queryCommandState(commandId: string): boolean;\n queryCommandEnabled(commandId: string): boolean;\n}\n\n\nconst SHIP_EDITOR_VALUE_ACCESSOR: Provider =",
365
365
  "description": ""
366
366
  },
367
367
  {
@@ -394,6 +394,30 @@
394
394
  "returnType": "void",
395
395
  "description": ""
396
396
  },
397
+ {
398
+ "name": "onDOMInput",
399
+ "parameters": "",
400
+ "returnType": "any",
401
+ "description": ""
402
+ },
403
+ {
404
+ "name": "onDOMBlur",
405
+ "parameters": "",
406
+ "returnType": "any",
407
+ "description": ""
408
+ },
409
+ {
410
+ "name": "onCodeInput",
411
+ "parameters": "event: Event",
412
+ "returnType": "any",
413
+ "description": ""
414
+ },
415
+ {
416
+ "name": "onCodeBlur",
417
+ "parameters": "event: Event",
418
+ "returnType": "any",
419
+ "description": ""
420
+ },
397
421
  {
398
422
  "name": "formatText",
399
423
  "parameters": "command: string, value: string = ''",
@@ -454,18 +478,42 @@
454
478
  "returnType": "any",
455
479
  "description": ""
456
480
  },
481
+ {
482
+ "name": "toggleViewMode",
483
+ "parameters": "",
484
+ "returnType": "any",
485
+ "description": ""
486
+ },
487
+ {
488
+ "name": "onSelectionChange",
489
+ "parameters": "",
490
+ "returnType": "any",
491
+ "description": ""
492
+ },
457
493
  {
458
494
  "name": "openLinkModal",
459
495
  "parameters": "",
460
496
  "returnType": "any",
461
497
  "description": ""
462
498
  },
499
+ {
500
+ "name": "applyLink",
501
+ "parameters": "url: string",
502
+ "returnType": "any",
503
+ "description": ""
504
+ },
463
505
  {
464
506
  "name": "openImageModal",
465
507
  "parameters": "",
466
508
  "returnType": "any",
467
509
  "description": ""
468
510
  },
511
+ {
512
+ "name": "applyImage",
513
+ "parameters": "url: string",
514
+ "returnType": "any",
515
+ "description": ""
516
+ },
469
517
  {
470
518
  "name": "onComponentFocusIn",
471
519
  "parameters": "event: FocusEvent",
@@ -502,6 +550,18 @@
502
550
  "returnType": "string",
503
551
  "description": ""
504
552
  },
553
+ {
554
+ "name": "onToolbarKeyDown",
555
+ "parameters": "event: KeyboardEvent",
556
+ "returnType": "any",
557
+ "description": ""
558
+ },
559
+ {
560
+ "name": "onToolbarFocusIn",
561
+ "parameters": "event: FocusEvent",
562
+ "returnType": "any",
563
+ "description": ""
564
+ },
505
565
  {
506
566
  "name": "onComponentScroll",
507
567
  "parameters": "event: Event",
@@ -703,7 +763,7 @@
703
763
  "methods": [
704
764
  {
705
765
  "name": "Autolayout",
706
- "parameters": "true);\n autoLayout = input<boolean>(false);\n gridSize = input(20);\n snapToGrid = input<boolean>(true);\n gridColor = input<[string, string]>(['#d8d8d8', '#2c2c2c']);\n\n nodes = model<BlueprintNode[]>([]);\n\n #currentGridColor = computed(() => this.gridColor()[this.lightMode() ? 0 : 1]);\n\n panX = signal(0);\n panY = signal(0);\n zoomLevel = signal(1);\n gridSnapSize = signal(20);\n\n isHoveringNode = signal(false);\n midpointDivPosition = signal<{ x: number; y: number } | null>(null);\n showMidpointDiv = signal(false);\n isLocked = signal(false);\n draggingConnection = signal<DragState | null>(null);\n validationErrors = signal<ValidationErrors | null>(null);\n highlightedConnection = signal<Connection | null>(null);\n\n #draggingNodeCoordinates = signal<Coordinates | null>(null);\n #isDragging = signal(false);\n #lastMouseX = signal(0);\n #lastMouseY = signal(0);\n #initialPinchDistance = signal(0);\n #isNodeDragging = signal(false);\n #draggedNodeId = signal<string | null>(null);\n #dragOffset = signal<Coordinates | null>(null);\n #connections = signal<Connection[]>([]);\n #canvasWidth = signal(0);\n #canvasHeight = signal(0);\n\n @ViewChild('blueprintCanvas', { static: true }) canvasRef!: ElementRef<HTMLCanvasElement>;\n #ctx!: CanvasRenderingContext2D;\n #resizeObserver!: ResizeObserver;\n\n visibleNodes = computed(() => {\n const nodes = this.nodes();\n const panX = this.panX();\n const panY = this.panY();\n const zoom = this.zoomLevel();\n const width = this.#canvasWidth();\n const height = this.#canvasHeight();\n\n if (width === 0 || height === 0",
766
+ "parameters": "true);\n autoLayout = input<boolean>(false);\n gridSize = input(20);\n snapToGrid = input<boolean>(true);\n gridColor = input<[string, string]>(['#d8d8d8', '#2c2c2c']);\n\n nodes = model<BlueprintNode[]>([]);\n\n #currentGridColor = computed(() => this.gridColor()[this.lightMode() ? 0 : 1]);\n\n panX = signal(0);\n panY = signal(0);\n zoomLevel = signal(1);\n gridSnapSize = signal(20);\n\n isHoveringNode = signal(false);\n midpointDivPosition = signal<{ x: number; y: number } | null>(null);\n showMidpointDiv = signal(false);\n isLocked = signal(false);\n draggingConnection = signal<DragState | null>(null);\n validationErrors = signal<ValidationErrors | null>(null);\n highlightedConnection = signal<Connection | null>(null);\n\n #draggingNodeCoordinates = signal<Coordinates | null>(null);\n #isDragging = signal(false);\n #lastMouseX = signal(0);\n #lastMouseY = signal(0);\n #initialPinchDistance = signal(0);\n #isNodeDragging = signal(false);\n #draggedNodeId = signal<string | null>(null);\n #dragOffset = signal<Coordinates | null>(null);\n #connections = signal<Connection[]>([]);\n #canvasWidth = signal(0);\n #canvasHeight = signal(0);\n\n canvasRef = viewChild.required<ElementRef<HTMLCanvasElement>>('blueprintCanvas');\n #ctx!: CanvasRenderingContext2D;\n #resizeObserver!: ResizeObserver;\n\n visibleNodes = computed(() => {\n const nodes = this.nodes();\n const panX = this.panX();\n const panY = this.panY();\n const zoom = this.zoomLevel();\n const width = this.#canvasWidth();\n const height = this.#canvasHeight();\n\n if (width === 0 || height === 0",
707
767
  "returnType": "any",
708
768
  "description": ""
709
769
  },
@@ -936,7 +996,7 @@
936
996
  },
937
997
  {
938
998
  "name": "return",
939
- "parameters": "pos.left >= 0 &&\n pos.top >= 0 &&\n pos.left + m.width <= window.innerWidth &&\n pos.top + m.height <= window.innerHeight\n );\n }\n\n /** Clamp a position so the popover stays within the viewport */\n #clampToViewport(pos: { left: number; top: number }, m: DOMRect",
999
+ "parameters": "pos.left >= 0 &&\n pos.top >= 0 &&\n pos.left + m.width <= window.innerWidth &&\n pos.top + m.height <= window.innerHeight\n );\n }\n\n \n #clampToViewport(pos: { left: number; top: number }, m: DOMRect",
940
1000
  "returnType": "any",
941
1001
  "description": ""
942
1002
  }
@@ -1101,7 +1161,14 @@
1101
1161
  }
1102
1162
  ],
1103
1163
  "outputs": [],
1104
- "methods": [],
1164
+ "methods": [
1165
+ {
1166
+ "name": "onInternalInputChange",
1167
+ "parameters": "event: Event",
1168
+ "returnType": "any",
1169
+ "description": ""
1170
+ }
1171
+ ],
1105
1172
  "cssVariables": [
1106
1173
  {
1107
1174
  "name": "--toggle-bg",
@@ -1194,7 +1261,7 @@
1194
1261
  "methods": [
1195
1262
  {
1196
1263
  "name": "effect",
1197
- "parameters": "() => {\n const inputs = this.#inputObserver() as HTMLInputElement[];\n if (inputs.length === 0) return;\n\n if (inputs[0]) this.setupInput(inputs[0], true);\n if (inputs[1]) this.setupInput(inputs[1], false);\n });\n }\n\n private setupInput(element: HTMLInputElement, isStart: boolean",
1264
+ "parameters": "() => {\n const inputs = this.#inputObserver() as HTMLInputElement[];\n if (inputs.length === 0) return;\n\n if (inputs[0]) this.#setupInput(inputs[0], true);\n if (inputs[1]) this.#setupInput(inputs[1], false);\n });\n }\n\n #setupInput(element: HTMLInputElement, isStart: boolean",
1198
1265
  "returnType": "any",
1199
1266
  "description": ""
1200
1267
  },
@@ -1728,7 +1795,7 @@
1728
1795
  },
1729
1796
  {
1730
1797
  "name": "effect",
1731
- "parameters": "() => {\n this.items(); // track projected items\n this.updateProgress();\n });\n\n if (typeof MutationObserver !== 'undefined'",
1798
+ "parameters": "() => {\n this.items(); \n this.updateProgress();\n });\n\n if (typeof MutationObserver !== 'undefined'",
1732
1799
  "returnType": "any",
1733
1800
  "description": ""
1734
1801
  },
@@ -2264,7 +2331,14 @@
2264
2331
  }
2265
2332
  ],
2266
2333
  "outputs": [],
2267
- "methods": [],
2334
+ "methods": [
2335
+ {
2336
+ "name": "onInternalInputChange",
2337
+ "parameters": "event: Event",
2338
+ "returnType": "any",
2339
+ "description": ""
2340
+ }
2341
+ ],
2268
2342
  "cssVariables": [
2269
2343
  {
2270
2344
  "name": "--radiod-c",
@@ -2312,7 +2386,7 @@
2312
2386
  {
2313
2387
  "name": "sortableManager",
2314
2388
  "type": "any",
2315
- "description": "The flat list of all tree nodes. */ readonly items = model<any[]>([]); /** Optional Writable/Readable WritableSignal manager created by createTreeSortableManager.",
2389
+ "description": "",
2316
2390
  "defaultValue": "null"
2317
2391
  },
2318
2392
  {
@@ -2354,19 +2428,19 @@
2354
2428
  {
2355
2429
  "name": "getIcon",
2356
2430
  "type": "(item: any) => string | null",
2357
- "description": "The flat list of all tree nodes. */ readonly items = model<any[]>([]); /** Optional Writable/Readable WritableSignal manager created by createTreeSortableManager. */ readonly sortableManager = input<any>(null); /** Currently selected node ID. */ readonly selectedId = model<string | null>(null); // Mappings readonly getId = input<(item: any) => string>((item) => item.id); readonly getName = input<(item: any) => string>((item) => item.name); readonly getParentId = input<(item: any) => string | null>((item) => item.parentId); readonly isFolder = input<(item: any) => boolean>((item) => item.type === 'dir'); readonly getIsOpen = input<(item: any) => boolean>((item) => !!item.isOpen); readonly setIsOpen = input<(item: any, isOpen: boolean) => void>((item, open) => { item.isOpen = open; }); /** Function returning a custom icon name for a node.",
2431
+ "description": "",
2358
2432
  "defaultValue": "("
2359
2433
  },
2360
2434
  {
2361
2435
  "name": "items",
2362
2436
  "type": "any[]",
2363
- "description": "The flat list of all tree nodes.",
2437
+ "description": "",
2364
2438
  "defaultValue": "[]"
2365
2439
  },
2366
2440
  {
2367
2441
  "name": "selectedId",
2368
2442
  "type": "string | null",
2369
- "description": "The flat list of all tree nodes. */ readonly items = model<any[]>([]); /** Optional Writable/Readable WritableSignal manager created by createTreeSortableManager. */ readonly sortableManager = input<any>(null); /** Currently selected node ID.",
2443
+ "description": "",
2370
2444
  "defaultValue": "null"
2371
2445
  }
2372
2446
  ],
@@ -2560,7 +2634,7 @@
2560
2634
  "methods": [
2561
2635
  {
2562
2636
  "name": "untracked",
2563
- "parameters": "() => this.drawColorPicker());\n\n if (this.previousLayoutHash !== layoutHash",
2637
+ "parameters": "() => this.#drawColorPicker());\n\n if (this.#previousLayoutHash !== layoutHash",
2564
2638
  "returnType": "any",
2565
2639
  "description": ""
2566
2640
  }
@@ -2689,7 +2763,56 @@
2689
2763
  ]
2690
2764
  },
2691
2765
  {
2692
- "name": "ShipSortable",
2766
+ "name": "ShipListItemSwipeService",
2767
+ "selector": "sh-list-item-swipe",
2768
+ "path": "core/projects/ship-ui/ship-list-item-swipe/ship-list-item-swipe.ts",
2769
+ "description": "",
2770
+ "keywords": [],
2771
+ "inputs": [
2772
+ {
2773
+ "name": "swipeThreshold",
2774
+ "type": "number",
2775
+ "description": "",
2776
+ "defaultValue": "0.3"
2777
+ }
2778
+ ],
2779
+ "outputs": [
2780
+ {
2781
+ "name": "swipeOpen",
2782
+ "type": "'left' | 'right'",
2783
+ "description": ""
2784
+ },
2785
+ {
2786
+ "name": "swipeClose",
2787
+ "type": "void",
2788
+ "description": ""
2789
+ }
2790
+ ],
2791
+ "methods": [
2792
+ {
2793
+ "name": "onTouchStart",
2794
+ "parameters": "e: TouchEvent",
2795
+ "returnType": "any",
2796
+ "description": ""
2797
+ },
2798
+ {
2799
+ "name": "open",
2800
+ "parameters": "side: 'left' | 'right'",
2801
+ "returnType": "any",
2802
+ "description": ""
2803
+ },
2804
+ {
2805
+ "name": "close",
2806
+ "parameters": "",
2807
+ "returnType": "any",
2808
+ "description": ""
2809
+ }
2810
+ ],
2811
+ "cssVariables": [],
2812
+ "examples": []
2813
+ },
2814
+ {
2815
+ "name": "ShipSortableService",
2693
2816
  "selector": "[shSortable]",
2694
2817
  "path": "core/projects/ship-ui/ship-sortable/ship-sortable.ts",
2695
2818
  "description": "### Enable Sorting\n\nApply the\n`shSortable`\ndirective to any container element to enable drag-and-drop reordering.\n\n### Event Handling\n\nListen to the\n`sortDrop`\nevent to update your data source when an item is moved. For tree structures, listen to the\n`treeDrop`\nevent.\n\n### Sortable Manager (Recommended)\n\nVastly simplify drag-and-drop state by passing a manager to the\n`shSortable`\ninput. Use\n`createSortableManager()`\nfor simple and cross-list configurations, or\n`createTreeSortableManager()`\nfor hierarchical trees.\n\n### Tree View Drag & Drop\n\nEnable VSCode-explorer-style tree drag-and-drop by setting\n`sortingMode=\"tree\"`\nand binding\n`[treeItems]`\nto the visible items list. Target folders must include the\n`sortable-folder=\"true\"`\nattribute to accept drop-inside actions.\n\n### Drag Handles\n\nAdd the\n`sort-handle`\nattribute to a specific element within a sortable item to limit dragging to that specific region.",
@@ -2719,6 +2842,18 @@
2719
2842
  "description": "",
2720
2843
  "defaultValue": "'list'"
2721
2844
  },
2845
+ {
2846
+ "name": "touchEnabled",
2847
+ "type": "boolean",
2848
+ "description": "",
2849
+ "defaultValue": "false"
2850
+ },
2851
+ {
2852
+ "name": "touchActivation",
2853
+ "type": "'longpress' | 'handle' | 'none'",
2854
+ "description": "",
2855
+ "defaultValue": "'longpress'"
2856
+ },
2722
2857
  {
2723
2858
  "name": "treeItems",
2724
2859
  "type": "any[]",
@@ -2768,38 +2903,38 @@
2768
2903
  "description": ""
2769
2904
  },
2770
2905
  {
2771
- "name": "dragLeave",
2772
- "parameters": "e: DragEvent",
2906
+ "name": "processDragEnter",
2907
+ "parameters": "",
2773
2908
  "returnType": "any",
2774
2909
  "description": ""
2775
2910
  },
2776
2911
  {
2777
- "name": "dragOver",
2912
+ "name": "dragLeave",
2778
2913
  "parameters": "e: DragEvent",
2779
2914
  "returnType": "any",
2780
2915
  "description": ""
2781
2916
  },
2782
2917
  {
2783
- "name": "getVisualIndexOfElement",
2784
- "parameters": "i: number",
2785
- "returnType": "number",
2918
+ "name": "processDragLeave",
2919
+ "parameters": "clientX: number, clientY: number, relatedTarget: Node | null, force = false",
2920
+ "returnType": "any",
2786
2921
  "description": ""
2787
2922
  },
2788
2923
  {
2789
- "name": "drop",
2790
- "parameters": "event: ShipTreeDropEvent, visibleNodesList: T[]",
2791
- "returnType": "any",
2924
+ "name": "clientX",
2925
+ "parameters": "array: T[],\n event: Pick<ShipDropEvent, 'previousIndex' | 'currentIndex'> | Pick<AfterDropResponse, 'fromIndex' | 'toIndex'>",
2926
+ "returnType": "T[]",
2792
2927
  "description": ""
2793
2928
  },
2794
2929
  {
2795
- "name": "dragEnd",
2796
- "parameters": "",
2930
+ "name": "while",
2931
+ "parameters": "currentParentId !== null && currentParentId !== undefined",
2797
2932
  "returnType": "any",
2798
2933
  "description": ""
2799
2934
  },
2800
2935
  {
2801
- "name": "while",
2802
- "parameters": "currentParentId !== null && currentParentId !== undefined",
2936
+ "name": "drop",
2937
+ "parameters": "event: ShipTreeDropEvent, visibleNodesList: T[]",
2803
2938
  "returnType": "any",
2804
2939
  "description": ""
2805
2940
  },
@@ -4719,7 +4854,14 @@
4719
4854
  }
4720
4855
  ],
4721
4856
  "outputs": [],
4722
- "methods": [],
4857
+ "methods": [
4858
+ {
4859
+ "name": "onInternalInputChange",
4860
+ "parameters": "event: Event",
4861
+ "returnType": "any",
4862
+ "description": ""
4863
+ }
4864
+ ],
4723
4865
  "cssVariables": [
4724
4866
  {
4725
4867
  "name": "--box-bw",
@@ -4880,19 +5022,19 @@
4880
5022
  {
4881
5023
  "name": "mode",
4882
5024
  "type": "'global' | 'local'",
4883
- "description": "The registered action name (e.g. 'table.next-page', 'dialog.close'). / shA11yKeybinding = input.required<string>(); /** Defines whether the keybinding listener is 'local' (host element keydown) or 'global' (window keydown). Default is 'local'.",
5025
+ "description": "",
4884
5026
  "defaultValue": "'local'"
4885
5027
  },
4886
5028
  {
4887
5029
  "name": "preventDefault",
4888
5030
  "type": "boolean",
4889
- "description": "The registered action name (e.g. 'table.next-page', 'dialog.close'). / shA11yKeybinding = input.required<string>(); /** Defines whether the keybinding listener is 'local' (host element keydown) or 'global' (window keydown). Default is 'local'. / mode = input<'global' | 'local'>('local'); /** Whether to prevent the default action when the keybinding matches.",
5031
+ "description": "",
4890
5032
  "defaultValue": "true"
4891
5033
  },
4892
5034
  {
4893
5035
  "name": "stopPropagation",
4894
5036
  "type": "boolean",
4895
- "description": "The registered action name (e.g. 'table.next-page', 'dialog.close'). / shA11yKeybinding = input.required<string>(); /** Defines whether the keybinding listener is 'local' (host element keydown) or 'global' (window keydown). Default is 'local'. / mode = input<'global' | 'local'>('local'); /** Whether to prevent the default action when the keybinding matches. / preventDefault = input<boolean>(true); /** Whether to stop event propagation when the keybinding matches.",
5037
+ "description": "",
4896
5038
  "defaultValue": "true"
4897
5039
  }
4898
5040
  ],
@@ -4900,7 +5042,7 @@
4900
5042
  {
4901
5043
  "name": "triggered",
4902
5044
  "type": "KeyboardEvent",
4903
- "description": "The registered action name (e.g. 'table.next-page', 'dialog.close'). / shA11yKeybinding = input.required<string>(); /** Defines whether the keybinding listener is 'local' (host element keydown) or 'global' (window keydown). Default is 'local'. / mode = input<'global' | 'local'>('local'); /** Whether to prevent the default action when the keybinding matches. / preventDefault = input<boolean>(true); /** Whether to stop event propagation when the keybinding matches. / stopPropagation = input<boolean>(true); /** Event emitted when the keybinding is triggered."
5045
+ "description": ""
4904
5046
  }
4905
5047
  ],
4906
5048
  "methods": [
@@ -4912,7 +5054,7 @@
4912
5054
  },
4913
5055
  {
4914
5056
  "name": "onCleanup",
4915
- "parameters": "() => {\n window.removeEventListener('keydown', listener);\n });\n }\n });\n }\n\n /**\n * Local keydown listener when mode is 'local'\n */\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent",
5057
+ "parameters": "() => {\n window.removeEventListener('keydown', listener);\n });\n }\n });\n }\n\n \n\n\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent",
4916
5058
  "returnType": "void",
4917
5059
  "description": ""
4918
5060
  }
@@ -4951,31 +5093,31 @@
4951
5093
  "name": "registerDefaults",
4952
5094
  "parameters": "defaults: Record<string, string>",
4953
5095
  "returnType": "void",
4954
- "description": "Returns true if the platform is running on macOS. / get isMac(): boolean { if (!isPlatformBrowser(this.#platformId)) return false; return navigator.userAgent.toLowerCase().includes('mac'); } constructor() { this.registerDefaults(DEFAULT_KEYBINDINGS); if (this.#overrides) { this.registerOverrides(this.#overrides); } } /** Registers default shortcuts for actions. If an override already exists for a given action, the override takes precedence."
5096
+ "description": ""
4955
5097
  },
4956
5098
  {
4957
5099
  "name": "registerOverrides",
4958
5100
  "parameters": "overrides: Record<string, string>",
4959
5101
  "returnType": "void",
4960
- "description": "Returns true if the platform is running on macOS. / get isMac(): boolean { if (!isPlatformBrowser(this.#platformId)) return false; return navigator.userAgent.toLowerCase().includes('mac'); } constructor() { this.registerDefaults(DEFAULT_KEYBINDINGS); if (this.#overrides) { this.registerOverrides(this.#overrides); } } /** Registers default shortcuts for actions. If an override already exists for a given action, the override takes precedence. / registerDefaults(defaults: Record<string, string>): void { for (const [action, shortcut] of Object.entries(defaults)) { this.#defaults.set(action, shortcut); // If we don't have an override/binding for this action, set it as the active binding if (!this.#bindings.has(action)) { this.#bindings.set(action, shortcut); } } } /** Registers overrides for actions. Overwrites any existing or default bindings."
5102
+ "description": ""
4961
5103
  },
4962
5104
  {
4963
5105
  "name": "getShortcut",
4964
5106
  "parameters": "action: string",
4965
5107
  "returnType": "string | undefined",
4966
- "description": "Returns true if the platform is running on macOS. / get isMac(): boolean { if (!isPlatformBrowser(this.#platformId)) return false; return navigator.userAgent.toLowerCase().includes('mac'); } constructor() { this.registerDefaults(DEFAULT_KEYBINDINGS); if (this.#overrides) { this.registerOverrides(this.#overrides); } } /** Registers default shortcuts for actions. If an override already exists for a given action, the override takes precedence. / registerDefaults(defaults: Record<string, string>): void { for (const [action, shortcut] of Object.entries(defaults)) { this.#defaults.set(action, shortcut); // If we don't have an override/binding for this action, set it as the active binding if (!this.#bindings.has(action)) { this.#bindings.set(action, shortcut); } } } /** Registers overrides for actions. Overwrites any existing or default bindings. / registerOverrides(overrides: Record<string, string>): void { for (const [action, shortcut] of Object.entries(overrides)) { this.#bindings.set(action, shortcut); } } /** Retrieves the active shortcut string for a registered action."
5108
+ "description": ""
4967
5109
  },
4968
5110
  {
4969
5111
  "name": "getDefaultShortcut",
4970
5112
  "parameters": "action: string",
4971
5113
  "returnType": "string | undefined",
4972
- "description": "Returns true if the platform is running on macOS. / get isMac(): boolean { if (!isPlatformBrowser(this.#platformId)) return false; return navigator.userAgent.toLowerCase().includes('mac'); } constructor() { this.registerDefaults(DEFAULT_KEYBINDINGS); if (this.#overrides) { this.registerOverrides(this.#overrides); } } /** Registers default shortcuts for actions. If an override already exists for a given action, the override takes precedence. / registerDefaults(defaults: Record<string, string>): void { for (const [action, shortcut] of Object.entries(defaults)) { this.#defaults.set(action, shortcut); // If we don't have an override/binding for this action, set it as the active binding if (!this.#bindings.has(action)) { this.#bindings.set(action, shortcut); } } } /** Registers overrides for actions. Overwrites any existing or default bindings. / registerOverrides(overrides: Record<string, string>): void { for (const [action, shortcut] of Object.entries(overrides)) { this.#bindings.set(action, shortcut); } } /** Retrieves the active shortcut string for a registered action. / getShortcut(action: string): string | undefined { return this.#bindings.get(action); } /** Retrieves the default shortcut string for a registered action."
5114
+ "description": ""
4973
5115
  },
4974
5116
  {
4975
5117
  "name": "getDisplayShortcut",
4976
5118
  "parameters": "action: string",
4977
5119
  "returnType": "string | undefined",
4978
- "description": "Returns true if the platform is running on macOS. / get isMac(): boolean { if (!isPlatformBrowser(this.#platformId)) return false; return navigator.userAgent.toLowerCase().includes('mac'); } constructor() { this.registerDefaults(DEFAULT_KEYBINDINGS); if (this.#overrides) { this.registerOverrides(this.#overrides); } } /** Registers default shortcuts for actions. If an override already exists for a given action, the override takes precedence. / registerDefaults(defaults: Record<string, string>): void { for (const [action, shortcut] of Object.entries(defaults)) { this.#defaults.set(action, shortcut); // If we don't have an override/binding for this action, set it as the active binding if (!this.#bindings.has(action)) { this.#bindings.set(action, shortcut); } } } /** Registers overrides for actions. Overwrites any existing or default bindings. / registerOverrides(overrides: Record<string, string>): void { for (const [action, shortcut] of Object.entries(overrides)) { this.#bindings.set(action, shortcut); } } /** Retrieves the active shortcut string for a registered action. / getShortcut(action: string): string | undefined { return this.#bindings.get(action); } /** Retrieves the default shortcut string for a registered action. / getDefaultShortcut(action: string): string | undefined { return this.#defaults.get(action); } /** Gets a formatted, user-friendly shortcut string for display. E.g. 'ctrlOrCmd+Shift+KeyK' -> '⌘⇧K' on macOS, 'Ctrl+Shift+K' on Windows/Linux. Supports comma-separated multiple shortcuts (e.g. 'ArrowRight, d' -> 'ArrowRight, D')."
5120
+ "description": ""
4979
5121
  }
4980
5122
  ],
4981
5123
  "cssVariables": [],
@@ -5705,7 +5847,7 @@
5705
5847
  "methods": [
5706
5848
  {
5707
5849
  "name": "onCleanup",
5708
- "parameters": "() => {\n const index = ShipMenu.openMenus.indexOf(this);\n if (index > -1",
5850
+ "parameters": "() => {\n const index = openMenus.indexOf(this);\n if (index > -1",
5709
5851
  "returnType": "any",
5710
5852
  "description": ""
5711
5853
  },
package/bin/src/subset.ts CHANGED
@@ -4,7 +4,7 @@ import { dirname, resolve } from 'path';
4
4
 
5
5
  const require = createRequire(import.meta.url);
6
6
 
7
- // @ts-ignore
7
+
8
8
  import wawoff2 from 'wawoff2';
9
9
 
10
10
  let harfbuzzInst: { harfbuzzJsWasm: any; heapu8: Uint8Array } | null = null;
@@ -42,18 +42,18 @@ export default async function subsetFont(originalFont: Buffer, text: string): Pr
42
42
  const face = harfbuzzJsWasm.hb_face_create(blob, 0);
43
43
  harfbuzzJsWasm.hb_blob_destroy(blob);
44
44
 
45
- // equivalent of --font-features=*
46
- const layoutFeatures = harfbuzzJsWasm.hb_subset_input_set(input, 6); // HB_SUBSET_SETS_LAYOUT_FEATURE_TAG
45
+
46
+ const layoutFeatures = harfbuzzJsWasm.hb_subset_input_set(input, 6);
47
47
  harfbuzzJsWasm.hb_set_clear(layoutFeatures);
48
48
  harfbuzzJsWasm.hb_set_invert(layoutFeatures);
49
49
 
50
- // equivalent of noLayoutClosure: true
50
+
51
51
  harfbuzzJsWasm.hb_subset_input_set_flags(
52
52
  input,
53
53
  harfbuzzJsWasm.hb_subset_input_get_flags(input) | 0x00000200
54
54
  );
55
55
 
56
- // Add mapped unicode indices
56
+
57
57
  const inputUnicodes = harfbuzzJsWasm.hb_subset_input_unicode_set(input);
58
58
  for (const c of text) {
59
59
  const cp = c.codePointAt(0);
@@ -93,7 +93,7 @@ export default async function subsetFont(originalFont: Buffer, text: string): Pr
93
93
  harfbuzzJsWasm.hb_face_destroy(face);
94
94
  harfbuzzJsWasm.free(fontBuffer);
95
95
 
96
- // Direct compression from TTF -> WOFF2 internally
96
+
97
97
  const woff2Buffer = await wawoff2.compress(subsetFontBuffer);
98
98
  return Buffer.from(woff2Buffer);
99
99
  }
@@ -1,25 +1,25 @@
1
- // export function createNameCodeObject(jsonData: Item[]): Record<string, string> {
2
- // const nameCodeObject: Record<string, string> = {};
3
1
 
4
- // for (let i = 0; i < jsonData.length; i++) {
5
- // const item = jsonData[i];
6
- // const hexCode = item.properties.code.toString(16); // Convert decimal to hex
7
- // const codePoint = parseInt(hexCode, 16); // Parse hex to integer code point
8
- // const glyph = String.fromCodePoint(codePoint); // Create the glyph
9
- // nameCodeObject[item.properties.ligatures] = glyph;
10
- // }
11
2
 
12
- // return nameCodeObject;
13
- // }
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
14
 
15
15
  export const getUnicodeObject = (jsonData: Item[], isDuotone = false): Record<string, [string, string]> => {
16
16
  const nameCodeObject: Record<string, [string, string]> = {};
17
17
 
18
18
  for (let i = 0; i < jsonData.length; i++) {
19
19
  const item = jsonData[i];
20
- const hexCode = item.properties.code.toString(16); // Convert decimal to hex
21
- const codePoint = parseInt(hexCode, 16); // Parse hex to integer code point
22
- const glyph = String.fromCodePoint(codePoint); // Create the glyph
20
+ const hexCode = item.properties.code.toString(16);
21
+ const codePoint = parseInt(hexCode, 16);
22
+ const glyph = String.fromCodePoint(codePoint);
23
23
  if (glyph === '') {
24
24
  console.warn(`Invalid codepoint 0x${hexCode} for ligature ${item.properties.ligatures}`);
25
25
  continue;