le-kit 0.1.4 → 0.1.5

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 (198) hide show
  1. package/dist/le-kit/assets/custom-elements.json +4305 -0
  2. package/dist/le-kit/index-Da-89pOc.js +4522 -0
  3. package/dist/le-kit/{index-D21JjI31.js.map → index-Da-89pOc.js.map} +1 -1
  4. package/dist/le-kit/index.esm.js +116 -2
  5. package/dist/le-kit/index.esm.js.map +1 -1
  6. package/dist/{esm → le-kit}/le-box.entry.js +3 -3
  7. package/dist/le-kit/le-button.entry.esm.js.map +1 -0
  8. package/dist/le-kit/le-button.entry.js +90 -0
  9. package/dist/{esm → le-kit}/le-card.entry.js +3 -3
  10. package/dist/le-kit/le-checkbox.entry.esm.js.map +1 -0
  11. package/dist/le-kit/le-checkbox.entry.js +59 -0
  12. package/dist/le-kit/le-component.entry.esm.js.map +1 -0
  13. package/dist/{collection/components/le-component/le-component.js → le-kit/le-component.entry.js} +19 -134
  14. package/dist/le-kit/le-kit.css +1010 -1
  15. package/dist/le-kit/le-kit.esm.js +48 -2
  16. package/dist/le-kit/le-kit.esm.js.map +1 -1
  17. package/dist/{esm → le-kit}/le-number-input.entry.js +5 -5
  18. package/dist/le-kit/le-popover.entry.esm.js.map +1 -0
  19. package/dist/{components/le-popover2.js → le-kit/le-popover.entry.js} +9 -45
  20. package/dist/{esm → le-kit}/le-popup.entry.js +6 -6
  21. package/dist/{esm → le-kit}/le-round-progress.entry.js +2 -2
  22. package/dist/le-kit/le-slot.entry.esm.js.map +1 -0
  23. package/dist/{collection/components/le-slot/le-slot.js → le-kit/le-slot.entry.js} +30 -279
  24. package/dist/{esm → le-kit}/le-stack.entry.js +3 -3
  25. package/dist/le-kit/le-string-input.entry.esm.js.map +1 -0
  26. package/dist/le-kit/le-string-input.entry.js +93 -0
  27. package/dist/{esm → le-kit}/le-text.entry.js +3 -3
  28. package/dist/{esm → le-kit}/le-turntable.entry.js +2 -2
  29. package/dist/{esm/utils-CJLZrrdC.js → le-kit/utils-FDOApZ53.js} +3 -3
  30. package/dist/le-kit/{utils-apol-Xc_.js.map → utils-FDOApZ53.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/cjs/index-CO4npcak.js +0 -1796
  33. package/dist/cjs/index-CO4npcak.js.map +0 -1
  34. package/dist/cjs/index.cjs.js +0 -117
  35. package/dist/cjs/index.cjs.js.map +0 -1
  36. package/dist/cjs/le-box.cjs.entry.js +0 -184
  37. package/dist/cjs/le-box.entry.cjs.js.map +0 -1
  38. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +0 -1
  39. package/dist/cjs/le-button_6.cjs.entry.js +0 -1199
  40. package/dist/cjs/le-card.cjs.entry.js +0 -29
  41. package/dist/cjs/le-card.entry.cjs.js.map +0 -1
  42. package/dist/cjs/le-kit.cjs.js +0 -25
  43. package/dist/cjs/le-kit.cjs.js.map +0 -1
  44. package/dist/cjs/le-number-input.cjs.entry.js +0 -202
  45. package/dist/cjs/le-number-input.entry.cjs.js.map +0 -1
  46. package/dist/cjs/le-popup.cjs.entry.js +0 -212
  47. package/dist/cjs/le-popup.entry.cjs.js.map +0 -1
  48. package/dist/cjs/le-round-progress.cjs.entry.js +0 -106
  49. package/dist/cjs/le-round-progress.entry.cjs.js.map +0 -1
  50. package/dist/cjs/le-stack.cjs.entry.js +0 -135
  51. package/dist/cjs/le-stack.entry.cjs.js.map +0 -1
  52. package/dist/cjs/le-text.cjs.entry.js +0 -335
  53. package/dist/cjs/le-text.entry.cjs.js.map +0 -1
  54. package/dist/cjs/le-turntable.cjs.entry.js +0 -139
  55. package/dist/cjs/le-turntable.entry.cjs.js.map +0 -1
  56. package/dist/cjs/loader.cjs.js +0 -13
  57. package/dist/cjs/loader.cjs.js.map +0 -1
  58. package/dist/cjs/utils-BeT0iyCQ.js +0 -152
  59. package/dist/cjs/utils-BeT0iyCQ.js.map +0 -1
  60. package/dist/collection/collection-manifest.json +0 -26
  61. package/dist/collection/components/le-box/le-box.default.css +0 -37
  62. package/dist/collection/components/le-box/le-box.js +0 -614
  63. package/dist/collection/components/le-box/le-box.js.map +0 -1
  64. package/dist/collection/components/le-button/le-button.default.css +0 -263
  65. package/dist/collection/components/le-button/le-button.js +0 -368
  66. package/dist/collection/components/le-button/le-button.js.map +0 -1
  67. package/dist/collection/components/le-card/le-card.default.css +0 -74
  68. package/dist/collection/components/le-card/le-card.js +0 -102
  69. package/dist/collection/components/le-card/le-card.js.map +0 -1
  70. package/dist/collection/components/le-checkbox/le-checkbox.css +0 -93
  71. package/dist/collection/components/le-checkbox/le-checkbox.js +0 -192
  72. package/dist/collection/components/le-checkbox/le-checkbox.js.map +0 -1
  73. package/dist/collection/components/le-component/le-component.css +0 -189
  74. package/dist/collection/components/le-component/le-component.js.map +0 -1
  75. package/dist/collection/components/le-number-input/le-number-input.css +0 -135
  76. package/dist/collection/components/le-number-input/le-number-input.js +0 -515
  77. package/dist/collection/components/le-number-input/le-number-input.js.map +0 -1
  78. package/dist/collection/components/le-popover/le-popover.css +0 -143
  79. package/dist/collection/components/le-popover/le-popover.js +0 -693
  80. package/dist/collection/components/le-popover/le-popover.js.map +0 -1
  81. package/dist/collection/components/le-popup/le-popup.api.js +0 -101
  82. package/dist/collection/components/le-popup/le-popup.api.js.map +0 -1
  83. package/dist/collection/components/le-popup/le-popup.css +0 -222
  84. package/dist/collection/components/le-popup/le-popup.js +0 -596
  85. package/dist/collection/components/le-popup/le-popup.js.map +0 -1
  86. package/dist/collection/components/le-round-progress/le-round-progress.css +0 -34
  87. package/dist/collection/components/le-round-progress/le-round-progress.js +0 -184
  88. package/dist/collection/components/le-round-progress/le-round-progress.js.map +0 -1
  89. package/dist/collection/components/le-slot/le-slot.default.css +0 -222
  90. package/dist/collection/components/le-slot/le-slot.js.map +0 -1
  91. package/dist/collection/components/le-stack/le-stack.default.css +0 -37
  92. package/dist/collection/components/le-stack/le-stack.js +0 -389
  93. package/dist/collection/components/le-stack/le-stack.js.map +0 -1
  94. package/dist/collection/components/le-string-input/le-string-input.css +0 -83
  95. package/dist/collection/components/le-string-input/le-string-input.js +0 -359
  96. package/dist/collection/components/le-string-input/le-string-input.js.map +0 -1
  97. package/dist/collection/components/le-text/le-text.default.css +0 -169
  98. package/dist/collection/components/le-text/le-text.js +0 -475
  99. package/dist/collection/components/le-text/le-text.js.map +0 -1
  100. package/dist/collection/components/le-turntable/le-turntable.css +0 -10
  101. package/dist/collection/components/le-turntable/le-turntable.js +0 -210
  102. package/dist/collection/components/le-turntable/le-turntable.js.map +0 -1
  103. package/dist/collection/global/app.js +0 -130
  104. package/dist/collection/global/app.js.map +0 -1
  105. package/dist/collection/index.js +0 -15
  106. package/dist/collection/index.js.map +0 -1
  107. package/dist/collection/types/blocks.js +0 -115
  108. package/dist/collection/types/blocks.js.map +0 -1
  109. package/dist/collection/types/options.js +0 -2
  110. package/dist/collection/types/options.js.map +0 -1
  111. package/dist/collection/utils/utils.js +0 -141
  112. package/dist/collection/utils/utils.js.map +0 -1
  113. package/dist/components/index.js +0 -127
  114. package/dist/components/index.js.map +0 -1
  115. package/dist/components/le-box.js +0 -256
  116. package/dist/components/le-box.js.map +0 -1
  117. package/dist/components/le-button.js +0 -9
  118. package/dist/components/le-button.js.map +0 -1
  119. package/dist/components/le-button2.js +0 -1408
  120. package/dist/components/le-button2.js.map +0 -1
  121. package/dist/components/le-card.js +0 -83
  122. package/dist/components/le-card.js.map +0 -1
  123. package/dist/components/le-checkbox.js +0 -9
  124. package/dist/components/le-checkbox.js.map +0 -1
  125. package/dist/components/le-component.js +0 -9
  126. package/dist/components/le-component.js.map +0 -1
  127. package/dist/components/le-number-input.js +0 -271
  128. package/dist/components/le-number-input.js.map +0 -1
  129. package/dist/components/le-popover.js +0 -9
  130. package/dist/components/le-popover.js.map +0 -1
  131. package/dist/components/le-popover2.js.map +0 -1
  132. package/dist/components/le-popup.js +0 -279
  133. package/dist/components/le-popup.js.map +0 -1
  134. package/dist/components/le-round-progress.js +0 -135
  135. package/dist/components/le-round-progress.js.map +0 -1
  136. package/dist/components/le-slot.js +0 -9
  137. package/dist/components/le-slot.js.map +0 -1
  138. package/dist/components/le-stack.js +0 -198
  139. package/dist/components/le-stack.js.map +0 -1
  140. package/dist/components/le-string-input.js +0 -9
  141. package/dist/components/le-string-input.js.map +0 -1
  142. package/dist/components/le-text.js +0 -398
  143. package/dist/components/le-text.js.map +0 -1
  144. package/dist/components/le-turntable.js +0 -164
  145. package/dist/components/le-turntable.js.map +0 -1
  146. package/dist/docs.d.ts +0 -443
  147. package/dist/docs.json +0 -5185
  148. package/dist/esm/index-D71TXvJa.js +0 -1781
  149. package/dist/esm/index-D71TXvJa.js.map +0 -1
  150. package/dist/esm/index.js +0 -106
  151. package/dist/esm/index.js.map +0 -1
  152. package/dist/esm/le-box.entry.js.map +0 -1
  153. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +0 -1
  154. package/dist/esm/le-button_6.entry.js +0 -1192
  155. package/dist/esm/le-card.entry.js.map +0 -1
  156. package/dist/esm/le-kit.js +0 -21
  157. package/dist/esm/le-kit.js.map +0 -1
  158. package/dist/esm/le-number-input.entry.js.map +0 -1
  159. package/dist/esm/le-popup.entry.js.map +0 -1
  160. package/dist/esm/le-round-progress.entry.js.map +0 -1
  161. package/dist/esm/le-stack.entry.js.map +0 -1
  162. package/dist/esm/le-text.entry.js.map +0 -1
  163. package/dist/esm/le-turntable.entry.js.map +0 -1
  164. package/dist/esm/loader.js +0 -11
  165. package/dist/esm/loader.js.map +0 -1
  166. package/dist/esm/utils-CJLZrrdC.js.map +0 -1
  167. package/dist/index.cjs.js +0 -1
  168. package/dist/index.js +0 -1
  169. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +0 -1
  170. package/dist/le-kit/p-024a764e.entry.js +0 -2
  171. package/dist/le-kit/p-024a764e.entry.js.map +0 -1
  172. package/dist/le-kit/p-073cf0b9.entry.js +0 -2
  173. package/dist/le-kit/p-073cf0b9.entry.js.map +0 -1
  174. package/dist/le-kit/p-0955b105.entry.js +0 -2
  175. package/dist/le-kit/p-0955b105.entry.js.map +0 -1
  176. package/dist/le-kit/p-18d79ee2.entry.js +0 -2
  177. package/dist/le-kit/p-18d79ee2.entry.js.map +0 -1
  178. package/dist/le-kit/p-4b1d3b6d.entry.js +0 -2
  179. package/dist/le-kit/p-4b1d3b6d.entry.js.map +0 -1
  180. package/dist/le-kit/p-79d179bd.entry.js +0 -2
  181. package/dist/le-kit/p-79d179bd.entry.js.map +0 -1
  182. package/dist/le-kit/p-D71TXvJa.js +0 -3
  183. package/dist/le-kit/p-D71TXvJa.js.map +0 -1
  184. package/dist/le-kit/p-c8a9288e.entry.js +0 -2
  185. package/dist/le-kit/p-c8a9288e.entry.js.map +0 -1
  186. package/dist/le-kit/p-cfc35bd3.entry.js +0 -2
  187. package/dist/le-kit/p-cfc35bd3.entry.js.map +0 -1
  188. package/dist/le-kit/p-d04da1f5.entry.js +0 -2
  189. package/dist/le-kit/p-d04da1f5.entry.js.map +0 -1
  190. package/dist/le-kit/p-qIai5-eB.js +0 -2
  191. package/dist/le-kit/p-qIai5-eB.js.map +0 -1
  192. package/dist/themes/base.css +0 -89
  193. package/dist/themes/dark.css +0 -100
  194. package/dist/themes/default.css +0 -108
  195. package/dist/themes/gradient.css +0 -100
  196. package/dist/themes/index.css +0 -413
  197. package/dist/themes/minimal.css +0 -100
  198. package/dist/themes/warm.css +0 -100
@@ -1,210 +0,0 @@
1
- import { h } from "@stencil/core";
2
- export class LeTurntable {
3
- // host element
4
- el;
5
- // transform origin
6
- // gets the same values as transform-origin css property
7
- center = 'center';
8
- // transform rotate
9
- value = 0;
10
- updateValue(newValue) {
11
- if (!this.rotating) {
12
- this.currentAngle = parseFloat(newValue);
13
- this.setAngle(this.currentAngle);
14
- }
15
- }
16
- /**
17
- * Internal state
18
- *
19
- * using properties instead of @State decoratorm
20
- * because we are only changing styles of the element and don't
21
- * need the element to be rerendered
22
- */
23
- // indicates is the element being manually rotated right now
24
- rotating = false;
25
- // coordinates of the transform origin in pixels
26
- centerX;
27
- centerY;
28
- // element page (body?) offset in pixels
29
- pageX;
30
- pageY;
31
- currentAngle = 0;
32
- // angle at the start of the drag
33
- startAngle;
34
- /**
35
- * Event listeners
36
- */
37
- handleMouseDown(evt) {
38
- // set rotating mode on
39
- this.rotating = true;
40
- // get start angle
41
- // getting pageX/Y, because when the element is transformed
42
- // relative values are useless
43
- this.startAngle = this.getAngle(evt.pageX, evt.pageY);
44
- // cancel the event to prevent text selection
45
- evt.preventDefault();
46
- evt.stopPropagation();
47
- return false;
48
- }
49
- /**
50
- * Fires when the mouse moves
51
- * checks is the element rotating right now and if it is
52
- * then calc the current angle and rotate the element
53
- *
54
- * TODO: attach events only after the dragStart?
55
- */
56
- handleMouseMove(evt) {
57
- if (this.rotating) {
58
- // calc angle update and rotate element
59
- this.setAngle(this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle));
60
- return false;
61
- }
62
- }
63
- handleMouseUp(evt) {
64
- if (this.rotating) {
65
- const angle = this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle);
66
- this.setAngle(angle);
67
- this.currentAngle = angle;
68
- this.rotating = false;
69
- return false;
70
- }
71
- }
72
- // on window resize the center should be recalculated
73
- handleWindowResize() {
74
- this.getTransformOrigin();
75
- }
76
- /**
77
- * Component lifecycles
78
- */
79
- componentDidLoad() {
80
- this.el.style.transformOrigin = this.center;
81
- this.currentAngle = this.value;
82
- this.getTransformOrigin();
83
- this.setAngle(this.currentAngle);
84
- }
85
- componentDidUpdate() {
86
- this.getTransformOrigin();
87
- }
88
- /**
89
- * Calculates the transform origin of the component
90
- * and the page offset in pixels
91
- *
92
- * We'll need these values to calculate the angle of pointer event
93
- */
94
- getTransformOrigin() {
95
- // transform origin
96
- [this.centerX, this.centerY] = window
97
- .getComputedStyle(this.el, null)
98
- .transformOrigin.split(' ')
99
- .map(val => Math.round(parseFloat(val)));
100
- // page offset
101
- let t = null;
102
- const scrollContainer = ((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.scrollLeft === 'number' ? t : document.body;
103
- const clientRects = this.el.getBoundingClientRect();
104
- this.pageX = Math.round(clientRects.left + scrollContainer.scrollLeft);
105
- this.pageY = Math.round(clientRects.top + scrollContainer.scrollTop);
106
- }
107
- /**
108
- * Calculates current angle
109
- *
110
- * @param {number} posX horizontal mouse position
111
- * @param {number} posY vertical mouse position
112
- */
113
- getAngle(posX, posY) {
114
- const x = posX - this.pageX - this.centerX;
115
- const y = posY - this.pageY - this.centerY;
116
- const angle = Math.round(((Math.atan2(y, x) * 180) / Math.PI) * 100) / 100;
117
- return angle;
118
- }
119
- setAngle(angle) {
120
- this.el.style.transform = `rotate(${angle}deg)`;
121
- }
122
- render() {
123
- return (h("div", { key: 'ec9a506a360881ab3c3df97027c8a25d663f6819', class: "turntable", onMouseDown: this.handleMouseDown.bind(this) }, h("slot", { key: '926a84fa75952bdc3e44f1b2146848401e8ab10f' })));
124
- }
125
- static get is() { return "le-turntable"; }
126
- static get encapsulation() { return "shadow"; }
127
- static get originalStyleUrls() {
128
- return {
129
- "$": ["le-turntable.css"]
130
- };
131
- }
132
- static get styleUrls() {
133
- return {
134
- "$": ["le-turntable.css"]
135
- };
136
- }
137
- static get properties() {
138
- return {
139
- "center": {
140
- "type": "string",
141
- "mutable": false,
142
- "complexType": {
143
- "original": "string",
144
- "resolved": "string",
145
- "references": {}
146
- },
147
- "required": false,
148
- "optional": false,
149
- "docs": {
150
- "tags": [],
151
- "text": ""
152
- },
153
- "getter": false,
154
- "setter": false,
155
- "reflect": false,
156
- "attribute": "center",
157
- "defaultValue": "'center'"
158
- },
159
- "value": {
160
- "type": "number",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "number",
164
- "resolved": "number",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": false,
169
- "docs": {
170
- "tags": [],
171
- "text": ""
172
- },
173
- "getter": false,
174
- "setter": false,
175
- "reflect": false,
176
- "attribute": "value",
177
- "defaultValue": "0"
178
- }
179
- };
180
- }
181
- static get elementRef() { return "el"; }
182
- static get watchers() {
183
- return [{
184
- "propName": "value",
185
- "methodName": "updateValue"
186
- }];
187
- }
188
- static get listeners() {
189
- return [{
190
- "name": "mousemove",
191
- "method": "handleMouseMove",
192
- "target": "window",
193
- "capture": false,
194
- "passive": true
195
- }, {
196
- "name": "mouseup",
197
- "method": "handleMouseUp",
198
- "target": "window",
199
- "capture": false,
200
- "passive": true
201
- }, {
202
- "name": "resize",
203
- "method": "handleWindowResize",
204
- "target": "window",
205
- "capture": false,
206
- "passive": true
207
- }];
208
- }
209
- }
210
- //# sourceMappingURL=le-turntable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"le-turntable.js","sourceRoot":"","sources":["../../../src/components/le-turntable/le-turntable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAO3E,MAAM,OAAO,WAAW;IACtB,eAAe;IACJ,EAAE,CAAc;IAE3B,mBAAmB;IACnB,wDAAwD;IAChD,MAAM,GAAW,QAAQ,CAAC;IAElC,mBAAmB;IACX,KAAK,GAAW,CAAC,CAAC;IAG1B,WAAW,CAAC,QAAQ;QAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IAEH,4DAA4D;IAC5D,QAAQ,GAAG,KAAK,CAAC;IAEjB,gDAAgD;IAChD,OAAO,CAAS;IAChB,OAAO,CAAS;IAEhB,wCAAwC;IACxC,KAAK,CAAS;IACd,KAAK,CAAS;IAEd,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,eAAe,CAAC,SAAS,CAAC,CAAC;IACvE,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,IAAY,EAAE,IAAY;QACjC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3C,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,KAAK,MAAM,CAAC;IAClD,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DAAK,KAAK,EAAC,WAAW,EAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;YACjE,8DAAQ,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, Listen, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'le-turntable',\n styleUrl: 'le-turntable.css',\n shadow: true,\n})\nexport class LeTurntable {\n // host element\n @Element() el: HTMLElement;\n\n // transform origin\n // gets the same values as transform-origin css property\n @Prop() center: string = 'center';\n\n // transform rotate\n @Prop() value: number = 0;\n\n @Watch('value')\n updateValue(newValue) {\n if (!this.rotating) {\n this.currentAngle = parseFloat(newValue);\n this.setAngle(this.currentAngle);\n }\n }\n\n /**\n * Internal state\n *\n * using properties instead of @State decoratorm\n * because we are only changing styles of the element and don't\n * need the element to be rerendered\n */\n\n // indicates is the element being manually rotated right now\n rotating = false;\n\n // coordinates of the transform origin in pixels\n centerX: number;\n centerY: number;\n\n // element page (body?) offset in pixels\n pageX: number;\n pageY: number;\n\n currentAngle: number = 0;\n // angle at the start of the drag\n startAngle: number;\n\n /**\n * Event listeners\n */\n handleMouseDown(evt: MouseEvent) {\n // set rotating mode on\n this.rotating = true;\n\n // get start angle\n // getting pageX/Y, because when the element is transformed\n // relative values are useless\n this.startAngle = this.getAngle(evt.pageX, evt.pageY);\n\n // cancel the event to prevent text selection\n evt.preventDefault();\n evt.stopPropagation();\n return false;\n }\n\n /**\n * Fires when the mouse moves\n * checks is the element rotating right now and if it is\n * then calc the current angle and rotate the element\n *\n * TODO: attach events only after the dragStart?\n */\n @Listen('mousemove', { target: 'window' })\n handleMouseMove(evt: MouseEvent) {\n if (this.rotating) {\n // calc angle update and rotate element\n this.setAngle(this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle));\n return false;\n }\n }\n\n @Listen('mouseup', { target: 'window' })\n handleMouseUp(evt: MouseEvent) {\n if (this.rotating) {\n const angle = this.currentAngle + (this.getAngle(evt.pageX, evt.pageY) - this.startAngle);\n this.setAngle(angle);\n this.currentAngle = angle;\n this.rotating = false;\n return false;\n }\n }\n\n // on window resize the center should be recalculated\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.getTransformOrigin();\n }\n\n /**\n * Component lifecycles\n */\n componentDidLoad() {\n this.el.style.transformOrigin = this.center;\n this.currentAngle = this.value;\n\n this.getTransformOrigin();\n this.setAngle(this.currentAngle);\n }\n\n componentDidUpdate() {\n this.getTransformOrigin();\n }\n\n /**\n * Calculates the transform origin of the component\n * and the page offset in pixels\n *\n * We'll need these values to calculate the angle of pointer event\n */\n getTransformOrigin() {\n // transform origin\n [this.centerX, this.centerY] = window\n .getComputedStyle(this.el, null)\n .transformOrigin.split(' ')\n .map(val => Math.round(parseFloat(val)));\n // page offset\n let t = null;\n const scrollContainer = ((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.scrollLeft === 'number' ? t : document.body;\n const clientRects = this.el.getBoundingClientRect();\n this.pageX = Math.round(clientRects.left + scrollContainer.scrollLeft);\n this.pageY = Math.round(clientRects.top + scrollContainer.scrollTop);\n }\n\n /**\n * Calculates current angle\n *\n * @param {number} posX horizontal mouse position\n * @param {number} posY vertical mouse position\n */\n getAngle(posX: number, posY: number) {\n const x = posX - this.pageX - this.centerX;\n const y = posY - this.pageY - this.centerY;\n const angle = Math.round(((Math.atan2(y, x) * 180) / Math.PI) * 100) / 100;\n return angle;\n }\n\n setAngle(angle) {\n this.el.style.transform = `rotate(${angle}deg)`;\n }\n\n render() {\n return (\n <div class=\"turntable\" onMouseDown={this.handleMouseDown.bind(this)}>\n <slot />\n </div>\n );\n }\n}\n"]}
@@ -1,130 +0,0 @@
1
- import { setMode } from "@stencil/core";
2
- /**
3
- * Global mode initialization for le-kit components.
4
- *
5
- * Mode inheritance works as follows:
6
- * 1. Check the element's own `mode` attribute
7
- * 2. Traverse up the DOM to find a parent with `mode` attribute
8
- * 3. Check the document root element (html) for `mode` attribute
9
- * 4. Fall back to 'default'
10
- *
11
- * This allows setting mode at any level:
12
- * - `<html mode="admin">` - all components in admin mode
13
- * - `<le-card mode="admin">` - this card and its children in admin mode
14
- */
15
- function initializeMode() {
16
- setMode((el) => {
17
- // 1. Check element's own mode attribute
18
- const ownMode = el.getAttribute('mode');
19
- if (ownMode) {
20
- return ownMode;
21
- }
22
- // 2. Traverse up the DOM tree to find inherited mode
23
- let parent = el.parentElement;
24
- while (parent) {
25
- const parentMode = parent.getAttribute('mode');
26
- if (parentMode) {
27
- return parentMode;
28
- }
29
- parent = parent.parentElement;
30
- }
31
- // 3. Check document root element
32
- const rootMode = document.documentElement.getAttribute('mode');
33
- if (rootMode) {
34
- return rootMode;
35
- }
36
- // 4. Default mode
37
- return 'default';
38
- });
39
- }
40
- // Default export for Stencil global script
41
- export default initializeMode;
42
- /**
43
- * Helper function to get the current mode for an element.
44
- * Can be used programmatically in components.
45
- *
46
- * This function traverses both regular DOM and shadow DOM boundaries
47
- * to find the nearest mode attribute.
48
- */
49
- export function getMode(el) {
50
- // Check element's own mode
51
- const ownMode = el.getAttribute('mode');
52
- if (ownMode) {
53
- return ownMode;
54
- }
55
- // Traverse up DOM, crossing shadow boundaries
56
- let current = el;
57
- while (current) {
58
- // Try parent element first
59
- if (current instanceof Element && current.parentElement) {
60
- current = current.parentElement;
61
- const mode = current.getAttribute?.('mode');
62
- if (mode) {
63
- return mode;
64
- }
65
- }
66
- else {
67
- // No parent element - check if we're in a shadow root
68
- const root = current.getRootNode();
69
- if (root instanceof ShadowRoot) {
70
- // Cross the shadow boundary to the host element
71
- current = root.host;
72
- const mode = current.getAttribute?.('mode');
73
- if (mode) {
74
- return mode;
75
- }
76
- }
77
- else {
78
- // We've reached the document root
79
- break;
80
- }
81
- }
82
- }
83
- // Check document root
84
- const rootMode = document.documentElement.getAttribute('mode');
85
- if (rootMode) {
86
- return rootMode;
87
- }
88
- return 'default';
89
- }
90
- /**
91
- * Helper function to get the current theme for an element.
92
- * Theme inheritance works the same as mode - cascades through DOM.
93
- */
94
- export function getTheme(el) {
95
- // Check element's own theme
96
- const ownTheme = el.getAttribute('theme');
97
- if (ownTheme) {
98
- return ownTheme;
99
- }
100
- // Traverse up DOM
101
- let parent = el.parentElement;
102
- while (parent) {
103
- const parentTheme = parent.getAttribute('theme');
104
- if (parentTheme) {
105
- return parentTheme;
106
- }
107
- parent = parent.parentElement;
108
- }
109
- // Check root
110
- const rootTheme = document.documentElement.getAttribute('theme');
111
- if (rootTheme) {
112
- return rootTheme;
113
- }
114
- return 'default';
115
- }
116
- /**
117
- * Helper function to set mode on the document root.
118
- * Useful for switching all components to admin mode.
119
- */
120
- export function setGlobalMode(mode) {
121
- document.documentElement.setAttribute('mode', mode);
122
- }
123
- /**
124
- * Helper function to set theme on the document root.
125
- * Useful for switching all components to a different theme.
126
- */
127
- export function setGlobalTheme(theme) {
128
- document.documentElement.setAttribute('theme', theme);
129
- }
130
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/global/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC;;;;;;;;;;;;GAYG;AACH,SAAS,cAAc;IACrB,OAAO,CAAC,CAAC,EAAe,EAAa,EAAE;QACrC,wCAAwC;QACxC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAoB,CAAC;QAC9B,CAAC;QAED,qDAAqD;QACrD,IAAI,MAAM,GAAG,EAAE,CAAC,aAAa,CAAC;QAC9B,OAAO,MAAM,EAAE,CAAC;YACd,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAC/C,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,UAAuB,CAAC;YACjC,CAAC;YACD,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;QAChC,CAAC;QAED,iCAAiC;QACjC,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAqB,CAAC;QAC/B,CAAC;QAED,kBAAkB;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,2CAA2C;AAC3C,eAAe,cAAc,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EAAe;IACrC,2BAA2B;IAC3B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAoB,CAAC;IAC9B,CAAC;IAED,8CAA8C;IAC9C,IAAI,OAAO,GAAg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MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAyB,CAAC;QACnC,CAAC;QACD,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAChC,CAAC;IAED,aAAa;IACb,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACjE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAuB,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAe;IAC3C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAiB;IAC9C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { setMode } from '@stencil/core';\n\nexport type LeKitMode = 'default' | 'admin' | string;\nexport type LeKitTheme = 'default' | 'dark' | string;\n\n/**\n * Global mode initialization for le-kit components.\n *\n * Mode inheritance works as follows:\n * 1. Check the element's own `mode` attribute\n * 2. Traverse up the DOM to find a parent with `mode` attribute\n * 3. Check the document root element (html) for `mode` attribute\n * 4. Fall back to 'default'\n *\n * This allows setting mode at any level:\n * - `<html mode=\"admin\">` - all components in admin mode\n * - `<le-card mode=\"admin\">` - this card and its children in admin mode\n */\nfunction initializeMode() {\n setMode((el: HTMLElement): LeKitMode => {\n // 1. Check element's own mode attribute\n const ownMode = el.getAttribute('mode');\n if (ownMode) {\n return ownMode as LeKitMode;\n }\n\n // 2. Traverse up the DOM tree to find inherited mode\n let parent = el.parentElement;\n while (parent) {\n const parentMode = parent.getAttribute('mode');\n if (parentMode) {\n return parentMode as LeKitMode;\n }\n parent = parent.parentElement;\n }\n\n // 3. Check document root element\n const rootMode = document.documentElement.getAttribute('mode');\n if (rootMode) {\n return rootMode as LeKitMode;\n }\n\n // 4. Default mode\n return 'default';\n });\n}\n\n// Default export for Stencil global script\nexport default initializeMode;\n\n/**\n * Helper function to get the current mode for an element.\n * Can be used programmatically in components.\n * \n * This function traverses both regular DOM and shadow DOM boundaries\n * to find the nearest mode attribute.\n */\nexport function getMode(el: HTMLElement): LeKitMode {\n // Check element's own mode\n const ownMode = el.getAttribute('mode');\n if (ownMode) {\n return ownMode as LeKitMode;\n }\n\n // Traverse up DOM, crossing shadow boundaries\n let current: Node | null = el;\n while (current) {\n // Try parent element first\n if (current instanceof Element && current.parentElement) {\n current = current.parentElement;\n const mode = (current as HTMLElement).getAttribute?.('mode');\n if (mode) {\n return mode as LeKitMode;\n }\n } else {\n // No parent element - check if we're in a shadow root\n const root = current.getRootNode();\n if (root instanceof ShadowRoot) {\n // Cross the shadow boundary to the host element\n current = root.host;\n const mode = (current as HTMLElement).getAttribute?.('mode');\n if (mode) {\n return mode as LeKitMode;\n }\n } else {\n // We've reached the document root\n break;\n }\n }\n }\n\n // Check document root\n const rootMode = document.documentElement.getAttribute('mode');\n if (rootMode) {\n return rootMode as LeKitMode;\n }\n\n return 'default';\n}\n\n/**\n * Helper function to get the current theme for an element.\n * Theme inheritance works the same as mode - cascades through DOM.\n */\nexport function getTheme(el: HTMLElement): LeKitTheme {\n // Check element's own theme\n const ownTheme = el.getAttribute('theme');\n if (ownTheme) {\n return ownTheme as LeKitTheme;\n }\n\n // Traverse up DOM\n let parent = el.parentElement;\n while (parent) {\n const parentTheme = parent.getAttribute('theme');\n if (parentTheme) {\n return parentTheme as LeKitTheme;\n }\n parent = parent.parentElement;\n }\n\n // Check root\n const rootTheme = document.documentElement.getAttribute('theme');\n if (rootTheme) {\n return rootTheme as LeKitTheme;\n }\n\n return 'default';\n}\n\n/**\n * Helper function to set mode on the document root.\n * Useful for switching all components to admin mode.\n */\nexport function setGlobalMode(mode: LeKitMode): void {\n document.documentElement.setAttribute('mode', mode);\n}\n\n/**\n * Helper function to set theme on the document root.\n * Useful for switching all components to a different theme.\n */\nexport function setGlobalTheme(theme: LeKitTheme): void {\n document.documentElement.setAttribute('theme', theme);\n}\n"]}
@@ -1,15 +0,0 @@
1
- /**
2
- * @fileoverview Entry point for le-kit component library
3
- *
4
- * This file exports utilities, types, and helper functions.
5
- * Components are auto-registered and available as custom elements.
6
- *
7
- * @see README.md for usage instructions
8
- */
9
- // Utility exports
10
- export { generateId, parseCommaSeparated, slotHasContent } from './utils/utils';
11
- // Global mode and theme helpers
12
- export { getMode, setGlobalMode, getTheme, setGlobalTheme } from './global/app';
13
- // Popup/dialog programmatic API
14
- export { leAlert, leConfirm, lePrompt } from './components/le-popup/le-popup.api';
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEhF,gCAAgC;AAChC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGhF,gCAAgC;AAChC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["/**\n * @fileoverview Entry point for le-kit component library\n *\n * This file exports utilities, types, and helper functions.\n * Components are auto-registered and available as custom elements.\n *\n * @see README.md for usage instructions\n */\n\n// Utility exports\nexport { generateId, parseCommaSeparated, slotHasContent } from './utils/utils';\n\n// Global mode and theme helpers\nexport { getMode, setGlobalMode, getTheme, setGlobalTheme } from './global/app';\nexport type { LeKitMode, LeKitTheme } from './global/app';\n\n// Popup/dialog programmatic API\nexport { leAlert, leConfirm, lePrompt } from './components/le-popup/le-popup.api';\nexport type { PopupOptions } from './components/le-popup/le-popup.api';\nexport type { PopupResult, PopupType, PopupPosition } from './components/le-popup/le-popup';\n\n// Type exports\nexport type * from './components.d.ts';\n"]}
@@ -1,115 +0,0 @@
1
- /**
2
- * Block types for the rich text editor.
3
- *
4
- * Used by: le-rich-text-editor, le-editor-block, le-block-menu
5
- */
6
- /**
7
- * Default block type configurations.
8
- */
9
- export const DEFAULT_BLOCK_CONFIGS = [
10
- {
11
- type: 'paragraph',
12
- label: 'Text',
13
- icon: '📝',
14
- tag: 'p',
15
- placeholder: 'Type something...',
16
- editable: true,
17
- description: 'Plain text paragraph',
18
- },
19
- {
20
- type: 'heading1',
21
- label: 'Heading 1',
22
- icon: 'H1',
23
- tag: 'h1',
24
- placeholder: 'Heading 1',
25
- editable: true,
26
- description: 'Large section heading',
27
- shortcut: '# ',
28
- },
29
- {
30
- type: 'heading2',
31
- label: 'Heading 2',
32
- icon: 'H2',
33
- tag: 'h2',
34
- placeholder: 'Heading 2',
35
- editable: true,
36
- description: 'Medium section heading',
37
- shortcut: '## ',
38
- },
39
- {
40
- type: 'heading3',
41
- label: 'Heading 3',
42
- icon: 'H3',
43
- tag: 'h3',
44
- placeholder: 'Heading 3',
45
- editable: true,
46
- description: 'Small section heading',
47
- shortcut: '### ',
48
- },
49
- {
50
- type: 'bullet-list',
51
- label: 'Bulleted List',
52
- icon: '•',
53
- tag: 'li',
54
- placeholder: 'List item',
55
- editable: true,
56
- description: 'Unordered list',
57
- shortcut: '- ',
58
- },
59
- {
60
- type: 'numbered-list',
61
- label: 'Numbered List',
62
- icon: '1.',
63
- tag: 'li',
64
- placeholder: 'List item',
65
- editable: true,
66
- description: 'Ordered list',
67
- shortcut: '1. ',
68
- },
69
- {
70
- type: 'quote',
71
- label: 'Quote',
72
- icon: '❝',
73
- tag: 'blockquote',
74
- placeholder: 'Quote',
75
- editable: true,
76
- description: 'Block quote',
77
- shortcut: '> ',
78
- },
79
- {
80
- type: 'code',
81
- label: 'Code',
82
- icon: '</>',
83
- tag: 'code',
84
- placeholder: 'Code',
85
- editable: true,
86
- description: 'Code block',
87
- shortcut: '``` ',
88
- },
89
- {
90
- type: 'divider',
91
- label: 'Divider',
92
- icon: '—',
93
- tag: 'hr',
94
- editable: false,
95
- description: 'Horizontal line',
96
- shortcut: '---',
97
- },
98
- ];
99
- /**
100
- * Generate a unique block ID
101
- */
102
- export function generateBlockId() {
103
- return `block-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
104
- }
105
- /**
106
- * Create a new block with default values
107
- */
108
- export function createBlock(type, content = '') {
109
- return {
110
- id: generateBlockId(),
111
- type,
112
- content,
113
- };
114
- }
115
- //# sourceMappingURL=blocks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/types/blocks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmIH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD;QACE,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,GAAG;QACR,WAAW,EAAE,mBAAmB;QAChC,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,sBAAsB;KACpC;IACD;QACE,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,IAAI;QACT,WAAW,EAAE,WAAW;QACxB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,uBAAuB;QACpC,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,IAAI;QACT,WAAW,EAAE,WAAW;QACxB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,KAAK;KAChB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,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C,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAe,EAAE,UAAkB,EAAE;IAC/D,OAAO;QACL,EAAE,EAAE,eAAe,EAAE;QACrB,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Block types for the rich text editor.\n *\n * Used by: le-rich-text-editor, le-editor-block, le-block-menu\n */\n\n/**\n * Available block types for the editor.\n * Start with essential types, expand in future versions.\n */\nexport type BlockType = 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'bullet-list' | 'numbered-list' | 'quote' | 'code' | 'divider';\n\n/**\n * A single block in the editor.\n *\n * @example Paragraph block\n * ```typescript\n * const block: LeBlock = {\n * id: 'block-1',\n * type: 'paragraph',\n * content: 'Hello <strong>world</strong>!'\n * };\n * ```\n *\n * @example Code block with language\n * ```typescript\n * const block: LeBlock = {\n * id: 'block-2',\n * type: 'code',\n * content: 'const x = 1;',\n * attributes: { language: 'typescript' }\n * };\n * ```\n */\nexport interface LeBlock {\n /**\n * Unique identifier for the block.\n */\n id: string;\n\n /**\n * The type of block (paragraph, heading, list, etc.)\n */\n type: BlockType;\n\n /**\n * HTML content of the block.\n * For most blocks, this is the inner HTML.\n * For divider, this is empty.\n */\n content: string;\n\n /**\n * Block-specific attributes.\n */\n attributes?: LeBlockAttributes;\n}\n\n/**\n * Block-specific attributes\n */\nexport interface LeBlockAttributes {\n /**\n * Programming language for code blocks.\n */\n language?: string;\n\n /**\n * Placeholder text shown when block is empty.\n */\n placeholder?: string;\n\n /**\n * Custom CSS class for the block.\n */\n className?: string;\n\n /**\n * Additional custom attributes.\n */\n [key: string]: unknown;\n}\n\n/**\n * Configuration for a block type.\n * Used by the block registry to render and manage blocks.\n */\nexport interface BlockTypeConfig {\n /**\n * Block type identifier.\n */\n type: BlockType;\n\n /**\n * Display label for the block type (shown in block menu).\n */\n label: string;\n\n /**\n * Icon for the block type (emoji or icon name).\n */\n icon?: string;\n\n /**\n * HTML tag to render for this block type.\n */\n tag: string;\n\n /**\n * CSS class applied to the block element.\n */\n className?: string;\n\n /**\n * Placeholder text shown when block is empty.\n */\n placeholder?: string;\n\n /**\n * Whether the block content is editable.\n * Set to false for blocks like divider.\n */\n editable?: boolean;\n\n /**\n * Description shown in block menu.\n */\n description?: string;\n\n /**\n * Keyboard shortcut hint (e.g., \"# \" for heading).\n */\n shortcut?: string;\n}\n\n/**\n * Default block type configurations.\n */\nexport const DEFAULT_BLOCK_CONFIGS: BlockTypeConfig[] = [\n {\n type: 'paragraph',\n label: 'Text',\n icon: '📝',\n tag: 'p',\n placeholder: 'Type something...',\n editable: true,\n description: 'Plain text paragraph',\n },\n {\n type: 'heading1',\n label: 'Heading 1',\n icon: 'H1',\n tag: 'h1',\n placeholder: 'Heading 1',\n editable: true,\n description: 'Large section heading',\n shortcut: '# ',\n },\n {\n type: 'heading2',\n label: 'Heading 2',\n icon: 'H2',\n tag: 'h2',\n placeholder: 'Heading 2',\n editable: true,\n description: 'Medium section heading',\n shortcut: '## ',\n },\n {\n type: 'heading3',\n label: 'Heading 3',\n icon: 'H3',\n tag: 'h3',\n placeholder: 'Heading 3',\n editable: true,\n description: 'Small section heading',\n shortcut: '### ',\n },\n {\n type: 'bullet-list',\n label: 'Bulleted List',\n icon: '•',\n tag: 'li',\n placeholder: 'List item',\n editable: true,\n description: 'Unordered list',\n shortcut: '- ',\n },\n {\n type: 'numbered-list',\n label: 'Numbered List',\n icon: '1.',\n tag: 'li',\n placeholder: 'List item',\n editable: true,\n description: 'Ordered list',\n shortcut: '1. ',\n },\n {\n type: 'quote',\n label: 'Quote',\n icon: '❝',\n tag: 'blockquote',\n placeholder: 'Quote',\n editable: true,\n description: 'Block quote',\n shortcut: '> ',\n },\n {\n type: 'code',\n label: 'Code',\n icon: '</>',\n tag: 'code',\n placeholder: 'Code',\n editable: true,\n description: 'Code block',\n shortcut: '``` ',\n },\n {\n type: 'divider',\n label: 'Divider',\n icon: '—',\n tag: 'hr',\n editable: false,\n description: 'Horizontal line',\n shortcut: '---',\n },\n];\n\n/**\n * Event detail for block changes\n */\nexport interface LeBlockChangeDetail {\n blocks: LeBlock[];\n changedBlock?: LeBlock;\n action: 'add' | 'remove' | 'update' | 'move';\n}\n\n/**\n * Generate a unique block ID\n */\nexport function generateBlockId(): string {\n return `block-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\n\n/**\n * Create a new block with default values\n */\nexport function createBlock(type: BlockType, content: string = ''): LeBlock {\n return {\n id: generateBlockId(),\n type,\n content,\n };\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Universal option interface used across Le-Kit components.\n *\n * Used by: le-select, le-combobox, le-multiselect, le-tabs,\n * le-block-menu, le-emoji-picker, and any menu/list components.\n *\n * @example Basic option\n * ```typescript\n * const option: LeOption = {\n * label: 'Option 1',\n * value: 'opt1'\n * };\n * ```\n *\n * @example With icons and description\n * ```typescript\n * const option: LeOption = {\n * label: 'Settings',\n * value: 'settings',\n * iconStart: '⚙️',\n * description: 'Configure application settings'\n * };\n * ```\n *\n * @example Grouped options\n * ```typescript\n * const options: LeOption[] = [\n * { label: 'Apple', value: 'apple', group: 'Fruits' },\n * { label: 'Banana', value: 'banana', group: 'Fruits' },\n * { label: 'Carrot', value: 'carrot', group: 'Vegetables' },\n * ];\n * ```\n *\n * @example Nested options (for submenus)\n * ```typescript\n * const option: LeOption = {\n * label: 'More actions',\n * iconEnd: '▶',\n * children: [\n * { label: 'Duplicate', value: 'duplicate' },\n * { label: 'Archive', value: 'archive' },\n * ]\n * };\n * ```\n */\nexport interface LeOption {\n /**\n * Unique identifier for the option.\n * Auto-generated if not provided.\n */\n id?: string;\n\n /**\n * Display text for the option (required).\n */\n label: string;\n\n /**\n * Selection value. Defaults to label if not provided.\n */\n value?: string | number;\n\n /**\n * Whether the option is disabled and cannot be selected.\n */\n disabled?: boolean;\n\n /**\n * Whether the option is currently selected.\n * Used for multiselect and menu components.\n */\n selected?: boolean;\n\n /**\n * Whether the option is checked.\n * Used for checkbox/radio menu items.\n */\n checked?: boolean;\n\n /**\n * Icon displayed at the start (left) of the option.\n * Can be a URL, icon name, or emoji character.\n */\n iconStart?: string;\n\n /**\n * Icon displayed at the end (right) of the option.\n * Can be a URL, icon name, or emoji character.\n */\n iconEnd?: string;\n\n /**\n * Secondary description text displayed below the label.\n */\n description?: string;\n\n /**\n * Nested child options for hierarchical menus or submenus.\n */\n children?: LeOption[];\n\n /**\n * Group label for categorizing options in flat lists.\n * Options with the same group value are visually grouped together.\n */\n group?: string;\n\n /**\n * Add a visual separator line before or after this option.\n */\n separator?: 'before' | 'after';\n\n /**\n * Custom data passthrough for application-specific needs.\n * This data is included in selection events.\n */\n data?: Record<string, unknown>;\n}\n\n/**\n * Helper type for option value\n */\nexport type LeOptionValue = string | number;\n\n/**\n * Event detail for option selection events\n */\nexport interface LeOptionSelectDetail {\n value: LeOptionValue;\n option: LeOption;\n}\n\n/**\n * Event detail for multi-option selection events\n */\nexport interface LeMultiOptionSelectDetail {\n values: LeOptionValue[];\n options: LeOption[];\n}\n"]}