kritzel-stencil 0.4.4 → 0.4.6

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 (128) hide show
  1. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +79 -13
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/stencil.cjs.js +1 -1
  4. package/dist/collection/classes/core/viewport.class.js +14 -1
  5. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +48 -8
  6. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +84 -3
  7. package/dist/collection/constants/version.js +1 -1
  8. package/dist/components/index.js +1226 -1
  9. package/dist/components/kritzel-active-users.js +6 -1
  10. package/dist/components/kritzel-avatar.js +6 -1
  11. package/dist/components/kritzel-awareness-cursors.js +6 -1
  12. package/dist/components/kritzel-back-to-content.js +6 -1
  13. package/dist/components/kritzel-brush-style.js +64 -1
  14. package/dist/components/kritzel-button.js +6 -1
  15. package/dist/components/kritzel-color-palette.js +6 -1
  16. package/dist/components/kritzel-color.js +6 -1
  17. package/dist/components/kritzel-context-menu.js +6 -1
  18. package/dist/components/kritzel-controls.js +6 -1
  19. package/dist/components/kritzel-current-user-dialog.js +6 -1
  20. package/dist/components/kritzel-current-user.js +6 -1
  21. package/dist/components/kritzel-cursor-trail.js +6 -1
  22. package/dist/components/kritzel-dialog.js +6 -1
  23. package/dist/components/kritzel-dropdown.js +6 -1
  24. package/dist/components/kritzel-editor.js +4404 -1
  25. package/dist/components/kritzel-engine.js +6 -1
  26. package/dist/components/kritzel-export.js +6 -1
  27. package/dist/components/kritzel-font-family.js +6 -1
  28. package/dist/components/kritzel-font-size.js +6 -1
  29. package/dist/components/kritzel-font.js +6 -1
  30. package/dist/components/kritzel-icon.js +6 -1
  31. package/dist/components/kritzel-input.js +6 -1
  32. package/dist/components/kritzel-line-endings.js +6 -1
  33. package/dist/components/kritzel-loading-overlay.js +6 -1
  34. package/dist/components/kritzel-login-dialog.js +6 -1
  35. package/dist/components/kritzel-master-detail.js +6 -1
  36. package/dist/components/kritzel-menu-item.js +6 -1
  37. package/dist/components/kritzel-menu.js +6 -1
  38. package/dist/components/kritzel-more-menu.js +6 -1
  39. package/dist/components/kritzel-notification-card.js +6 -1
  40. package/dist/components/kritzel-numeric-input.js +6 -1
  41. package/dist/components/kritzel-opacity-slider.js +6 -1
  42. package/dist/components/kritzel-pill-tabs.js +6 -1
  43. package/dist/components/kritzel-portal.js +6 -1
  44. package/dist/components/kritzel-settings.js +6 -1
  45. package/dist/components/kritzel-shape-fill.js +6 -1
  46. package/dist/components/kritzel-share-dialog.js +6 -1
  47. package/dist/components/kritzel-slide-toggle.js +6 -1
  48. package/dist/components/kritzel-split-button.js +6 -1
  49. package/dist/components/kritzel-stroke-size.js +6 -1
  50. package/dist/components/kritzel-sync-indicator.js +6 -1
  51. package/dist/components/kritzel-tool-config.js +6 -1
  52. package/dist/components/kritzel-tooltip.js +6 -1
  53. package/dist/components/kritzel-utility-panel.js +6 -1
  54. package/dist/components/kritzel-watermark.js +6 -1
  55. package/dist/components/kritzel-workspace-manager.js +6 -1
  56. package/dist/components/kritzel-zoom-panel.js +6 -1
  57. package/dist/components/p-894OnDQV.js +39 -1
  58. package/dist/components/p-B43upypT.js +1500 -1
  59. package/dist/components/p-B5oHmPJb.js +97 -1
  60. package/dist/components/p-B6t5q-V4.js +63 -1
  61. package/dist/components/p-B8Xi4Clg.js +43 -1
  62. package/dist/components/p-BBmP8lVY.js +51726 -0
  63. package/dist/components/p-BDzlx2hB.js +135 -1
  64. package/dist/components/p-BFTU3MAI.js +7 -1
  65. package/dist/components/p-BFYtCsZu.js +56 -1
  66. package/dist/components/p-BI2ng9I_.js +62 -1
  67. package/dist/components/p-BTzlrIxe.js +194 -1
  68. package/dist/components/p-BmyTdQGy.js +1090 -1
  69. package/dist/components/p-BsANVili.js +150 -1
  70. package/dist/components/p-BxpKq94F.js +290 -1
  71. package/dist/components/p-C38P-Vd0.js +446 -1
  72. package/dist/components/p-C4NrrUfN.js +77 -1
  73. package/dist/components/p-CW-VyJgK.js +6 -1
  74. package/dist/components/p-CWRSGYOE.js +57 -1
  75. package/dist/components/p-CXpv9Rxe.js +106 -1
  76. package/dist/components/p-Ca-igU1f.js +320 -1
  77. package/dist/components/p-CdR76C4L.js +165 -1
  78. package/dist/components/p-Ch42cOeY.js +320 -0
  79. package/dist/components/p-ClFprFvz.js +209 -1
  80. package/dist/components/p-Cm33td2O.js +122 -1
  81. package/dist/components/p-CqLgB8JK.js +91 -1
  82. package/dist/components/p-Cr682JI_.js +156 -1
  83. package/dist/components/p-CsvMgk_f.js +62 -1
  84. package/dist/components/p-CwJwsRR3.js +277 -1
  85. package/dist/components/p-Cymum41a.js +88 -1
  86. package/dist/components/p-D09kgc5Q.js +94 -1
  87. package/dist/components/p-D30zs0kA.js +121 -1
  88. package/dist/components/p-D3y_Hauo.js +85 -1
  89. package/dist/components/p-D5jf8wAu.js +142 -1
  90. package/dist/components/p-D82VaHce.js +53 -1
  91. package/dist/components/p-DAwPPDMS.js +101 -1
  92. package/dist/components/p-DEBwmRTC.js +55 -1
  93. package/dist/components/p-DIazmg6w.js +52 -1
  94. package/dist/components/p-DJ88BrIW.js +70 -1
  95. package/dist/components/p-DJkKlUyZ.js +182 -1
  96. package/dist/components/p-DUYmwrWV.js +3267 -1
  97. package/dist/components/p-DX2nriaq.js +486 -1
  98. package/dist/components/p-Dd-pMvlr.js +20 -1
  99. package/dist/components/p-Df3BwVGy.js +299 -1
  100. package/dist/components/p-DgJ0ufzr.js +43 -1
  101. package/dist/components/p-DkUb2czk.js +70 -1
  102. package/dist/components/p-Dlp84thc.js +57 -1
  103. package/dist/components/p-JYj3Facr.js +431 -1
  104. package/dist/components/p-Ka7OWbnk.js +2304 -1
  105. package/dist/components/p-PSFAfAyd.js +49 -1
  106. package/dist/components/p-WUdQqYnu.js +118 -1
  107. package/dist/components/p-djJSnjAX.js +84 -1
  108. package/dist/components/p-e6Zpc9Vp.js +143 -1
  109. package/dist/components/p-jGOpkGDl.js +30 -1
  110. package/dist/components/p-pagW8YF7.js +99 -1
  111. package/dist/esm/kritzel-active-users_47.entry.js +79 -13
  112. package/dist/esm/loader.js +1 -1
  113. package/dist/esm/stencil.js +1 -1
  114. package/dist/stencil/index.esm.js +1172 -1
  115. package/dist/stencil/p-5b969a42.entry.js +36109 -0
  116. package/dist/stencil/p-DQuL1Twl.js +3 -1
  117. package/dist/stencil/p-Dhio9uis.js +1717 -2
  118. package/dist/stencil/p-fb32cd8f.entry.js +29 -1
  119. package/dist/stencil/p-uC7_X6yr.js +30737 -1
  120. package/dist/stencil/stencil.esm.js +21 -1
  121. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +2 -0
  122. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +7 -0
  123. package/dist/types/components.d.ts +10 -0
  124. package/dist/types/constants/version.d.ts +1 -1
  125. package/package.json +1 -1
  126. package/dist/components/p--Oazz-BP.js +0 -9
  127. package/dist/components/p-Xsiz1D5Q.js +0 -1
  128. package/dist/stencil/p-9abc21b9.entry.js +0 -9
@@ -1 +1,135 @@
1
- import{p as e,H as i,c as t,h as n,d as r,t as o}from"./p-B43upypT.js";const s=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChange=t(this,"valueChange")}value;min=Number.MIN_SAFE_INTEGER;max=Number.MAX_SAFE_INTEGER;step=1;label="";placeholder="";valueChange;inputValue="";onValueChange(e){this.inputValue=this.shouldShowEmpty(e)?"":String(e)}componentWillLoad(){this.inputValue=this.shouldShowEmpty(this.value)?"":String(this.value)}shouldShowEmpty(e){return void 0===e||e===1/0||e===-1/0}normalizeValue(e){return isNaN(e)?this.value??0:Math.min(this.max,Math.max(this.min,e))}getDecimalPlaces(){const e=String(this.step),i=e.indexOf(".");return-1===i?0:e.length-i-1}roundToStep(e){const i=this.getDecimalPlaces(),t=Math.pow(10,i);return Math.round(e*t)/t}handleInput=e=>{this.inputValue=e.target.value};handleBlur=()=>{this.commitValue()};handleKeyDown=e=>{"Enter"===e.key&&this.commitValue()};handleInvalid=e=>{e.preventDefault()};commitValue(){if(""===this.inputValue.trim())return this.value=void 0,void this.valueChange.emit(void 0);const e=parseFloat(this.inputValue),i=this.normalizeValue(e);this.value=i,this.inputValue=String(i),this.valueChange.emit(i)}handleIncrement=()=>{const e=parseFloat(this.inputValue),i=isNaN(e)?this.value??0:e,t=this.normalizeValue(this.roundToStep(i+this.step));this.value=t,this.inputValue=String(t),this.valueChange.emit(t)};handleDecrement=()=>{const e=parseFloat(this.inputValue),i=isNaN(e)?this.value??0:e,t=this.normalizeValue(this.roundToStep(i-this.step));this.value=t,this.inputValue=String(t),this.valueChange.emit(t)};render(){return n(r,{key:"eb766b22717d856d096bd1a4a44279f6ac994892"},n("div",{key:"2394e2b2af48f560e77e7a37b34d00656b0dd344",class:"input-container"},this.label&&n("label",{key:"d8889aa93d4a86fa841f4da1f0b97411ab039cb1",class:"input-label"},this.label),n("div",{key:"b55ae2edf164cdfcdda356119b148c8bfb8fbd24",class:"input-wrapper"},n("input",{key:"ee1f1663f19c5ca66d64b6c5142005da318e03e4",type:"number",class:"numeric-input",title:"",min:this.min===Number.MIN_SAFE_INTEGER?void 0:this.min,max:this.max===Number.MAX_SAFE_INTEGER?void 0:this.max,step:this.step,value:this.inputValue,placeholder:this.placeholder,onInput:this.handleInput,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onInvalid:this.handleInvalid}),n("div",{key:"82e127b045e631616e6368c437473bbf9732445d",class:"spinner-buttons"},n("button",{key:"e7412dffccbdacbb5743ae2e2e7bd33c68e6fceb",type:"button",class:"spinner-button spinner-up",onClick:this.handleIncrement,tabIndex:-1,"aria-label":"Increase value"},n("svg",{key:"7e471bf2bee5d4d161fea2e838b26e2f28bb84d9",viewBox:"0 0 10 6",class:"spinner-icon"},n("path",{key:"69e4c80eed03b2ee2a044d07f35420b7618f4e75",d:"M1 5L5 1L9 5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}))),n("button",{key:"a0c2350d48c398f7396cebd973438c0e390d0aff",type:"button",class:"spinner-button spinner-down",onClick:this.handleDecrement,tabIndex:-1,"aria-label":"Decrease value"},n("svg",{key:"c1f6264d187936d5eb0cc43c0275dc2e2c93b854",viewBox:"0 0 10 6",class:"spinner-icon"},n("path",{key:"facbdd171b43868ec41b469b0d11d6c9bfcec3aa",d:"M1 1L5 5L9 1",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})))))))}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return":host{display:block}.input-container{display:flex;flex-direction:column;gap:6px}.input-label{font-size:14px;font-weight:500;color:var(--kritzel-numeric-input-label-color, #333333)}.input-wrapper{display:flex;position:relative}.numeric-input{flex:1;padding:8px 36px 8px 12px;border:1px solid var(--kritzel-numeric-input-border-color, #ebebeb);border-radius:var(--kritzel-numeric-input-border-radius, 6px);font-size:14px;color:var(--kritzel-numeric-input-text-color, #333333);background-color:var(--kritzel-numeric-input-input-background, #ffffff);outline:none;transition:border-color 150ms ease;box-sizing:border-box}.numeric-input::-webkit-outer-spin-button,.numeric-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.numeric-input[type='number']{-moz-appearance:textfield}.numeric-input::selection{background-color:var(--kritzel-numeric-input-selection-background, #007AFF);color:var(--kritzel-numeric-input-selection-color, #ffffff)}.numeric-input:hover{border-color:var(--kritzel-numeric-input-hover-border-color, #cccccc)}.numeric-input:focus{border-color:var(--kritzel-numeric-input-focus-border-color, #0066ff);border-width:2px;padding:7px 35px 7px 11px}.spinner-buttons{position:absolute;right:1px;top:1px;bottom:1px;display:flex;flex-direction:column;border-left:1px solid var(--kritzel-numeric-input-border-color, #ebebeb);border-radius:0 var(--kritzel-numeric-input-spinner-border-radius, 5px) var(--kritzel-numeric-input-spinner-border-radius, 5px) 0;overflow:hidden}.spinner-button{flex:1;display:flex;align-items:center;justify-content:center;width:24px;padding:0;border:none;background-color:var(--kritzel-numeric-input-spinner-background, #f5f5f5);color:var(--kritzel-numeric-input-spinner-color, #666666);cursor:pointer;transition:background-color 150ms ease}.spinner-button:hover{background-color:var(--kritzel-numeric-input-spinner-hover-background, #ebebeb)}.spinner-button:active{background-color:var(--kritzel-numeric-input-spinner-active-background, #dddddd)}.spinner-up{border-bottom:1px solid var(--kritzel-numeric-input-border-color, #ebebeb)}.spinner-icon{width:10px;height:6px}"}},[513,"kritzel-numeric-input",{value:[1026],min:[2],max:[2],step:[2],label:[1],placeholder:[1],inputValue:[32]},void 0,{value:[{onValueChange:0}]}]);function a(){"undefined"!=typeof customElements&&["kritzel-numeric-input"].forEach((e=>{"kritzel-numeric-input"===e&&(customElements.get(o(e))||customElements.define(o(e),s))}))}export{s as K,a as d}
1
+ import { p as proxyCustomElement, H, c as createEvent, h, d as Host, t as transformTag } from './p-B43upypT.js';
2
+
3
+ const kritzelNumericInputCss = () => `:host{display:block}.input-container{display:flex;flex-direction:column;gap:6px}.input-label{font-size:14px;font-weight:500;color:var(--kritzel-numeric-input-label-color, #333333)}.input-wrapper{display:flex;position:relative}.numeric-input{flex:1;padding:8px 36px 8px 12px;border:1px solid var(--kritzel-numeric-input-border-color, #ebebeb);border-radius:var(--kritzel-numeric-input-border-radius, 6px);font-size:14px;color:var(--kritzel-numeric-input-text-color, #333333);background-color:var(--kritzel-numeric-input-input-background, #ffffff);outline:none;transition:border-color 150ms ease;box-sizing:border-box}.numeric-input::-webkit-outer-spin-button,.numeric-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.numeric-input[type='number']{-moz-appearance:textfield}.numeric-input::selection{background-color:var(--kritzel-numeric-input-selection-background, #007AFF);color:var(--kritzel-numeric-input-selection-color, #ffffff)}.numeric-input:hover{border-color:var(--kritzel-numeric-input-hover-border-color, #cccccc)}.numeric-input:focus{border-color:var(--kritzel-numeric-input-focus-border-color, #0066ff);border-width:2px;padding:7px 35px 7px 11px}.spinner-buttons{position:absolute;right:1px;top:1px;bottom:1px;display:flex;flex-direction:column;border-left:1px solid var(--kritzel-numeric-input-border-color, #ebebeb);border-radius:0 var(--kritzel-numeric-input-spinner-border-radius, 5px) var(--kritzel-numeric-input-spinner-border-radius, 5px) 0;overflow:hidden}.spinner-button{flex:1;display:flex;align-items:center;justify-content:center;width:24px;padding:0;border:none;background-color:var(--kritzel-numeric-input-spinner-background, #f5f5f5);color:var(--kritzel-numeric-input-spinner-color, #666666);cursor:pointer;transition:background-color 150ms ease}.spinner-button:hover{background-color:var(--kritzel-numeric-input-spinner-hover-background, #ebebeb)}.spinner-button:active{background-color:var(--kritzel-numeric-input-spinner-active-background, #dddddd)}.spinner-up{border-bottom:1px solid var(--kritzel-numeric-input-border-color, #ebebeb)}.spinner-icon{width:10px;height:6px}`;
4
+
5
+ const KritzelNumericInput = /*@__PURE__*/ proxyCustomElement(class KritzelNumericInput extends H {
6
+ constructor(registerHost) {
7
+ super();
8
+ if (registerHost !== false) {
9
+ this.__registerHost();
10
+ }
11
+ this.__attachShadow();
12
+ this.valueChange = createEvent(this, "valueChange");
13
+ }
14
+ /** Current numeric value (undefined when cleared) */
15
+ value;
16
+ /** Minimum allowed value */
17
+ min = Number.MIN_SAFE_INTEGER;
18
+ /** Maximum allowed value */
19
+ max = Number.MAX_SAFE_INTEGER;
20
+ /** Step increment for the input */
21
+ step = 1;
22
+ /** Label text displayed above the input */
23
+ label = '';
24
+ /** Placeholder text shown when input is empty */
25
+ placeholder = '';
26
+ /** Emitted when the value changes (after normalization) */
27
+ valueChange;
28
+ inputValue = '';
29
+ onValueChange(newValue) {
30
+ this.inputValue = this.shouldShowEmpty(newValue) ? '' : String(newValue);
31
+ }
32
+ componentWillLoad() {
33
+ this.inputValue = this.shouldShowEmpty(this.value) ? '' : String(this.value);
34
+ }
35
+ shouldShowEmpty(value) {
36
+ return value === undefined || value === Infinity || value === -Infinity;
37
+ }
38
+ normalizeValue(raw) {
39
+ if (isNaN(raw)) {
40
+ return this.value ?? 0;
41
+ }
42
+ return Math.min(this.max, Math.max(this.min, raw));
43
+ }
44
+ getDecimalPlaces() {
45
+ const stepStr = String(this.step);
46
+ const decimalIndex = stepStr.indexOf('.');
47
+ return decimalIndex === -1 ? 0 : stepStr.length - decimalIndex - 1;
48
+ }
49
+ roundToStep(value) {
50
+ const decimals = this.getDecimalPlaces();
51
+ const factor = Math.pow(10, decimals);
52
+ return Math.round(value * factor) / factor;
53
+ }
54
+ handleInput = (event) => {
55
+ const input = event.target;
56
+ this.inputValue = input.value;
57
+ };
58
+ handleBlur = () => {
59
+ this.commitValue();
60
+ };
61
+ handleKeyDown = (event) => {
62
+ if (event.key === 'Enter') {
63
+ this.commitValue();
64
+ }
65
+ };
66
+ handleInvalid = (event) => {
67
+ event.preventDefault();
68
+ };
69
+ commitValue() {
70
+ if (this.inputValue.trim() === '') {
71
+ this.value = undefined;
72
+ this.valueChange.emit(undefined);
73
+ return;
74
+ }
75
+ const parsed = parseFloat(this.inputValue);
76
+ const normalized = this.normalizeValue(parsed);
77
+ this.value = normalized;
78
+ this.inputValue = String(normalized);
79
+ this.valueChange.emit(normalized);
80
+ }
81
+ handleIncrement = () => {
82
+ // Commit current input first if needed
83
+ const currentInput = parseFloat(this.inputValue);
84
+ const currentValue = !isNaN(currentInput) ? currentInput : (this.value ?? 0);
85
+ const newValue = this.normalizeValue(this.roundToStep(currentValue + this.step));
86
+ this.value = newValue;
87
+ this.inputValue = String(newValue);
88
+ this.valueChange.emit(newValue);
89
+ };
90
+ handleDecrement = () => {
91
+ // Commit current input first if needed
92
+ const currentInput = parseFloat(this.inputValue);
93
+ const currentValue = !isNaN(currentInput) ? currentInput : (this.value ?? 0);
94
+ const newValue = this.normalizeValue(this.roundToStep(currentValue - this.step));
95
+ this.value = newValue;
96
+ this.inputValue = String(newValue);
97
+ this.valueChange.emit(newValue);
98
+ };
99
+ render() {
100
+ return (h(Host, { key: 'eb766b22717d856d096bd1a4a44279f6ac994892' }, h("div", { key: '2394e2b2af48f560e77e7a37b34d00656b0dd344', class: "input-container" }, this.label && h("label", { key: 'd8889aa93d4a86fa841f4da1f0b97411ab039cb1', class: "input-label" }, this.label), h("div", { key: 'b55ae2edf164cdfcdda356119b148c8bfb8fbd24', class: "input-wrapper" }, h("input", { key: 'ee1f1663f19c5ca66d64b6c5142005da318e03e4', type: "number", class: "numeric-input", title: "", min: this.min === Number.MIN_SAFE_INTEGER ? undefined : this.min, max: this.max === Number.MAX_SAFE_INTEGER ? undefined : this.max, step: this.step, value: this.inputValue, placeholder: this.placeholder, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, onInvalid: this.handleInvalid }), h("div", { key: '82e127b045e631616e6368c437473bbf9732445d', class: "spinner-buttons" }, h("button", { key: 'e7412dffccbdacbb5743ae2e2e7bd33c68e6fceb', type: "button", class: "spinner-button spinner-up", onClick: this.handleIncrement, tabIndex: -1, "aria-label": "Increase value" }, h("svg", { key: '7e471bf2bee5d4d161fea2e838b26e2f28bb84d9', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: '69e4c80eed03b2ee2a044d07f35420b7618f4e75', d: "M1 5L5 1L9 5", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: 'a0c2350d48c398f7396cebd973438c0e390d0aff', type: "button", class: "spinner-button spinner-down", onClick: this.handleDecrement, tabIndex: -1, "aria-label": "Decrease value" }, h("svg", { key: 'c1f6264d187936d5eb0cc43c0275dc2e2c93b854', viewBox: "0 0 10 6", class: "spinner-icon" }, h("path", { key: 'facbdd171b43868ec41b469b0d11d6c9bfcec3aa', d: "M1 1L5 5L9 1", stroke: "currentColor", "stroke-width": "1.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
101
+ }
102
+ static get watchers() { return {
103
+ "value": [{
104
+ "onValueChange": 0
105
+ }]
106
+ }; }
107
+ static get style() { return kritzelNumericInputCss(); }
108
+ }, [513, "kritzel-numeric-input", {
109
+ "value": [1026],
110
+ "min": [2],
111
+ "max": [2],
112
+ "step": [2],
113
+ "label": [1],
114
+ "placeholder": [1],
115
+ "inputValue": [32]
116
+ }, undefined, {
117
+ "value": [{
118
+ "onValueChange": 0
119
+ }]
120
+ }]);
121
+ function defineCustomElement() {
122
+ if (typeof customElements === "undefined") {
123
+ return;
124
+ }
125
+ const components = ["kritzel-numeric-input"];
126
+ components.forEach(tagName => { switch (tagName) {
127
+ case "kritzel-numeric-input":
128
+ if (!customElements.get(transformTag(tagName))) {
129
+ customElements.define(transformTag(tagName), KritzelNumericInput);
130
+ }
131
+ break;
132
+ } });
133
+ }
134
+
135
+ export { KritzelNumericInput as K, defineCustomElement as d };
@@ -1 +1,7 @@
1
- var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{e as c,n as g}
1
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
7
+ export { commonjsGlobal as c, getDefaultExportFromCjs as g };
@@ -1 +1,56 @@
1
- import{p as e,H as t,c as l,h as r,d as i,t as o}from"./p-B43upypT.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.valueChange=l(this,"valueChange")}value="transparent";valueChange;handleFillChange(e){this.value=e,this.valueChange.emit(e)}renderFillIcon(e){const t="var(--kritzel-global-text-primary)";return r("svg",{viewBox:"0 0 24 24",class:"fill-icon"},r("rect","transparent"===e?{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"none",stroke:t,"stroke-width":"2"}:{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:t,stroke:t,"stroke-width":"2"}))}render(){return r(i,{key:"6d38a9af2e4c4c7f86ab994c63fc074007c86b48"},r("div",{key:"cf58f26cb0e56e274873d11024209c6908d317bb",class:"fill-row"},r("button",{key:"c75eed70fe0c2fcbf0fd136bb6fce75b2dbfb45d",class:{"fill-option":!0,selected:"transparent"===this.value},onClick:()=>this.handleFillChange("transparent"),title:"Transparent background"},this.renderFillIcon("transparent")),r("button",{key:"5d6ede439b5d5e55598cd8c20b5851fb9f210463",class:{"fill-option":!0,selected:"filled"===this.value},onClick:()=>this.handleFillChange("filled"),title:"Filled background"},this.renderFillIcon("filled"))))}static get style(){return":host{display:flex;flex-direction:column;gap:12px;padding:0;box-sizing:border-box}.fill-row{display:flex;align-items:center;gap:4px}.fill-option{display:flex;justify-content:center;align-items:center;width:48px;height:32px;border-radius:6px;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;background:var(--kritzel-shape-fill-option-background, #ffffff);padding:4px;transition:background-color 0.15s ease, border-color 0.15s ease}.fill-option:hover{background-color:var(--kritzel-shape-fill-hover-background-color, #ebebeb)}.fill-option.selected{border-color:var(--kritzel-selection-border-color, #007AFF);background-color:var(--kritzel-shape-fill-selected-background-color, #ebebeb)}.fill-option:focus{outline:none;box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}.fill-icon{width:100%;height:100%}"}},[513,"kritzel-shape-fill",{value:[1025]}]);function n(){"undefined"!=typeof customElements&&["kritzel-shape-fill"].forEach((e=>{"kritzel-shape-fill"===e&&(customElements.get(o(e))||customElements.define(o(e),s))}))}export{s as K,n as d}
1
+ import { p as proxyCustomElement, H, c as createEvent, h, d as Host, t as transformTag } from './p-B43upypT.js';
2
+
3
+ const kritzelShapeFillCss = () => `:host{display:flex;flex-direction:column;gap:12px;padding:0;box-sizing:border-box}.fill-row{display:flex;align-items:center;gap:4px}.fill-option{display:flex;justify-content:center;align-items:center;width:48px;height:32px;border-radius:6px;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;background:var(--kritzel-shape-fill-option-background, #ffffff);padding:4px;transition:background-color 0.15s ease, border-color 0.15s ease}.fill-option:hover{background-color:var(--kritzel-shape-fill-hover-background-color, #ebebeb)}.fill-option.selected{border-color:var(--kritzel-selection-border-color, #007AFF);background-color:var(--kritzel-shape-fill-selected-background-color, #ebebeb)}.fill-option:focus{outline:none;box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}.fill-icon{width:100%;height:100%}`;
4
+
5
+ const KritzelShapeFill = /*@__PURE__*/ proxyCustomElement(class KritzelShapeFill extends H {
6
+ constructor(registerHost) {
7
+ super();
8
+ if (registerHost !== false) {
9
+ this.__registerHost();
10
+ }
11
+ this.__attachShadow();
12
+ this.valueChange = createEvent(this, "valueChange");
13
+ }
14
+ /** Current fill type */
15
+ value = 'transparent';
16
+ valueChange;
17
+ handleFillChange(type) {
18
+ this.value = type;
19
+ this.valueChange.emit(type);
20
+ }
21
+ renderFillIcon(type) {
22
+ const strokeColor = 'var(--kritzel-global-text-primary)';
23
+ if (type === 'transparent') {
24
+ return (h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: "none", stroke: strokeColor, "stroke-width": "2" })));
25
+ }
26
+ // Filled
27
+ return (h("svg", { viewBox: "0 0 24 24", class: "fill-icon" }, h("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", fill: strokeColor, stroke: strokeColor, "stroke-width": "2" })));
28
+ }
29
+ render() {
30
+ return (h(Host, { key: '6d38a9af2e4c4c7f86ab994c63fc074007c86b48' }, h("div", { key: 'cf58f26cb0e56e274873d11024209c6908d317bb', class: "fill-row" }, h("button", { key: 'c75eed70fe0c2fcbf0fd136bb6fce75b2dbfb45d', class: {
31
+ 'fill-option': true,
32
+ 'selected': this.value === 'transparent',
33
+ }, onClick: () => this.handleFillChange('transparent'), title: "Transparent background" }, this.renderFillIcon('transparent')), h("button", { key: '5d6ede439b5d5e55598cd8c20b5851fb9f210463', class: {
34
+ 'fill-option': true,
35
+ 'selected': this.value === 'filled',
36
+ }, onClick: () => this.handleFillChange('filled'), title: "Filled background" }, this.renderFillIcon('filled')))));
37
+ }
38
+ static get style() { return kritzelShapeFillCss(); }
39
+ }, [513, "kritzel-shape-fill", {
40
+ "value": [1025]
41
+ }]);
42
+ function defineCustomElement() {
43
+ if (typeof customElements === "undefined") {
44
+ return;
45
+ }
46
+ const components = ["kritzel-shape-fill"];
47
+ components.forEach(tagName => { switch (tagName) {
48
+ case "kritzel-shape-fill":
49
+ if (!customElements.get(transformTag(tagName))) {
50
+ customElements.define(transformTag(tagName), KritzelShapeFill);
51
+ }
52
+ break;
53
+ } });
54
+ }
55
+
56
+ export { KritzelShapeFill as K, defineCustomElement as d };
@@ -1 +1,62 @@
1
- import{p as e,H as t,c as i,h as s,d as r,t as o}from"./p-B43upypT.js";import{d as n}from"./p-B8Xi4Clg.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.sizeChange=i(this,"sizeChange")}sizes=[8,10,12,16,20,24];selectedSize=null;fontFamily="Arial";sizeChange;handleSizeClick(e){this.selectedSize=e,this.sizeChange.emit(e)}handleKeyDown(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleSizeClick(t))}render(){return s(r,{key:"298b8c232c4d96583f4899efea86482ae8ebd319"},(this.sizes??[]).map((e=>s("div",{tabIndex:0,class:{"size-container":!0,selected:this.selectedSize===e},onClick:()=>this.handleSizeClick(e),onKeyDown:t=>this.handleKeyDown(t,e)},s("kritzel-font",{fontFamily:this.fontFamily,size:e,color:"var(--kritzel-global-text-primary)"})))))}static get style(){return":host{display:flex;align-items:flex-start;gap:8px;padding:0;box-sizing:border-box}.size-container{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:4px;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;border-radius:50%}.size-container:hover{background-color:var(--kritzel-font-size-hover-background-color, #ebebeb)}.size-container.selected{border-color:var(--kritzel-selection-border-color, #007AFF);background-color:var(--kritzel-font-size-selected-background-color, #e0e0e0)}"}},[513,"kritzel-font-size",{sizes:[16],selectedSize:[1026,"selected-size"],fontFamily:[1,"font-family"]}]);function a(){"undefined"!=typeof customElements&&["kritzel-font-size","kritzel-font"].forEach((e=>{switch(e){case"kritzel-font-size":customElements.get(o(e))||customElements.define(o(e),l);break;case"kritzel-font":customElements.get(o(e))||n()}}))}export{l as K,a as d}
1
+ import { p as proxyCustomElement, H, c as createEvent, h, d as Host, t as transformTag } from './p-B43upypT.js';
2
+ import { d as defineCustomElement$1 } from './p-B8Xi4Clg.js';
3
+
4
+ const kritzelFontSizeCss = () => `:host{display:flex;align-items:flex-start;gap:8px;padding:0;box-sizing:border-box}.size-container{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:4px;cursor:var(--kritzel-global-pointer-cursor, pointer);border:2px solid transparent;box-sizing:border-box;border-radius:50%}.size-container:hover{background-color:var(--kritzel-font-size-hover-background-color, #ebebeb)}.size-container.selected{border-color:var(--kritzel-selection-border-color, #007AFF);background-color:var(--kritzel-font-size-selected-background-color, #e0e0e0)}`;
5
+
6
+ const KritzelFontSize = /*@__PURE__*/ proxyCustomElement(class KritzelFontSize extends H {
7
+ constructor(registerHost) {
8
+ super();
9
+ if (registerHost !== false) {
10
+ this.__registerHost();
11
+ }
12
+ this.__attachShadow();
13
+ this.sizeChange = createEvent(this, "sizeChange");
14
+ }
15
+ sizes = [8, 10, 12, 16, 20, 24];
16
+ selectedSize = null;
17
+ fontFamily = 'Arial';
18
+ sizeChange;
19
+ handleSizeClick(size) {
20
+ this.selectedSize = size;
21
+ this.sizeChange.emit(size);
22
+ }
23
+ handleKeyDown(event, size) {
24
+ if (event.key === 'Enter' || event.key === ' ') {
25
+ event.preventDefault();
26
+ this.handleSizeClick(size);
27
+ }
28
+ }
29
+ render() {
30
+ const color = 'var(--kritzel-global-text-primary)';
31
+ const sizes = this.sizes ?? [];
32
+ return (h(Host, { key: '298b8c232c4d96583f4899efea86482ae8ebd319' }, sizes.map(size => (h("div", { tabIndex: 0, class: {
33
+ 'size-container': true,
34
+ 'selected': this.selectedSize === size,
35
+ }, onClick: () => this.handleSizeClick(size), onKeyDown: event => this.handleKeyDown(event, size) }, h("kritzel-font", { fontFamily: this.fontFamily, size: size, color: color }))))));
36
+ }
37
+ static get style() { return kritzelFontSizeCss(); }
38
+ }, [513, "kritzel-font-size", {
39
+ "sizes": [16],
40
+ "selectedSize": [1026, "selected-size"],
41
+ "fontFamily": [1, "font-family"]
42
+ }]);
43
+ function defineCustomElement() {
44
+ if (typeof customElements === "undefined") {
45
+ return;
46
+ }
47
+ const components = ["kritzel-font-size", "kritzel-font"];
48
+ components.forEach(tagName => { switch (tagName) {
49
+ case "kritzel-font-size":
50
+ if (!customElements.get(transformTag(tagName))) {
51
+ customElements.define(transformTag(tagName), KritzelFontSize);
52
+ }
53
+ break;
54
+ case "kritzel-font":
55
+ if (!customElements.get(transformTag(tagName))) {
56
+ defineCustomElement$1();
57
+ }
58
+ break;
59
+ } });
60
+ }
61
+
62
+ export { KritzelFontSize as K, defineCustomElement as d };
@@ -1 +1,194 @@
1
- import{p as t,H as i,c as e,h as s,d as o,t as n}from"./p-B43upypT.js";import{K as l}from"./p-WUdQqYnu.js";const h=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tooltipClosed=e(this,"tooltipClosed"),this.tooltipOpened=e(this,"tooltipOpened")}get host(){return this}isVisible=!1;anchorElement;triggerElement;offsetY=24;tooltipClosed;tooltipOpened;positionX=0;positionY=0;handleOutsideClick(t){if(!this.isVisible)return;const i=t.composedPath(),e=i.some((t=>t===this.host)),s=this.triggerElement&&i.some((t=>t===this.triggerElement));e||s||this.close()}handleOutsidePointerDown(t){if(!this.isVisible)return;const i=t.composedPath(),e=i.some((t=>t===this.host)),s=this.triggerElement&&i.some((t=>t===this.triggerElement));e||s||(t.stopPropagation(),t.preventDefault(),this.close())}handleCloseAll(t){t.detail!==this.host&&this.close()}handleWindowResize(){this.calculateAdjustedPosition()}handleTriggerElementChange(t,i){i&&i.removeEventListener("click",this.handleTriggerClick),t&&t.addEventListener("click",this.handleTriggerClick)}handleVisibilityChange(t){t&&(this.calculateAdjustedPosition(),requestAnimationFrame((()=>{this.focusContent()})))}async open(){this.isVisible||(document.dispatchEvent(new CustomEvent("kritzelTooltipCloseAll",{detail:this.host})),this.isVisible=!0,this.tooltipOpened.emit())}async close(){this.isVisible&&(this.isVisible=!1,this.tooltipClosed.emit())}async toggle(){this.isVisible?this.close():this.open()}async focusContent(){const t=l.getFocusableElements(this.host);t.length>0&&t[0].focus()}connectedCallback(){this.triggerElement&&this.triggerElement.addEventListener("click",this.handleTriggerClick)}componentDidLoad(){this.triggerElement&&this.triggerElement.addEventListener("click",this.handleTriggerClick)}componentWillLoad(){this.calculateAdjustedPosition()}componentWillUpdate(){this.calculateAdjustedPosition()}disconnectedCallback(){this.triggerElement&&this.triggerElement.removeEventListener("click",this.handleTriggerClick)}handleTriggerClick=t=>{t.stopPropagation(),this.toggle()};calculateAdjustedPosition(){if(this.isVisible&&this.anchorElement){const t=this.anchorElement.getBoundingClientRect(),i=this.host.shadowRoot?.querySelector(".tooltip-content"),e=i?.getBoundingClientRect(),s=e?.width||0,o=12,n=window.innerWidth-s-o;this.positionX=Math.max(o,Math.min(t.left+t.width/2-s/2,n)),this.positionY=window.innerHeight-t.top+this.offsetY}}render(){return s(o,{key:"c0a4b682b3279b8c830dfa758284979e91c0ce2a",style:{position:"fixed",zIndex:"9999",transition:"opacity 0.3s ease-in-out, transform 0.3s ease-in-out",visibility:this.isVisible?"visible":"hidden",left:`${this.positionX}px`,bottom:`${this.positionY}px`}},s("div",{key:"09fd259d19d42db513161b645aa19206ae81c76a",class:"tooltip-content",onClick:t=>t.stopPropagation(),onPointerDown:t=>t.stopPropagation(),onMouseDown:t=>t.stopPropagation()},s("slot",{key:"f743c0ca8c415d71e0af53cdab8304df60dd9a37"})))}static get watchers(){return{triggerElement:[{handleTriggerElementChange:0}],isVisible:[{handleVisibilityChange:0}]}}static get style(){return":host{width:auto}.tooltip-content{position:relative;padding:8px 12px;border-radius:4px;width:fit-content;background-color:var(--kritzel-tooltip-background-color, #ffffff);color:var(--kritzel-tooltip-color, #000000);padding:var(--kritzel-tooltip-padding, 12px);border:var(--kritzel-tooltip-border, 1px solid #ebebeb);border-radius:var(--kritzel-tooltip-border-radius, 16px);white-space:nowrap;box-shadow:var(--kritzel-tooltip-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12))}"}},[769,"kritzel-tooltip",{isVisible:[1028,"is-visible"],anchorElement:[16],triggerElement:[16],offsetY:[2,"offset-y"],positionX:[32],positionY:[32],open:[64],close:[64],toggle:[64],focusContent:[64]},[[4,"click","handleOutsideClick"],[6,"pointerdown","handleOutsidePointerDown"],[4,"kritzelTooltipCloseAll","handleCloseAll"],[9,"resize","handleWindowResize"]],{triggerElement:[{handleTriggerElementChange:0}],isVisible:[{handleVisibilityChange:0}]}]);function a(){"undefined"!=typeof customElements&&["kritzel-tooltip"].forEach((t=>{"kritzel-tooltip"===t&&(customElements.get(n(t))||customElements.define(n(t),h))}))}export{h as K,a as d}
1
+ import { p as proxyCustomElement, H, c as createEvent, h, d as Host, t as transformTag } from './p-B43upypT.js';
2
+ import { K as KritzelHTMLHelper } from './p-WUdQqYnu.js';
3
+
4
+ const kritzelTooltipCss = () => `:host{width:auto}.tooltip-content{position:relative;padding:8px 12px;border-radius:4px;width:fit-content;background-color:var(--kritzel-tooltip-background-color, #ffffff);color:var(--kritzel-tooltip-color, #000000);padding:var(--kritzel-tooltip-padding, 12px);border:var(--kritzel-tooltip-border, 1px solid #ebebeb);border-radius:var(--kritzel-tooltip-border-radius, 16px);white-space:nowrap;box-shadow:var(--kritzel-tooltip-box-shadow, 0 1px 6px rgba(0, 0, 0, 0.12))}`;
5
+
6
+ const KritzelTooltip = /*@__PURE__*/ proxyCustomElement(class KritzelTooltip extends H {
7
+ constructor(registerHost) {
8
+ super();
9
+ if (registerHost !== false) {
10
+ this.__registerHost();
11
+ }
12
+ this.__attachShadow();
13
+ this.tooltipClosed = createEvent(this, "tooltipClosed");
14
+ this.tooltipOpened = createEvent(this, "tooltipOpened");
15
+ }
16
+ get host() { return this; }
17
+ isVisible = false;
18
+ anchorElement;
19
+ triggerElement;
20
+ offsetY = 24;
21
+ tooltipClosed;
22
+ tooltipOpened;
23
+ positionX = 0;
24
+ positionY = 0;
25
+ handleOutsideClick(event) {
26
+ if (!this.isVisible)
27
+ return;
28
+ const path = event.composedPath();
29
+ const isInsideTooltip = path.some(el => el === this.host);
30
+ const isOnTrigger = this.triggerElement && path.some(el => el === this.triggerElement);
31
+ if (!isInsideTooltip && !isOnTrigger) {
32
+ this.close();
33
+ }
34
+ }
35
+ handleOutsidePointerDown(event) {
36
+ if (!this.isVisible)
37
+ return;
38
+ const path = event.composedPath();
39
+ const isInsideTooltip = path.some(el => el === this.host);
40
+ const isOnTrigger = this.triggerElement && path.some(el => el === this.triggerElement);
41
+ if (!isInsideTooltip && !isOnTrigger) {
42
+ event.stopPropagation();
43
+ event.preventDefault();
44
+ this.close();
45
+ }
46
+ }
47
+ handleCloseAll(event) {
48
+ if (event.detail !== this.host) {
49
+ this.close();
50
+ }
51
+ }
52
+ handleWindowResize() {
53
+ this.calculateAdjustedPosition();
54
+ }
55
+ handleTriggerElementChange(newTrigger, oldTrigger) {
56
+ if (oldTrigger) {
57
+ oldTrigger.removeEventListener('click', this.handleTriggerClick);
58
+ }
59
+ if (newTrigger) {
60
+ newTrigger.addEventListener('click', this.handleTriggerClick);
61
+ }
62
+ }
63
+ handleVisibilityChange(newValue) {
64
+ if (newValue) {
65
+ this.calculateAdjustedPosition();
66
+ requestAnimationFrame(() => {
67
+ this.focusContent();
68
+ });
69
+ }
70
+ }
71
+ async open() {
72
+ if (this.isVisible)
73
+ return;
74
+ document.dispatchEvent(new CustomEvent('kritzelTooltipCloseAll', { detail: this.host }));
75
+ this.isVisible = true;
76
+ this.tooltipOpened.emit();
77
+ }
78
+ async close() {
79
+ if (!this.isVisible)
80
+ return;
81
+ this.isVisible = false;
82
+ this.tooltipClosed.emit();
83
+ }
84
+ async toggle() {
85
+ if (this.isVisible) {
86
+ this.close();
87
+ }
88
+ else {
89
+ this.open();
90
+ }
91
+ }
92
+ async focusContent() {
93
+ const focusableElements = KritzelHTMLHelper.getFocusableElements(this.host);
94
+ if (focusableElements.length > 0) {
95
+ focusableElements[0].focus();
96
+ }
97
+ }
98
+ connectedCallback() {
99
+ if (this.triggerElement) {
100
+ this.triggerElement.addEventListener('click', this.handleTriggerClick);
101
+ }
102
+ }
103
+ componentDidLoad() {
104
+ if (this.triggerElement) {
105
+ this.triggerElement.addEventListener('click', this.handleTriggerClick);
106
+ }
107
+ }
108
+ componentWillLoad() {
109
+ this.calculateAdjustedPosition();
110
+ }
111
+ componentWillUpdate() {
112
+ this.calculateAdjustedPosition();
113
+ }
114
+ disconnectedCallback() {
115
+ if (this.triggerElement) {
116
+ this.triggerElement.removeEventListener('click', this.handleTriggerClick);
117
+ }
118
+ }
119
+ handleTriggerClick = (event) => {
120
+ event.stopPropagation();
121
+ this.toggle();
122
+ };
123
+ calculateAdjustedPosition() {
124
+ if (this.isVisible && this.anchorElement) {
125
+ const anchorRect = this.anchorElement.getBoundingClientRect();
126
+ const tooltipContent = this.host.shadowRoot?.querySelector('.tooltip-content');
127
+ const tooltipRect = tooltipContent?.getBoundingClientRect();
128
+ const tooltipWidth = tooltipRect?.width || 0;
129
+ const viewportPadding = 12; // Minimum distance from viewport edges
130
+ const anchorCenterX = anchorRect.left + anchorRect.width / 2;
131
+ // Step 1: Try to center the tooltip above the anchor
132
+ let idealLeft = anchorCenterX - tooltipWidth / 2;
133
+ // Step 2: Clamp to viewport bounds
134
+ const minLeft = viewportPadding;
135
+ const maxLeft = window.innerWidth - tooltipWidth - viewportPadding;
136
+ // Apply clamping - adjust if tooltip would overflow
137
+ this.positionX = Math.max(minLeft, Math.min(idealLeft, maxLeft));
138
+ // Step 3: Calculate bottom position (distance from viewport bottom to top of anchor + offset)
139
+ this.positionY = window.innerHeight - anchorRect.top + this.offsetY;
140
+ }
141
+ }
142
+ render() {
143
+ return (h(Host, { key: 'c0a4b682b3279b8c830dfa758284979e91c0ce2a', style: {
144
+ position: 'fixed',
145
+ zIndex: '9999',
146
+ transition: 'opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
147
+ visibility: this.isVisible ? 'visible' : 'hidden',
148
+ left: `${this.positionX}px`,
149
+ bottom: `${this.positionY}px`,
150
+ } }, h("div", { key: '09fd259d19d42db513161b645aa19206ae81c76a', class: "tooltip-content", onClick: event => event.stopPropagation(), onPointerDown: event => event.stopPropagation(), onMouseDown: event => event.stopPropagation() }, h("slot", { key: 'f743c0ca8c415d71e0af53cdab8304df60dd9a37' }))));
151
+ }
152
+ static get watchers() { return {
153
+ "triggerElement": [{
154
+ "handleTriggerElementChange": 0
155
+ }],
156
+ "isVisible": [{
157
+ "handleVisibilityChange": 0
158
+ }]
159
+ }; }
160
+ static get style() { return kritzelTooltipCss(); }
161
+ }, [769, "kritzel-tooltip", {
162
+ "isVisible": [1028, "is-visible"],
163
+ "anchorElement": [16],
164
+ "triggerElement": [16],
165
+ "offsetY": [2, "offset-y"],
166
+ "positionX": [32],
167
+ "positionY": [32],
168
+ "open": [64],
169
+ "close": [64],
170
+ "toggle": [64],
171
+ "focusContent": [64]
172
+ }, [[4, "click", "handleOutsideClick"], [6, "pointerdown", "handleOutsidePointerDown"], [4, "kritzelTooltipCloseAll", "handleCloseAll"], [9, "resize", "handleWindowResize"]], {
173
+ "triggerElement": [{
174
+ "handleTriggerElementChange": 0
175
+ }],
176
+ "isVisible": [{
177
+ "handleVisibilityChange": 0
178
+ }]
179
+ }]);
180
+ function defineCustomElement() {
181
+ if (typeof customElements === "undefined") {
182
+ return;
183
+ }
184
+ const components = ["kritzel-tooltip"];
185
+ components.forEach(tagName => { switch (tagName) {
186
+ case "kritzel-tooltip":
187
+ if (!customElements.get(transformTag(tagName))) {
188
+ customElements.define(transformTag(tagName), KritzelTooltip);
189
+ }
190
+ break;
191
+ } });
192
+ }
193
+
194
+ export { KritzelTooltip as K, defineCustomElement as d };