kritzel-stencil 0.4.3 → 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-DPhYXJsM.js +0 -1
- package/dist/stencil/p-43a8dcf8.entry.js +0 -9
|
@@ -1 +1,1090 @@
|
|
|
1
|
-
const o=[{light:"#000000",dark:"#ffffff",label:"Primary"},{light:"#ff5252",dark:"#ff5252"},{light:"#ffbc00",dark:"#ffbc00"},{light:"#00c853",dark:"#00c853"},{light:"#0000FF",dark:"#0000FF"},{light:"#d500f9",dark:"#d500f9"},{light:"#fafafa",dark:"#212121",label:"Background"},{light:"#a52714",dark:"#a52714"},{light:"#ee8100",dark:"#ee8100"},{light:"#558b2f",dark:"#558b2f"},{light:"#01579b",dark:"#01579b"},{light:"#8e24aa",dark:"#8e24aa"},{light:"#90a4ae",dark:"#607d8b",label:"Neutral"},{light:"#ff4081",dark:"#ff4081"},{light:"#ff6e40",dark:"#ff6e40"},{light:"#aeea00",dark:"#aeea00"},{light:"#304ffe",dark:"#304ffe"},{light:"#7c4dff",dark:"#7c4dff"},{light:"#cfd8dc",dark:"#455a64"},{light:"#f8bbd0",dark:"#ec407a"},{light:"#ffccbc",dark:"#ff7043"},{light:"#f0f4c3",dark:"#c0ca33"},{light:"#9fa8da",dark:"#5c6bc0"},{light:"#d1c4e9",dark:"#9575cd"}],r={name:"light",global:{borderColor:"#ebebeb",dividerColor:"#e0e0e0",focusColor:"#333333",focusRingColor:"#333333",iconColor:"currentColor",scrollbarThumbColor:"#ebebeb",textPrimary:"#000000",textSecondary:"#333333"},pillTabs:{background:"#f0f0f0",tabBackground:"transparent",tabBackgroundHover:"rgba(0, 0, 0, 0.05)",tabBackgroundSelected:"#ffffff",tabLabelMaxWidth:"10rem",tabShadowSelected:"0 1px 3px rgba(0, 0, 0, 0.1)",tabTextColor:"#666666",tabTextColorSelected:"#000000"},textInput:{background:"#ffffff",borderColor:"#dbdbdb",borderRadius:"6px",focusBorderColor:"#333333",hoverBorderColor:"#cccccc",labelColor:"#333333",placeholderColor:"#999999",selectionBackground:"#007AFF",selectionColor:"#ffffff",suffixBackground:"#f5f5f5",suffixColor:"#666666",textColor:"#333333"},selection:{borderColor:"#007AFF",boxBackgroundColor:"rgba(0, 122, 255, 0.2)",boxBorderColor:"rgba(0, 122, 255, 0.5)",handleColor:"#ffffff",handleStrokeColor:"#007AFF"},checkerboard:{colorDark:"#cccccc",colorLight:"#ffffff"},backToContent:{activeBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",color:"#000000",hoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)"},colorPalette:{circleBorderColor:"#dddcdc",hoverBackgroundColor:"#ebebeb",selectedBackgroundColor:"#ebebeb"},contextMenu:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 1px 6px rgba(0, 0, 0, 0.12)",dividerColor:"rgba(0, 0, 0, 0.1)",itemActiveBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",itemColor:"#333333",itemDisabledColor:"#aaaaaa",itemHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)"},controls:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",controlActiveBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",controlColor:"#000000",controlHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",controlSelectedBackgroundColor:"#007AFF",controlSelectedColor:"#ffffff",separatorColor:"#ebebeb"},currentUserDialog:{emailColor:"#666666",nameColor:"#333333"},dialog:{backdropColor:"rgba(0, 0, 0, 0.4)",backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.15)",closeButtonActiveBackground:"hsl(0, 0%, 0%, 8.6%)",closeButtonBackground:"transparent",closeButtonColor:"#333333",closeButtonHoverBackground:"hsl(0, 0%, 0%, 4.3%)",closeButtonHoverColor:"#000000",fontFamily:"inherit",footerBorder:"1px solid #ebebeb",headerBorder:"1px solid #ebebeb",titleColor:"#000000"},loginDialog:{buttonActiveBackground:"#ebebeb",buttonBackground:"#ffffff",buttonBorderColor:"#e0e0e0",buttonHoverBackground:"#f5f5f5",buttonHoverBorderColor:"#cccccc",buttonTextColor:"#333333",spinnerActiveColor:"#333333",spinnerColor:"#cccccc",subtitleColor:"#666666"},dropdown:{accentColor:"#007bff",background:"#ffffff",borderColor:"#dbdbdb",borderRadius:"6px",hoverBorderColor:"#cccccc",hoverBackgroundColor:"#f0f0f0",menuBorderRadius:"6px",selectedBackgroundColor:"#007bff1a",textColor:"#333333"},engine:{backgroundColor:"#ffffff",loadingOverlayBackground:"rgba(255, 255, 255, 0.85)",loadingOverlayColor:"#333333",loadingOverlaySpinnerActiveColor:"#333333",loadingOverlaySpinnerColor:"#cccccc"},snap:{indicatorFill:"rgba(59, 130, 246, 0.3)",indicatorStroke:"#007bff",lineStroke:"rgba(0, 0, 0, 0.2)"},fontSize:{hoverBackgroundColor:"#ebebeb",selectedBackgroundColor:"#ebebeb",textColor:"#333333"},lineEndings:{hoverBackgroundColor:"#ebebeb",labelColor:"#666666",optionBackground:"#ffffff",selectedBackgroundColor:"#ebebeb"},masterDetail:{backButtonColor:"#333333",backgroundColor:"#ffffff",detailBackgroundColor:"#ffffff",detailFocusOutline:"2px solid #333333",menuBackgroundColor:"#ffffff",menuBorderRight:"1px solid #ebebeb",menuItemActiveBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",menuItemBackgroundColor:"transparent",menuItemChevronColor:"#aaaaaa",menuItemColor:"#333333",menuItemDisabledColor:"#aaaaaa",menuItemFocusOutline:"2px solid #333333",menuItemHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",menuItemSelectedBackgroundColor:"#007AFF",menuItemSelectedColor:"#ffffff",menuItemSelectedHoverBackgroundColor:"#007AFF"},menu:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",itemButtonHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",itemChildOpenBackgroundColor:"hsl(0, 0%, 0%, 3%)",itemColor:"#333333",itemEditingBackgroundColor:"#f0f0f0",itemInputBorder:"1px solid #333333",itemInputBorderColorOnSelected:"#ffffff",itemInputCaretColor:"#333333",itemInputCaretColorOnSelected:"#ffffff",itemInputSelectionColor:"#007aff",itemInputSelectionColorOnSelected:"rgba(255, 255, 255, 0.55)",itemInputSelectionTextColor:"#ffffff",itemInputSelectionTextColorOnSelected:"#ffffff",itemOverlayBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",itemSelectedBackgroundColor:"#007aff",itemSelectedColor:"#ffffff"},moreMenu:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",borderRadius:"12px",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",buttonActiveBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",buttonColor:"#000000",buttonHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",innerBorderRadius:"12px"},notificationCard:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.08)",color:"#111827",dismissButtonActiveBackgroundColor:"#e5e7eb",dismissButtonBackgroundColor:"transparent",dismissButtonBorderRadius:"6px",dismissButtonColor:"#4b5563",dismissButtonHoverBackgroundColor:"#f3f4f6",dismissButtonSize:"24px",errorPillBackgroundColor:"#fef2f2",errorPillColor:"#b91c1c",headerGap:"8px",headerMarginBottom:"8px",headerRightGap:"6px",infoPillBackgroundColor:"#eff6ff",infoPillColor:"#1d4ed8",maxWidth:"360px",messageColor:"inherit",messageFontSize:"14px",messageLineHeight:"1.45",padding:"12px 14px",pillBackgroundColor:"#eff6ff",pillBorderRadius:"999px",pillColor:"#1d4ed8",pillFontSize:"12px",pillFontWeight:"600",pillHeight:"22px",pillPadding:"0 8px",timestampColor:"#6b7280",timestampFontSize:"12px",warningPillBackgroundColor:"#fff7ed",warningPillColor:"#b45309"},numericInput:{focusBorderColor:"#333333",borderColor:"#dbdbdb",borderRadius:"6px",hoverBorderColor:"#cccccc",inputBackground:"#ffffff",labelColor:"#666666",selectionBackground:"#007AFF",selectionColor:"#ffffff",spinnerActiveBackground:"hsl(0, 0%, 0%, 8.6%)",spinnerBackground:"transparent",spinnerBorderRadius:"5px",spinnerColor:"#333333",spinnerHoverBackground:"hsl(0, 0%, 0%, 4.3%)",textColor:"#333333"},opacitySlider:{activeColor:"#007AFF",thumbBorderColor:"#007AFF",thumbColor:"#ffffff",trackColor:"#e0e0e0"},settings:{contentHeadingColor:"#000000",contentTextColor:"#333333",descriptionColor:"#666666",labelColor:"#333333",shortcutItemBg:"#f8f8f8",shortcutKeyBg:"#ffffff",shortcutKeyBorder:"#e0e0e0",shortcutKeyColor:"#555555"},shapeFill:{hoverBackgroundColor:"#ebebeb",optionBackground:"#ffffff",selectedBackgroundColor:"#ebebeb"},shareDialog:{borderColor:"#e5e5e5",copyButtonBackground:"#ffffff",copyButtonColor:"#666666",copyButtonHoverBackground:"#e8e8e8",copyButtonHoverColor:"#333333",copySuccessBackground:"#d4edda",copySuccessColor:"#28a745",descriptionColor:"#666666",inputBackground:"#f5f5f5",inputBorderColor:"#e0e0e0",inputTextColor:"#333333",labelColor:"#333333",revokeButtonBorderColor:"#dc3545",revokeButtonColor:"#dc3545",revokeButtonHoverBackground:"#dc3545",revokeButtonHoverColor:"#ffffff",selectionColor:"#cce5ff"},slideToggle:{thumbColor:"#fff",thumbSize:"18px",trackCheckedColor:"#007AFF",trackColor:"#ccc"},splitButton:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",color:"#000000",dividerBackgroundColor:"#ebebeb",hoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)"},strokeSize:{hoverBackgroundColor:"#ebebeb",selectedBackgroundColor:"#ebebeb"},tooltip:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",boxShadow:"0 1px 6px rgba(0, 0, 0, 0.12)",color:"#000000"},utilityPanel:{backgroundColor:"#e2e2e2",buttonColor:"#333333",buttonHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",separatorColor:"hsl(0, 0%, 0%, 8%)"},watermark:{background:"rgba(255, 255, 255, 0.6)",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.12)",color:"rgba(60, 60, 60, 0.75)"},zoomPanel:{backgroundColor:"#ffffff",border:"1px solid #ebebeb",borderRadius:"12px",boxShadow:"0 0 3px rgba(0, 0, 0, 0.08)",buttonActiveBackgroundColor:"hsl(0, 0%, 0%, 8.6%)",buttonBorderRadius:"8px",buttonHoverBackgroundColor:"hsl(0, 0%, 0%, 4.3%)",buttonSize:"32px",gap:"4px",iconColor:"#000000",padding:"4px"}},e={name:"dark",global:{borderColor:"#3a3a3a",dividerColor:"#3a3a3a",focusColor:"#ffffff",focusRingColor:"#ffffff",iconColor:"currentColor",scrollbarThumbColor:"#555555",textPrimary:"#ffffff",textSecondary:"#e0e0e0"},pillTabs:{background:"#3a3a3a",tabBackground:"transparent",tabBackgroundHover:"rgba(255, 255, 255, 0.08)",tabBackgroundSelected:"#2a2a2a",tabLabelMaxWidth:"10rem",tabShadowSelected:"0 1px 3px rgba(0, 0, 0, 0.3)",tabTextColor:"#999999",tabTextColorSelected:"#ffffff"},textInput:{background:"#1a1a1a",borderColor:"#4a4a4a",borderRadius:"6px",focusBorderColor:"#ffffff",hoverBorderColor:"#5a5a5a",labelColor:"#e0e0e0",placeholderColor:"#777777",selectionBackground:"#0A84FF",selectionColor:"#ffffff",suffixBackground:"#3a3a3a",suffixColor:"#aaaaaa",textColor:"#e0e0e0"},selection:{borderColor:"#0A84FF",boxBackgroundColor:"rgba(10, 132, 255, 0.2)",boxBorderColor:"rgba(10, 132, 255, 0.5)",handleColor:"#1a1a1a",handleStrokeColor:"#0A84FF"},checkerboard:{colorDark:"#4a4a4a",colorLight:"#3a3a3a"},backToContent:{activeBackgroundColor:"hsl(0, 0%, 100%, 12%)",backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 0 6px rgba(0, 0, 0, 0.3)",color:"#ffffff",hoverBackgroundColor:"hsl(0, 0%, 100%, 8%)"},colorPalette:{circleBorderColor:"#4a4a4a",hoverBackgroundColor:"#3a3a3a",selectedBackgroundColor:"#3a3a3a"},contextMenu:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 1px 8px rgba(0, 0, 0, 0.4)",dividerColor:"rgba(255, 255, 255, 0.1)",itemActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",itemColor:"#e0e0e0",itemDisabledColor:"#666666",itemHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)"},controls:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 0 6px rgba(0, 0, 0, 0.3)",controlActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",controlColor:"#ffffff",controlHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",controlSelectedBackgroundColor:"#0A84FF",controlSelectedColor:"#ffffff",separatorColor:"#3a3a3a"},currentUserDialog:{emailColor:"#999999",nameColor:"#ffffff"},dialog:{backdropColor:"rgba(0, 0, 0, 0.6)",backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.5)",closeButtonActiveBackground:"hsl(0, 0%, 100%, 12%)",closeButtonBackground:"transparent",closeButtonColor:"#e0e0e0",closeButtonHoverBackground:"hsl(0, 0%, 100%, 8%)",closeButtonHoverColor:"#ffffff",footerBorder:"1px solid #3a3a3a",headerBorder:"1px solid #3a3a3a",titleColor:"#ffffff"},loginDialog:{buttonActiveBackground:"#444444",buttonBackground:"#2a2a2a",buttonBorderColor:"#4a4a4a",buttonHoverBackground:"#3a3a3a",buttonHoverBorderColor:"#5a5a5a",buttonTextColor:"#e0e0e0",spinnerActiveColor:"#ffffff",spinnerColor:"#555555",subtitleColor:"#999999"},dropdown:{accentColor:"#0A84FF",borderColor:"#4a4a4a",borderRadius:"6px",hoverBorderColor:"#5a5a5a",background:"#1a1a1a",hoverBackgroundColor:"#3a3a3a",menuBorderRadius:"6px",selectedBackgroundColor:"rgba(10, 132, 255, 0.2)",textColor:"#e0e0e0"},engine:{backgroundColor:"#1a1a1a",loadingOverlayBackground:"rgba(26, 26, 26, 0.85)",loadingOverlayColor:"#e0e0e0",loadingOverlaySpinnerActiveColor:"#e0e0e0",loadingOverlaySpinnerColor:"#555555"},snap:{indicatorFill:"rgba(10, 132, 255, 0.35)",indicatorStroke:"#0A84FF",lineStroke:"rgba(255, 255, 255, 0.35)"},fontSize:{hoverBackgroundColor:"#3a3a3a",selectedBackgroundColor:"#3a3a3a",textColor:"#e0e0e0"},lineEndings:{hoverBackgroundColor:"#3a3a3a",labelColor:"#999999",optionBackground:"#2a2a2a",selectedBackgroundColor:"#3a3a3a"},masterDetail:{backButtonColor:"#e0e0e0",backgroundColor:"#2a2a2a",detailBackgroundColor:"#2a2a2a",detailFocusOutline:"2px solid #ffffff",menuBackgroundColor:"#2a2a2a",menuBorderRight:"1px solid #3a3a3a",menuItemActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",menuItemBackgroundColor:"transparent",menuItemChevronColor:"#666666",menuItemColor:"#e0e0e0",menuItemDisabledColor:"#666666",menuItemFocusOutline:"2px solid #ffffff",menuItemHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",menuItemSelectedBackgroundColor:"#0A84FF",menuItemSelectedColor:"#ffffff",menuItemSelectedHoverBackgroundColor:"#0A84FF"},menu:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 0 6px rgba(0, 0, 0, 0.3)",itemButtonHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",itemChildOpenBackgroundColor:"hsl(0, 0%, 100%, 6%)",itemColor:"#e0e0e0",itemEditingBackgroundColor:"#3a3a3a",itemInputBorder:"1px solid #ffffff",itemInputBorderColorOnSelected:"#ffffff",itemInputCaretColor:"#e0e0e0",itemInputCaretColorOnSelected:"#ffffff",itemInputSelectionColor:"#b0b0b0",itemInputSelectionColorOnSelected:"rgba(255, 255, 255, 0.35)",itemInputSelectionTextColor:"#ffffff",itemInputSelectionTextColorOnSelected:"#ffffff",itemOverlayBackgroundColor:"hsl(0, 0%, 100%, 8%)",itemSelectedBackgroundColor:"#0A84FF",itemSelectedColor:"#ffffff"},moreMenu:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",borderRadius:"12px",boxShadow:"0 0 6px rgba(0, 0, 0, 0.3)",buttonActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",buttonColor:"#ffffff",buttonHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",innerBorderRadius:"12px"},notificationCard:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",borderRadius:"12px",boxShadow:"0 8px 20px rgba(0, 0, 0, 0.35)",color:"#e0e0e0",dismissButtonActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",dismissButtonBackgroundColor:"transparent",dismissButtonBorderRadius:"6px",dismissButtonColor:"#c7c7c7",dismissButtonHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",dismissButtonSize:"24px",errorPillBackgroundColor:"#4d1f24",errorPillColor:"#ff9aa2",headerGap:"8px",headerMarginBottom:"8px",headerRightGap:"6px",infoPillBackgroundColor:"#1f2f4a",infoPillColor:"#8bb7ff",maxWidth:"360px",messageColor:"inherit",messageFontSize:"14px",messageLineHeight:"1.45",padding:"12px 14px",pillBackgroundColor:"#1f2f4a",pillBorderRadius:"999px",pillColor:"#8bb7ff",pillFontSize:"12px",pillFontWeight:"600",pillHeight:"22px",pillPadding:"0 8px",timestampColor:"#a0a0a0",timestampFontSize:"12px",warningPillBackgroundColor:"#4a341f",warningPillColor:"#ffd29a"},numericInput:{borderColor:"#4a4a4a",borderRadius:"6px",focusBorderColor:"#ffffff",hoverBorderColor:"#5a5a5a",inputBackground:"#1a1a1a",labelColor:"#999999",selectionBackground:"#0A84FF",selectionColor:"#ffffff",spinnerActiveBackground:"hsl(0, 0%, 100%, 12%)",spinnerBackground:"transparent",spinnerBorderRadius:"5px",spinnerColor:"#e0e0e0",spinnerHoverBackground:"hsl(0, 0%, 100%, 8%)",textColor:"#e0e0e0"},opacitySlider:{activeColor:"#0A84FF",thumbBorderColor:"#0A84FF",thumbColor:"#ffffff",trackColor:"#4a4a4a"},settings:{contentHeadingColor:"#ffffff",contentTextColor:"#e0e0e0",descriptionColor:"#999999",labelColor:"#e0e0e0",shortcutItemBg:"#3a3a3a",shortcutKeyBg:"#2a2a2a",shortcutKeyBorder:"#4a4a4a",shortcutKeyColor:"#e0e0e0"},shapeFill:{hoverBackgroundColor:"#3a3a3a",optionBackground:"#2a2a2a",selectedBackgroundColor:"#3a3a3a"},shareDialog:{labelColor:"#e0e0e0",descriptionColor:"#e0e0e0",inputBackground:"#1a1a1a",inputBorderColor:"#4a4a4a",inputTextColor:"#e0e0e0",selectionColor:"#0A84FF",copyButtonBackground:"#2a2a2a",copyButtonColor:"#e0e0e0",copyButtonHoverBackground:"#3a3a3a",copyButtonHoverColor:"#ffffff",copySuccessBackground:"#28a745",copySuccessColor:"#ffffff"},slideToggle:{thumbColor:"#ffffff",trackCheckedColor:"#0A84FF",trackColor:"#4a4a4a",transitionDuration:"0.2s"},splitButton:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 0 6px rgba(0, 0, 0, 0.3)",color:"#ffffff",dividerBackgroundColor:"#3a3a3a",hoverBackgroundColor:"hsl(0, 0%, 100%, 8%)"},strokeSize:{hoverBackgroundColor:"#3a3a3a",selectedBackgroundColor:"#3a3a3a"},tooltip:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",boxShadow:"0 1px 8px rgba(0, 0, 0, 0.4)",color:"#ffffff"},utilityPanel:{backgroundColor:"#3a3a3a",buttonColor:"#e0e0e0",buttonHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",separatorColor:"hsl(0, 0%, 100%, 12%)"},watermark:{background:"rgba(40, 40, 40, 0.6)",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.35)",color:"rgba(220, 220, 220, 0.8)"},zoomPanel:{backgroundColor:"#2a2a2a",border:"1px solid #3a3a3a",borderRadius:"12px",boxShadow:"0 0 3px rgba(0, 0, 0, 0.4)",buttonActiveBackgroundColor:"hsl(0, 0%, 100%, 12%)",buttonBorderRadius:"8px",buttonHoverBackgroundColor:"hsl(0, 0%, 100%, 8%)",buttonSize:"32px",gap:"4px",iconColor:"#e0e0e0",padding:"4px"}};class a{static camelToKebab(o){return o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}static flattenThemeToVariables(o,r="--kritzel"){const e=new Map,t=(o,r,l=!1)=>{for(const[n,f]of Object.entries(o)){if(l&&"name"===n)continue;const o=`${r}-${a.camelToKebab(n)}`;"object"==typeof f&&null!==f?t(f,o):"string"==typeof f&&e.set(o,f)}};return t(o,r,!0),e}static applyVariablesToElement(o,r){for(const[e,a]of r)o.style.setProperty(e,a)}static applyThemeToElement(o,r){const e=a.flattenThemeToVariables(r);a.applyVariablesToElement(o,e)}}const t="kritzel-settings",l="light";class n{_core;_currentTheme=l;_targetElement=null;_storageKey;_themeRegistry=new Map;constructor(o){this._core=o,this._storageKey=o.editorId?`${t}-${o.editorId}`:t,this._themeRegistry.set("light",r),this._themeRegistry.set("dark",e),this._currentTheme=this.getStoredTheme()}get currentTheme(){return this._currentTheme}setTargetElement(o){this._targetElement=o,this._targetElement&&this.applyTheme(this._currentTheme)}getTargetElement(){return this._targetElement}getThemeByName(o){return this._themeRegistry.get(o)??this._themeRegistry.values().next().value}registerThemes(o){0===o.length&&console.warn("[KritzelThemeManager] registerThemes called with an empty array. The theme registry will be empty."),this._themeRegistry.clear();for(const r of o)this._themeRegistry.set(r.name,r)}injectThemeEarly(o){let r=o;if(r||"undefined"==typeof document||(r=document.documentElement),!r)return;const e=this.getStoredTheme(),t=this.getThemeByName(e);a.applyThemeToElement(r,t)}getAllThemes(){return Array.from(this._themeRegistry.values())}getStoredTheme(){if("undefined"==typeof localStorage)return l;const o=localStorage.getItem(this._storageKey);if(!o)return l;try{const r=JSON.parse(o);if("string"==typeof r?.theme)return r.theme}catch{}return l}static getStoredTheme(){if("undefined"==typeof localStorage)return l;const o=localStorage.getItem(t);if(!o)return l;try{const r=JSON.parse(o);if("string"==typeof r?.theme)return r.theme}catch{}return l}setTheme(o){this._currentTheme=o,this._targetElement&&this.applyTheme(o)}isDarkTheme(){return"dark"===this._currentTheme}applyTheme(o){if(!this._targetElement)return;const r=this.getThemeByName(o);a.applyThemeToElement(this._targetElement,r)}cleanup(){this._targetElement=null}}class f{static resolveThemeColor(o,r){return o?function(o,r){return r in o&&o[r]?o[r]:o["dark"===r?"dark":"light"]}(o,r??n.getStoredTheme()):""}static applyOpacity(o,r,e){const a="string"==typeof o?o:this.resolveThemeColor(o,e);if(!a||r>=1)return a;const t=a.startsWith("#")?a.slice(1):a;let l,n,f;if(3===t.length)l=parseInt(t[0]+t[0],16),n=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16);else{if(6!==t.length)return a;l=parseInt(t.substring(0,2),16),n=parseInt(t.substring(2,4),16),f=parseInt(t.substring(4,6),16)}return isNaN(l)||isNaN(n)||isNaN(f)?a:`rgba(${l}, ${n}, ${f}, ${r})`}static getContrastColor(o){const r=o.startsWith("#")?o.slice(1):o;let e,a,t;if(3===r.length)e=parseInt(r[0]+r[0],16),a=parseInt(r[1]+r[1],16),t=parseInt(r[2]+r[2],16);else{if(6!==r.length)return"#000000";e=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),t=parseInt(r.substring(4,6),16)}return isNaN(e)||isNaN(a)||isNaN(t)||.299*e+.587*a+.114*t>150?"#000000":"#ffffff"}static determineTextColor(o){const r="transparent"===o.light,e="transparent"===o.dark;return r&&e?{light:"#000000",dark:"#ffffff"}:{light:r?"#000000":this.getContrastColor(o.light),dark:e?"#ffffff":this.getContrastColor(o.dark)}}}export{o as D,n as K,a as T,f as a,e as d,r as l}
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to resolve a color value for a specific theme
|
|
3
|
+
*/
|
|
4
|
+
function resolveColor(color, theme) {
|
|
5
|
+
if (theme in color && color[theme]) {
|
|
6
|
+
return color[theme];
|
|
7
|
+
}
|
|
8
|
+
return color[theme === 'dark' ? 'dark' : 'light'];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Default color palette shared across all tool configurations.
|
|
12
|
+
* This ensures consistency in color options throughout the application.
|
|
13
|
+
* All colors support theme-specific variations.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_COLOR_PALETTE = [
|
|
16
|
+
{ light: '#000000', dark: '#ffffff', label: 'Primary' },
|
|
17
|
+
{ light: '#ff5252', dark: '#ff5252' },
|
|
18
|
+
{ light: '#ffbc00', dark: '#ffbc00' },
|
|
19
|
+
{ light: '#00c853', dark: '#00c853' },
|
|
20
|
+
{ light: '#0000FF', dark: '#0000FF' },
|
|
21
|
+
{ light: '#d500f9', dark: '#d500f9' },
|
|
22
|
+
{ light: '#fafafa', dark: '#212121', label: 'Background' },
|
|
23
|
+
{ light: '#a52714', dark: '#a52714' },
|
|
24
|
+
{ light: '#ee8100', dark: '#ee8100' },
|
|
25
|
+
{ light: '#558b2f', dark: '#558b2f' },
|
|
26
|
+
{ light: '#01579b', dark: '#01579b' },
|
|
27
|
+
{ light: '#8e24aa', dark: '#8e24aa' },
|
|
28
|
+
{ light: '#90a4ae', dark: '#607d8b', label: 'Neutral' },
|
|
29
|
+
{ light: '#ff4081', dark: '#ff4081' },
|
|
30
|
+
{ light: '#ff6e40', dark: '#ff6e40' },
|
|
31
|
+
{ light: '#aeea00', dark: '#aeea00' },
|
|
32
|
+
{ light: '#304ffe', dark: '#304ffe' },
|
|
33
|
+
{ light: '#7c4dff', dark: '#7c4dff' },
|
|
34
|
+
{ light: '#cfd8dc', dark: '#455a64' },
|
|
35
|
+
{ light: '#f8bbd0', dark: '#ec407a' },
|
|
36
|
+
{ light: '#ffccbc', dark: '#ff7043' },
|
|
37
|
+
{ light: '#f0f4c3', dark: '#c0ca33' },
|
|
38
|
+
{ light: '#9fa8da', dark: '#5c6bc0' },
|
|
39
|
+
{ light: '#d1c4e9', dark: '#9575cd' },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Light theme preset - the default theme
|
|
44
|
+
*/
|
|
45
|
+
const lightTheme = {
|
|
46
|
+
name: 'light',
|
|
47
|
+
global: {
|
|
48
|
+
borderColor: '#ebebeb',
|
|
49
|
+
dividerColor: '#e0e0e0',
|
|
50
|
+
focusColor: '#333333',
|
|
51
|
+
focusRingColor: '#333333',
|
|
52
|
+
iconColor: 'currentColor',
|
|
53
|
+
scrollbarThumbColor: '#ebebeb',
|
|
54
|
+
textPrimary: '#000000',
|
|
55
|
+
textSecondary: '#333333',
|
|
56
|
+
},
|
|
57
|
+
pillTabs: {
|
|
58
|
+
background: '#f0f0f0',
|
|
59
|
+
tabBackground: 'transparent',
|
|
60
|
+
tabBackgroundHover: 'rgba(0, 0, 0, 0.05)',
|
|
61
|
+
tabBackgroundSelected: '#ffffff',
|
|
62
|
+
tabLabelMaxWidth: '10rem',
|
|
63
|
+
tabShadowSelected: '0 1px 3px rgba(0, 0, 0, 0.1)',
|
|
64
|
+
tabTextColor: '#666666',
|
|
65
|
+
tabTextColorSelected: '#000000',
|
|
66
|
+
},
|
|
67
|
+
textInput: {
|
|
68
|
+
background: '#ffffff',
|
|
69
|
+
borderColor: '#dbdbdb',
|
|
70
|
+
borderRadius: '6px',
|
|
71
|
+
focusBorderColor: '#333333',
|
|
72
|
+
hoverBorderColor: '#cccccc',
|
|
73
|
+
labelColor: '#333333',
|
|
74
|
+
placeholderColor: '#999999',
|
|
75
|
+
selectionBackground: '#007AFF',
|
|
76
|
+
selectionColor: '#ffffff',
|
|
77
|
+
suffixBackground: '#f5f5f5',
|
|
78
|
+
suffixColor: '#666666',
|
|
79
|
+
textColor: '#333333',
|
|
80
|
+
},
|
|
81
|
+
selection: {
|
|
82
|
+
borderColor: '#007AFF',
|
|
83
|
+
boxBackgroundColor: 'rgba(0, 122, 255, 0.2)',
|
|
84
|
+
boxBorderColor: 'rgba(0, 122, 255, 0.5)',
|
|
85
|
+
handleColor: '#ffffff',
|
|
86
|
+
handleStrokeColor: '#007AFF'
|
|
87
|
+
},
|
|
88
|
+
checkerboard: {
|
|
89
|
+
colorDark: '#cccccc',
|
|
90
|
+
colorLight: '#ffffff',
|
|
91
|
+
},
|
|
92
|
+
backToContent: {
|
|
93
|
+
activeBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
94
|
+
backgroundColor: '#ffffff',
|
|
95
|
+
border: '1px solid #ebebeb',
|
|
96
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
97
|
+
color: '#000000',
|
|
98
|
+
hoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
99
|
+
},
|
|
100
|
+
colorPalette: {
|
|
101
|
+
circleBorderColor: '#dddcdc',
|
|
102
|
+
hoverBackgroundColor: '#ebebeb',
|
|
103
|
+
selectedBackgroundColor: '#ebebeb',
|
|
104
|
+
},
|
|
105
|
+
contextMenu: {
|
|
106
|
+
backgroundColor: '#ffffff',
|
|
107
|
+
border: '1px solid #ebebeb',
|
|
108
|
+
boxShadow: '0 1px 6px rgba(0, 0, 0, 0.12)',
|
|
109
|
+
dividerColor: 'rgba(0, 0, 0, 0.1)',
|
|
110
|
+
itemActiveBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
111
|
+
itemColor: '#333333',
|
|
112
|
+
itemDisabledColor: '#aaaaaa',
|
|
113
|
+
itemHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
114
|
+
},
|
|
115
|
+
controls: {
|
|
116
|
+
backgroundColor: '#ffffff',
|
|
117
|
+
border: '1px solid #ebebeb',
|
|
118
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
119
|
+
controlActiveBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
120
|
+
controlColor: '#000000',
|
|
121
|
+
controlHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
122
|
+
controlSelectedBackgroundColor: '#007AFF',
|
|
123
|
+
controlSelectedColor: '#ffffff',
|
|
124
|
+
separatorColor: '#ebebeb',
|
|
125
|
+
},
|
|
126
|
+
currentUserDialog: {
|
|
127
|
+
emailColor: '#666666',
|
|
128
|
+
nameColor: '#333333',
|
|
129
|
+
},
|
|
130
|
+
dialog: {
|
|
131
|
+
backdropColor: 'rgba(0, 0, 0, 0.4)',
|
|
132
|
+
backgroundColor: '#ffffff',
|
|
133
|
+
border: '1px solid #ebebeb',
|
|
134
|
+
boxShadow: '0 4px 24px rgba(0, 0, 0, 0.15)',
|
|
135
|
+
closeButtonActiveBackground: 'hsl(0, 0%, 0%, 8.6%)',
|
|
136
|
+
closeButtonBackground: 'transparent',
|
|
137
|
+
closeButtonColor: '#333333',
|
|
138
|
+
closeButtonHoverBackground: 'hsl(0, 0%, 0%, 4.3%)',
|
|
139
|
+
closeButtonHoverColor: '#000000',
|
|
140
|
+
fontFamily: 'inherit',
|
|
141
|
+
footerBorder: '1px solid #ebebeb',
|
|
142
|
+
headerBorder: '1px solid #ebebeb',
|
|
143
|
+
titleColor: '#000000',
|
|
144
|
+
},
|
|
145
|
+
loginDialog: {
|
|
146
|
+
buttonActiveBackground: '#ebebeb',
|
|
147
|
+
buttonBackground: '#ffffff',
|
|
148
|
+
buttonBorderColor: '#e0e0e0',
|
|
149
|
+
buttonHoverBackground: '#f5f5f5',
|
|
150
|
+
buttonHoverBorderColor: '#cccccc',
|
|
151
|
+
buttonTextColor: '#333333',
|
|
152
|
+
spinnerActiveColor: '#333333',
|
|
153
|
+
spinnerColor: '#cccccc',
|
|
154
|
+
subtitleColor: '#666666',
|
|
155
|
+
},
|
|
156
|
+
dropdown: {
|
|
157
|
+
accentColor: '#007bff',
|
|
158
|
+
background: '#ffffff',
|
|
159
|
+
borderColor: '#dbdbdb',
|
|
160
|
+
borderRadius: '6px',
|
|
161
|
+
hoverBorderColor: '#cccccc',
|
|
162
|
+
hoverBackgroundColor: '#f0f0f0',
|
|
163
|
+
menuBorderRadius: '6px',
|
|
164
|
+
selectedBackgroundColor: '#007bff1a',
|
|
165
|
+
textColor: '#333333',
|
|
166
|
+
},
|
|
167
|
+
engine: {
|
|
168
|
+
backgroundColor: '#ffffff',
|
|
169
|
+
loadingOverlayBackground: 'rgba(255, 255, 255, 0.85)',
|
|
170
|
+
loadingOverlayColor: '#333333',
|
|
171
|
+
loadingOverlaySpinnerActiveColor: '#333333',
|
|
172
|
+
loadingOverlaySpinnerColor: '#cccccc',
|
|
173
|
+
},
|
|
174
|
+
snap: {
|
|
175
|
+
indicatorFill: 'rgba(59, 130, 246, 0.3)',
|
|
176
|
+
indicatorStroke: '#007bff',
|
|
177
|
+
lineStroke: 'rgba(0, 0, 0, 0.2)',
|
|
178
|
+
},
|
|
179
|
+
fontSize: {
|
|
180
|
+
hoverBackgroundColor: '#ebebeb',
|
|
181
|
+
selectedBackgroundColor: '#ebebeb',
|
|
182
|
+
textColor: '#333333',
|
|
183
|
+
},
|
|
184
|
+
lineEndings: {
|
|
185
|
+
hoverBackgroundColor: '#ebebeb',
|
|
186
|
+
labelColor: '#666666',
|
|
187
|
+
optionBackground: '#ffffff',
|
|
188
|
+
selectedBackgroundColor: '#ebebeb',
|
|
189
|
+
},
|
|
190
|
+
masterDetail: {
|
|
191
|
+
backButtonColor: '#333333',
|
|
192
|
+
backgroundColor: '#ffffff',
|
|
193
|
+
detailBackgroundColor: '#ffffff',
|
|
194
|
+
detailFocusOutline: '2px solid #333333',
|
|
195
|
+
menuBackgroundColor: '#ffffff',
|
|
196
|
+
menuBorderRight: '1px solid #ebebeb',
|
|
197
|
+
menuItemActiveBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
198
|
+
menuItemBackgroundColor: 'transparent',
|
|
199
|
+
menuItemChevronColor: '#aaaaaa',
|
|
200
|
+
menuItemColor: '#333333',
|
|
201
|
+
menuItemDisabledColor: '#aaaaaa',
|
|
202
|
+
menuItemFocusOutline: '2px solid #333333',
|
|
203
|
+
menuItemHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
204
|
+
menuItemSelectedBackgroundColor: '#007AFF',
|
|
205
|
+
menuItemSelectedColor: '#ffffff',
|
|
206
|
+
menuItemSelectedHoverBackgroundColor: '#007AFF',
|
|
207
|
+
},
|
|
208
|
+
menu: {
|
|
209
|
+
backgroundColor: '#ffffff',
|
|
210
|
+
border: '1px solid #ebebeb',
|
|
211
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
212
|
+
itemButtonHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
213
|
+
itemChildOpenBackgroundColor: 'hsl(0, 0%, 0%, 3%)',
|
|
214
|
+
itemColor: '#333333',
|
|
215
|
+
itemEditingBackgroundColor: '#f0f0f0',
|
|
216
|
+
itemInputBorder: '1px solid #333333',
|
|
217
|
+
itemInputBorderColorOnSelected: '#ffffff',
|
|
218
|
+
itemInputCaretColor: '#333333',
|
|
219
|
+
itemInputCaretColorOnSelected: '#ffffff',
|
|
220
|
+
itemInputSelectionColor: '#007aff',
|
|
221
|
+
itemInputSelectionColorOnSelected: 'rgba(255, 255, 255, 0.55)',
|
|
222
|
+
itemInputSelectionTextColor: '#ffffff',
|
|
223
|
+
itemInputSelectionTextColorOnSelected: '#ffffff',
|
|
224
|
+
itemOverlayBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
225
|
+
itemSelectedBackgroundColor: '#007aff',
|
|
226
|
+
itemSelectedColor: '#ffffff',
|
|
227
|
+
},
|
|
228
|
+
moreMenu: {
|
|
229
|
+
backgroundColor: '#ffffff',
|
|
230
|
+
border: '1px solid #ebebeb',
|
|
231
|
+
borderRadius: '12px',
|
|
232
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
233
|
+
buttonActiveBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
234
|
+
buttonColor: '#000000',
|
|
235
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
236
|
+
innerBorderRadius: '12px',
|
|
237
|
+
},
|
|
238
|
+
notificationCard: {
|
|
239
|
+
backgroundColor: '#ffffff',
|
|
240
|
+
border: '1px solid #e5e7eb',
|
|
241
|
+
borderRadius: '12px',
|
|
242
|
+
boxShadow: '0 8px 20px rgba(15, 23, 42, 0.08)',
|
|
243
|
+
color: '#111827',
|
|
244
|
+
dismissButtonActiveBackgroundColor: '#e5e7eb',
|
|
245
|
+
dismissButtonBackgroundColor: 'transparent',
|
|
246
|
+
dismissButtonBorderRadius: '6px',
|
|
247
|
+
dismissButtonColor: '#4b5563',
|
|
248
|
+
dismissButtonHoverBackgroundColor: '#f3f4f6',
|
|
249
|
+
dismissButtonSize: '24px',
|
|
250
|
+
errorPillBackgroundColor: '#fef2f2',
|
|
251
|
+
errorPillColor: '#b91c1c',
|
|
252
|
+
headerGap: '8px',
|
|
253
|
+
headerMarginBottom: '8px',
|
|
254
|
+
headerRightGap: '6px',
|
|
255
|
+
infoPillBackgroundColor: '#eff6ff',
|
|
256
|
+
infoPillColor: '#1d4ed8',
|
|
257
|
+
maxWidth: '360px',
|
|
258
|
+
messageColor: 'inherit',
|
|
259
|
+
messageFontSize: '14px',
|
|
260
|
+
messageLineHeight: '1.45',
|
|
261
|
+
padding: '12px 14px',
|
|
262
|
+
pillBackgroundColor: '#eff6ff',
|
|
263
|
+
pillBorderRadius: '999px',
|
|
264
|
+
pillColor: '#1d4ed8',
|
|
265
|
+
pillFontSize: '12px',
|
|
266
|
+
pillFontWeight: '600',
|
|
267
|
+
pillHeight: '22px',
|
|
268
|
+
pillPadding: '0 8px',
|
|
269
|
+
timestampColor: '#6b7280',
|
|
270
|
+
timestampFontSize: '12px',
|
|
271
|
+
warningPillBackgroundColor: '#fff7ed',
|
|
272
|
+
warningPillColor: '#b45309',
|
|
273
|
+
},
|
|
274
|
+
numericInput: {
|
|
275
|
+
focusBorderColor: '#333333',
|
|
276
|
+
borderColor: '#dbdbdb',
|
|
277
|
+
borderRadius: '6px',
|
|
278
|
+
hoverBorderColor: '#cccccc',
|
|
279
|
+
inputBackground: '#ffffff',
|
|
280
|
+
labelColor: '#666666',
|
|
281
|
+
selectionBackground: '#007AFF',
|
|
282
|
+
selectionColor: '#ffffff',
|
|
283
|
+
spinnerActiveBackground: 'hsl(0, 0%, 0%, 8.6%)',
|
|
284
|
+
spinnerBackground: 'transparent',
|
|
285
|
+
spinnerBorderRadius: '5px',
|
|
286
|
+
spinnerColor: '#333333',
|
|
287
|
+
spinnerHoverBackground: 'hsl(0, 0%, 0%, 4.3%)',
|
|
288
|
+
textColor: '#333333',
|
|
289
|
+
},
|
|
290
|
+
opacitySlider: {
|
|
291
|
+
activeColor: '#007AFF',
|
|
292
|
+
thumbBorderColor: '#007AFF',
|
|
293
|
+
thumbColor: '#ffffff',
|
|
294
|
+
trackColor: '#e0e0e0',
|
|
295
|
+
},
|
|
296
|
+
settings: {
|
|
297
|
+
contentHeadingColor: '#000000',
|
|
298
|
+
contentTextColor: '#333333',
|
|
299
|
+
descriptionColor: '#666666',
|
|
300
|
+
labelColor: '#333333',
|
|
301
|
+
shortcutItemBg: '#f8f8f8',
|
|
302
|
+
shortcutKeyBg: '#ffffff',
|
|
303
|
+
shortcutKeyBorder: '#e0e0e0',
|
|
304
|
+
shortcutKeyColor: '#555555',
|
|
305
|
+
},
|
|
306
|
+
shapeFill: {
|
|
307
|
+
hoverBackgroundColor: '#ebebeb',
|
|
308
|
+
optionBackground: '#ffffff',
|
|
309
|
+
selectedBackgroundColor: '#ebebeb',
|
|
310
|
+
},
|
|
311
|
+
shareDialog: {
|
|
312
|
+
borderColor: '#e5e5e5',
|
|
313
|
+
copyButtonBackground: '#ffffff',
|
|
314
|
+
copyButtonColor: '#666666',
|
|
315
|
+
copyButtonHoverBackground: '#e8e8e8',
|
|
316
|
+
copyButtonHoverColor: '#333333',
|
|
317
|
+
copySuccessBackground: '#d4edda',
|
|
318
|
+
copySuccessColor: '#28a745',
|
|
319
|
+
descriptionColor: '#666666',
|
|
320
|
+
inputBackground: '#f5f5f5',
|
|
321
|
+
inputBorderColor: '#e0e0e0',
|
|
322
|
+
inputTextColor: '#333333',
|
|
323
|
+
labelColor: '#333333',
|
|
324
|
+
revokeButtonBorderColor: '#dc3545',
|
|
325
|
+
revokeButtonColor: '#dc3545',
|
|
326
|
+
revokeButtonHoverBackground: '#dc3545',
|
|
327
|
+
revokeButtonHoverColor: '#ffffff',
|
|
328
|
+
selectionColor: '#cce5ff',
|
|
329
|
+
},
|
|
330
|
+
slideToggle: {
|
|
331
|
+
thumbColor: '#fff',
|
|
332
|
+
thumbSize: '18px',
|
|
333
|
+
trackCheckedColor: '#007AFF',
|
|
334
|
+
trackColor: '#ccc',
|
|
335
|
+
},
|
|
336
|
+
splitButton: {
|
|
337
|
+
backgroundColor: '#ffffff',
|
|
338
|
+
border: '1px solid #ebebeb',
|
|
339
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
340
|
+
color: '#000000',
|
|
341
|
+
dividerBackgroundColor: '#ebebeb',
|
|
342
|
+
hoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
343
|
+
},
|
|
344
|
+
strokeSize: {
|
|
345
|
+
hoverBackgroundColor: '#ebebeb',
|
|
346
|
+
selectedBackgroundColor: '#ebebeb',
|
|
347
|
+
},
|
|
348
|
+
tooltip: {
|
|
349
|
+
backgroundColor: '#ffffff',
|
|
350
|
+
border: '1px solid #ebebeb',
|
|
351
|
+
boxShadow: '0 1px 6px rgba(0, 0, 0, 0.12)',
|
|
352
|
+
color: '#000000',
|
|
353
|
+
},
|
|
354
|
+
utilityPanel: {
|
|
355
|
+
backgroundColor: '#e2e2e2',
|
|
356
|
+
buttonColor: '#333333',
|
|
357
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
358
|
+
separatorColor: 'hsl(0, 0%, 0%, 8%)',
|
|
359
|
+
},
|
|
360
|
+
watermark: {
|
|
361
|
+
background: 'rgba(255, 255, 255, 0.6)',
|
|
362
|
+
boxShadow: '0 1px 2px rgba(0, 0, 0, 0.12)',
|
|
363
|
+
color: 'rgba(60, 60, 60, 0.75)',
|
|
364
|
+
},
|
|
365
|
+
zoomPanel: {
|
|
366
|
+
backgroundColor: '#ffffff',
|
|
367
|
+
border: '1px solid #ebebeb',
|
|
368
|
+
borderRadius: '12px',
|
|
369
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.08)',
|
|
370
|
+
buttonActiveBackgroundColor: 'hsl(0, 0%, 0%, 8.6%)',
|
|
371
|
+
buttonBorderRadius: '8px',
|
|
372
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 0%, 4.3%)',
|
|
373
|
+
buttonSize: '32px',
|
|
374
|
+
gap: '4px',
|
|
375
|
+
iconColor: '#000000',
|
|
376
|
+
padding: '4px',
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Dark theme preset
|
|
382
|
+
*/
|
|
383
|
+
const darkTheme = {
|
|
384
|
+
name: 'dark',
|
|
385
|
+
global: {
|
|
386
|
+
borderColor: '#3a3a3a',
|
|
387
|
+
dividerColor: '#3a3a3a',
|
|
388
|
+
focusColor: '#ffffff',
|
|
389
|
+
focusRingColor: '#ffffff',
|
|
390
|
+
iconColor: 'currentColor',
|
|
391
|
+
scrollbarThumbColor: '#555555',
|
|
392
|
+
textPrimary: '#ffffff',
|
|
393
|
+
textSecondary: '#e0e0e0',
|
|
394
|
+
},
|
|
395
|
+
pillTabs: {
|
|
396
|
+
background: '#3a3a3a',
|
|
397
|
+
tabBackground: 'transparent',
|
|
398
|
+
tabBackgroundHover: 'rgba(255, 255, 255, 0.08)',
|
|
399
|
+
tabBackgroundSelected: '#2a2a2a',
|
|
400
|
+
tabLabelMaxWidth: '10rem',
|
|
401
|
+
tabShadowSelected: '0 1px 3px rgba(0, 0, 0, 0.3)',
|
|
402
|
+
tabTextColor: '#999999',
|
|
403
|
+
tabTextColorSelected: '#ffffff',
|
|
404
|
+
},
|
|
405
|
+
textInput: {
|
|
406
|
+
background: '#1a1a1a',
|
|
407
|
+
borderColor: '#4a4a4a',
|
|
408
|
+
borderRadius: '6px',
|
|
409
|
+
focusBorderColor: '#ffffff',
|
|
410
|
+
hoverBorderColor: '#5a5a5a',
|
|
411
|
+
labelColor: '#e0e0e0',
|
|
412
|
+
placeholderColor: '#777777',
|
|
413
|
+
selectionBackground: '#0A84FF',
|
|
414
|
+
selectionColor: '#ffffff',
|
|
415
|
+
suffixBackground: '#3a3a3a',
|
|
416
|
+
suffixColor: '#aaaaaa',
|
|
417
|
+
textColor: '#e0e0e0',
|
|
418
|
+
},
|
|
419
|
+
selection: {
|
|
420
|
+
borderColor: '#0A84FF',
|
|
421
|
+
boxBackgroundColor: 'rgba(10, 132, 255, 0.2)',
|
|
422
|
+
boxBorderColor: 'rgba(10, 132, 255, 0.5)',
|
|
423
|
+
handleColor: '#1a1a1a',
|
|
424
|
+
handleStrokeColor: '#0A84FF'
|
|
425
|
+
},
|
|
426
|
+
checkerboard: {
|
|
427
|
+
colorDark: '#4a4a4a',
|
|
428
|
+
colorLight: '#3a3a3a',
|
|
429
|
+
},
|
|
430
|
+
backToContent: {
|
|
431
|
+
activeBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
432
|
+
backgroundColor: '#2a2a2a',
|
|
433
|
+
border: '1px solid #3a3a3a',
|
|
434
|
+
boxShadow: '0 0 6px rgba(0, 0, 0, 0.3)',
|
|
435
|
+
color: '#ffffff',
|
|
436
|
+
hoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
437
|
+
},
|
|
438
|
+
colorPalette: {
|
|
439
|
+
circleBorderColor: '#4a4a4a',
|
|
440
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
441
|
+
selectedBackgroundColor: '#3a3a3a',
|
|
442
|
+
},
|
|
443
|
+
contextMenu: {
|
|
444
|
+
backgroundColor: '#2a2a2a',
|
|
445
|
+
border: '1px solid #3a3a3a',
|
|
446
|
+
boxShadow: '0 1px 8px rgba(0, 0, 0, 0.4)',
|
|
447
|
+
dividerColor: 'rgba(255, 255, 255, 0.1)',
|
|
448
|
+
itemActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
449
|
+
itemColor: '#e0e0e0',
|
|
450
|
+
itemDisabledColor: '#666666',
|
|
451
|
+
itemHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
452
|
+
},
|
|
453
|
+
controls: {
|
|
454
|
+
backgroundColor: '#2a2a2a',
|
|
455
|
+
border: '1px solid #3a3a3a',
|
|
456
|
+
boxShadow: '0 0 6px rgba(0, 0, 0, 0.3)',
|
|
457
|
+
controlActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
458
|
+
controlColor: '#ffffff',
|
|
459
|
+
controlHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
460
|
+
controlSelectedBackgroundColor: '#0A84FF',
|
|
461
|
+
controlSelectedColor: '#ffffff',
|
|
462
|
+
separatorColor: '#3a3a3a',
|
|
463
|
+
},
|
|
464
|
+
currentUserDialog: {
|
|
465
|
+
emailColor: '#999999',
|
|
466
|
+
nameColor: '#ffffff',
|
|
467
|
+
},
|
|
468
|
+
dialog: {
|
|
469
|
+
backdropColor: 'rgba(0, 0, 0, 0.6)',
|
|
470
|
+
backgroundColor: '#2a2a2a',
|
|
471
|
+
border: '1px solid #3a3a3a',
|
|
472
|
+
boxShadow: '0 4px 24px rgba(0, 0, 0, 0.5)',
|
|
473
|
+
closeButtonActiveBackground: 'hsl(0, 0%, 100%, 12%)',
|
|
474
|
+
closeButtonBackground: 'transparent',
|
|
475
|
+
closeButtonColor: '#e0e0e0',
|
|
476
|
+
closeButtonHoverBackground: 'hsl(0, 0%, 100%, 8%)',
|
|
477
|
+
closeButtonHoverColor: '#ffffff',
|
|
478
|
+
footerBorder: '1px solid #3a3a3a',
|
|
479
|
+
headerBorder: '1px solid #3a3a3a',
|
|
480
|
+
titleColor: '#ffffff',
|
|
481
|
+
},
|
|
482
|
+
loginDialog: {
|
|
483
|
+
buttonActiveBackground: '#444444',
|
|
484
|
+
buttonBackground: '#2a2a2a',
|
|
485
|
+
buttonBorderColor: '#4a4a4a',
|
|
486
|
+
buttonHoverBackground: '#3a3a3a',
|
|
487
|
+
buttonHoverBorderColor: '#5a5a5a',
|
|
488
|
+
buttonTextColor: '#e0e0e0',
|
|
489
|
+
spinnerActiveColor: '#ffffff',
|
|
490
|
+
spinnerColor: '#555555',
|
|
491
|
+
subtitleColor: '#999999',
|
|
492
|
+
},
|
|
493
|
+
dropdown: {
|
|
494
|
+
accentColor: '#0A84FF',
|
|
495
|
+
borderColor: '#4a4a4a',
|
|
496
|
+
borderRadius: '6px',
|
|
497
|
+
hoverBorderColor: '#5a5a5a',
|
|
498
|
+
background: '#1a1a1a',
|
|
499
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
500
|
+
menuBorderRadius: '6px',
|
|
501
|
+
selectedBackgroundColor: 'rgba(10, 132, 255, 0.2)',
|
|
502
|
+
textColor: '#e0e0e0',
|
|
503
|
+
},
|
|
504
|
+
engine: {
|
|
505
|
+
backgroundColor: '#1a1a1a',
|
|
506
|
+
loadingOverlayBackground: 'rgba(26, 26, 26, 0.85)',
|
|
507
|
+
loadingOverlayColor: '#e0e0e0',
|
|
508
|
+
loadingOverlaySpinnerActiveColor: '#e0e0e0',
|
|
509
|
+
loadingOverlaySpinnerColor: '#555555',
|
|
510
|
+
},
|
|
511
|
+
snap: {
|
|
512
|
+
indicatorFill: 'rgba(10, 132, 255, 0.35)',
|
|
513
|
+
indicatorStroke: '#0A84FF',
|
|
514
|
+
lineStroke: 'rgba(255, 255, 255, 0.35)',
|
|
515
|
+
},
|
|
516
|
+
fontSize: {
|
|
517
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
518
|
+
selectedBackgroundColor: '#3a3a3a',
|
|
519
|
+
textColor: '#e0e0e0',
|
|
520
|
+
},
|
|
521
|
+
lineEndings: {
|
|
522
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
523
|
+
labelColor: '#999999',
|
|
524
|
+
optionBackground: '#2a2a2a',
|
|
525
|
+
selectedBackgroundColor: '#3a3a3a',
|
|
526
|
+
},
|
|
527
|
+
masterDetail: {
|
|
528
|
+
backButtonColor: '#e0e0e0',
|
|
529
|
+
backgroundColor: '#2a2a2a',
|
|
530
|
+
detailBackgroundColor: '#2a2a2a',
|
|
531
|
+
detailFocusOutline: '2px solid #ffffff',
|
|
532
|
+
menuBackgroundColor: '#2a2a2a',
|
|
533
|
+
menuBorderRight: '1px solid #3a3a3a',
|
|
534
|
+
menuItemActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
535
|
+
menuItemBackgroundColor: 'transparent',
|
|
536
|
+
menuItemChevronColor: '#666666',
|
|
537
|
+
menuItemColor: '#e0e0e0',
|
|
538
|
+
menuItemDisabledColor: '#666666',
|
|
539
|
+
menuItemFocusOutline: '2px solid #ffffff',
|
|
540
|
+
menuItemHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
541
|
+
menuItemSelectedBackgroundColor: '#0A84FF',
|
|
542
|
+
menuItemSelectedColor: '#ffffff',
|
|
543
|
+
menuItemSelectedHoverBackgroundColor: '#0A84FF',
|
|
544
|
+
},
|
|
545
|
+
menu: {
|
|
546
|
+
backgroundColor: '#2a2a2a',
|
|
547
|
+
border: '1px solid #3a3a3a',
|
|
548
|
+
boxShadow: '0 0 6px rgba(0, 0, 0, 0.3)',
|
|
549
|
+
itemButtonHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
550
|
+
itemChildOpenBackgroundColor: 'hsl(0, 0%, 100%, 6%)',
|
|
551
|
+
itemColor: '#e0e0e0',
|
|
552
|
+
itemEditingBackgroundColor: '#3a3a3a',
|
|
553
|
+
itemInputBorder: '1px solid #ffffff',
|
|
554
|
+
itemInputBorderColorOnSelected: '#ffffff',
|
|
555
|
+
itemInputCaretColor: '#e0e0e0',
|
|
556
|
+
itemInputCaretColorOnSelected: '#ffffff',
|
|
557
|
+
itemInputSelectionColor: '#b0b0b0',
|
|
558
|
+
itemInputSelectionColorOnSelected: 'rgba(255, 255, 255, 0.35)',
|
|
559
|
+
itemInputSelectionTextColor: '#ffffff',
|
|
560
|
+
itemInputSelectionTextColorOnSelected: '#ffffff',
|
|
561
|
+
itemOverlayBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
562
|
+
itemSelectedBackgroundColor: '#0A84FF',
|
|
563
|
+
itemSelectedColor: '#ffffff',
|
|
564
|
+
},
|
|
565
|
+
moreMenu: {
|
|
566
|
+
backgroundColor: '#2a2a2a',
|
|
567
|
+
border: '1px solid #3a3a3a',
|
|
568
|
+
borderRadius: '12px',
|
|
569
|
+
boxShadow: '0 0 6px rgba(0, 0, 0, 0.3)',
|
|
570
|
+
buttonActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
571
|
+
buttonColor: '#ffffff',
|
|
572
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
573
|
+
innerBorderRadius: '12px',
|
|
574
|
+
},
|
|
575
|
+
notificationCard: {
|
|
576
|
+
backgroundColor: '#2a2a2a',
|
|
577
|
+
border: '1px solid #3a3a3a',
|
|
578
|
+
borderRadius: '12px',
|
|
579
|
+
boxShadow: '0 8px 20px rgba(0, 0, 0, 0.35)',
|
|
580
|
+
color: '#e0e0e0',
|
|
581
|
+
dismissButtonActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
582
|
+
dismissButtonBackgroundColor: 'transparent',
|
|
583
|
+
dismissButtonBorderRadius: '6px',
|
|
584
|
+
dismissButtonColor: '#c7c7c7',
|
|
585
|
+
dismissButtonHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
586
|
+
dismissButtonSize: '24px',
|
|
587
|
+
errorPillBackgroundColor: '#4d1f24',
|
|
588
|
+
errorPillColor: '#ff9aa2',
|
|
589
|
+
headerGap: '8px',
|
|
590
|
+
headerMarginBottom: '8px',
|
|
591
|
+
headerRightGap: '6px',
|
|
592
|
+
infoPillBackgroundColor: '#1f2f4a',
|
|
593
|
+
infoPillColor: '#8bb7ff',
|
|
594
|
+
maxWidth: '360px',
|
|
595
|
+
messageColor: 'inherit',
|
|
596
|
+
messageFontSize: '14px',
|
|
597
|
+
messageLineHeight: '1.45',
|
|
598
|
+
padding: '12px 14px',
|
|
599
|
+
pillBackgroundColor: '#1f2f4a',
|
|
600
|
+
pillBorderRadius: '999px',
|
|
601
|
+
pillColor: '#8bb7ff',
|
|
602
|
+
pillFontSize: '12px',
|
|
603
|
+
pillFontWeight: '600',
|
|
604
|
+
pillHeight: '22px',
|
|
605
|
+
pillPadding: '0 8px',
|
|
606
|
+
timestampColor: '#a0a0a0',
|
|
607
|
+
timestampFontSize: '12px',
|
|
608
|
+
warningPillBackgroundColor: '#4a341f',
|
|
609
|
+
warningPillColor: '#ffd29a',
|
|
610
|
+
},
|
|
611
|
+
numericInput: {
|
|
612
|
+
borderColor: '#4a4a4a',
|
|
613
|
+
borderRadius: '6px',
|
|
614
|
+
focusBorderColor: '#ffffff',
|
|
615
|
+
hoverBorderColor: '#5a5a5a',
|
|
616
|
+
inputBackground: '#1a1a1a',
|
|
617
|
+
labelColor: '#999999',
|
|
618
|
+
selectionBackground: '#0A84FF',
|
|
619
|
+
selectionColor: '#ffffff',
|
|
620
|
+
spinnerActiveBackground: 'hsl(0, 0%, 100%, 12%)',
|
|
621
|
+
spinnerBackground: 'transparent',
|
|
622
|
+
spinnerBorderRadius: '5px',
|
|
623
|
+
spinnerColor: '#e0e0e0',
|
|
624
|
+
spinnerHoverBackground: 'hsl(0, 0%, 100%, 8%)',
|
|
625
|
+
textColor: '#e0e0e0',
|
|
626
|
+
},
|
|
627
|
+
opacitySlider: {
|
|
628
|
+
activeColor: '#0A84FF',
|
|
629
|
+
thumbBorderColor: '#0A84FF',
|
|
630
|
+
thumbColor: '#ffffff',
|
|
631
|
+
trackColor: '#4a4a4a',
|
|
632
|
+
},
|
|
633
|
+
settings: {
|
|
634
|
+
contentHeadingColor: '#ffffff',
|
|
635
|
+
contentTextColor: '#e0e0e0',
|
|
636
|
+
descriptionColor: '#999999',
|
|
637
|
+
labelColor: '#e0e0e0',
|
|
638
|
+
shortcutItemBg: '#3a3a3a',
|
|
639
|
+
shortcutKeyBg: '#2a2a2a',
|
|
640
|
+
shortcutKeyBorder: '#4a4a4a',
|
|
641
|
+
shortcutKeyColor: '#e0e0e0',
|
|
642
|
+
},
|
|
643
|
+
shapeFill: {
|
|
644
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
645
|
+
optionBackground: '#2a2a2a',
|
|
646
|
+
selectedBackgroundColor: '#3a3a3a',
|
|
647
|
+
},
|
|
648
|
+
shareDialog: {
|
|
649
|
+
labelColor: '#e0e0e0',
|
|
650
|
+
descriptionColor: '#e0e0e0',
|
|
651
|
+
inputBackground: '#1a1a1a',
|
|
652
|
+
inputBorderColor: '#4a4a4a',
|
|
653
|
+
inputTextColor: '#e0e0e0',
|
|
654
|
+
selectionColor: '#0A84FF',
|
|
655
|
+
copyButtonBackground: '#2a2a2a',
|
|
656
|
+
copyButtonColor: '#e0e0e0',
|
|
657
|
+
copyButtonHoverBackground: '#3a3a3a',
|
|
658
|
+
copyButtonHoverColor: '#ffffff',
|
|
659
|
+
copySuccessBackground: '#28a745',
|
|
660
|
+
copySuccessColor: '#ffffff',
|
|
661
|
+
},
|
|
662
|
+
slideToggle: {
|
|
663
|
+
thumbColor: '#ffffff',
|
|
664
|
+
trackCheckedColor: '#0A84FF',
|
|
665
|
+
trackColor: '#4a4a4a',
|
|
666
|
+
transitionDuration: '0.2s',
|
|
667
|
+
},
|
|
668
|
+
splitButton: {
|
|
669
|
+
backgroundColor: '#2a2a2a',
|
|
670
|
+
border: '1px solid #3a3a3a',
|
|
671
|
+
boxShadow: '0 0 6px rgba(0, 0, 0, 0.3)',
|
|
672
|
+
color: '#ffffff',
|
|
673
|
+
dividerBackgroundColor: '#3a3a3a',
|
|
674
|
+
hoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
675
|
+
},
|
|
676
|
+
strokeSize: {
|
|
677
|
+
hoverBackgroundColor: '#3a3a3a',
|
|
678
|
+
selectedBackgroundColor: '#3a3a3a',
|
|
679
|
+
},
|
|
680
|
+
tooltip: {
|
|
681
|
+
backgroundColor: '#2a2a2a',
|
|
682
|
+
border: '1px solid #3a3a3a',
|
|
683
|
+
boxShadow: '0 1px 8px rgba(0, 0, 0, 0.4)',
|
|
684
|
+
color: '#ffffff',
|
|
685
|
+
},
|
|
686
|
+
utilityPanel: {
|
|
687
|
+
backgroundColor: '#3a3a3a',
|
|
688
|
+
buttonColor: '#e0e0e0',
|
|
689
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
690
|
+
separatorColor: 'hsl(0, 0%, 100%, 12%)',
|
|
691
|
+
},
|
|
692
|
+
watermark: {
|
|
693
|
+
background: 'rgba(40, 40, 40, 0.6)',
|
|
694
|
+
boxShadow: '0 1px 2px rgba(0, 0, 0, 0.35)',
|
|
695
|
+
color: 'rgba(220, 220, 220, 0.8)',
|
|
696
|
+
},
|
|
697
|
+
zoomPanel: {
|
|
698
|
+
backgroundColor: '#2a2a2a',
|
|
699
|
+
border: '1px solid #3a3a3a',
|
|
700
|
+
borderRadius: '12px',
|
|
701
|
+
boxShadow: '0 0 3px rgba(0, 0, 0, 0.4)',
|
|
702
|
+
buttonActiveBackgroundColor: 'hsl(0, 0%, 100%, 12%)',
|
|
703
|
+
buttonBorderRadius: '8px',
|
|
704
|
+
buttonHoverBackgroundColor: 'hsl(0, 0%, 100%, 8%)',
|
|
705
|
+
buttonSize: '32px',
|
|
706
|
+
gap: '4px',
|
|
707
|
+
iconColor: '#e0e0e0',
|
|
708
|
+
padding: '4px',
|
|
709
|
+
},
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
class ThemeHelper {
|
|
713
|
+
/**
|
|
714
|
+
* Converts a camelCase string to kebab-case.
|
|
715
|
+
* @example ThemeHelper.camelToKebab('controlHoverBackgroundColor') → 'control-hover-background-color'
|
|
716
|
+
* @example ThemeHelper.camelToKebab('backgroundColor') → 'background-color'
|
|
717
|
+
* @example ThemeHelper.camelToKebab('gap') → 'gap'
|
|
718
|
+
*/
|
|
719
|
+
static camelToKebab(str) {
|
|
720
|
+
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Recursively flattens a theme object into a map of CSS variable names to values.
|
|
724
|
+
* Skips the 'name' property at the root level since it's the theme identifier, not a CSS value.
|
|
725
|
+
*
|
|
726
|
+
* @param theme - The theme object to flatten
|
|
727
|
+
* @param prefix - The CSS variable prefix (default: '--kritzel')
|
|
728
|
+
* @returns A Map of CSS variable names to their values
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* ThemeHelper.flattenThemeToVariables(lightTheme)
|
|
732
|
+
* // Returns Map {
|
|
733
|
+
* // '--kritzel-global-pointer-cursor' => 'pointer',
|
|
734
|
+
* // '--kritzel-controls-gap' => '8px',
|
|
735
|
+
* // ...
|
|
736
|
+
* // }
|
|
737
|
+
*/
|
|
738
|
+
static flattenThemeToVariables(theme, prefix = '--kritzel') {
|
|
739
|
+
const variables = new Map();
|
|
740
|
+
const recurse = (obj, currentPrefix, isRoot = false) => {
|
|
741
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
742
|
+
// Skip the 'name' property at the root level
|
|
743
|
+
if (isRoot && key === 'name') {
|
|
744
|
+
continue;
|
|
745
|
+
}
|
|
746
|
+
const kebabKey = ThemeHelper.camelToKebab(key);
|
|
747
|
+
const variableName = `${currentPrefix}-${kebabKey}`;
|
|
748
|
+
if (typeof value === 'object' && value !== null) {
|
|
749
|
+
recurse(value, variableName);
|
|
750
|
+
}
|
|
751
|
+
else if (typeof value === 'string') {
|
|
752
|
+
variables.set(variableName, value);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
recurse(theme, prefix, true);
|
|
757
|
+
return variables;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Applies a map of CSS variables to an HTML element.
|
|
761
|
+
*
|
|
762
|
+
* @param element - The target HTML element
|
|
763
|
+
* @param variables - A Map of CSS variable names to values
|
|
764
|
+
*/
|
|
765
|
+
static applyVariablesToElement(element, variables) {
|
|
766
|
+
for (const [name, value] of variables) {
|
|
767
|
+
element.style.setProperty(name, value);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Convenience method that flattens a theme and applies it to an element in one call.
|
|
772
|
+
*
|
|
773
|
+
* @param element - The target HTML element
|
|
774
|
+
* @param theme - The theme object to apply
|
|
775
|
+
*/
|
|
776
|
+
static applyThemeToElement(element, theme) {
|
|
777
|
+
const variables = ThemeHelper.flattenThemeToVariables(theme);
|
|
778
|
+
ThemeHelper.applyVariablesToElement(element, variables);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/** Key used to store the settings object in localStorage. */
|
|
783
|
+
const SETTINGS_STORAGE_KEY = 'kritzel-settings';
|
|
784
|
+
/** Default theme used when no stored preference exists. */
|
|
785
|
+
const DEFAULT_THEME = 'light';
|
|
786
|
+
/**
|
|
787
|
+
* Manages theme state and application across the Kritzel editor.
|
|
788
|
+
* Reads the persisted theme from the settings object in localStorage but does not write to it.
|
|
789
|
+
* Persistence is handled exclusively by the KritzelSettings component.
|
|
790
|
+
*
|
|
791
|
+
* The theme manager is responsible for:
|
|
792
|
+
* - Reading the stored theme preference from the settings object
|
|
793
|
+
* - Applying CSS custom properties to target elements
|
|
794
|
+
* - Switching between light and dark themes at runtime
|
|
795
|
+
*/
|
|
796
|
+
class KritzelThemeManager {
|
|
797
|
+
_core;
|
|
798
|
+
_currentTheme = DEFAULT_THEME;
|
|
799
|
+
_targetElement = null;
|
|
800
|
+
_storageKey;
|
|
801
|
+
_themeRegistry = new Map();
|
|
802
|
+
/**
|
|
803
|
+
* Creates a new KritzelThemeManager instance.
|
|
804
|
+
* Initializes the current theme from the settings object in localStorage or uses the default theme.
|
|
805
|
+
*
|
|
806
|
+
* @param core - The KritzelCore instance this manager belongs to
|
|
807
|
+
*/
|
|
808
|
+
constructor(core) {
|
|
809
|
+
this._core = core;
|
|
810
|
+
this._storageKey = core.editorId ? `${SETTINGS_STORAGE_KEY}-${core.editorId}` : SETTINGS_STORAGE_KEY;
|
|
811
|
+
this._themeRegistry.set('light', lightTheme);
|
|
812
|
+
this._themeRegistry.set('dark', darkTheme);
|
|
813
|
+
this._currentTheme = this.getStoredTheme();
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Gets the current active theme name.
|
|
817
|
+
*
|
|
818
|
+
* @returns The name of the currently active theme ('light' or 'dark')
|
|
819
|
+
*/
|
|
820
|
+
get currentTheme() {
|
|
821
|
+
return this._currentTheme;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Sets the target element where theme CSS variables will be applied.
|
|
825
|
+
* If an element is provided, the current theme is immediately applied to it.
|
|
826
|
+
*
|
|
827
|
+
* @param element - The HTML element to apply theme styles to, or null to clear
|
|
828
|
+
*/
|
|
829
|
+
setTargetElement(element) {
|
|
830
|
+
this._targetElement = element;
|
|
831
|
+
if (this._targetElement) {
|
|
832
|
+
this.applyTheme(this._currentTheme);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Gets the current target element where theme CSS variables are applied.
|
|
837
|
+
*
|
|
838
|
+
* @returns The current target HTML element, or null if none is set
|
|
839
|
+
*/
|
|
840
|
+
getTargetElement() {
|
|
841
|
+
return this._targetElement;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Gets the theme configuration object by its name.
|
|
845
|
+
* Falls back to the first registered theme if the requested name is not found.
|
|
846
|
+
*
|
|
847
|
+
* @param themeName - The name of the theme to retrieve
|
|
848
|
+
* @returns The KritzelTheme object containing all theme CSS variable values
|
|
849
|
+
*/
|
|
850
|
+
getThemeByName(themeName) {
|
|
851
|
+
return this._themeRegistry.get(themeName) ?? this._themeRegistry.values().next().value;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Registers the provided themes to this theme manager instance.
|
|
855
|
+
*
|
|
856
|
+
* @param themes - The complete list of themes to make available
|
|
857
|
+
*/
|
|
858
|
+
registerThemes(themes) {
|
|
859
|
+
if (themes.length === 0) {
|
|
860
|
+
console.warn('[KritzelThemeManager] registerThemes called with an empty array. The theme registry will be empty.');
|
|
861
|
+
}
|
|
862
|
+
this._themeRegistry.clear();
|
|
863
|
+
for (const theme of themes) {
|
|
864
|
+
this._themeRegistry.set(theme.name, theme);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Pre-emptively applies the stored theme's CSS variables to the closest editor or document.
|
|
869
|
+
* This prevents a "Flash of Unstyled Content" (FOUC) while Stencil web components are hydrating.
|
|
870
|
+
*
|
|
871
|
+
* @param element - The HTML element to apply the theme to
|
|
872
|
+
*/
|
|
873
|
+
injectThemeEarly(element) {
|
|
874
|
+
let targetElement = element;
|
|
875
|
+
if (!targetElement && typeof document !== 'undefined') {
|
|
876
|
+
targetElement = document.documentElement;
|
|
877
|
+
}
|
|
878
|
+
if (!targetElement)
|
|
879
|
+
return;
|
|
880
|
+
const themeName = this.getStoredTheme();
|
|
881
|
+
const theme = this.getThemeByName(themeName);
|
|
882
|
+
ThemeHelper.applyThemeToElement(targetElement, theme);
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Gets all registered themes.
|
|
886
|
+
*
|
|
887
|
+
* @returns An array of all registered theme objects
|
|
888
|
+
*/
|
|
889
|
+
getAllThemes() {
|
|
890
|
+
return Array.from(this._themeRegistry.values());
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Gets the stored theme name from the settings object in localStorage using this instance's namespaced key.
|
|
894
|
+
*
|
|
895
|
+
* @returns The stored theme name if valid, or 'light' as the default
|
|
896
|
+
*/
|
|
897
|
+
getStoredTheme() {
|
|
898
|
+
if (typeof localStorage === 'undefined') {
|
|
899
|
+
return DEFAULT_THEME;
|
|
900
|
+
}
|
|
901
|
+
const stored = localStorage.getItem(this._storageKey);
|
|
902
|
+
if (!stored) {
|
|
903
|
+
return DEFAULT_THEME;
|
|
904
|
+
}
|
|
905
|
+
try {
|
|
906
|
+
const parsed = JSON.parse(stored);
|
|
907
|
+
if (typeof parsed?.theme === 'string') {
|
|
908
|
+
return parsed.theme;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
catch {
|
|
912
|
+
// Invalid JSON, use default
|
|
913
|
+
}
|
|
914
|
+
return DEFAULT_THEME;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Gets the stored theme from the default (non-namespaced) settings object in localStorage.
|
|
918
|
+
* Used by static utility helpers that don't have access to a core instance.
|
|
919
|
+
*
|
|
920
|
+
* @returns The stored theme name if valid, or 'light' as the default
|
|
921
|
+
*/
|
|
922
|
+
static getStoredTheme() {
|
|
923
|
+
if (typeof localStorage === 'undefined') {
|
|
924
|
+
return DEFAULT_THEME;
|
|
925
|
+
}
|
|
926
|
+
const stored = localStorage.getItem(SETTINGS_STORAGE_KEY);
|
|
927
|
+
if (!stored) {
|
|
928
|
+
return DEFAULT_THEME;
|
|
929
|
+
}
|
|
930
|
+
try {
|
|
931
|
+
const parsed = JSON.parse(stored);
|
|
932
|
+
if (typeof parsed?.theme === 'string') {
|
|
933
|
+
return parsed.theme;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
catch {
|
|
937
|
+
// Invalid JSON, use default
|
|
938
|
+
}
|
|
939
|
+
return DEFAULT_THEME;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Sets the current theme and applies it to the target element.
|
|
943
|
+
* Does not persist the theme — persistence is handled by the KritzelSettings component.
|
|
944
|
+
*
|
|
945
|
+
* @param themeName - The theme name to set ('light' or 'dark')
|
|
946
|
+
*/
|
|
947
|
+
setTheme(themeName) {
|
|
948
|
+
this._currentTheme = themeName;
|
|
949
|
+
if (this._targetElement) {
|
|
950
|
+
this.applyTheme(themeName);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Checks if the current theme is the dark theme.
|
|
955
|
+
*
|
|
956
|
+
* @returns True if the current theme is 'dark', false otherwise
|
|
957
|
+
*/
|
|
958
|
+
isDarkTheme() {
|
|
959
|
+
return this._currentTheme === 'dark';
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Applies a theme to the target element by setting CSS custom properties.
|
|
963
|
+
* Uses the ThemeHelper utility to automatically derive CSS variable names
|
|
964
|
+
* from the theme interface structure and apply them to the element's style.
|
|
965
|
+
* Does nothing if no target element is set.
|
|
966
|
+
*
|
|
967
|
+
* @param themeName - The name of the theme to apply ('light' or 'dark')
|
|
968
|
+
*/
|
|
969
|
+
applyTheme(themeName) {
|
|
970
|
+
if (!this._targetElement) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
const theme = this.getThemeByName(themeName);
|
|
974
|
+
ThemeHelper.applyThemeToElement(this._targetElement, theme);
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Cleans up the theme manager state by clearing the target element reference.
|
|
978
|
+
* Should be called when the manager is no longer needed to prevent memory leaks.
|
|
979
|
+
*/
|
|
980
|
+
cleanup() {
|
|
981
|
+
this._targetElement = null;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
class KritzelColorHelper {
|
|
986
|
+
/**
|
|
987
|
+
* Resolves a color value based on the current theme.
|
|
988
|
+
* Handles both simple string colors and theme-aware color objects.
|
|
989
|
+
* @param color - The color to resolve (string or ThemeAwareColor)
|
|
990
|
+
* @param theme - Optional theme to use. If not provided, uses current theme from ThemeManager
|
|
991
|
+
* @returns The resolved hex color string, or empty string if color is undefined
|
|
992
|
+
*/
|
|
993
|
+
static resolveThemeColor(color, theme) {
|
|
994
|
+
if (!color) {
|
|
995
|
+
return '';
|
|
996
|
+
}
|
|
997
|
+
const currentTheme = theme ?? KritzelThemeManager.getStoredTheme();
|
|
998
|
+
return resolveColor(color, currentTheme);
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Applies opacity to a theme-aware color and returns an rgba string.
|
|
1002
|
+
* @param color - The theme-aware color object or a hex color string
|
|
1003
|
+
* @param opacity - The opacity value between 0 and 1
|
|
1004
|
+
* @param theme - Optional theme to use. If not provided, uses current theme from ThemeManager
|
|
1005
|
+
* @returns The color as an rgba string, or the resolved hex if opacity is 1
|
|
1006
|
+
*/
|
|
1007
|
+
static applyOpacity(color, opacity, theme) {
|
|
1008
|
+
const hexColor = typeof color === 'string' ? color : this.resolveThemeColor(color, theme);
|
|
1009
|
+
if (!hexColor || opacity >= 1)
|
|
1010
|
+
return hexColor;
|
|
1011
|
+
const sanitizedHex = hexColor.startsWith('#') ? hexColor.slice(1) : hexColor;
|
|
1012
|
+
let r, g, b;
|
|
1013
|
+
if (sanitizedHex.length === 3) {
|
|
1014
|
+
r = parseInt(sanitizedHex[0] + sanitizedHex[0], 16);
|
|
1015
|
+
g = parseInt(sanitizedHex[1] + sanitizedHex[1], 16);
|
|
1016
|
+
b = parseInt(sanitizedHex[2] + sanitizedHex[2], 16);
|
|
1017
|
+
}
|
|
1018
|
+
else if (sanitizedHex.length === 6) {
|
|
1019
|
+
r = parseInt(sanitizedHex.substring(0, 2), 16);
|
|
1020
|
+
g = parseInt(sanitizedHex.substring(2, 4), 16);
|
|
1021
|
+
b = parseInt(sanitizedHex.substring(4, 6), 16);
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
return hexColor;
|
|
1025
|
+
}
|
|
1026
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
1027
|
+
return hexColor;
|
|
1028
|
+
}
|
|
1029
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Determines the appropriate contrast color (black or white) based on the luminance of the given hex color.
|
|
1033
|
+
* Uses the relative luminance formula: 0.299*R + 0.587*G + 0.114*B
|
|
1034
|
+
* @param hexColor - The hex color string (with or without #)
|
|
1035
|
+
* @returns '#000000' for light backgrounds, '#ffffff' for dark backgrounds
|
|
1036
|
+
*/
|
|
1037
|
+
static getContrastColor(hexColor) {
|
|
1038
|
+
const sanitizedHex = hexColor.startsWith('#') ? hexColor.slice(1) : hexColor;
|
|
1039
|
+
let r, g, b;
|
|
1040
|
+
if (sanitizedHex.length === 3) {
|
|
1041
|
+
r = parseInt(sanitizedHex[0] + sanitizedHex[0], 16);
|
|
1042
|
+
g = parseInt(sanitizedHex[1] + sanitizedHex[1], 16);
|
|
1043
|
+
b = parseInt(sanitizedHex[2] + sanitizedHex[2], 16);
|
|
1044
|
+
}
|
|
1045
|
+
else if (sanitizedHex.length === 6) {
|
|
1046
|
+
r = parseInt(sanitizedHex.substring(0, 2), 16);
|
|
1047
|
+
g = parseInt(sanitizedHex.substring(2, 4), 16);
|
|
1048
|
+
b = parseInt(sanitizedHex.substring(4, 6), 16);
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
// Default to black for invalid colors
|
|
1052
|
+
return '#000000';
|
|
1053
|
+
}
|
|
1054
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
1055
|
+
return '#000000';
|
|
1056
|
+
}
|
|
1057
|
+
// Calculate relative luminance
|
|
1058
|
+
const luminance = 0.299 * r + 0.587 * g + 0.114 * b;
|
|
1059
|
+
// Use threshold of 150 (midpoint) for balanced contrast
|
|
1060
|
+
return luminance > 150 ? '#000000' : '#ffffff';
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Determines the appropriate text color for both light and dark themes based on the fill color.
|
|
1064
|
+
* Returns default theme-appropriate colors if the fill is transparent.
|
|
1065
|
+
* @param fillColor - The theme-aware fill color
|
|
1066
|
+
* @returns A theme-aware color object with appropriate text colors for both themes
|
|
1067
|
+
*/
|
|
1068
|
+
static determineTextColor(fillColor) {
|
|
1069
|
+
// Check if fillColor is transparent for both themes
|
|
1070
|
+
const isTransparentLight = fillColor.light === 'transparent';
|
|
1071
|
+
const isTransparentDark = fillColor.dark === 'transparent';
|
|
1072
|
+
if (isTransparentLight && isTransparentDark) {
|
|
1073
|
+
// Return default theme-appropriate colors for transparent fills
|
|
1074
|
+
return { light: '#000000', dark: '#ffffff' };
|
|
1075
|
+
}
|
|
1076
|
+
// Determine text color for each theme based on fill brightness
|
|
1077
|
+
const lightThemeTextColor = isTransparentLight
|
|
1078
|
+
? '#000000'
|
|
1079
|
+
: this.getContrastColor(fillColor.light);
|
|
1080
|
+
const darkThemeTextColor = isTransparentDark
|
|
1081
|
+
? '#ffffff'
|
|
1082
|
+
: this.getContrastColor(fillColor.dark);
|
|
1083
|
+
return {
|
|
1084
|
+
light: lightThemeTextColor,
|
|
1085
|
+
dark: darkThemeTextColor,
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export { DEFAULT_COLOR_PALETTE as D, KritzelThemeManager as K, ThemeHelper as T, KritzelColorHelper as a, darkTheme as d, lightTheme as l };
|