@ktjs/core 0.18.4 → 0.18.7

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.
@@ -28,9 +28,9 @@ type BaseAttr = {
28
28
 
29
29
  // # Events
30
30
  // Mouse events
31
- 'on:click'?: (ev: MouseEvent) => void;
32
- 'on:dblclick'?: (ev: MouseEvent) => void;
33
- 'on:mousedown'?: (ev: MouseEvent) => void;
31
+ 'on:click'?: (ev: PointerEvent) => void;
32
+ 'on:dblclick'?: (ev: PointerEvent) => void;
33
+ 'on:mousedown'?: (ev: PointerEvent) => void;
34
34
  'on:mouseup'?: (ev: MouseEvent) => void;
35
35
  'on:mousemove'?: (ev: MouseEvent) => void;
36
36
  'on:mouseenter'?: (ev: MouseEvent) => void;
@@ -786,13 +786,222 @@ interface AttributesMap {
786
786
  };
787
787
  }
788
788
 
789
- type Redraw = (props?: KTAttribute, ...args: any[]) => KTHTMLElement;
790
- type KTHTMLElement<El extends HTMLElement = HTMLElement, R extends Function = Redraw> = El & {
789
+ interface SVGAttributesMap {
790
+ a: AttributesMap['svg'] & { href?: string; x?: number | string; y?: number | string };
791
+ animate: AttributesMap['svg'] & {
792
+ attributeName?: string;
793
+ from?: string | number;
794
+ to?: string | number;
795
+ dur?: string;
796
+ repeatCount?: string | number;
797
+ };
798
+ animateMotion: AttributesMap['svg'] & { path?: string; dur?: string; rotate?: string };
799
+ animateTransform: AttributesMap['svg'] & { type?: string; from?: string; to?: string; dur?: string };
800
+ circle: AttributesMap['svg'] & { cx?: number | string; cy?: number | string; r?: number | string };
801
+ clipPath: AttributesMap['svg'] & { clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox' };
802
+ defs: AttributesMap['svg'];
803
+ desc: AttributesMap['svg'];
804
+ ellipse: AttributesMap['svg'] & {
805
+ cx?: number | string;
806
+ cy?: number | string;
807
+ rx?: number | string;
808
+ ry?: number | string;
809
+ };
810
+
811
+ // Filter primitives (provide common props)
812
+ feBlend: AttributesMap['svg'] & { in?: string; in2?: string; mode?: string };
813
+ feColorMatrix: AttributesMap['svg'] & {
814
+ type?: 'matrix' | 'saturate' | 'hueRotate' | 'luminanceToAlpha';
815
+ values?: string;
816
+ };
817
+ feComponentTransfer: AttributesMap['svg'] & {};
818
+ feComposite: AttributesMap['svg'] & {
819
+ in?: string;
820
+ in2?: string;
821
+ operator?: string;
822
+ k1?: number | string;
823
+ k2?: number | string;
824
+ k3?: number | string;
825
+ k4?: number | string;
826
+ };
827
+ feConvolveMatrix: AttributesMap['svg'] & {
828
+ order?: string | number;
829
+ kernelMatrix?: string;
830
+ divisor?: string | number;
831
+ bias?: string | number;
832
+ };
833
+ feDiffuseLighting: AttributesMap['svg'] & {};
834
+ feDisplacementMap: AttributesMap['svg'] & {
835
+ in?: string;
836
+ in2?: string;
837
+ scale?: number | string;
838
+ xChannelSelector?: string;
839
+ yChannelSelector?: string;
840
+ };
841
+ feDistantLight: AttributesMap['svg'] & { azimuth?: number | string; elevation?: number | string };
842
+ feDropShadow: AttributesMap['svg'] & {
843
+ dx?: number | string;
844
+ dy?: number | string;
845
+ stdDeviation?: number | string;
846
+ floodColor?: string;
847
+ floodOpacity?: number | string;
848
+ };
849
+ feFlood: AttributesMap['svg'] & { floodColor?: string; floodOpacity?: number | string };
850
+ feFuncA: AttributesMap['svg'] & {};
851
+ feFuncB: AttributesMap['svg'] & {};
852
+ feFuncG: AttributesMap['svg'] & {};
853
+ feFuncR: AttributesMap['svg'] & {};
854
+ feGaussianBlur: AttributesMap['svg'] & { stdDeviation?: number | string; edgeMode?: string };
855
+ feImage: AttributesMap['svg'] & { href?: string };
856
+ feMerge: AttributesMap['svg'] & {};
857
+ feMergeNode: AttributesMap['svg'] & { in?: string };
858
+ feMorphology: AttributesMap['svg'] & { operator?: 'erode' | 'dilate'; radius?: number | string };
859
+ feOffset: AttributesMap['svg'] & { dx?: number | string; dy?: number | string };
860
+ fePointLight: AttributesMap['svg'] & { x?: number | string; y?: number | string; z?: number | string };
861
+ feSpecularLighting: AttributesMap['svg'] & {
862
+ specularConstant?: number | string;
863
+ specularExponent?: number | string;
864
+ surfaceScale?: number | string;
865
+ };
866
+ feSpotLight: AttributesMap['svg'] & {
867
+ x?: number | string;
868
+ y?: number | string;
869
+ z?: number | string;
870
+ pointsAtX?: number | string;
871
+ pointsAtY?: number | string;
872
+ pointsAtZ?: number | string;
873
+ specularExponent?: number | string;
874
+ limitingConeAngle?: number | string;
875
+ };
876
+ feTile: AttributesMap['svg'] & {};
877
+ feTurbulence: AttributesMap['svg'] & {
878
+ baseFrequency?: number | string;
879
+ numOctaves?: number | string;
880
+ seed?: number | string;
881
+ stitchTiles?: string;
882
+ type?: 'fractalNoise' | 'turbulence';
883
+ };
884
+
885
+ filter: AttributesMap['svg'] & {
886
+ x?: number | string;
887
+ y?: number | string;
888
+ width?: number | string;
889
+ height?: number | string;
890
+ filterUnits?: string;
891
+ primitiveUnits?: string;
892
+ };
893
+ foreignObject: AttributesMap['svg'] & {
894
+ x?: number | string;
895
+ y?: number | string;
896
+ width?: number | string;
897
+ height?: number | string;
898
+ };
899
+ g: AttributesMap['svg'];
900
+ image: AttributesMap['svg'] & {
901
+ href?: string;
902
+ x?: number | string;
903
+ y?: number | string;
904
+ width?: number | string;
905
+ height?: number | string;
906
+ };
907
+ line: AttributesMap['svg'] & {
908
+ x1?: number | string;
909
+ y1?: number | string;
910
+ x2?: number | string;
911
+ y2?: number | string;
912
+ };
913
+ linearGradient: AttributesMap['svg'] & {
914
+ x1?: number | string;
915
+ y1?: number | string;
916
+ x2?: number | string;
917
+ y2?: number | string;
918
+ gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
919
+ gradientTransform?: string;
920
+ };
921
+ marker: AttributesMap['svg'] & {
922
+ markerUnits?: string;
923
+ markerWidth?: number | string;
924
+ markerHeight?: number | string;
925
+ refX?: number | string;
926
+ refY?: number | string;
927
+ orient?: string;
928
+ };
929
+ mask: AttributesMap['svg'] & {
930
+ maskUnits?: string;
931
+ maskContentUnits?: string;
932
+ x?: number | string;
933
+ y?: number | string;
934
+ width?: number | string;
935
+ height?: number | string;
936
+ };
937
+ metadata: AttributesMap['svg'];
938
+ mpath: AttributesMap['svg'] & { href?: string };
939
+ path: AttributesMap['svg'] & { d?: string; pathLength?: number | string };
940
+ pattern: AttributesMap['svg'] & {
941
+ patternUnits?: string;
942
+ patternContentUnits?: string;
943
+ width?: number | string;
944
+ height?: number | string;
945
+ x?: number | string;
946
+ y?: number | string;
947
+ };
948
+ polygon: AttributesMap['svg'] & { points?: string };
949
+ polyline: AttributesMap['svg'] & { points?: string };
950
+ radialGradient: AttributesMap['svg'] & {
951
+ cx?: number | string;
952
+ cy?: number | string;
953
+ r?: number | string;
954
+ fx?: number | string;
955
+ fy?: number | string;
956
+ gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
957
+ gradientTransform?: string;
958
+ };
959
+ rect: AttributesMap['svg'] & {
960
+ x?: number | string;
961
+ y?: number | string;
962
+ width?: number | string;
963
+ height?: number | string;
964
+ rx?: number | string;
965
+ ry?: number | string;
966
+ };
967
+ script: AttributesMap['svg'] & { href?: string; type?: string };
968
+ set: AttributesMap['svg'] & { attributeName?: string; to?: string | number; begin?: string; dur?: string };
969
+ stop: AttributesMap['svg'] & { offset?: number | string; stopColor?: string; stopOpacity?: number | string };
970
+ style: AttributesMap['svg'] & { media?: string };
971
+ svg: AttributesMap['svg'];
972
+ switch: AttributesMap['svg'];
973
+ symbol: AttributesMap['svg'] & { viewBox?: string; preserveAspectRatio?: string };
974
+ text: AttributesMap['svg'] & {
975
+ x?: number | string;
976
+ y?: number | string;
977
+ dx?: number | string;
978
+ dy?: number | string;
979
+ textLength?: number | string;
980
+ };
981
+ textPath: AttributesMap['svg'] & { href?: string; startOffset?: number | string };
982
+ title: AttributesMap['svg'];
983
+ tspan: AttributesMap['svg'] & {
984
+ x?: number | string;
985
+ y?: number | string;
986
+ dx?: number | string;
987
+ dy?: number | string;
988
+ };
989
+ use: AttributesMap['svg'] & {
990
+ href?: string;
991
+ x?: number | string;
992
+ y?: number | string;
993
+ width?: number | string;
994
+ height?: number | string;
995
+ };
996
+ view: AttributesMap['svg'] & { viewBox?: string; preserveAspectRatio?: string };
997
+ }
998
+
999
+ type KTHTMLElement<El extends HTMLElement = HTMLElement> = El & {
791
1000
  /**
792
1001
  * Automically generate a redraw function if it is not provided
793
1002
  * @param props
794
1003
  */
795
- redraw: R;
1004
+ redraw: (props?: KTAttribute, ...args: any[]) => KTHTMLElement;
796
1005
  };
797
1006
 
798
1007
  declare global {
@@ -800,49 +1009,174 @@ declare global {
800
1009
  type Element = KTHTMLElement;
801
1010
 
802
1011
  interface IntrinsicElements {
803
- div: AttributesMap['div'];
804
- span: AttributesMap['span'];
805
- input: AttributesMap['input'];
806
- button: AttributesMap['button'];
807
- ul: AttributesMap['ul'];
808
- li: AttributesMap['li'];
809
- p: AttributesMap['p'];
810
- a: AttributesMap['a'];
811
- img: AttributesMap['img'];
812
- form: AttributesMap['form'];
1012
+ // Document-level & metadata
1013
+ html: AttributesMap['html'];
1014
+ head: AttributesMap['head'];
1015
+ title: AttributesMap['title'];
1016
+ base: AttributesMap['base'];
1017
+ link: AttributesMap['link'];
1018
+ meta: AttributesMap['meta'];
1019
+
1020
+ // Sectioning
1021
+ body: AttributesMap['body'];
1022
+ header: AttributesMap['header'];
1023
+ footer: AttributesMap['footer'];
1024
+ nav: AttributesMap['nav'];
1025
+ main: AttributesMap['main'];
1026
+ section: AttributesMap['section'];
1027
+ article: AttributesMap['article'];
1028
+ aside: AttributesMap['aside'];
1029
+
1030
+ // Headings
813
1031
  h1: AttributesMap['h1'];
814
1032
  h2: AttributesMap['h2'];
815
1033
  h3: AttributesMap['h3'];
816
1034
  h4: AttributesMap['h4'];
817
1035
  h5: AttributesMap['h5'];
818
1036
  h6: AttributesMap['h6'];
1037
+
1038
+ // Text content
1039
+ p: AttributesMap['p'];
1040
+ pre: AttributesMap['pre'];
1041
+ code: AttributesMap['code'];
1042
+ strong: AttributesMap['strong'];
1043
+ small: AttributesMap['small'];
1044
+ em: AttributesMap['em'];
1045
+ br: AttributesMap['br'];
1046
+ i: AttributesMap['i'];
1047
+
1048
+ // Lists
1049
+ ul: AttributesMap['ul'];
1050
+ ol: AttributesMap['ol'];
1051
+ li: AttributesMap['li'];
1052
+
1053
+ // Tables
819
1054
  table: AttributesMap['table'];
820
1055
  thead: AttributesMap['thead'];
821
1056
  tbody: AttributesMap['tbody'];
1057
+ tfoot: AttributesMap['tfoot'];
822
1058
  tr: AttributesMap['tr'];
823
1059
  th: AttributesMap['th'];
824
1060
  td: AttributesMap['td'];
1061
+
1062
+ // Forms
1063
+ form: AttributesMap['form'];
825
1064
  label: AttributesMap['label'];
1065
+ input: AttributesMap['input'];
1066
+ textarea: AttributesMap['textarea'];
826
1067
  select: AttributesMap['select'];
827
1068
  option: AttributesMap['option'];
828
- textarea: AttributesMap['textarea'];
829
- section: AttributesMap['section'];
830
- header: AttributesMap['header'];
831
- footer: AttributesMap['footer'];
832
- nav: AttributesMap['nav'];
833
- article: AttributesMap['article'];
834
- aside: AttributesMap['aside'];
835
- main: AttributesMap['main'];
836
- figure: AttributesMap['figure'];
837
- figcaption: AttributesMap['figcaption'];
838
- video: AttributesMap['video'];
1069
+ optgroup: AttributesMap['optgroup'];
1070
+ button: AttributesMap['button'];
1071
+ fieldset: AttributesMap['fieldset'];
1072
+ legend: AttributesMap['legend'];
1073
+ datalist: AttributesMap['datalist'];
1074
+ output: AttributesMap['output'];
1075
+
1076
+ // Media & embedded
1077
+ img: AttributesMap['img'];
1078
+ picture: AttributesMap['picture'];
1079
+ source: AttributesMap['source'];
839
1080
  audio: AttributesMap['audio'];
1081
+ video: AttributesMap['video'];
1082
+ track: AttributesMap['track'];
1083
+ iframe: AttributesMap['iframe'];
1084
+ embed: AttributesMap['embed'];
1085
+ object: AttributesMap['object'];
840
1086
  canvas: AttributesMap['canvas'];
1087
+
1088
+ // Interactive & misc
1089
+ a: AttributesMap['a'] & SVGAttributesMap['a'];
1090
+ area: AttributesMap['area'];
1091
+ map: AttributesMap['map'];
1092
+ details: AttributesMap['details'];
1093
+ dialog: AttributesMap['dialog'];
1094
+ summary: AttributesMap['summary'];
1095
+ slot: AttributesMap['slot'];
1096
+
1097
+ // Scripting & styles
1098
+ script: AttributesMap['script'];
1099
+ style: AttributesMap['style'];
1100
+
1101
+ // Semantic & phrasing
1102
+ figure: AttributesMap['figure'];
1103
+ figcaption: AttributesMap['figcaption'];
1104
+ blockquote: AttributesMap['blockquote'];
1105
+ q: AttributesMap['q'];
1106
+
1107
+ // Generic elements
1108
+ div: AttributesMap['div'];
1109
+ span: AttributesMap['span'];
1110
+ address: AttributesMap['address'];
1111
+ abbr: AttributesMap['abbr'];
1112
+ b: AttributesMap['b'];
1113
+ cite: AttributesMap['cite'];
1114
+ dl: AttributesMap['dl'];
1115
+ dt: AttributesMap['dt'];
1116
+ dd: AttributesMap['dd'];
1117
+ hr: AttributesMap['hr'];
1118
+
1119
+ // SVG
841
1120
  svg: AttributesMap['svg'];
842
- code: AttributesMap['code'];
843
- strong: AttributesMap['strong'];
844
- small: AttributesMap['small'];
845
- pre: AttributesMap['pre'];
1121
+ // a: SVGAttributesMap['a'];
1122
+ animate: SVGAttributesMap['animate'];
1123
+ animateMotion: SVGAttributesMap['animateMotion'];
1124
+ animateTransform: SVGAttributesMap['animateTransform'];
1125
+ circle: SVGAttributesMap['circle'];
1126
+ clipPath: SVGAttributesMap['clipPath'];
1127
+ defs: SVGAttributesMap['defs'];
1128
+ desc: SVGAttributesMap['desc'];
1129
+ ellipse: SVGAttributesMap['ellipse'];
1130
+ feBlend: SVGAttributesMap['feBlend'];
1131
+ feColorMatrix: SVGAttributesMap['feColorMatrix'];
1132
+ feComponentTransfer: SVGAttributesMap['feComponentTransfer'];
1133
+ feComposite: SVGAttributesMap['feComposite'];
1134
+ feConvolveMatrix: SVGAttributesMap['feConvolveMatrix'];
1135
+ feDiffuseLighting: SVGAttributesMap['feDiffuseLighting'];
1136
+ feDisplacementMap: SVGAttributesMap['feDisplacementMap'];
1137
+ feDistantLight: SVGAttributesMap['feDistantLight'];
1138
+ feDropShadow: SVGAttributesMap['feDropShadow'];
1139
+ feFlood: SVGAttributesMap['feFlood'];
1140
+ feFuncA: SVGAttributesMap['feFuncA'];
1141
+ feFuncB: SVGAttributesMap['feFuncB'];
1142
+ feFuncG: SVGAttributesMap['feFuncG'];
1143
+ feFuncR: SVGAttributesMap['feFuncR'];
1144
+ feGaussianBlur: SVGAttributesMap['feGaussianBlur'];
1145
+ feImage: SVGAttributesMap['feImage'];
1146
+ feMerge: SVGAttributesMap['feMerge'];
1147
+ feMergeNode: SVGAttributesMap['feMergeNode'];
1148
+ feMorphology: SVGAttributesMap['feMorphology'];
1149
+ feOffset: SVGAttributesMap['feOffset'];
1150
+ fePointLight: SVGAttributesMap['fePointLight'];
1151
+ feSpecularLighting: SVGAttributesMap['feSpecularLighting'];
1152
+ feSpotLight: SVGAttributesMap['feSpotLight'];
1153
+ feTile: SVGAttributesMap['feTile'];
1154
+ feTurbulence: SVGAttributesMap['feTurbulence'];
1155
+ filter: SVGAttributesMap['filter'];
1156
+ foreignObject: SVGAttributesMap['foreignObject'];
1157
+ g: SVGAttributesMap['g'];
1158
+ image: SVGAttributesMap['image'];
1159
+ line: SVGAttributesMap['line'];
1160
+ linearGradient: SVGAttributesMap['linearGradient'];
1161
+ marker: SVGAttributesMap['marker'];
1162
+ mask: SVGAttributesMap['mask'];
1163
+ metadata: SVGAttributesMap['metadata'];
1164
+ mpath: SVGAttributesMap['mpath'];
1165
+ path: SVGAttributesMap['path'];
1166
+ pattern: SVGAttributesMap['pattern'];
1167
+ polygon: SVGAttributesMap['polygon'];
1168
+ polyline: SVGAttributesMap['polyline'];
1169
+ radialGradient: SVGAttributesMap['radialGradient'];
1170
+ rect: SVGAttributesMap['rect'];
1171
+ set: SVGAttributesMap['set'];
1172
+ stop: SVGAttributesMap['stop'];
1173
+ switch: SVGAttributesMap['switch'];
1174
+ symbol: SVGAttributesMap['symbol'];
1175
+ text: SVGAttributesMap['text'];
1176
+ textPath: SVGAttributesMap['textPath'];
1177
+ tspan: SVGAttributesMap['tspan'];
1178
+ use: SVGAttributesMap['use'];
1179
+ view: SVGAttributesMap['view'];
846
1180
  }
847
1181
 
848
1182
  interface IntrinsicAttributes {
@@ -942,7 +1276,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
942
1276
  * ## About
943
1277
  * @package @ktjs/core
944
1278
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
945
- * @version 0.18.4 (Last Update: 2026.01.31 01:05:10.539)
1279
+ * @version 0.18.7 (Last Update: 2026.01.31 14:27:12.962)
946
1280
  * @license MIT
947
1281
  * @link https://github.com/baendlorel/kt.js
948
1282
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -199,7 +199,7 @@ const svgTempWrapper = document.createElement('div');
199
199
  * ## About
200
200
  * @package @ktjs/core
201
201
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
202
- * @version 0.18.4 (Last Update: 2026.01.31 01:05:10.539)
202
+ * @version 0.18.7 (Last Update: 2026.01.31 14:27:12.962)
203
203
  * @license MIT
204
204
  * @link https://github.com/baendlorel/kt.js
205
205
  * @link https://baendlorel.github.io/ Welcome to my site!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.18.4",
3
+ "version": "0.18.7",
4
4
  "description": "Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",