main
html 219 lines 5.95 KB
Raw
1 <html>
2 <head>
3 <script type="module">
4 import { store } from "/plugins/_office/webui/office-store.js";
5 </script>
6 </head>
7 <body>
8 <div x-data>
9 <template x-if="$store.office">
10 <div class="office-panel" x-create="$store.office.onMount($el, xAttrs($el) || {})" x-destroy="$store.office.cleanup()">
11 <div class="office-shell">
12 <div class="office-state-line" x-show="$store.office.message || $store.office.error || $store.office.loading" style="display: none;">
13 <x-icon :class="{ spinning: $store.office.loading }" :name="$store.office.loading ? 'progress_activity' : ($store.office.error ? 'error' : 'check_circle')"></x-icon>
14 <span x-text="$store.office.error || $store.office.message || 'Working'"></span>
15 </div>
16
17 <div class="office-body">
18 <div class="office-empty" x-show="!$store.office.loading" style="display: none;">
19 <div class="office-empty-actions">
20 <button type="button" class="office-icon-button office-command-button" @click="$store.office.runNewMenuAction('open')">
21 <x-icon aria-hidden="true" name="folder_open"></x-icon>
22 <span class="office-button-label">Open</span>
23 </button>
24 <button type="button" class="office-icon-button office-command-button" @click="$store.office.runNewMenuAction('writer')">
25 <x-icon aria-hidden="true" name="description"></x-icon>
26 <span class="office-button-label">Writer</span>
27 </button>
28 <button type="button" class="office-icon-button office-command-button" @click="$store.office.runNewMenuAction('spreadsheet')">
29 <x-icon aria-hidden="true" name="table_chart"></x-icon>
30 <span class="office-button-label">Calc</span>
31 </button>
32 <button type="button" class="office-icon-button office-command-button" @click="$store.office.runNewMenuAction('presentation')">
33 <x-icon aria-hidden="true" name="co_present"></x-icon>
34 <span class="office-button-label">Impress</span>
35 </button>
36 </div>
37 </div>
38 </div>
39 </div>
40 </div>
41 </template>
42 </div>
43
44 <style>
45 .office-panel,
46 .office-shell {
47 display: flex;
48 flex: 1 1 auto;
49 flex-direction: column;
50 width: 100%;
51 height: 100%;
52 min-width: 0;
53 min-height: 0;
54 background: var(--color-background);
55 color: var(--color-text);
56 }
57
58 .office-panel {
59 container-type: inline-size;
60 }
61
62 .modal-inner.office-modal {
63 box-sizing: border-box;
64 width: min(1040px, calc(100vw - 32px));
65 height: min(760px, calc(100vh - 32px));
66 min-width: min(640px, calc(100vw - 16px));
67 min-height: min(460px, calc(100vh - 16px));
68 max-width: none;
69 max-height: none;
70 overflow: hidden;
71 }
72
73 .modal-inner.office-modal .modal-scroll {
74 display: flex;
75 flex: 1 1 auto;
76 min-height: 0;
77 max-height: none;
78 overflow: hidden;
79 padding: 0;
80 }
81
82 .modal-inner.office-modal .modal-header {
83 grid-template-columns: minmax(0, 1fr) auto auto;
84 }
85
86 .office-state-line {
87 display: flex;
88 align-items: center;
89 gap: 8px;
90 border-bottom: 1px solid var(--color-border);
91 padding: 8px 10px;
92 min-width: 0;
93 font-size: 13px;
94 color: var(--color-muted);
95 }
96
97 .office-icon-button {
98 display: inline-flex;
99 align-items: center;
100 justify-content: center;
101 gap: 6px;
102 height: 32px;
103 min-width: 32px;
104 border: 1px solid var(--color-border);
105 border-radius: 6px;
106 background: var(--color-background);
107 color: var(--color-text);
108 cursor: pointer;
109 }
110
111 .office-icon-button:hover:not(:disabled) {
112 background: var(--color-surface);
113 }
114
115 .office-icon-button:disabled {
116 cursor: default;
117 opacity: 0.55;
118 }
119
120 .office-new-menu {
121 position: absolute;
122 top: calc(100% + 6px);
123 right: 0;
124 z-index: 15;
125 display: grid;
126 min-width: 172px;
127 padding: 6px;
128 border: 1px solid var(--color-border);
129 border-radius: 6px;
130 background: var(--color-background);
131 box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
132 }
133
134 .office-new-menu-item {
135 display: flex;
136 align-items: center;
137 gap: 8px;
138 width: 100%;
139 border: 0;
140 border-radius: 5px;
141 background: transparent;
142 color: var(--color-text);
143 padding: 8px;
144 text-align: left;
145 cursor: pointer;
146 }
147
148 .office-new-menu-item:hover {
149 background: var(--color-surface);
150 }
151
152 .office-empty-actions {
153 display: flex;
154 align-items: center;
155 flex-wrap: wrap;
156 gap: 6px;
157 }
158
159 .office-body {
160 display: flex;
161 flex: 1 1 auto;
162 min-height: 0;
163 }
164
165 .office-empty {
166 display: flex;
167 flex: 1 1 auto;
168 align-items: center;
169 justify-content: center;
170 padding: 24px;
171 }
172
173 .office-command-button {
174 min-width: 108px;
175 justify-content: flex-start;
176 padding: 0 10px;
177 }
178
179 .office-header-actions {
180 position: relative;
181 display: inline-flex;
182 align-items: center;
183 }
184
185 .office-header-new-button {
186 display: inline-flex;
187 align-items: center;
188 gap: 4px;
189 height: 32px;
190 border: 1px solid var(--color-border);
191 border-radius: 6px;
192 background: var(--color-background);
193 color: var(--color-text);
194 padding: 0 9px;
195 cursor: pointer;
196 }
197
198 .office-header-actions .office-new-menu {
199 right: 0;
200 }
201
202 @container (max-width: 560px) {
203 .office-state-line {
204 padding: 7px;
205 }
206
207 .office-button-label,
208 .office-header-new-button span:not(.material-symbols-outlined) {
209 display: none;
210 }
211
212 .office-command-button {
213 min-width: 32px;
214 justify-content: center;
215 }
216 }
217 </style>
218 </body>
219 </html>