kritzel-stencil 0.4.4 → 0.4.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.
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/components/index.js +1226 -1
- package/dist/components/kritzel-active-users.js +6 -1
- package/dist/components/kritzel-avatar.js +6 -1
- package/dist/components/kritzel-awareness-cursors.js +6 -1
- package/dist/components/kritzel-back-to-content.js +6 -1
- package/dist/components/kritzel-brush-style.js +64 -1
- package/dist/components/kritzel-button.js +6 -1
- package/dist/components/kritzel-color-palette.js +6 -1
- package/dist/components/kritzel-color.js +6 -1
- package/dist/components/kritzel-context-menu.js +6 -1
- package/dist/components/kritzel-controls.js +6 -1
- package/dist/components/kritzel-current-user-dialog.js +6 -1
- package/dist/components/kritzel-current-user.js +6 -1
- package/dist/components/kritzel-cursor-trail.js +6 -1
- package/dist/components/kritzel-dialog.js +6 -1
- package/dist/components/kritzel-dropdown.js +6 -1
- package/dist/components/kritzel-editor.js +4396 -1
- package/dist/components/kritzel-engine.js +6 -1
- package/dist/components/kritzel-export.js +6 -1
- package/dist/components/kritzel-font-family.js +6 -1
- package/dist/components/kritzel-font-size.js +6 -1
- package/dist/components/kritzel-font.js +6 -1
- package/dist/components/kritzel-icon.js +6 -1
- package/dist/components/kritzel-input.js +6 -1
- package/dist/components/kritzel-line-endings.js +6 -1
- package/dist/components/kritzel-loading-overlay.js +6 -1
- package/dist/components/kritzel-login-dialog.js +6 -1
- package/dist/components/kritzel-master-detail.js +6 -1
- package/dist/components/kritzel-menu-item.js +6 -1
- package/dist/components/kritzel-menu.js +6 -1
- package/dist/components/kritzel-more-menu.js +6 -1
- package/dist/components/kritzel-notification-card.js +6 -1
- package/dist/components/kritzel-numeric-input.js +6 -1
- package/dist/components/kritzel-opacity-slider.js +6 -1
- package/dist/components/kritzel-pill-tabs.js +6 -1
- package/dist/components/kritzel-portal.js +6 -1
- package/dist/components/kritzel-settings.js +6 -1
- package/dist/components/kritzel-shape-fill.js +6 -1
- package/dist/components/kritzel-share-dialog.js +6 -1
- package/dist/components/kritzel-slide-toggle.js +6 -1
- package/dist/components/kritzel-split-button.js +6 -1
- package/dist/components/kritzel-stroke-size.js +6 -1
- package/dist/components/kritzel-sync-indicator.js +6 -1
- package/dist/components/kritzel-tool-config.js +6 -1
- package/dist/components/kritzel-tooltip.js +6 -1
- package/dist/components/kritzel-utility-panel.js +6 -1
- package/dist/components/kritzel-watermark.js +6 -1
- package/dist/components/kritzel-workspace-manager.js +6 -1
- package/dist/components/kritzel-zoom-panel.js +6 -1
- package/dist/components/p--Oazz-BP.js +51657 -2
- package/dist/components/p-894OnDQV.js +39 -1
- package/dist/components/p-B43upypT.js +1500 -1
- package/dist/components/p-B5oHmPJb.js +97 -1
- package/dist/components/p-B6t5q-V4.js +63 -1
- package/dist/components/p-B8Xi4Clg.js +43 -1
- package/dist/components/p-BDzlx2hB.js +135 -1
- package/dist/components/p-BFTU3MAI.js +7 -1
- package/dist/components/p-BFYtCsZu.js +56 -1
- package/dist/components/p-BI2ng9I_.js +62 -1
- package/dist/components/p-BTzlrIxe.js +194 -1
- package/dist/components/p-BmyTdQGy.js +1090 -1
- package/dist/components/p-BsANVili.js +150 -1
- package/dist/components/p-BxpKq94F.js +290 -1
- package/dist/components/p-C38P-Vd0.js +446 -1
- package/dist/components/p-C4NrrUfN.js +77 -1
- package/dist/components/p-CW-VyJgK.js +6 -1
- package/dist/components/p-CWRSGYOE.js +57 -1
- package/dist/components/p-CXpv9Rxe.js +106 -1
- package/dist/components/p-Ca-igU1f.js +320 -1
- package/dist/components/p-CdR76C4L.js +165 -1
- package/dist/components/p-ClFprFvz.js +209 -1
- package/dist/components/p-Cm33td2O.js +122 -1
- package/dist/components/p-CqLgB8JK.js +91 -1
- package/dist/components/p-Cr682JI_.js +156 -1
- package/dist/components/p-CsvMgk_f.js +62 -1
- package/dist/components/p-CwJwsRR3.js +277 -1
- package/dist/components/p-Cymum41a.js +88 -1
- package/dist/components/p-D09kgc5Q.js +94 -1
- package/dist/components/p-D30zs0kA.js +121 -1
- package/dist/components/p-D3y_Hauo.js +85 -1
- package/dist/components/p-D5jf8wAu.js +142 -1
- package/dist/components/p-D82VaHce.js +53 -1
- package/dist/components/p-DAwPPDMS.js +101 -1
- package/dist/components/p-DEBwmRTC.js +55 -1
- package/dist/components/p-DIazmg6w.js +52 -1
- package/dist/components/p-DJ88BrIW.js +70 -1
- package/dist/components/p-DJkKlUyZ.js +182 -1
- package/dist/components/p-DUYmwrWV.js +3267 -1
- package/dist/components/p-DX2nriaq.js +486 -1
- package/dist/components/p-Dd-pMvlr.js +20 -1
- package/dist/components/p-Df3BwVGy.js +299 -1
- package/dist/components/p-DgJ0ufzr.js +43 -1
- package/dist/components/p-DkUb2czk.js +70 -1
- package/dist/components/p-Dlp84thc.js +57 -1
- package/dist/components/p-JYj3Facr.js +431 -1
- package/dist/components/p-Ka7OWbnk.js +2304 -1
- package/dist/components/p-PSFAfAyd.js +49 -1
- package/dist/components/p-U6uE85Qx.js +320 -0
- package/dist/components/p-WUdQqYnu.js +118 -1
- package/dist/components/p-djJSnjAX.js +84 -1
- package/dist/components/p-e6Zpc9Vp.js +143 -1
- package/dist/components/p-jGOpkGDl.js +30 -1
- package/dist/components/p-pagW8YF7.js +99 -1
- package/dist/esm/kritzel-active-users_47.entry.js +1 -1
- package/dist/stencil/index.esm.js +1172 -1
- package/dist/stencil/p-4463dade.entry.js +36043 -0
- package/dist/stencil/p-DQuL1Twl.js +3 -1
- package/dist/stencil/p-Dhio9uis.js +1717 -2
- package/dist/stencil/p-fb32cd8f.entry.js +29 -1
- package/dist/stencil/p-uC7_X6yr.js +30737 -1
- package/dist/stencil/stencil.esm.js +21 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-Xsiz1D5Q.js +0 -1
- package/dist/stencil/p-9abc21b9.entry.js +0 -9
|
@@ -1 +1,97 @@
|
|
|
1
|
-
import{p as
|
|
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$2 } from './p-DX2nriaq.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './p-CdR76C4L.js';
|
|
4
|
+
|
|
5
|
+
const kritzelLoginDialogCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-width-small:380px}.login-content{display:flex;flex-direction:column;gap:20px}.login-subtitle{font-size:13px;color:var(--kritzel-login-dialog-subtitle-color, #666666);margin:0;line-height:1.5;text-align:center}.login-providers{display:flex;flex-direction:column;gap:10px}.provider-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 16px;border:1px solid var(--kritzel-login-dialog-button-border-color, #e0e0e0);border-radius:8px;background:var(--kritzel-login-dialog-button-background, #ffffff);color:var(--kritzel-login-dialog-button-text-color, #333333);font-size:14px;font-weight:500;font-family:inherit;cursor:var(--kritzel-global-pointer-cursor, pointer);transition:background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;-webkit-tap-highlight-color:transparent}.provider-button:hover:not(:disabled){background:var(--kritzel-login-dialog-button-hover-background, #f5f5f5);border-color:var(--kritzel-login-dialog-button-hover-border-color, #cccccc)}.provider-button:active:not(:disabled){background:var(--kritzel-login-dialog-button-active-background, #ebebeb)}.provider-button:focus-visible{outline:revert;outline-offset:revert}.provider-button.is-disabled{opacity:0.5;cursor:default;pointer-events:none}.provider-button.is-loading{cursor:default}.provider-label{flex-shrink:0}.provider-button.is-loading .provider-label{opacity:0.7}@keyframes kritzel-login-spin{to{transform:rotate(360deg)}}.spinner{width:20px;height:20px;box-sizing:border-box;display:block;flex-shrink:0;border:2px solid var(--kritzel-login-dialog-spinner-color, #cccccc);border-top-color:var(--kritzel-login-dialog-spinner-active-color, #333333);border-radius:50%;animation:kritzel-login-spin 0.6s linear infinite}`;
|
|
6
|
+
|
|
7
|
+
const KritzelLoginDialog = /*@__PURE__*/ proxyCustomElement(class KritzelLoginDialog extends H {
|
|
8
|
+
constructor(registerHost) {
|
|
9
|
+
super();
|
|
10
|
+
if (registerHost !== false) {
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
}
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.providerLogin = createEvent(this, "providerLogin");
|
|
15
|
+
this.dialogClosed = createEvent(this, "dialogClosed");
|
|
16
|
+
}
|
|
17
|
+
get host() { return this; }
|
|
18
|
+
/** Array of authentication provider buttons to render */
|
|
19
|
+
providers = [];
|
|
20
|
+
/** Dialog title */
|
|
21
|
+
dialogTitle = 'Sign in';
|
|
22
|
+
/** Optional subtitle text displayed below the title */
|
|
23
|
+
subtitle;
|
|
24
|
+
isDialogOpen = false;
|
|
25
|
+
loadingProvider = null;
|
|
26
|
+
/** Emitted when a provider button is clicked */
|
|
27
|
+
providerLogin;
|
|
28
|
+
/** Emitted when the dialog is closed */
|
|
29
|
+
dialogClosed;
|
|
30
|
+
/** Opens the login dialog */
|
|
31
|
+
async open() {
|
|
32
|
+
this.loadingProvider = null;
|
|
33
|
+
this.isDialogOpen = true;
|
|
34
|
+
}
|
|
35
|
+
/** Closes the login dialog */
|
|
36
|
+
async close() {
|
|
37
|
+
this.isDialogOpen = false;
|
|
38
|
+
this.loadingProvider = null;
|
|
39
|
+
}
|
|
40
|
+
/** Sets or clears the loading state on a provider button */
|
|
41
|
+
async setLoading(provider) {
|
|
42
|
+
this.loadingProvider = provider;
|
|
43
|
+
}
|
|
44
|
+
handleProviderClick = (provider) => {
|
|
45
|
+
if (this.loadingProvider)
|
|
46
|
+
return;
|
|
47
|
+
this.loadingProvider = provider.name;
|
|
48
|
+
this.providerLogin.emit({ provider: provider.name });
|
|
49
|
+
};
|
|
50
|
+
closeDialog = () => {
|
|
51
|
+
this.isDialogOpen = false;
|
|
52
|
+
this.loadingProvider = null;
|
|
53
|
+
this.dialogClosed.emit();
|
|
54
|
+
};
|
|
55
|
+
render() {
|
|
56
|
+
return (h(Host, { key: 'd2b393ac37292a0cf88d0e18e9768ca666b238b2' }, h("kritzel-dialog", { key: '6e302e9030b5da0baf307fe261285e484b3c1f08', dialogTitle: this.dialogTitle, isOpen: this.isDialogOpen, onDialogClose: this.closeDialog, size: "small", contained: true }, h("div", { key: 'f32b073d70acb3874dc3ab4c3905543067a543d8', class: "login-content" }, this.subtitle && (h("p", { key: '42a6ec7d6c9ca0a14700bd13cbe8ee9edbbcc18b', class: "login-subtitle" }, this.subtitle)), h("div", { key: 'cbb5497abd1c88fc364ac8bb7c3d356df6df0dad', class: "login-providers" }, this.providers.map(provider => (h("button", { key: provider.name, class: {
|
|
57
|
+
'provider-button': true,
|
|
58
|
+
'is-loading': this.loadingProvider === provider.name,
|
|
59
|
+
'is-disabled': this.loadingProvider !== null && this.loadingProvider !== provider.name,
|
|
60
|
+
}, disabled: this.loadingProvider !== null && this.loadingProvider !== provider.name, onClick: () => this.handleProviderClick(provider) }, this.loadingProvider === provider.name ? (h("span", { class: "spinner" })) : (provider.icon && h("kritzel-icon", { name: provider.icon, size: 20 })), h("span", { class: "provider-label" }, provider.label)))))))));
|
|
61
|
+
}
|
|
62
|
+
static get style() { return kritzelLoginDialogCss(); }
|
|
63
|
+
}, [513, "kritzel-login-dialog", {
|
|
64
|
+
"providers": [16],
|
|
65
|
+
"dialogTitle": [1, "dialog-title"],
|
|
66
|
+
"subtitle": [1],
|
|
67
|
+
"isDialogOpen": [32],
|
|
68
|
+
"loadingProvider": [32],
|
|
69
|
+
"open": [64],
|
|
70
|
+
"close": [64],
|
|
71
|
+
"setLoading": [64]
|
|
72
|
+
}]);
|
|
73
|
+
function defineCustomElement() {
|
|
74
|
+
if (typeof customElements === "undefined") {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const components = ["kritzel-login-dialog", "kritzel-dialog", "kritzel-icon"];
|
|
78
|
+
components.forEach(tagName => { switch (tagName) {
|
|
79
|
+
case "kritzel-login-dialog":
|
|
80
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
81
|
+
customElements.define(transformTag(tagName), KritzelLoginDialog);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case "kritzel-dialog":
|
|
85
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
86
|
+
defineCustomElement$2();
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case "kritzel-icon":
|
|
90
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
91
|
+
defineCustomElement$1();
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
} });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { KritzelLoginDialog as K, defineCustomElement as d };
|
|
@@ -1 +1,63 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, d as Host, t as transformTag } from './p-B43upypT.js';
|
|
2
|
+
|
|
3
|
+
const kritzelOpacitySliderCss = () => `:host{display:flex;flex-direction:column;padding:0;box-sizing:border-box}.opacity-container{display:flex;align-items:center;width:232px}.slider-wrapper{flex:1;display:flex;align-items:center}.opacity-slider{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:3px;background:linear-gradient( to right, var(--kritzel-opacity-slider-active-color, #007AFF) 0%, var(--kritzel-opacity-slider-active-color, #007AFF) var(--slider-progress, 100%), var(--kritzel-opacity-slider-track-color, #e0e0e0) var(--slider-progress, 100%), var(--kritzel-opacity-slider-track-color, #e0e0e0) 100% );outline:none;cursor:var(--kritzel-global-pointer-cursor, pointer)}.opacity-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--kritzel-opacity-slider-thumb-color, #ffffff);border:2px solid var(--kritzel-opacity-slider-thumb-border-color, #007AFF);cursor:var(--kritzel-global-pointer-cursor, pointer);box-shadow:0 1px 3px rgba(0, 0, 0, 0.2);transition:transform 0.1s ease}.opacity-slider::-webkit-slider-thumb:hover{transform:scale(1.1)}.opacity-slider::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--kritzel-opacity-slider-thumb-color, #ffffff);border:2px solid var(--kritzel-opacity-slider-thumb-border-color, #007AFF);cursor:var(--kritzel-global-pointer-cursor, pointer);box-shadow:0 1px 3px rgba(0, 0, 0, 0.2);transition:transform 0.1s ease}.opacity-slider::-moz-range-thumb:hover{transform:scale(1.1)}.opacity-slider::-moz-range-track{height:6px;border-radius:3px;background:transparent}.opacity-slider:focus{outline:none}.opacity-slider:focus::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}.opacity-slider:focus::-moz-range-thumb{box-shadow:0 0 0 2px var(--kritzel-global-focus-ring-color, rgba(0, 122, 255, 0.3))}`;
|
|
4
|
+
|
|
5
|
+
const KritzelOpacitySlider = /*@__PURE__*/ proxyCustomElement(class KritzelOpacitySlider 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 opacity value (0 to 1) */
|
|
15
|
+
value = 1;
|
|
16
|
+
/** Minimum opacity value */
|
|
17
|
+
min = 0;
|
|
18
|
+
/** Maximum opacity value */
|
|
19
|
+
max = 1;
|
|
20
|
+
/** Step increment */
|
|
21
|
+
step = 0.01;
|
|
22
|
+
/** Color to display in the preview (optional) */
|
|
23
|
+
previewColor = '#000000';
|
|
24
|
+
valueChange;
|
|
25
|
+
handleInput(event) {
|
|
26
|
+
const input = event.target;
|
|
27
|
+
const newValue = parseFloat(input.value);
|
|
28
|
+
this.value = newValue;
|
|
29
|
+
this.valueChange.emit(newValue);
|
|
30
|
+
}
|
|
31
|
+
getPercentage() {
|
|
32
|
+
return Math.round(this.value * 100);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
const percentage = this.getPercentage();
|
|
36
|
+
return (h(Host, { key: 'a175945928dac5ae5b4464c0b11c4d812f8a3ef6' }, h("div", { key: 'a045d452d459577f8d657e00dd9189797dd4de66', class: "opacity-container" }, h("div", { key: '11a4217a4b6e1f0b1981a8fd8e03f505a9d4a3b5', class: "slider-wrapper" }, h("input", { key: '2cbf72a10026c4201727208230b8832ea2309a76', type: "range", class: "opacity-slider", min: this.min, max: this.max, step: this.step, value: this.value, onInput: (e) => this.handleInput(e), style: {
|
|
37
|
+
'--slider-progress': `${percentage}%`,
|
|
38
|
+
'--kritzel-opacity-slider-thumb-border-color': this.previewColor,
|
|
39
|
+
} })))));
|
|
40
|
+
}
|
|
41
|
+
static get style() { return kritzelOpacitySliderCss(); }
|
|
42
|
+
}, [513, "kritzel-opacity-slider", {
|
|
43
|
+
"value": [1026],
|
|
44
|
+
"min": [2],
|
|
45
|
+
"max": [2],
|
|
46
|
+
"step": [2],
|
|
47
|
+
"previewColor": [1, "preview-color"]
|
|
48
|
+
}]);
|
|
49
|
+
function defineCustomElement() {
|
|
50
|
+
if (typeof customElements === "undefined") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const components = ["kritzel-opacity-slider"];
|
|
54
|
+
components.forEach(tagName => { switch (tagName) {
|
|
55
|
+
case "kritzel-opacity-slider":
|
|
56
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
57
|
+
customElements.define(transformTag(tagName), KritzelOpacitySlider);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { KritzelOpacitySlider as K, defineCustomElement as d };
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import { p as proxyCustomElement, H, h, d as Host, t as transformTag } from './p-B43upypT.js';
|
|
2
|
+
|
|
3
|
+
const kritzelFontCss = () => `:host{display:block}.font-preview{color:var(--kritzel-font-size-text-color, #333333);line-height:1;text-align:center;font-weight:bold}`;
|
|
4
|
+
|
|
5
|
+
const KritzelFont = /*@__PURE__*/ proxyCustomElement(class KritzelFont extends H {
|
|
6
|
+
constructor(registerHost) {
|
|
7
|
+
super();
|
|
8
|
+
if (registerHost !== false) {
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
}
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
}
|
|
13
|
+
fontFamily = 'Arial, sans-serif';
|
|
14
|
+
size = 24;
|
|
15
|
+
color = '#000000';
|
|
16
|
+
render() {
|
|
17
|
+
return (h(Host, { key: '57369ac95d0c99a52a8580e7659ec10e0e8ab38e' }, h("div", { key: 'e8f128fd7b8d26debb2c4ad2075b27f969d731bd', class: "font-preview", style: {
|
|
18
|
+
fontFamily: this.fontFamily,
|
|
19
|
+
fontSize: `${this.size}px`,
|
|
20
|
+
color: this.color
|
|
21
|
+
} }, "A")));
|
|
22
|
+
}
|
|
23
|
+
static get style() { return kritzelFontCss(); }
|
|
24
|
+
}, [513, "kritzel-font", {
|
|
25
|
+
"fontFamily": [1, "font-family"],
|
|
26
|
+
"size": [2],
|
|
27
|
+
"color": [1]
|
|
28
|
+
}]);
|
|
29
|
+
function defineCustomElement() {
|
|
30
|
+
if (typeof customElements === "undefined") {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const components = ["kritzel-font"];
|
|
34
|
+
components.forEach(tagName => { switch (tagName) {
|
|
35
|
+
case "kritzel-font":
|
|
36
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
37
|
+
customElements.define(transformTag(tagName), KritzelFont);
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
} });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { KritzelFont as K, defineCustomElement as d };
|
|
@@ -1 +1,135 @@
|
|
|
1
|
-
import{p as
|
|
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
|
|
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
|
|
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
|
|
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 };
|