包页面→ /design/shtukbase-ui-html/components/shell/layout-canvas/layout-canvas.html
pages/design/shtukbase-ui-html/components/shell/layout-canvas/layout-canvas.html
22 行, 5.2 KB. 直接打开 (在项目中它旁边还有其他文件,这里可能缺失).
文件按包中的原样显示:代码及其注释不做翻译。
- <!---
- id: layout-canvas
- title: Canvas layout
- level: shell
- description: A page form - a surface with a faint dot grid that pans, zooms and fits; the zoom controls float in the corner, a minimap is optional. Any lens can be a canvas.
- uses: []
- parts: [layout-canvas-viewport, layout-canvas-stage, layout-canvas-controls, layout-canvas-zoom, layout-canvas-minimap]
- states: [default, minimap]
- status: [loading]
- controls:
- grid: {kind: segment, label: Grid, options: [dots, lines, none], default: dots}
- cssProperties: [--layout-canvas-zoom]
- --->
- <template data-state="default">
- <div data-slot="layout-canvas" class="layout-canvas" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><div data-slot="layout-canvas-stage" class="layout-canvas-stage" style="transform: scale(0.9)"><div class="layout-demo-tile" style="position: absolute; left: 40px; top: 40px"><b>Core</b><span>Pages and packages</span></div><div class="layout-demo-tile" style="position: absolute; left: 320px; top: 120px"><b>Lenses</b><span>HTML lenses</span></div></div></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div></div>
- </template>
- <template data-state="minimap">
- <div data-slot="layout-canvas" class="layout-canvas" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><div data-slot="layout-canvas-stage" class="layout-canvas-stage" style="transform: scale(0.9)"><div class="layout-demo-tile" style="position: absolute; left: 40px; top: 40px"><b>Core</b><span>Pages and packages</span></div><div class="layout-demo-tile" style="position: absolute; left: 320px; top: 120px"><b>Lenses</b><span>HTML lenses</span></div></div></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div><div data-slot="layout-canvas-minimap" class="layout-canvas-minimap" aria-hidden="true"><i style="left: 10%; top: 12%; width: 46%; height: 52%"></i></div></div>
- </template>
- <template data-status="loading">
- <div data-slot="layout-canvas" class="layout-canvas" data-status="loading" aria-busy="true" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><p class="layout-note">Drawing the canvas…</p></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div></div>
- </template>