@arronqzy/react-view 1.0.39 → 1.0.40
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/styles.css +316 -241
- package/package.json +7 -7
- package/src/panel/ReactViewPanel.tsx +80 -71
- package/src/panel/components/ElementsLayer.tsx +1 -1
- package/src/panel/components/MaterialSidebar.tsx +304 -264
- package/src/panel/components/MoveableLayer.tsx +11 -2
- package/src/panel/components/PanelCanvas.tsx +1 -0
- package/src/panel/components/PanelConfigSidebar.tsx +49 -65
- package/src/panel/components/PanelLayerDock.tsx +397 -316
- package/src/panel/components/PanelRulers.tsx +169 -42
- package/src/panel/components/SelectLayer.tsx +2 -2
- package/src/panel/components/WorkspaceProjectNav.tsx +1 -1
- package/src/panel/icons.tsx +117 -0
- package/src/tailwind.css +66 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arronqzy/react-view",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"files": [
|
|
5
5
|
"src",
|
|
6
6
|
"dist",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@codemirror/lang-json": "^6.0.1",
|
|
31
31
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
32
32
|
"@codemirror/view": "^6.36.2",
|
|
33
|
-
"@arronqzy/i18n": "0.1.17",
|
|
34
|
-
"@arronqzy/ui": "1.0.10",
|
|
35
33
|
"@arronqzy/blueprint-dsl": "1.0.17",
|
|
34
|
+
"@arronqzy/ui": "1.0.11",
|
|
35
|
+
"@arronqzy/i18n": "0.1.17",
|
|
36
|
+
"@arronqzy/react-blueprint": "1.0.25",
|
|
36
37
|
"@arronqzy/rx-store": "1.0.8",
|
|
37
38
|
"@arronqzy/view-scene3d": "0.1.5",
|
|
38
39
|
"@arronqzy/view-table": "0.1.8",
|
|
39
|
-
"@arronqzy/webllm-assistant": "0.1.16"
|
|
40
|
-
"@arronqzy/react-blueprint": "1.0.24"
|
|
40
|
+
"@arronqzy/webllm-assistant": "0.1.16"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "^19.0.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"eslint": "^8.57.0",
|
|
47
47
|
"typescript": "^5.5.4",
|
|
48
48
|
"@arronqzy/eslint-config": "0.0.0",
|
|
49
|
-
"@arronqzy/
|
|
50
|
-
"@arronqzy/
|
|
49
|
+
"@arronqzy/typescript-config": "1.0.0",
|
|
50
|
+
"@arronqzy/tailwind": "1.0.2"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
@@ -111,13 +111,16 @@ import { PANEL_Z_INDEX } from "./constants/zIndex";
|
|
|
111
111
|
import { useRafThrottledScroll } from "./hooks/useRafThrottledScroll";
|
|
112
112
|
import {
|
|
113
113
|
IconBackward,
|
|
114
|
+
IconBlueprint,
|
|
114
115
|
IconBringFront,
|
|
115
116
|
IconClose,
|
|
116
117
|
IconForward,
|
|
117
118
|
IconImage,
|
|
118
119
|
IconLayers,
|
|
120
|
+
IconMoon,
|
|
119
121
|
IconRedo,
|
|
120
122
|
IconSendBack,
|
|
123
|
+
IconSun,
|
|
121
124
|
IconUndo,
|
|
122
125
|
} from "./icons";
|
|
123
126
|
import {
|
|
@@ -138,7 +141,6 @@ import {
|
|
|
138
141
|
ResizableHandle,
|
|
139
142
|
ResizablePanel,
|
|
140
143
|
ResizablePanelGroup,
|
|
141
|
-
Switch,
|
|
142
144
|
Toaster,
|
|
143
145
|
Tooltip,
|
|
144
146
|
TooltipContent,
|
|
@@ -1907,13 +1909,37 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
1907
1909
|
</Tooltip>
|
|
1908
1910
|
</TooltipProvider>
|
|
1909
1911
|
<style>{`
|
|
1910
|
-
|
|
1912
|
+
/* 功能说明视觉层次:主标签醒目、辅助说明更轻(类苹果) */
|
|
1913
|
+
.panel-font-root {
|
|
1914
|
+
font-size: var(--panel-font-px);
|
|
1915
|
+
font-weight: 400;
|
|
1916
|
+
letter-spacing: -0.011em;
|
|
1917
|
+
}
|
|
1918
|
+
.panel-font-root [data-typo="title"] {
|
|
1919
|
+
font-size: calc(var(--panel-font-px) * 1.08) !important;
|
|
1920
|
+
font-weight: 600 !important;
|
|
1921
|
+
letter-spacing: -0.022em;
|
|
1922
|
+
}
|
|
1923
|
+
.panel-font-root [data-typo="label"] {
|
|
1911
1924
|
font-size: var(--panel-font-px) !important;
|
|
1925
|
+
font-weight: 510 !important;
|
|
1926
|
+
letter-spacing: -0.015em;
|
|
1927
|
+
}
|
|
1928
|
+
.panel-font-root [data-typo="caption"] {
|
|
1929
|
+
font-size: calc(var(--panel-font-px) * 0.85) !important;
|
|
1930
|
+
font-weight: 400 !important;
|
|
1931
|
+
letter-spacing: -0.008em;
|
|
1932
|
+
}
|
|
1933
|
+
.panel-font-root [data-typo="micro"] {
|
|
1934
|
+
font-size: calc(var(--panel-font-px) * 0.77) !important;
|
|
1935
|
+
font-weight: 400 !important;
|
|
1912
1936
|
}
|
|
1913
1937
|
/* 画布节点、富文本内容使用各自的字号,不被编辑器 UI 字号强制覆盖 */
|
|
1914
1938
|
.panel-font-root [data-workspace-region="view"] :is(span, label, p, strong, button, input, textarea, select, option, a, li),
|
|
1915
1939
|
.panel-font-root [data-panel-user-text] :is(span, label, p, strong, button, input, textarea, select, option, a, li) {
|
|
1916
1940
|
font-size: inherit !important;
|
|
1941
|
+
font-weight: inherit !important;
|
|
1942
|
+
letter-spacing: inherit !important;
|
|
1917
1943
|
}
|
|
1918
1944
|
.panel-font-root :is(input, textarea):focus,
|
|
1919
1945
|
.panel-font-root :is(input, textarea):focus-visible {
|
|
@@ -1947,7 +1973,7 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
1947
1973
|
box-shadow: 0 0 0 1px hsl(var(--primary) / 0.45) inset !important;
|
|
1948
1974
|
}
|
|
1949
1975
|
`}</style>
|
|
1950
|
-
<nav className="panel-font-root relative z-30 flex items-center gap-2 border-b border-border bg-background/
|
|
1976
|
+
<nav className="panel-font-root relative z-30 flex h-10 shrink-0 items-center gap-2.5 border-b border-border/70 bg-background/80 px-3 text-foreground backdrop-blur-md supports-[backdrop-filter]:bg-background/70">
|
|
1951
1977
|
<PanelMenubar
|
|
1952
1978
|
t={t}
|
|
1953
1979
|
handleExport={handleExport}
|
|
@@ -2001,8 +2027,8 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2001
2027
|
</Button>
|
|
2002
2028
|
</nav>
|
|
2003
2029
|
<ResizablePanelGroup direction="horizontal" className="min-h-0 w-full flex-1">
|
|
2004
|
-
<ResizablePanel defaultSize={
|
|
2005
|
-
<div className="panel-font-root h-full">
|
|
2030
|
+
<ResizablePanel defaultSize={16} minSize={12} maxSize={28}>
|
|
2031
|
+
<div className="panel-font-root h-full min-w-0">
|
|
2006
2032
|
<MaterialSidebar
|
|
2007
2033
|
layers={layers}
|
|
2008
2034
|
allElements={allElements}
|
|
@@ -2073,8 +2099,8 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2073
2099
|
/>
|
|
2074
2100
|
</div>
|
|
2075
2101
|
</ResizablePanel>
|
|
2076
|
-
<ResizableHandle withHandle />
|
|
2077
|
-
<ResizablePanel defaultSize={
|
|
2102
|
+
<ResizableHandle withHandle className="opacity-70 transition-opacity hover:opacity-100" />
|
|
2103
|
+
<ResizablePanel defaultSize={68} minSize={40}>
|
|
2078
2104
|
{/* Center workspace */}
|
|
2079
2105
|
<div
|
|
2080
2106
|
className="panel-font-root min-w-0 h-full"
|
|
@@ -2092,18 +2118,18 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2092
2118
|
clearSelection();
|
|
2093
2119
|
}}
|
|
2094
2120
|
>
|
|
2095
|
-
<div className="relative flex h-full flex-col overflow-hidden
|
|
2121
|
+
<div className="relative flex h-full flex-col overflow-hidden bg-background">
|
|
2096
2122
|
<div
|
|
2097
|
-
className="relative flex items-center gap-2 border-b border-border bg-
|
|
2123
|
+
className="relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-1.5 text-foreground"
|
|
2098
2124
|
style={{ zIndex: PANEL_Z_INDEX.toolbar }}
|
|
2099
2125
|
>
|
|
2100
2126
|
<Input
|
|
2101
2127
|
value={displayProductName}
|
|
2102
2128
|
onChange={(e) => setProductName(e.target.value)}
|
|
2103
2129
|
placeholder={t("panel.menubar.productNamePlaceholder")}
|
|
2104
|
-
className="h-7 w-[
|
|
2130
|
+
className="h-7 w-[200px] rounded-md border-border/70 bg-background/80 text-xs shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none"
|
|
2105
2131
|
/>
|
|
2106
|
-
<span className="text-[11px] text-muted-foreground">{t("panel.menubar.productName")}</span>
|
|
2132
|
+
<span className="hidden text-[11px] text-muted-foreground sm:inline">{t("panel.menubar.productName")}</span>
|
|
2107
2133
|
<TooltipProvider delayDuration={150}>
|
|
2108
2134
|
<Tooltip>
|
|
2109
2135
|
<TooltipTrigger asChild>
|
|
@@ -2238,60 +2264,45 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2238
2264
|
</DropdownMenuContent>
|
|
2239
2265
|
</DropdownMenu>
|
|
2240
2266
|
<div className="flex-1" />
|
|
2241
|
-
<div
|
|
2242
|
-
data-blueprint-toggle
|
|
2243
|
-
className="flex shrink-0 items-center gap-2 rounded-md border border-border bg-muted/30 px-2 py-1"
|
|
2244
|
-
>
|
|
2245
|
-
<span className="text-[11px] text-muted-foreground">{t("panel.menubar.blueprint")}</span>
|
|
2246
|
-
<Switch
|
|
2247
|
-
checked={blueprintOpen}
|
|
2248
|
-
onCheckedChange={setBlueprintOpen}
|
|
2249
|
-
aria-label={t("panel.menubar.showBlueprintPanel")}
|
|
2250
|
-
/>
|
|
2251
|
-
</div>
|
|
2252
2267
|
<TooltipProvider delayDuration={150}>
|
|
2253
|
-
<
|
|
2254
|
-
<
|
|
2255
|
-
<
|
|
2256
|
-
<
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
<div
|
|
2268
|
+
<div className="inline-flex items-center gap-1">
|
|
2269
|
+
<Tooltip>
|
|
2270
|
+
<TooltipTrigger asChild>
|
|
2271
|
+
<button
|
|
2272
|
+
type="button"
|
|
2273
|
+
data-blueprint-toggle
|
|
2274
|
+
onClick={() => setBlueprintOpen((v) => !v)}
|
|
2275
|
+
aria-label={t("panel.menubar.showBlueprintPanel")}
|
|
2276
|
+
aria-pressed={blueprintOpen}
|
|
2263
2277
|
className={[
|
|
2264
|
-
"
|
|
2265
|
-
|
|
2278
|
+
"inline-flex h-7 w-7 items-center justify-center rounded-md border transition-colors",
|
|
2279
|
+
blueprintOpen
|
|
2280
|
+
? "border-primary/50 bg-primary/15 text-primary"
|
|
2281
|
+
: "border-border/70 bg-background/80 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
2266
2282
|
].join(" ")}
|
|
2267
2283
|
>
|
|
2268
|
-
{
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
</div>
|
|
2291
|
-
</div>
|
|
2292
|
-
</TooltipTrigger>
|
|
2293
|
-
<TooltipContent className="z-[10000]">{t("panel.menubar.toggleThemeHint")}</TooltipContent>
|
|
2294
|
-
</Tooltip>
|
|
2284
|
+
<IconBlueprint active={blueprintOpen} />
|
|
2285
|
+
</button>
|
|
2286
|
+
</TooltipTrigger>
|
|
2287
|
+
<TooltipContent className="z-[10000]">
|
|
2288
|
+
{t("panel.menubar.showBlueprintPanel")}
|
|
2289
|
+
</TooltipContent>
|
|
2290
|
+
</Tooltip>
|
|
2291
|
+
<Tooltip>
|
|
2292
|
+
<TooltipTrigger asChild>
|
|
2293
|
+
<button
|
|
2294
|
+
type="button"
|
|
2295
|
+
onClick={() => applyTheme(!isDark)}
|
|
2296
|
+
aria-label={t("panel.menubar.toggleTheme")}
|
|
2297
|
+
aria-pressed={isDark}
|
|
2298
|
+
className="inline-flex h-7 w-7 items-center justify-center rounded-md border border-border/70 bg-background/80 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
2299
|
+
>
|
|
2300
|
+
{isDark ? <IconMoon /> : <IconSun />}
|
|
2301
|
+
</button>
|
|
2302
|
+
</TooltipTrigger>
|
|
2303
|
+
<TooltipContent className="z-[10000]">{t("panel.menubar.toggleThemeHint")}</TooltipContent>
|
|
2304
|
+
</Tooltip>
|
|
2305
|
+
</div>
|
|
2295
2306
|
<Tooltip>
|
|
2296
2307
|
<TooltipTrigger asChild>
|
|
2297
2308
|
<button
|
|
@@ -2304,13 +2315,11 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2304
2315
|
</TooltipTrigger>
|
|
2305
2316
|
<TooltipContent className="z-[10000]">{t("panel.menubar.zoomOutCanvas")}</TooltipContent>
|
|
2306
2317
|
</Tooltip>
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
</span>
|
|
2313
|
-
<TooltipProvider delayDuration={150}>
|
|
2318
|
+
<span className="w-20 text-center text-xs">
|
|
2319
|
+
{zoom.x === zoom.y
|
|
2320
|
+
? `${(zoom.x * 100).toFixed(0)}%`
|
|
2321
|
+
: `${(zoom.x * 100).toFixed(0)}%×${(zoom.y * 100).toFixed(0)}%`}
|
|
2322
|
+
</span>
|
|
2314
2323
|
<Tooltip>
|
|
2315
2324
|
<TooltipTrigger asChild>
|
|
2316
2325
|
<button
|
|
@@ -2742,9 +2751,9 @@ const ReactViewPanelInner = forwardRef<AbuilderViewHandle, ReactViewPanelProps>(
|
|
|
2742
2751
|
</div>
|
|
2743
2752
|
</div>
|
|
2744
2753
|
</ResizablePanel>
|
|
2745
|
-
<ResizableHandle withHandle />
|
|
2746
|
-
<ResizablePanel defaultSize={20} minSize={
|
|
2747
|
-
<div className="panel-font-root h-full">
|
|
2754
|
+
<ResizableHandle withHandle className="opacity-70 transition-opacity hover:opacity-100" />
|
|
2755
|
+
<ResizablePanel defaultSize={20} minSize={16} maxSize={32}>
|
|
2756
|
+
<div className="panel-font-root h-full min-w-0">
|
|
2748
2757
|
<WorkspaceConfigSidebar
|
|
2749
2758
|
configFocus={sidebarConfigFocus}
|
|
2750
2759
|
executionLog={executionLogView}
|
|
@@ -957,7 +957,7 @@ const PanelElementNode = React.memo(function PanelElementNode({
|
|
|
957
957
|
className={[
|
|
958
958
|
"absolute select-none",
|
|
959
959
|
previewMode ? "" : "rv-selectable",
|
|
960
|
-
!previewMode && isSelected ? "
|
|
960
|
+
!previewMode && isSelected ? "rv-node-selected" : "",
|
|
961
961
|
hasViewEvent ? "cursor-pointer" : "",
|
|
962
962
|
].join(" ")}
|
|
963
963
|
data-element-id={el.id}
|