weifuwu 0.38.2 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +96 -66
  2. package/dist/client/app.d.ts +2 -6
  3. package/dist/client/error-boundary.d.ts +2 -2
  4. package/dist/client/index.d.ts +3 -1
  5. package/dist/client/index.js +350 -147
  6. package/dist/client/locale/en_US.d.ts +15 -0
  7. package/dist/client/locale/zh_CN.d.ts +15 -0
  8. package/dist/client/popup.d.ts +19 -0
  9. package/dist/client/render.d.ts +3 -3
  10. package/dist/client/router.d.ts +1 -1
  11. package/dist/client/types.d.ts +11 -5
  12. package/dist/client/vnode.d.ts +11 -2
  13. package/dist/components/Chart/Chart.d.ts +15 -0
  14. package/dist/components/Chart/chart-utils.d.ts +53 -0
  15. package/dist/components/DatePicker/DatePicker.d.ts +18 -0
  16. package/dist/components/DatePicker/calendar-utils.d.ts +30 -0
  17. package/dist/components/Dropdown/Dropdown.d.ts +3 -0
  18. package/dist/components/Editor/Editor.d.ts +13 -0
  19. package/dist/components/Editor/tools/format.d.ts +10 -0
  20. package/dist/components/Editor/tools/table.d.ts +7 -0
  21. package/dist/components/Editor/tools/toolbar.d.ts +9 -0
  22. package/dist/components/Editor/tools/types.d.ts +15 -0
  23. package/dist/components/FileUpload/FileUpload.d.ts +3 -0
  24. package/dist/components/Img/Img.d.ts +0 -2
  25. package/dist/components/InView/InView.d.ts +2 -17
  26. package/dist/components/Popover/Popover.d.ts +2 -12
  27. package/dist/components/Skeleton/Skeleton.d.ts +0 -8
  28. package/dist/components/Tooltip/Tooltip.d.ts +5 -1
  29. package/dist/components/index.d.ts +6 -0
  30. package/dist/components/index.js +1603 -343
  31. package/dist/components/style.css +734 -153
  32. package/dist/layout/weifuwu-layout.css +14 -0
  33. package/package.json +2 -2
@@ -795,15 +795,11 @@
795
795
  /* weifuwu/components — Dropdown */
796
796
 
797
797
  .wf-dropdown {
798
- position: relative;
799
798
  display: inline-block;
800
799
  }
801
800
 
802
801
  .wf-dropdown-menu {
803
- position: absolute;
804
- top: 100%;
805
- left: 0;
806
- margin-top: var(--wf-gap-xs);
802
+ position: fixed;
807
803
  min-width: 140px;
808
804
  background: var(--wf-color-bg);
809
805
  border: var(--wf-border-width) solid var(--wf-color-border);
@@ -816,7 +812,6 @@
816
812
  .wf-dropdown--open {
817
813
  z-index: var(--wf-cover-z);
818
814
  }
819
- }
820
815
 
821
816
  .wf-dropdown-item {
822
817
  display: block;
@@ -1598,99 +1593,84 @@
1598
1593
  /* weifuwu/components — Tooltip */
1599
1594
 
1600
1595
  .wf-tooltip-wrap {
1601
- position: relative;
1602
1596
  display: inline-flex;
1603
1597
  }
1604
1598
 
1605
1599
  .wf-tooltip {
1606
- position: absolute;
1600
+ position: fixed;
1607
1601
  z-index: var(--wf-cover-z, 1000);
1608
- display: flex;
1609
- flex-direction: column;
1610
- align-items: center;
1611
- pointer-events: none;
1612
- animation: wf-tooltip-fadein 0.15s ease-out;
1613
- }
1614
-
1615
- @keyframes wf-tooltip-fadein {
1616
- from { opacity: 0; }
1617
- to { opacity: 1; }
1618
- }
1619
-
1620
- .wf-tooltip-content {
1602
+ background: var(--wf-color-text);
1603
+ color: var(--wf-color-bg);
1621
1604
  font-family: var(--wf-font-sans);
1622
1605
  font-size: var(--wf-font-size-xs);
1623
- color: var(--wf-color-bg);
1624
- background: var(--wf-color-text);
1625
1606
  padding: var(--wf-space-xs) var(--wf-space-sm);
1626
1607
  border-radius: var(--wf-radius-sm);
1627
1608
  white-space: nowrap;
1609
+ pointer-events: none;
1628
1610
  max-width: 240px;
1629
- overflow: hidden;
1630
- text-overflow: ellipsis;
1631
- line-height: var(--wf-line-height-tight);
1632
1611
  }
1633
1612
 
1634
- .wf-tooltip-arrow {
1635
- width: 6px;
1636
- height: 6px;
1637
- background: var(--wf-color-text);
1638
- transform: rotate(45deg);
1639
- border-radius: 1px;
1613
+ .wf-tooltip--hidden {
1614
+ visibility: hidden;
1640
1615
  }
1641
1616
 
1642
- /* 位置: top (默认) */
1643
- .wf-tooltip--top {
1644
- bottom: 100%;
1645
- left: 50%;
1617
+ .wf-tooltip--bottom {
1646
1618
  transform: translateX(-50%);
1647
- padding-bottom: 4px;
1648
1619
  }
1649
1620
 
1650
- .wf-tooltip--top .wf-tooltip-arrow {
1651
- order: 1;
1652
- margin-top: -3px;
1621
+ .wf-tooltip--top {
1622
+ transform: translateX(-50%) translateY(-100%);
1653
1623
  }
1654
1624
 
1655
- /* 位置: bottom */
1656
- .wf-tooltip--bottom {
1657
- top: 100%;
1658
- left: 50%;
1659
- transform: translateX(-50%);
1660
- padding-top: 4px;
1625
+ .wf-tooltip--left {
1626
+ transform: translateY(-50%) translateX(-100%);
1661
1627
  }
1662
1628
 
1663
- .wf-tooltip--bottom .wf-tooltip-arrow {
1664
- order: -1;
1665
- margin-bottom: -3px;
1629
+ .wf-tooltip--right {
1630
+ transform: translateY(-50%);
1666
1631
  }
1667
1632
 
1668
- /* 位置: left */
1669
- .wf-tooltip--left {
1670
- right: 100%;
1671
- top: 50%;
1672
- transform: translateY(-50%);
1673
- padding-right: 4px;
1674
- flex-direction: row;
1633
+ .wf-tooltip-arrow {
1634
+ position: absolute;
1635
+ width: 0;
1636
+ height: 0;
1637
+ border: 5px solid transparent;
1675
1638
  }
1676
1639
 
1677
- .wf-tooltip--left .wf-tooltip-arrow {
1678
- order: 1;
1679
- margin-left: -3px;
1640
+ .wf-tooltip--bottom .wf-tooltip-arrow {
1641
+ top: -5px;
1642
+ left: 50%;
1643
+ transform: translateX(-50%);
1644
+ border-bottom-color: var(--wf-color-text);
1645
+ border-top: none;
1680
1646
  }
1681
1647
 
1682
- /* 位置: right */
1683
- .wf-tooltip--right {
1648
+ .wf-tooltip--top .wf-tooltip-arrow {
1649
+ top: 100%;
1650
+ left: 50%;
1651
+ transform: translateX(-50%);
1652
+ border-top-color: var(--wf-color-text);
1653
+ border-bottom: none;
1654
+ }
1655
+
1656
+ .wf-tooltip--left .wf-tooltip-arrow {
1684
1657
  left: 100%;
1685
1658
  top: 50%;
1686
1659
  transform: translateY(-50%);
1687
- padding-left: 4px;
1688
- flex-direction: row;
1660
+ border-left-color: var(--wf-color-text);
1661
+ border-right: none;
1689
1662
  }
1690
1663
 
1691
1664
  .wf-tooltip--right .wf-tooltip-arrow {
1692
- order: -1;
1693
- margin-right: -3px;
1665
+ left: -5px;
1666
+ top: 50%;
1667
+ transform: translateY(-50%);
1668
+ border-right-color: var(--wf-color-text);
1669
+ border-left: none;
1670
+ }
1671
+
1672
+ .wf-tooltip-content {
1673
+ line-height: 1.4;
1694
1674
  }
1695
1675
 
1696
1676
  /* weifuwu/components — Drawer */
@@ -1837,8 +1817,7 @@
1837
1817
  /* weifuwu/components — Popover */
1838
1818
 
1839
1819
  .wf-popover-wrap {
1840
- position: relative;
1841
- display: inline-flex;
1820
+ display: inline-block;
1842
1821
  }
1843
1822
 
1844
1823
  .wf-popover-overlay {
@@ -1848,111 +1827,46 @@
1848
1827
  }
1849
1828
 
1850
1829
  .wf-popover {
1851
- position: absolute;
1830
+ position: fixed;
1852
1831
  z-index: 999;
1853
- display: flex;
1854
- flex-direction: column;
1855
- align-items: center;
1856
- animation: wf-popover-fadein 0.15s ease-out;
1857
- }
1858
-
1859
- @keyframes wf-popover-fadein {
1860
- from { opacity: 0; }
1861
- to { opacity: 1; }
1862
- }
1863
-
1864
- .wf-popover-content {
1865
- font-family: var(--wf-font-sans);
1866
- font-size: var(--wf-font-size-sm);
1867
- color: var(--wf-color-text);
1868
1832
  background: var(--wf-color-bg);
1869
- border: 1px solid var(--wf-color-border);
1870
- border-radius: var(--wf-radius);
1871
- box-shadow: 0 4px 12px rgba(0,0,0,0.1);
1872
- padding: var(--wf-space-sm);
1873
- min-width: 120px;
1833
+ border: var(--wf-border-width) solid var(--wf-color-border);
1834
+ border-radius: var(--wf-radius-md);
1835
+ box-shadow: var(--wf-shadow-md);
1836
+ padding: var(--wf-space);
1837
+ min-width: 160px;
1874
1838
  max-width: 320px;
1875
- line-height: var(--wf-line-height-normal);
1876
- }
1877
-
1878
- .wf-popover-arrow {
1879
- width: 8px;
1880
- height: 8px;
1881
- background: var(--wf-color-bg);
1882
- border: 1px solid var(--wf-color-border);
1883
- transform: rotate(45deg);
1884
- border-radius: 1px;
1885
- }
1886
-
1887
- .wf-popover-arrow {
1888
- border-bottom: none;
1889
- border-right: none;
1890
- }
1891
-
1892
- /* 位置: top */
1893
- .wf-popover--top {
1894
- bottom: 100%;
1895
- left: 50%;
1896
- transform: translateX(-50%);
1897
- padding-bottom: 6px;
1898
- }
1899
-
1900
- .wf-popover--top .wf-popover-arrow {
1901
- order: 1;
1902
- margin-top: -4px;
1903
- border: none;
1904
- border-top: 1px solid var(--wf-color-border);
1905
- border-left: 1px solid var(--wf-color-border);
1906
1839
  }
1907
1840
 
1908
- /* 位置: bottom */
1909
1841
  .wf-popover--bottom {
1910
- top: 100%;
1911
- left: 50%;
1912
1842
  transform: translateX(-50%);
1913
- padding-top: 6px;
1914
1843
  }
1915
1844
 
1916
- .wf-popover--bottom .wf-popover-arrow {
1917
- order: -1;
1918
- margin-bottom: -4px;
1919
- border: none;
1920
- border-bottom: 1px solid var(--wf-color-border);
1921
- border-right: 1px solid var(--wf-color-border);
1845
+ .wf-popover--top {
1846
+ transform: translateX(-50%) translateY(-100%);
1922
1847
  }
1923
1848
 
1924
- /* 位置: left */
1925
1849
  .wf-popover--left {
1926
- right: 100%;
1927
- top: 50%;
1850
+ transform: translateY(-50%) translateX(-100%);
1851
+ }
1852
+
1853
+ .wf-popover--right {
1928
1854
  transform: translateY(-50%);
1929
- padding-right: 6px;
1930
- flex-direction: row;
1931
1855
  }
1932
1856
 
1933
- .wf-popover--left .wf-popover-arrow {
1934
- order: 1;
1935
- margin-left: -4px;
1936
- border: none;
1937
- border-left: 1px solid var(--wf-color-border);
1938
- border-bottom: 1px solid var(--wf-color-border);
1857
+ .wf-popover-arrow {
1858
+ display: none;
1939
1859
  }
1940
1860
 
1941
- /* 位置: right */
1942
- .wf-popover--right {
1943
- left: 100%;
1944
- top: 50%;
1945
- transform: translateY(-50%);
1946
- padding-left: 6px;
1947
- flex-direction: row;
1861
+ .wf-popover-content {
1862
+ font-family: var(--wf-font-sans);
1863
+ font-size: var(--wf-font-size-sm);
1864
+ color: var(--wf-color-text);
1865
+ line-height: var(--wf-line-height);
1948
1866
  }
1949
1867
 
1950
- .wf-popover--right .wf-popover-arrow {
1951
- order: -1;
1952
- margin-right: -4px;
1953
- border: none;
1954
- border-right: 1px solid var(--wf-color-border);
1955
- border-top: 1px solid var(--wf-color-border);
1868
+ .wf-popover-trigger {
1869
+ display: inline-flex;
1956
1870
  }
1957
1871
 
1958
1872
  /* weifuwu/components — Skeleton */
@@ -2003,6 +1917,14 @@
2003
1917
  width: 60%;
2004
1918
  }
2005
1919
 
1920
+ /* weifuwu/components — Image */
1921
+
1922
+ .wf-image {
1923
+ max-width: 100%;
1924
+ height: auto;
1925
+ display: block;
1926
+ }
1927
+
2006
1928
  /* weifuwu/components — InView */
2007
1929
 
2008
1930
  .wf-inview {
@@ -2029,3 +1951,662 @@
2029
1951
  content: '滚动到此处加载内容';
2030
1952
  }
2031
1953
 
1954
+ /* weifuwu/components — DatePicker */
1955
+
1956
+ .wf-datepicker {
1957
+ position: relative;
1958
+ display: inline-block;
1959
+ width: 100%;
1960
+ }
1961
+
1962
+ .wf-datepicker-input {
1963
+ font-family: var(--wf-font-sans);
1964
+ font-size: var(--wf-font-size-sm);
1965
+ padding: var(--wf-space-sm) var(--wf-space);
1966
+ border: var(--wf-border-width) solid var(--wf-color-border);
1967
+ border-radius: var(--wf-radius);
1968
+ background: var(--wf-color-bg);
1969
+ color: var(--wf-color-text);
1970
+ outline: none;
1971
+ width: 100%;
1972
+ cursor: pointer;
1973
+ box-sizing: border-box;
1974
+ }
1975
+
1976
+ .wf-datepicker-input:focus {
1977
+ border-color: var(--wf-color-primary);
1978
+ box-shadow: var(--wf-focus-ring);
1979
+ }
1980
+
1981
+ .wf-datepicker--disabled .wf-datepicker-input {
1982
+ opacity: var(--wf-opacity-disabled);
1983
+ cursor: not-allowed;
1984
+ }
1985
+
1986
+ /* ── 遮罩 ── */
1987
+
1988
+ .wf-datepicker-overlay {
1989
+ position: fixed;
1990
+ inset: 0;
1991
+ z-index: calc(var(--wf-pop-z) - 1);
1992
+ }
1993
+
1994
+ /* ── 日历面板 ── */
1995
+
1996
+ .wf-datepicker-dropdown {
1997
+ position: fixed;
1998
+ z-index: var(--wf-pop-z);
1999
+ background: var(--wf-color-bg);
2000
+ border: var(--wf-border-width) solid var(--wf-color-border);
2001
+ border-radius: var(--wf-radius-md);
2002
+ box-shadow: var(--wf-shadow-md);
2003
+ padding: var(--wf-space);
2004
+ min-width: 260px;
2005
+ user-select: none;
2006
+ }
2007
+
2008
+ .wf-datepicker-header {
2009
+ display: flex;
2010
+ align-items: center;
2011
+ justify-content: space-between;
2012
+ margin-bottom: var(--wf-space);
2013
+ }
2014
+
2015
+ .wf-datepicker-header-title {
2016
+ font-family: var(--wf-font-sans);
2017
+ font-size: var(--wf-font-size-sm);
2018
+ font-weight: var(--wf-font-weight-semibold);
2019
+ color: var(--wf-color-text);
2020
+ }
2021
+
2022
+ .wf-datepicker-header-btn {
2023
+ font-family: var(--wf-font-sans);
2024
+ font-size: var(--wf-font-size-sm);
2025
+ padding: var(--wf-space-xs) var(--wf-space-sm);
2026
+ border: none;
2027
+ border-radius: var(--wf-radius-sm);
2028
+ background: transparent;
2029
+ color: var(--wf-color-text-secondary);
2030
+ cursor: pointer;
2031
+ }
2032
+
2033
+ .wf-datepicker-header-btn:hover {
2034
+ background: var(--wf-color-bg-tertiary);
2035
+ color: var(--wf-color-text);
2036
+ }
2037
+
2038
+ .wf-datepicker-weekdays {
2039
+ display: grid;
2040
+ grid-template-columns: repeat(7, 1fr);
2041
+ gap: 2px;
2042
+ margin-bottom: 4px;
2043
+ }
2044
+
2045
+ .wf-datepicker-weekday {
2046
+ text-align: center;
2047
+ font-family: var(--wf-font-sans);
2048
+ font-size: var(--wf-font-size-xs);
2049
+ color: var(--wf-color-text-tertiary);
2050
+ padding: 4px 0;
2051
+ }
2052
+
2053
+ .wf-datepicker-grid {
2054
+ display: grid;
2055
+ grid-template-columns: repeat(7, 1fr);
2056
+ gap: 2px;
2057
+ }
2058
+
2059
+ .wf-datepicker-cell {
2060
+ display: flex;
2061
+ align-items: center;
2062
+ justify-content: center;
2063
+ width: 32px;
2064
+ height: 32px;
2065
+ font-family: var(--wf-font-sans);
2066
+ font-size: var(--wf-font-size-sm);
2067
+ color: var(--wf-color-text);
2068
+ border-radius: var(--wf-radius-sm);
2069
+ cursor: pointer;
2070
+ border: none;
2071
+ background: transparent;
2072
+ }
2073
+
2074
+ .wf-datepicker-cell:hover {
2075
+ background: var(--wf-color-bg-tertiary);
2076
+ }
2077
+
2078
+ .wf-datepicker-cell--other-month {
2079
+ color: var(--wf-color-text-disabled);
2080
+ }
2081
+
2082
+ .wf-datepicker-cell--today {
2083
+ font-weight: var(--wf-font-weight-bold);
2084
+ }
2085
+
2086
+ .wf-datepicker-cell--selected {
2087
+ background: var(--wf-color-primary);
2088
+ color: #fff;
2089
+ }
2090
+
2091
+ .wf-datepicker-cell--in-range {
2092
+ background: var(--wf-color-primary-bg);
2093
+ border-radius: 0;
2094
+ }
2095
+
2096
+ .wf-datepicker-cell--range-edge {
2097
+ background: var(--wf-color-primary);
2098
+ color: #fff;
2099
+ }
2100
+
2101
+ /* ── 区间模式 ── */
2102
+
2103
+ .wf-datepicker-range-wrap {
2104
+ position: fixed;
2105
+ z-index: var(--wf-pop-z);
2106
+ display: flex;
2107
+ gap: var(--wf-space);
2108
+ background: var(--wf-color-bg);
2109
+ border: var(--wf-border-width) solid var(--wf-color-border);
2110
+ border-radius: var(--wf-radius-md);
2111
+ box-shadow: var(--wf-shadow-md);
2112
+ padding: var(--wf-space);
2113
+ user-select: none;
2114
+ }
2115
+
2116
+ .wf-datepicker-range-panel {
2117
+ min-width: 240px;
2118
+ }
2119
+
2120
+ /* ── 时间选择 ── */
2121
+
2122
+ .wf-time-picker {
2123
+ position: fixed;
2124
+ z-index: var(--wf-pop-z);
2125
+ background: var(--wf-color-bg);
2126
+ border: var(--wf-border-width) solid var(--wf-color-border);
2127
+ border-radius: var(--wf-radius-md);
2128
+ box-shadow: var(--wf-shadow-md);
2129
+ padding: var(--wf-space);
2130
+ min-width: 200px;
2131
+ user-select: none;
2132
+ }
2133
+
2134
+ .wf-time-body {
2135
+ display: flex;
2136
+ gap: var(--wf-space-lg);
2137
+ justify-content: center;
2138
+ padding: var(--wf-space) 0;
2139
+ }
2140
+
2141
+ .wf-time-col {
2142
+ display: flex;
2143
+ flex-direction: column;
2144
+ align-items: center;
2145
+ gap: 4px;
2146
+ }
2147
+
2148
+ .wf-time-col-label {
2149
+ font-family: var(--wf-font-sans);
2150
+ font-size: var(--wf-font-size-xs);
2151
+ color: var(--wf-color-text-tertiary);
2152
+ }
2153
+
2154
+ .wf-time-opt-list {
2155
+ display: flex;
2156
+ flex-direction: column;
2157
+ gap: 2px;
2158
+ max-height: 200px;
2159
+ overflow-y: auto;
2160
+ }
2161
+
2162
+ .wf-time-opt {
2163
+ font-family: var(--wf-font-mono);
2164
+ font-size: var(--wf-font-size-sm);
2165
+ padding: 2px 12px;
2166
+ border: none;
2167
+ border-radius: var(--wf-radius-sm);
2168
+ background: transparent;
2169
+ color: var(--wf-color-text);
2170
+ cursor: pointer;
2171
+ text-align: center;
2172
+ }
2173
+
2174
+ .wf-time-opt:hover {
2175
+ background: var(--wf-color-bg-tertiary);
2176
+ }
2177
+
2178
+ .wf-time-opt--selected {
2179
+ background: var(--wf-color-primary);
2180
+ color: #fff;
2181
+ }
2182
+
2183
+ .wf-time-footer {
2184
+ display: flex;
2185
+ justify-content: flex-end;
2186
+ gap: var(--wf-gap-sm);
2187
+ padding-top: var(--wf-space-sm);
2188
+ border-top: var(--wf-border-width) solid var(--wf-color-border-light);
2189
+ }
2190
+
2191
+ /* ── datetime 模式 ── */
2192
+
2193
+ .wf-datetime-time {
2194
+ display: flex;
2195
+ align-items: center;
2196
+ gap: var(--wf-gap-sm);
2197
+ margin-top: var(--wf-space);
2198
+ padding-top: var(--wf-space-sm);
2199
+ border-top: var(--wf-border-width) solid var(--wf-color-border-light);
2200
+ }
2201
+
2202
+ .wf-datetime-time-label {
2203
+ font-family: var(--wf-font-sans);
2204
+ font-size: var(--wf-font-size-xs);
2205
+ color: var(--wf-color-text-secondary);
2206
+ }
2207
+
2208
+ .wf-datetime-time-select {
2209
+ display: flex;
2210
+ align-items: center;
2211
+ gap: 2px;
2212
+ }
2213
+
2214
+ .wf-datetime-select {
2215
+ font-family: var(--wf-font-sans);
2216
+ font-size: var(--wf-font-size-sm);
2217
+ padding: 2px 4px;
2218
+ border: var(--wf-border-width) solid var(--wf-color-border);
2219
+ border-radius: var(--wf-radius-sm);
2220
+ background: var(--wf-color-bg);
2221
+ color: var(--wf-color-text);
2222
+ outline: none;
2223
+ cursor: pointer;
2224
+ }
2225
+
2226
+ .wf-datetime-sep {
2227
+ font-family: var(--wf-font-mono);
2228
+ font-size: var(--wf-font-size-sm);
2229
+ color: var(--wf-color-text-tertiary);
2230
+ padding: 0 2px;
2231
+ }
2232
+
2233
+ /* weifuwu/components — Chart */
2234
+
2235
+ .wf-chart {
2236
+ position: relative;
2237
+ display: inline-block;
2238
+ font-family: var(--wf-font-sans);
2239
+ }
2240
+
2241
+ .wf-chart-title {
2242
+ font-size: var(--wf-font-size-sm);
2243
+ font-weight: var(--wf-font-weight-semibold);
2244
+ color: var(--wf-color-text);
2245
+ margin-bottom: var(--wf-space-sm);
2246
+ text-align: center;
2247
+ }
2248
+
2249
+ .wf-chart svg {
2250
+ display: block;
2251
+ }
2252
+
2253
+ /* ── 图例 ── */
2254
+
2255
+ .wf-chart-legend {
2256
+ display: flex;
2257
+ flex-wrap: wrap;
2258
+ gap: var(--wf-gap-sm);
2259
+ justify-content: center;
2260
+ margin-top: var(--wf-space-sm);
2261
+ }
2262
+
2263
+ .wf-chart-legend-item {
2264
+ display: inline-flex;
2265
+ align-items: center;
2266
+ gap: 4px;
2267
+ font-size: var(--wf-font-size-xs);
2268
+ color: var(--wf-color-text-secondary);
2269
+ }
2270
+
2271
+ .wf-chart-legend-dot {
2272
+ width: 8px;
2273
+ height: 8px;
2274
+ border-radius: 50%;
2275
+ display: inline-block;
2276
+ }
2277
+
2278
+ /* ── Tooltip ── */
2279
+
2280
+ .wf-chart-tooltip {
2281
+ position: fixed;
2282
+ z-index: var(--wf-cover-z, 1000);
2283
+ background: var(--wf-color-text);
2284
+ color: var(--wf-color-bg);
2285
+ padding: var(--wf-space-xs) var(--wf-space-sm);
2286
+ border-radius: var(--wf-radius-sm);
2287
+ font-size: var(--wf-font-size-xs);
2288
+ pointer-events: none;
2289
+ transform: translate(-50%, -100%);
2290
+ white-space: nowrap;
2291
+ }
2292
+
2293
+ .wf-chart-tooltip-label {
2294
+ font-weight: var(--wf-font-weight-semibold);
2295
+ }
2296
+
2297
+ .wf-chart-tooltip-value {
2298
+ opacity: 0.8;
2299
+ }
2300
+
2301
+ /* weifuwu/components — Editor */
2302
+
2303
+ .wf-editor { position: relative;
2304
+ display: flex;
2305
+ flex-direction: column;
2306
+ border: var(--wf-border-width) solid var(--wf-color-border);
2307
+ border-radius: var(--wf-radius);
2308
+ background: var(--wf-color-bg);
2309
+ overflow: hidden;
2310
+ transition: border-color var(--wf-transition), box-shadow var(--wf-transition);
2311
+ }
2312
+
2313
+ .wf-editor:focus-within {
2314
+ border-color: var(--wf-color-primary);
2315
+ box-shadow: var(--wf-focus-ring);
2316
+ }
2317
+
2318
+ .wf-editor--disabled {
2319
+ opacity: var(--wf-opacity-disabled);
2320
+ cursor: not-allowed;
2321
+ background: var(--wf-color-bg-secondary, #f9fafb);
2322
+ }
2323
+
2324
+ /* ── 工具栏 ────────────────────────────────────────── */
2325
+
2326
+ .wf-editor-toolbar {
2327
+ display: flex;
2328
+ align-items: center;
2329
+ gap: 2px;
2330
+ padding: var(--wf-space-xs) var(--wf-space-sm);
2331
+ border-bottom: var(--wf-border-width) solid var(--wf-color-border);
2332
+ background: var(--wf-color-bg-secondary, #f9fafb);
2333
+ flex-wrap: wrap;
2334
+ user-select: none;
2335
+ }
2336
+
2337
+ .wf-editor-tb-btn {
2338
+ display: inline-flex;
2339
+ align-items: center;
2340
+ justify-content: center;
2341
+ min-width: 32px;
2342
+ height: 32px;
2343
+ padding: 0 var(--wf-space-xs);
2344
+ border: none;
2345
+ border-radius: var(--wf-radius-sm, 4px);
2346
+ background: transparent;
2347
+ color: var(--wf-color-text);
2348
+ font-size: var(--wf-font-size-sm);
2349
+ font-weight: var(--wf-font-weight-semibold, 600);
2350
+ cursor: pointer;
2351
+ transition: background 0.15s;
2352
+ }
2353
+
2354
+ .wf-editor-tb-btn:hover {
2355
+ background: var(--wf-color-bg-tertiary, #e5e7eb);
2356
+ }
2357
+
2358
+ .wf-editor-tb-btn--active {
2359
+ background: var(--wf-color-primary-light, #e0f2fe);
2360
+ color: var(--wf-color-primary);
2361
+ }
2362
+
2363
+ .wf-editor-tb-btn--active:hover {
2364
+ background: var(--wf-color-primary-lighter, #bae6fd);
2365
+ }
2366
+
2367
+ .wf-editor-tb-btn--link {
2368
+ font-size: 14px;
2369
+ }
2370
+
2371
+ .wf-editor-tb-sep {
2372
+ display: inline-block;
2373
+ width: 1px;
2374
+ height: 20px;
2375
+ margin: 0 4px;
2376
+ background: var(--wf-color-border);
2377
+ }
2378
+
2379
+ /* ── 编辑区 ────────────────────────────────────────── */
2380
+
2381
+ .wf-editor-content {
2382
+ padding: var(--wf-space-sm) var(--wf-space);
2383
+ min-height: 200px;
2384
+ outline: none;
2385
+ font-family: var(--wf-font-sans);
2386
+ font-size: var(--wf-font-size-sm);
2387
+ line-height: var(--wf-line-height);
2388
+ color: var(--wf-color-text);
2389
+ overflow-y: auto;
2390
+ }
2391
+
2392
+ .wf-editor-content--disabled {
2393
+ pointer-events: none;
2394
+ }
2395
+
2396
+ .wf-editor-content--has-placeholder:empty::before {
2397
+ content: attr(data-placeholder);
2398
+ color: var(--wf-color-text-tertiary);
2399
+ pointer-events: none;
2400
+ }
2401
+
2402
+ /* 编辑区内部元素样式 */
2403
+ .wf-editor-content h1 {
2404
+ font-size: var(--wf-font-size-2xl, 1.5rem);
2405
+ font-weight: var(--wf-font-weight-bold, 700);
2406
+ margin: 0.5em 0 0.25em;
2407
+ line-height: 1.3;
2408
+ }
2409
+
2410
+ .wf-editor-content h2 {
2411
+ font-size: var(--wf-font-size-xl, 1.25rem);
2412
+ font-weight: var(--wf-font-weight-bold, 700);
2413
+ margin: 0.5em 0 0.25em;
2414
+ line-height: 1.3;
2415
+ }
2416
+
2417
+ .wf-editor-content h3 {
2418
+ font-size: var(--wf-font-size-lg, 1.125rem);
2419
+ font-weight: var(--wf-font-weight-semibold, 600);
2420
+ margin: 0.4em 0 0.2em;
2421
+ line-height: 1.3;
2422
+ }
2423
+
2424
+ .wf-editor-content ul,
2425
+ .wf-editor-content ol {
2426
+ padding-left: 1.5em;
2427
+ margin: 0.25em 0;
2428
+ }
2429
+
2430
+ .wf-editor-content li {
2431
+ margin: 0.15em 0;
2432
+ }
2433
+
2434
+ .wf-editor-content a {
2435
+ color: var(--wf-color-primary);
2436
+ text-decoration: underline;
2437
+ }
2438
+
2439
+ .wf-editor-content blockquote {
2440
+ margin: 0.5em 0;
2441
+ padding: var(--wf-space-xs) var(--wf-space);
2442
+ border-left: 3px solid var(--wf-color-primary);
2443
+ background: var(--wf-color-bg-secondary, #f9fafb);
2444
+ color: var(--wf-color-text-secondary);
2445
+ font-style: italic;
2446
+ }
2447
+
2448
+ .wf-editor-content hr {
2449
+ border: none;
2450
+ border-top: 1px solid var(--wf-color-border);
2451
+ margin: 0.75em 0;
2452
+ }
2453
+
2454
+ .wf-editor-content[style*="text-align: center"] {
2455
+ text-align: center;
2456
+ }
2457
+
2458
+ .wf-editor-content[style*="text-align: right"] {
2459
+ text-align: right;
2460
+ }
2461
+
2462
+ /* ── 源码模式 ──────────────────────────────────────── */
2463
+
2464
+ .wf-editor-source {
2465
+ display: block;
2466
+ width: 100%;
2467
+ min-height: 200px;
2468
+ padding: var(--wf-space-sm) var(--wf-space);
2469
+ border: none;
2470
+ outline: none;
2471
+ font-family: var(--wf-font-mono, 'SF Mono', 'Fira Code', 'Consolas', monospace);
2472
+ font-size: var(--wf-font-size-sm);
2473
+ line-height: 1.6;
2474
+ color: var(--wf-color-text);
2475
+ background: var(--wf-color-bg-secondary, #f9fafb);
2476
+ resize: vertical;
2477
+ tab-size: 2;
2478
+ }
2479
+
2480
+ .wf-editor-source:focus {
2481
+ background: var(--wf-color-bg);
2482
+ }
2483
+
2484
+ /* ── 弹窗内输入框 ──────────────────────────────────── */
2485
+
2486
+ .wf-editor-link-input {
2487
+ display: block;
2488
+ width: 100%;
2489
+ box-sizing: border-box;
2490
+ font-family: var(--wf-font-sans);
2491
+ font-size: var(--wf-font-size-sm);
2492
+ padding: var(--wf-space-sm) var(--wf-space);
2493
+ border: var(--wf-border-width) solid var(--wf-color-border);
2494
+ border-radius: var(--wf-radius);
2495
+ outline: none;
2496
+ background: var(--wf-color-bg);
2497
+ color: var(--wf-color-text);
2498
+ }
2499
+
2500
+ .wf-editor-link-input:focus {
2501
+ border-color: var(--wf-color-primary);
2502
+ box-shadow: var(--wf-focus-ring);
2503
+ }
2504
+
2505
+ /* ── 图片上传区域 ──────────────────────────────────── */
2506
+
2507
+ .wf-editor-img-zone {
2508
+ display: flex;
2509
+ flex-direction: column;
2510
+ align-items: center;
2511
+ justify-content: center;
2512
+ gap: 6px;
2513
+ padding: var(--wf-space-lg) var(--wf-space);
2514
+ cursor: pointer;
2515
+ text-align: center;
2516
+ }
2517
+
2518
+ .wf-editor-img-zone-icon {
2519
+ font-size: 28px;
2520
+ line-height: 1;
2521
+ }
2522
+
2523
+ .wf-editor-img-zone-text {
2524
+ font-size: var(--wf-font-size-sm);
2525
+ color: var(--wf-color-text-secondary);
2526
+ }
2527
+
2528
+ .wf-editor-img-or {
2529
+ display: block;
2530
+ text-align: center;
2531
+ color: var(--wf-color-text-tertiary);
2532
+ font-size: var(--wf-font-size-sm);
2533
+ }
2534
+
2535
+ /* 编辑区内图片 */
2536
+ .wf-editor-content img {
2537
+ max-width: 100%;
2538
+ height: auto;
2539
+ border-radius: var(--wf-radius-sm, 4px);
2540
+ margin: 0.5em 0;
2541
+ }
2542
+
2543
+ /* ── 编辑区内表格 ──────────────────────────────────── */
2544
+
2545
+ .wf-editor-table {
2546
+ border-collapse: collapse;
2547
+ width: 100%;
2548
+ margin: 0.5em 0;
2549
+ font-size: var(--wf-font-size-sm);
2550
+ }
2551
+
2552
+ .wf-editor-table th,
2553
+ .wf-editor-table td {
2554
+ border: 1px solid var(--wf-color-border);
2555
+ padding: var(--wf-space-xs) var(--wf-space-sm);
2556
+ vertical-align: top;
2557
+ min-width: 40px;
2558
+ }
2559
+
2560
+ .wf-editor-table tbody tr:nth-child(even) {
2561
+ background: var(--wf-color-bg-secondary, #f9fafb);
2562
+ }
2563
+
2564
+ /* ── 表格选择网格 ──────────────────────────────────── */
2565
+
2566
+ .wf-editor-table-picker {
2567
+
2568
+ z-index: 100;
2569
+ background: var(--wf-color-bg);
2570
+ border: var(--wf-border-width) solid var(--wf-color-border);
2571
+ border-radius: var(--wf-radius);
2572
+ padding: var(--wf-space-sm);
2573
+ box-shadow: var(--wf-shadow-lg, 0 4px 12px rgba(0,0,0,0.12));
2574
+ /* 定位在工具栏下方 */
2575
+ }
2576
+
2577
+ .wf-editor-table-grid {
2578
+ display: flex;
2579
+ flex-direction: column;
2580
+ gap: 2px;
2581
+ }
2582
+
2583
+ .wf-editor-table-grid-row {
2584
+ display: flex;
2585
+ gap: 2px;
2586
+ }
2587
+
2588
+ .wf-editor-table-grid-cell {
2589
+ width: 18px;
2590
+ height: 18px;
2591
+ border: 1px solid var(--wf-color-border);
2592
+ border-radius: 2px;
2593
+ cursor: pointer;
2594
+ background: var(--wf-color-bg);
2595
+ transition: background 0.1s, border-color 0.1s;
2596
+ }
2597
+
2598
+ .wf-editor-table-grid-cell:hover,
2599
+ .wf-editor-table-grid-cell--active {
2600
+ background: var(--wf-color-primary-light, #e0f2fe);
2601
+ border-color: var(--wf-color-primary);
2602
+ }
2603
+
2604
+ .wf-editor-table-picker-label {
2605
+ text-align: center;
2606
+ font-size: var(--wf-font-size-xs);
2607
+ color: var(--wf-color-text-secondary);
2608
+ margin-top: var(--wf-space-xs);
2609
+ padding-top: var(--wf-space-xs);
2610
+ border-top: 1px solid var(--wf-color-border);
2611
+ }
2612
+